Skip to contentSkip to conversation

net/mlx5: fix shared RSS and mark actions combination

PATCH Applied Suanming Mou 2 participants 2 messages Dec 15, 2020 – Jan 6, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix shared RSS and mark actions combination

In order to allow mbuf mark ID update in Rx data-path, there is a mechanism in the PMD to enable it according to the rte_flows. When a flow with mark ID and RSS/QUEUE action exists, all the relevant Rx queues will be enabled to report the mark ID.

When shared RSS action is combined with mark action, the PMD mechanism misses the Rx queues updates.

This commit handles the shared RSS case in the mechanism too.

Fixes e1592b6 ("net/mlx5: make Rx queue thread safe")
---
 drivers/net/mlx5/mlx5_flow.c    | 52 ++++++++++++++++------
 drivers/net/mlx5/mlx5_flow_dv.c | 95 ++++++++++++++++-------------------------
 2 files changed, 75 insertions(+), 72 deletions(-)
drivers/net/mlx5/mlx5_flow.c +38 -14
index 82e24d7..40f8928 100644
@@ -1001,17 +1001,29 @@ struct mlx5_flow_tunnel_info {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	const int mark = dev_handle->mark;
 	const int tunnel = !!(dev_handle->layers & MLX5_FLOW_LAYER_TUNNEL);
-	struct mlx5_hrxq *hrxq;
+	struct mlx5_ind_table_obj *ind_tbl = NULL;
 	unsigned int i;
 
-	if (dev_handle->fate_action != MLX5_FLOW_FATE_QUEUE)
-		return;
-	hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
+	if (dev_handle->fate_action == MLX5_FLOW_FATE_QUEUE) {
+		struct mlx5_hrxq *hrxq;
+
+		hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
 			      dev_handle->rix_hrxq);
-	if (!hrxq)
+		if (hrxq)
+			ind_tbl = hrxq->ind_table;
+	} else if (dev_handle->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {
+		struct mlx5_shared_action_rss *shared_rss;
+
+		shared_rss = mlx5_ipool_get
+			(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
+			 dev_handle->rix_srss);
+		if (shared_rss)
+			ind_tbl = shared_rss->ind_tbl;
+	}
+	if (!ind_tbl)
 		return;
-	for (i = 0; i != hrxq->ind_table->queues_n; ++i) {
-		int idx = hrxq->ind_table->queues[i];
+	for (i = 0; i != ind_tbl->queues_n; ++i) {
+		int idx = ind_tbl->queues[i];
 		struct mlx5_rxq_ctrl *rxq_ctrl =
 			container_of((*priv->rxqs)[idx],
 				     struct mlx5_rxq_ctrl, rxq);
@@ -1083,18 +1095,30 @@ struct mlx5_flow_tunnel_info {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	const int mark = dev_handle->mark;
 	const int tunnel = !!(dev_handle->layers & MLX5_FLOW_LAYER_TUNNEL);
-	struct mlx5_hrxq *hrxq;
+	struct mlx5_ind_table_obj *ind_tbl = NULL;
 	unsigned int i;
 
-	if (dev_handle->fate_action != MLX5_FLOW_FATE_QUEUE)
-		return;
-	hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
+	if (dev_handle->fate_action == MLX5_FLOW_FATE_QUEUE) {
+		struct mlx5_hrxq *hrxq;
+
+		hrxq = mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_HRXQ],
 			      dev_handle->rix_hrxq);
-	if (!hrxq)
+		if (hrxq)
+			ind_tbl = hrxq->ind_table;
+	} else if (dev_handle->fate_action == MLX5_FLOW_FATE_SHARED_RSS) {
+		struct mlx5_shared_action_rss *shared_rss;
+
+		shared_rss = mlx5_ipool_get
+			(priv->sh->ipool[MLX5_IPOOL_RSS_SHARED_ACTIONS],
+			 dev_handle->rix_srss);
+		if (shared_rss)
+			ind_tbl = shared_rss->ind_tbl;
+	}
+	if (!ind_tbl)
 		return;
 	MLX5_ASSERT(dev->data->dev_started);
-	for (i = 0; i != hrxq->ind_table->queues_n; ++i) {
-		int idx = hrxq->ind_table->queues[i];
+	for (i = 0; i != ind_tbl->queues_n; ++i) {
+		int idx = ind_tbl->queues[i];
 		struct mlx5_rxq_ctrl *rxq_ctrl =
 			container_of((*priv->rxqs)[idx],
 				     struct mlx5_rxq_ctrl, rxq);
drivers/net/mlx5/mlx5_flow_dv.c +37 -58

151 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

15/12/2020 04:46, Suanming Mou:

Quoted 8 lines

In order to allow mbuf mark ID update in Rx data-path, there is a mechanism in the PMD to enable it according to the rte_flows. When a flow with mark ID and RSS/QUEUE action exists, all the relevant Rx queues will be enabled to report the mark ID.

When shared RSS action is combined with mark action, the PMD mechanism misses the Rx queues updates.

Quoted 7 lines

This commit handles the shared RSS case in the mechanism too.

Fixes e1592b6 ("net/mlx5: make Rx queue thread safe")

Applied in next-net-mlx, thanks.