fixs for shared RSS action
cover fixs for shared RSS action
This series of patchs fix two problems of shared RSS action:
1. inner RSS (level > 1) doesn't work
2. missed RSS types support (i.e L3-src-only)
Xiaoyu Min (2):
net/mlx5: fix shared inner RSS
net/mlx5: fix missing shared RSS hash types
drivers/net/mlx5/mlx5_flow.h | 22 +++- drivers/net/mlx5/mlx5_flow_dv.c | 176 +++++++++++++++++++++++++++----- 2 files changed, 170 insertions(+), 28 deletions(-)
Signature · 1 line
2.31.0
PATCH 1/2 net/mlx5: fix shared inner RSS
The shared RSS action use the _tunnel_ information which is derived from flow items to decide whether need to do inner RSS or not. However, inner RSS should be decided by RSS level (>1) in configuration and then to create TIR with 'IBV_RX_HASH_INNER' hash bit set.
Also, for one shared RSS action there is only one set of TIRs - outer or inner could be so the unnecessary set of TIRs are removed in order to reduce resource.
--- drivers/net/mlx5/mlx5_flow.h | 2 -- drivers/net/mlx5/mlx5_flow_dv.c | 48 +++++++++++++++------------------ 2 files changed, 22 insertions(+), 28 deletions(-)
drivers/net/mlx5/mlx5_flow.h +0 -2
@@ -1129,8 +1129,6 @@ struct mlx5_shared_action_rss {/**< Hash RX queues (hrxq, hrxq_tunnel fields) indirection table. */ uint32_t hrxq[MLX5_RSS_HASH_FIELDS_LEN ];/**< Hash RX queue indexes mapped to mlx5_rss_hash_fields */ -uint32_t hrxq_tunnel[MLX5_RSS_HASH_FIELDS_LEN ]; -/**< Hash RX queue indexes for tunneled RSS */ rte_spinlock_t action_rss_sl;/**< Shared RSS action spinlock. */ };
drivers/net/mlx5/mlx5_flow_dv.c +22 -26
86 lines not on this page · raw message
Signature · 1 line
2.31.0
PATCH 2/2 net/mlx5: fix missing shared RSS hash types
In reply to Xiaoyu MinShared RSS action create all supported RSS hash combination in advance and lookup the right hash TIR when flow is actually applied by comparing hash field value.
Unfortunately some hash combination is missed, for example, UDP/TCP dest port only, L3-src-only, etc.
This patch add the missing hash combination.
In order to reduce the usage of pre-created TIRs and because for one L3+L4 combination only one IBV hash type is possible, for example, either IBV_RX_HASH_SRC_PORT_UDP or IBV_RX_HASH_DST_PORT_UDP or both of them could be set so they can share same slot in mlx5_rss_hash_fields, means only one TIR will be created.
--- drivers/net/mlx5/mlx5_flow.h | 20 +++++ drivers/net/mlx5/mlx5_flow_dv.c | 128 ++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+)
drivers/net/mlx5/mlx5_flow.h +20 -0
@@ -1106,6 +1106,26 @@ struct rte_flow {#define MLX5_RSS_HASH_IPV6_UDP \ (MLX5_RSS_HASH_IPV6 | \ IBV_RX_HASH_SRC_PORT_UDP | IBV_RX_HASH_DST_PORT_UDP) +#define MLX5_RSS_HASH_IPV4_SRC_ONLY IBV_RX_HASH_SRC_IPV4 +#define MLX5_RSS_HASH_IPV4_DST_ONLY IBV_RX_HASH_DST_IPV4 +#define MLX5_RSS_HASH_IPV6_SRC_ONLY IBV_RX_HASH_SRC_IPV6 +#define MLX5_RSS_HASH_IPV6_DST_ONLY IBV_RX_HASH_DST_IPV6 +#define MLX5_RSS_HASH_IPV4_UDP_SRC_ONLY \ + (MLX5_RSS_HASH_IPV4 | IBV_RX_HASH_SRC_PORT_UDP) +#define MLX5_RSS_HASH_IPV4_UDP_DST_ONLY \ + (MLX5_RSS_HASH_IPV4 | IBV_RX_HASH_DST_PORT_UDP) +#define MLX5_RSS_HASH_IPV6_UDP_SRC_ONLY \ + (MLX5_RSS_HASH_IPV6 | IBV_RX_HASH_SRC_PORT_UDP) +#define MLX5_RSS_HASH_IPV6_UDP_DST_ONLY \ + (MLX5_RSS_HASH_IPV6 | IBV_RX_HASH_DST_PORT_UDP) +#define MLX5_RSS_HASH_IPV4_TCP_SRC_ONLY \ + (MLX5_RSS_HASH_IPV4 | IBV_RX_HASH_SRC_PORT_TCP) +#define MLX5_RSS_HASH_IPV4_TCP_DST_ONLY \ + (MLX5_RSS_HASH_IPV4 | IBV_RX_HASH_DST_PORT_TCP) +#define MLX5_RSS_HASH_IPV6_TCP_SRC_ONLY \ + (MLX5_RSS_HASH_IPV6 | IBV_RX_HASH_SRC_PORT_TCP) +#define MLX5_RSS_HASH_IPV6_TCP_DST_ONLY \ + (MLX5_RSS_HASH_IPV6 | IBV_RX_HASH_DST_PORT_TCP)#define MLX5_RSS_HASH_NONE 0ULL/* array of valid combinations of RX Hash fields for RSS */
drivers/net/mlx5/mlx5_flow_dv.c +128 -0
183 lines not on this page · raw message
Signature · 1 line
2.31.0
Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix shared inner RSS
In reply to Xiaoyu MinFrom: Xiaoyu Min
Quoted 5 lines
The shared RSS action use the _tunnel_ information which is derived from flow items to decide whether need to do inner RSS or not.
However, inner RSS should be decided by RSS level (>1) in configuration and then to create TIR with 'IBV_RX_HASH_INNER' hash bit set.
Quoted 8 lines
Also, for one shared RSS action there is only one set of TIRs - outer or inner could be so the unnecessary set of TIRs are removed in order to reduce resource.
Fixes d2046c09aa64 ("net/mlx5: support shared action for RSS")Signed-off-by Xiaoyu Min <[email protected]>
Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix missing shared RSS hash types
In reply to Xiaoyu MinFrom: Xiaoyu Min
Quoted 15 lines
Shared RSS action create all supported RSS hash combination in advance and lookup the right hash TIR when flow is actually applied by comparing hash field value.
Unfortunately some hash combination is missed, for example, UDP/TCP dest port only, L3-src-only, etc.
This patch add the missing hash combination.
In order to reduce the usage of pre-created TIRs and because for one L3+L4 combination only one IBV hash type is possible, for example, either
IBV_RX_HASH_SRC_PORT_UDPorIBV_RX_HASH_DST_PORT_UDPor both of them could be set so they can share same slot inmlx5_rss_hash_fields, means only one TIR will be created.
Quoted 4 lines
Fixes d2046c09aa64 ("net/mlx5: support shared action for RSS")Signed-off-by Xiaoyu Min <[email protected]>
Hi,
Quoted 14 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Xiaoyu Min
Sent: Friday, March 26, 2021 8:20 AM
Cc: [email protected]
Subject: [dpdk-dev] [PATCH 0/2] fixs for shared RSS actionThis series of patchs fix two problems of shared RSS action:
1. inner RSS (level > 1) doesn't work
2. missed RSS types support (i.e L3-src-only)Xiaoyu Min (2):
net/mlx5: fix shared inner RSS
net/mlx5: fix missing shared RSS hash types
Quoted 7 lines
drivers/net/mlx5/mlx5_flow.h | 22 +++- drivers/net/mlx5/mlx5_flow_dv.c | 176 +++++++++++++++++++++++++++- ---- 2 files changed, 170 insertions(+), 28 deletions(-)--
2.31.0
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh