From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 35C6A5907 for ; Tue, 24 Jun 2014 04:02:43 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 23 Jun 2014 19:03:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,534,1400050800"; d="scan'208";a="552305053" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 23 Jun 2014 19:02:59 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s5O22vOX006950; Tue, 24 Jun 2014 10:02:57 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s5O22sKW010573; Tue, 24 Jun 2014 10:02:56 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s5O22rS5010569; Tue, 24 Jun 2014 10:02:53 +0800 From: Helin Zhang To: dev@dpdk.org Date: Tue, 24 Jun 2014 10:02:38 +0800 Message-Id: <1403575359-10422-7-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1403575359-10422-1-git-send-email-helin.zhang@intel.com> References: <1403575359-10422-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v3 6/7] i40e: ignore the failure of updating default macvlan filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 02:02:43 -0000 For NVM4.2.2 or after, the firmware has the correct configurations and load the macvlan filter as expected. It is not needed to Update the default macvlan filter which cannot be removed at all during initialization. Signed-off-by: Helin Zhang Acked-by: Jing Chen Acked-by: Cunming Liang --- lib/librte_pmd_i40e/i40e_ethdev.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 204d2cb..3311d73 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -2306,11 +2306,10 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) ret = i40e_aq_remove_macvlan(hw, vsi->seid, &def_filter, 1, NULL); if (ret != I40E_SUCCESS) { struct i40e_mac_filter *f; - PMD_DRV_LOG(WARNING, "Failed to remove default [mac,vlan] config\n"); - /* Even failed to update default setting, still needs to add the permanent - * mac into mac list. - */ + PMD_DRV_LOG(WARNING, "Cannot remove the default " + "macvlan filter\n"); + /* It needs to add the permanent mac into mac list */ f = rte_zmalloc("macv_filter", sizeof(*f), 0); if (f == NULL) { PMD_DRV_LOG(ERR, "failed to allocate memory\n"); @@ -2320,6 +2319,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) ETH_ADDR_LEN); TAILQ_INSERT_TAIL(&vsi->mac_list, f, next); vsi->mac_num++; + return ret; } @@ -2516,14 +2516,19 @@ i40e_vsi_setup(struct i40e_pf *pf, (void)rte_memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr, ETH_ADDR_LEN); - ret = i40e_update_default_filter_setting(vsi); - if (ret != I40E_SUCCESS) { - PMD_DRV_LOG(ERR, "Failed to remove default " - "filter setting\n"); - goto fail_msix_alloc; - } - } - else if (type == I40E_VSI_SRIOV) { + + /** + * Updating default filter settings are necessary to prevent + * reception of tagged packets. + * Some old firmware configurations load a default macvlan + * filter which accepts both tagged and untagged packets. + * The updating is to use a normal filter instead if needed. + * For NVM 4.2.2 or after, the updating is not needed anymore. + * The firmware with correct configurations load the default + * macvlan filter which is expected and cannot be removed. + */ + i40e_update_default_filter_setting(vsi); + } else if (type == I40E_VSI_SRIOV) { memset(&ctxt, 0, sizeof(ctxt)); /** * For other VSI, the uplink_seid equals to uplink VSI's -- 1.8.1.4