summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rss.c
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2018-01-03 10:14:19 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commitb365799b3cd440437367b4539f1792eb65c86cc7 (patch)
treeaece30e72bd0834c38fd81629789312c70be1746 /drivers/net/mlx5/mlx5_rss.c
parentd1eded3a8e6fa28087eef3062081a8b0f2dca222 (diff)
downloaddpdk-next-eventdev-b365799b3cd440437367b4539f1792eb65c86cc7.zip
dpdk-next-eventdev-b365799b3cd440437367b4539f1792eb65c86cc7.tar.gz
dpdk-next-eventdev-b365799b3cd440437367b4539f1792eb65c86cc7.tar.xz
net/mlx5: fix un-supported RSS hash fields use
MLX5 NIC does not support all hash fields, this patch limit by refusing impossible RSS combination to avoid errors. Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rss.c')
-rw-r--r--drivers/net/mlx5/mlx5_rss.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f491135..f47bda6 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -51,6 +51,7 @@
#include <rte_ethdev.h>
#include "mlx5.h"
+#include "mlx5_defs.h"
#include "mlx5_rxtx.h"
/**
@@ -72,6 +73,10 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
int ret = 0;
priv_lock(priv);
+ if (rss_conf->rss_hf & MLX5_RSS_HF_MASK) {
+ ret = -EINVAL;
+ goto out;
+ }
if (rss_conf->rss_key && rss_conf->rss_key_len) {
priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
rss_conf->rss_key_len, 0);