From: Helin Zhang Date: Mon, 23 Nov 2015 06:19:24 +0000 (+0800) Subject: i40e: fix reconfiguring hash enable flags X-Git-Tag: spdx-start~8006 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8ebb29567b0792e693510a760b9eeaca73ae1b55;p=dpdk.git i40e: fix reconfiguring 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 Acked-by: Jingjing Wu --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 6cf99dc7fb..684b2ec0e1 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -5672,9 +5672,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 =