From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C59F7BDAE for ; Fri, 5 Feb 2016 05:58:28 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 04 Feb 2016 20:58:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,398,1449561600"; d="scan'208";a="647524764" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 04 Feb 2016 20:58:27 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u154wNl9011167; Fri, 5 Feb 2016 12:58:23 +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 u154wJLp026831; Fri, 5 Feb 2016 12:58:21 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u154wJeE026827; Fri, 5 Feb 2016 12:58:19 +0800 From: Shaopeng He To: dev@dpdk.org Date: Fri, 5 Feb 2016 12:57:49 +0800 Message-Id: <1454648270-26760-6-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1454648270-26760-1-git-send-email-shaopeng.he@intel.com> References: <1450856233-11825-1-git-send-email-shaopeng.he@intel.com> <1454648270-26760-1-git-send-email-shaopeng.he@intel.com> Subject: [dpdk-dev] [PATCH v6 5/6] 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: Fri, 05 Feb 2016 04:58:29 -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 Acked-by: Michael Qiu --- 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 06bfffd..832a3fe 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2817,6 +2817,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