summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rss.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2017-03-20 16:04:34 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2017-04-04 19:03:02 +0200
commitd365210ef18212a73b2821b669f94d86b469225a (patch)
treefc7c87a9841f1ef88fb6a811197e04f8b14aee10 /drivers/net/mlx5/mlx5_rss.c
parent6f60ca5e5ef386ae362676b1e8f6678cfae36e63 (diff)
downloaddpdk-next-eventdev-d365210ef18212a73b2821b669f94d86b469225a.zip
dpdk-next-eventdev-d365210ef18212a73b2821b669f94d86b469225a.tar.gz
dpdk-next-eventdev-d365210ef18212a73b2821b669f94d86b469225a.tar.xz
net/mlx5: use correct RETA table size
When querying and updating RSS RETA table, it always uses the max size of the device instead of configured value. This patch fixes it and removed the related comments in the code. Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rss.c')
-rw-r--r--drivers/net/mlx5/mlx5_rss.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index 0bed74e..0702f1a 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -257,13 +257,9 @@ priv_dev_rss_reta_query(struct priv *priv,
{
unsigned int idx;
unsigned int i;
- int ret;
-
- /* See RETA comment in mlx5_dev_infos_get(). */
- ret = priv_rss_reta_index_resize(priv, priv->ind_table_max_size);
- if (ret)
- return ret;
+ if (!reta_size || reta_size > priv->reta_idx_n)
+ return EINVAL;
/* Fill each entry of the table even if its bit is not set. */
for (idx = 0, i = 0; (i != reta_size); ++i) {
idx = i / RTE_RETA_GROUP_SIZE;
@@ -296,8 +292,9 @@ priv_dev_rss_reta_update(struct priv *priv,
unsigned int pos;
int ret;
- /* See RETA comment in mlx5_dev_infos_get(). */
- ret = priv_rss_reta_index_resize(priv, priv->ind_table_max_size);
+ if (!reta_size)
+ return EINVAL;
+ ret = priv_rss_reta_index_resize(priv, reta_size);
if (ret)
return ret;