From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12E80A04DD for ; Wed, 28 Oct 2020 11:48:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F13FC4C90; Wed, 28 Oct 2020 11:48:40 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 59A972C2A for ; Wed, 28 Oct 2020 11:48:39 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id t9so5114647wrq.11 for ; Wed, 28 Oct 2020 03:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FGFO5uwcaTwYROuuE3e7IIag2xhTSQZ2yfnTwMcH0+s=; b=fyjRUpwPvcukr2NFGYNdnRcGcf2zEB5b5kb5WR5ItFesc92QfSgU/mrQWO5FrDZqqs rR1WOxF15ieQsUsf/rIFVxgSFbxPhLoHnneQvwNEnBt/mc1fU9OeUzV7D1g18i9izct3 ooncUEDhmfIIJ8b9nVmZLhARnQF2r+UT2Iso6gw47DI9rpnxWXB95kZ9QrSkodkY7SjV 9Zlsa27wdgw54OntaOo+xHsY52drQYNqphnCA1g5gBl87/0Nm++9RcEIqMLSeQQymz7B wKLIY68KSdNSdeqMZq2RW8u3igRCamwdAKuKgnustprP23KoVg1Dox9lXFOPrAozrHVP KNqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FGFO5uwcaTwYROuuE3e7IIag2xhTSQZ2yfnTwMcH0+s=; b=XqrC8+5Bcry04xNJbPgI83cM6fA2my6AOjgGJyr8qeRr47qBBhWrA9sulTk91uM8x5 zGIer6teoT6Mvcsjr67WrCq8T/ux9Ccsgz3cG7PX88RgIp4EmVxU2NL9phbX0+dhD45L R8IE2MFuR9x6OWB7hNw7xApCKtoepayGxTKg2+TZu1vSJafleCQGVazog3d+DRO7IHez BYfia/MAdKej4oRgAyNxAveBqnYP8f/DywwQvThvJvLMMaimiBPesNXJnWJJOMIo+kYx pVCRF1q7A2Dnqjfjr/6rsWRGjw6dPcE93Q7OCtUr/4lQ0EoulYbU89206whoh7nwieZy FSdw== X-Gm-Message-State: AOAM530SQNrcC7qYpjiUSA/R6eVq4CpDZ4SMZdpmmDCnS2dQ2QA7zaUC Hqm/V9Puz9ZuusDWIR5CyQM= X-Google-Smtp-Source: ABdhPJxZwil73loelHMB6hqQJi7iNyLTjtItlwXvNe6cG7Vg0kdGqQAi+v66evnAEdqh/AKYTG7aOg== X-Received: by 2002:adf:cf04:: with SMTP id o4mr8087666wrj.244.1603882118059; Wed, 28 Oct 2020 03:48:38 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id h128sm5879385wme.38.2020.10.28.03.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:48:37 -0700 (PDT) From: luca.boccassi@gmail.com To: Rahul Lakkireddy Cc: Brian Poole , dpdk stable Date: Wed, 28 Oct 2020 10:43:26 +0000 Message-Id: <20201028104606.3504127-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/cxgbe: fix crash when accessing empty Tx mbuf list' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 4c661677f11c87e3ffe0d6d6846a90477ce7b281 Mon Sep 17 00:00:00 2001 From: Rahul Lakkireddy Date: Tue, 1 Sep 2020 22:50:09 +0530 Subject: [PATCH] net/cxgbe: fix crash when accessing empty Tx mbuf list [ upstream commit dca62adebf68ec94d84444fd2a61f03f73f51ffb ] Ensure packets are available before accessing the mbuf list in Tx burst function. Otherwise, just reclaim completed Tx descriptors and exit. Fixes: b1df19e43e1d ("net/cxgbe: fix prefetch for non-coalesced Tx packets") Reported-by: Brian Poole Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_ethdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 51b63ef574..abd455c6ea 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -74,6 +74,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, t4_os_lock(&txq->txq_lock); /* free up desc from already completed tx */ reclaim_completed_tx(&txq->q); + if (unlikely(!nb_pkts)) + goto out_unlock; + rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *)); while (total_sent < nb_pkts) { pkts_remain = nb_pkts - total_sent; @@ -94,6 +97,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, reclaim_completed_tx(&txq->q); } +out_unlock: t4_os_unlock(&txq->txq_lock); return total_sent; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:13.256518858 +0000 +++ 0047-net-cxgbe-fix-crash-when-accessing-empty-Tx-mbuf-lis.patch 2020-10-28 10:35:11.512830142 +0000 @@ -1,14 +1,15 @@ -From dca62adebf68ec94d84444fd2a61f03f73f51ffb Mon Sep 17 00:00:00 2001 +From 4c661677f11c87e3ffe0d6d6846a90477ce7b281 Mon Sep 17 00:00:00 2001 From: Rahul Lakkireddy Date: Tue, 1 Sep 2020 22:50:09 +0530 Subject: [PATCH] net/cxgbe: fix crash when accessing empty Tx mbuf list +[ upstream commit dca62adebf68ec94d84444fd2a61f03f73f51ffb ] + Ensure packets are available before accessing the mbuf list in Tx burst function. Otherwise, just reclaim completed Tx descriptors and exit. Fixes: b1df19e43e1d ("net/cxgbe: fix prefetch for non-coalesced Tx packets") -Cc: stable@dpdk.org Reported-by: Brian Poole Signed-off-by: Rahul Lakkireddy @@ -17,10 +18,10 @@ 1 file changed, 4 insertions(+) diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c -index 7c6016d5cf..1205e17a6c 100644 +index 51b63ef574..abd455c6ea 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c -@@ -71,6 +71,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -74,6 +74,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, t4_os_lock(&txq->txq_lock); /* free up desc from already completed tx */ reclaim_completed_tx(&txq->q); @@ -30,7 +31,7 @@ rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *)); while (total_sent < nb_pkts) { pkts_remain = nb_pkts - total_sent; -@@ -91,6 +94,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -94,6 +97,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, reclaim_completed_tx(&txq->q); }