diff mbox series

[v2,2/2] net/iavf: fix the RSS error when VF port closed

Message ID 20201109065136.26807-3-stevex.yang@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Qi Zhang
Headers show
Series net/iavf: backported bug fixes from i40evf to iavf | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

Steve Yang Nov. 9, 2020, 6:51 a.m. UTC
Check the VF RSS offload flag and ignore relative operation when
iavf hash uninit to avoid reset/close error.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
 drivers/net/iavf/iavf_hash.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Qi Zhang Nov. 12, 2020, 11:47 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Steve Yang
> Sent: Monday, November 9, 2020 2:52 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Yang, SteveX
> <stevex.yang@intel.com>
> Subject: [dpdk-dev] [PATCH v2 2/2] net/iavf: fix the RSS error when VF port
> closed
> 
> Check the VF RSS offload flag and ignore relative operation when iavf hash
> uninit to avoid reset/close error.
> 
> Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
> 
> Signed-off-by: Steve Yang <stevex.yang@intel.com>
> ---
>  drivers/net/iavf/iavf_hash.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> 8a5a6bb5a4..d3e9218f75 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -1093,10 +1093,13 @@ iavf_hash_uninit(struct iavf_adapter *ad)
>  	if (vf->vf_reset)
>  		return;
> 
> -	if (iavf_hash_default_set(ad, false))
> -		PMD_DRV_LOG(ERR, "fail to delete default RSS");
> +	if (vf->vf_res &&
> +	    vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) {
> +		if (iavf_hash_default_set(ad, false))
> +			PMD_DRV_LOG(ERR, "fail to delete default RSS");

Better to follow the same pattern in ice_hash_init, return immediate when check something wrong.

> 
> -	iavf_unregister_parser(&iavf_hash_parser, ad);
> +		iavf_unregister_parser(&iavf_hash_parser, ad);
> +	}
>  }
> 
>  static void
> --
> 2.17.1
diff mbox series

Patch

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 8a5a6bb5a4..d3e9218f75 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -1093,10 +1093,13 @@  iavf_hash_uninit(struct iavf_adapter *ad)
 	if (vf->vf_reset)
 		return;
 
-	if (iavf_hash_default_set(ad, false))
-		PMD_DRV_LOG(ERR, "fail to delete default RSS");
+	if (vf->vf_res &&
+	    vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) {
+		if (iavf_hash_default_set(ad, false))
+			PMD_DRV_LOG(ERR, "fail to delete default RSS");
 
-	iavf_unregister_parser(&iavf_hash_parser, ad);
+		iavf_unregister_parser(&iavf_hash_parser, ad);
+	}
 }
 
 static void