From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13E6CA056A; Fri, 6 Mar 2020 09:16:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3EC7E1BFBB; Fri, 6 Mar 2020 09:16:11 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 42D7523D; Fri, 6 Mar 2020 09:16:09 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 00:16:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,521,1574150400"; d="scan'208";a="234795156" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga008.fm.intel.com with ESMTP; 06 Mar 2020 00:16:06 -0800 Date: Fri, 6 Mar 2020 16:13:47 +0800 From: Ye Xiaolong To: Shougang Wang Cc: dev@dpdk.org, qiming.yang@intel.com, beilei.xing@intel.com, stable@dpdk.org Message-ID: <20200306081347.GA18727@intel.com> References: <20200305084037.69571-1-shougangx.wang@intel.com> <20200305104235.63380-1-shougangx.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200305104235.63380-1-shougangx.wang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix DCB init issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/05, Shougang Wang wrote: >Stopping lldp is necessary for DPDK, but it will cause DCB init failed. >For kernel shared code, the prerequisite for successful initialization >of DCB is that LLDP is enabled. This patch starts lldp before DCB init >and stops it when finish init. > >Fixes: a8e84b22bd55 ("net/i40e/base: support persistent LLDP") >Cc: stable@dpdk.org > >Signed-off-by: Shougang Wang >Acked-by: Qi Zhang >--- > drivers/net/i40e/i40e_ethdev.c | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c >index 9fbda1c34..9459b520c 100644 >--- a/drivers/net/i40e/i40e_ethdev.c >+++ b/drivers/net/i40e/i40e_ethdev.c >@@ -11669,11 +11669,15 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb) > * LLDP MIB change event. > */ > if (sw_dcb == TRUE) { >- if (i40e_need_stop_lldp(dev)) { >- ret = i40e_aq_stop_lldp(hw, TRUE, TRUE, NULL); >- if (ret != I40E_SUCCESS) >- PMD_INIT_LOG(DEBUG, "Failed to stop lldp"); >- } >+ /* Stopping lldp is necessary for DPDK, but it will cause >+ * DCB init failed. For i40e_init_dcb(), the prerequisite >+ * for successful initialization of DCB is that LLDP is >+ * enabled. So it is needed to start lldp before DCB init >+ * and stop it after initialization. >+ */ >+ ret = i40e_aq_start_lldp(hw, true, NULL); >+ if (ret != I40E_SUCCESS) >+ PMD_INIT_LOG(DEBUG, "Failed to start lldp"); > > ret = i40e_init_dcb(hw, true); > /* If lldp agent is stopped, the return value from >@@ -11718,6 +11722,12 @@ i40e_dcb_init_configure(struct rte_eth_dev *dev, bool sw_dcb) > ret, hw->aq.asq_last_status); > return -ENOTSUP; > } >+ >+ if (i40e_need_stop_lldp(dev)) { >+ ret = i40e_aq_stop_lldp(hw, true, true, NULL); >+ if (ret != I40E_SUCCESS) >+ PMD_INIT_LOG(DEBUG, "Failed to stop lldp"); >+ } > } else { > ret = i40e_aq_start_lldp(hw, true, NULL); > if (ret != I40E_SUCCESS) >-- >2.17.1 > Acked-by: Xiaolong Ye Applied to dpdk-next-net-intel, Thanks.