From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 19CE1C332 for ; Fri, 29 May 2015 10:11:06 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 29 May 2015 01:11:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,515,1427785200"; d="scan'208";a="733577375" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 29 May 2015 01:11:05 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t4T8B3In010877; Fri, 29 May 2015 16:11:03 +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 t4T8B1cF024855; Fri, 29 May 2015 16:11:03 +0800 Received: (from jingche2@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t4T8B1Es024851; Fri, 29 May 2015 16:11:01 +0800 From: "Chen Jing D(Mark)" To: dev@dpdk.org Date: Fri, 29 May 2015 16:10:44 +0800 Message-Id: <1432887044-24777-7-git-send-email-jing.d.chen@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1432887044-24777-1-git-send-email-jing.d.chen@intel.com> References: <1432887044-24777-1-git-send-email-jing.d.chen@intel.com> Cc: shaopeng.he@intel.com Subject: [dpdk-dev] [PATCH 6/6] fm10k: Add default mac/vlan filter to SM 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, 29 May 2015 08:11:07 -0000 From: "Chen Jing D(Mark)" Since the communication between PF/Switch Manager, VF/PF is asynchronous through mailbox, it's hard to determine when Switch Manager/PF host will send the default vlan to PF/VF. So, it's necessary to set default vlan until the device is started. Signed-off-by: Chen Jing D(Mark) --- drivers/net/fm10k/fm10k_ethdev.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index b6e82e3..3a26480 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -667,6 +667,17 @@ fm10k_dev_start(struct rte_eth_dev *dev) } } + if (hw->mac.default_vid && hw->mac.default_vid <= ETHER_MAX_VLAN_ID) { + fm10k_mbx_lock(hw); + /* Update default vlan */ + hw->mac.ops.update_vlan(hw, hw->mac.default_vid, 0, true); + + /* Add default mac/vlan filter to PF/Switch manger */ + hw->mac.ops.update_uc_addr(hw, hw->mac.dglort_map, hw->mac.addr, + hw->mac.default_vid, true, 0); + fm10k_mbx_unlock(hw); + } + return 0; } @@ -1839,15 +1850,12 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) /* Enable port first */ hw->mac.ops.update_lport_state(hw, hw->mac.dglort_map, 1, 1); - /* Update default vlan */ - hw->mac.ops.update_vlan(hw, hw->mac.default_vid, 0, true); - /* - * Add default mac/vlan filter. glort is assigned by SM for PF, while is + * Add default mac. glort is assigned by SM for PF, while is * unused for VF. PF will assign correct glort for VF. */ hw->mac.ops.update_uc_addr(hw, hw->mac.dglort_map, hw->mac.addr, - hw->mac.default_vid, 1, 0); + 0, 1, 0); /* Set unicast mode by default. App can change to other mode in other * API func. -- 1.7.7.6