[dpdk-dev] [PATCH 2/2] net/qede: fix link change event notification

Rasesh Mody rasesh.mody at cavium.com
Thu Jun 7 18:30:52 CEST 2018


From: Shahed Shaikh <shahed.shaikh at cavium.com>

As per existing behavior, when firmware sends a link change
notification, PMD only updates the link structure but does
not notify applications about it.
This results in application sending packets even when link
status is down.

Fix this issue by issuing RTE_ETH_EVENT_INTR_LSC.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable at dpdk.org

Signed-off-by: Shahed Shaikh <shahed.shaikh at cavium.com>
---
 drivers/net/qede/qede_main.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index c3407fe..de5a7ca 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -634,8 +634,11 @@ void qed_link_update(struct ecore_hwfn *hwfn)
 {
 	struct ecore_dev *edev = hwfn->p_dev;
 	struct qede_dev *qdev = (struct qede_dev *)edev;
+	struct rte_eth_dev *dev = (struct rte_eth_dev *)qdev->ethdev;
 
-	qede_link_update((struct rte_eth_dev *)qdev->ethdev, 0);
+	if (!qede_link_update(dev, 0))
+		_rte_eth_dev_callback_process(dev,
+					      RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
 static int qed_drain(struct ecore_dev *edev)
-- 
1.7.10.3



More information about the dev mailing list