DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40evf: fix the issue of configuring rss key enable flags
@ 2015-11-27 15:34 Helin Zhang
  2015-11-27 18:29 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Helin Zhang @ 2015-11-27 15:34 UTC (permalink / raw)
  To: dev

It fixes the issue of not configuring rss key enable flags
when there is no rss key available.

Fixes: 647d1eaf758b ("i40evf: support AQ based RSS config")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index ea96f85..5c554f2 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2200,9 +2200,14 @@ i40evf_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_VFQF_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_VFQF_HKEY_MAX_INDEX + 1) *
+		sizeof(uint32_t)) {
+		PMD_DRV_LOG(ERR, "Invalid key length %u", key_len);
 		return -EINVAL;
+	}
 
 	if (vf->flags & I40E_FLAG_RSS_AQ_CAPABLE) {
 		struct i40e_aqc_get_set_rss_key_data *key_dw =
@@ -2322,12 +2327,14 @@ i40evf_config_rss(struct i40e_vf *vf)
 		return 0;
 	}
 
-	if (rss_conf.rss_key == NULL || rss_conf.rss_key_len < nb_q) {
+	if (rss_conf.rss_key == NULL || rss_conf.rss_key_len <
+		(I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t)) {
 		/* Calculate the default hash key */
 		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
 			rss_key_default[i] = (uint32_t)rte_rand();
 		rss_conf.rss_key = (uint8_t *)rss_key_default;
-		rss_conf.rss_key_len = nb_q;
+		rss_conf.rss_key_len = (I40E_VFQF_HKEY_MAX_INDEX + 1) *
+			sizeof(uint32_t);
 	}
 
 	return i40evf_hw_rss_hash_set(vf, &rss_conf);
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] i40evf: fix the issue of configuring rss key enable flags
  2015-11-27 15:34 [dpdk-dev] [PATCH] i40evf: fix the issue of configuring rss key enable flags Helin Zhang
@ 2015-11-27 18:29 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-11-27 18:29 UTC (permalink / raw)
  To: Helin Zhang; +Cc: dev

2015-11-27 23:34, Helin Zhang:
> It fixes the issue of not configuring rss key enable flags
> when there is no rss key available.
> 
> Fixes: 647d1eaf758b ("i40evf: support AQ based RSS config")
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-27 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27 15:34 [dpdk-dev] [PATCH] i40evf: fix the issue of configuring rss key enable flags Helin Zhang
2015-11-27 18:29 ` Thomas Monjalon

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).