From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFE9442D46 for ; Sun, 25 Jun 2023 08:39:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D316740ED8; Sun, 25 Jun 2023 08:39:24 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2060.outbound.protection.outlook.com [40.107.223.60]) by mails.dpdk.org (Postfix) with ESMTP id 79D2240A7F for ; Sun, 25 Jun 2023 08:39:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YIPtyPkfBkpEH9yM6JDEz3pTIE6gY/xr5/T9yMClg8kWSMQMBNslmkPkcCSsrEnH4K9caIzfysECWn3HZFmym22iVBjLeAnMr9d+vFwHCKLu58c7zKL6rmsDrlcy1UIL8EmBPavzwX70G6E4t+a+pAVHjD5kF7HpqecneaAA7zJeeWcLd8lpSozTSZl0YWGhK/rUwFnM5JfQPIMELOApL5TBRj97n7P2d0mBbrixP9c8i3cVw1qN1ANyURSuBGO7DzzY2bMcZZ9W54k4PdN1SJkuhTZ5AOyGgp8eisb0cgbVHSvuL/aqoY57SZZeeFl9PnKsMxRMKAvhCBGy7g+3+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t98O1VhcOjzYPuNYZMghihyWrm99aZcQd/uTnFxqdkg=; b=LYsR/IOWoJdsuOKKV9F/tLbuJBQo5GKSXPN03LuapimRHsXkq9GiRKLn3lcdA2ALq38gxqq+55xYZircc9y8SiZhr8nXTwCpXLI0Rflwjzn0DR3D2kFYQ7/ybswrtdRurJ9M70YrzFUTUiq12aF9JUgWcp7wbNeZ05j5eyKecl9tjuwpwxKO6IYLZV7wOFQm+kyddNi/HGFdDHooalYxfhhwbDArY6qGsfrSmPmqNLD4ppwNVGNQA6W1SZ1cLwIWKTApkr6obhhSk6Ltq/8gWvPtXlGibhWG0ywwP64GaAcrwXKbd1w5XzJcuYnaMeVesK9eUheR47fgHjS4thv43Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vmware.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t98O1VhcOjzYPuNYZMghihyWrm99aZcQd/uTnFxqdkg=; b=qRfk+9IAxlxMOx9j8ohaxHqg1qw0qyREMre28bY3CGBKIGWpiil3gDGiM8kbweZXITbguos5C87rBTkta8IDA4RTs/sN4Nk6ufRgmDGGppv+osr5IQumZzBQxppbZAWVm4PSkpEH1LqoBjZziRPE6wynTcomzQfDkls2VNzwMus1+n6MwfL7IDTlZiYcTECanwbKbeAMdUPOpypWyfZ2D7MYxAf/o13BEtJFmtzfVKzfdd2P2zhS62eQNfvzlW6i1HykHQFjahyhzEPwwdYCVoEgOmBWnaPqSEdSgmu4k85V1U5QvEqapY8LFkRdadGIHtUJ2mo1Ru0ixNlxZNQ3gQ== Received: from DS7P222CA0001.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::7) by PH0PR12MB5630.namprd12.prod.outlook.com (2603:10b6:510:146::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Sun, 25 Jun 2023 06:39:19 +0000 Received: from DM6NAM11FT090.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2e:cafe::bf) by DS7P222CA0001.outlook.office365.com (2603:10b6:8:2e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.32 via Frontend Transport; Sun, 25 Jun 2023 06:39:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT090.mail.protection.outlook.com (10.13.172.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.47 via Frontend Transport; Sun, 25 Jun 2023 06:39:19 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 24 Jun 2023 23:39:08 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sat, 24 Jun 2023 23:39:06 -0700 From: Xueming Li To: Ronak Doshi CC: Jochen Behrens , dpdk stable Subject: patch 'net/vmxnet3: fix drop of empty segments in Tx' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:34:13 +0800 Message-ID: <20230625063544.11183-36-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT090:EE_|PH0PR12MB5630:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b42a25d-cab6-4e96-b44a-08db7546e769 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LKA0IkIL7Fwi5FAEvHmfV2OzgxTQazwkW5OFsGDZ98RdnPfsx9IpRUCuXp7Mh5ahMo5c+Mrp3Q9aZewW+KKHhXRor2cLbkZ9IPE+DrPjdmLEgDuMwSa6YAT9S4i7kM6cddtWFeJ/LIeJVjEa3BH3Z827luYbknilpCDWwJskcMzUY86Gkm2gaE4YPFe7wF21+T3+rAK0H59t2Qt2UKF/guVn/5Kif8Ihnjr9ZoBlqz4DiQE4+C9WKtZOCt0KZgrtuLjA2ynqRAoWdIYaEQAZ/S9AuDS82oqIYM1rTlyXV7kWNzw+E8JeTFYP9NcxeBoEtUoFyik1lh00KRnDDSCkb6cLSCHsYx1VuRaUPSzaW1oaPZw0xMT/N4/niA1/4vPyiOgHgTh1oJGpeFNrT0oacbcSwW146uDD30sK3u1AdeWhuMe3QYI+AncOXMy/MEIGVeOSGJ1d4gI4JhjNBDsltCH1zTqVr6EUqPPM5r0N5FCZuxtAvqfki6w/mG7CppS5d4w/WVIjJHdYSVUzcrkWWEv+tfvpLYaiW1hiq79iBqlhYH7hlubFQM0fDZUD3PhZ02HoJ8X8iCNg/ASHyYXNzZEGIQMbN73h9MnhNjjcf/O3Y6f8P2NeDd8ULJtlg8XnbTerdXErjnx3bsq27Xp13+R1buptJhWfwSC9nzt6CN+LxIxoforuoJJygmDah4oQZeLAI6E/vWwvnBcKpoAF5gKxaI/nsJ0uQ81QBYa8vI4OtlrWnJnK6Z8u3uRzDyHAbAMcyIPBqAYyXuL2jmv4Mw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199021)(36840700001)(40470700004)(46966006)(19627235002)(8936002)(8676002)(55016003)(4326008)(6916009)(70206006)(70586007)(41300700001)(316002)(53546011)(1076003)(16526019)(26005)(186003)(6286002)(336012)(2616005)(478600001)(54906003)(6666004)(40460700003)(966005)(7696005)(82310400005)(2906002)(5660300002)(40480700001)(82740400003)(356005)(7636003)(36756003)(86362001)(36860700001)(47076005)(83380400001)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:39:19.2119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b42a25d-cab6-4e96-b44a-08db7546e769 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT090.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5630 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 22.11.3 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/27/23. 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. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=799cc0612c1273aadc989d786269ecbf10752c9a Thanks. Xueming Li --- >From 799cc0612c1273aadc989d786269ecbf10752c9a Mon Sep 17 00:00:00 2001 From: Ronak Doshi Date: Mon, 8 May 2023 19:21:06 -0700 Subject: [PATCH] net/vmxnet3: fix drop of empty segments in Tx Cc: Xueming Li [ upstream commit b44f3e1381f3910be50d03c784f5c073c25245dd ] When empty segments are dropped, some descriptor variable values are updated in the segment processing loop before it is exited. This can lead to a wedged queue where all subsequent packets are dropped for this queue. Also move the check for empty packet to catch the case of a zero length packet with multiple segments. Fixes: d863f19efa4f ("net/vmxnet3: skip empty segments in transmission") Signed-off-by: Ronak Doshi Acked-by: Jochen Behrens --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 33 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index a875ffec07..f4cade0954 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -412,8 +412,8 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, nb_tx = 0; while (nb_tx < nb_pkts) { - Vmxnet3_GenericDesc *gdesc; - vmxnet3_buf_info_t *tbi; + Vmxnet3_GenericDesc *gdesc = NULL; + vmxnet3_buf_info_t *tbi = NULL; uint32_t first2fill, avail, dw2; struct rte_mbuf *txm = tx_pkts[nb_tx]; struct rte_mbuf *m_seg = txm; @@ -457,18 +457,18 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, continue; } + /* Skip empty packets */ + if (unlikely(rte_pktmbuf_pkt_len(txm) == 0)) { + txq->stats.drop_total++; + rte_pktmbuf_free(txm); + nb_tx++; + continue; + } + if (txm->nb_segs == 1 && rte_pktmbuf_pkt_len(txm) <= txq->txdata_desc_size) { struct Vmxnet3_TxDataDesc *tdd; - /* Skip empty packets */ - if (unlikely(rte_pktmbuf_pkt_len(txm) == 0)) { - txq->stats.drop_total++; - rte_pktmbuf_free(txm); - nb_tx++; - continue; - } - tdd = (struct Vmxnet3_TxDataDesc *) ((uint8 *)txq->data_ring.base + txq->cmd_ring.next2fill * @@ -481,6 +481,10 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, dw2 = (txq->cmd_ring.gen ^ 0x1) << VMXNET3_TXD_GEN_SHIFT; first2fill = txq->cmd_ring.next2fill; do { + /* Skip empty segments */ + if (unlikely(m_seg->data_len == 0)) + continue; + /* Remember the transmit buffer for cleanup */ tbi = txq->cmd_ring.buf_info + txq->cmd_ring.next2fill; @@ -490,10 +494,6 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, */ gdesc = txq->cmd_ring.base + txq->cmd_ring.next2fill; - /* Skip empty segments */ - if (unlikely(m_seg->data_len == 0)) - continue; - if (copy_size) { uint64 offset = (uint64)txq->cmd_ring.next2fill * @@ -514,6 +514,11 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* use the right gen for non-SOP desc */ dw2 = txq->cmd_ring.gen << VMXNET3_TXD_GEN_SHIFT; } while ((m_seg = m_seg->next) != NULL); + /* We must have executed the complete preceding loop at least + * once without skipping an empty segment, as we can't have + * a packet with only empty segments. + * Thus, tbi and gdesc have been initialized. + */ /* set the last buf_info for the pkt */ tbi->m = txm; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:31:59.466290900 +0800 +++ 0035-net-vmxnet3-fix-drop-of-empty-segments-in-Tx.patch 2023-06-25 14:31:58.325773900 +0800 @@ -1 +1 @@ -From b44f3e1381f3910be50d03c784f5c073c25245dd Mon Sep 17 00:00:00 2001 +From 799cc0612c1273aadc989d786269ecbf10752c9a Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b44f3e1381f3910be50d03c784f5c073c25245dd ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 39ad0726cb..148f65383e 100644 +index a875ffec07..f4cade0954 100644 @@ -27 +29 @@ -@@ -418,8 +418,8 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -412,8 +412,8 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, @@ -38 +40 @@ -@@ -465,18 +465,18 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -457,18 +457,18 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, @@ -65 +67 @@ -@@ -489,6 +489,10 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -481,6 +481,10 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, @@ -76 +78 @@ -@@ -498,10 +502,6 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -490,10 +494,6 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, @@ -87 +89 @@ -@@ -522,6 +522,11 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +@@ -514,6 +514,11 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,