net/i40e: fix remove MAC/VLAN addresses error
PATCH 1/1 net/i40e: fix remove MAC/VLAN addresses error
Firmware will return I40E_AQ_RC_ENOENT when try to delete non-existent MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But in i40e_asq_send_command, it will return I40E_ERR_ADMIN_QUEUE_ERROR if the return value of Admin Queue command processed by Firmware is not I40E_AQ_RC_OK or I40E_AQ_RC_EBUSY.
Use i40e_aq_remove_macvlan_v2 instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware return I40E_AQ_RC_ENOENT.
--- drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_ethdev.c +11 -4
@@ -7036,6 +7036,7 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,int ret =I40E_SUCCESS ;struct i40e_hw *hw =I40E_VSI_TO_HW (vsi);struct i40e_aqc_remove_macvlan_element_data *req_list; +enum i40e_admin_queue_err aq_status;if (filter ==NULL || total ==0 )return I40E_ERR_PARAM ;
@@ -7083,11 +7084,17 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi, req_list[i].flags =rte_cpu_to_le_16 (flags); } - ret =i40e_aq_remove_macvlan (hw, vsi->seid, req_list, - actual_num,NULL ); + ret =i40e_aq_remove_macvlan_v2 (hw, vsi->seid, req_list, + actual_num,NULL , &aq_status); +if (ret !=I40E_SUCCESS ) { -PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); - goto DONE; +/* Do not report as an error when firmware returns ENOENT */ +if (aq_status ==I40E_AQ_RC_ENOENT ) { + ret =I40E_SUCCESS ; + }else { +PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); + goto DONE; + } } num += actual_num; }while (num < total);
Signature · 1 line
2.25.1
Quoted 6 lines · Robin Zhang
Firmware will return
I40E_AQ_RC_ENOENTwhen try to delete non-existent MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But ini40e_asq_send_command, it will returnI40E_ERR_ADMIN_QUEUE_ERRORif the return value of Admin Queue command processed by Firmware is notI40E_AQ_RC_OKorI40E_AQ_RC_EBUSY.
Quoted 6 lines
Use
i40e_aq_remove_macvlan_v2instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware returnI40E_AQ_RC_ENOENT.Fixes 4861cde46116 ("i40e: new poll mode driver")
Is it relevant to stable releases (20.11/19.11) with earlier firmware?
https://git.dpdk.org/dpdk/tree/doc/guides/nics/i40e.rst#n101
Quoted 40 lines
Signed-off-by Robin Zhang <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/net/i40e/i40e_ethdev.c +11
-4@@ -7036,6 +7036,7 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,int ret =I40E_SUCCESS ;struct i40e_hw *hw =I40E_VSI_TO_HW (vsi);struct i40e_aqc_remove_macvlan_element_data *req_list; +enum i40e_admin_queue_err aq_status;if (filter ==NULL || total ==0 )return I40E_ERR_PARAM ;@@ -7083,11 +7084,17 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi, req_list[i].flags =rte_cpu_to_le_16 (flags); } - ret =i40e_aq_remove_macvlan (hw, vsi->seid, req_list, - actual_num,NULL ); + ret =i40e_aq_remove_macvlan_v2 (hw, vsi->seid, req_list, + actual_num,NULL , &aq_status); +if (ret !=I40E_SUCCESS ) { -PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); - goto DONE; +/* Do not report as an error when firmware returns ENOENT */ +if (aq_status ==I40E_AQ_RC_ENOENT ) { + ret =I40E_SUCCESS ; + }else { +PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); + goto DONE; + } } num += actual_num; }while (num < total);
Hi,
Quoted 22 lines
-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Tuesday, September 28, 2021 5:54 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix remove MAC/VLAN addresses errorQuoted 1 line · Robin Zhang
Firmware will return
I40E_AQ_RC_ENOENTwhen try to delete non-existent
Quoted 4 lines
MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But in
i40e_asq_send_command, it will returnI40E_ERR_ADMIN_QUEUE_ERRORif the return value of Admin Queue command processed by Firmware is notI40E_AQ_RC_OKor
I40E_AQ_RC_EBUSY.Quoted 5 lines
Use
i40e_aq_remove_macvlan_v2instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware returnI40E_AQ_RC_ENOENT.
Quoted 6 lines
Quoted 2 lines
Fixes 4861cde46116 ("i40e: new poll mode driver")Is it relevant to stable releases (20.11/19.11) with earlier firmware?
https://git.dpdk.org/dpdk/tree/doc/guides/nics/i40e.rst#n101
No, i40e_aq_remove_macvlan_v2 is added in latest i40e share code. So this patch cannot cc stable either.
Quoted 45 lines
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi
Quoted 18 lines
Signed-off-by Robin Zhang <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_ethdev.cindexacbe7380b1..fdc9943034100644drivers/net/i40e/i40e_ethdev.c +1
-0@@ -7036,6 +7036,7 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,int ret =I40E_SUCCESS ;struct i40e_hw *hw =I40E_VSI_TO_HW (vsi);struct i40e_aqc_remove_macvlan_element_data *req_list; +enum i40e_admin_queue_err aq_status;if (filter ==NULL || total ==0 )return I40E_ERR_PARAM ;@@ -7083,11 +7084,17 @@ i40e_remove_macvlan_filters(struct i40e_vsi*vsi,
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 7 lines
drivers/net/i40e/i40e_ethdev.c +2
-2req_list[i].flags =rte_cpu_to_le_16 (flags); } - ret =i40e_aq_remove_macvlan (hw, vsi->seid, req_list, - actual_num,NULL ); + ret = i40e_aq_remove_macvlan_v2(hw, vsi->seid, req_list, + actual_num, NULL,
&aq_status);drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 3 lines
drivers/net/i40e/i40e_ethdev.c +1
-1+if (ret !=I40E_SUCCESS ) { - PMD_DRV_LOG(ERR, "Failed to remove macvlanfilter");
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi · line 7091
Quoted 2 lines
drivers/net/i40e/i40e_ethdev.c +1
-1- goto DONE; +/* Do not report as an error when firmware returns ENOENT */
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 4 lines
drivers/net/i40e/i40e_ethdev.c +4
-0+if (aq_status ==I40E_AQ_RC_ENOENT ) { + ret =I40E_SUCCESS ; + }else { + PMD_DRV_LOG(ERR, "Failed to removemacvlan filter");
Quoted 6 lines
drivers/net/i40e/i40e_ethdev.c +2
-0+ goto DONE; + } } num += actual_num; }while (num < total);
Quoted 38 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Zhang, RobinX
Sent: Tuesday, September 28, 2021 6:36 PM
To: Kevin Traynor <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix remove MAC/VLAN addresses errorHi,
Quoted 25 lines
-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Tuesday, September 28, 2021 5:54 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix remove MAC/VLAN addresses errorQuoted 1 line · Robin Zhang
Firmware will return
I40E_AQ_RC_ENOENTwhen try to delete non-existent
Quoted 4 lines
MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But in
i40e_asq_send_command, it will returnI40E_ERR_ADMIN_QUEUE_ERRORif the return value of Admin Queue command processed by Firmware is notI40E_AQ_RC_OKor
I40E_AQ_RC_EBUSY.Quoted 7 lines
Use
i40e_aq_remove_macvlan_v2instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware returnI40E_AQ_RC_ENOENT.Fixes 4861cde46116 ("i40e: new poll mode driver")
Quoted 6 lines
Quoted 3 lines
Is it relevant to stable releases (20.11/19.11) with earlier firmware?
https://git.dpdk.org/dpdk/tree/doc/guides/nics/i40e.rst#n101No,
i40e_aq_remove_macvlan_v2is added in latest i40e share code. So this patch cannot cc stable either.
To avoid confuse, lets remove the "fix" from this patch,
Actually this is an AQ command upgrade to support new firmware and keep compatible with old firmware
So the title could be "upgrade AQ command of MAC/VLAN remove"
There might be the requirement to support new firmware in LTS release, but that should be covered by separated patches.
Quoted 47 lines
Quoted 11 lines
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi
Quoted 11 lines
Signed-off-by Robin Zhang <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_ethdev.cindexacbe7380b1..fdc9943034100644drivers/net/i40e/i40e_ethdev.c +0
-0@@ -7036,6 +7036,7 @@ i40e_remove_macvlan_filters(struct i40e_vsi*vsi,
Quoted 35 lines
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi
Quoted 8 lines
drivers/net/i40e/i40e_ethdev.c +1
-0int ret =I40E_SUCCESS ;struct i40e_hw *hw =I40E_VSI_TO_HW (vsi);struct i40e_aqc_remove_macvlan_element_data *req_list; +enum i40e_admin_queue_err aq_status;if (filter ==NULL || total ==0 )return I40E_ERR_PARAM ;@@ -7083,11 +7084,17 @@ i40e_remove_macvlan_filters(struct i40e_vsi*vsi,
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 7 lines
drivers/net/i40e/i40e_ethdev.c +2
-2req_list[i].flags =rte_cpu_to_le_16 (flags); } - ret =i40e_aq_remove_macvlan (hw, vsi->seid, req_list, - actual_num,NULL ); + ret = i40e_aq_remove_macvlan_v2(hw, vsi->seid, req_list, + actual_num, NULL,
&aq_status);drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 3 lines
drivers/net/i40e/i40e_ethdev.c +1
-1+if (ret !=I40E_SUCCESS ) { - PMD_DRV_LOG(ERR, "Failed to remove macvlanfilter");
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi · line 7091
Quoted 2 lines
drivers/net/i40e/i40e_ethdev.c +1
-1- goto DONE; +/* Do not report as an error when firmware returns ENOENT */
drivers/net/i40e/i40e_ethdev.c i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
Quoted 4 lines
drivers/net/i40e/i40e_ethdev.c +4
-0+if (aq_status ==I40E_AQ_RC_ENOENT ) { + ret =I40E_SUCCESS ; + }else { + PMD_DRV_LOG(ERR, "Failed to removemacvlan filter");
Quoted 6 lines
drivers/net/i40e/i40e_ethdev.c +2
-0+ goto DONE; + } } num += actual_num; }while (num < total);
PATCH v2 1/1 net/i40e: upgrade AQ command of MAC/VLAN remove
In reply to Robin ZhangFirmware will return I40E_AQ_RC_ENOENT when try to delete non-existent MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But in i40e_asq_send_command, it will return I40E_ERR_ADMIN_QUEUE_ERROR if the return value of Admin Queue command processed by Firmware is not I40E_AQ_RC_OK or I40E_AQ_RC_EBUSY.
Use i40e_aq_remove_macvlan_v2 instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware return I40E_AQ_RC_ENOENT.
---
v2:
- To avoid confuse, remove the "fix" from patch title
--- drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_ethdev.c +11 -4
@@ -7012,6 +7012,7 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,int ret =I40E_SUCCESS ;struct i40e_hw *hw =I40E_VSI_TO_HW (vsi);struct i40e_aqc_remove_macvlan_element_data *req_list; +enum i40e_admin_queue_err aq_status;if (filter ==NULL || total ==0 )return I40E_ERR_PARAM ;
@@ -7059,11 +7060,17 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi, req_list[i].flags =rte_cpu_to_le_16 (flags); } - ret =i40e_aq_remove_macvlan (hw, vsi->seid, req_list, - actual_num,NULL ); + ret =i40e_aq_remove_macvlan_v2 (hw, vsi->seid, req_list, + actual_num,NULL , &aq_status); +if (ret !=I40E_SUCCESS ) { -PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); - goto DONE; +/* Do not report as an error when firmware returns ENOENT */ +if (aq_status ==I40E_AQ_RC_ENOENT ) { + ret =I40E_SUCCESS ; + }else { +PMD_DRV_LOG (ERR ,"Failed to remove macvlan filter" ); + goto DONE; + } } num += actual_num; }while (num < total);
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v2] net/i40e: upgrade AQ command of MAC/VLAN remove
Quoted 11 lines
-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, October 11, 2021 4:13 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v2] net/i40e: upgrade AQ command of MAC/VLAN remove
Quoted 1 line
Firmware will return
I40E_AQ_RC_ENOENTwhen try to delete non-existent
Better to add firmware version it should be 8.4+
Quoted 9 lines
MAC/VLAN addresses from the HW filtering, this should not be considered as an Admin Queue error. But in
i40e_asq_send_command, it will returnI40E_ERR_ADMIN_QUEUE_ERRORif the return value of Admin Queue command processed by Firmware is notI40E_AQ_RC_OKorI40E_AQ_RC_EBUSY.Use
i40e_aq_remove_macvlan_v2instead so that we can get the corresponding Admin Queue status, and not report as an error in DPDK when Firmware returnI40E_AQ_RC_ENOENT.
and it will not break with a old firmware
Quoted 2 lines
Signed-off-by Robin Zhang <[email protected]>
Applied to dpdk-next-net-intel after refine the commit log.
Thanks
Qi