From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: [PATCH] net/failsafe: fix Rx burst infinite loop Date: Wed, 24 Jan 2018 10:19:17 +0000 Message-ID: <1516789157-9234-1-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org To: Gaetan Rivet Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0083.outbound.protection.outlook.com [104.47.1.83]) by dpdk.org (Postfix) with ESMTP id 415CDA84C for ; Wed, 24 Jan 2018 11:19:48 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case of plugged out device, the fail-safe PMD uses failsafe_rx_burst function for packet receiving. This function iterates over the present sub-devices until it receives a traffic from one of them or they are all cannot receive packets. The corrupted code didn't advance the sub-device pointer when the sub-device was not present and caused to infinite loop. Advance the sub-device pointer also in plugged-out sub-device case. Fixes: 8052bbd9d548 ("net/failsafe: improve Rx sub-devices iteration") Signed-off-by: Matan Azrad --- drivers/net/failsafe/failsafe_rxtx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c index 1654494..aeee076 100644 --- a/drivers/net/failsafe/failsafe_rxtx.c +++ b/drivers/net/failsafe/failsafe_rxtx.c @@ -104,6 +104,7 @@ do { if (fs_rx_unsafe(sdev)) { nb_rx = 0; + sdev = sdev->next; continue; } sub_rxq = ETH(sdev)->data->rx_queues[rxq->qid]; -- 1.8.3.1