net/mlx5: fix shared RSS and mark actions combination
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.
--- 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
@@ -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
Thomas Monjalon
Applied15/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")Signed-off-by Suanming Mou <[email protected]>Acked-by Matan Azrad <[email protected]>
Applied in next-net-mlx, thanks.