patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/i40e: fix DCB init issue
@ 2020-03-05  8:40 Shougang Wang
  2020-03-05  9:06 ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
  2020-03-05 10:42 ` [dpdk-stable] [PATCH v2] " Shougang Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Shougang Wang @ 2020-03-05  8:40 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, beilei.xing, Shougang Wang, stable

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>
---
 drivers/net/i40e/i40e_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9fbda1c34..9f37662f8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11669,11 +11669,9 @@ 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");
-		}
+		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 +11716,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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/i40e: fix DCB init issue
  2020-03-05  8:40 [dpdk-stable] [PATCH] net/i40e: fix DCB init issue Shougang Wang
@ 2020-03-05  9:06 ` Zhang, Qi Z
  2020-03-05 10:42 ` [dpdk-stable] [PATCH v2] " Shougang Wang
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2020-03-05  9:06 UTC (permalink / raw)
  To: Wang, ShougangX, dev; +Cc: Yang, Qiming, Xing, Beilei, Wang, ShougangX, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Shougang Wang
> Sent: Thursday, March 5, 2020 4:41 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Wang, ShougangX <shougangx.wang@intel.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix DCB init issue
> 
> 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>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 9fbda1c34..9f37662f8 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -11669,11 +11669,9 @@ 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");
> -		}

It's better to add some comment here, so easy for other people to understand the purpose.
Otherwise

Acked-by: Qi Zhang <qi.z.zhang@intel.com>



> +		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
> +11716,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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v2] net/i40e: fix DCB init issue
  2020-03-05  8:40 [dpdk-stable] [PATCH] net/i40e: fix DCB init issue Shougang Wang
  2020-03-05  9:06 ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
@ 2020-03-05 10:42 ` Shougang Wang
  2020-03-06  8:13   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong
  1 sibling, 1 reply; 4+ messages in thread
From: Shougang Wang @ 2020-03-05 10:42 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, beilei.xing, Shougang Wang, stable

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/i40e: fix DCB init issue
  2020-03-05 10:42 ` [dpdk-stable] [PATCH v2] " Shougang Wang
@ 2020-03-06  8:13   ` Ye Xiaolong
  0 siblings, 0 replies; 4+ messages in thread
From: Ye Xiaolong @ 2020-03-06  8:13 UTC (permalink / raw)
  To: Shougang Wang; +Cc: dev, qiming.yang, beilei.xing, stable

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 <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
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel, Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-06  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-05  8:40 [dpdk-stable] [PATCH] net/i40e: fix DCB init issue Shougang Wang
2020-03-05  9:06 ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
2020-03-05 10:42 ` [dpdk-stable] [PATCH v2] " Shougang Wang
2020-03-06  8:13   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong

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).