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 32F088E82 for ; Fri, 25 Sep 2015 07:37:25 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 24 Sep 2015 22:37:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,585,1437462000"; d="scan'208";a="776722148" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 24 Sep 2015 22:37:24 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t8P5bMok019319; Fri, 25 Sep 2015 13:37:22 +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 t8P5bIZb032558; Fri, 25 Sep 2015 13:37:20 +0800 Received: (from heshaope@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t8P5bIhi032554; Fri, 25 Sep 2015 13:37:18 +0800 From: Shaopeng He To: dev@dpdk.org Date: Fri, 25 Sep 2015 13:37:03 +0800 Message-Id: <1443159425-32502-4-git-send-email-shaopeng.he@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1443159425-32502-1-git-send-email-shaopeng.he@intel.com> References: <1443159425-32502-1-git-send-email-shaopeng.he@intel.com> Subject: [dpdk-dev] [PATCH 3/5] 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, 25 Sep 2015 05:37:25 -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 --- 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 6648934..d5e18bc 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2354,6 +2354,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); -- 1.9.3