From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by dpdk.org (Postfix) with ESMTP id 4EEDF2A7 for ; Fri, 20 Jun 2014 12:24:50 +0200 (CEST) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 20 Jun 2014 03:25:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,513,1400050800"; d="scan'208";a="447898638" Received: from shilc102.sh.intel.com ([10.239.39.44]) by azsmga001.ch.intel.com with ESMTP; 20 Jun 2014 03:25:05 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shilc102.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s5KAP0l0029307; Fri, 20 Jun 2014 18:25:02 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s5KAOwmw006621; Fri, 20 Jun 2014 18:25:00 +0800 Received: (from jingche2@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s5KAOwF5006617; Fri, 20 Jun 2014 18:24:58 +0800 From: "Chen Jing D(Mark)" To: dev@dpdk.org Date: Fri, 20 Jun 2014 18:24:40 +0800 Message-Id: <1403259884-6498-3-git-send-email-jing.d.chen@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1403259884-6498-1-git-send-email-jing.d.chen@intel.com> References: <1403259884-6498-1-git-send-email-jing.d.chen@intel.com> Subject: [dpdk-dev] [PATCH 2/6] i40e: Add permenant mac address into mac list 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: Fri, 20 Jun 2014 10:24:50 -0000 From: "Chen Jing D(Mark)" In old firmware versions, the default mac vlan filter setting is not the one that we expected, so we'll try to remove it and add new one to change default setting. After firmware updated, it change default setting to the one that we expected and don't allow to remove the setting. In this case, we should add the perenant mac address into mac list and then return. Signed-off-by: Chen Jing D(Mark) Acked-by: Helin Zhang Acked-by: Cunming Liang Acked-by: Jingjing Wu --- lib/librte_pmd_i40e/i40e_ethdev.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 7ee6a70..4535cdf 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -2277,8 +2277,24 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) def_filter.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH | I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; ret = i40e_aq_remove_macvlan(hw, vsi->seid, &def_filter, 1, NULL); - if (ret != I40E_SUCCESS) + 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. + */ + f = rte_zmalloc("macv_filter", sizeof(*f), 0); + if (f == NULL) { + PMD_DRV_LOG(ERR, "failed to allocate memory\n"); + return I40E_ERR_NO_MEMORY; + } + (void)rte_memcpy(&f->macaddr.addr_bytes, hw->mac.perm_addr, + ETH_ADDR_LEN); + TAILQ_INSERT_TAIL(&vsi->mac_list, f, next); + vsi->mac_num++; return ret; + } return i40e_vsi_add_mac(vsi, (struct ether_addr *)(hw->mac.perm_addr)); } -- 1.7.7.6