DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robin Zhang <robinx.zhang@intel.com>
To: dev@dpdk.org
Cc: beilei.xing@intel.com, qi.z.zhang@intel.com,
	junfeng.guo@intel.com, stevex.yang@intel.com,
	Robin Zhang <robinx.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/i40e: upgrade AQ command of MAC/VLAN remove
Date: Mon, 11 Oct 2021 08:12:48 +0000	[thread overview]
Message-ID: <20211011081248.4108-1-robinx.zhang@intel.com> (raw)
In-Reply-To: <20210928084042.1227848-1-robinx.zhang@intel.com>

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.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
---

v2:
- To avoid confuse, remove the "fix" from patch title

---
 drivers/net/i40e/i40e_ethdev.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index b00f9cd396..52f6c673be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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);
-- 
2.25.1


  parent reply	other threads:[~2021-10-11  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  8:40 [dpdk-dev] [PATCH] net/i40e: fix remove MAC/VLAN addresses error Robin Zhang
2021-09-28  9:53 ` Kevin Traynor
2021-09-28 10:36   ` Zhang, RobinX
2021-10-09  9:21     ` Zhang, Qi Z
2021-10-11  8:12 ` Robin Zhang [this message]
2021-10-13  2:21   ` [dpdk-dev] [PATCH v2] net/i40e: upgrade AQ command of MAC/VLAN remove Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011081248.4108-1-robinx.zhang@intel.com \
    --to=robinx.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=junfeng.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stevex.yang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).