DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: <ferruh.yigit@intel.com>, <thomas.monjalon@6wind.com>
Cc: <dev@dpdk.org>, <adrien.mazarguil@6wind.com>,
	<nelio.laranjeiro@6wind.com>, Yongseok Koh <yskoh@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 2/3] net/mlx5: use correct RETA table size
Date: Mon, 20 Mar 2017 16:04:34 -0700	[thread overview]
Message-ID: <c8ef649638be7cc1319bec0847852d466194533f.1490050764.git.yskoh@mellanox.com> (raw)
In-Reply-To: <cover.1490050764.git.yskoh@mellanox.com>

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 |  8 ++------
 drivers/net/mlx5/mlx5_rss.c    | 13 +++++--------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index dd5fe5c1f..0578b11e4 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -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);
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index 0bed74eeb..0702f1a63 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;
 
-- 
2.11.0

  parent reply	other threads:[~2017-03-20 23:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 22:40 [dpdk-dev] [PATCH 0/3] net/mlx5: fix updating RETA Yongseok Koh
2017-03-16 22:40 ` [dpdk-dev] [PATCH 1/3] lib/librte_ether: remove requirement of aligned RETA size Yongseok Koh
2017-03-17 17:19   ` Yongseok Koh
2017-03-16 22:40 ` [dpdk-dev] [PATCH 2/3] net/mlx5: use correct RETA table size Yongseok Koh
2017-03-16 22:40 ` [dpdk-dev] [PATCH 3/3] net/mlx5: rebuild flows on updating RETA Yongseok Koh
2017-03-17  9:11   ` Nélio Laranjeiro
2017-03-17 17:14     ` Yongseok Koh
2017-03-20  7:56       ` Nélio Laranjeiro
2017-03-20 23:04 ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: fix " Yongseok Koh
2017-03-20 23:04   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ether: remove requirement of aligned RETA size Yongseok Koh
2017-03-30  0:37     ` Thomas Monjalon
2017-03-31  7:33       ` Zhang, Helin
2017-04-01  7:28         ` Lu, Wenzhuo
2017-04-03 10:02           ` Ferruh Yigit
2017-03-20 23:04   ` Yongseok Koh [this message]
2017-03-20 23:04   ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: rebuild flows on updating RETA Yongseok Koh
2017-03-21  7:45   ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: fix " Nélio Laranjeiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8ef649638be7cc1319bec0847852d466194533f.1490050764.git.yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).