patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 20.11] net/mlx5: fix RSS hash types adjustment
@ 2022-06-20 10:37 Dariusz Sosnowski
  2022-06-21  7:34 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: Dariusz Sosnowski @ 2022-06-20 10:37 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 aa22e85f6a..c1505b69e6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -11567,8 +11567,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.
  *
@@ -11576,10 +11576,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:
@@ -11680,7 +11680,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 20.11] net/mlx5: fix RSS hash types adjustment
  2022-06-20 10:37 [PATCH 20.11] net/mlx5: fix RSS hash types adjustment Dariusz Sosnowski
@ 2022-06-21  7:34 ` Xueming(Steven) Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming(Steven) Li @ 2022-06-21  7:34 UTC (permalink / raw)
  To: Dariusz Sosnowski, Matan Azrad, Slava Ovsiienko; +Cc: stable

Applied, thanks!

> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Monday, June 20, 2022 6:37 PM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: stable@dpdk.org
> Subject: [PATCH 20.11] net/mlx5: fix RSS hash types adjustment
> 
> [ 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 aa22e85f6a..c1505b69e6 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -11567,8 +11567,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.
>   *
> @@ -11576,10 +11576,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:
> @@ -11680,7 +11680,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

end of thread, other threads:[~2022-06-21  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 10:37 [PATCH 20.11] net/mlx5: fix RSS hash types adjustment Dariusz Sosnowski
2022-06-21  7:34 ` Xueming(Steven) Li

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).