Skip to contentSkip to conversation

ethdev: add tm cap for private shaper packet mode

PATCH In review Nithin Dabilpuram 10 participants 60 messages Mar 30, 2020 – Sep 14, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ethdev: add tm cap for private shaper packet mode

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +59 -3
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ weight mode supported. Non-zero value indicates wfq weight mode
+	 * is supported and a SP child (even a wfq group) can be configured to
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+
 	/** WRED packet mode support. When non-zero, this parameter indicates
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value indicates
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight calculations.
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same mode
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is set.
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value indicates
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight calculations.
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same mode
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is set.
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array of
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same mode is
+			 * used for private shaper connected to this node if
+			 * tm capability *sched_shaper_private_weight_mode* is
+			 * true.
 			 */
 			int *wfq_weight_mode;
 
Signature · 1 line
2.8.4
#1 lore raw

PATCH 2/2 app/testpmd: add tm non leaf node pktmode command

Add TM command to enable packet mode for all SP children in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

This patch also dumps new tm capabilities "sched_wfq_weight_mode_supported" and "sched_shaper_private_weight_mode".

---
 app/test-pmd/cmdline.c                      |   7 ++
 app/test-pmd/cmdline_tm.c                   | 178 ++++++++++++++++++++++++++++
 app/test-pmd/cmdline_tm.h                   |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  27 +++++
 4 files changed, 213 insertions(+)
app/test-pmd/cmdline.c +7 -0
index a037a55..eba79f1 100644
@@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
 			"       Add port tm nonleaf node.\n\n"
 
+			"add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)"
+			" (priority) (weight) (level_id) (shaper_profile_id)"
+			" (n_sp_priorities) (stats_mask) (n_shared_shapers)"
+			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+			"       Add port tm nonleaf node with pkt mode enabled.\n\n"
+
 			"add port tm leaf node (port_id) (node_id) (parent_node_id)"
 			" (priority) (weight) (level_id) (shaper_profile_id)"
 			" (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
@@ -19583,6 +19589,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,
+	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,
app/test-pmd/cmdline_tm.c +178 -0

202 lines not on this page · raw message

app/test-pmd/cmdline_tm.h +1 -0
index 950cb75..e59c15c 100644
@@ -19,6 +19,7 @@ extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;
 extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;
+extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode;
 extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;
 extern cmdline_parse_inst_t cmd_del_port_tm_node;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +27 -0
index 5bb12a5..9072ed6 100644
@@ -2971,6 +2971,33 @@ where:
 * ``n_shared_shapers``: Number of shared shapers.
 * ``shared_shaper_id``: Shared shaper id.
 
+Add port traffic management hierarchy nonleaf node with packet mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add nonleaf node with packet mode to port traffic management hierarchy::
+
+   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \
+   (priority) (weight) (level_id) (shaper_profile_id) \
+   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
+   [(shared_shaper_0) (shared_shaper_1) ...] \
+
+where:
+
+* ``parent_node_id``: Node ID of the parent.
+* ``priority``: Node priority (highest node priority is zero). This is used by
+  the SP algorithm running on the parent node for scheduling this node.
+* ``weight``: Node weight (lowest weight is one). The node weight is relative
+  to the weight sum of all siblings that have the same priority. It is used by
+  the WFQ algorithm running on the parent node for scheduling this node.
+* ``level_id``: Hierarchy level of the node.
+* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
+  the node.
+* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on
+  all of them.
+* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
+* ``n_shared_shapers``: Number of shared shapers.
+* ``shared_shaper_id``: Shared shaper id.
+
 Add port traffic management hierarchy leaf node
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.8.4
#2 lore raw
In reply to Nithin Dabilpuram

Ping.

Quoted 127 lines · Nithin Dabilpuram

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +59 -3
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ weight mode supported. Non-zero value indicates wfq weight mode
+	 * is supported and a SP child (even a wfq group) can be configured to
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+
 	/** WRED packet mode support. When non-zero, this parameter indicates
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value indicates
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight calculations.
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same mode
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is set.
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value indicates
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight calculations.
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same mode
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is set.
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array of
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same mode is
+			 * used for private shaper connected to this node if
+			 * tm capability *sched_shaper_private_weight_mode* is
+			 * true.
 			 */
 			int *wfq_weight_mode;
 
Signature · 1 line
2.8.4
#3 lore raw
In reply to Nithin Dabilpuram

Hi Nithin,

Quoted 44 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, March 30, 2020 5:00 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62
+++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +1 -0
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ weight mode supported. Non-zero value indicates wfq

weight mode

lib/librte_ethdev/rte_tm.h +1 -0
+	 * is supported and a SP child (even a wfq group) can be configured

to

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 347

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +4 -0
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+

This is incorrect, as the WFQ support, including the weight aspect of WFQ, is already part of the existing set of capabilities: see sched_wfq_weight_max and the other sched_wfq_* capability fields.

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 355

Quoted 8 lines
lib/librte_ethdev/rte_tm.h +8 -0
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+

If I understand your intention correctly, you are trying to introduce packet mode (in addition to the existing byte mode) for (1) scheduler WFQ weights and for (2) shaper rates. Basically, the ability to express WFQ weights in bytes as well as packets, and the ability to express shaper rates in bytes and well as packets. Is this correct?

Assuming yes, we probably need to do it in a slightly different way:
1/ Similar to the WRED packet mode that was introduced by Nikhil Rao's patches a while ago (in addition to WRED's byte mode), see WRED capability and configuration. 2/ Decouple between scheduler and shaper. So we should add sched_* fields and shaper_* fields, but never sched_shaper_*, as it creates a functional dependency that does not exist.

In line with methodology already used for WRED, I suggest:
a) Scheduler WFQ capabilities (TM/level/node): sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported
b) Shaper capabilities (TM/level/node): shaper_rate_packet_mode_supported, shaper_rate_byte_mode_supported.
c) Shaper profile (struct rte_tm_shaper_params): add an integer packet_mode flag with 0 = byte-mode (default) and 1 = packet mode for the values in struct rte_tm_token_bucket.

It is important to note that the API must allow a combination of packet mode and byte mode (for different nodes, not for the same), but an implementation can support either a single mode or both (should be enforced by the driver).

Quoted 24 lines

/** WRED packet mode support. When non-zero, this parameter
indicates

lib/librte_ethdev/rte_tm.h +1 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 588

Quoted 6 lines
lib/librte_ethdev/rte_tm.h +3 -0
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one

See above the comments on TM capabilities.

Quoted 21 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_node_capabilities { · line 784

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +2 -0
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */

See above the comments on the TM capabilities.

Quoted 12 lines
lib/librte_ethdev/rte_tm.h +5 -1
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 

lib/librte_ethdev/rte_tm.h struct rte_tm_wred_params { · line 898

Quoted 10 lines
lib/librte_ethdev/rte_tm.h +6 -1
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 

Comments are not correct, as API should allow a combination of both the packet mode and the byte mode (for different nodes, not for the same node), so both capabilities shaper_rate_packet_mode and shaper_rate_byte_mode can be set. Hence, the comments should not specify a capability, but the fact that these values can specify either byte or packets, depending on a flag elsewhere.

lib/librte_ethdev/rte_tm.h struct rte_tm_node_params { · line 984

Quoted 13 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -1
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same

mode is

lib/librte_ethdev/rte_tm.h +2 -0
+			 * used for private shaper connected to this node if
+			 * tm capability

*sched_shaper_private_weight_mode* is

lib/librte_ethdev/rte_tm.h +1 -0
+			 * true.
 			 */

This comment is incorrect, as sched should not be combined with shaper. The user should select between packet mode and byte mode for the WFQ weight independently of the mode for the shaper rate, although an implementation (driver) should enforce the correct values.

Quoted 4 lines

int *wfq_weight_mode;

--
2.8.4

Regards,
Cristian

#4 lore raw

Hi Cristian,

Thanks for your comments. I have some queries below.

Quoted 45 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

Quoted 40 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, March 30, 2020 5:00 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62
+++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
Quoted 10 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 347

Quoted 8 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** WFQ weight mode supported. Non-zero value indicates wfq

weight mode

lib/librte_ethdev/rte_tm.h +1 -0
+	 * is supported and a SP child (even a wfq group) can be configured

to

lib/librte_ethdev/rte_tm.h +4 -0
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+

This is incorrect, as the WFQ support, including the weight aspect of WFQ, is already part of the existing set of capabilities: see sched_wfq_weight_max and the other sched_wfq_* capability fields

This is a missing capability for an existing functionality.
"struct rte_tm_node_params:nonleaf.wfq_weight_mode" field could be used to toggle between packet-mode or byte-mode for WFQ weights.

The field if NULL also says that mode defaults to byte-mode.

Quoted 11 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 355

Quoted 9 lines
lib/librte_ethdev/rte_tm.h +8 -0
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+

If I understand your intention correctly, you are trying to introduce packet mode (in addition to the existing byte mode) for (1) scheduler WFQ weights and for (2) shaper rates. Basically, the ability to express WFQ weights in bytes as well as packets, and the ability to express shaper rates in bytes and well as packets. Is this correct?

Isn't packet mode for (1) already supported via "struct rte_tm_node_params:nonleaf.wfq_weight_mode" and rte_tm_node_wfq_weight_mode_update() ?

I'm trying to add support for packet-mode for (2).

Quoted 7 lines

Assuming yes, we probably need to do it in a slightly different way:
1/ Similar to the WRED packet mode that was introduced by Nikhil Rao's patches a while ago (in addition to WRED's byte mode), see WRED capability and configuration. 2/ Decouple between scheduler and shaper. So we should add sched_* fields and shaper_* fields, but never sched_shaper_*, as it creates a functional dependency that does not exist.

In line with methodology already used for WRED, I suggest:
a) Scheduler WFQ capabilities (TM/level/node): sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported

I'll add "sched_wfq_packet_mode_supported" field.

Since currently when "struct rte_tm_node_params:nonleaf.wfq_weight_mode" is NULL, mode defaults to byte mode, is it needed to have "sched_wfq_byte_mode_supported" ? Or I should also update the text in "struct rte_tm_node_params" ?

Quoted 1 line

b) Shaper capabilities (TM/level/node): shaper_rate_packet_mode_supported, shaper_rate_byte_mode_supported.

Ack.

Quoted 1 line

c) Shaper profile (struct rte_tm_shaper_params): add an integer packet_mode flag with 0 = byte-mode (default) and 1 = packet mode for the values in struct rte_tm_token_bucket.

Ok. I'll add a field "packet-mode" in rte_tm_shaper_params and enforce restrictions in PMD.

Quoted 77 lines

It is important to note that the API must allow a combination of packet mode and byte mode (for different nodes, not for the same), but an implementation can support either a single mode or both (should be enforced by the driver).

Quoted 24 lines

/** WRED packet mode support. When non-zero, this parameter
indicates

lib/librte_ethdev/rte_tm.h +1 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 588

Quoted 6 lines
lib/librte_ethdev/rte_tm.h +3 -0
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one

See above the comments on TM capabilities.

Quoted 21 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_node_capabilities { · line 784

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +2 -0
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */

See above the comments on the TM capabilities.

Quoted 12 lines
lib/librte_ethdev/rte_tm.h +5 -1
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 
Quoted 12 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_wred_params { · line 898

Quoted 10 lines
lib/librte_ethdev/rte_tm.h +6 -1
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 

Comments are not correct, as API should allow a combination of both the packet mode and the byte mode (for different nodes, not for the same node), so both capabilities shaper_rate_packet_mode and shaper_rate_byte_mode can be set. Hence, the comments should not specify a capability, but the fact that these values can specify either byte or packets, depending on a flag elsewhere.

Ok. As per your above comment I'll add field "packet-mode" in "struct rte_tm_shaper_params" and update this comment accordingly.

Quoted 25 lines
Quoted 12 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -1
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same

mode is

lib/librte_ethdev/rte_tm.h +2 -0
+			 * used for private shaper connected to this node if
+			 * tm capability

*sched_shaper_private_weight_mode* is

lib/librte_ethdev/rte_tm.h struct rte_tm_node_params { · line 984

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +1 -0
+			 * true.
 			 */

This comment is incorrect, as sched should not be combined with shaper. The user should select between packet mode and byte mode for the WFQ weight independently of the mode for the shaper rate, although an implementation (driver) should enforce the correct values.

Quoted 4 lines

int *wfq_weight_mode;

--
2.8.4

Regards,
Cristian

#5 lore raw
Quoted 77 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Tuesday, April 7, 2020 6:21 PM
To: Dumitrescu, Cristian <[email protected]>
Cc: Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] RE: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Hi Cristian,

Thanks for your comments. I have some queries below.

Quoted 9 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

Quoted 4 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, March 30, 2020 5:00 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas

Monjalon

Quoted 1 line
Quoted 1 line

<[email protected]>; Yigit, Ferruh <[email protected]>;

Andrew

Quoted 35 lines
Quoted 35 lines

Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62
+++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
Quoted 10 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 347

Quoted 8 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** WFQ weight mode supported. Non-zero value indicates wfq

weight mode

lib/librte_ethdev/rte_tm.h +1 -0
+	 * is supported and a SP child (even a wfq group) can be configured

to

lib/librte_ethdev/rte_tm.h +4 -0
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+

This is incorrect, as the WFQ support, including the weight aspect of WFQ, is

already part of the existing set of capabilities: see sched_wfq_weight_max and the other sched_wfq_* capability fields

Quoted 7 lines

This is a missing capability for an existing functionality. "struct rte_tm_node_params:nonleaf.wfq_weight_mode" field could be used to toggle between
packet-mode or byte-mode for WFQ weights.

The field if NULL also says that mode defaults to byte-mode.

This capability field should be split into sched_wfq_weight_byte_mode_supported and sched_wfq_weight_packet_mode_supported.

I agree that both of these modes are already supported by the API, but not explicitly mentioned in capability structure, so I think it makes sense to add them to capabilities too. We should have the same look & feel for all the features that accept byte mode and packet mode, i.e. WFQ weight, shaper rate, WRED thresholds. Makes sense?

Quoted 16 lines
Quoted 11 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 355

Quoted 9 lines
lib/librte_ethdev/rte_tm.h +8 -0
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+

If I understand your intention correctly, you are trying to introduce packet

mode (in addition to the existing byte mode) for (1) scheduler WFQ weights and for (2) shaper rates. Basically, the ability to express WFQ weights in bytes as well as packets, and the ability to express shaper rates in bytes and well as packets. Is this correct?

Quoted 6 lines

Isn't packet mode for (1) already supported via "struct rte_tm_node_params:nonleaf.wfq_weight_mode" and rte_tm_node_wfq_weight_mode_update() ?

I'm trying to add support for packet-mode for (2).

See previous note.

Quoted 13 lines
Quoted 3 lines

Assuming yes, we probably need to do it in a slightly different way:
1/ Similar to the WRED packet mode that was introduced by Nikhil Rao's

patches a while ago (in addition to WRED's byte mode), see WRED capability and configuration.

Quoted 1 line

2/ Decouple between scheduler and shaper. So we should add sched_*

fields and shaper_* fields, but never sched_shaper_*, as it creates a functional dependency that does not exist.

Quoted 3 lines

In line with methodology already used for WRED, I suggest:
a) Scheduler WFQ capabilities (TM/level/node):

sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported

Quoted 8 lines

I'll add "sched_wfq_packet_mode_supported" field.

Since currently when "struct rte_tm_node_params:nonleaf.wfq_weight_mode" is NULL, mode defaults to byte mode, is it needed to have "sched_wfq_byte_mode_supported" ?
Or I should also update the text in "struct rte_tm_node_params" ?

See previous comment. Yes, it makes sense to add both sched_wfq_weight_byte_mode_supported and sched_wfq_weight_packet_mode_supported to capabilities structure, even though they refer to features already supported by the API. We should have the same look 7 feel for all features that support byte mode and packet mode.

Quoted 5 lines
Quoted 2 lines

b) Shaper capabilities (TM/level/node):

shaper_rate_packet_mode_supported,
shaper_rate_byte_mode_supported.
Ack.

OK, great.

Quoted 6 lines
Quoted 1 line

c) Shaper profile (struct rte_tm_shaper_params): add an integer

packet_mode flag with 0 = byte-mode (default) and 1 = packet mode for the values in struct rte_tm_token_bucket.

Ok. I'll add a field "packet-mode" in rte_tm_shaper_params and enforce restrictions in PMD.

OK, great.

Quoted 92 lines
Quoted 2 lines

It is important to note that the API must allow a combination of packet

mode and byte mode (for different nodes, not for the same), but an implementation can support either a single mode or both (should be enforced by the driver).

Quoted 75 lines
Quoted 25 lines

/** WRED packet mode support. When non-zero, this parameter
indicates

lib/librte_ethdev/rte_tm.h +1 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 588

Quoted 6 lines
lib/librte_ethdev/rte_tm.h +3 -0
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one

See above the comments on TM capabilities.

Quoted 21 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_node_capabilities { · line 784

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +2 -0
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */

See above the comments on the TM capabilities.

Quoted 12 lines
lib/librte_ethdev/rte_tm.h +5 -1
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 
Quoted 12 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_wred_params { · line 898

Quoted 10 lines
lib/librte_ethdev/rte_tm.h +6 -1
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 

Comments are not correct, as API should allow a combination of both the

Quoted 8 lines

packet mode and the byte mode (for different nodes, not for the same node), so both capabilities shaper_rate_packet_mode and shaper_rate_byte_mode can be set. Hence, the comments should not specify a capability, but the fact that these values can specify either byte or packets, depending on a flag elsewhere.

Ok. As per your above comment I'll add field "packet-mode" in "struct rte_tm_shaper_params" and update this comment accordingly.

OK, great.

Quoted 28 lines
Quoted 16 lines
Quoted 12 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -1
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same

mode is

lib/librte_ethdev/rte_tm.h +2 -0
+			 * used for private shaper connected to this node if
+			 * tm capability

*sched_shaper_private_weight_mode* is

lib/librte_ethdev/rte_tm.h struct rte_tm_node_params { · line 984

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +1 -0
+			 * true.
 			 */

This comment is incorrect, as sched should not be combined with shaper.

The user should select between packet mode and byte mode for the WFQ weight independently of the mode for the shaper rate, although an implementation (driver) should enforce the correct values.

Quoted 9 lines
Quoted 5 lines

int *wfq_weight_mode;

--
2.8.4

Regards,
Cristian

#6 lore raw

Thanks Cristian. Agree with your comments, Will send a v2 addressing them.

Quoted 286 lines · Cristian
Quoted 77 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Tuesday, April 7, 2020 6:21 PM
To: Dumitrescu, Cristian <[email protected]>
Cc: Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] RE: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Hi Cristian,

Thanks for your comments. I have some queries below.

Quoted 9 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

Quoted 4 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, March 30, 2020 5:00 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas

Monjalon

Quoted 1 line
Quoted 1 line

<[email protected]>; Yigit, Ferruh <[email protected]>;

Andrew

Quoted 35 lines
Quoted 35 lines

Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH 1/2] ethdev: add tm cap for private shaper packet mode

Some NIC hardware have private shaper attached to
every node and has a limitation where packet mode is applied both to the scheduling of a node's children using WFQ and shaping of traffic out of the private shaper.
This cannot be expressed using existing capabilities or configurations.

So this patch adds a tm capability that if set by a PMD implies that packet mode when configured is even applied to private shaper connected to that node. This also implies the limitation that all the SP children of that node should have same mode at any point of time i.e either packet mode or byte mode and same applies to private shaper in that NIC PMD.

This patch also adds missing capability that tells whether PMD supports wfq weight mode or not.

---
 lib/librte_ethdev/rte_tm.h | 62
+++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 59 insertions(+), 3 deletions(-)
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..50bcea6 100644
@@ -339,6 +339,20 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
Quoted 10 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 347

Quoted 8 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** WFQ weight mode supported. Non-zero value indicates wfq

weight mode

lib/librte_ethdev/rte_tm.h +1 -0
+	 * is supported and a SP child (even a wfq group) can be configured

to

lib/librte_ethdev/rte_tm.h +4 -0
+	 * use packet-mode or byte-mode for weight calculations.
+	 */
+	int sched_wfq_weight_mode_supported;
+

This is incorrect, as the WFQ support, including the weight aspect of WFQ, is

already part of the existing set of capabilities: see sched_wfq_weight_max and the other sched_wfq_* capability fields

Quoted 7 lines

This is a missing capability for an existing functionality. "struct rte_tm_node_params:nonleaf.wfq_weight_mode" field could be used to toggle between
packet-mode or byte-mode for WFQ weights.

The field if NULL also says that mode defaults to byte-mode.

This capability field should be split into sched_wfq_weight_byte_mode_supported and sched_wfq_weight_packet_mode_supported.

I agree that both of these modes are already supported by the API, but not explicitly mentioned in capability structure, so I think it makes sense to add them to capabilities too. We should have the same look & feel for all the features that accept byte mode and packet mode, i.e. WFQ weight, shaper rate, WRED thresholds. Makes sense?

Quoted 16 lines
Quoted 11 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 355

Quoted 9 lines
lib/librte_ethdev/rte_tm.h +8 -0
+	/** Private shaper and scheduler weight mode.
+	 * When non-zero value indicates that all SP children should have
+	 * same weight mode and the same mode applies to private
+	 * shaper as well. This is only valid if
+	 * *sched_wfq_weight_mode_supported* is set.
+	 */
+	int sched_shaper_private_weight_mode;
+

If I understand your intention correctly, you are trying to introduce packet

mode (in addition to the existing byte mode) for (1) scheduler WFQ weights and for (2) shaper rates. Basically, the ability to express WFQ weights in bytes as well as packets, and the ability to express shaper rates in bytes and well as packets. Is this correct?

Quoted 6 lines

Isn't packet mode for (1) already supported via "struct rte_tm_node_params:nonleaf.wfq_weight_mode" and rte_tm_node_wfq_weight_mode_update() ?

I'm trying to add support for packet-mode for (2).

See previous note.

Quoted 13 lines
Quoted 3 lines

Assuming yes, we probably need to do it in a slightly different way:
1/ Similar to the WRED packet mode that was introduced by Nikhil Rao's

patches a while ago (in addition to WRED's byte mode), see WRED capability and configuration.

Quoted 1 line

2/ Decouple between scheduler and shaper. So we should add sched_*

fields and shaper_* fields, but never sched_shaper_*, as it creates a functional dependency that does not exist.

Quoted 3 lines

In line with methodology already used for WRED, I suggest:
a) Scheduler WFQ capabilities (TM/level/node):

sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported

Quoted 8 lines

I'll add "sched_wfq_packet_mode_supported" field.

Since currently when "struct rte_tm_node_params:nonleaf.wfq_weight_mode" is NULL, mode defaults to byte mode, is it needed to have "sched_wfq_byte_mode_supported" ?
Or I should also update the text in "struct rte_tm_node_params" ?

See previous comment. Yes, it makes sense to add both sched_wfq_weight_byte_mode_supported and sched_wfq_weight_packet_mode_supported to capabilities structure, even though they refer to features already supported by the API. We should have the same look 7 feel for all features that support byte mode and packet mode.

Quoted 5 lines
Quoted 2 lines

b) Shaper capabilities (TM/level/node):

shaper_rate_packet_mode_supported,
shaper_rate_byte_mode_supported.
Ack.

OK, great.

Quoted 6 lines
Quoted 1 line

c) Shaper profile (struct rte_tm_shaper_params): add an integer

packet_mode flag with 0 = byte-mode (default) and 1 = packet mode for the values in struct rte_tm_token_bucket.

Ok. I'll add a field "packet-mode" in rte_tm_shaper_params and enforce restrictions in PMD.

OK, great.

Quoted 92 lines
Quoted 2 lines

It is important to note that the API must allow a combination of packet

mode and byte mode (for different nodes, not for the same), but an implementation can support either a single mode or both (should be enforced by the driver).

Quoted 75 lines
Quoted 25 lines

/** WRED packet mode support. When non-zero, this parameter
indicates

lib/librte_ethdev/rte_tm.h +1 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -554,6 +568,21 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 588

Quoted 6 lines
lib/librte_ethdev/rte_tm.h +3 -0
+			 */
+			int sched_shaper_private_weight_mode;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one

See above the comments on TM capabilities.

Quoted 21 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +764,21 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ weight mode supported. Non-zero value

indicates

