summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxq.c
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2017-11-06 16:00:25 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2017-11-07 10:19:02 +0100
commit31b3e2b837013f764225a6f301d00f9704594f4f (patch)
tree2faf997a55475b5d608b96398e93409172d298d9 /drivers/net/mlx5/mlx5_rxq.c
parentd296d7d00501d5153fc0b04c6d33ceffb424a81a (diff)
downloaddpdk-31b3e2b837013f764225a6f301d00f9704594f4f.zip
dpdk-31b3e2b837013f764225a6f301d00f9704594f4f.tar.gz
dpdk-31b3e2b837013f764225a6f301d00f9704594f4f.tar.xz
net/mlx5: fix flow creation on port start
While the PMD avoids from creating hash RXQ with no hash fields and array of queues after the port was already started, it lacks such protection when re-creating the flows after the port restarts. This may lead to inconsistent behavior for flows depending if they were created before or after the port start. Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxq.c')
-rw-r--r--drivers/net/mlx5/mlx5_rxq.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a1f382b..18c13b3 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1265,7 +1265,8 @@ mlx5_priv_ind_table_ibv_verify(struct priv *priv)
* @param hash_fields
* Verbs protocol hash field to make the RSS on.
* @param queues
- * Queues entering in hash queue.
+ * Queues entering in hash queue. In case of empty hash_fields only the
+ * first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
*
@@ -1280,6 +1281,7 @@ mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
struct mlx5_ind_table_ibv *ind_tbl;
struct ibv_qp *qp;
+ queues_n = hash_fields ? queues_n : 1;
ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n);
if (!ind_tbl)
ind_tbl = mlx5_priv_ind_table_ibv_new(priv, queues, queues_n);
@@ -1332,7 +1334,8 @@ error:
* @param rss_conf
* RSS configuration for the Rx hash queue.
* @param queues
- * Queues entering in hash queue.
+ * Queues entering in hash queue. In case of empty hash_fields only the
+ * first queue index will be taken for the indirection table.
* @param queues_n
* Number of queues.
*
@@ -1345,6 +1348,7 @@ mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len,
{
struct mlx5_hrxq *hrxq;
+ queues_n = hash_fields ? queues_n : 1;
LIST_FOREACH(hrxq, &priv->hrxqs, next) {
struct mlx5_ind_table_ibv *ind_tbl;