> -----Original Message----- > From: Nithin Dabilpuram <ndabilpu...@marvell.com> > Sent: Wednesday, April 22, 2020 9:09 AM > To: Nithin Dabilpuram <nithind1...@gmail.com> > Cc: Singh, Jasvinder <jasvinder.si...@intel.com>; Dumitrescu, Cristian > <cristian.dumitre...@intel.com>; Thomas Monjalon > <tho...@monjalon.net>; Yigit, Ferruh <ferruh.yi...@intel.com>; Andrew > Rybchenko <arybche...@solarflare.com>; dev@dpdk.org; > jer...@marvell.com; kka...@marvell.com > 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. > > On Wed, Apr 22, 2020 at 01:29:44PM +0530, Nithin Dabilpuram wrote: > > From: Nithin Dabilpuram <ndabilpu...@marvell.com> > > > > 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. > > > > Signed-off-by: Nithin Dabilpuram <ndabilpu...@marvell.com> > > --- > > > > 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 ++++++++++ <snip>
> > @@ -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, [Jasvinder] - byte mode needs to be set here. > > .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, [jasvinder] - byte mode should be set here as well. > > #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, > > } }, [Jasvinder] - byte mode to be set. > > .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, > > } }, [Jasvinder] - byte mode to be set here. > > .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 = {