lib/librte_ethdev/rte_tm.h +3 -0
+			 * wfq weight mode is supported and a SP child
+			 * (even a wfq group) can be configured to use
+			 * packet-mode or byte-mode for weight

calculations.

lib/librte_ethdev/rte_tm.h +6 -0
+			 */
+			int sched_wfq_weight_mode_supported;
+
+			/** Private shaper and scheduler weight mode.
+			 * When non-zero value indicates that all SP children
+			 * should have same weight mode and the same

mode

lib/librte_ethdev/rte_tm.h +2 -0
+			 * applies to private shaper as well. This is only
+			 * valid if *sched_wfq_weight_mode_supported* is

set.

lib/librte_ethdev/rte_tm.h struct rte_tm_node_capabilities { · line 784

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +2 -0
+			 */
+			int sched_shaper_private_weight_mode;
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */

See above the comments on the TM capabilities.

Quoted 12 lines
lib/librte_ethdev/rte_tm.h +5 -1
@@ -836,10 +880,19 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate. This is in "bytes per second" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets per second".
+	 */
 	uint64_t rate;
 
Quoted 12 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_wred_params { · line 898

Quoted 10 lines
lib/librte_ethdev/rte_tm.h +6 -1
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size, a.k.a. max burst size.
+	 * This is in "bytes" by default.
+	 * For private shaper attached to node that is set in packet mode
+	 * and tm capability *sched_shaper_private_weight_mode* is set,
+	 * this is interpreted as "packets".
+	 */
 	uint64_t size;
 };
 

Comments are not correct, as API should allow a combination of both the

Quoted 8 lines

packet mode and the byte mode (for different nodes, not for the same node), so both capabilities shaper_rate_packet_mode and shaper_rate_byte_mode can be set. Hence, the comments should not specify a capability, but the fact that these values can specify either byte or packets, depending on a flag elsewhere.

Ok. As per your above comment I'll add field "packet-mode" in "struct rte_tm_shaper_params" and update this comment accordingly.

OK, great.

Quoted 28 lines
Quoted 16 lines
Quoted 12 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -924,7 +977,10 @@ struct rte_tm_node_params {
 			 * indicates that WFQ is to be used for all priorities.
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -1
 			 * *n_sp_priorities* values, with non-zero value for
-			 * byte-mode and zero for packet-mode.
+			 * byte-mode and zero for packet-mode. The same

mode is

lib/librte_ethdev/rte_tm.h +2 -0
+			 * used for private shaper connected to this node if
+			 * tm capability

*sched_shaper_private_weight_mode* is

lib/librte_ethdev/rte_tm.h struct rte_tm_node_params { · line 984

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +1 -0
+			 * true.
 			 */

This comment is incorrect, as sched should not be combined with shaper.

The user should select between packet mode and byte mode for the WFQ weight independently of the mode for the shaper rate, although an implementation (driver) should enforce the correct values.

Quoted 9 lines
Quoted 5 lines

int *wfq_weight_mode;

--
2.8.4

Regards,
Cristian

#7 lore raw

PATCH v2 1/4 ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

---

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 lib/librte_ethdev/rte_tm.h | 156 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 154 insertions(+), 2 deletions(-)
lib/librte_ethdev/rte_tm.h +154 -2
index f9c0cf3..38fff4c 100644
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this parameter
+	 * indicates that there is atleast one node that can be configured
+	 * with packet mode in it's private shaper. When shaper is configured
+	 * in packet mode, committed/peak rate provided is interpreted
+	 * in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this parameter
+	 * indicates that there is atleast one node that can be configured
+	 * with byte mode in it's private shaper. When shaper is configured
+	 * in byte mode, committed/peak rate provided is interpreted in
+	 * bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
+
 	/** Maximum number of shared shapers. The value of zero indicates that
 	 * shared shapers are not supported.
 	 */
@@ -284,6 +301,21 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_shared_rate_max;
 
+	/** Shaper shared packet mode supported. When non-zero, this parameter
+	 * indicates a shared shaper can be configured with packet mode.
+	 * When shared shaper is configured in packet mode, committed/peak rate
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_shared_packet_mode_supported;
+
+	/** Shaper shared byte mode supported. When non-zero, this parameter
+	 * indicates that a shared shaper can be configured with byte mode.
+	 * When shared shaper is configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_shared_byte_mode_supported;
+
+
 	/** Minimum value allowed for packet length adjustment for any private
 	 * or shared shaper.
 	 */
@@ -339,6 +371,22 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ packet mode supported. When non-zero, this parameter indicates
+	 * that there is at least one non-leaf node that supports packet mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * packet count for scheduling children when a non-leaf node
+	 * is configured appropriately.
+	 */
+	int sched_wfq_packet_mode_supported;
+
+	/** WFQ byte mode supported. When non-zero, this parameter indicates
+	 * that there is at least one non-leaf node that supports byte mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * bytes for scheduling children when a non-leaf node is configured
+	 * appropriately.
+	 */
+	int sched_wfq_byte_mode_supported;
+
 	/** WRED packet mode support. When non-zero, this parameter indicates
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -485,6 +533,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When non-zero,
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with packet mode in its private shaper. When private
+			 * shaper is configured in packet mode, committed/peak
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When non-zero,
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with byte mode in its private shaper. When private
+			 * shaper is configured in byte mode, committed/peak
+			 * rate provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any non-leaf
 			 * node on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -554,6 +620,25 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ packet mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports packet
+			 * mode for WFQ among its children. WFQ weights will
+			 * be applied against packet count for scheduling
+			 * children when a non-leaf node is configured
+			 * appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports byte
+			 * mode for WFQ among its children. WFQ weights will
+			 * be applied against bytes for scheduling children
+			 * when a non-leaf node is configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -596,6 +681,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When non-zero,
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * packet mode in its private shaper. When private
+			 * shaper is configured in packet mode, committed/peak
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When non-zero,
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * byte mode in its private shaper. When private shaper
+			 * is configured in byte mode, committed/peak rate
+			 * provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any leaf node
 			 * on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -686,6 +789,20 @@ struct rte_tm_node_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this parameter
+	 * indicates private shaper of current node can be configured with
+	 * packet mode. When configured in packet mode, committed/peak rate
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this parameter
+	 * indicates private shaper of current node can be configured with
+	 * byte mode. When configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
 	/** Maximum number of shared shapers the current node can be part of.
 	 * The value of zero indicates that shared shapers are not supported by
 	 * the current node.
@@ -735,6 +852,23 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ packet mode supported. When non-zero, this
+			 * parameter indicates that current node supports packet
+			 * mode for WFQ among its children. WFQ weights will be
+			 * applied against packet count for scheduling children
+			 * when configured appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that current node supports byte
+			 * mode for WFQ among its children. WFQ weights will be
+			 * applied against  bytes for scheduling children when
+			 * configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +970,10 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate (bytes per second or packets per second) */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size (bytes or packets), a.k.a. max burst size */
 	uint64_t size;
 };
 
@@ -860,6 +994,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets. The
  * rate of the peak bucket has to be bigger than zero, as well as greater than
  * or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported
  */
 struct rte_tm_shaper_params {
 	/** Committed token bucket */
@@ -874,6 +1013,17 @@ struct rte_tm_shaper_params {
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet mode and
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively. In
+	 * packet mode, *pkt_length_adjust* is ignored.
+	 */
+	int packet_mode;
 };
 
 /**
@@ -925,6 +1075,8 @@ struct rte_tm_node_params {
 			 * When non-NULL, it points to a pre-allocated array of
 			 * *n_sp_priorities* values, with non-zero value for
 			 * byte-mode and zero for packet-mode.
+			 * @see struct rte_tm_node_capabilities::sched_wfq_packet_mode_supported
+			 * @see struct rte_tm_node_capabilities::sched_wfq_byte_mode_supported
 			 */
 			int *wfq_weight_mode;
 
Signature · 1 line
2.8.4
#8 lore raw

PATCH v2 2/4 drivers/net: update tm capability for existing pmds

From: Nithin Dabilpuram <[email protected]>

Since existing PMD's support shaper byte mode and scheduler wfq byte mode, update the same in their port/level/node capabilities that are added.

---
v1..v2:
- Newly included patch to change exiting pmd's with tm support of byte mode to show the same in port/level/node cap.

 drivers/net/i40e/i40e_tm.c               | 16 ++++++++++++
 drivers/net/ipn3ke/ipn3ke_tm.c           | 26 ++++++++++++++++++
 drivers/net/ixgbe/ixgbe_tm.c             | 16 ++++++++++++
 drivers/net/mvpp2/mrvl_tm.c              | 14 ++++++++++
 drivers/net/softnic/rte_eth_softnic_tm.c | 45 ++++++++++++++++++++++++++++++++
 5 files changed, 117 insertions(+)
drivers/net/i40e/i40e_tm.c +16 -0
index c76760c..ab272e9 100644
@@ -160,12 +160,16 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->func_caps.num_tx_qp;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -179,6 +183,8 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	 * So, all the nodes should have the same weight.
 	 */
 	cap->sched_wfq_weight_max = 1;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	cap->cman_head_drop_supported = 0;
 	cap->dynamic_update_mask = 0;
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD;
@@ -754,6 +760,8 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 40Gbps -> 5GBps */
 		cap->nonleaf.shaper_private_rate_max = 5000000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
 		if (level_id == I40E_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
@@ -765,6 +773,8 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -776,6 +786,8 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->leaf.shaper_private_rate_max = 5000000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
@@ -817,6 +829,8 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 
 	if (node_type == I40E_TM_NODE_TYPE_QUEUE) {
@@ -834,6 +848,8 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/ipn3ke/ipn3ke_tm.c +26 -0
index 5a16c5f..35c90b8 100644
@@ -440,6 +440,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_private_dual_rate_n_max = 0;
 	cap->shaper_private_rate_min = 1;
 	cap->shaper_private_rate_max = 1 + IPN3KE_TM_VT_NODE_NUM;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
@@ -447,6 +449,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
 	cap->shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
@@ -456,6 +460,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->sched_wfq_n_children_per_group_max = UINT32_MAX;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = UINT32_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->cman_wred_packet_mode_supported = 0;
 	cap->cman_wred_byte_mode_supported = 0;
@@ -517,6 +523,8 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
@@ -524,6 +532,8 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -539,6 +549,8 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
@@ -546,6 +558,8 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -561,6 +575,8 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_dual_rate_supported = 0;
 		cap->leaf.shaper_private_rate_min = 0;
 		cap->leaf.shaper_private_rate_max = 0;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.shaper_shared_n_max = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
@@ -632,6 +648,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
@@ -640,6 +658,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -649,6 +669,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
@@ -657,6 +679,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -666,6 +690,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 0;
 		cap->shaper_private_rate_max = 0;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 0;
 		cap->shaper_shared_n_max = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
drivers/net/ixgbe/ixgbe_tm.c +16 -0
index 73845a7..c067109 100644
@@ -168,12 +168,16 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->mac.max_tx_queues;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -182,6 +186,8 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->sched_sp_n_priorities_max = 1;
 	cap->sched_wfq_n_children_per_group_max = 0;
 	cap->sched_wfq_n_groups_max = 0;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	/**
 	 * SW only supports fair round robin now.
 	 * So, all the nodes should have the same weight.
@@ -875,6 +881,8 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 10Gbps -> 1.25GBps */
 		cap->nonleaf.shaper_private_rate_max = 1250000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
 		if (level_id == IXGBE_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
@@ -886,6 +894,8 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -897,6 +907,8 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->leaf.shaper_private_rate_max = 1250000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
@@ -938,6 +950,8 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 
 	if (node_type == IXGBE_TM_NODE_TYPE_QUEUE) {
@@ -955,6 +969,8 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/mvpp2/mrvl_tm.c +14 -0
index 3de8997..e98f576 100644
@@ -193,12 +193,16 @@ mrvl_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_n_max = cap->shaper_n_max;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->sched_n_children_max = dev->data->nb_tx_queues;
 	cap->sched_sp_n_priorities_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_children_per_group_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask = RTE_TM_UPDATE_NODE_SUSPEND_RESUME |
 				   RTE_TM_UPDATE_NODE_STATS;
@@ -244,6 +248,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_supported = 1;
 		cap->nonleaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->nonleaf.shaper_private_rate_max = priv->rate_max;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -251,6 +257,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->nonleaf.stats_mask = RTE_TM_STATS_N_PKTS |
 					  RTE_TM_STATS_N_BYTES;
 	} else { /* level_id == MRVL_NODE_QUEUE */
@@ -261,6 +269,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_supported = 1;
 		cap->leaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->leaf.shaper_private_rate_max = priv->rate_max;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.stats_mask = RTE_TM_STATS_N_PKTS;
 	}
 
@@ -300,6 +310,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 	cap->shaper_private_supported = 1;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	if (node->type == MRVL_NODE_PORT) {
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
@@ -308,6 +320,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->stats_mask = RTE_TM_STATS_N_PKTS | RTE_TM_STATS_N_BYTES;
 	} else {
 		cap->stats_mask = RTE_TM_STATS_N_PKTS;
drivers/net/softnic/rte_eth_softnic_tm.c +45 -0

174 lines not on this page · raw message

Signature · 1 line
2.8.4
#9 lore raw

PATCH v2 3/4 app/testpmd: add tm cmd for non leaf and shaper pktmode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Add TM command to enable packet mode for all SP children in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

Also add support to shaper profile add command to take packet mode parameter used to setup shaper in packet mode. This adds an extra argument "packet_mode" to shaper profile add command "add port tm node shaper profile" as last argument.

This patch also dumps new tm port/level/node capabilities sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported, shaper_private_packet_mode_supported, shaper_private_byte_mode_supported, shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.

---
v1..v2:
- Update tm capability show cmd to dump lastest pktmode/bytemode fields of v2.
- Update existing shaper profile add command to take last argument as pkt_mode and update struct rte_tm_shaper_params:packet_mode with the same.
- Update documentation with latest command changes.

 app/test-pmd/cmdline.c                      |   9 +-
 app/test-pmd/cmdline_tm.c                   | 206 ++++++++++++++++++++++++++++
 app/test-pmd/cmdline_tm.h                   |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  40 +++++-
 4 files changed, 250 insertions(+), 6 deletions(-)
app/test-pmd/cmdline.c +8 -1
index 863b567..af90242 100644
@@ -1189,7 +1189,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"add port tm node shaper profile (port_id) (shaper_profile_id)"
 			" (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)"
-			" (packet_length_adjust)\n"
+			" (packet_length_adjust) (packet_mode)\n"
 			"       Add port tm node private shaper profile.\n\n"
 
 			"del port tm node shaper profile (port_id) (shaper_profile_id)\n"
@@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
 			"       Add port tm nonleaf node.\n\n"
 
+			"add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)"
+			" (priority) (weight) (level_id) (shaper_profile_id)"
+			" (n_sp_priorities) (stats_mask) (n_shared_shapers)"
+			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+			"       Add port tm nonleaf node with pkt mode enabled.\n\n"
+
 			"add port tm leaf node (port_id) (node_id) (parent_node_id)"
 			" (priority) (weight) (level_id) (shaper_profile_id)"
 			" (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
@@ -19636,6 +19642,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,
+	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,
app/test-pmd/cmdline_tm.c +206 -0

284 lines not on this page · raw message

app/test-pmd/cmdline_tm.h +1 -0
index 950cb75..e59c15c 100644
@@ -19,6 +19,7 @@ extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;
 extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;
+extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode;
 extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;
 extern cmdline_parse_inst_t cmd_del_port_tm_node;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +35 -5
index dcee5de..a058f75 100644
@@ -2840,19 +2840,22 @@ Add the port traffic management private shaper profile::
 
    testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \
    (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \
-   (packet_length_adjust)
+   (packet_length_adjust) (packet_mode)
 
 where:
 
 * ``shaper_profile id``: Shaper profile ID for the new profile.
-* ``cmit_tb_rate``: Committed token bucket rate (bytes per second).
-* ``cmit_tb_size``: Committed token bucket size (bytes).
-* ``peak_tb_rate``: Peak token bucket rate (bytes per second).
-* ``peak_tb_size``: Peak token bucket size (bytes).
+* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second).
+* ``cmit_tb_size``: Committed token bucket size (bytes or packets).
+* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second).
+* ``peak_tb_size``: Peak token bucket size (bytes or packets).
 * ``packet_length_adjust``: The value (bytes) to be added to the length of
   each packet for the purpose of shaping. This parameter value can be used to
   correct the packet length with the framing overhead bytes that are consumed
   on the wire.
+* ``packet_mode``: Shaper configured in packet mode. This parameter value if
+  zero, configures shaper in byte mode and if non-zero configures it in packet
+  mode.
 
 Delete port traffic management private shaper profile
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2977,6 +2980,33 @@ where:
 * ``n_shared_shapers``: Number of shared shapers.
 * ``shared_shaper_id``: Shared shaper id.
 
+Add port traffic management hierarchy nonleaf node with packet mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add nonleaf node with packet mode to port traffic management hierarchy::
+
+   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \
+   (priority) (weight) (level_id) (shaper_profile_id) \
+   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
+   [(shared_shaper_0) (shared_shaper_1) ...] \
+
+where:
+
+* ``parent_node_id``: Node ID of the parent.
+* ``priority``: Node priority (highest node priority is zero). This is used by
+  the SP algorithm running on the parent node for scheduling this node.
+* ``weight``: Node weight (lowest weight is one). The node weight is relative
+  to the weight sum of all siblings that have the same priority. It is used by
+  the WFQ algorithm running on the parent node for scheduling this node.
+* ``level_id``: Hierarchy level of the node.
+* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
+  the node.
+* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on
+  all of them.
+* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
+* ``n_shared_shapers``: Number of shared shapers.
+* ``shared_shaper_id``: Shared shaper id.
+
 Add port traffic management hierarchy leaf node
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.8.4
#10 lore raw

PATCH v2 4/4 net/octeontx2: support tm length adjust and pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

This patch adds support to packet length adjust TM feature for private shaper. It also adds support to packet mode feature that applies both to private shaper and node DWRR scheduling of SP children.

---
v1..v2:
- Newly included patch.

 drivers/net/octeontx2/otx2_tm.c | 140 +++++++++++++++++++++++++++++++++-------
 drivers/net/octeontx2/otx2_tm.h |   5 ++
 2 files changed, 122 insertions(+), 23 deletions(-)
drivers/net/octeontx2/otx2_tm.c +117 -23
index f94618d..fa7d21b 100644
@@ -336,18 +336,25 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 {
 	struct shaper_params cir, pir;
 	uint32_t schq = tm_node->hw_id;
+	uint64_t adjust = 0;
 	uint8_t k = 0;
 
 	memset(&cir, 0, sizeof(cir));
 	memset(&pir, 0, sizeof(pir));
 	shaper_config_to_nix(profile, &cir, &pir);
 
-	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, "
-		    "pir %" PRIu64 "(%" PRIu64 "B),"
-		     " cir %" PRIu64 "(%" PRIu64 "B) (%p)",
-		     nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
-		     tm_node->id, pir.rate, pir.burst,
-		     cir.rate, cir.burst, tm_node);
+	/* Packet length adjust */
+	if (tm_node->pkt_mode)
+		adjust = 1;
+	else if (profile)
+		adjust = profile->params.pkt_length_adjust & 0x1FF;
+
+	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, pir %" PRIu64
+		    "(%" PRIu64 "B), cir %" PRIu64 "(%" PRIu64 "B)"
+		    "adjust 0x%" PRIx64 "(pktmode %u) (%p)",
+		    nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
+		    tm_node->id, pir.rate, pir.burst, cir.rate, cir.burst,
+		    adjust, tm_node->pkt_mode, tm_node);
 
 	switch (tm_node->hw_lvl) {
 	case NIX_TXSCH_LVL_SMQ:
@@ -364,7 +371,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED ALG */
 		reg[k] = NIX_AF_MDQX_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL4:
@@ -381,7 +390,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL4X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL3:
@@ -398,7 +409,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL3X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -416,7 +429,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL2X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -426,6 +441,12 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 		regval[k] = (cir.rate && cir.burst) ?
 				(shaper2regval(&cir) | 1) : 0;
 		k++;
+
+		/* Configure length disable and adjust */
+		reg[k] = NIX_AF_TL1X_SHAPE(schq);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->pkt_mode << 24);
+		k++;
 		break;
 	}
 
@@ -773,6 +794,15 @@ nix_tm_node_add_to_list(struct otx2_eth_dev *dev, uint32_t node_id,
 	tm_node->flags = 0;
 	if (user)
 		tm_node->flags = NIX_TM_NODE_USER;
+
+	/* Packet mode */
+	if (!nix_tm_is_leaf(dev, lvl) &&
+	    ((profile && profile->params.packet_mode) ||
+	     (params->nonleaf.wfq_weight_mode &&
+	      params->nonleaf.n_sp_priorities &&
+	      !params->nonleaf.wfq_weight_mode[0])))
+		tm_node->pkt_mode = 1;
+
 	rte_memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
 
 	if (profile)
@@ -1873,8 +1903,10 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->shaper_private_dual_rate_n_max = max_nr_nodes;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
-	cap->shaper_pkt_length_adjust_min = 0;
-	cap->shaper_pkt_length_adjust_max = 0;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
+	cap->shaper_pkt_length_adjust_min = NIX_LENGTH_ADJUST_MIN;
+	cap->shaper_pkt_length_adjust_max = NIX_LENGTH_ADJUST_MAX;
 
 	/* Schedule Capabilities */
 	cap->sched_n_children_max = rsp->schq[NIX_TXSCH_LVL_MDQ];
@@ -1882,6 +1914,8 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->sched_wfq_n_children_per_group_max = cap->sched_n_children_max;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->sched_wfq_packet_mode_supported = 1;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask =
 		RTE_TM_UPDATE_NODE_PARENT_KEEP_LEVEL |
@@ -1944,12 +1978,16 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_tm_have_tl1_access(dev) ? false : true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = rsp->schq[hw_lvl - 1];
 		cap->nonleaf.sched_sp_n_priorities_max =
 					nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 		if (nix_tm_have_tl1_access(dev))
 			cap->nonleaf.stats_mask =
@@ -1966,6 +2004,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 		cap->nonleaf.shaper_private_dual_rate_supported = true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		/* MDQ doesn't support Strict Priority */
 		if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -1977,6 +2017,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 	} else {
 		/* unsupported level */
 		error->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;
@@ -2029,6 +2071,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		(hw_lvl == NIX_TXSCH_LVL_TL1) ? false : true;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	/* Non Leaf Scheduler */
 	if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -2041,6 +2085,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		cap->nonleaf.sched_n_children_max;
 	cap->nonleaf.sched_wfq_n_groups_max = 1;
 	cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+	cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 	if (hw_lvl == NIX_TXSCH_LVL_TL1)
 		cap->stats_mask = RTE_TM_STATS_N_PKTS_RED_DROPPED |
@@ -2096,6 +2142,13 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (params->pkt_length_adjust < NIX_LENGTH_ADJUST_MIN ||
+	    params->pkt_length_adjust > NIX_LENGTH_ADJUST_MAX) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN;
+		error->message = "length adjust invalid";
+		return -EINVAL;
+	}
+
 	profile = rte_zmalloc("otx2_nix_tm_shaper_profile",
 			      sizeof(struct otx2_nix_tm_shaper_profile), 0);
 	if (!profile)
@@ -2108,13 +2161,14 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 
 	otx2_tm_dbg("Added TM shaper profile %u, "
 		    " pir %" PRIu64 " , pbs %" PRIu64 ", cir %" PRIu64
-		    ", cbs %" PRIu64 " , adj %u",
+		    ", cbs %" PRIu64 " , adj %u, pkt mode %d",
 		    profile_id,
 		    params->peak.rate * 8,
 		    params->peak.size,
 		    params->committed.rate * 8,
 		    params->committed.size,
-		    params->pkt_length_adjust);
+		    params->pkt_length_adjust,
+		    params->packet_mode);
 
 	/* Translate rate as bits per second */
 	profile->params.peak.rate = profile->params.peak.rate * 8;
@@ -2170,9 +2224,11 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		     struct rte_tm_error *error)
 {
 	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	struct otx2_nix_tm_shaper_profile *profile = NULL;
 	struct otx2_nix_tm_node *parent_node;
-	int rc, clear_on_fail = 0;
-	uint32_t exp_next_lvl;
+	int rc, pkt_mode, clear_on_fail = 0;
+	uint32_t exp_next_lvl, i;
+	uint32_t profile_id;
 	uint16_t hw_lvl;
 
 	/* we don't support dynamic updates */
@@ -2234,13 +2290,45 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		return -EINVAL;
 	}
 
-	/* Check if shaper profile exists for non leaf node */
-	if (!nix_tm_is_leaf(dev, lvl) &&
-	    params->shaper_profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE &&
-	    !nix_tm_shaper_profile_search(dev, params->shaper_profile_id)) {
-		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
-		error->message = "invalid shaper profile";
-		return -EINVAL;
+	if (!nix_tm_is_leaf(dev, lvl)) {
+		/* Check if shaper profile exists for non leaf node */
+		profile_id = params->shaper_profile_id;
+		profile = nix_tm_shaper_profile_search(dev, profile_id);
+		if (profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE && !profile) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+			error->message = "invalid shaper profile";
+			return -EINVAL;
+		}
+
+		/* Minimum static priority count is 1 */
+		if (!params->nonleaf.n_sp_priorities ||
+		    params->nonleaf.n_sp_priorities > TXSCH_TLX_SP_PRIO_MAX) {
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
+			error->message = "invalid sp priorities";
+			return -EINVAL;
+		}
+
+		pkt_mode = 0;
+		/* Validate weight mode */
+		for (i = 0; i < params->nonleaf.n_sp_priorities &&
+		     params->nonleaf.wfq_weight_mode; i++) {
+			pkt_mode = !params->nonleaf.wfq_weight_mode[i];
+			if (pkt_mode == !params->nonleaf.wfq_weight_mode[0])
+				continue;
+
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
+			error->message = "unsupported weight mode";
+			return -EINVAL;
+		}
+
+		if (profile && params->nonleaf.n_sp_priorities &&
+		    pkt_mode != profile->params.packet_mode) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;
+			error->message = "shaper wfq packet mode mismatch";
+			return -EINVAL;
+		}
 	}
 
 	/* Check if there is second DWRR already in siblings or holes in prio */
