From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DEB2A034F; Mon, 11 Oct 2021 10:27:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F08BC410E8; Mon, 11 Oct 2021 10:27:06 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 2CE04410E5 for ; Mon, 11 Oct 2021 10:27:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="224236302" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="224236302" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 01:27:04 -0700 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="479767810" Received: from unknown (HELO intel-npg-odc-srv03.cd.intel.com) ([10.240.178.145]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 01:27:02 -0700 From: Robin Zhang To: dev@dpdk.org Cc: beilei.xing@intel.com, qi.z.zhang@intel.com, junfeng.guo@intel.com, stevex.yang@intel.com, Robin Zhang Date: Mon, 11 Oct 2021 08:12:48 +0000 Message-Id: <20211011081248.4108-1-robinx.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210928084042.1227848-1-robinx.zhang@intel.com> References: <20210928084042.1227848-1-robinx.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/i40e: upgrade AQ command of MAC/VLAN remove X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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