[dpdk-stable] patch 'net/i40e: fix link status update' has been queued to stable release 18.02.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu May 31 10:34:07 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.02.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/02/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From f10ff9d64a0785881e62a6bcd29af3d79c3482db Mon Sep 17 00:00:00 2001
From: Fan Zhang <roy.fan.zhang at intel.com>
Date: Wed, 30 May 2018 09:30:47 +0100
Subject: [PATCH] net/i40e: fix link status update

[ upstream commit c60869e2b742d2d0b7c5d568ad31f67f29d4f450 ]

This patch fixes link status update problem in interrupt mode.
Previously, directly reading link status register instead of
accessing via admin queue command may cause the link status
change interrupt callback inactive. This patch fixes the
problem by making the driver only read the register in
"no wait" and polling mode.

Bugzilla ID: 54
Fixes: eef2daf2e199 ("net/i40e: fix link update no wait")

Signed-off-by: Fan Zhang <roy.fan.zhang at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
Tested-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 1ebda8dbd..ccfd6069d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2480,7 +2480,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
 }
 
 static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
 #define I40E_PRTMAC_LINKSTA		0x001E2420
@@ -2534,8 +2534,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
 }
 
 static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
-	bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+	bool enable_lse, int wait_to_complete)
 {
 #define CHECK_INTERVAL             100  /* 100ms */
 #define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
@@ -2557,7 +2557,7 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
 		}
 
 		link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
-		if (unlikely(link->link_status != 0))
+		if (!wait_to_complete || link->link_status)
 			break;
 
 		rte_delay_ms(CHECK_INTERVAL);
@@ -2607,10 +2607,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
 	link.link_autoneg = !(dev->data->dev_conf.link_speeds &
 			ETH_LINK_SPEED_FIXED);
 
-	if (!wait_to_complete)
-		update_link_no_wait(hw, &link);
+	if (!wait_to_complete && !enable_lse)
+		update_link_reg(hw, &link);
 	else
-		update_link_wait(hw, &link, enable_lse);
+		update_link_aq(hw, &link, enable_lse, wait_to_complete);
 
 	rte_i40e_dev_atomic_write_link_status(dev, &link);
 	if (link.link_status == old.link_status)
-- 
2.17.1



More information about the stable mailing list