@@ -2482,6 +2570,12 @@ otx2_nix_tm_node_shaper_update(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (profile && profile->params.packet_mode != tm_node->pkt_mode) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+		error->message = "shaper profile pkt mode mismatch";
+		return -EINVAL;
+	}
+
 	tm_node->params.shaper_profile_id = profile_id;
 
 	/* Nothing to do if not yet committed */
drivers/net/octeontx2/otx2_tm.h +5 -0
index 9675182..cdca987 100644
@@ -48,6 +48,7 @@ struct otx2_nix_tm_node {
 #define NIX_TM_NODE_USER	BIT_ULL(2)
 	/* Shaper algorithm for RED state @NIX_REDALG_E */
 	uint32_t red_algo:2;
+	uint32_t pkt_mode:1;
 
 	struct otx2_nix_tm_node *parent;
 	struct rte_tm_node_params params;
@@ -114,6 +115,10 @@ TAILQ_HEAD(otx2_nix_tm_shaper_profile_list, otx2_nix_tm_shaper_profile);
 #define MAX_SHAPER_RATE \
 	SHAPER_RATE(MAX_RATE_EXPONENT, MAX_RATE_MANTISSA, 0)
 
+/* Min is limited so that NIX_AF_SMQX_CFG[MINLEN]+ADJUST is not -ve */
+#define NIX_LENGTH_ADJUST_MIN ((int)-NIX_MIN_HW_FRS + 1)
+#define NIX_LENGTH_ADJUST_MAX 255
+
 /** TM Shaper - low level operations */
 
 /** NIX burst limits */
Signature · 1 line
2.8.4
#11 lore raw

Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram
Quoted 13 lines · Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines

---

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

Hi Cristian,

Can you please review this series?

Thanks,
ferruh

#12 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

Ping.

Quoted 32 lines · Ferruh Yigit

External Email

----------------------------------------------------------------------

Quoted 13 lines · Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines

---

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

Hi Cristian,

Can you please review this series?

Thanks,
ferruh

#13 lore raw

Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

Hi Nithin,

Quoted 46 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Saturday, April 11, 2020 12:44 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

---

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 lib/librte_ethdev/rte_tm.h | 156
++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 154 insertions(+), 2 deletions(-)
lib/librte_ethdev/rte_tm.h +1 -0
index f9c0cf3..38fff4c 100644
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h

Quoted 1 line
lib/librte_ethdev/rte_tm.h +1 -0
+	 * indicates that there is atleast one node that can be configured

Typo (please fix all occurrences): atleast -> at least

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 255

Quoted 1 line
lib/librte_ethdev/rte_tm.h +1 -0
+	 * with packet mode in it's private shaper. When shaper is configured

Typo (please fix all occurrences): it's -> its

Quoted 160 lines
lib/librte_ethdev/rte_tm.h +6 -0
+	 * in packet mode, committed/peak rate provided is interpreted
+	 * in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +8 -0
+	 * indicates that there is atleast one node that can be configured
+	 * with byte mode in it's private shaper. When shaper is configured
+	 * in byte mode, committed/peak rate provided is interpreted in
+	 * bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
+
 	/** Maximum number of shared shapers. The value of zero indicates

that

lib/librte_ethdev/rte_tm.h +1 -0
 	 * shared shapers are not supported.
 	 */
@@ -284,6 +301,21 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_shared_rate_max;
 
+	/** Shaper shared packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates a shared shaper can be configured with packet mode.
+	 * When shared shaper is configured in packet mode,

committed/peak rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_shared_packet_mode_supported;
+
+	/** Shaper shared byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates that a shared shaper can be configured with byte mode.
+	 * When shared shaper is configured in byte mode, committed/peak

rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_shared_byte_mode_supported;
+
+
 	/** Minimum value allowed for packet length adjustment for any

private

lib/librte_ethdev/rte_tm.h +1 -0
 	 * or shared shaper.
 	 */
@@ -339,6 +371,22 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ packet mode supported. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +8 -0
+	 * that there is at least one non-leaf node that supports packet mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * packet count for scheduling children when a non-leaf node
+	 * is configured appropriately.
+	 */
+	int sched_wfq_packet_mode_supported;
+
+	/** WFQ byte mode supported. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +7 -0
+	 * that there is at least one non-leaf node that supports byte mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * bytes for scheduling children when a non-leaf node is configured
+	 * appropriately.
+	 */
+	int sched_wfq_byte_mode_supported;
+
 	/** WRED packet mode support. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +4 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -485,6 +533,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When
 non-zero,
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with packet mode in its private shaper. When

private

lib/librte_ethdev/rte_tm.h +1 -0
+			 * shaper is configured in packet mode,

committed/peak

lib/librte_ethdev/rte_tm.h +5 -0
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When

non-zero,

lib/librte_ethdev/rte_tm.h +4 -0
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with byte mode in its private shaper. When private
+			 * shaper is configured in byte mode,

committed/peak

lib/librte_ethdev/rte_tm.h +4 -0
+			 * rate provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any

non-leaf

lib/librte_ethdev/rte_tm.h +1 -0
 			 * node on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -554,6 +620,25 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ packet mode supported. When non-zero,

this

lib/librte_ethdev/rte_tm.h +3 -0
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports packet
+			 * mode for WFQ among its children. WFQ weights

will

lib/librte_ethdev/rte_tm.h +10 -0
+			 * be applied against packet count for scheduling
+			 * children when a non-leaf node is configured
+			 * appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports byte
+			 * mode for WFQ among its children. WFQ weights

will

lib/librte_ethdev/rte_tm.h +10 -0
+			 * be applied against bytes for scheduling children
+			 * when a non-leaf node is configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -596,6 +681,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When
 non-zero,
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * packet mode in its private shaper. When private
+			 * shaper is configured in packet mode,

committed/peak

lib/librte_ethdev/rte_tm.h +5 -0
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When

non-zero,

lib/librte_ethdev/rte_tm.h +3 -0
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * byte mode in its private shaper. When private

shaper

lib/librte_ethdev/rte_tm.h +5 -0
+			 * is configured in byte mode, committed/peak rate
+			 * provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any

leaf node

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 704

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +0 -0
 			 * on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by

You are missing the shaper_shared_(packet, byte)_mode supported for non-leaf and leaf nodes in struct rte_tm_level_capabilities.

The description of this nodes should be aligned with the description of e.g. shaper_shared_n_max field: basically, we want to say that, when true, the flag signifies there is at least on non-leaf/leaf node on this level that can be part of a shared shaper that works in packet/byte mode. Makes sense?

Quoted 22 lines
lib/librte_ethdev/rte_tm.h +1 -0
@@ -686,6 +789,20 @@ struct rte_tm_node_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates private shaper of current node can be configured with
+	 * packet mode. When configured in packet mode, committed/peak

rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +6 -0
+	 * indicates private shaper of current node can be configured with
+	 * byte mode. When configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
 	/** Maximum number of shared shapers the current node can be
Quoted 4 lines

part of.
* The value of zero indicates that shared shapers are not supported
by
* the current node.

You are missing the shaper_shared_(packet, byte)_mode supported (applicable for both non-leaf and leaf nodes, so it should occur only once in the common part of the struct) in struct rte_tm_node_capabilities. See the above comment on the applicable description style.

Quoted 69 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +852,23 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ packet mode supported. When non-zero,

this

lib/librte_ethdev/rte_tm.h +1 -0
+			 * parameter indicates that current node supports

packet

lib/librte_ethdev/rte_tm.h +1 -0
+			 * mode for WFQ among its children. WFQ weights

will be

lib/librte_ethdev/rte_tm.h +1 -0
+			 * applied against packet count for scheduling

children

lib/librte_ethdev/rte_tm.h +6 -0
+			 * when configured appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that current node supports

byte

lib/librte_ethdev/rte_tm.h +1 -0
+			 * mode for WFQ among its children. WFQ weights

will be

lib/librte_ethdev/rte_tm.h +7 -2
+			 * applied against  bytes for scheduling children when
+			 * configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +970,10 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate (bytes per second or packets per second) */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size (bytes or packets), a.k.a. max burst size */
 	uint64_t size;
 };
 
@@ -860,6 +994,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets.

The
* rate of the peak bucket has to be bigger than zero, as well as greater than
* or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported */
struct rte_tm_shaper_params {

lib/librte_ethdev/rte_tm.h +6 -0
 	/** Committed token bucket */
@@ -874,6 +1013,17 @@ struct rte_tm_shaper_params {
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet

mode and

lib/librte_ethdev/rte_tm.h struct rte_tm_shaper_params { · line 1025

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +4 -0
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively. In
+	 * packet mode, *pkt_length_adjust* is ignored.
+	 */

Please move the last statement ("In packet mode, *pkt_length_adjust* is ignored.") to the description of the pkt_length_adjust field.

Quoted 17 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	int packet_mode;
 };
 
 /**
@@ -925,6 +1075,8 @@ struct rte_tm_node_params {
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -0
 			 * *n_sp_priorities* values, with non-zero value for
 			 * byte-mode and zero for packet-mode.
+			 * @see struct

rte_tm_node_capabilities::sched_wfq_packet_mode_supported

lib/librte_ethdev/rte_tm.h +1 -0
+			 * @see struct

rte_tm_node_capabilities::sched_wfq_byte_mode_supported

lib/librte_ethdev/rte_tm.h +0 -1
 			 */
 			int *wfq_weight_mode;
 
--
Quoted 1 line

2.8.4

Regards,
Cristian

#14 lore raw

Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

Hi Cristian,

Quoted 46 lines · Cristian

Hi Nithin,

Quoted 44 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Saturday, April 11, 2020 12:44 PM
To: Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

---

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 lib/librte_ethdev/rte_tm.h | 156
++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 154 insertions(+), 2 deletions(-)
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..38fff4c 100644
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
Quoted 5 lines

lib/librte_ethdev/rte_tm.h

Quoted 3 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +1 -0
+	 * indicates that there is atleast one node that can be configured

Typo (please fix all occurrences): atleast -> at least

Ack.

Quoted 4 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 255

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	 * with packet mode in it's private shaper. When shaper is configured

Typo (please fix all occurrences): it's -> its

Ack.

Quoted 166 lines
Quoted 161 lines
lib/librte_ethdev/rte_tm.h +6 -0
+	 * in packet mode, committed/peak rate provided is interpreted
+	 * in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +8 -0
+	 * indicates that there is atleast one node that can be configured
+	 * with byte mode in it's private shaper. When shaper is configured
+	 * in byte mode, committed/peak rate provided is interpreted in
+	 * bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
+
 	/** Maximum number of shared shapers. The value of zero indicates

that

lib/librte_ethdev/rte_tm.h +1 -0
 	 * shared shapers are not supported.
 	 */
@@ -284,6 +301,21 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_shared_rate_max;
 
+	/** Shaper shared packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates a shared shaper can be configured with packet mode.
+	 * When shared shaper is configured in packet mode,

committed/peak rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_shared_packet_mode_supported;
+
+	/** Shaper shared byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates that a shared shaper can be configured with byte mode.
+	 * When shared shaper is configured in byte mode, committed/peak

rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_shared_byte_mode_supported;
+
+
 	/** Minimum value allowed for packet length adjustment for any

private

lib/librte_ethdev/rte_tm.h +1 -0
 	 * or shared shaper.
 	 */
@@ -339,6 +371,22 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ packet mode supported. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +8 -0
+	 * that there is at least one non-leaf node that supports packet mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * packet count for scheduling children when a non-leaf node
+	 * is configured appropriately.
+	 */
+	int sched_wfq_packet_mode_supported;
+
+	/** WFQ byte mode supported. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +7 -0
+	 * that there is at least one non-leaf node that supports byte mode
+	 * for WFQ among its children. WFQ weights will be applied against
+	 * bytes for scheduling children when a non-leaf node is configured
+	 * appropriately.
+	 */
+	int sched_wfq_byte_mode_supported;
+
 	/** WRED packet mode support. When non-zero, this parameter

indicates

lib/librte_ethdev/rte_tm.h +4 -0
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -485,6 +533,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When
 non-zero,
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with packet mode in its private shaper. When

private

lib/librte_ethdev/rte_tm.h +1 -0
+			 * shaper is configured in packet mode,

committed/peak

lib/librte_ethdev/rte_tm.h +5 -0
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When

non-zero,

lib/librte_ethdev/rte_tm.h +4 -0
+			 * this parameter indicates there is atleast one
+			 * non-leaf node at this level that can be configured
+			 * with byte mode in its private shaper. When private
+			 * shaper is configured in byte mode,

committed/peak

lib/librte_ethdev/rte_tm.h +4 -0
+			 * rate provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any

non-leaf

lib/librte_ethdev/rte_tm.h +1 -0
 			 * node on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -554,6 +620,25 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ packet mode supported. When non-zero,

this

lib/librte_ethdev/rte_tm.h +3 -0
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports packet
+			 * mode for WFQ among its children. WFQ weights

will

lib/librte_ethdev/rte_tm.h +10 -0
+			 * be applied against packet count for scheduling
+			 * children when a non-leaf node is configured
+			 * appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports byte
+			 * mode for WFQ among its children. WFQ weights

will

lib/librte_ethdev/rte_tm.h +10 -0
+			 * be applied against bytes for scheduling children
+			 * when a non-leaf node is configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -596,6 +681,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When
 non-zero,
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * packet mode in its private shaper. When private
+			 * shaper is configured in packet mode,

committed/peak

lib/librte_ethdev/rte_tm.h +5 -0
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When

non-zero,

lib/librte_ethdev/rte_tm.h +3 -0
+			 * this parameter indicates there is atleast one leaf
+			 * node at this level that can be configured with
+			 * byte mode in its private shaper. When private

shaper

lib/librte_ethdev/rte_tm.h +5 -0
+			 * is configured in byte mode, committed/peak rate
+			 * provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any

leaf node

lib/librte_ethdev/rte_tm.h struct rte_tm_level_capabilities { · line 704

Quoted 2 lines
lib/librte_ethdev/rte_tm.h +0 -0
 			 * on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by

You are missing the shaper_shared_(packet, byte)_mode supported for non-leaf and leaf nodes in struct rte_tm_level_capabilities.

Quoted 1 line

The description of this nodes should be aligned with the description of e.g. shaper_shared_n_max field: basically, we want to say that, when true, the flag signifies there is at least on non-leaf/leaf node on this level that can be part of a shared shaper that works in packet/byte mode. Makes sense?

I intentionally didn't add shaper_shared_(packet, byte)_mode in node and level capabilities and added it in only global cap assuming existing semantics are enforcing that.

Currently, except for 'shaper_shared_n_max', all the other existing shared shaper capabilities like shaper_shared_dual_rate_n_max, shaper_shared_rate_min, etc are only provided in global cap.

I felt the semantics are as such because, shared shaper doesn't really belong to any node or level and any node from any level can attach to a particular shared shaper. Isn't it so ?

Quoted 21 lines
Quoted 21 lines
lib/librte_ethdev/rte_tm.h +1 -0
@@ -686,6 +789,20 @@ struct rte_tm_node_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates private shaper of current node can be configured with
+	 * packet mode. When configured in packet mode, committed/peak

rate

lib/librte_ethdev/rte_tm.h +5 -0
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +5 -0
+	 * indicates private shaper of current node can be configured with
+	 * byte mode. When configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
Quoted 8 lines
Quoted 6 lines
lib/librte_ethdev/rte_tm.h +1 -0
+
 	/** Maximum number of shared shapers the current node can be

part of.
* The value of zero indicates that shared shapers are not supported
by
* the current node.

You are missing the shaper_shared_(packet, byte)_mode supported (applicable for both non-leaf and leaf nodes, so it should occur only once in the common part of the struct) in struct rte_tm_node_capabilities. See the above comment on the applicable description style.

Please see above.

Quoted 68 lines
Quoted 68 lines
lib/librte_ethdev/rte_tm.h +2 -0
@@ -735,6 +852,23 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ packet mode supported. When non-zero,

this

lib/librte_ethdev/rte_tm.h +1 -0
+			 * parameter indicates that current node supports

packet

lib/librte_ethdev/rte_tm.h +1 -0
+			 * mode for WFQ among its children. WFQ weights

will be

lib/librte_ethdev/rte_tm.h +1 -0
+			 * applied against packet count for scheduling

children

lib/librte_ethdev/rte_tm.h +6 -0
+			 * when configured appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that current node supports

byte

lib/librte_ethdev/rte_tm.h +1 -0
+			 * mode for WFQ among its children. WFQ weights

will be

lib/librte_ethdev/rte_tm.h +7 -2
+			 * applied against  bytes for scheduling children when
+			 * configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +970,10 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate (bytes per second or packets per second) */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size (bytes or packets), a.k.a. max burst size */
 	uint64_t size;
 };
 
@@ -860,6 +994,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets.

The
* rate of the peak bucket has to be bigger than zero, as well as greater than
* or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported */
struct rte_tm_shaper_params {

lib/librte_ethdev/rte_tm.h +5 -0
 	/** Committed token bucket */
@@ -874,6 +1013,17 @@ struct rte_tm_shaper_params {
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
Quoted 8 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_shaper_params { · line 1025

Quoted 6 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	 * When non-zero, that private or shared shaper works in packet

mode and

lib/librte_ethdev/rte_tm.h +4 -0
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively. In
+	 * packet mode, *pkt_length_adjust* is ignored.
+	 */

Please move the last statement ("In packet mode, *pkt_length_adjust* is ignored.") to the description of the pkt_length_adjust field.

Ack.

Quoted 22 lines
Quoted 18 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	int packet_mode;
 };
 
 /**
@@ -925,6 +1075,8 @@ struct rte_tm_node_params {
 			 * When non-NULL, it points to a pre-allocated array

of

lib/librte_ethdev/rte_tm.h +1 -0
 			 * *n_sp_priorities* values, with non-zero value for
 			 * byte-mode and zero for packet-mode.
+			 * @see struct

rte_tm_node_capabilities::sched_wfq_packet_mode_supported

lib/librte_ethdev/rte_tm.h +1 -0
+			 * @see struct

rte_tm_node_capabilities::sched_wfq_byte_mode_supported

lib/librte_ethdev/rte_tm.h +0 -1
 			 */
 			int *wfq_weight_mode;
 
--
Quoted 1 line

2.8.4

Regards,
Cristian

#15 lore raw

Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

Hi Nithin,

<snip>...

Quoted 18 lines
Quoted 1 line

You are missing the shaper_shared_(packet, byte)_mode supported for

non-leaf and leaf nodes in struct rte_tm_level_capabilities.

Quoted 2 lines

The description of this nodes should be aligned with the description of e.g.

shaper_shared_n_max field: basically, we want to say that, when true, the flag signifies there is at least on non-leaf/leaf node on this level that can be part of a shared shaper that works in packet/byte mode. Makes sense?

I intentionally didn't add shaper_shared_(packet, byte)_mode in node and level
capabilities and added it in only global cap assuming existing semantics are enforcing that.

Currently, except for 'shaper_shared_n_max', all the other existing shared shaper capabilities like
shaper_shared_dual_rate_n_max, shaper_shared_rate_min, etc are only provided in global cap.

Quoted 5 lines

I felt the semantics are as such because, shared shaper doesn't really belong to any node
or level and any node from any level can attach to a particular shared shaper. Isn't it so
?

That's exactly why we need to formulate node/level capability from node's perspective, and not from the shared shaper's perspective, as a shared shaper is by definition related to a set of nodes, not just one node.

The fact that a given node can be part of a shared shaper that works in packet or byte mode, etc is a node capability in itself, right? So the node's capability called "shaper_shared_(packet, byte)_mode" being supported by the node means that this specific node can be part of a shared shaper that has those properties. To me, this is a valuable thing to capture in node/level capabilities.

We already have other node level capabilities for shared shaper, and we apply the same rationale there.

What do you think?

Regards,
Cristian

#16 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v2 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 31 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

<snip>...

Quoted 18 lines
Quoted 1 line

You are missing the shaper_shared_(packet, byte)_mode supported for

non-leaf and leaf nodes in struct rte_tm_level_capabilities.

Quoted 2 lines

The description of this nodes should be aligned with the description of e.g.

shaper_shared_n_max field: basically, we want to say that, when true, the flag signifies there is at least on non-leaf/leaf node on this level that can be part of a shared shaper that works in packet/byte mode. Makes sense?

I intentionally didn't add shaper_shared_(packet, byte)_mode in node and level
capabilities and added it in only global cap assuming existing semantics are enforcing that.

Currently, except for 'shaper_shared_n_max', all the other existing shared shaper capabilities like
shaper_shared_dual_rate_n_max, shaper_shared_rate_min, etc are only provided in global cap.

Quoted 5 lines

I felt the semantics are as such because, shared shaper doesn't really belong to any node
or level and any node from any level can attach to a particular shared shaper. Isn't it so
?

Quoted 7 lines

That's exactly why we need to formulate node/level capability from node's perspective, and not from the shared shaper's perspective, as a shared shaper is by definition related to a set of nodes, not just one node.

The fact that a given node can be part of a shared shaper that works in packet or byte mode, etc is a node capability in itself, right? So the node's capability called "shaper_shared_(packet, byte)_mode" being supported by the node means that this specific node can be part of a shared shaper that has those properties. To me, this is a valuable thing to capture in node/level capabilities.

We already have other node level capabilities for shared shaper, and we apply the same rationale there.

What do you think?

Ok. I'll add them from the node's perspective.
Thanks.

Quoted 3 lines

Regards,
Cristian

#17 lore raw

PATCH v3 1/1 ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to
avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’) ../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196 ++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +65 -0
index 80a470c..344819f 100644
@@ -447,6 +447,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_private_dual_rate_n_max = 0,
 	.shaper_private_rate_min = 1,
 	.shaper_private_rate_max = UINT32_MAX,
+	.shaper_private_packet_mode_supported = 0,
+	.shaper_private_byte_mode_supported = 1,
 
 	.shaper_shared_n_max = UINT32_MAX,
 	.shaper_shared_n_nodes_per_shaper_max = UINT32_MAX,
@@ -454,6 +456,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_shared_dual_rate_n_max = 0,
 	.shaper_shared_rate_min = 1,
 	.shaper_shared_rate_max = UINT32_MAX,
+	.shaper_shared_packet_mode_supported = 0,
+	.shaper_shared_byte_mode_supported = 1,
 
