RE: [PATCH v1 1/3] ethdev: add flow item for RoCE infiniband BTH
Hi Andrew, will update those 2 comments in the V2, thanks. > -Original Message- > From: Andrew Rybchenko > Sent: Monday, May 22, 2023 3:02 PM > To: Ori Kam ; Bill Zhou ; Slava > Ovsiienko ; NBU-Contact-Thomas Monjalon > (EXTERNAL) ; Aman Singh > ; Yuying Zhang ; > Ferruh Yigit ; Olivier Matz > Cc: dev@dpdk.org; Raslan Darawsheh > Subject: Re: [PATCH v1 1/3] ethdev: add flow item for RoCE infiniband BTH > > On 5/17/23 20:06, Ori Kam wrote: > > Hi Bill, > > > >> -Original Message- > >> From: Bill Zhou > >> Sent: Thursday, May 11, 2023 10:55 AM > >> Subject: [PATCH v1 1/3] ethdev: add flow item for RoCE infiniband BTH > > RoEC should be added devtools/words-case.txt IB as well. > > >> > >> IB(InfiniBand) is one type of networking used in high-performance > >> computing with high throughput and low latency. Like Ethernet, IB > >> defines a layered protocol (Physical, Link, Network, Transport > >> Layers). IB provides native support for RDMA(Remote DMA), an > >> extension of the DMA that allows direct access to remote host memory > >> without CPU intervention. IB network requires NICs and switches to > >> support the IB protocol. > >> > >> RoCE(RDMA over Converged Ethernet) is a network protocol that allows > >> RDMA to run on Ethernet. RoCE encapsulates IB packets on ethernet and > >> has two versions, RoCEv1 and RoCEv2. RoCEv1 is an ethernet link layer > >> protocol, IB packets are encapsulated in the ethernet layer and use > >> ethernet type 0x8915. RoCEv2 is an internet > > ethernet -> Ethernet (4 times above) > > >> layer protocol, IB packets are encapsulated in UDP payload and use a > >> destination port 4791, The format of the RoCEv2 packet is as follows: > >>ETH + IP + UDP(dport 4791) + IB(BTH + ExtHDR + PAYLOAD + CRC) > >> > >> BTH(Base Transport Header) is the IB transport layer header, RoCEv1 > >> and RoCEv2 both contain this header. This patch introduces a new RTE > >> item to match the IB BTH in RoCE packets. One use of this match is > >> that the user can monitor RoCEv2's CNP(Congestion Notification > >> Packet) by matching BTH opcode 0x81. > >> > >> This patch also adds the testpmd command line to match the RoCEv2 > >> BTH. Usage example: > >> > >>testpmd> flow create 0 group 1 ingress pattern > >> eth / ipv4 / udp dst is 4791 / ib_bth opcode is 0x81 > >> dst_qp is 0xd3 / end actions queue index 0 / end > >> > >> Signed-off-by: Dong Zhou > >> --- > > > > Acked-by: Ori Kam > > Acked-by: Andrew Rybchenko >
Re: [dpdk-dev] [PATCH v2] ethdev: support flow aging
> -Original Message- > From: Ori Kam > Sent: Tuesday, April 14, 2020 4:50 PM > To: Bill Zhou ; Matan Azrad > ; wenzhuo...@intel.com; jingjing...@intel.com; > bernard.iremon...@intel.com; john.mcnam...@intel.com; > marko.kovace...@intel.com; Thomas Monjalon ; > ferruh.yi...@intel.com; arybche...@solarflare.com > Cc: dev@dpdk.org > Subject: RE: [PATCH v2] ethdev: support flow aging > > > > > -Original Message- > > From: Dong Zhou > > Sent: Tuesday, April 14, 2020 11:33 AM > > To: Ori Kam ; Matan Azrad > ; > > wenzhuo...@intel.com; jingjing...@intel.com; > > bernard.iremon...@intel.com; john.mcnam...@intel.com; > > marko.kovace...@intel.com; Thomas Monjalon ; > > ferruh.yi...@intel.com; arybche...@solarflare.com > > Cc: dev@dpdk.org > > Subject: [PATCH v2] ethdev: support flow aging > > > > One of the reasons to destroy a flow is the fact that no packet > > matches the flow for "timeout" time. > > For example, when TCP\UDP sessions are suddenly closed. > > > > Currently, there is not any DPDK mechanism for flow aging and the > > applications use their own ways to detect and destroy aged-out flows. > > > > The flow aging implementation need include: > > - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the > timeout and > > the application flow context for each flow. > > - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to > report > > that there are new aged-out flows. > > - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out flows > > contexts from the port. > > - Support input flow aging command line in Testpmd. > > > > Signed-off-by: Dong Zhou > > --- > Like said before nice patch and hope to see more patches from you. > Just a small nit please next time add change log. > Sorry for it. --- v2: Removing "* Added support for flow Aging mechanism base on counter." this line from doc/guides/rel_notes/release_20_05.rst, this patch does not include this support. --- > Acked-by: Ori Kam > Thanks, > Ori > > > > app/test-pmd/cmdline_flow.c | 26 ++ > > doc/guides/prog_guide/rte_flow.rst | 22 + > > doc/guides/rel_notes/release_20_05.rst | 11 + > > lib/librte_ethdev/rte_ethdev.h | 1 + > > lib/librte_ethdev/rte_ethdev_version.map | 3 ++ > > lib/librte_ethdev/rte_flow.c | 18 +++ > > lib/librte_ethdev/rte_flow.h | 62 > > lib/librte_ethdev/rte_flow_driver.h | 6 +++ > > 8 files changed, 149 insertions(+) > > > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > > index e6ab8ff2f7..45bcff3cf5 100644 > > --- a/app/test-pmd/cmdline_flow.c > > +++ b/app/test-pmd/cmdline_flow.c > > @@ -343,6 +343,8 @@ enum index { > > ACTION_SET_IPV4_DSCP_VALUE, > > ACTION_SET_IPV6_DSCP, > > ACTION_SET_IPV6_DSCP_VALUE, > > + ACTION_AGE, > > + ACTION_AGE_TIMEOUT, > > }; > > > > /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ > > -1145,6 +1147,7 @@ static const enum index next_action[] = { > > ACTION_SET_META, > > ACTION_SET_IPV4_DSCP, > > ACTION_SET_IPV6_DSCP, > > + ACTION_AGE, > > ZERO, > > }; > > > > @@ -1370,6 +1373,13 @@ static const enum index > action_set_ipv6_dscp[] = { > > ZERO, > > }; > > > > +static const enum index action_age[] = { > > + ACTION_AGE, > > + ACTION_AGE_TIMEOUT, > > + ACTION_NEXT, > > + ZERO, > > +}; > > + > > static int parse_set_raw_encap_decap(struct context *, const struct > token *, > > const char *, unsigned int, > > void *, unsigned int); > > @@ -3694,6 +3704,22 @@ static const struct token token_list[] = { > > (struct rte_flow_action_set_dscp, dscp)), > > .call = parse_vc_conf, > > }, > > + [ACTION_AGE] = { > > + .name = "age", > > + .help = "set a specific metadata header", > > + .next = NEXT(action_age), > > + .priv = PRIV_ACTION(AGE, > > + sizeof(struct rte_flow_action_age)), > > + .call = parse_vc, > > + }, > > + [ACTION_AGE_TIMEOUT] = { > > + .name = "timeout", > > + .help = "flow age timeout value", > > +
Re: [dpdk-dev] [PATCH v2] ethdev: support flow aging
> -Original Message- > From: Ferruh Yigit > Sent: Saturday, April 18, 2020 6:01 AM > To: Bill Zhou ; Ori Kam ; > Matan Azrad ; wenzhuo...@intel.com; > jingjing...@intel.com; bernard.iremon...@intel.com; > john.mcnam...@intel.com; marko.kovace...@intel.com; Thomas Monjalon > ; arybche...@solarflare.com > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] ethdev: support flow aging > > On 4/14/2020 9:32 AM, Dong Zhou wrote: > > One of the reasons to destroy a flow is the fact that no packet > > matches the flow for "timeout" time. > > For example, when TCP\UDP sessions are suddenly closed. > > > > Currently, there is not any DPDK mechanism for flow aging and the > > applications use their own ways to detect and destroy aged-out flows. > > > > The flow aging implementation need include: > > - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the > timeout and > > the application flow context for each flow. > > - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to > report > > that there are new aged-out flows. > > - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out flows > > contexts from the port. > > - Support input flow aging command line in Testpmd. > > > > Signed-off-by: Dong Zhou > > <...> > > > --- a/lib/librte_ethdev/rte_ethdev.h > > +++ b/lib/librte_ethdev/rte_ethdev.h > > @@ -3015,6 +3015,7 @@ enum rte_eth_event_type { > > RTE_ETH_EVENT_NEW, /**< port is probed */ > > RTE_ETH_EVENT_DESTROY, /**< port is released */ > > RTE_ETH_EVENT_IPSEC,/**< IPsec offload related event */ > > + RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows is detected > */ > > RTE_ETH_EVENT_MAX /**< max value of this enum */ > > }; > > > Just recognized that this is failing in ABI check [1], as far as last time > for a > similar enum warning a QAT patch has been dropped, should this need to > wait for > 20.11 too? This patch is commonly used for flow aging, there are 2 other patches have implement flow aging in mlx5 driver reply to this patch. In our schedule, this feature is merged in 20.05 for some customers. Can it be fixed? > > > [1] > [C]'function int _rte_eth_dev_callback_process(rte_eth_dev*, > rte_eth_event_type, void*)' at rte_ethdev.c:4063:1 has some indirect sub- > type > changes: > parameter 2 of type 'enum rte_eth_event_type' has sub-type changes: > type size hasn't changed > 1 enumerator insertion: > 'rte_eth_event_type::RTE_ETH_EVENT_FLOW_AGED' value '10' > 1 enumerator change: > 'rte_eth_event_type::RTE_ETH_EVENT_MAX' from value '10' to '11' at > rte_ethdev.h:3008:1
[dpdk-dev] [PATCH v3] ethdev: support flow aging
From: Dong Zhou One of the reasons to destroy a flow is the fact that no packet matches the flow for "timeout" time. For example, when TCP\UDP sessions are suddenly closed. Currently, there is not any DPDK mechanism for flow aging and the applications use their own ways to detect and destroy aged-out flows. The flow aging implementation need include: - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the timeout and the application flow context for each flow. - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to report that there are new aged-out flows. - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out flows contexts from the port. - Support input flow aging command line in Testpmd. Signed-off-by: Dong Zhou --- v2: Removing "* Added support for flow Aging mechanism base on counter." this line from doc/guides/rel_notes/release_20_05.rst, this patch does not include this support. --- v3: Update file libabigail.abignore, add one new suppressed enumeration type for RTE_ETH_EVENT_MAX. --- app/test-pmd/cmdline_flow.c | 26 ++ devtools/libabigail.abignore | 4 ++ doc/guides/prog_guide/rte_flow.rst | 22 + doc/guides/rel_notes/release_20_05.rst | 11 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_ethdev/rte_ethdev_version.map | 3 ++ lib/librte_ethdev/rte_flow.c | 18 +++ lib/librte_ethdev/rte_flow.h | 62 lib/librte_ethdev/rte_flow_driver.h | 6 +++ 9 files changed, 153 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index e6ab8ff2f7..45bcff3cf5 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -343,6 +343,8 @@ enum index { ACTION_SET_IPV4_DSCP_VALUE, ACTION_SET_IPV6_DSCP, ACTION_SET_IPV6_DSCP_VALUE, + ACTION_AGE, + ACTION_AGE_TIMEOUT, }; /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -1145,6 +1147,7 @@ static const enum index next_action[] = { ACTION_SET_META, ACTION_SET_IPV4_DSCP, ACTION_SET_IPV6_DSCP, + ACTION_AGE, ZERO, }; @@ -1370,6 +1373,13 @@ static const enum index action_set_ipv6_dscp[] = { ZERO, }; +static const enum index action_age[] = { + ACTION_AGE, + ACTION_AGE_TIMEOUT, + ACTION_NEXT, + ZERO, +}; + static int parse_set_raw_encap_decap(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -3694,6 +3704,22 @@ static const struct token token_list[] = { (struct rte_flow_action_set_dscp, dscp)), .call = parse_vc_conf, }, + [ACTION_AGE] = { + .name = "age", + .help = "set a specific metadata header", + .next = NEXT(action_age), + .priv = PRIV_ACTION(AGE, + sizeof(struct rte_flow_action_age)), + .call = parse_vc, + }, + [ACTION_AGE_TIMEOUT] = { + .name = "timeout", + .help = "flow age timeout value", + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_action_age, + timeout, 24)), + .next = NEXT(action_age, NEXT_ENTRY(UNSIGNED)), + .call = parse_vc_conf, + }, }; /** Remove and return last entry from argument stack. */ diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index a59df8f135..949e40fbd1 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -11,3 +11,7 @@ type_kind = enum name = rte_crypto_asym_xform_type changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END +[suppress_type] +type_kind = enum +name = rte_eth_event_type +changed_enumerators = RTE_ETH_EVENT_MAX diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 41c147913c..cf4368e1c4 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2616,6 +2616,28 @@ Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error will be returned. | ``dscp`` | DSCP in low 6 bits, rest ignore | +---+-+ +Action: ``AGE`` +^ + +Set ageing timeout configuration to a flow. + +Event RTE_ETH_EVENT_FLOW_AGED will be reported if +timeout passed without any matching on the flow. + +.. _table_rte_flow_action_age: + +.. table:: AGE + + +--+-+ + | Field| Value | + +==+=+ + | ``timeout`` | 24 bits timeout value | + +--+-+ + | ``reserved`` | 8 bits reserved, must be zero | + +--+---
[dpdk-dev] [PATCH v4] ethdev: support flow aging
From: Dong Zhou One of the reasons to destroy a flow is the fact that no packet matches the flow for "timeout" time. For example, when TCP\UDP sessions are suddenly closed. Currently, there is not any DPDK mechanism for flow aging and the applications use their own ways to detect and destroy aged-out flows. The flow aging implementation need include: - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the timeout and the application flow context for each flow. - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to report that there are new aged-out flows. - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out flows contexts from the port. - Support input flow aging command line in Testpmd. The new event type addition in the enum is flagged as an ABI breakage, so an ignore rule is added for these reasons: - It is not changing value of existing types (except MAX) - The new value is not used by existing API if the event is not registered In general, it is safe adding new ethdev event types at the end of the enum, because of event callback registration mechanism. Signed-off-by: Dong Zhou --- v2: Removing "* Added support for flow Aging mechanism base on counter." this line from doc/guides/rel_notes/release_20_05.rst, this patch does not include this support. v3: Update file libabigail.abignore, add one new suppressed enumeration type for RTE_ETH_EVENT_MAX. v4: Add justification in devtools/libabigail.abignore and in the commit log about the modification of v3. --- app/test-pmd/cmdline_flow.c | 26 ++ devtools/libabigail.abignore | 6 +++ doc/guides/prog_guide/rte_flow.rst | 22 + doc/guides/rel_notes/release_20_05.rst | 11 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_ethdev/rte_ethdev_version.map | 3 ++ lib/librte_ethdev/rte_flow.c | 18 +++ lib/librte_ethdev/rte_flow.h | 62 lib/librte_ethdev/rte_flow_driver.h | 6 +++ 9 files changed, 155 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index e6ab8ff2f7..45bcff3cf5 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -343,6 +343,8 @@ enum index { ACTION_SET_IPV4_DSCP_VALUE, ACTION_SET_IPV6_DSCP, ACTION_SET_IPV6_DSCP_VALUE, + ACTION_AGE, + ACTION_AGE_TIMEOUT, }; /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -1145,6 +1147,7 @@ static const enum index next_action[] = { ACTION_SET_META, ACTION_SET_IPV4_DSCP, ACTION_SET_IPV6_DSCP, + ACTION_AGE, ZERO, }; @@ -1370,6 +1373,13 @@ static const enum index action_set_ipv6_dscp[] = { ZERO, }; +static const enum index action_age[] = { + ACTION_AGE, + ACTION_AGE_TIMEOUT, + ACTION_NEXT, + ZERO, +}; + static int parse_set_raw_encap_decap(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -3694,6 +3704,22 @@ static const struct token token_list[] = { (struct rte_flow_action_set_dscp, dscp)), .call = parse_vc_conf, }, + [ACTION_AGE] = { + .name = "age", + .help = "set a specific metadata header", + .next = NEXT(action_age), + .priv = PRIV_ACTION(AGE, + sizeof(struct rte_flow_action_age)), + .call = parse_vc, + }, + [ACTION_AGE_TIMEOUT] = { + .name = "timeout", + .help = "flow age timeout value", + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_action_age, + timeout, 24)), + .next = NEXT(action_age, NEXT_ENTRY(UNSIGNED)), + .call = parse_vc_conf, + }, }; /** Remove and return last entry from argument stack. */ diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index a59df8f135..c047adbd79 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -11,3 +11,9 @@ type_kind = enum name = rte_crypto_asym_xform_type changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END +; Ignore ethdev event enum update because new event cannot be +; received if not registered +[suppress_type] +type_kind = enum +name = rte_eth_event_type +changed_enumerators = RTE_ETH_EVENT_MAX diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 41c147913c..cf4368e1c4 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2616,6 +2616,28 @@ Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error will be returned. | ``dscp`` | DSCP in low 6 bits, rest ignore | +---+-+ +Action: ``AGE`` +
[dpdk-dev] [PATCH v2 2/2] net/mlx5: support flow aging
Currently, there is no flow aging check and age-out event callback mechanism for mlx5 driver, this patch implements it. It's included: - Splitting the current counter container to aged or no-aged container since reducing memory consumption. Aged container will allocate extra memory to save the aging parameter from user configuration. - Aging check and age-out event callback mechanism based on current counter. When a flow be checked aged-out, RTE_ETH_EVENT_FLOW_AGED event will be triggered to applications. - Implement the new API: rte_flow_get_aged_flows, applications can use this API to get aged flows. Signed-off-by: Bill Zhou --- v2: Moving aging list from struct mlx5_ibv_shared to struct mlx5_priv, one port has one aging list. Update event be triggered once after last call of rte_flow_get_aged_flows. --- doc/guides/rel_notes/release_20_05.rst | 1 + drivers/net/mlx5/mlx5.c| 86 +++--- drivers/net/mlx5/mlx5.h| 49 +++- drivers/net/mlx5/mlx5_flow.c | 201 -- drivers/net/mlx5/mlx5_flow.h | 16 +- drivers/net/mlx5/mlx5_flow_dv.c| 361 + drivers/net/mlx5/mlx5_flow_verbs.c | 14 +- 7 files changed, 607 insertions(+), 121 deletions(-) diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst index b124c3f287..a5ba8a4792 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -141,6 +141,7 @@ New Features * Added support for creating Relaxed Ordering Memory Regions. * Added support for jumbo frame size (9K MTU) in Multi-Packet RQ mode. * Optimized the memory consumption of flow. + * Added support for flow aging based on hardware counter. * **Updated the AESNI MB crypto PMD.** diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 57d76cb741..674d0ea9d3 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -437,6 +437,20 @@ mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id) return 0; } +/** + * Initialize the private aging list information. + * + * @param[in] priv + * Pointer to the private device data structure. + */ +static void +mlx5_flow_aging_list_init(struct mlx5_priv *priv) +{ + TAILQ_INIT(&priv->aged_counters); + rte_spinlock_init(&priv->aged_sl); + rte_atomic16_set(&priv->trigger_event, 1); +} + /** * Initialize the counters management structure. * @@ -446,11 +460,14 @@ mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id) static void mlx5_flow_counters_mng_init(struct mlx5_ibv_shared *sh) { - uint8_t i; + uint8_t i, age; + sh->cmng.age = 0; TAILQ_INIT(&sh->cmng.flow_counters); - for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) - TAILQ_INIT(&sh->cmng.ccont[i].pool_list); + for (age = 0; age < RTE_DIM(sh->cmng.ccont[0]); ++age) { + for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) + TAILQ_INIT(&sh->cmng.ccont[i][age].pool_list); + } } /** @@ -480,7 +497,7 @@ static void mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) { struct mlx5_counter_stats_mem_mng *mng; - uint8_t i; + uint8_t i, age = 0; int j; int retries = 1024; @@ -491,36 +508,42 @@ mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) break; rte_pause(); } - for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) { - struct mlx5_flow_counter_pool *pool; - uint32_t batch = !!(i % 2); - if (!sh->cmng.ccont[i].pools) - continue; - pool = TAILQ_FIRST(&sh->cmng.ccont[i].pool_list); - while (pool) { - if (batch) { - if (pool->min_dcs) - claim_zero - (mlx5_devx_cmd_destroy(pool->min_dcs)); - } - for (j = 0; j < MLX5_COUNTERS_PER_POOL; ++j) { - if (MLX5_POOL_GET_CNT(pool, j)->action) - claim_zero - (mlx5_glue->destroy_flow_action -(MLX5_POOL_GET_CNT(pool, j)->action)); - if (!batch && MLX5_GET_POOL_CNT_EXT - (pool, j)->dcs) - claim_zero(mlx5_devx_cmd_destroy - (MLX5_GET_POOL_CNT_EXT - (pool, j)->dcs)); + for (age = 0; age < RTE_DIM(sh->cmng.ccont[0]); ++age) { + for (i = 0; i < RTE_DIM(sh->cm
[dpdk-dev] [PATCH v2 1/2] net/mlx5: modify ext-counter memory allocation
Currently, the counter pool needs 512 ext-counter memory for no batch counters, it's allocated separately by once, behind the 512 basic-counter memory. This is not easy to get ext-counter pointer by corresponding basic-counter pointer. This is also no easy for expanding some other potential additional type of counter memory. So, need allocate every one of ext-counter and basic-counter together, as a single piece of memory. It's will be same for further additional type of counter memory. In this case, one piece of memory contains all type of memory for one counter, it's easy to get each type memory by using offsetting. Signed-off-by: Bill Zhou --- v2: Update some comments for new adding fields. --- drivers/net/mlx5/mlx5.c| 4 ++-- drivers/net/mlx5/mlx5.h| 22 -- drivers/net/mlx5/mlx5_flow_dv.c| 27 +++ drivers/net/mlx5/mlx5_flow_verbs.c | 16 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index cc13e447d6..57d76cb741 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -505,10 +505,10 @@ mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) (mlx5_devx_cmd_destroy(pool->min_dcs)); } for (j = 0; j < MLX5_COUNTERS_PER_POOL; ++j) { - if (pool->counters_raw[j].action) + if (MLX5_POOL_GET_CNT(pool, j)->action) claim_zero (mlx5_glue->destroy_flow_action - (pool->counters_raw[j].action)); +(MLX5_POOL_GET_CNT(pool, j)->action)); if (!batch && MLX5_GET_POOL_CNT_EXT (pool, j)->dcs) claim_zero(mlx5_devx_cmd_destroy diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 50349abf34..51c3f33e6b 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -222,6 +222,18 @@ struct mlx5_drop { #define MLX5_COUNTERS_PER_POOL 512 #define MLX5_MAX_PENDING_QUERIES 4 #define MLX5_CNT_CONTAINER_RESIZE 64 +#define CNT_SIZE (sizeof(struct mlx5_flow_counter)) +#define CNTEXT_SIZE (sizeof(struct mlx5_flow_counter_ext)) + +#define CNT_POOL_TYPE_EXT (1 << 0) +#define IS_EXT_POOL(pool) (((pool)->type) & CNT_POOL_TYPE_EXT) +#define MLX5_CNT_LEN(pool) \ + (CNT_SIZE + (IS_EXT_POOL(pool) ? CNTEXT_SIZE : 0)) +#define MLX5_POOL_GET_CNT(pool, index) \ + ((struct mlx5_flow_counter *) \ + ((char *)((pool) + 1) + (index) * (MLX5_CNT_LEN(pool +#define MLX5_CNT_ARRAY_IDX(pool, cnt) \ + ((int)(((char *)(cnt) - (char *)((pool) + 1)) / MLX5_CNT_LEN(pool))) \ /* * The pool index and offset of counter in the pool array makes up the * counter index. In case the counter is from pool 0 and offset 0, it @@ -230,11 +242,10 @@ struct mlx5_drop { */ #define MLX5_MAKE_CNT_IDX(pi, offset) \ ((pi) * MLX5_COUNTERS_PER_POOL + (offset) + 1) -#define MLX5_CNT_TO_CNT_EXT(pool, cnt) (&((struct mlx5_flow_counter_ext *) \ - ((pool) + 1))[((cnt) - (pool)->counters_raw)]) +#define MLX5_CNT_TO_CNT_EXT(cnt) \ + ((struct mlx5_flow_counter_ext *)((cnt) + 1)) #define MLX5_GET_POOL_CNT_EXT(pool, offset) \ - (&((struct mlx5_flow_counter_ext *) \ - ((pool) + 1))[offset]) + MLX5_CNT_TO_CNT_EXT(MLX5_POOL_GET_CNT((pool), (offset))) struct mlx5_flow_counter_pool; @@ -287,11 +298,10 @@ struct mlx5_flow_counter_pool { rte_atomic64_t start_query_gen; /* Query start round. */ rte_atomic64_t end_query_gen; /* Query end round. */ uint32_t index; /* Pool index in container. */ + uint32_t type: 2; /* Memory type behind the counter array. */ rte_spinlock_t sl; /* The pool lock. */ struct mlx5_counter_stats_raw *raw; struct mlx5_counter_stats_raw *raw_hw; /* The raw on HW working. */ - struct mlx5_flow_counter counters_raw[MLX5_COUNTERS_PER_POOL]; - /* The pool counters memory. */ }; struct mlx5_counter_stats_raw; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6263ecc731..784a62c521 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3909,7 +3909,7 @@ flow_dv_counter_get_by_idx(struct rte_eth_dev *dev, MLX5_ASSERT(pool); if (ppool) *ppool = pool; - return &pool->counters_raw[idx % MLX5_COUNTERS_PER_POOL]; + return MLX5_POOL_GET_CNT(pool, idx % MLX5_COUNTERS_PER_POOL); } /** @@ -4117,7 +4117,7 @@ _flow_dv_query_count(struct rte_eth_dev *dev, uint32_t counter
[dpdk-dev] [PATCH v2 0/2] net/mlx5: support flow aging
Those patches implement flow aging for mlx5 driver. First patch is to modify the current additional memory allocation for counter, so that it's easy to get every counter additional memory location by using offsetting. Second patch implements aging check and age-out event callback mechanism for mlx5 driver. Bill Zhou (2): net/mlx5: modify ext-counter memory allocation net/mlx5: support flow aging doc/guides/rel_notes/release_20_05.rst | 1 + drivers/net/mlx5/mlx5.c| 86 +++--- drivers/net/mlx5/mlx5.h| 63 - drivers/net/mlx5/mlx5_flow.c | 201 -- drivers/net/mlx5/mlx5_flow.h | 16 +- drivers/net/mlx5/mlx5_flow_dv.c| 370 + drivers/net/mlx5/mlx5_flow_verbs.c | 16 +- 7 files changed, 626 insertions(+), 127 deletions(-) -- 2.21.0
[dpdk-dev] [PATCH] app/testpmd: support flow aging
Currently, there is no way to check the aging event or to get the current aged flows in testpmd, this patch include those implements, it's included: - Registering aging event based on verbose level, when set verbose > 0, will register this event, otherwise, remove this event. In this event only dump one line of log to user there is one aging event coming. - Add new command to list all aged flows, meanwhile, we can set parameter to destroy it. Signed-off-by: Bill Zhou --- app/test-pmd/cmdline.c | 4 + app/test-pmd/cmdline_flow.c | 61 ++ app/test-pmd/config.c | 153 +--- app/test-pmd/testpmd.c | 2 + app/test-pmd/testpmd.h | 9 +++ 5 files changed, 217 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 22fb23a92d..01aed7cc1f 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1125,6 +1125,10 @@ static void cmd_help_long_parsed(void *parsed_result, "Restrict ingress traffic to the defined" " flow rules\n\n" + "flow aged {port_id} destroy {boolean}\n" + "List and destroy aged flows" + " flow rules\n\n" + "set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src" " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst" " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n" diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 45bcff3cf5..0349875591 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -67,6 +67,7 @@ enum index { DUMP, QUERY, LIST, + AGED, ISOLATE, /* Destroy arguments. */ @@ -78,6 +79,9 @@ enum index { /* List arguments. */ LIST_GROUP, + /* List aged arguments. */ + AGED_DESTROY, + /* Validate/create arguments. */ GROUP, PRIORITY, @@ -664,6 +668,9 @@ struct buffer { struct { int set; } isolate; /**< Isolated mode arguments. */ + struct { + int destroy; + } aged; /**< Aged list arguments. */ } args; /**< Command arguments. */ }; @@ -719,6 +726,12 @@ static const enum index next_list_attr[] = { ZERO, }; +static const enum index next_aged_attr[] = { + AGED_DESTROY, + END, + ZERO, +}; + static const enum index item_param[] = { ITEM_PARAM_IS, ITEM_PARAM_SPEC, @@ -1466,6 +1479,9 @@ static int parse_action(struct context *, const struct token *, static int parse_list(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); +static int parse_aged(struct context *, const struct token *, + const char *, unsigned int, + void *, unsigned int); static int parse_isolate(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -1649,6 +1665,7 @@ static const struct token token_list[] = { FLUSH, DUMP, LIST, + AGED, QUERY, ISOLATE)), .call = parse_init, @@ -1708,6 +1725,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct buffer, port)), .call = parse_list, }, + [AGED] = { + .name = "aged", + .help = "list or destroy aged flows", + .next = NEXT(next_aged_attr, NEXT_ENTRY(PORT_ID)), + .args = ARGS(ARGS_ENTRY(struct buffer, port)), + .call = parse_aged, + }, [ISOLATE] = { .name = "isolate", .help = "restrict ingress traffic to the defined flow rules", @@ -1741,6 +1765,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_PTR(struct buffer, args.list.group)), .call = parse_list, }, + [AGED_DESTROY] = { + .name = "destroy", + .help = "specify aged flows need be destroyed", + .next = NEXT(NEXT_ENTRY(BOOLEAN)), + .args = ARGS(ARGS_ENTRY(struct buffer, args.aged.destroy)), + .comp = comp_none, + }, /* Validate/create attributes. */ [GROUP] = { .name = "group", @@ -5367,6 +5398,33 @@ parse_list(struct context *ctx, const struct token *token, return len; } +/*
Re: [dpdk-dev] [PATCH] app/testpmd: support flow aging
> -Original Message- > From: Ferruh Yigit > Sent: Saturday, April 25, 2020 12:25 AM > To: Bill Zhou ; wenzhuo...@intel.com; > jingjing...@intel.com; bernard.iremon...@intel.com; Ori Kam > > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: support flow aging > > On 4/24/2020 11:55 AM, Bill Zhou wrote: > > Currently, there is no way to check the aging event or to get the > > current aged flows in testpmd, this patch include those implements, it's > included: > > - Registering aging event based on verbose level, when set verbose > 0, > > will register this event, otherwise, remove this event. In this event > > only dump one line of log to user there is one aging event coming. > > - Add new command to list all aged flows, meanwhile, we can set > parameter > > to destroy it. > > Can you please document new feature and command? > > Instead of overloading the 'verbose', what do you think having explicit > command to register aging events? ("flow aged register "?) I think > many of the verbose usage won't really interest in the flow aging. > Yes, some of the verbose usage indeed not interest in the flow aging. But If we use register or unregister event to one port, sometime, it will repeat many times for every ports. What do you think if we register this event all the time, and introduce new global var from command to control the event export to application ? for example: set aged_flow_event_print_en [0 | 1] > > > > Signed-off-by: Bill Zhou > > <...>
[dpdk-dev] [PATCH v3 0/2] net/mlx5: support flow aging
Those patches implement flow aging for mlx5 driver. First patch is to modify the current additional memory allocation for counter, so that it's easy to get every counter additional memory location by using offsetting. Second patch implements aging check and age-out event callback mechanism for mlx5 driver. Bill Zhou (2): net/mlx5: modify ext-counter memory allocation net/mlx5: support flow aging doc/guides/rel_notes/release_20_05.rst | 1 + drivers/net/mlx5/mlx5.c| 93 -- drivers/net/mlx5/mlx5.h| 79 +- drivers/net/mlx5/mlx5_flow.c | 205 -- drivers/net/mlx5/mlx5_flow.h | 16 +- drivers/net/mlx5/mlx5_flow_dv.c| 373 + drivers/net/mlx5/mlx5_flow_verbs.c | 16 +- 7 files changed, 655 insertions(+), 128 deletions(-) -- 2.21.0
[dpdk-dev] [PATCH v3 2/2] net/mlx5: support flow aging
Currently, there is no flow aging check and age-out event callback mechanism for mlx5 driver, this patch implements it. It's included: - Splitting the current counter container to aged or no-aged container since reducing memory consumption. Aged container will allocate extra memory to save the aging parameter from user configuration. - Aging check and age-out event callback mechanism based on current counter. When a flow be checked aged-out, RTE_ETH_EVENT_FLOW_AGED event will be triggered to applications. - Implement the new API: rte_flow_get_aged_flows, applications can use this API to get aged flows. Signed-off-by: Bill Zhou --- v2: Moving aging list from struct mlx5_ibv_shared to struct mlx5_priv, one port has one aging list. Update event be triggered once after last call of rte_flow_get_aged_flows. v3: Update the way of aging event callback, update some comments. --- doc/guides/rel_notes/release_20_05.rst | 1 + drivers/net/mlx5/mlx5.c| 93 --- drivers/net/mlx5/mlx5.h| 66 - drivers/net/mlx5/mlx5_flow.c | 205 -- drivers/net/mlx5/mlx5_flow.h | 16 +- drivers/net/mlx5/mlx5_flow_dv.c| 364 + drivers/net/mlx5/mlx5_flow_verbs.c | 14 +- 7 files changed, 636 insertions(+), 123 deletions(-) diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst index b124c3f287..a5ba8a4792 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -141,6 +141,7 @@ New Features * Added support for creating Relaxed Ordering Memory Regions. * Added support for jumbo frame size (9K MTU) in Multi-Packet RQ mode. * Optimized the memory consumption of flow. + * Added support for flow aging based on hardware counter. * **Updated the AESNI MB crypto PMD.** diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 57d76cb741..ad3d92bce2 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -437,6 +437,27 @@ mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id) return 0; } +/** + * Initialize the shared aging list information per port. + * + * @param[in] sh + * Pointer to mlx5_ibv_shared object. + */ +static void +mlx5_flow_aging_init(struct mlx5_ibv_shared *sh) +{ + uint32_t i; + struct mlx5_age_info *age_info; + + for (i = 0; i < sh->max_port; i++) { + age_info = &sh->port[i].age_info; + age_info->flags = 0; + TAILQ_INIT(&age_info->aged_counters); + rte_spinlock_init(&age_info->aged_sl); + MLX5_AGE_SET(age_info, MLX5_AGE_TRIGGER); + } +} + /** * Initialize the counters management structure. * @@ -446,11 +467,14 @@ mlx5_flow_id_release(struct mlx5_flow_id_pool *pool, uint32_t id) static void mlx5_flow_counters_mng_init(struct mlx5_ibv_shared *sh) { - uint8_t i; + uint8_t i, age; + sh->cmng.age = 0; TAILQ_INIT(&sh->cmng.flow_counters); - for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) - TAILQ_INIT(&sh->cmng.ccont[i].pool_list); + for (age = 0; age < RTE_DIM(sh->cmng.ccont[0]); ++age) { + for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) + TAILQ_INIT(&sh->cmng.ccont[i][age].pool_list); + } } /** @@ -480,7 +504,7 @@ static void mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) { struct mlx5_counter_stats_mem_mng *mng; - uint8_t i; + uint8_t i, age = 0; int j; int retries = 1024; @@ -491,36 +515,42 @@ mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) break; rte_pause(); } - for (i = 0; i < RTE_DIM(sh->cmng.ccont); ++i) { - struct mlx5_flow_counter_pool *pool; - uint32_t batch = !!(i % 2); - if (!sh->cmng.ccont[i].pools) - continue; - pool = TAILQ_FIRST(&sh->cmng.ccont[i].pool_list); - while (pool) { - if (batch) { - if (pool->min_dcs) - claim_zero - (mlx5_devx_cmd_destroy(pool->min_dcs)); - } - for (j = 0; j < MLX5_COUNTERS_PER_POOL; ++j) { - if (MLX5_POOL_GET_CNT(pool, j)->action) - claim_zero - (mlx5_glue->destroy_flow_action -(MLX5_POOL_GET_CNT(pool, j)->action)); - if (!batch && MLX5_GET_POOL_CNT_EXT - (pool, j)->dcs) -
[dpdk-dev] [PATCH v3 1/2] net/mlx5: modify ext-counter memory allocation
Currently, the counter pool needs 512 ext-counter memory for no batch counters, it's allocated separately by once, behind the 512 basic-counter memory. This is not easy to get ext-counter pointer by corresponding basic-counter pointer. This is also no easy for expanding some other potential additional type of counter memory. So, need allocate every one of ext-counter and basic-counter together, as a single piece of memory. It's will be same for further additional type of counter memory. In this case, one piece of memory contains all type of memory for one counter, it's easy to get each type memory by using offsetting. Signed-off-by: Bill Zhou --- v2: Update some comments for new adding fields. v3: Update some macro definitions. --- drivers/net/mlx5/mlx5.c| 4 ++-- drivers/net/mlx5/mlx5.h| 23 +-- drivers/net/mlx5/mlx5_flow_dv.c| 27 +++ drivers/net/mlx5/mlx5_flow_verbs.c | 16 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index cc13e447d6..57d76cb741 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -505,10 +505,10 @@ mlx5_flow_counters_mng_close(struct mlx5_ibv_shared *sh) (mlx5_devx_cmd_destroy(pool->min_dcs)); } for (j = 0; j < MLX5_COUNTERS_PER_POOL; ++j) { - if (pool->counters_raw[j].action) + if (MLX5_POOL_GET_CNT(pool, j)->action) claim_zero (mlx5_glue->destroy_flow_action - (pool->counters_raw[j].action)); +(MLX5_POOL_GET_CNT(pool, j)->action)); if (!batch && MLX5_GET_POOL_CNT_EXT (pool, j)->dcs) claim_zero(mlx5_devx_cmd_destroy diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 50349abf34..4d9984f603 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -222,6 +222,19 @@ struct mlx5_drop { #define MLX5_COUNTERS_PER_POOL 512 #define MLX5_MAX_PENDING_QUERIES 4 #define MLX5_CNT_CONTAINER_RESIZE 64 +#define CNT_SIZE (sizeof(struct mlx5_flow_counter)) +#define CNTEXT_SIZE (sizeof(struct mlx5_flow_counter_ext)) + +#define CNT_POOL_TYPE_EXT (1 << 0) +#define IS_EXT_POOL(pool) (((pool)->type) & CNT_POOL_TYPE_EXT) +#define MLX5_CNT_LEN(pool) \ + (CNT_SIZE + (IS_EXT_POOL(pool) ? CNTEXT_SIZE : 0)) +#define MLX5_POOL_GET_CNT(pool, index) \ + ((struct mlx5_flow_counter *) \ + ((uint8_t *)((pool) + 1) + (index) * (MLX5_CNT_LEN(pool +#define MLX5_CNT_ARRAY_IDX(pool, cnt) \ + ((int)(((uint8_t *)(cnt) - (uint8_t *)((pool) + 1)) / \ + MLX5_CNT_LEN(pool))) /* * The pool index and offset of counter in the pool array makes up the * counter index. In case the counter is from pool 0 and offset 0, it @@ -230,11 +243,10 @@ struct mlx5_drop { */ #define MLX5_MAKE_CNT_IDX(pi, offset) \ ((pi) * MLX5_COUNTERS_PER_POOL + (offset) + 1) -#define MLX5_CNT_TO_CNT_EXT(pool, cnt) (&((struct mlx5_flow_counter_ext *) \ - ((pool) + 1))[((cnt) - (pool)->counters_raw)]) +#define MLX5_CNT_TO_CNT_EXT(cnt) \ + ((struct mlx5_flow_counter_ext *)((cnt) + 1)) #define MLX5_GET_POOL_CNT_EXT(pool, offset) \ - (&((struct mlx5_flow_counter_ext *) \ - ((pool) + 1))[offset]) + MLX5_CNT_TO_CNT_EXT(MLX5_POOL_GET_CNT((pool), (offset))) struct mlx5_flow_counter_pool; @@ -287,11 +299,10 @@ struct mlx5_flow_counter_pool { rte_atomic64_t start_query_gen; /* Query start round. */ rte_atomic64_t end_query_gen; /* Query end round. */ uint32_t index; /* Pool index in container. */ + uint32_t type: 2; /* Memory type behind the counter array. */ rte_spinlock_t sl; /* The pool lock. */ struct mlx5_counter_stats_raw *raw; struct mlx5_counter_stats_raw *raw_hw; /* The raw on HW working. */ - struct mlx5_flow_counter counters_raw[MLX5_COUNTERS_PER_POOL]; - /* The pool counters memory. */ }; struct mlx5_counter_stats_raw; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6263ecc731..784a62c521 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3909,7 +3909,7 @@ flow_dv_counter_get_by_idx(struct rte_eth_dev *dev, MLX5_ASSERT(pool); if (ppool) *ppool = pool; - return &pool->counters_raw[idx % MLX5_COUNTERS_PER_POOL]; + return MLX5_POOL_GET_CNT(pool, idx % MLX5_COUNTERS_PER_POOL); } /** @@ -4117,7 +4117,7 @@ _flow_dv_query
[dpdk-dev] [PATCH v2] app/testpmd: support flow aging
Currently, there is no way to check the aging event or to get the current aged flows in testpmd, this patch include those implements, it's included: - Registering aging event when the testpmd application start, add new command to control if the event expose to the applications. If it's be set, when new flow be checked age out, there will be one-line output log. - Add new command to list all aged flows, meanwhile, we can set parameter to destroy it. Signed-off-by: Bill Zhou --- v2: Update the way of registering aging event, add new command to control if the event need be print or not. Update the output of the delete aged flow command format. --- app/test-pmd/cmdline.c | 46 + app/test-pmd/cmdline_flow.c | 62 +++ app/test-pmd/config.c | 108 ++-- app/test-pmd/testpmd.c | 17 +++ app/test-pmd/testpmd.h | 6 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 77 ++ 6 files changed, 304 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1375f223eb..2b1dc8f8d7 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -738,6 +738,9 @@ static void cmd_help_long_parsed(void *parsed_result, "show port (port_id) queue-region\n" "show all queue region related configuration info\n\n" + "set aged_flow_event_log (on|off)\n" + "Enable or disable aged flow event logging\n\n" + , list_pkt_forwarding_modes() ); } @@ -1125,6 +1128,10 @@ static void cmd_help_long_parsed(void *parsed_result, "Restrict ingress traffic to the defined" " flow rules\n\n" + "flow aged {port_id} [destroy]\n" + "List and destroy aged flows" + " flow rules\n\n" + "set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src" " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst" " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n" @@ -19387,6 +19394,44 @@ cmdline_parse_inst_t cmd_showport_macs = { }, }; +/* Enable/Disable flow aging event log */ +struct cmd_set_aged_flow_event_log_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t keyword; + cmdline_fixed_string_t enable; +}; +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_set = + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, + set, "set"); +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_keyword = + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, + keyword, "aged_flow_event_log"); +cmdline_parse_token_string_t cmd_set_aged_flow_event_log_enable = + TOKEN_STRING_INITIALIZER(struct cmd_set_aged_flow_event_log_result, + enable, "on#off"); + +static void +cmd_set_aged_flow_event_log_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ + struct cmd_set_aged_flow_event_log_result *res = parsed_result; + int enable = (strcmp(res->enable, "on") == 0) ? 1 : 0; + update_aging_event_log_status(enable); +} + +cmdline_parse_inst_t cmd_set_aged_flow_event_log = { + .f = cmd_set_aged_flow_event_log_parsed, + .data = NULL, + .help_str = "set aged_flow_event_log on|off", + .tokens = { + (void *)&cmd_set_aged_flow_event_log_set, + (void *)&cmd_set_aged_flow_event_log_keyword, + (void *)&cmd_set_aged_flow_event_log_enable, + NULL, + }, +}; + /* */ /* list of instructions */ @@ -19684,6 +19729,7 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_show_set_raw, (cmdline_parse_inst_t *)&cmd_show_set_raw_all, (cmdline_parse_inst_t *)&cmd_config_tx_dynf_specific, + (cmdline_parse_inst_t *)&cmd_set_aged_flow_event_log, NULL, }; diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 45bcff3cf5..4e2006c543 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -67,6 +67,7 @@ enum index { DUMP, QUERY, LIST, + AGED, ISOLATE, /* Destroy arguments. */ @@ -78,6 +79,9 @@ enum index { /* List arguments. */ LIST_GROUP, + /* Destroy aged flow arguments. */ +
[dpdk-dev] [PATCH v3] app/testpmd: support flow aging
Currently, there is no way to check the aging event or to get the current aged flows in testpmd, this patch include those implements, it's included: - Registering aging event when the testpmd application start, add one new command to set verbose bitmaps for all events. If RTE_ETH_EVENT_FLOW_AGED bit is set, when new flow be checked age out, there will be output log for it. - Add new command to list all aged flows, meanwhile, we can set parameter to destroy it. Signed-off-by: Bill Zhou --- v2: Update the way of registering aging event, add new command to control if the event need be print or not. Update the output of the delete aged flow command format. v3: Change the command from only set aged flow output to set one gloable verbose bitmap for all events output. --- app/test-pmd/cmdline.c | 49 + app/test-pmd/cmdline_flow.c | 62 +++ app/test-pmd/config.c | 108 ++-- app/test-pmd/testpmd.c | 12 +++ app/test-pmd/testpmd.h | 4 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 79 ++ 6 files changed, 303 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1375f223eb..a257f25e01 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -263,6 +263,9 @@ static void cmd_help_long_parsed(void *parsed_result, "set verbose (level)\n" "Set the debug verbosity level X.\n\n" + "set event_verbose (bitmap)\n" + "Set the event debug verbose 32 bits bitmap X.\n\n" + "set log global|(type) (level)\n" "Set the log level.\n\n" @@ -1125,6 +1128,10 @@ static void cmd_help_long_parsed(void *parsed_result, "Restrict ingress traffic to the defined" " flow rules\n\n" + "flow aged {port_id} [destroy]\n" + "List and destroy aged flows" + " flow rules\n\n" + "set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src" " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst" " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n" @@ -19387,6 +19394,47 @@ cmdline_parse_inst_t cmd_showport_macs = { }, }; +/* Set event verbose bitmap*/ +struct cmd_set_event_verbose_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t keyword; + uint32_t bitmap; +}; +cmdline_parse_token_string_t cmd_set_event_verbose_set = + TOKEN_STRING_INITIALIZER(struct cmd_set_event_verbose_result, + set, "set"); +cmdline_parse_token_string_t cmd_set_event_verbose_keyword = + TOKEN_STRING_INITIALIZER(struct cmd_set_event_verbose_result, + keyword, "event_verbose"); +cmdline_parse_token_num_t cmd_set_event_verbose_bitmap = + TOKEN_NUM_INITIALIZER(struct cmd_set_event_verbose_result, + bitmap, UINT32); + +static void +cmd_set_event_verbose_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ + struct cmd_set_event_verbose_result *res = parsed_result; + + printf("Change event verbose bitmap from 0x%x to 0x%x\n", + (unsigned int) event_verbose_bitmap, + (unsigned int) res->bitmap); + event_verbose_bitmap = res->bitmap; +} + +cmdline_parse_inst_t cmd_set_event_verbose = { + .f = cmd_set_event_verbose_parsed, + .data = NULL, + .help_str = "set event_verbose (bitmap)", + .tokens = { + (void *)&cmd_set_event_verbose_set, + (void *)&cmd_set_event_verbose_keyword, + (void *)&cmd_set_event_verbose_bitmap, + NULL, + }, +}; + /* */ /* list of instructions */ @@ -19684,6 +19732,7 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_show_set_raw, (cmdline_parse_inst_t *)&cmd_show_set_raw_all, (cmdline_parse_inst_t *)&cmd_config_tx_dynf_specific, + (cmdline_parse_inst_t *)&cmd_set_event_verbose, NULL, }; diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 45bcff3cf5..4e2006c543 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -67,6 +67,7 @@ enum index { DUMP, QUERY, LIST, + AGED, ISOLATE, /* Destroy arguments. */ @@ -78,6 +79,9 @@ enum index {
[dpdk-dev] [PATCH v4] app/testpmd: support flow aging
Currently, there is no way to check the aging event or to get the current aged flows in testpmd, this patch include those implements, it's included: - Add new item "flow_aged" to the current print event command arguments. - Add new command to list all aged flows, meanwhile, we can set parameter to destroy it. Signed-off-by: Bill Zhou --- v2: Update the way of registering aging event, add new command to control if the event need be print or not. Update the output of the delete aged flow command format. v3: Change the command from only set aged flow output to set one gloable verbose bitmap for all events output. v4: Add the event output to current global print event arguments. --- app/test-pmd/cmdline.c | 4 + app/test-pmd/cmdline_flow.c | 62 +++ app/test-pmd/config.c | 108 ++-- app/test-pmd/parameters.c | 6 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 3 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 62 +++ 7 files changed, 235 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1375f223eb..bcf9080c48 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1125,6 +1125,10 @@ static void cmd_help_long_parsed(void *parsed_result, "Restrict ingress traffic to the defined" " flow rules\n\n" + "flow aged {port_id} [destroy]\n" + "List and destroy aged flows" + " flow rules\n\n" + "set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src" " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst" " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n" diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 45bcff3cf5..4e2006c543 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -67,6 +67,7 @@ enum index { DUMP, QUERY, LIST, + AGED, ISOLATE, /* Destroy arguments. */ @@ -78,6 +79,9 @@ enum index { /* List arguments. */ LIST_GROUP, + /* Destroy aged flow arguments. */ + AGED_DESTROY, + /* Validate/create arguments. */ GROUP, PRIORITY, @@ -664,6 +668,9 @@ struct buffer { struct { int set; } isolate; /**< Isolated mode arguments. */ + struct { + int destroy; + } aged; /**< Aged arguments. */ } args; /**< Command arguments. */ }; @@ -719,6 +726,12 @@ static const enum index next_list_attr[] = { ZERO, }; +static const enum index next_aged_attr[] = { + AGED_DESTROY, + END, + ZERO, +}; + static const enum index item_param[] = { ITEM_PARAM_IS, ITEM_PARAM_SPEC, @@ -1466,6 +1479,9 @@ static int parse_action(struct context *, const struct token *, static int parse_list(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); +static int parse_aged(struct context *, const struct token *, + const char *, unsigned int, + void *, unsigned int); static int parse_isolate(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -1649,6 +1665,7 @@ static const struct token token_list[] = { FLUSH, DUMP, LIST, + AGED, QUERY, ISOLATE)), .call = parse_init, @@ -1708,6 +1725,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct buffer, port)), .call = parse_list, }, + [AGED] = { + .name = "aged", + .help = "list and destroy aged flows", + .next = NEXT(next_aged_attr, NEXT_ENTRY(PORT_ID)), + .args = ARGS(ARGS_ENTRY(struct buffer, port)), + .call = parse_aged, + }, [ISOLATE] = { .name = "isolate", .help = "restrict ingress traffic to the defined flow rules", @@ -1741,6 +1765,12 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_PTR(struct buffer, args.list.group)), .call = parse_list, }, + [AGED_DESTROY] = { + .name = "destroy", + .help = "specify aged flows need be destroyed", +
[dpdk-dev] [PATCH v5] app/testpmd: support flow aging
Currently, there is no way to check the aging event or to get the current aged flows in testpmd, this patch include those implements, it's included: - Add new item "flow_aged" to the current print event command arguments. - Add new command to list all aged flows, meanwhile, we can set parameter to destroy it. Signed-off-by: Bill Zhou --- v2: Update the way of registering aging event, add new command to control if the event need be print or not. Update the output of the delete aged flow command format. v3: Change the command from only set aged flow output to set one gloable verbose bitmap for all events output. v4: Add the event output to current global print event arguments. v5: Update the documentation about print event command line change. app/test-pmd/cmdline.c | 4 + app/test-pmd/cmdline_flow.c | 62 +++ app/test-pmd/config.c | 108 ++-- app/test-pmd/parameters.c | 6 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 3 + doc/guides/testpmd_app_ug/run_app.rst | 4 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 62 +++ 8 files changed, 237 insertions(+), 16 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1375f223eb..bcf9080c48 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1125,6 +1125,10 @@ static void cmd_help_long_parsed(void *parsed_result, "Restrict ingress traffic to the defined" " flow rules\n\n" + "flow aged {port_id} [destroy]\n" + "List and destroy aged flows" + " flow rules\n\n" + "set vxlan ip-version (ipv4|ipv6) vni (vni) udp-src" " (udp-src) udp-dst (udp-dst) ip-src (ip-src) ip-dst" " (ip-dst) eth-src (eth-src) eth-dst (eth-dst)\n" diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 45bcff3cf5..4e2006c543 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -67,6 +67,7 @@ enum index { DUMP, QUERY, LIST, + AGED, ISOLATE, /* Destroy arguments. */ @@ -78,6 +79,9 @@ enum index { /* List arguments. */ LIST_GROUP, + /* Destroy aged flow arguments. */ + AGED_DESTROY, + /* Validate/create arguments. */ GROUP, PRIORITY, @@ -664,6 +668,9 @@ struct buffer { struct { int set; } isolate; /**< Isolated mode arguments. */ + struct { + int destroy; + } aged; /**< Aged arguments. */ } args; /**< Command arguments. */ }; @@ -719,6 +726,12 @@ static const enum index next_list_attr[] = { ZERO, }; +static const enum index next_aged_attr[] = { + AGED_DESTROY, + END, + ZERO, +}; + static const enum index item_param[] = { ITEM_PARAM_IS, ITEM_PARAM_SPEC, @@ -1466,6 +1479,9 @@ static int parse_action(struct context *, const struct token *, static int parse_list(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); +static int parse_aged(struct context *, const struct token *, + const char *, unsigned int, + void *, unsigned int); static int parse_isolate(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -1649,6 +1665,7 @@ static const struct token token_list[] = { FLUSH, DUMP, LIST, + AGED, QUERY, ISOLATE)), .call = parse_init, @@ -1708,6 +1725,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct buffer, port)), .call = parse_list, }, + [AGED] = { + .name = "aged", + .help = "list and destroy aged flows", + .next = NEXT(next_aged_attr, NEXT_ENTRY(PORT_ID)), + .args = ARGS(ARGS_ENTRY(struct buffer, port)), + .call = parse_aged, + }, [ISOLATE] = { .name = "isolate", .help = "restrict ingress traffic to the defined flow rules", @@ -1741,6 +1765,12 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_PTR(struct buffer, args.list.group)), .call = parse_list, }, + [AGED_DE
Re: [dpdk-dev] [PATCH] ethdev: support flow aging
> -Original Message- > From: Thomas Monjalon > Sent: Friday, April 10, 2020 6:14 PM > To: Bill Zhou > Cc: Matan Azrad ; Ori Kam ; > wenzhuo...@intel.com; jingjing...@intel.com; > bernard.iremon...@intel.com; john.mcnam...@intel.com; > marko.kovace...@intel.com; ferruh.yi...@intel.com; > arybche...@solarflare.com; dev@dpdk.org > Subject: Re: [PATCH] ethdev: support flow aging > > 10/04/2020 11:46, BillZhou: > > One of the reasons to destroy a flow is the fact that no packet > > matches the flow for "timeout" time. > > For example, when TCP\UDP sessions are suddenly closed. > > > > Currently, there is no any DPDK mechanism for flow aging and the > > applications use their own ways to detect and destroy aged-out flows. > > > > The flow aging implementation need include: > > - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the > timeout and > > the application flow context for each flow. > > - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to > report > > that there are new aged-out flows. > > - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out flows > > contexts from the port. > > - Support input flow aging command line in Testpmd. > > > > Signed-off-by: BillZhou > > I think you should insert a space in your name: Bill Zhou. > I find strange to associate "Bill Zhou" with "dongz" in your email. > Are you sure you don't want to mention "Dong"? Thanks for your mention, it's will be updated in the latter patches. > > > > + * Added support for flow Aging mechanism base on counter. > > Aging -> aging > base -> based > counter -> hardware counter? For Mellanox mlx5 driver, flow aging is based on hardware counter update. But for this patch, it's not include this support, so remove this line. >
[dpdk-dev] [PATCH] net/mlx5: fix LRO checksum completence
The TCP checksum includes IPV4 pseudo-header checksum and L3 payload checksum which include TCP header and TCP payload. When mlx5 LRO is enabled, HW will calculate the TCP payload checksum, PMD need complete the IPV4 pseudo-header checksum and the TCP header checksum. The mlx5_lro_update_tcp_hdr function completes the TCP header checksum, but this function using lower 4 bits of data-offset field in TCP header to get the whole TCP header length, this will cause TCP header checksum wrong calculation. Update the code using higher 4 bits of data-offset field instead of lower 4 bits. Fixes: e4c2a16eb1de ("net/mlx5: handle LRO packets in Rx queue") Cc: sta...@dpdk.org Signed-off-by: Bill Zhou Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 6a17a9a5d0..e4c1c95b0e 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1529,7 +1529,7 @@ mlx5_lro_update_tcp_hdr(struct rte_tcp_hdr *restrict tcp, if (cqe->lro_tcppsh_abort_dupack & MLX5_CQE_LRO_PUSH_MASK) tcp->tcp_flags |= RTE_TCP_PSH_FLAG; tcp->cksum = 0; - csum += rte_raw_cksum(tcp, (tcp->data_off & 0xF) * 4); + csum += rte_raw_cksum(tcp, (tcp->data_off >> 4) * 4); csum = ((csum & 0x) >> 16) + (csum & 0x); csum = (~csum) & 0x; if (csum == 0) -- 2.21.0
[dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
From: Bill Zhou In the bonding configurations the port switch id for representors was composed of pf index in bonding as the 1 msb and the representor's index as the remaining 15 lsbs. The special corner case for the host PF representor on BF setups with representor id 0x was missed as well. The new switch port id consists of 4 msbs for the pf bonding index and the remaining 12 lsbs for the representor index. The switch port id ranges for each type of representors are as follows: Uplink representor(AKA master): 0x Host PF representor: 0xFFF VF representor: 0x[0-FFE] Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration") Cc: sta...@dpdk.org Signed-off-by: Bill Zhou Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_defs.h | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h index 4980352..f8f8a1f 100644 --- a/drivers/net/mlx5/mlx5_defs.h +++ b/drivers/net/mlx5/mlx5_defs.h @@ -50,7 +50,7 @@ /* Switch port ID parameters for bonding configurations. */ #define MLX5_PORT_ID_BONDING_PF_MASK 0xf -#define MLX5_PORT_ID_BONDING_PF_SHIFT 0xf +#define MLX5_PORT_ID_BONDING_PF_SHIFT 12 /* Alarm timeout. */ #define MLX5_ALARM_TIMEOUT_US 10 diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index ee97480..a3910cf 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -338,14 +338,22 @@ * representors (more than 4K) or PFs (more than 15) * this approach must be reconsidered. */ - if ((info->switch_info.port_id >> - MLX5_PORT_ID_BONDING_PF_SHIFT) || + /* Switch port ID for VF representors: 0 - 0xFFE */ + if ((info->switch_info.port_id != 0x && + info->switch_info.port_id >= + ((1 << MLX5_PORT_ID_BONDING_PF_SHIFT) - 1)) || priv->pf_bond > MLX5_PORT_ID_BONDING_PF_MASK) { DRV_LOG(ERR, "can't update switch port ID" " for bonding device"); MLX5_ASSERT(false); return -ENODEV; } + /* +* Switch port ID for Host PF representor +* (representor_id is -1) , set to 0xFFF +*/ + if (info->switch_info.port_id == 0x) + info->switch_info.port_id = 0xfff; info->switch_info.port_id |= priv->pf_bond << MLX5_PORT_ID_BONDING_PF_SHIFT; } -- 1.8.3.1
Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor in bonding
> -Original Message- > From: Ferruh Yigit > Sent: Saturday, November 14, 2020 2:54 AM > To: Bill Zhou ; Slava Ovsiienko > ; Matan Azrad ; NBU-Contact- > Thomas Monjalon > Cc: sta...@dpdk.org; dev@dpdk.org; Raslan Darawsheh ; > Bill Zhou > Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix switch port id when representor > in > bonding > > On 11/4/2020 6:04 AM, Bill Zhou wrote: > > From: Bill Zhou > > > > In the bonding configurations the port switch id for representors was > > composed of pf index in bonding as the 1 msb and the representor's > > index as the remaining 15 lsbs. The special corner case for the host > > PF representor on BF setups with representor id 0x was missed as well. > > > > The new switch port id consists of 4 msbs for the pf bonding index and > > the remaining 12 lsbs for the representor index. The switch port id > > ranges for each type of representors are as follows: > > > > Uplink representor(AKA master): 0x Host PF representor: > > 0xFFF VF representor: 0x[0-FFE] > > > > Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding > > configuration") > > Cc: sta...@dpdk.org > > > > Signed-off-by: Bill Zhou > > Acked-by: Viacheslav Ovsiienko > > Sign off tag is updated as following in the next-net, to keep consistent to > previously used name: > Signed-off-by: Dong Zhou Yes, it's fine.