* [dpdk-dev] [PATCH] i40e: fix issue of reconfigure hash enable flags
@ 2015-11-23 5:36 Helin Zhang
2015-11-23 5:53 ` Wu, Jingjing
2015-11-23 6:19 ` [dpdk-dev] [PATCH v2] " Helin Zhang
0 siblings, 2 replies; 6+ messages in thread
From: Helin Zhang @ 2015-11-23 5:36 UTC (permalink / raw)
To: dev
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(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2c51a0b..e9e07e2 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 && (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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: fix issue of reconfigure hash enable flags
2015-11-23 5:36 [dpdk-dev] [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 ` [dpdk-dev] [PATCH v2] " Helin Zhang
1 sibling, 1 reply; 6+ messages in thread
From: Wu, Jingjing @ 2015-11-23 5:53 UTC (permalink / raw)
To: Zhang, Helin, dev
>
> - 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 && (key_len != (I40E_PFQF_HKEY_MAX_INDEX + 1) *
> + sizeof(uint32_t))) {
No need to check key in else if, it shouldn't be NULL here.
> + PMD_DRV_LOG(ERR, "Invalid key length %u", key_len);
> return -EINVAL;
> + }
Thanks
Jingjing
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: fix issue of reconfigure hash enable flags
2015-11-23 5:53 ` Wu, Jingjing
@ 2015-11-23 5:58 ` Zhang, Helin
0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Helin @ 2015-11-23 5:58 UTC (permalink / raw)
To: Wu, Jingjing, dev
> -----Original Message-----
> From: Wu, Jingjing
> Sent: Monday, November 23, 2015 1:54 PM
> To: Zhang, Helin; dev@dpdk.org
> Cc: Pei, Yulong
> Subject: RE: [PATCH] i40e: fix issue of reconfigure hash enable flags
>
> >
> > - 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 && (key_len != (I40E_PFQF_HKEY_MAX_INDEX + 1) *
> > + sizeof(uint32_t))) {
> No need to check key in else if, it shouldn't be NULL here.
Yes, it should be removed. Thanks!
Regards,
Helin
> > + PMD_DRV_LOG(ERR, "Invalid key length %u", key_len);
> > return -EINVAL;
> > + }
>
> Thanks
> Jingjing
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] i40e: fix issue of reconfigure hash enable flags
2015-11-23 5:36 [dpdk-dev] [PATCH] i40e: fix issue of reconfigure hash enable flags Helin Zhang
2015-11-23 5:53 ` Wu, Jingjing
@ 2015-11-23 6:19 ` Helin Zhang
2015-11-23 8:29 ` Wu, Jingjing
1 sibling, 1 reply; 6+ messages in thread
From: Helin Zhang @ 2015-11-23 6:19 UTC (permalink / raw)
To: dev
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: fix issue of reconfigure hash enable flags
2015-11-23 6:19 ` [dpdk-dev] [PATCH v2] " Helin Zhang
@ 2015-11-23 8:29 ` Wu, Jingjing
2015-11-23 21:55 ` Thomas Monjalon
0 siblings, 1 reply; 6+ messages in thread
From: Wu, Jingjing @ 2015-11-23 8:29 UTC (permalink / raw)
To: Zhang, Helin, dev
> -----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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: fix issue of reconfigure hash enable flags
2015-11-23 8:29 ` Wu, Jingjing
@ 2015-11-23 21:55 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2015-11-23 21:55 UTC (permalink / raw)
To: Zhang, Helin; +Cc: dev
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-23 21:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 5:36 [dpdk-dev] [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 ` [dpdk-dev] [PATCH v2] " Helin Zhang
2015-11-23 8:29 ` Wu, Jingjing
2015-11-23 21:55 ` 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).