 	.shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
 	.shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
@@ -463,6 +467,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.sched_wfq_n_children_per_group_max = UINT32_MAX,
 	.sched_wfq_n_groups_max = 1,
 	.sched_wfq_weight_max = UINT32_MAX,
+	.sched_wfq_packet_mode_supported = 0,
+	.sched_wfq_byte_mode_supported = 1,
 
 	.cman_wred_packet_mode_supported = WRED_SUPPORTED,
 	.cman_wred_byte_mode_supported = 0,
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported = WRED_SUPPORTED,
@@ -736,7 +773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -744,6 +785,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -762,6 +809,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
lib/librte_ethdev/rte_tm.h +194 -2

290 lines not on this page · raw message

Signature · 1 line
2.8.4
#18 lore raw

PATCH v3 2/4 drivers/net: update tm capability for existing pmds

From: Nithin Dabilpuram <[email protected]>

Since existing PMD's support shaper byte mode and scheduler wfq byte mode, update the same in their port/level/node capabilities that are added. SoftNIC PMD is already upto date with new capabilities.

---

v2..v3:
- Update node/level cap with shaper_shared_(packet, byte)_mode_supported.

v2:
- Newly included patch to change exiting pmd's with tm support of byte mode to show the same in port/level/node cap.

 drivers/net/i40e/i40e_tm.c     | 22 ++++++++++++++++++++++
 drivers/net/ipn3ke/ipn3ke_tm.c | 38 ++++++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_tm.c   | 22 ++++++++++++++++++++++
 drivers/net/mvpp2/mrvl_tm.c    | 14 ++++++++++++++
 4 files changed, 96 insertions(+)
drivers/net/i40e/i40e_tm.c +22 -0
index c76760c..5d722f9 100644
@@ -160,12 +160,16 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->func_caps.num_tx_qp;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -179,6 +183,8 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	 * So, all the nodes should have the same weight.
 	 */
 	cap->sched_wfq_weight_max = 1;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	cap->cman_head_drop_supported = 0;
 	cap->dynamic_update_mask = 0;
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD;
@@ -754,7 +760,11 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 40Gbps -> 5GBps */
 		cap->nonleaf.shaper_private_rate_max = 5000000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 		if (level_id == I40E_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
 				I40E_MAX_TRAFFIC_CLASS;
@@ -765,6 +775,8 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -776,7 +788,11 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->leaf.shaper_private_rate_max = 5000000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
+	cap->leaf.shaper_shared_packet_mode_supported = 0;
+	cap->leaf.shaper_shared_byte_mode_supported = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
 	cap->leaf.cman_wred_context_shared_n_max = 0;
@@ -817,7 +833,11 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	if (node_type == I40E_TM_NODE_TYPE_QUEUE) {
 		cap->leaf.cman_head_drop_supported = false;
@@ -834,6 +854,8 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/ipn3ke/ipn3ke_tm.c +38 -0
index 5a16c5f..17ac026 100644
@@ -440,6 +440,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_private_dual_rate_n_max = 0;
 	cap->shaper_private_rate_min = 1;
 	cap->shaper_private_rate_max = 1 + IPN3KE_TM_VT_NODE_NUM;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
@@ -447,6 +449,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
 	cap->shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
@@ -456,6 +460,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->sched_wfq_n_children_per_group_max = UINT32_MAX;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = UINT32_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->cman_wred_packet_mode_supported = 0;
 	cap->cman_wred_byte_mode_supported = 0;
@@ -517,13 +523,19 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -539,13 +551,19 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -561,7 +579,11 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_dual_rate_supported = 0;
 		cap->leaf.shaper_private_rate_min = 0;
 		cap->leaf.shaper_private_rate_max = 0;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.shaper_shared_n_max = 0;
+		cap->leaf.shaper_shared_packet_mode_supported = 0;
+		cap->leaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
 		cap->leaf.cman_wred_packet_mode_supported = WRED_SUPPORTED;
@@ -632,7 +654,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -640,6 +666,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -649,7 +677,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -657,6 +689,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -666,7 +700,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 0;
 		cap->shaper_private_rate_max = 0;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 0;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
 		cap->leaf.cman_wred_packet_mode_supported = WRED_SUPPORTED;
drivers/net/ixgbe/ixgbe_tm.c +22 -0
index 73845a7..a8407e7 100644
@@ -168,12 +168,16 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->mac.max_tx_queues;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -182,6 +186,8 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->sched_sp_n_priorities_max = 1;
 	cap->sched_wfq_n_children_per_group_max = 0;
 	cap->sched_wfq_n_groups_max = 0;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	/**
 	 * SW only supports fair round robin now.
 	 * So, all the nodes should have the same weight.
@@ -875,7 +881,11 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 10Gbps -> 1.25GBps */
 		cap->nonleaf.shaper_private_rate_max = 1250000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 		if (level_id == IXGBE_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
 				IXGBE_DCB_MAX_TRAFFIC_CLASS;
@@ -886,6 +896,8 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -897,7 +909,11 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->leaf.shaper_private_rate_max = 1250000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
+	cap->leaf.shaper_shared_packet_mode_supported = 0;
+	cap->leaf.shaper_shared_byte_mode_supported = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
 	cap->leaf.cman_wred_context_shared_n_max = 0;
@@ -938,7 +954,11 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	if (node_type == IXGBE_TM_NODE_TYPE_QUEUE) {
 		cap->leaf.cman_head_drop_supported = false;
@@ -955,6 +975,8 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/mvpp2/mrvl_tm.c +14 -0
index 3de8997..e98f576 100644
@@ -193,12 +193,16 @@ mrvl_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_n_max = cap->shaper_n_max;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->sched_n_children_max = dev->data->nb_tx_queues;
 	cap->sched_sp_n_priorities_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_children_per_group_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask = RTE_TM_UPDATE_NODE_SUSPEND_RESUME |
 				   RTE_TM_UPDATE_NODE_STATS;
@@ -244,6 +248,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_supported = 1;
 		cap->nonleaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->nonleaf.shaper_private_rate_max = priv->rate_max;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -251,6 +257,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->nonleaf.stats_mask = RTE_TM_STATS_N_PKTS |
 					  RTE_TM_STATS_N_BYTES;
 	} else { /* level_id == MRVL_NODE_QUEUE */
@@ -261,6 +269,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_supported = 1;
 		cap->leaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->leaf.shaper_private_rate_max = priv->rate_max;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.stats_mask = RTE_TM_STATS_N_PKTS;
 	}
 
@@ -300,6 +310,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 	cap->shaper_private_supported = 1;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	if (node->type == MRVL_NODE_PORT) {
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
@@ -308,6 +320,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->stats_mask = RTE_TM_STATS_N_PKTS | RTE_TM_STATS_N_BYTES;
 	} else {
 		cap->stats_mask = RTE_TM_STATS_N_PKTS;
Signature · 1 line
2.8.4
#19 lore raw

PATCH v3 3/4 app/testpmd: add tm cmd for non leaf and shaper pktmode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Add TM command to enable packet mode for all SP children in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

Also add support to shaper profile add command to take packet mode parameter used to setup shaper in packet mode. This adds an extra argument "packet_mode" to shaper profile add command "add port tm node shaper profile" as last argument.

This patch also dumps new tm port/level/node capabilities sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported, shaper_private_packet_mode_supported, shaper_private_byte_mode_supported, shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.

---
v2..v3:
- Update cmdline dump of node/level cap.

v1..v2:
- Update tm capability show cmd to dump lastest pktmode/bytemode fields of v2.
- Update existing shaper profile add command to take last argument as pkt_mode and update struct rte_tm_shaper_params:packet_mode with the same.
- Update documentation with latest command changes.

 app/test-pmd/cmdline.c                      |   9 +-
 app/test-pmd/cmdline_tm.c                   | 220 ++++++++++++++++++++++++++++
 app/test-pmd/cmdline_tm.h                   |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  40 ++++-
 4 files changed, 264 insertions(+), 6 deletions(-)
app/test-pmd/cmdline.c +8 -1
index 22fb23a..880ec61 100644
@@ -1189,7 +1189,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"add port tm node shaper profile (port_id) (shaper_profile_id)"
 			" (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)"
-			" (packet_length_adjust)\n"
+			" (packet_length_adjust) (packet_mode)\n"
 			"       Add port tm node private shaper profile.\n\n"
 
 			"del port tm node shaper profile (port_id) (shaper_profile_id)\n"
@@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
 			"       Add port tm nonleaf node.\n\n"
 
+			"add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)"
+			" (priority) (weight) (level_id) (shaper_profile_id)"
+			" (n_sp_priorities) (stats_mask) (n_shared_shapers)"
+			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+			"       Add port tm nonleaf node with pkt mode enabled.\n\n"
+
 			"add port tm leaf node (port_id) (node_id) (parent_node_id)"
 			" (priority) (weight) (level_id) (shaper_profile_id)"
 			" (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
@@ -19655,6 +19661,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,
+	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,
app/test-pmd/cmdline_tm.c +220 -0

304 lines not on this page · raw message

app/test-pmd/cmdline_tm.h +1 -0
index 950cb75..e59c15c 100644
@@ -19,6 +19,7 @@ extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;
 extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;
+extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode;
 extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;
 extern cmdline_parse_inst_t cmd_del_port_tm_node;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +35 -5
index a360ecc..7513a97 100644
@@ -2842,19 +2842,22 @@ Add the port traffic management private shaper profile::
 
    testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \
    (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \
-   (packet_length_adjust)
+   (packet_length_adjust) (packet_mode)
 
 where:
 
 * ``shaper_profile id``: Shaper profile ID for the new profile.
-* ``cmit_tb_rate``: Committed token bucket rate (bytes per second).
-* ``cmit_tb_size``: Committed token bucket size (bytes).
-* ``peak_tb_rate``: Peak token bucket rate (bytes per second).
-* ``peak_tb_size``: Peak token bucket size (bytes).
+* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second).
+* ``cmit_tb_size``: Committed token bucket size (bytes or packets).
+* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second).
+* ``peak_tb_size``: Peak token bucket size (bytes or packets).
 * ``packet_length_adjust``: The value (bytes) to be added to the length of
   each packet for the purpose of shaping. This parameter value can be used to
   correct the packet length with the framing overhead bytes that are consumed
   on the wire.
+* ``packet_mode``: Shaper configured in packet mode. This parameter value if
+  zero, configures shaper in byte mode and if non-zero configures it in packet
+  mode.
 
 Delete port traffic management private shaper profile
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2979,6 +2982,33 @@ where:
 * ``n_shared_shapers``: Number of shared shapers.
 * ``shared_shaper_id``: Shared shaper id.
 
+Add port traffic management hierarchy nonleaf node with packet mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add nonleaf node with packet mode to port traffic management hierarchy::
+
+   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \
+   (priority) (weight) (level_id) (shaper_profile_id) \
+   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
+   [(shared_shaper_0) (shared_shaper_1) ...] \
+
+where:
+
+* ``parent_node_id``: Node ID of the parent.
+* ``priority``: Node priority (highest node priority is zero). This is used by
+  the SP algorithm running on the parent node for scheduling this node.
+* ``weight``: Node weight (lowest weight is one). The node weight is relative
+  to the weight sum of all siblings that have the same priority. It is used by
+  the WFQ algorithm running on the parent node for scheduling this node.
+* ``level_id``: Hierarchy level of the node.
+* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
+  the node.
+* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on
+  all of them.
+* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
+* ``n_shared_shapers``: Number of shared shapers.
+* ``shared_shaper_id``: Shared shaper id.
+
 Add port traffic management hierarchy leaf node
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.8.4
#20 lore raw

PATCH v3 4/4 net/octeontx2: support tm length adjust and pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

This patch adds support to packet length adjust TM feature for private shaper. It also adds support to packet mode feature that applies both to private shaper and node DWRR scheduling of SP children.

---

v2..v3:
- No change.

v1..v2:
- Newly included patch.

 drivers/net/octeontx2/otx2_tm.c | 140 +++++++++++++++++++++++++++++++++-------
 drivers/net/octeontx2/otx2_tm.h |   5 ++
 2 files changed, 122 insertions(+), 23 deletions(-)
drivers/net/octeontx2/otx2_tm.c +117 -23
index f94618d..fa7d21b 100644
@@ -336,18 +336,25 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 {
 	struct shaper_params cir, pir;
 	uint32_t schq = tm_node->hw_id;
+	uint64_t adjust = 0;
 	uint8_t k = 0;
 
 	memset(&cir, 0, sizeof(cir));
 	memset(&pir, 0, sizeof(pir));
 	shaper_config_to_nix(profile, &cir, &pir);
 
-	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, "
-		    "pir %" PRIu64 "(%" PRIu64 "B),"
-		     " cir %" PRIu64 "(%" PRIu64 "B) (%p)",
-		     nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
-		     tm_node->id, pir.rate, pir.burst,
-		     cir.rate, cir.burst, tm_node);
+	/* Packet length adjust */
+	if (tm_node->pkt_mode)
+		adjust = 1;
+	else if (profile)
+		adjust = profile->params.pkt_length_adjust & 0x1FF;
+
+	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, pir %" PRIu64
+		    "(%" PRIu64 "B), cir %" PRIu64 "(%" PRIu64 "B)"
+		    "adjust 0x%" PRIx64 "(pktmode %u) (%p)",
+		    nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
+		    tm_node->id, pir.rate, pir.burst, cir.rate, cir.burst,
+		    adjust, tm_node->pkt_mode, tm_node);
 
 	switch (tm_node->hw_lvl) {
 	case NIX_TXSCH_LVL_SMQ:
@@ -364,7 +371,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED ALG */
 		reg[k] = NIX_AF_MDQX_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL4:
@@ -381,7 +390,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL4X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL3:
@@ -398,7 +409,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL3X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -416,7 +429,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL2X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -426,6 +441,12 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 		regval[k] = (cir.rate && cir.burst) ?
 				(shaper2regval(&cir) | 1) : 0;
 		k++;
+
+		/* Configure length disable and adjust */
+		reg[k] = NIX_AF_TL1X_SHAPE(schq);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->pkt_mode << 24);
+		k++;
 		break;
 	}
 
@@ -773,6 +794,15 @@ nix_tm_node_add_to_list(struct otx2_eth_dev *dev, uint32_t node_id,
 	tm_node->flags = 0;
 	if (user)
 		tm_node->flags = NIX_TM_NODE_USER;
+
+	/* Packet mode */
+	if (!nix_tm_is_leaf(dev, lvl) &&
+	    ((profile && profile->params.packet_mode) ||
+	     (params->nonleaf.wfq_weight_mode &&
+	      params->nonleaf.n_sp_priorities &&
+	      !params->nonleaf.wfq_weight_mode[0])))
+		tm_node->pkt_mode = 1;
+
 	rte_memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
 
 	if (profile)
@@ -1873,8 +1903,10 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->shaper_private_dual_rate_n_max = max_nr_nodes;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
-	cap->shaper_pkt_length_adjust_min = 0;
-	cap->shaper_pkt_length_adjust_max = 0;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
+	cap->shaper_pkt_length_adjust_min = NIX_LENGTH_ADJUST_MIN;
+	cap->shaper_pkt_length_adjust_max = NIX_LENGTH_ADJUST_MAX;
 
 	/* Schedule Capabilities */
 	cap->sched_n_children_max = rsp->schq[NIX_TXSCH_LVL_MDQ];
@@ -1882,6 +1914,8 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->sched_wfq_n_children_per_group_max = cap->sched_n_children_max;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->sched_wfq_packet_mode_supported = 1;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask =
 		RTE_TM_UPDATE_NODE_PARENT_KEEP_LEVEL |
@@ -1944,12 +1978,16 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_tm_have_tl1_access(dev) ? false : true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = rsp->schq[hw_lvl - 1];
 		cap->nonleaf.sched_sp_n_priorities_max =
 					nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 		if (nix_tm_have_tl1_access(dev))
 			cap->nonleaf.stats_mask =
@@ -1966,6 +2004,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 		cap->nonleaf.shaper_private_dual_rate_supported = true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		/* MDQ doesn't support Strict Priority */
 		if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -1977,6 +2017,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 	} else {
 		/* unsupported level */
 		error->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;
@@ -2029,6 +2071,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		(hw_lvl == NIX_TXSCH_LVL_TL1) ? false : true;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	/* Non Leaf Scheduler */
 	if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -2041,6 +2085,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		cap->nonleaf.sched_n_children_max;
 	cap->nonleaf.sched_wfq_n_groups_max = 1;
 	cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+	cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 	if (hw_lvl == NIX_TXSCH_LVL_TL1)
 		cap->stats_mask = RTE_TM_STATS_N_PKTS_RED_DROPPED |
@@ -2096,6 +2142,13 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (params->pkt_length_adjust < NIX_LENGTH_ADJUST_MIN ||
+	    params->pkt_length_adjust > NIX_LENGTH_ADJUST_MAX) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN;
+		error->message = "length adjust invalid";
+		return -EINVAL;
+	}
+
 	profile = rte_zmalloc("otx2_nix_tm_shaper_profile",
 			      sizeof(struct otx2_nix_tm_shaper_profile), 0);
 	if (!profile)
@@ -2108,13 +2161,14 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 
 	otx2_tm_dbg("Added TM shaper profile %u, "
 		    " pir %" PRIu64 " , pbs %" PRIu64 ", cir %" PRIu64
-		    ", cbs %" PRIu64 " , adj %u",
+		    ", cbs %" PRIu64 " , adj %u, pkt mode %d",
 		    profile_id,
 		    params->peak.rate * 8,
 		    params->peak.size,
 		    params->committed.rate * 8,
 		    params->committed.size,
-		    params->pkt_length_adjust);
+		    params->pkt_length_adjust,
+		    params->packet_mode);
 
 	/* Translate rate as bits per second */
 	profile->params.peak.rate = profile->params.peak.rate * 8;
@@ -2170,9 +2224,11 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		     struct rte_tm_error *error)
 {
 	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	struct otx2_nix_tm_shaper_profile *profile = NULL;
 	struct otx2_nix_tm_node *parent_node;
-	int rc, clear_on_fail = 0;
-	uint32_t exp_next_lvl;
+	int rc, pkt_mode, clear_on_fail = 0;
+	uint32_t exp_next_lvl, i;
+	uint32_t profile_id;
 	uint16_t hw_lvl;
 
 	/* we don't support dynamic updates */
@@ -2234,13 +2290,45 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		return -EINVAL;
 	}
 
-	/* Check if shaper profile exists for non leaf node */
-	if (!nix_tm_is_leaf(dev, lvl) &&
-	    params->shaper_profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE &&
-	    !nix_tm_shaper_profile_search(dev, params->shaper_profile_id)) {
-		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
-		error->message = "invalid shaper profile";
-		return -EINVAL;
+	if (!nix_tm_is_leaf(dev, lvl)) {
+		/* Check if shaper profile exists for non leaf node */
+		profile_id = params->shaper_profile_id;
+		profile = nix_tm_shaper_profile_search(dev, profile_id);
+		if (profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE && !profile) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+			error->message = "invalid shaper profile";
+			return -EINVAL;
+		}
+
+		/* Minimum static priority count is 1 */
+		if (!params->nonleaf.n_sp_priorities ||
+		    params->nonleaf.n_sp_priorities > TXSCH_TLX_SP_PRIO_MAX) {
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
+			error->message = "invalid sp priorities";
+			return -EINVAL;
+		}
+
+		pkt_mode = 0;
+		/* Validate weight mode */
+		for (i = 0; i < params->nonleaf.n_sp_priorities &&
+		     params->nonleaf.wfq_weight_mode; i++) {
+			pkt_mode = !params->nonleaf.wfq_weight_mode[i];
+			if (pkt_mode == !params->nonleaf.wfq_weight_mode[0])
+				continue;
+
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
+			error->message = "unsupported weight mode";
+			return -EINVAL;
+		}
+
+		if (profile && params->nonleaf.n_sp_priorities &&
+		    pkt_mode != profile->params.packet_mode) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;
+			error->message = "shaper wfq packet mode mismatch";
+			return -EINVAL;
+		}
 	}
 
 	/* Check if there is second DWRR already in siblings or holes in prio */
@@ -2482,6 +2570,12 @@ otx2_nix_tm_node_shaper_update(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (profile && profile->params.packet_mode != tm_node->pkt_mode) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+		error->message = "shaper profile pkt mode mismatch";
+		return -EINVAL;
+	}
+
 	tm_node->params.shaper_profile_id = profile_id;
 
 	/* Nothing to do if not yet committed */
drivers/net/octeontx2/otx2_tm.h +5 -0
index 9675182..cdca987 100644
@@ -48,6 +48,7 @@ struct otx2_nix_tm_node {
 #define NIX_TM_NODE_USER	BIT_ULL(2)
 	/* Shaper algorithm for RED state @NIX_REDALG_E */
 	uint32_t red_algo:2;
+	uint32_t pkt_mode:1;
 
 	struct otx2_nix_tm_node *parent;
 	struct rte_tm_node_params params;
@@ -114,6 +115,10 @@ TAILQ_HEAD(otx2_nix_tm_shaper_profile_list, otx2_nix_tm_shaper_profile);
 #define MAX_SHAPER_RATE \
 	SHAPER_RATE(MAX_RATE_EXPONENT, MAX_RATE_MANTISSA, 0)
 
+/* Min is limited so that NIX_AF_SMQX_CFG[MINLEN]+ADJUST is not -ve */
+#define NIX_LENGTH_ADJUST_MIN ((int)-NIX_MIN_HW_FRS + 1)
+#define NIX_LENGTH_ADJUST_MAX 255
+
 /** TM Shaper - low level operations */
 
 /** NIX burst limits */
Signature · 1 line
2.8.4
#21 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

Please ignore this patch. Had issue with subject line.
Consider patch "[v3,1/4] ethdev: add tm support for shaper config in pkt mode " instead.

Quoted 579 lines · Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to
avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’) ../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196 ++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +65 -0
index 80a470c..344819f 100644
@@ -447,6 +447,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_private_dual_rate_n_max = 0,
 	.shaper_private_rate_min = 1,
 	.shaper_private_rate_max = UINT32_MAX,
+	.shaper_private_packet_mode_supported = 0,
+	.shaper_private_byte_mode_supported = 1,
 
 	.shaper_shared_n_max = UINT32_MAX,
 	.shaper_shared_n_nodes_per_shaper_max = UINT32_MAX,
@@ -454,6 +456,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_shared_dual_rate_n_max = 0,
 	.shaper_shared_rate_min = 1,
 	.shaper_shared_rate_max = UINT32_MAX,
+	.shaper_shared_packet_mode_supported = 0,
+	.shaper_shared_byte_mode_supported = 1,
 
 	.shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
 	.shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
@@ -463,6 +467,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.sched_wfq_n_children_per_group_max = UINT32_MAX,
 	.sched_wfq_n_groups_max = 1,
 	.sched_wfq_weight_max = UINT32_MAX,
+	.sched_wfq_packet_mode_supported = 0,
+	.sched_wfq_byte_mode_supported = 1,
 
 	.cman_wred_packet_mode_supported = WRED_SUPPORTED,
 	.cman_wred_byte_mode_supported = 0,
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported = WRED_SUPPORTED,
@@ -736,7 +773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -744,6 +785,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -762,6 +809,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
lib/librte_ethdev/rte_tm.h +194 -2
index f9c0cf3..b3865af 100644
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this parameter
+	 * indicates that there is at least one node that can be configured
+	 * with packet mode in it's private shaper. When shaper is configured
+	 * in packet mode, committed/peak rate provided is interpreted
+	 * in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this parameter
+	 * indicates that there is at least one node that can be configured
+	 * with byte mode in it's private shaper. When shaper is configured
+	 * in byte mode, committed/peak rate provided is interpreted in
+	 * bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
+
 	/** Maximum number of shared shapers. The value of zero indicates that
 	 * shared shapers are not supported.
 	 */
@@ -284,6 +301,21 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_shared_rate_max;
 
+	/** Shaper shared packet mode supported. When non-zero, this parameter
+	 * indicates a shared shaper can be configured with packet mode.
+	 * When shared shaper is configured in packet mode, committed/peak rate
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_shared_packet_mode_supported;
+
+	/** Shaper shared byte mode supported. When non-zero, this parameter
+	 * indicates that a shared shaper can be configured with byte mode.
+	 * When shared shaper is configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_shared_byte_mode_supported;
+
+
 	/** Minimum value allowed for packet length adjustment for any private
 	 * or shared shaper.
 	 */
