diff mbox

[dpdk-dev,v2] i40e: fix issue of reconfigure hash enable flags

Message ID 1448259564-4635-1-git-send-email-helin.zhang@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Helin Zhang Nov. 23, 2015, 6:19 a.m. UTC
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.

Comments

Jingjing Wu Nov. 23, 2015, 8:29 a.m. UTC | #1
> -----Original Message-----
> From: Zhang, Helin
> Sent: Monday, November 23, 2015 2:19 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing; Pei, Yulong; Zhang, Helin
> Subject: [PATCH v2] i40e: fix issue of reconfigure hash enable flags
> 
> 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>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Thomas Monjalon Nov. 23, 2015, 9:55 p.m. UTC | #2
> > 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>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Applied, thanks
diff mbox

Patch

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 =