All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [PATCH v2] i40e: fix issue of reconfigure hash enable flags
Date: Mon, 23 Nov 2015 14:19:24 +0800	[thread overview]
Message-ID: <1448259564-4635-1-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1448256970-2722-1-git-send-email-helin.zhang@intel.com>

It fixes the issue of not re-configuring hash enable flags (HENA)
if there is no key.

Fixes: d0a349409bd7 ("i40e: support AQ based RSS config")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

v2 changes:
Removed useless checks.

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2c51a0b..4bc258a 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5663,9 +5663,14 @@ i40e_set_rss_key(struct i40e_vsi *vsi, uint8_t *key, uint8_t key_len)
 	struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
 	int ret = 0;
 
-	if (!key || key_len != ((I40E_PFQF_HKEY_MAX_INDEX + 1) *
-		sizeof(uint32_t)))
+	if (!key || key_len == 0) {
+		PMD_DRV_LOG(DEBUG, "No key to be configured");
+		return 0;
+	} else if (key_len != (I40E_PFQF_HKEY_MAX_INDEX + 1) *
+		sizeof(uint32_t)) {
+		PMD_DRV_LOG(ERR, "Invalid key length %u", key_len);
 		return -EINVAL;
+	}
 
 	if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
 		struct i40e_aqc_get_set_rss_key_data *key_dw =
-- 
1.9.3

  parent reply	other threads:[~2015-11-23  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23  5:36 [PATCH] i40e: fix issue of reconfigure hash enable flags Helin Zhang
2015-11-23  5:53 ` Wu, Jingjing
2015-11-23  5:58   ` Zhang, Helin
2015-11-23  6:19 ` Helin Zhang [this message]
2015-11-23  8:29   ` [PATCH v2] " Wu, Jingjing
2015-11-23 21:55     ` Thomas Monjalon

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=1448259564-4635-1-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.