@@ -339,6 +371,22 @@ struct rte_tm_capabilities {
 	 */
 	uint32_t sched_wfq_weight_max;
 
+	/** WFQ packet mode supported. When non-zero, this parameter indicates
+	 * that there is at least one non-leaf node that supports packet mode
+	 * for WFQ among it's children. WFQ weights will be applied against
+	 * packet count for scheduling children when a non-leaf node
+	 * is configured appropriately.
+	 */
+	int sched_wfq_packet_mode_supported;
+
+	/** WFQ byte mode supported. When non-zero, this parameter indicates
+	 * that there is at least one non-leaf node that supports byte mode
+	 * for WFQ among it's children. WFQ weights will be applied against
+	 * bytes for scheduling children when a non-leaf node is configured
+	 * appropriately.
+	 */
+	int sched_wfq_byte_mode_supported;
+
 	/** WRED packet mode support. When non-zero, this parameter indicates
 	 * that there is at least one leaf node that supports the WRED packet
 	 * mode, which might not be true for all the leaf nodes. In packet
@@ -485,6 +533,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When non-zero,
+			 * this parameter indicates there is at least one
+			 * non-leaf node at this level that can be configured
+			 * with packet mode in it's private shaper. When private
+			 * shaper is configured in packet mode, committed/peak
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When non-zero,
+			 * this parameter indicates there is at least one
+			 * non-leaf node at this level that can be configured
+			 * with byte mode in it's private shaper. When private
+			 * shaper is configured in byte mode, committed/peak
+			 * rate provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any non-leaf
 			 * node on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -495,6 +561,20 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t shaper_shared_n_max;
 
+			/** Shaper shared packet mode supported. When non-zero,
+			 * this parameter indicates that there is at least one
+			 * non-leaf node on this level that can be part of
+			 * shared shapers which work in packet mode.
+			 */
+			int shaper_shared_packet_mode_supported;
+
+			/** Shaper shared byte mode supported. When non-zero,
+			 * this parameter indicates that there is at least one
+			 * non-leaf node on this level that can be part of
+			 * shared shapers which work in byte mode.
+			 */
+			int shaper_shared_byte_mode_supported;
+
 			/** Maximum number of children nodes. This parameter
 			 * indicates that there is at least one non-leaf node on
 			 * this level that can be configured with this many
@@ -554,6 +634,25 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t sched_wfq_weight_max;
 
+			/** WFQ packet mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports packet
+			 * mode for WFQ among it's children. WFQ weights will
+			 * be applied against packet count for scheduling
+			 * children when a non-leaf node is configured
+			 * appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that there is at least one
+			 * non-leaf node at this level that supports byte
+			 * mode for WFQ among it's children. WFQ weights will
+			 * be applied against bytes for scheduling children
+			 * when a non-leaf node is configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 			/** Mask of statistics counter types supported by the
 			 * non-leaf nodes on this level. Every supported
 			 * statistics counter type is supported by at least one
@@ -596,6 +695,24 @@ struct rte_tm_level_capabilities {
 			 */
 			uint64_t shaper_private_rate_max;
 
+			/** Shaper private packet mode supported. When non-zero,
+			 * this parameter indicates there is at least one leaf
+			 * node at this level that can be configured with
+			 * packet mode in it's private shaper. When private
+			 * shaper is configured in packet mode, committed/peak
+			 * rate provided is interpreted in packets per second.
+			 */
+			int shaper_private_packet_mode_supported;
+
+			/** Shaper private byte mode supported. When non-zero,
+			 * this parameter indicates there is at least one leaf
+			 * node at this level that can be configured with
+			 * byte mode in it's private shaper. When private shaper
+			 * is configured in byte mode, committed/peak rate
+			 * provided is interpreted in bytes per second.
+			 */
+			int shaper_private_byte_mode_supported;
+
 			/** Maximum number of shared shapers that any leaf node
 			 * on this level can be part of. The value of zero
 			 * indicates that shared shapers are not supported by
@@ -606,6 +723,20 @@ struct rte_tm_level_capabilities {
 			 */
 			uint32_t shaper_shared_n_max;
 
+			/** Shaper shared packet mode supported. When non-zero,
+			 * this parameter indicates that there is at least one
+			 * leaf node on this level that can be part of
+			 * shared shapers which work in packet mode.
+			 */
+			int shaper_shared_packet_mode_supported;
+
+			/** Shaper shared byte mode supported. When non-zero,
+			 * this parameter indicates that there is at least one
+			 * leaf node on this level that can be part of
+			 * shared shapers which work in byte mode.
+			 */
+			int shaper_shared_byte_mode_supported;
+
 			/** WRED packet mode support. When non-zero, this
 			 * parameter indicates that there is at least one leaf
 			 * node on this level that supports the WRED packet
@@ -686,12 +817,38 @@ struct rte_tm_node_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this parameter
+	 * indicates private shaper of current node can be configured with
+	 * packet mode. When configured in packet mode, committed/peak rate
+	 * provided is interpreted in packets per second.
+	 */
+	int shaper_private_packet_mode_supported;
+
+	/** Shaper private byte mode supported. When non-zero, this parameter
+	 * indicates private shaper of current node can be configured with
+	 * byte mode. When configured in byte mode, committed/peak rate
+	 * provided is interpreted in bytes per second.
+	 */
+	int shaper_private_byte_mode_supported;
+
 	/** Maximum number of shared shapers the current node can be part of.
 	 * The value of zero indicates that shared shapers are not supported by
 	 * the current node.
 	 */
 	uint32_t shaper_shared_n_max;
 
+	/** Shaper shared packet mode supported. When non-zero,
+	 * this parameter indicates that current node can be part of
+	 * shared shapers which work in packet mode.
+	 */
+	int shaper_shared_packet_mode_supported;
+
+	/** Shaper shared byte mode supported. When non-zero,
+	 * this parameter indicates that current node can be part of
+	 * shared shapers which work in byte mode.
+	 */
+	int shaper_shared_byte_mode_supported;
+
 	RTE_STD_C11
 	union {
 		/** Items valid only for non-leaf nodes. */
@@ -735,6 +892,23 @@ struct rte_tm_node_capabilities {
 			 * WFQ weight, so WFQ is reduced to FQ.
 			 */
 			uint32_t sched_wfq_weight_max;
+
+			/** WFQ packet mode supported. When non-zero, this
+			 * parameter indicates that current node supports packet
+			 * mode for WFQ among it's children. WFQ weights will be
+			 * applied against packet count for scheduling children
+			 * when configured appropriately.
+			 */
+			int sched_wfq_packet_mode_supported;
+
+			/** WFQ byte mode supported. When non-zero, this
+			 * parameter indicates that current node supports byte
+			 * mode for WFQ among it's children. WFQ weights will be
+			 * applied against  bytes for scheduling children when
+			 * configured appropriately.
+			 */
+			int sched_wfq_byte_mode_supported;
+
 		} nonleaf;
 
 		/** Items valid only for leaf nodes. */
@@ -836,10 +1010,10 @@ struct rte_tm_wred_params {
  * Token bucket
  */
 struct rte_tm_token_bucket {
-	/** Token bucket rate (bytes per second) */
+	/** Token bucket rate (bytes per second or packets per second) */
 	uint64_t rate;
 
-	/** Token bucket size (bytes), a.k.a. max burst size */
+	/** Token bucket size (bytes or packets), a.k.a. max burst size */
 	uint64_t size;
 };
 
@@ -860,6 +1034,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets. The
  * rate of the peak bucket has to be bigger than zero, as well as greater than
  * or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported
  */
 struct rte_tm_shaper_params {
 	/** Committed token bucket */
@@ -872,8 +1051,19 @@ struct rte_tm_shaper_params {
 	 * purpose of shaping. Can be used to correct the packet length with
 	 * the framing overhead bytes that are also consumed on the wire (e.g.
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
+	 * This field is ignored when the profile enables packet mode.
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet mode and
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively.
+	 */
+	int packet_mode;
 };
 
 /**
@@ -925,6 +1115,8 @@ struct rte_tm_node_params {
 			 * When non-NULL, it points to a pre-allocated array of
 			 * *n_sp_priorities* values, with non-zero value for
 			 * byte-mode and zero for packet-mode.
+			 * @see struct rte_tm_node_capabilities::sched_wfq_packet_mode_supported
+			 * @see struct rte_tm_node_capabilities::sched_wfq_byte_mode_supported
 			 */
 			int *wfq_weight_mode;
 
Signature · 1 line
2.8.4
#22 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Quoted 62 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 9:09 AM
To: Nithin Dabilpuram <[email protected]>
Cc: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Please ignore this patch. Had issue with subject line. Consider patch "[v3,1/4] ethdev: add tm support for shaper config in pkt mode "
instead.

Quoted 18 lines · Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

Quoted 8 lines

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around

scalar initializer

Quoted 2 lines
   {.nonleaf = {
  ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization

for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’)

Quoted 1 line

../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in

record or union initializer

Quoted 4 lines
   {.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and

bytemode.

Quoted 5 lines

- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++

<snip>

Quoted 11 lines

Review static const struct rte_tm_level_capabilities

Quoted 1 line
(quoted diff) +0 -0
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
Quoted 8 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = {

Quoted 3 lines
drivers/net/softnic/rte_eth_softnic_tm.c +0 -0
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 569

Quoted 4 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,

[Jasvinder] - byte mode needs to be set here.

Quoted 17 lines

Review static const struct rte_tm_level_capabilities

Quoted 3 lines
(quoted diff) +0 -0
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

Quoted 9 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 604

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,

[jasvinder] - byte mode should be set here as well.

Quoted 79 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 6 lines
drivers/net/softnic/rte_eth_softnic_tm.c +1 -0
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported =

WRED_SUPPORTED, @@ -736,7

Quoted 1 line

+773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] =

{

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX, @@ -744,6

+785,8 @@ static

Quoted 8 lines
Quoted 2 lines

const struct rte_tm_node_capabilities tm_node_cap[] = {
.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 572

Quoted 5 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },

[Jasvinder] - byte mode to be set.

Quoted 15 lines

Review static const struct rte_tm_node_capabilities

Quoted 2 lines
(quoted diff) +0 -0
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX, @@ -762,6

+809,8 @@ static

Quoted 8 lines
Quoted 2 lines

const struct rte_tm_node_capabilities tm_node_cap[] = {
.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 608

Quoted 5 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },

[Jasvinder] - byte mode to be set here.

Quoted 60 lines

Review static const struct rte_tm_node_capabilities

Quoted 2 lines
(quoted diff) +0 -0
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
#23 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Fixed in v4.

Quoted 303 lines · Jasvinder

External Email

----------------------------------------------------------------------

Quoted 60 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 9:09 AM
To: Nithin Dabilpuram <[email protected]>
Cc: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Please ignore this patch. Had issue with subject line. Consider patch "[v3,1/4] ethdev: add tm support for shaper config in pkt mode "
instead.

Quoted 18 lines · Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

Quoted 8 lines

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around

scalar initializer

Quoted 2 lines
   {.nonleaf = {
  ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization

for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’)

Quoted 1 line

../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in

record or union initializer

Quoted 4 lines
   {.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and

bytemode.

Quoted 5 lines

- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++

<snip>

Quoted 11 lines

Review static const struct rte_tm_level_capabilities

Quoted 1 line
(quoted diff) +0 -0
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
Quoted 8 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = {

Quoted 3 lines
drivers/net/softnic/rte_eth_softnic_tm.c +0 -0
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 569

Quoted 4 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,

[Jasvinder] - byte mode needs to be set here.

Quoted 17 lines

Review static const struct rte_tm_level_capabilities

Quoted 3 lines
(quoted diff) +0 -0
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

Quoted 9 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 604

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,

[jasvinder] - byte mode should be set here as well.

Quoted 79 lines

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 6 lines
drivers/net/softnic/rte_eth_softnic_tm.c +1 -0
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities

tm_level_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported =

WRED_SUPPORTED, @@ -736,7

Quoted 1 line

+773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] =

{

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX, @@ -744,6

+785,8 @@ static

Quoted 8 lines
Quoted 2 lines

const struct rte_tm_node_capabilities tm_node_cap[] = {
.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 572

Quoted 5 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },

[Jasvinder] - byte mode to be set.

Quoted 15 lines

Review static const struct rte_tm_node_capabilities

Quoted 2 lines
(quoted diff) +0 -0
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX, @@ -762,6

+809,8 @@ static

Quoted 8 lines
Quoted 2 lines

const struct rte_tm_node_capabilities tm_node_cap[] = {
.sched_wfq_n_children_per_group_max =

UINT32_MAX,

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_level_capabilities tm_level_cap[] = { · line 608

Quoted 5 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },

[Jasvinder] - byte mode to be set here.

Quoted 60 lines

Review static const struct rte_tm_node_capabilities

Quoted 2 lines
(quoted diff) +0 -0
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 12 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

drivers/net/softnic/rte_eth_softnic_tm.c static const struct rte_tm_node_capabilities

Quoted 9 lines
drivers/net/softnic/rte_eth_softnic_tm.c +2 -0
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities

tm_node_cap[] = {

Quoted 11 lines
drivers/net/softnic/rte_eth_softnic_tm.c +4 -0
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
#24 lore raw

Re: [dpdk-dev] [PATCH v3] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

Hi Nithin,

drivers/net/softnic/rte_eth_softnic_tm.c

Quoted 60 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 9:00 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around
scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization
for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’)
../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in
record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196
++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +0 -0
index 80a470c..344819f 100644

<snip>...

The softnic changes logically belong to a separate patch. I understand you are getting some build warnings, but it does not make sense to me. Are you sure there is no other way to avoid them?

You are not checking that packet_mode is set to 0. Please add a check in function shaper_profile_check() (file rte_eth_softnic_tm.c) to verify that packet_mode is always set to 0.

Jasvinder, any other changes we need in Soft NIC?

lib/librte_ethdev/rte_tm.h

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..b3865af 100644

I am now fine with your additions to this file, with some minor exceptions listed below. Thank you!

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 255

Quoted 8 lines
lib/librte_ethdev/rte_tm.h +1 -0
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates that there is at least one node that can be configured
+	 * with packet mode in it's private shaper. When shaper is configured

Recurring typo: it's -> its

Please search for all occurrences of "it's", all should be replaced with either "its" or "it is", we should have absolutely no occurrence of "it's".

<snip>...

Quoted 31 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -860,6 +1034,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets.

The
* rate of the peak bucket has to be bigger than zero, as well as greater than
* or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported */
struct rte_tm_shaper_params {

lib/librte_ethdev/rte_tm.h +0 -0
 	/** Committed token bucket */
@@ -872,8 +1051,19 @@ struct rte_tm_shaper_params {
 	 * purpose of shaping. Can be used to correct the packet length with
 	 * the framing overhead bytes that are also consumed on the wire

(e.g.

lib/librte_ethdev/rte_tm.h +7 -0
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
+	 * This field is ignored when the profile enables packet mode.
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet

mode and

lib/librte_ethdev/rte_tm.h struct rte_tm_shaper_params { · line 1067

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +4 -0
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively.
+	 */
+	int packet_mode;
 };

I would like to simplify this comment a bit. The reference to a shaper being associated with a profile might be confusing, as some people might incorrectly read there is a 1:1 association between shaper and profile, etc; this is described in mode details in the comment at the top of this structure. I would avoid any mentions of objects outside of the current structure.

I would phrase it like: "When zero, the byte mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in bytes per second and bytes, respectively. When non-zero, the packet mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in packets per second and packets, respectively. ". Is this OK with you?

Please also add the links to the relevant capabilities: @see struct rte_tm_node_capabilities::XYZ.

Regards,
Cristian

#25 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Quoted 68 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

drivers/net/softnic/rte_eth_softnic_tm.c

Quoted 60 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 9:00 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around
scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization
for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’)
../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in
record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196
++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +0 -0
index 80a470c..344819f 100644

<snip>...

Quoted 1 line

The softnic changes logically belong to a separate patch. I understand you are getting some build warnings, but it does not make sense to me. Are you sure there is no other way to avoid them?

I see error only because of v3 changes in node cap. There seems to be some gcc issue with order of initializations only when next field is union. I tried both gcc 4.8.5 and 7.3.1

struct test {                                            
        int a;                                           
        char b;                                          
        int c;                                           
        union {                                          
                int d;                                   
        };                                               

};

struct test ds1 = {                                      
        .a = 10,                                         
        .b = 20,                                         
        {                                                
                .d = 40,                                 
        }                                                
};                                                       

int main(void)

{                                                        
        printf("ds1.a %d\n", ds1.a);                     
}                                                        

[root@hyd1588t430 dpdk]# make a
cc a.c -o a
a.c:20:2: warning: braces around scalar initializer [enabled by default]
{
^
a.c:20:2: warning: (near initialization for ‘ds1.c’) [enabled by default] a.c:21:3: error: field name not in record or union initializer
.d = 40,
^
a.c:21:3: error: (near initialization for ‘ds1.c’)
make: *** [a] Error 1

I don't see any issue if 'd' is not inside a union.

Similar issue is reported in kernel and similar fix was applied of initializing all the fields.
https://patchwork.kernel.org/patch/3033041/

Quoted 2 lines

You are not checking that packet_mode is set to 0. Please add a check in function shaper_profile_check() (file rte_eth_softnic_tm.c) to verify that packet_mode is always set to 0.

Ack.

Quoted 14 lines

Jasvinder, any other changes we need in Soft NIC?

lib/librte_ethdev/rte_tm.h

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..b3865af 100644

I am now fine with your additions to this file, with some minor exceptions listed below. Thank you!

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
Quoted 8 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 255

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates that there is at least one node that can be configured
+	 * with packet mode in it's private shaper. When shaper is configured

Recurring typo: it's -> its

Please search for all occurrences of "it's", all should be replaced with either "its" or "it is", we should have absolutely no occurrence of "it's".

Ack. My bad, I misunderstood earlier comment. Will fix in v4.

Quoted 42 lines

<snip>...

Quoted 31 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -860,6 +1034,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets.

The
* rate of the peak bucket has to be bigger than zero, as well as greater than
* or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported */
struct rte_tm_shaper_params {

lib/librte_ethdev/rte_tm.h +0 -0
 	/** Committed token bucket */
@@ -872,8 +1051,19 @@ struct rte_tm_shaper_params {
 	 * purpose of shaping. Can be used to correct the packet length with
 	 * the framing overhead bytes that are also consumed on the wire

(e.g.

lib/librte_ethdev/rte_tm.h +7 -0
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
+	 * This field is ignored when the profile enables packet mode.
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet

mode and

lib/librte_ethdev/rte_tm.h struct rte_tm_shaper_params { · line 1067

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +4 -0
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively.
+	 */
+	int packet_mode;
 };

I would like to simplify this comment a bit. The reference to a shaper being associated with a profile might be confusing, as some people might incorrectly read there is a 1:1 association between shaper and profile, etc; this is described in mode details in the comment at the top of this structure. I would avoid any mentions of objects outside of the current structure.

Quoted 1 line

I would phrase it like: "When zero, the byte mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in bytes per second and bytes, respectively. When non-zero, the packet mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in packets per second and packets, respectively. ". Is this OK with you?

Ack.

Quoted 2 lines

Please also add the links to the relevant capabilities: @see struct rte_tm_node_capabilities::XYZ.

Ack.

Quoted 4 lines

Regards,
Cristian

#26 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Quoted 2 lines

Please also add the links to the relevant capabilities: @see struct rte_tm_node_capabilities::XYZ.

This is already added for packet_mode field in descrption of struct rte_tm_shaper_params similar to struct rte_tm_wred_params. Do you see anything missing ?

Quoted 190 lines · Nithin Dabilpuram
Quoted 68 lines · Cristian

External Email

----------------------------------------------------------------------
Hi Nithin,

drivers/net/softnic/rte_eth_softnic_tm.c

Quoted 60 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 9:00 AM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around
scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization
for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’)
../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in
record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196
++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +0 -0
index 80a470c..344819f 100644

<snip>...

Quoted 1 line

The softnic changes logically belong to a separate patch. I understand you are getting some build warnings, but it does not make sense to me. Are you sure there is no other way to avoid them?

I see error only because of v3 changes in node cap. There seems to be some gcc issue with order of initializations only when next field is union. I tried both gcc 4.8.5 and 7.3.1

struct test {                                            
        int a;                                           
        char b;                                          
        int c;                                           
        union {                                          
                int d;                                   
        };                                               

};

struct test ds1 = {                                      
        .a = 10,                                         
        .b = 20,                                         
        {                                                
                .d = 40,                                 
        }                                                
};                                                       

int main(void)

{                                                        
        printf("ds1.a %d\n", ds1.a);                     
}                                                        

[root@hyd1588t430 dpdk]# make a
cc a.c -o a
a.c:20:2: warning: braces around scalar initializer [enabled by default]
{
^
a.c:20:2: warning: (near initialization for ‘ds1.c’) [enabled by default] a.c:21:3: error: field name not in record or union initializer
.d = 40,
^
a.c:21:3: error: (near initialization for ‘ds1.c’)
make: *** [a] Error 1

I don't see any issue if 'd' is not inside a union.

Similar issue is reported in kernel and similar fix was applied of initializing all the fields.
https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_3033041_&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=Ygf72TMZqO2D2qgWdhga8M61LRznr54ORYKCZ5iQG7w&s=n6pWrzBSgTCaznkjfH4UXjJS_CvBpX2_uY-CJ-LZcd4&e=

Quoted 2 lines

You are not checking that packet_mode is set to 0. Please add a check in function shaper_profile_check() (file rte_eth_softnic_tm.c) to verify that packet_mode is always set to 0.

Ack.

Quoted 14 lines

Jasvinder, any other changes we need in Soft NIC?

lib/librte_ethdev/rte_tm.h

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +0 -0
index f9c0cf3..b3865af 100644

I am now fine with your additions to this file, with some minor exceptions listed below. Thank you!

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -250,6 +250,23 @@ struct rte_tm_capabilities {
 	 */
 	uint64_t shaper_private_rate_max;
 
Quoted 8 lines

lib/librte_ethdev/rte_tm.h struct rte_tm_capabilities { · line 255

Quoted 4 lines
lib/librte_ethdev/rte_tm.h +1 -0
+	/** Shaper private packet mode supported. When non-zero, this

parameter

lib/librte_ethdev/rte_tm.h +2 -0
+	 * indicates that there is at least one node that can be configured
+	 * with packet mode in it's private shaper. When shaper is configured

Recurring typo: it's -> its

Please search for all occurrences of "it's", all should be replaced with either "its" or "it is", we should have absolutely no occurrence of "it's".

Ack. My bad, I misunderstood earlier comment. Will fix in v4.

Quoted 42 lines

<snip>...

Quoted 31 lines
lib/librte_ethdev/rte_tm.h +0 -0
@@ -860,6 +1034,11 @@ struct rte_tm_token_bucket {
  * Dual rate shapers use both the committed and the peak token buckets.

The
* rate of the peak bucket has to be bigger than zero, as well as greater than
* or equal to the rate of the committed bucket.
+ *
+ * @see struct rte_tm_capabilities::shaper_private_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_private_byte_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_packet_mode_supported
+ * @see struct rte_tm_capabilities::shaper_shared_byte_mode_supported */
struct rte_tm_shaper_params {

lib/librte_ethdev/rte_tm.h +0 -0
 	/** Committed token bucket */
@@ -872,8 +1051,19 @@ struct rte_tm_shaper_params {
 	 * purpose of shaping. Can be used to correct the packet length with
 	 * the framing overhead bytes that are also consumed on the wire

(e.g.

lib/librte_ethdev/rte_tm.h +7 -0
 	 * RTE_TM_ETH_FRAMING_OVERHEAD_FCS).
+	 * This field is ignored when the profile enables packet mode.
 	 */
 	int32_t pkt_length_adjust;
+
+	/** When zero, the private or shared shaper that is associated to this
+	 * profile works in byte mode and hence *rate* and *size* fields in
+	 * both token bucket configurations are specified in bytes per second
+	 * and bytes respectively.
+	 * When non-zero, that private or shared shaper works in packet

mode and

lib/librte_ethdev/rte_tm.h struct rte_tm_shaper_params { · line 1067

Quoted 5 lines
lib/librte_ethdev/rte_tm.h +4 -0
+	 * hence *rate* and *size* fields in both token bucket configurations
+	 * are specified in packets per second and packets respectively.
+	 */
+	int packet_mode;
 };

I would like to simplify this comment a bit. The reference to a shaper being associated with a profile might be confusing, as some people might incorrectly read there is a 1:1 association between shaper and profile, etc; this is described in mode details in the comment at the top of this structure. I would avoid any mentions of objects outside of the current structure.

Quoted 1 line

I would phrase it like: "When zero, the byte mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in bytes per second and bytes, respectively. When non-zero, the packet mode is enabled for the current profile, so the *rate* and *size* fields in both the committed and peak token buckets are specified in packets per second and packets, respectively. ". Is this OK with you?

Ack.

Quoted 2 lines

Please also add the links to the relevant capabilities: @see struct rte_tm_node_capabilities::XYZ.

Ack.

Quoted 4 lines

Regards,
Cristian

#27 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Quoted 14 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 12:49 PM
To: Dumitrescu, Cristian <[email protected]>
Cc: Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

Quoted 7 lines
Quoted 2 lines

Please also add the links to the relevant capabilities: @see struct rte_tm_node_capabilities::XYZ.

This is already added for packet_mode field in descrption of struct rte_tm_shaper_params similar to struct rte_tm_wred_params. Do you see anything missing ?

You're right, sorry.

#28 lore raw

Re: [dpdk-dev] [EXT] RE: [PATCH v3] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram
Quoted 43 lines
Quoted 2 lines

The softnic changes logically belong to a separate patch. I understand you

are getting some build warnings, but it does not make sense to me. Are you sure there is no other way to avoid them?
I see error only because of v3 changes in node cap. There seems to be some gcc
issue with order of initializations only when next field is union. I tried both gcc 4.8.5 and 7.3.1

struct test {
        int a;
        char b;
        int c;
        union {
                int d;
        };

};

struct test ds1 = {
        .a = 10,
        .b = 20,
        {
                .d = 40,
        }
};

int main(void)

{
        printf("ds1.a %d\n", ds1.a);
}

[root@hyd1588t430 dpdk]# make a
cc a.c -o a
a.c:20:2: warning: braces around scalar initializer [enabled by default]
{
^
a.c:20:2: warning: (near initialization for ‘ds1.c’) [enabled by default] a.c:21:3: error: field name not in record or union initializer
.d = 40,
^
a.c:21:3: error: (near initialization for ‘ds1.c’)
make: *** [a] Error 1

Quoted 7 lines

I don't see any issue if 'd' is not inside a union.

Similar issue is reported in kernel and similar fix was applied of initializing all the fields.
https://patchwork.kernel.org/patch/3033041/

Sure, I can live with softnic changes in the same patch if no other option is identified.

#29 lore raw

PATCH v3 1/4 ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to
avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’) ../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  65 ++++++++++
 lib/librte_ethdev/rte_tm.h               | 196 ++++++++++++++++++++++++++++++-
 2 files changed, 259 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +65 -0
index 80a470c..344819f 100644
@@ -447,6 +447,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_private_dual_rate_n_max = 0,
 	.shaper_private_rate_min = 1,
 	.shaper_private_rate_max = UINT32_MAX,
+	.shaper_private_packet_mode_supported = 0,
+	.shaper_private_byte_mode_supported = 1,
 
 	.shaper_shared_n_max = UINT32_MAX,
 	.shaper_shared_n_nodes_per_shaper_max = UINT32_MAX,
@@ -454,6 +456,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_shared_dual_rate_n_max = 0,
 	.shaper_shared_rate_min = 1,
 	.shaper_shared_rate_max = UINT32_MAX,
+	.shaper_shared_packet_mode_supported = 0,
+	.shaper_shared_byte_mode_supported = 1,
 
 	.shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
 	.shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
@@ -463,6 +467,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.sched_wfq_n_children_per_group_max = UINT32_MAX,
 	.sched_wfq_n_groups_max = 1,
 	.sched_wfq_weight_max = UINT32_MAX,
+	.sched_wfq_packet_mode_supported = 0,
+	.sched_wfq_byte_mode_supported = 1,
 
 	.cman_wred_packet_mode_supported = WRED_SUPPORTED,
 	.cman_wred_byte_mode_supported = 0,
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported = WRED_SUPPORTED,
@@ -736,7 +773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -744,6 +785,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -762,6 +809,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
lib/librte_ethdev/rte_tm.h +194 -2

290 lines not on this page · raw message

Signature · 1 line
2.8.4
#30 lore raw

PATCH v4 1/4 ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE
- Fix shaper_profile_check() with packet mode check
- Fix typo's

v2..v3:
- Fix typo's
- Add shaper_shared_(packet, byte)_mode_supported in level and node cap
- Fix comment in pkt_length_adjust.
- Move rte_eth_softnic_tm.c capability update to patch 1/4 to
avoid compilations issues in node and level cap array in softnicpmd. ../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: warning: braces around scalar initializer
{.nonleaf = {
../drivers/net/softnic/rte_eth_softnic_tm.c:782:3: note: (near initialization for ‘tm_node_cap[0].shaper_shared_byte_mode_supported’) ../drivers/net/softnic/rte_eth_softnic_tm.c:782:4: error: field name not in record or union initializer
{.nonleaf = {

v1..v2:
- Add seperate capability for shaper and scheduler pktmode and bytemode.
- Add packet_mode field in struct rte_tm_shaper_params to indicate packet mode shaper profile.

 drivers/net/softnic/rte_eth_softnic_tm.c |  72 +++++++++++
 lib/librte_ethdev/rte_tm.h               | 197 ++++++++++++++++++++++++++++++-
 2 files changed, 267 insertions(+), 2 deletions(-)
drivers/net/softnic/rte_eth_softnic_tm.c +72 -0
index 80a470c..d309763 100644
@@ -447,6 +447,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_private_dual_rate_n_max = 0,
 	.shaper_private_rate_min = 1,
 	.shaper_private_rate_max = UINT32_MAX,
+	.shaper_private_packet_mode_supported = 0,
+	.shaper_private_byte_mode_supported = 1,
 
 	.shaper_shared_n_max = UINT32_MAX,
 	.shaper_shared_n_nodes_per_shaper_max = UINT32_MAX,
@@ -454,6 +456,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.shaper_shared_dual_rate_n_max = 0,
 	.shaper_shared_rate_min = 1,
 	.shaper_shared_rate_max = UINT32_MAX,
+	.shaper_shared_packet_mode_supported = 0,
+	.shaper_shared_byte_mode_supported = 1,
 
 	.shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
 	.shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS,
@@ -463,6 +467,8 @@ static const struct rte_tm_capabilities tm_cap = {
 	.sched_wfq_n_children_per_group_max = UINT32_MAX,
 	.sched_wfq_n_groups_max = 1,
 	.sched_wfq_weight_max = UINT32_MAX,
+	.sched_wfq_packet_mode_supported = 0,
+	.sched_wfq_byte_mode_supported = 1,
 
 	.cman_wred_packet_mode_supported = WRED_SUPPORTED,
 	.cman_wred_byte_mode_supported = 0,
@@ -548,13 +554,19 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -572,7 +584,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max = UINT32_MAX,
 			.sched_sp_n_priorities_max = 1,
@@ -580,9 +596,14 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_groups_max = 1,
 #ifdef RTE_SCHED_SUBPORT_TC_OV
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #else
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 #endif
+
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
 	},
@@ -599,7 +620,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.sched_n_children_max =
 				RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE,
@@ -608,6 +633,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -625,7 +652,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 1,
 			.shaper_private_rate_max = UINT32_MAX,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 1,
 			.shaper_shared_n_max = 1,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 1,
 
 			.sched_n_children_max =
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
@@ -634,6 +665,8 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 
 			.stats_mask = STATS_MASK_DEFAULT,
 		} },
@@ -651,7 +684,11 @@ static const struct rte_tm_level_capabilities tm_level_cap[] = {
 			.shaper_private_dual_rate_supported = 0,
 			.shaper_private_rate_min = 0,
 			.shaper_private_rate_max = 0,
+			.shaper_private_packet_mode_supported = 0,
+			.shaper_private_byte_mode_supported = 0,
 			.shaper_shared_n_max = 0,
+			.shaper_shared_packet_mode_supported = 0,
+			.shaper_shared_byte_mode_supported = 0,
 
 			.cman_head_drop_supported = 0,
 			.cman_wred_packet_mode_supported = WRED_SUPPORTED,
@@ -736,7 +773,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -744,6 +785,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -754,7 +797,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max = UINT32_MAX,
@@ -762,6 +809,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = UINT32_MAX,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -772,7 +821,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -782,6 +835,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 			.sched_wfq_n_children_per_group_max = 1,
 			.sched_wfq_n_groups_max = 0,
 			.sched_wfq_weight_max = 1,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 0,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -792,7 +847,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 1,
 		.shaper_private_rate_max = UINT32_MAX,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 1,
 		.shaper_shared_n_max = 1,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 1,
 
 		{.nonleaf = {
 			.sched_n_children_max =
@@ -802,6 +861,8 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 				RTE_SCHED_BE_QUEUES_PER_PIPE,
 			.sched_wfq_n_groups_max = 1,
 			.sched_wfq_weight_max = UINT32_MAX,
+			.sched_wfq_packet_mode_supported = 0,
+			.sched_wfq_byte_mode_supported = 1,
 		} },
 
 		.stats_mask = STATS_MASK_DEFAULT,
@@ -812,7 +873,11 @@ static const struct rte_tm_node_capabilities tm_node_cap[] = {
 		.shaper_private_dual_rate_supported = 0,
 		.shaper_private_rate_min = 0,
 		.shaper_private_rate_max = 0,
+		.shaper_private_packet_mode_supported = 0,
+		.shaper_private_byte_mode_supported = 0,
 		.shaper_shared_n_max = 0,
+		.shaper_shared_packet_mode_supported = 0,
+		.shaper_shared_byte_mode_supported = 0,
 
 
 		{.leaf = {
@@ -947,6 +1012,13 @@ shaper_profile_check(struct rte_eth_dev *dev,
 			NULL,
 			rte_strerror(EINVAL));
 
+	/* Packet mode is not supported. */
+	if (profile->packet_mode != 0)
+		return -rte_tm_error_set(error,
+			EINVAL,
+			RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE,
+			NULL,
+			rte_strerror(EINVAL));
 	return 0;
 }
 
lib/librte_ethdev/rte_tm.h +195 -2

297 lines not on this page · raw message

Signature · 1 line
2.8.4
#31 lore raw

PATCH v4 2/4 drivers/net: update tm capability for existing pmds

From: Nithin Dabilpuram <[email protected]>

Since existing PMD's support shaper byte mode and scheduler wfq byte mode, update the same in their port/level/node capabilities that are added. SoftNIC PMD is already upto date with new capabilities.

---
v3..v4:
- No change

v2..v3:
- Update node/level cap with shaper_shared_(packet, byte)_mode_supported.

v2:
- Newly included patch to change exiting pmd's with tm support of byte mode to show the same in port/level/node cap.

 drivers/net/i40e/i40e_tm.c     | 22 ++++++++++++++++++++++
 drivers/net/ipn3ke/ipn3ke_tm.c | 38 ++++++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_tm.c   | 22 ++++++++++++++++++++++
 drivers/net/mvpp2/mrvl_tm.c    | 14 ++++++++++++++
 4 files changed, 96 insertions(+)
drivers/net/i40e/i40e_tm.c +22 -0
index c76760c..5d722f9 100644
@@ -160,12 +160,16 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->func_caps.num_tx_qp;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -179,6 +183,8 @@ i40e_tm_capabilities_get(struct rte_eth_dev *dev,
 	 * So, all the nodes should have the same weight.
 	 */
 	cap->sched_wfq_weight_max = 1;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	cap->cman_head_drop_supported = 0;
 	cap->dynamic_update_mask = 0;
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD;
@@ -754,7 +760,11 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 40Gbps -> 5GBps */
 		cap->nonleaf.shaper_private_rate_max = 5000000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 		if (level_id == I40E_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
 				I40E_MAX_TRAFFIC_CLASS;
@@ -765,6 +775,8 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -776,7 +788,11 @@ i40e_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->leaf.shaper_private_rate_max = 5000000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
+	cap->leaf.shaper_shared_packet_mode_supported = 0;
+	cap->leaf.shaper_shared_byte_mode_supported = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
 	cap->leaf.cman_wred_context_shared_n_max = 0;
@@ -817,7 +833,11 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 40Gbps -> 5GBps */
 	cap->shaper_private_rate_max = 5000000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	if (node_type == I40E_TM_NODE_TYPE_QUEUE) {
 		cap->leaf.cman_head_drop_supported = false;
@@ -834,6 +854,8 @@ i40e_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/ipn3ke/ipn3ke_tm.c +38 -0
index 5a16c5f..17ac026 100644
@@ -440,6 +440,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_private_dual_rate_n_max = 0;
 	cap->shaper_private_rate_min = 1;
 	cap->shaper_private_rate_max = 1 + IPN3KE_TM_VT_NODE_NUM;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
@@ -447,6 +449,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	cap->shaper_pkt_length_adjust_min = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
 	cap->shaper_pkt_length_adjust_max = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
@@ -456,6 +460,8 @@ ipn3ke_tm_capabilities_get(__rte_unused struct rte_eth_dev *dev,
 	cap->sched_wfq_n_children_per_group_max = UINT32_MAX;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = UINT32_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->cman_wred_packet_mode_supported = 0;
 	cap->cman_wred_byte_mode_supported = 0;
@@ -517,13 +523,19 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -539,13 +551,19 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_dual_rate_supported = 0;
 		cap->nonleaf.shaper_private_rate_min = 1;
 		cap->nonleaf.shaper_private_rate_max = UINT32_MAX;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 0;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->nonleaf.stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -561,7 +579,11 @@ ipn3ke_tm_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_dual_rate_supported = 0;
 		cap->leaf.shaper_private_rate_min = 0;
 		cap->leaf.shaper_private_rate_max = 0;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.shaper_shared_n_max = 0;
+		cap->leaf.shaper_shared_packet_mode_supported = 0;
+		cap->leaf.shaper_shared_byte_mode_supported = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
 		cap->leaf.cman_wred_packet_mode_supported = WRED_SUPPORTED;
@@ -632,7 +654,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -640,6 +666,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_VT_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -649,7 +677,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 1;
 		cap->shaper_private_rate_max = UINT32_MAX;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 1;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->nonleaf.sched_n_children_max = IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -657,6 +689,8 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 			IPN3KE_TM_COS_NODE_NUM;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 
 		cap->stats_mask = STATS_MASK_DEFAULT;
 		break;
@@ -666,7 +700,11 @@ ipn3ke_tm_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->shaper_private_dual_rate_supported = 0;
 		cap->shaper_private_rate_min = 0;
 		cap->shaper_private_rate_max = 0;
+		cap->shaper_private_packet_mode_supported = 0;
+		cap->shaper_private_byte_mode_supported = 0;
 		cap->shaper_shared_n_max = 0;
+		cap->shaper_shared_packet_mode_supported = 0;
+		cap->shaper_shared_byte_mode_supported = 0;
 
 		cap->leaf.cman_head_drop_supported = 0;
 		cap->leaf.cman_wred_packet_mode_supported = WRED_SUPPORTED;
drivers/net/ixgbe/ixgbe_tm.c +22 -0
index 73845a7..a8407e7 100644
@@ -168,12 +168,16 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
 	cap->shaper_shared_n_nodes_per_shaper_max = 0;
 	cap->shaper_shared_n_shapers_per_node_max = 0;
 	cap->shaper_shared_dual_rate_n_max = 0;
 	cap->shaper_shared_rate_min = 0;
 	cap->shaper_shared_rate_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 	cap->sched_n_children_max = hw->mac.max_tx_queues;
 	/**
 	 * HW supports SP. But no plan to support it now.
@@ -182,6 +186,8 @@ ixgbe_tm_capabilities_get(struct rte_eth_dev *dev,
 	cap->sched_sp_n_priorities_max = 1;
 	cap->sched_wfq_n_children_per_group_max = 0;
 	cap->sched_wfq_n_groups_max = 0;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 0;
 	/**
 	 * SW only supports fair round robin now.
 	 * So, all the nodes should have the same weight.
@@ -875,7 +881,11 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_rate_min = 0;
 		/* 10Gbps -> 1.25GBps */
 		cap->nonleaf.shaper_private_rate_max = 1250000000ull;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 		cap->nonleaf.shaper_shared_n_max = 0;
+		cap->nonleaf.shaper_shared_packet_mode_supported = 0;
+		cap->nonleaf.shaper_shared_byte_mode_supported = 0;
 		if (level_id == IXGBE_TM_NODE_TYPE_PORT)
 			cap->nonleaf.sched_n_children_max =
 				IXGBE_DCB_MAX_TRAFFIC_CLASS;
@@ -886,6 +896,8 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 		cap->nonleaf.stats_mask = 0;
 
 		return 0;
@@ -897,7 +909,11 @@ ixgbe_level_capabilities_get(struct rte_eth_dev *dev,
 	cap->leaf.shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->leaf.shaper_private_rate_max = 1250000000ull;
+	cap->leaf.shaper_private_packet_mode_supported = 0;
+	cap->leaf.shaper_private_byte_mode_supported = 1;
 	cap->leaf.shaper_shared_n_max = 0;
+	cap->leaf.shaper_shared_packet_mode_supported = 0;
+	cap->leaf.shaper_shared_byte_mode_supported = 0;
 	cap->leaf.cman_head_drop_supported = false;
 	cap->leaf.cman_wred_context_private_supported = true;
 	cap->leaf.cman_wred_context_shared_n_max = 0;
@@ -938,7 +954,11 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_rate_min = 0;
 	/* 10Gbps -> 1.25GBps */
 	cap->shaper_private_rate_max = 1250000000ull;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 	cap->shaper_shared_n_max = 0;
+	cap->shaper_shared_packet_mode_supported = 0;
+	cap->shaper_shared_byte_mode_supported = 0;
 
 	if (node_type == IXGBE_TM_NODE_TYPE_QUEUE) {
 		cap->leaf.cman_head_drop_supported = false;
@@ -955,6 +975,8 @@ ixgbe_node_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.sched_wfq_n_children_per_group_max = 0;
 		cap->nonleaf.sched_wfq_n_groups_max = 0;
 		cap->nonleaf.sched_wfq_weight_max = 1;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 0;
 	}
 
 	cap->stats_mask = 0;
drivers/net/mvpp2/mrvl_tm.c +14 -0
index 3de8997..e98f576 100644
@@ -193,12 +193,16 @@ mrvl_capabilities_get(struct rte_eth_dev *dev,
 	cap->shaper_private_n_max = cap->shaper_n_max;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	cap->sched_n_children_max = dev->data->nb_tx_queues;
 	cap->sched_sp_n_priorities_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_children_per_group_max = dev->data->nb_tx_queues;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+	cap->sched_wfq_packet_mode_supported = 0;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask = RTE_TM_UPDATE_NODE_SUSPEND_RESUME |
 				   RTE_TM_UPDATE_NODE_STATS;
@@ -244,6 +248,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->nonleaf.shaper_private_supported = 1;
 		cap->nonleaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->nonleaf.shaper_private_rate_max = priv->rate_max;
+		cap->nonleaf.shaper_private_packet_mode_supported = 0;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
 		cap->nonleaf.sched_sp_n_priorities_max = 1;
@@ -251,6 +257,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->nonleaf.stats_mask = RTE_TM_STATS_N_PKTS |
 					  RTE_TM_STATS_N_BYTES;
 	} else { /* level_id == MRVL_NODE_QUEUE */
@@ -261,6 +269,8 @@ mrvl_level_capabilities_get(struct rte_eth_dev *dev,
 		cap->leaf.shaper_private_supported = 1;
 		cap->leaf.shaper_private_rate_min = MRVL_RATE_MIN;
 		cap->leaf.shaper_private_rate_max = priv->rate_max;
+		cap->leaf.shaper_private_packet_mode_supported = 0;
+		cap->leaf.shaper_private_byte_mode_supported = 1;
 		cap->leaf.stats_mask = RTE_TM_STATS_N_PKTS;
 	}
 
@@ -300,6 +310,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 	cap->shaper_private_supported = 1;
 	cap->shaper_private_rate_min = MRVL_RATE_MIN;
 	cap->shaper_private_rate_max = priv->rate_max;
+	cap->shaper_private_packet_mode_supported = 0;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	if (node->type == MRVL_NODE_PORT) {
 		cap->nonleaf.sched_n_children_max = dev->data->nb_tx_queues;
@@ -308,6 +320,8 @@ mrvl_node_capabilities_get(struct rte_eth_dev *dev, uint32_t node_id,
 			dev->data->nb_tx_queues;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MRVL_WEIGHT_MAX;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 0;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 		cap->stats_mask = RTE_TM_STATS_N_PKTS | RTE_TM_STATS_N_BYTES;
 	} else {
 		cap->stats_mask = RTE_TM_STATS_N_PKTS;
Signature · 1 line
2.8.4
#32 lore raw

PATCH v4 3/4 app/testpmd: add tm cmd for non leaf and shaper pktmode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

Add TM command to enable packet mode for all SP children in non leaf node. This is a new command as
"add tm nonleaf node pktmode".

Also add support to shaper profile add command to take packet mode parameter used to setup shaper in packet mode. This adds an extra argument "packet_mode" to shaper profile add command "add port tm node shaper profile" as last argument.

This patch also dumps new tm port/level/node capabilities sched_wfq_packet_mode_supported, sched_wfq_byte_mode_supported, shaper_private_packet_mode_supported, shaper_private_byte_mode_supported, shaper_shared_packet_mode_supported, shaper_shared_byte_mode_supported.

---

v3..v4:
- Add packet mode error string.

v2..v3:
- Update cmdline dump of node/level cap.

v1..v2:
- Update tm capability show cmd to dump lastest pktmode/bytemode fields of v2.
- Update existing shaper profile add command to take last argument as pkt_mode and update struct rte_tm_shaper_params:packet_mode with the same.
- Update documentation with latest command changes.

 app/test-pmd/cmdline.c                      |   9 +-
 app/test-pmd/cmdline_tm.c                   | 222 ++++++++++++++++++++++++++++
 app/test-pmd/cmdline_tm.h                   |   1 +
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  40 ++++-
 4 files changed, 266 insertions(+), 6 deletions(-)
app/test-pmd/cmdline.c +8 -1
index 22fb23a..880ec61 100644
@@ -1189,7 +1189,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"add port tm node shaper profile (port_id) (shaper_profile_id)"
 			" (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size)"
-			" (packet_length_adjust)\n"
+			" (packet_length_adjust) (packet_mode)\n"
 			"       Add port tm node private shaper profile.\n\n"
 
 			"del port tm node shaper profile (port_id) (shaper_profile_id)\n"
@@ -1221,6 +1221,12 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
 			"       Add port tm nonleaf node.\n\n"
 
+			"add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id)"
+			" (priority) (weight) (level_id) (shaper_profile_id)"
+			" (n_sp_priorities) (stats_mask) (n_shared_shapers)"
+			" [(shared_shaper_id_0) (shared_shaper_id_1)...]\n"
+			"       Add port tm nonleaf node with pkt mode enabled.\n\n"
+
 			"add port tm leaf node (port_id) (node_id) (parent_node_id)"
 			" (priority) (weight) (level_id) (shaper_profile_id)"
 			" (cman_mode) (wred_profile_id) (stats_mask) (n_shared_shapers)"
@@ -19655,6 +19661,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,
+	(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node_pmode,
 	(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,
 	(cmdline_parse_inst_t *)&cmd_del_port_tm_node,
 	(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,
app/test-pmd/cmdline_tm.c +222 -0

312 lines not on this page · raw message

app/test-pmd/cmdline_tm.h +1 -0
index 950cb75..e59c15c 100644
@@ -19,6 +19,7 @@ extern cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile;
 extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node;
+extern cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node_pmode;
 extern cmdline_parse_inst_t cmd_add_port_tm_leaf_node;
 extern cmdline_parse_inst_t cmd_del_port_tm_node;
 extern cmdline_parse_inst_t cmd_set_port_tm_node_parent;
doc/guides/testpmd_app_ug/testpmd_funcs.rst +35 -5
index a360ecc..7513a97 100644
@@ -2842,19 +2842,22 @@ Add the port traffic management private shaper profile::
 
    testpmd> add port tm node shaper profile (port_id) (shaper_profile_id) \
    (cmit_tb_rate) (cmit_tb_size) (peak_tb_rate) (peak_tb_size) \
-   (packet_length_adjust)
+   (packet_length_adjust) (packet_mode)
 
 where:
 
 * ``shaper_profile id``: Shaper profile ID for the new profile.
-* ``cmit_tb_rate``: Committed token bucket rate (bytes per second).
-* ``cmit_tb_size``: Committed token bucket size (bytes).
-* ``peak_tb_rate``: Peak token bucket rate (bytes per second).
-* ``peak_tb_size``: Peak token bucket size (bytes).
+* ``cmit_tb_rate``: Committed token bucket rate (bytes per second or packets per second).
+* ``cmit_tb_size``: Committed token bucket size (bytes or packets).
+* ``peak_tb_rate``: Peak token bucket rate (bytes per second or packets per second).
+* ``peak_tb_size``: Peak token bucket size (bytes or packets).
 * ``packet_length_adjust``: The value (bytes) to be added to the length of
   each packet for the purpose of shaping. This parameter value can be used to
   correct the packet length with the framing overhead bytes that are consumed
   on the wire.
+* ``packet_mode``: Shaper configured in packet mode. This parameter value if
+  zero, configures shaper in byte mode and if non-zero configures it in packet
+  mode.
 
 Delete port traffic management private shaper profile
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2979,6 +2982,33 @@ where:
 * ``n_shared_shapers``: Number of shared shapers.
 * ``shared_shaper_id``: Shared shaper id.
 
+Add port traffic management hierarchy nonleaf node with packet mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add nonleaf node with packet mode to port traffic management hierarchy::
+
+   testpmd> add port tm nonleaf node pktmode (port_id) (node_id) (parent_node_id) \
+   (priority) (weight) (level_id) (shaper_profile_id) \
+   (n_sp_priorities) (stats_mask) (n_shared_shapers) \
+   [(shared_shaper_0) (shared_shaper_1) ...] \
+
+where:
+
+* ``parent_node_id``: Node ID of the parent.
+* ``priority``: Node priority (highest node priority is zero). This is used by
+  the SP algorithm running on the parent node for scheduling this node.
+* ``weight``: Node weight (lowest weight is one). The node weight is relative
+  to the weight sum of all siblings that have the same priority. It is used by
+  the WFQ algorithm running on the parent node for scheduling this node.
+* ``level_id``: Hierarchy level of the node.
+* ``shaper_profile_id``: Shaper profile ID of the private shaper to be used by
+  the node.
+* ``n_sp_priorities``: Number of strict priorities. Packet mode is enabled on
+  all of them.
+* ``stats_mask``: Mask of statistics counter types to be enabled for this node.
+* ``n_shared_shapers``: Number of shared shapers.
+* ``shared_shaper_id``: Shared shaper id.
+
 Add port traffic management hierarchy leaf node
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Signature · 1 line
2.8.4
#33 lore raw

PATCH v4 4/4 net/octeontx2: support tm length adjust and pkt mode

In reply to Nithin Dabilpuram

From: Nithin Dabilpuram <[email protected]>

This patch adds support to packet length adjust TM feature for private shaper. It also adds support to packet mode feature that applies both to private shaper and node DWRR scheduling of SP children.

---

v3..v4:
- No change.

v2..v3:
- No change.

v1..v2:
- Newly included patch.

 drivers/net/octeontx2/otx2_tm.c | 140 +++++++++++++++++++++++++++++++++-------
 drivers/net/octeontx2/otx2_tm.h |   5 ++
 2 files changed, 122 insertions(+), 23 deletions(-)
drivers/net/octeontx2/otx2_tm.c +117 -23
index f94618d..fa7d21b 100644
@@ -336,18 +336,25 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 {
 	struct shaper_params cir, pir;
 	uint32_t schq = tm_node->hw_id;
+	uint64_t adjust = 0;
 	uint8_t k = 0;
 
 	memset(&cir, 0, sizeof(cir));
 	memset(&pir, 0, sizeof(pir));
 	shaper_config_to_nix(profile, &cir, &pir);
 
-	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, "
-		    "pir %" PRIu64 "(%" PRIu64 "B),"
-		     " cir %" PRIu64 "(%" PRIu64 "B) (%p)",
-		     nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
-		     tm_node->id, pir.rate, pir.burst,
-		     cir.rate, cir.burst, tm_node);
+	/* Packet length adjust */
+	if (tm_node->pkt_mode)
+		adjust = 1;
+	else if (profile)
+		adjust = profile->params.pkt_length_adjust & 0x1FF;
+
+	otx2_tm_dbg("Shaper config node %s(%u) lvl %u id %u, pir %" PRIu64
+		    "(%" PRIu64 "B), cir %" PRIu64 "(%" PRIu64 "B)"
+		    "adjust 0x%" PRIx64 "(pktmode %u) (%p)",
+		    nix_hwlvl2str(tm_node->hw_lvl), schq, tm_node->lvl,
+		    tm_node->id, pir.rate, pir.burst, cir.rate, cir.burst,
+		    adjust, tm_node->pkt_mode, tm_node);
 
 	switch (tm_node->hw_lvl) {
 	case NIX_TXSCH_LVL_SMQ:
@@ -364,7 +371,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED ALG */
 		reg[k] = NIX_AF_MDQX_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL4:
@@ -381,7 +390,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL4X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 		break;
 	case NIX_TXSCH_LVL_TL3:
@@ -398,7 +409,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL3X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -416,7 +429,9 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 
 		/* Configure RED algo */
 		reg[k] = NIX_AF_TL2X_SHAPE(schq);
-		regval[k] = ((uint64_t)tm_node->red_algo << 9);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->red_algo << 9 |
+			     (uint64_t)tm_node->pkt_mode << 24);
 		k++;
 
 		break;
@@ -426,6 +441,12 @@ prepare_tm_shaper_reg(struct otx2_nix_tm_node *tm_node,
 		regval[k] = (cir.rate && cir.burst) ?
 				(shaper2regval(&cir) | 1) : 0;
 		k++;
+
+		/* Configure length disable and adjust */
+		reg[k] = NIX_AF_TL1X_SHAPE(schq);
+		regval[k] = (adjust |
+			     (uint64_t)tm_node->pkt_mode << 24);
+		k++;
 		break;
 	}
 
@@ -773,6 +794,15 @@ nix_tm_node_add_to_list(struct otx2_eth_dev *dev, uint32_t node_id,
 	tm_node->flags = 0;
 	if (user)
 		tm_node->flags = NIX_TM_NODE_USER;
+
+	/* Packet mode */
+	if (!nix_tm_is_leaf(dev, lvl) &&
+	    ((profile && profile->params.packet_mode) ||
+	     (params->nonleaf.wfq_weight_mode &&
+	      params->nonleaf.n_sp_priorities &&
+	      !params->nonleaf.wfq_weight_mode[0])))
+		tm_node->pkt_mode = 1;
+
 	rte_memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
 
 	if (profile)
@@ -1873,8 +1903,10 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->shaper_private_dual_rate_n_max = max_nr_nodes;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
-	cap->shaper_pkt_length_adjust_min = 0;
-	cap->shaper_pkt_length_adjust_max = 0;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
+	cap->shaper_pkt_length_adjust_min = NIX_LENGTH_ADJUST_MIN;
+	cap->shaper_pkt_length_adjust_max = NIX_LENGTH_ADJUST_MAX;
 
 	/* Schedule Capabilities */
 	cap->sched_n_children_max = rsp->schq[NIX_TXSCH_LVL_MDQ];
@@ -1882,6 +1914,8 @@ otx2_nix_tm_capa_get(struct rte_eth_dev *eth_dev,
 	cap->sched_wfq_n_children_per_group_max = cap->sched_n_children_max;
 	cap->sched_wfq_n_groups_max = 1;
 	cap->sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->sched_wfq_packet_mode_supported = 1;
+	cap->sched_wfq_byte_mode_supported = 1;
 
 	cap->dynamic_update_mask =
 		RTE_TM_UPDATE_NODE_PARENT_KEEP_LEVEL |
@@ -1944,12 +1978,16 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_tm_have_tl1_access(dev) ? false : true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		cap->nonleaf.sched_n_children_max = rsp->schq[hw_lvl - 1];
 		cap->nonleaf.sched_sp_n_priorities_max =
 					nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 		if (nix_tm_have_tl1_access(dev))
 			cap->nonleaf.stats_mask =
@@ -1966,6 +2004,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 		cap->nonleaf.shaper_private_dual_rate_supported = true;
 		cap->nonleaf.shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 		cap->nonleaf.shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+		cap->nonleaf.shaper_private_packet_mode_supported = 1;
+		cap->nonleaf.shaper_private_byte_mode_supported = 1;
 
 		/* MDQ doesn't support Strict Priority */
 		if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -1977,6 +2017,8 @@ otx2_nix_tm_level_capa_get(struct rte_eth_dev *eth_dev, uint32_t lvl,
 			nix_max_prio(dev, hw_lvl) + 1;
 		cap->nonleaf.sched_wfq_n_groups_max = 1;
 		cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+		cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+		cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 	} else {
 		/* unsupported level */
 		error->type = RTE_TM_ERROR_TYPE_UNSPECIFIED;
@@ -2029,6 +2071,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		(hw_lvl == NIX_TXSCH_LVL_TL1) ? false : true;
 	cap->shaper_private_rate_min = MIN_SHAPER_RATE / 8;
 	cap->shaper_private_rate_max = MAX_SHAPER_RATE / 8;
+	cap->shaper_private_packet_mode_supported = 1;
+	cap->shaper_private_byte_mode_supported = 1;
 
 	/* Non Leaf Scheduler */
 	if (hw_lvl == NIX_TXSCH_LVL_MDQ)
@@ -2041,6 +2085,8 @@ otx2_nix_tm_node_capa_get(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		cap->nonleaf.sched_n_children_max;
 	cap->nonleaf.sched_wfq_n_groups_max = 1;
 	cap->nonleaf.sched_wfq_weight_max = MAX_SCHED_WEIGHT;
+	cap->nonleaf.sched_wfq_packet_mode_supported = 1;
+	cap->nonleaf.sched_wfq_byte_mode_supported = 1;
 
 	if (hw_lvl == NIX_TXSCH_LVL_TL1)
 		cap->stats_mask = RTE_TM_STATS_N_PKTS_RED_DROPPED |
@@ -2096,6 +2142,13 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (params->pkt_length_adjust < NIX_LENGTH_ADJUST_MIN ||
+	    params->pkt_length_adjust > NIX_LENGTH_ADJUST_MAX) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN;
+		error->message = "length adjust invalid";
+		return -EINVAL;
+	}
+
 	profile = rte_zmalloc("otx2_nix_tm_shaper_profile",
 			      sizeof(struct otx2_nix_tm_shaper_profile), 0);
 	if (!profile)
@@ -2108,13 +2161,14 @@ otx2_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev,
 
 	otx2_tm_dbg("Added TM shaper profile %u, "
 		    " pir %" PRIu64 " , pbs %" PRIu64 ", cir %" PRIu64
-		    ", cbs %" PRIu64 " , adj %u",
+		    ", cbs %" PRIu64 " , adj %u, pkt mode %d",
 		    profile_id,
 		    params->peak.rate * 8,
 		    params->peak.size,
 		    params->committed.rate * 8,
 		    params->committed.size,
-		    params->pkt_length_adjust);
+		    params->pkt_length_adjust,
+		    params->packet_mode);
 
 	/* Translate rate as bits per second */
 	profile->params.peak.rate = profile->params.peak.rate * 8;
@@ -2170,9 +2224,11 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		     struct rte_tm_error *error)
 {
 	struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+	struct otx2_nix_tm_shaper_profile *profile = NULL;
 	struct otx2_nix_tm_node *parent_node;
-	int rc, clear_on_fail = 0;
-	uint32_t exp_next_lvl;
+	int rc, pkt_mode, clear_on_fail = 0;
+	uint32_t exp_next_lvl, i;
+	uint32_t profile_id;
 	uint16_t hw_lvl;
 
 	/* we don't support dynamic updates */
@@ -2234,13 +2290,45 @@ otx2_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
 		return -EINVAL;
 	}
 
-	/* Check if shaper profile exists for non leaf node */
-	if (!nix_tm_is_leaf(dev, lvl) &&
-	    params->shaper_profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE &&
-	    !nix_tm_shaper_profile_search(dev, params->shaper_profile_id)) {
-		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
-		error->message = "invalid shaper profile";
-		return -EINVAL;
+	if (!nix_tm_is_leaf(dev, lvl)) {
+		/* Check if shaper profile exists for non leaf node */
+		profile_id = params->shaper_profile_id;
+		profile = nix_tm_shaper_profile_search(dev, profile_id);
+		if (profile_id != RTE_TM_SHAPER_PROFILE_ID_NONE && !profile) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+			error->message = "invalid shaper profile";
+			return -EINVAL;
+		}
+
+		/* Minimum static priority count is 1 */
+		if (!params->nonleaf.n_sp_priorities ||
+		    params->nonleaf.n_sp_priorities > TXSCH_TLX_SP_PRIO_MAX) {
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
+			error->message = "invalid sp priorities";
+			return -EINVAL;
+		}
+
+		pkt_mode = 0;
+		/* Validate weight mode */
+		for (i = 0; i < params->nonleaf.n_sp_priorities &&
+		     params->nonleaf.wfq_weight_mode; i++) {
+			pkt_mode = !params->nonleaf.wfq_weight_mode[i];
+			if (pkt_mode == !params->nonleaf.wfq_weight_mode[0])
+				continue;
+
+			error->type =
+				RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
+			error->message = "unsupported weight mode";
+			return -EINVAL;
+		}
+
+		if (profile && params->nonleaf.n_sp_priorities &&
+		    pkt_mode != profile->params.packet_mode) {
+			error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE;
+			error->message = "shaper wfq packet mode mismatch";
+			return -EINVAL;
+		}
 	}
 
 	/* Check if there is second DWRR already in siblings or holes in prio */
@@ -2482,6 +2570,12 @@ otx2_nix_tm_node_shaper_update(struct rte_eth_dev *eth_dev,
 		}
 	}
 
+	if (profile && profile->params.packet_mode != tm_node->pkt_mode) {
+		error->type = RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID;
+		error->message = "shaper profile pkt mode mismatch";
+		return -EINVAL;
+	}
+
 	tm_node->params.shaper_profile_id = profile_id;
 
 	/* Nothing to do if not yet committed */
drivers/net/octeontx2/otx2_tm.h +5 -0
index 9675182..cdca987 100644
@@ -48,6 +48,7 @@ struct otx2_nix_tm_node {
 #define NIX_TM_NODE_USER	BIT_ULL(2)
 	/* Shaper algorithm for RED state @NIX_REDALG_E */
 	uint32_t red_algo:2;
+	uint32_t pkt_mode:1;
 
 	struct otx2_nix_tm_node *parent;
 	struct rte_tm_node_params params;
@@ -114,6 +115,10 @@ TAILQ_HEAD(otx2_nix_tm_shaper_profile_list, otx2_nix_tm_shaper_profile);
 #define MAX_SHAPER_RATE \
 	SHAPER_RATE(MAX_RATE_EXPONENT, MAX_RATE_MANTISSA, 0)
 
+/* Min is limited so that NIX_AF_SMQX_CFG[MINLEN]+ADJUST is not -ve */
+#define NIX_LENGTH_ADJUST_MIN ((int)-NIX_MIN_HW_FRS + 1)
+#define NIX_LENGTH_ADJUST_MAX 255
+
 /** TM Shaper - low level operations */
 
 /** NIX burst limits */
Signature · 1 line
2.8.4
Acked-by on v4 1/4
#34 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Nithin Dabilpuram
Quoted 29 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

Quoted 9 lines

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE
- Fix shaper_profile_check() with packet mode check
- Fix typo's

#35 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 39 lines · Cristian
Quoted 29 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

Quoted 9 lines

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE
- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 2 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

#36 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

Regards,
Cristian

#37 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Ray, Neil, David, Luca, Kevin, what do you think?

#38 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 115 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Monday, April 27, 2020 5:13 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Luca Boccassi <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 6 lines · Cristian
Quoted 6 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin

Dabilpuram

Quoted 6 lines
Quoted 6 lines

<[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in

pkt

Quoted 11 lines
Quoted 11 lines

mode

Quoted 8 lines · Cristian
Quoted 8 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>;

Andrew

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte

mode

Quoted 23 lines
Quoted 23 lines
Quoted 10 lines
Quoted 10 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

Quoted 7 lines
Quoted 2 lines

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not

correctly marked when __rte_experimental ABI checker was introduced.

Quoted 2 lines

It is marked as experimental at the top of the rte_tm.h, similarly to other

APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function
declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11),
so marking them as experimental now will break the ABI. Not sure what to do,
cc'ed a few ABI related names for comment.

Quoted 7 lines

For me, we need to proceed as the experimental tag removed and APIs become
mature starting from v19.11, since this is what happened in practice, and remove
a few existing being experimental references in the doxygen comments.

Ray, Neil, David, Luca, Kevin, what do you think?

Hi Ferruh,

IMO your proposed approach is fixing the wrong problem and is probably not the right way of doing things.

This API is correctly marked as experimental in the header file rte_tm.h and in the MAINTAINERS file, therefore it should remain experimental, as more changes are expected from the people like Nithin and others currently upstreaming drivers for it.

For some reason, the __rte_experimental tags were not added to this file when the ABI checker was introduced, and this is the real problem that should be fixed.

Regards,
Cristian

#39 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

27/04/2020 18:28, Dumitrescu, Cristian:

Quoted 45 lines

From: Yigit, Ferruh <[email protected]>

Quoted 36 lines · Cristian
Quoted 6 lines

From: Yigit, Ferruh <[email protected]>

Quoted 5 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

Quoted 7 lines
Quoted 2 lines

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not

correctly marked when __rte_experimental ABI checker was introduced.

Quoted 2 lines

It is marked as experimental at the top of the rte_tm.h, similarly to other

APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function
declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11),
so marking them as experimental now will break the ABI. Not sure what to do,
cc'ed a few ABI related names for comment.

Quoted 7 lines

For me, we need to proceed as the experimental tag removed and APIs become
mature starting from v19.11, since this is what happened in practice, and remove
a few existing being experimental references in the doxygen comments.

Ray, Neil, David, Luca, Kevin, what do you think?

Quoted 7 lines

Hi Ferruh,

IMO your proposed approach is fixing the wrong problem and is probably not the right way of doing things.

This API is correctly marked as experimental in the header file rte_tm.h and in the MAINTAINERS file,

in rte_tm.h:
* @warning
* @b EXPERIMENTAL: this API may change without prior notice

in MAINTAINERS:
Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 1 line

therefore it should remain experimental,

in rte_ethdev_version.map:

	before 19.11: DPDK_17.08 {
	since 19.11: DPDK_20.0 {

When adding rte_tm in 17.08:
http://git.dpdk.org/dpdk/diff/lib/librte_ether/rte_ether_version.map?id=5d109deffa

In 17.08, early July 2017, the first EXPERIMENTAL section was declared in EAL:
http://git.dpdk.org/dpdk/diff/lib/librte_eal/linuxapp/eal/rte_eal_version.map?id=a3ee360f444

When adding rte_mtr in 17.11, all functions are made experimental:
http://git.dpdk.org/dpdk/diff/lib/librte_ether/rte_ethdev_version.map?id=6613ffe1

In 18.02, the tag __rte_experimental was introduced:

	http://git.dpdk.org/dpdk/commit/?id=7d540a3e735
and functions are marked (including rte_mtr but not rte_tm):
	http://git.dpdk.org/dpdk/commit/?id=77b7b81e32e
Quoted 2 lines

as more changes are expected from the people like Nithin and others currently upstreaming drivers for it.

They are doing changes in the API introduced 3 years ago.

Quoted 3 lines

For some reason, the __rte_experimental tags were not added to this file when the ABI checker was introduced,
and this is the real problem that should be fixed.

The mistake was done 2 years ago.
As maintainer of rte_tm code, you are expected to notice the issue. As maintainer of rte_mtr code, you were expected to review the change on the mtr functions being marked as experimental.
I am sorry that it took 2 years to discover the gap.

We can fix the ABI in the ABI-breakage window: in 20.11.

#40 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 103 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:30 PM
To: Dumitrescu, Cristian <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Luca Boccassi <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>; Richardson, Bruce <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

27/04/2020 18:28, Dumitrescu, Cristian:

Quoted 6 lines

From: Yigit, Ferruh <[email protected]>

Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>

Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning

[1],

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was

not

Quoted 3 lines
Quoted 3 lines

correctly marked when __rte_experimental ABI checker was introduced.

Quoted 2 lines

It is marked as experimental at the top of the rte_tm.h, similarly to

other

Quoted 1 line
Quoted 1 line

APIs introduced around same time, but it was not correctly picked up by

the

Quoted 1 line
Quoted 1 line

ABI check procedure when later introduced, so __rte_experimental was

not

Quoted 7 lines
Quoted 7 lines

added to every function.

Quoted 1 line

:(

Is it time to mature them?

Quoted 7 lines
Quoted 7 lines

As you said they are not marked as experimental both in header file (function
declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11),
so marking them as experimental now will break the ABI. Not sure what

to

Quoted 11 lines
Quoted 10 lines

do,
cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become
mature starting from v19.11, since this is what happened in practice, and remove
a few existing being experimental references in the doxygen comments.

Ray, Neil, David, Luca, Kevin, what do you think?

Quoted 7 lines

Hi Ferruh,

IMO your proposed approach is fixing the wrong problem and is probably not the right way of doing things.

This API is correctly marked as experimental in the header file rte_tm.h and in the MAINTAINERS file,

in rte_tm.h:
* @warning
* @b EXPERIMENTAL: this API may change without prior notice

in MAINTAINERS:
Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 1 line

therefore it should remain experimental,

in rte_ethdev_version.map:

	before 19.11: DPDK_17.08 {
	since 19.11: DPDK_20.0 {

When adding rte_tm in 17.08:
http://git.dpdk.org/dpdk/diff/lib/librte_ether/rte_ether_version.map?id=5
d109deffa

In 17.08, early July 2017, the first EXPERIMENTAL section was declared in EAL:
http://git.dpdk.org/dpdk/diff/lib/librte_eal/linuxapp/eal/rte_eal_version.m
ap?id=a3ee360f444

Quoted 10 lines

When adding rte_mtr in 17.11, all functions are made experimental:
http://git.dpdk.org/dpdk/diff/lib/librte_ether/rte_ethdev_version.map?id=
6613ffe1

In 18.02, the tag __rte_experimental was introduced:

	http://git.dpdk.org/dpdk/commit/?id=7d540a3e735
and functions are marked (including rte_mtr but not rte_tm):
	http://git.dpdk.org/dpdk/commit/?id=77b7b81e32e

Thanks, Thomas, for taking the time to put all the historic events in their proper sequence.

Quoted 6 lines
Quoted 2 lines

as more changes are expected from the people like Nithin and others currently upstreaming drivers for it.

They are doing changes in the API introduced 3 years ago.

Quoted 6 lines
Quoted 3 lines

For some reason, the __rte_experimental tags were not added to this file when the ABI checker was introduced,
and this is the real problem that should be fixed.

The mistake was done 2 years ago.
As maintainer of rte_tm code, you are expected to notice the issue.

Apologies for not noticing this gap at the time. As Thomas shows above, the __rte_experimental tags were introduced several DPDK releases after the rte_tm API.

Quoted 2 lines

As maintainer of rte_mtr code, you were expected to review the change on the mtr functions being marked as experimental.

I did.

Quoted 4 lines

I am sorry that it took 2 years to discover the gap.

We can fix the ABI in the ABI-breakage window: in 20.11.

#41 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Ferruh Yigit
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 2 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#42 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 92 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

Quoted 3 lines
Quoted 3 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#43 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 102 lines · Ferruh Yigit
Quoted 92 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet. Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#44 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 117 lines · Jerin Jacob

External Email

----------------------------------------------------------------------

Quoted 102 lines · Ferruh Yigit
Quoted 92 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=xJB0Qb2Q-1bl0hEDeknUjJqrCDc3z-h0F0e7kj8KvvI&s=R6xtRQRRIIzAilc5z52oYjyHNlvvJB_9SUsKBkpPC6g&e=

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet. Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 4 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Ray, Neil, David, Luca, Kevin, Ferruh

Any thoughts on this proposal ?

If it is fine, I can send a "Fixes:" patch to update experimental attribute in rte_tm.h for all functions so that 20.05 is having the right marking.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#45 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 123 lines · Nithin Dabilpuram
Quoted 117 lines · Jerin Jacob

External Email

----------------------------------------------------------------------

Quoted 102 lines · Ferruh Yigit
Quoted 92 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=xJB0Qb2Q-1bl0hEDeknUjJqrCDc3z-h0F0e7kj8KvvI&s=R6xtRQRRIIzAilc5z52oYjyHNlvvJB_9SUsKBkpPC6g&e=

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet. Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 4 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 6 lines

Ray, Neil, David, Luca, Kevin, Ferruh

Any thoughts on this proposal ?

If it is fine, I can send a "Fixes:" patch to update experimental attribute in rte_tm.h for all functions so that 20.05 is having the right marking.

Hi Nithin,

Please send the fix patch, we may continue to discuss in that patch but it would be good to have it ready.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#46 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Jerin Jacob
Quoted 103 lines · Jerin Jacob
Quoted 102 lines · Ferruh Yigit
Quoted 99 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 6 lines
Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet.

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 4 lines

Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Yes, this is where we are, both you and Cristian suggest API is not ready and should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad ones.

Quoted 10 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Ray, Neil, David, Luca, Kevin, what do you think?

#47 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 125 lines · Ferruh Yigit
Quoted 103 lines · Jerin Jacob
Quoted 102 lines · Ferruh Yigit
Quoted 99 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 6 lines
Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet.

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 4 lines

Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 15 lines

Yes, this is where we are, both you and Cristian suggest API is not ready and should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad ones.

Quoted 10 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Ray, Neil, David, Luca, Kevin, what do you think?

While I'm not called any of those names, allow me to give my 2c.

Since these are marked in binaries as part of the stable ABI, I think we need to honour that for the next two releases 20.05 and 20.08 [which means that we need to put in versioned functions for any changes, not that we can't change anything]

For 20.11, I think these should then have one of two options taken:
* have these "fixed" and ready to be marked as stable, and officially part of v21 ABI or
* mark them as experimental properly, and look to have them as part of the v22 or subsequent ABI

Given the comments here, I would tend towards the latter of the above two options, but that's really a decision for the maintainers.

Remember, this is not the first bug we have encountered where we messed up some ABI versions in the 19.11 release, and, like the previous one with the screwed up version number, I think we need to honour the ABI committments made, especially since in this case it's only for a few more months till 20.11 development starts.

/Bruce

#48 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 147 lines · Bruce Richardson
Quoted 120 lines · Ferruh Yigit
Quoted 98 lines · Jerin Jacob
Quoted 97 lines · Ferruh Yigit
Quoted 95 lines · Jerin Jacob
Quoted 79 lines · Ferruh Yigit
Quoted 61 lines · Cristian
Quoted 61 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 26 lines · Cristian
Quoted 26 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

Quoted 9 lines
Quoted 2 lines

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 6 lines
Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet.

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 4 lines

Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 10 lines

Yes, this is where we are, both you and Cristian suggest API is not ready and should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad ones.

Quoted 5 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 1 line
Quoted 1 line
Quoted 1 line

Ray, Neil, David, Luca, Kevin, what do you think?

While I'm not called any of those names, allow me to give my 2c.

Since these are marked in binaries as part of the stable ABI, I think we need to honour that for the next two releases 20.05 and 20.08 [which means that we need to put in versioned functions for any changes, not that we can't change anything]

For 20.11, I think these should then have one of two options taken:
* have these "fixed" and ready to be marked as stable, and officially part of v21 ABI or
* mark them as experimental properly, and look to have them as part of the v22 or subsequent ABI

Given the comments here, I would tend towards the latter of the above two options, but that's really a decision for the maintainers.

Quoted 7 lines

Remember, this is not the first bug we have encountered where we messed up some ABI versions in the 19.11 release, and, like the previous one with the screwed up version number, I think we need to honour the ABI committments made, especially since in this case it's only for a few more months till 20.11 development starts.

/Bruce

+1

If they are not ready now, they haven't been ready for the past 6 months either, so staying not ready for 6 more is the lesser evil.

Signature · 2 lines
Kind regards,
Luca Boccassi
#49 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 15 lines · Bruce Richardson
Quoted 14 lines · Ferruh Yigit
Quoted 13 lines · Jerin Jacob
Quoted 12 lines · Ferruh Yigit
Quoted 11 lines · Jerin Jacob
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Cristian
Quoted 8 lines

From: Yigit, Ferruh <[email protected]>

Quoted 7 lines · Cristian
Quoted 6 lines

From: Nithin Dabilpuram <[email protected]>

Quoted 5 lines

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
Quoted 10 lines
Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 9 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet.

rte_tm is implemented in 6 PMDs.

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

No, this is wrong.

Quoted 32 lines
Quoted 32 lines
Quoted 10 lines

Yes, this is where we are, both you and Cristian suggest API is not ready and should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad ones.

Quoted 5 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 1 line
Quoted 1 line
Quoted 1 line

Ray, Neil, David, Luca, Kevin, what do you think?

While I'm not called any of those names, allow me to give my 2c.

Since these are marked in binaries as part of the stable ABI, I think we need to honour that for the next two releases 20.05 and 20.08 [which means that we need to put in versioned functions for any changes, not that we can't change anything]

For 20.11, I think these should then have one of two options taken:
* have these "fixed" and ready to be marked as stable, and officially part of v21 ABI or
* mark them as experimental properly, and look to have them as part of the v22 or subsequent ABI

Given the comments here, I would tend towards the latter of the above two options, but that's really a decision for the maintainers.

Remember, this is not the first bug we have encountered where we messed up some ABI versions in the 19.11 release, and, like the previous one with the screwed up version number, I think we need to honour the ABI committments made, especially since in this case it's only for a few more months till 20.11 development starts.

Quoted 6 lines
Quoted 1 line

/Bruce

+1

If they are not ready now, they haven't been ready for the past 6 months either, so staying not ready for 6 more is the lesser evil.

This API is almost 3 years old (release 17.08).
That's good to improve it but we must respect the ABI contract that we all agreed.

Summary:
17.08: rte_tm is introduced.
17.11: rte_mtr is introduced as experimental, but rte_tm remains stable. 18.02: __rte_experimental tag is introduced (including for rte_mtr), but rte_tm remains untouched as it is in stable ABI.
19.11: stable ABI is frozen until 20.11
20.05: rte_tm improvement is blocked because of ABI breakage.

It should remind everybody of reviewing the new API and policies, and maintaining the existing code appropriately.

#50 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 133 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>

Quoted 3 lines · Cristian
Quoted 2 lines

From: Nithin Dabilpuram <[email protected]>

Quoted 1 line

This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Quoted 8 lines

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

Quoted 65 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Yes, this is where we are, both you and Cristian suggest API is not ready

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad

ones.

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 1 line
Quoted 1 line
Quoted 1 line

Ray, Neil, David, Luca, Kevin, what do you think?

While I'm not called any of those names, allow me to give my 2c.

Since these are marked in binaries as part of the stable ABI, I think we need to honour that for the next two releases 20.05 and 20.08 [which

means

Quoted 7 lines
Quoted 7 lines

that we need to put in versioned functions for any changes, not that we can't change anything]

For 20.11, I think these should then have one of two options taken:
* have these "fixed" and ready to be marked as stable, and officially part of v21 ABI or
* mark them as experimental properly, and look to have them as part of

the

Quoted 3 lines
Quoted 3 lines

v22 or subsequent ABI

Given the comments here, I would tend towards the latter of the above

two

Quoted 3 lines
Quoted 3 lines

options, but that's really a decision for the maintainers.

Remember, this is not the first bug we have encountered where we

messed up

Quoted 1 line
Quoted 1 line

some ABI versions in the 19.11 release, and, like the previous one with

the

Quoted 1 line
Quoted 1 line

screwed up version number, I think we need to honour the ABI

committments

Quoted 9 lines
Quoted 4 lines

made, especially since in this case it's only for a few more months till 20.11 development starts.

/Bruce

+1

If they are not ready now, they haven't been ready for the past 6 months either, so staying not ready for 6 more is the lesser evil.

This API is almost 3 years old (release 17.08).
That's good to improve it but we must respect the ABI contract that we all agreed.

Summary:
17.08: rte_tm is introduced.
17.11: rte_mtr is introduced as experimental, but rte_tm remains stable. 18.02: __rte_experimental tag is introduced (including for rte_mtr), but rte_tm remains untouched as it is in stable ABI.
19.11: stable ABI is frozen until 20.11
20.05: rte_tm improvement is blocked because of ABI breakage.

It should remind everybody of reviewing the new API and policies, and maintaining the existing code appropriately.

#51 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 136 lines · Cristian
Quoted 136 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>

Quoted 3 lines · Cristian
Quoted 2 lines

From: Nithin Dabilpuram <[email protected]>

Quoted 1 line

This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

/Bruce

#52 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 140 lines · Bruce Richardson
Quoted 139 lines · Cristian
Quoted 139 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>

Quoted 3 lines · Cristian
Quoted 2 lines

From: Nithin Dabilpuram <[email protected]>
This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

Deferring the patchet for this release.

Reminder that if the option "to mark rte_tm_* as experimental in v20.11" selected, requires deprecation notice before v20.11.

#53 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 154 lines · Ferruh Yigit

External Email

----------------------------------------------------------------------

Quoted 140 lines · Bruce Richardson
Quoted 139 lines · Cristian
Quoted 139 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>

Quoted 3 lines · Cristian

From: Nithin Dabilpuram <[email protected]>
This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=ej5sP3-cEhEoCTZOia-QivXqgljtzBcMLtZGs-5c-Uc&s=B8z_5mQ2xO3C1izjmRe2zBApMrCUcW6KcAN-adglhJQ&e=

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

Quoted 4 lines

Deferring the patchet for this release.

Reminder that if the option "to mark rte_tm_* as experimental in v20.11" selected, requires deprecation notice before v20.11.

Thanks Ferruh for reminder. I'll send a deprecation notice patch for the same.

#54 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 155 lines · Nithin Dabilpuram
Quoted 154 lines · Ferruh Yigit

External Email

----------------------------------------------------------------------

Quoted 149 lines · Bruce Richardson
Quoted 136 lines · Cristian
Quoted 136 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian
Quoted 4 lines

From: Yigit, Ferruh <[email protected]>
On 4/24/2020 11:28 AM, Dumitrescu, Cristian wrote:
From: Nithin Dabilpuram <[email protected]>
This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=ej5sP3-cEhEoCTZOia-QivXqgljtzBcMLtZGs-5c-Uc&s=B8z_5mQ2xO3C1izjmRe2zBApMrCUcW6KcAN-adglhJQ&e=

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental,
but it looks that this was not correctly marked
when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h,
similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure
when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

Quoted 7 lines
Quoted 4 lines

Deferring the patchet for this release.

Reminder that if the option "to mark rte_tm_* as experimental in v20.11" selected, requires deprecation notice before v20.11.

Thanks Ferruh for reminder. I'll send a deprecation notice patch for the same.

Hi Nithin Kumar, Cristian, Jerin,

Who is working on updating APIs as experimental? We need that patch to proceed with this one.

#55 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 161 lines · Ferruh Yigit
Quoted 160 lines · Nithin Dabilpuram
Quoted 158 lines · Ferruh Yigit

External Email

----------------------------------------------------------------------

Quoted 140 lines · Bruce Richardson
Quoted 139 lines · Cristian
Quoted 139 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Cristian

From: Yigit, Ferruh <[email protected]>
On 4/24/2020 11:28 AM, Dumitrescu, Cristian wrote:
From: Nithin Dabilpuram <[email protected]>
This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=ej5sP3-cEhEoCTZOia-QivXqgljtzBcMLtZGs-5c-Uc&s=B8z_5mQ2xO3C1izjmRe2zBApMrCUcW6KcAN-adglhJQ&e=

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental,
but it looks that this was not correctly marked
when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h,
similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure
when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

Deferring the patchet for this release.

Reminder that if the option "to mark rte_tm_* as experimental in v20.11" selected, requires deprecation notice before v20.11.

Quoted 7 lines
Quoted 2 lines

Thanks Ferruh for reminder. I'll send a deprecation notice patch for the same.

Hi Nithin Kumar, Cristian, Jerin,

Who is working on updating APIs as experimental? We need that patch to proceed with this one.

Hi Ferruh,

I'll send out a patch marking all TM API's experimental.

#56 lore raw

Re: [dpdk-dev] [EXT] Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 165 lines · Nithin Dabilpuram
Quoted 164 lines · Ferruh Yigit
Quoted 162 lines · Nithin Dabilpuram
Quoted 154 lines · Ferruh Yigit

External Email

----------------------------------------------------------------------

Quoted 140 lines · Bruce Richardson
Quoted 139 lines · Cristian
Quoted 139 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, April 28, 2020 4:54 PM
To: Jerin Jacob <[email protected]>; Dumitrescu, Cristian <[email protected]>
Cc: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>; Luca Boccassi <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; Kinsella, Ray <[email protected]>; Neil Horman <[email protected]>; Kevin Traynor <[email protected]>; David Marchand <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

28/04/2020 17:04, Luca Boccassi:

Quoted 4 lines · Bruce Richardson
Quoted 3 lines · Ferruh Yigit
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 10:19 PM Ferruh Yigit

Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Jerin Jacob
Quoted 1 line

On Mon, Apr 27, 2020 at 9:42 PM Ferruh Yigit

Quoted 5 lines · <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

On 4/27/2020 10:19 AM, Dumitrescu, Cristian wrote:
From: Yigit, Ferruh <[email protected]>
On 4/24/2020 11:28 AM, Dumitrescu, Cristian wrote:
From: Nithin Dabilpuram <[email protected]>
This patch also updates tm port/level/node capability

structures with

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exiting features of scheduler wfq packet mode,

scheduler wfq byte mode

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following

warning [1],

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

can you please check?

[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__pastebin.com_XYNFg14u&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=FZ_tPCbgFOh18zwRPO9H0yDx8VW38vuapifdDfc8SFQ&m=ej5sP3-cEhEoCTZOia-QivXqgljtzBcMLtZGs-5c-Uc&s=B8z_5mQ2xO3C1izjmRe2zBApMrCUcW6KcAN-adglhJQ&e=

Hi Ferruh,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The RTE_TM API is marked as experimental,
but it looks that this was not correctly marked
when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h,
similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure
when later introduced, so __rte_experimental was not added

to every function.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

:(

Is it time to mature them?

As you said they are not marked as experimental both in header

file (function

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

declarations) and .map file.

The problem is, they are not marked as experimental in

DPDK_20.0 ABI (v19.11),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

so marking them as experimental now will break the ABI. Not

sure what to do,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed

and APIs become

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

mature starting from v19.11, since this is what happened in

practice, and remove

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a few existing being experimental references in the doxygen

comments.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I think, accidentally we can not make a library as NON-

experimental.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

TM never went through experimental to mature transition(see git

log

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the

ABI process.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Some of the features like packet marking are not even

implemented by any HW.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I think, we can make API stable only all the features are

implemented

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

by one or two HW.

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental

now will

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready

yet.

rte_tm is implemented in 6 PMDs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the

symbol in the

Quoted 1 line
Quoted 1 line
Quoted 1 line

binary doesn't have experimental tag. Our scripts and automated

checks won't

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

detect it as experimental.

My point is just having experimental comment in header file is not

enough to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

No, this is wrong.

Why exactly is this wrong? This is the gap that caused the current discussion, right?

It's wrong for this release, since we can't change things from stable back to experimental. Any such patch will have to wait for 20.11, as agreed in the discussion.

Quoted 4 lines

Deferring the patchet for this release.

Reminder that if the option "to mark rte_tm_* as experimental in v20.11" selected, requires deprecation notice before v20.11.

Thanks Ferruh for reminder. I'll send a deprecation notice patch for the same.

Quoted 9 lines
Quoted 4 lines

Hi Nithin Kumar, Cristian, Jerin,

Who is working on updating APIs as experimental? We need that patch to proceed with this one.

Hi Ferruh,

I'll send out a patch marking all TM API's experimental.

The experimental API change is done & applied,
hence for this series:

Series applied to dpdk-next-net/main, thanks.

#57 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Thomas Monjalon
Quoted 61 lines · Thomas Monjalon

28/04/2020 17:04, Luca Boccassi:

Quoted 15 lines · Bruce Richardson
Quoted 14 lines · Ferruh Yigit
Quoted 13 lines · Jerin Jacob
Quoted 12 lines · Ferruh Yigit
Quoted 11 lines · Jerin Jacob
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Cristian
Quoted 8 lines

From: Yigit, Ferruh <[email protected]>

Quoted 7 lines · Cristian
Quoted 6 lines

From: Nithin Dabilpuram <[email protected]>

Quoted 5 lines

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
Quoted 10 lines
Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 9 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 2 lines

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

None of the 6 PMDS covers all the features.

Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Quoted 7 lines

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

ABI change are in structures. So the function versioning does not help. So we will wait for 20.11 then :-(

#58 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 83 lines · Jerin Jacob
Quoted 61 lines · Thomas Monjalon

28/04/2020 17:04, Luca Boccassi:

Quoted 15 lines · Bruce Richardson
Quoted 14 lines · Ferruh Yigit
Quoted 13 lines · Jerin Jacob
Quoted 12 lines · Ferruh Yigit
Quoted 11 lines · Jerin Jacob
Quoted 10 lines · Ferruh Yigit
Quoted 9 lines · Cristian
Quoted 8 lines

From: Yigit, Ferruh <[email protected]>

Quoted 7 lines · Cristian
Quoted 6 lines

From: Nithin Dabilpuram <[email protected]>

Quoted 5 lines

This patch also updates tm port/level/node capability structures with
exiting features of scheduler wfq packet mode, scheduler wfq byte mode
and private/shared shaper byte mode.

SoftNIC PMD is also updated with new capabilities.

[...]

Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 35 lines
Quoted 34 lines
Quoted 10 lines
Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Hi Ferruh,

Quoted 9 lines

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time,
but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 2 lines

Yes this is what was decided one or two years ago I think. But rte_tm API was introduced 3 years ago and is implemented by 6 PMDs.

None of the 6 PMDS covers all the features.

Quoted 16 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 1 line

Anyway, we need to break the ABI to make it work on various HW.

Yes this is why I was asking in 19.11 to check our API, in order to avoid such situation.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I am not sure what to do?

Either manage ABI versioning, or wait 20.11.

ABI change are in structures. So the function versioning does not help. So we will wait for 20.11 then :-(

yes - I spent some time looking at this also, and came to same conclusion.

Ray K

#59 lore raw

Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

In reply to Bruce Richardson
Quoted 157 lines · Bruce Richardson
Quoted 125 lines · Ferruh Yigit
Quoted 103 lines · Jerin Jacob
Quoted 102 lines · Ferruh Yigit
Quoted 99 lines · Jerin Jacob
Quoted 83 lines · Ferruh Yigit
Quoted 67 lines · Cristian
Quoted 58 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Saturday, April 25, 2020 9:09 PM
To: Dumitrescu, Cristian <[email protected]>; Nithin Dabilpuram <[email protected]>; Singh, Jasvinder <[email protected]>; Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: Re: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

Quoted 27 lines · Cristian
Quoted 27 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Wednesday, April 22, 2020 6:21 PM
To: Singh, Jasvinder <[email protected]>; Dumitrescu, Cristian <[email protected]>; Thomas Monjalon <[email protected]>; Yigit, Ferruh <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>
Subject: [PATCH v4 1/4] ethdev: add tm support for shaper config in pkt mode

From: Nithin Dabilpuram <[email protected]>

Some NIC hardware support shaper to work in packet mode i.e shaping or ratelimiting traffic is in packets per second (PPS) as opposed to default bytes per second (BPS). Hence this patch adds support to configure shared or private shaper in packet mode, provide rate in PPS and add related tm capabilities in port/level/node capability structures.

This patch also updates tm port/level/node capability structures with exiting features of scheduler wfq packet mode, scheduler wfq byte mode and private/shared shaper byte mode.

Quoted 8 lines
Quoted 8 lines

SoftNIC PMD is also updated with new capabilities.

---
v3..v4:
- Update text under packet_mode as per Cristian.
- Update rte_eth_softnic_tm.c based on Jasvinder's comments.
- Add error enum

RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PACKET_MODE

Quoted 6 lines
Quoted 3 lines

- Fix shaper_profile_check() with packet mode check
- Fix typo's

Quoted 7 lines

Hi Nithin,

It looks like patch is causing ABI break, I am getting following warning [1], can you please check?

[1]
https://pastebin.com/XYNFg14u

Quoted 6 lines

Hi Ferruh,

The RTE_TM API is marked as experimental, but it looks that this was not correctly marked when __rte_experimental ABI checker was introduced.

It is marked as experimental at the top of the rte_tm.h, similarly to other APIs introduced around same time, but it was not correctly picked up by the ABI check procedure when later introduced, so __rte_experimental was not added to every function.

:(

Is it time to mature them?

As you said they are not marked as experimental both in header file (function declarations) and .map file.

Quoted 7 lines

The problem is, they are not marked as experimental in DPDK_20.0 ABI (v19.11), so marking them as experimental now will break the ABI. Not sure what to do, cc'ed a few ABI related names for comment.

For me, we need to proceed as the experimental tag removed and APIs become mature starting from v19.11, since this is what happened in practice, and remove a few existing being experimental references in the doxygen comments.

I think, accidentally we can not make a library as NON-experimental. TM never went through experimental to mature transition(see git log lib/librte_ethdev/rte_tm.h)
It was a bug to not mark as experimental in each function in the ABI process. Some of the features like packet marking are not even implemented by any HW. I think, we can make API stable only all the features are implemented by one or two HW.

Quoted 6 lines
Quoted 4 lines

Fair enough, specially if the API is not ready yet.

But they were part of stable ABI, and marking them as experimental now will break the old applications using these APIs.

it is still marked as EXPERIMENTAL everywhere and API is not ready yet.

Existing experimental marks are text only for human parsing.

The compiler attribute and build time checks are missing, and the symbol in the binary doesn't have experimental tag. Our scripts and automated checks won't detect it as experimental.

My point is just having experimental comment in header file is not enough to qualify the APIs as experimental.

Quoted 4 lines

Anyway, we need to break the ABI to make it work on various HW. I am not sure what to do?
IMO, We need to send a patch as Fixes: for the bug of not adding __rte_experimental in each function.

Quoted 15 lines

Yes, this is where we are, both you and Cristian suggest API is not ready and should be experimental, but they were part of stable ABI, making them experimental will break the ABI.
It looks like there is no good option but we should select one of the bad ones.

Quoted 10 lines

Traffic Management API - EXPERIMENTAL
M: Cristian Dumitrescu <[email protected]>
T: git://dpdk.org/next/dpdk-next-qos
F: lib/librte_ethdev/rte_tm*

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

Ray, Neil, David, Luca, Kevin, what do you think?

While I'm not called any of those names, allow me to give my 2c.

Since these are marked in binaries as part of the stable ABI, I think we need to honour that for the next two releases 20.05 and 20.08 [which means that we need to put in versioned functions for any changes, not that we can't change anything]

For 20.11, I think these should then have one of two options taken:
* have these "fixed" and ready to be marked as stable, and officially part of v21 ABI or
* mark them as experimental properly, and look to have them as part of the v22 or subsequent ABI

Given the comments here, I would tend towards the latter of the above two options, but that's really a decision for the maintainers.

Quoted 8 lines

Remember, this is not the first bug we have encountered where we messed up some ABI versions in the 19.11 release, and, like the previous one with the screwed up version number, I think we need to honour the ABI committments made, especially since in this case it's only for a few more months till 20.11 development starts.

/Bruce

So the rte_tm API has been "EXPERIMENTAL" for quiet a long time, as far back as v17.11. To the extent it predates the experimental infrastructure the community developed since then. TM added in 17.08, EXPERIMENTAL appears to have been added in 17.11.

That said, some form of stable TM API should have emerged by this point. So I am not sure that EXPERIMENTAL status was 100% warranted.

As Bruce points out.
It is simpler to wait for the next ABI breakage window in August. And mark them EXPERIMENTAL at that point.

Thanks,

Ray K