patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 21.11] net/mlx5: fix RSS hash types adjustment
@ 2022-06-22 17:54 Dariusz Sosnowski
  2022-06-23 13:59 ` Kevin Traynor
  0 siblings, 1 reply; 2+ messages in thread
From: Dariusz Sosnowski @ 2022-06-22 17:54 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko; +Cc: stable

[ upstream commit d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 ]

When an indirect action was created with an RSS action configured to
hash on both source and destination L3 addresses (or L4 ports), it caused
shared hrxq to be configured to hash only on destination address
(or port).

This patch fixes this behavior by refining RSS types specified in
configuration before calculating hash types used for hrxq. Refining RSS
types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set.

Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types")
Cc: stable@dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index b24c79b324..b6f552bc62 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -14679,8 +14679,8 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  * MLX5_RSS_HASH_IPV4_DST_ONLY are mutually exclusive so they can share
  * same slot in mlx5_rss_hash_fields.
  *
- * @param[in] rss
- *   Pointer to the shared action RSS conf.
+ * @param[in] orig_rss_types
+ *   RSS type as provided in shared RSS action.
  * @param[in, out] hash_field
  *   hash_field variable needed to be adjusted.
  *
@@ -14688,10 +14688,10 @@ __flow_dv_action_rss_hrxqs_release(struct rte_eth_dev *dev,
  *   void
  */
 static void
-__flow_dv_action_rss_l34_hash_adjust(struct mlx5_shared_action_rss *rss,
+__flow_dv_action_rss_l34_hash_adjust(uint64_t orig_rss_types,
 				     uint64_t *hash_field)
 {
-	uint64_t rss_types = rss->origin.types;
+	uint64_t rss_types = rte_eth_rss_hf_refine(orig_rss_types);
 
 	switch (*hash_field & ~IBV_RX_HASH_INNER) {
 	case MLX5_RSS_HASH_IPV4:
@@ -14793,7 +14793,8 @@ __flow_dv_action_rss_setup(struct rte_eth_dev *dev,
 		uint64_t hash_fields = mlx5_rss_hash_fields[i];
 		int tunnel = 0;
 
-		__flow_dv_action_rss_l34_hash_adjust(shared_rss, &hash_fields);
+		__flow_dv_action_rss_l34_hash_adjust(shared_rss->origin.types,
+						     &hash_fields);
 		if (shared_rss->origin.level > 1) {
 			hash_fields |= IBV_RX_HASH_INNER;
 			tunnel = 1;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 21.11] net/mlx5: fix RSS hash types adjustment
  2022-06-22 17:54 [PATCH 21.11] net/mlx5: fix RSS hash types adjustment Dariusz Sosnowski
@ 2022-06-23 13:59 ` Kevin Traynor
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2022-06-23 13:59 UTC (permalink / raw)
  To: Dariusz Sosnowski, Matan Azrad, Viacheslav Ovsiienko; +Cc: stable

On 22/06/2022 18:54, Dariusz Sosnowski wrote:
> [ upstream commit d2fa2632a4a17b491f9a15834d9e13c6a6e5a1b9 ]
> 
> When an indirect action was created with an RSS action configured to
> hash on both source and destination L3 addresses (or L4 ports), it caused
> shared hrxq to be configured to hash only on destination address
> (or port).
> 
> This patch fixes this behavior by refining RSS types specified in
> configuration before calculating hash types used for hrxq. Refining RSS
> types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set.
> 
> Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types")
> Cc:stable@dpdk.org
> 
> Signed-off-by: Dariusz Sosnowski<dsosnowski@nvidia.com>
> Acked-by: Viacheslav Ovsiienko<viacheslavo@nvidia.com>

Thanks, applied.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-23 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22 17:54 [PATCH 21.11] net/mlx5: fix RSS hash types adjustment Dariusz Sosnowski
2022-06-23 13:59 ` Kevin Traynor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).