]> git.droids-corp.org - dpdk.git/commitdiff
net/mlx5: use correct RETA table size
authorYongseok Koh <yskoh@mellanox.com>
Mon, 20 Mar 2017 23:04:34 +0000 (16:04 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:03:02 +0000 (19:03 +0200)
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>
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_rss.c

index 766fb7269a6d32edd9439cdf445ec2bc55eb2ca0..18f4c96e5a8eaca5d6cdaa179bf7c3e7db1cdbab 100644 (file)
@@ -701,12 +701,8 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
                                          DEV_TX_OFFLOAD_GRE_TNL_TSO);
        if (priv_get_ifname(priv, &ifname) == 0)
                info->if_index = if_nametoindex(ifname);
-       /* FIXME: RETA update/query API expects the callee to know the size of
-        * the indirection table, for this PMD the size varies depending on
-        * the number of RX queues, it becomes impossible to find the correct
-        * size if it is not fixed.
-        * The API should be updated to solve this problem. */
-       info->reta_size = priv->ind_table_max_size;
+       info->reta_size = priv->reta_idx_n ?
+               priv->reta_idx_n : priv->ind_table_max_size;
        info->hash_key_size = ((*priv->rss_conf) ?
                               (*priv->rss_conf)[0]->rss_key_len :
                               0);
index 0bed74eeb80f2fd1be41053901c6029307eb24c7..0702f1a63a0d079b495b0dadfaccdcaa9adbfe9d 100644 (file)
@@ -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;