Skip to contentSkip to conversation

net/mlx5: fix meter policy with RSS action

PATCH In review Li Zhang 2 participants 2 messages Jun 23, 2021 – Jun 28, 2021 Network drivers

lore
Share & tools
lore

Li Zhang

author
#0 lore raw

PATCH 1/1 net/mlx5: fix meter policy with RSS action

When creating the meter sub-policy RSS rule, the RSS descriptor was used before its update. It also need update tunnel bit in RSS descriptor after flow translate.

Use it only when it is updated.

Fixes ec962bad14e ("net/mlx5: fix metering cleanup on stop")
---
 drivers/net/mlx5/mlx5_flow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow.c +5 -1
index c5c767aaee..c5d4a95a8f 100644
@@ -4613,7 +4613,6 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 			struct mlx5_flow dev_flow = {0};
 			struct mlx5_flow_handle dev_handle = { {0} };
 
-			rss_desc_v[i] = wks->rss_desc;
 			if (policy->is_rss) {
 				const void *rss_act =
 					policy->act_cnt[i].rss->conf;
@@ -4641,14 +4640,19 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 				if (flow_drv_translate(dev, &dev_flow, attr,
 						items, rss_actions, error))
 					goto exit;
+				rss_desc_v[i] = wks->rss_desc;
 				rss_desc_v[i].key_len = MLX5_RSS_HASH_KEY_LEN;
 				rss_desc_v[i].hash_fields =
 						dev_flow.hash_fields;
 				rss_desc_v[i].queue_num =
 						rss_desc_v[i].hash_fields ?
 						rss_desc_v[i].queue_num : 1;
+				rss_desc_v[i].tunnel =
+					!!(dev_flow.handle->layers &
+					MLX5_FLOW_LAYER_TUNNEL);
 			} else {
 				/* This is queue action. */
+				rss_desc_v[i] = wks->rss_desc;
 				rss_desc_v[i].key_len = 0;
 				rss_desc_v[i].hash_fields = 0;
 				rss_desc_v[i].queue =
Signature · 1 line
2.27.0
#1 lore raw

Hi,

Quoted 16 lines

-----Original Message-----
From: Li Zhang <[email protected]>
Sent: Wednesday, June 23, 2021 10:25 AM
To: Ori Kam <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>
Cc: [email protected]; NBU-Contact-Thomas Monjalon <[email protected]>; Raslan Darawsheh <[email protected]>; Roni Bar Yanai <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix meter policy with RSS action

When creating the meter sub-policy RSS rule, the RSS descriptor was used before its update. It also need update tunnel bit in RSS descriptor after flow translate.

Quoted 8 lines

Use it only when it is updated.

Fixes ec962bad14e ("net/mlx5: fix metering cleanup on stop")

---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh