From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 5718491B6 for ; Thu, 5 Nov 2015 06:12:29 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 04 Nov 2015 21:12:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,246,1444719600"; d="scan'208";a="843524089" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 04 Nov 2015 21:12:27 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tA55CPE8001939; Thu, 5 Nov 2015 13:12:25 +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 tA55CMcB010117; Thu, 5 Nov 2015 13:12:24 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tA55CMwk010113; Thu, 5 Nov 2015 13:12:22 +0800 From: Shaopeng He To: dev@dpdk.org Date: Thu, 5 Nov 2015 13:12:07 +0800 Message-Id: <1446700329-10048-6-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1446700329-10048-1-git-send-email-shaopeng.he@intel.com> References: <1445831265-14256-1-git-send-email-shaopeng.he@intel.com> <1446700329-10048-1-git-send-email-shaopeng.he@intel.com> Subject: [dpdk-dev] [PATCH v3 5/7] fm10k: make sure default VID available in dev_init 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: Thu, 05 Nov 2015 05:12:30 -0000 When PF establishes a connection with Switch Manager, it receives a logic port range from SM, and registers certain logic ports from that range, then a default VID will be send back from SM. This whole transaction needs to be finished in dev_init, otherwise, in dev_start the interrupt setting will be changed according to RX queue number, and probably will cause this transaction failed. Signed-off-by: Shaopeng He Acked-by: Jing Chen --- drivers/net/fm10k/fm10k_ethdev.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 9b210d7..2cb0b94 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2786,6 +2786,21 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) fm10k_mbx_unlock(hw); + /* Make sure default VID is ready before going forward. */ + if (hw->mac.type == fm10k_mac_pf) { + for (i = 0; i < MAX_QUERY_SWITCH_STATE_TIMES; i++) { + if (hw->mac.default_vid) + break; + /* Delay some time to acquire async port VLAN info. */ + rte_delay_us(WAIT_SWITCH_MSG_US); + } + + if (!hw->mac.default_vid) { + PMD_INIT_LOG(ERR, "default VID is not ready"); + return -1; + } + } + /* Add default mac address */ fm10k_MAC_filter_set(dev, hw->mac.addr, true, MAIN_VSI_POOL_NUMBER); -- 1.9.3