DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	ivan.boule@6wind.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: fix RSS structure initialisation
Date: Fri, 13 Oct 2017 14:09:45 +0200	[thread overview]
Message-ID: <8b28426c813b6811a15ee18d51d44dae748b04c8.1507896510.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <b014d4116d1fe8ce46a641f00e7a2a8ac8b9e61f.1507896510.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <b014d4116d1fe8ce46a641f00e7a2a8ac8b9e61f.1507896510.git.nelio.laranjeiro@6wind.com>

Struct rss_conf.rss_key_len is not initialised forcing the user to verify
the rss_conf.rss_key pointer to know if the key is present or not.
rss_conf.rss_key_len should have a valid length according to the size of
the rss_key pointed.

Fixes: 560e02ee5237 ("app/testpmd: configure RSS without restart")
Cc: ivan.boule@6wind.com
Cc: stable@dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/cmdline.c      | 2 +-
 drivers/net/mlx5/mlx5_rss.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 120460452..abbe52ad6 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1750,7 +1750,7 @@ cmd_config_rss_parsed(void *parsed_result,
 			__attribute__((unused)) void *data)
 {
 	struct cmd_config_rss *res = parsed_result;
-	struct rte_eth_rss_conf rss_conf;
+	struct rte_eth_rss_conf rss_conf = { .rss_key_len = 0, };
 	int diag;
 	uint8_t i;
 
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index ad6d9ab70..dd9ddf2e0 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -72,7 +72,7 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
 	int ret = 0;
 
 	priv_lock(priv);
-	if (rss_conf->rss_key_len) {
+	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);
 		if (!priv->rss_conf.rss_key) {
-- 
2.11.0

  reply	other threads:[~2017-10-13 12:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 12:09 [dpdk-dev] [PATCH 1/2] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-13 12:09 ` Nelio Laranjeiro [this message]
2017-10-20 19:46   ` [dpdk-dev] [dpdk-stable] [PATCH 2/2] app/testpmd: fix RSS structure initialisation Ferruh Yigit
2017-10-23  9:44 ` [dpdk-dev] [PATCH 0/3] net/mlx5: bugfixes Nelio Laranjeiro
2017-10-23 11:17   ` [dpdk-dev] [PATCH v3 0/3] net/mlx5: bug fixes Nelio Laranjeiro
2017-10-23 21:30     ` Ferruh Yigit
2017-10-23 11:17   ` [dpdk-dev] [PATCH v3 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-23 11:17   ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
2017-10-23 11:17   ` [dpdk-dev] [PATCH v3 3/3] net/mlx5: fix RSS hash update Nelio Laranjeiro
2017-10-23 18:54     ` Yongseok Koh
2017-10-23  9:44 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix flow priority for queue action Nelio Laranjeiro
2017-10-23  9:45 ` [dpdk-dev] [PATCH 2/3] app/testpmd: fix RSS structure initialisation Nelio Laranjeiro
2017-10-23  9:45 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix RSS hash update Nelio 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=8b28426c813b6811a15ee18d51d44dae748b04c8.1507896510.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ivan.boule@6wind.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.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).