DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shougang Wang <shougangx.wang@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, beilei.xing@intel.com,
	Shougang Wang <shougangx.wang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] net/i40e: fix DCB init issue
Date: Thu,  5 Mar 2020 10:42:35 +0000	[thread overview]
Message-ID: <20200305104235.63380-1-shougangx.wang@intel.com> (raw)
In-Reply-To: <20200305084037.69571-1-shougangx.wang@intel.com>

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 <shougangx.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 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


  parent reply	other threads:[~2020-03-05 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05  8:40 [dpdk-dev] [PATCH] " Shougang Wang
2020-03-05  9:06 ` Zhang, Qi Z
2020-03-05 10:42 ` Shougang Wang [this message]
2020-03-06  8:13   ` [dpdk-dev] [PATCH v2] " Ye Xiaolong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305104235.63380-1-shougangx.wang@intel.com \
    --to=shougangx.wang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).