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 78ED245CE3 for ; Mon, 11 Nov 2024 07:38:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71C584067A; Mon, 11 Nov 2024 07:38:46 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061.outbound.protection.outlook.com [40.107.94.61]) by mails.dpdk.org (Postfix) with ESMTP id DC8CC40E1E for ; Mon, 11 Nov 2024 07:38:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yjI2fqmI/cjHtLzszat393Lw84Tf66wCwY0wKxKZ5rrZUNpGu9FAo7viel3w1Xx8RLqgemjb0M1fF/T3cUs62rzGZyy4tV0g1U1x9WmbEHwvQnr7r16vcC2HmZkTrwLVTDkahoAfWGMpxGXiV7IxMA+HEJwxW+OqJ4tPowgouGE0vsmRD5Y6v44H+4jiQqNjhch0JWt2QIJRkqZblUUr4H5PdA0nMwAXUbLw6ZKc+ccAvjxjsqcb5bKuoSgqIfLJQhxgRd+iI6Y8UeKYlGllQiDsfALWkkVMYvTCHgHwNRGRSuIIpx9pQzHh6vhfFnvwQUBxI/oyMj3lntFiJkrtsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mCOatbiRSq4/X3jsp5wtZJfh3aw4IzVEPIzp49dd1+A=; b=aItG4+Z9TlcivneoVF/5zMEUqIrDgzNq8KEooHRm8CN7PDdlqZTWGCjh7cqtkQnf6ZjHP1G09yh/AVYD/EfVLabqkxTYw0F2BXiG9Gz6fbahC5bcNBvlTZ6wCGy2VRin5KxpiMqKjNRQ4hnfAvTMK+3hiG15tT5mW4xxadG+CwJSwstHgnWDiKkLWh15BYgfHCq3asYIc8tFMmYm2HA17NbLSNKuvG518zWQxiofsomo0B3Ygm87FUI5le7ciRJMYIWUXI9DZMpx+pxDqT0sIcEloNlDdugI0nH0re/cT6uZgVLAEsmtvKwx3C7v+6KpnVDiX6hgKY8Cf4FFRncM3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=google.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 (0) 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=mCOatbiRSq4/X3jsp5wtZJfh3aw4IzVEPIzp49dd1+A=; b=CJe6Z+MyZhXo+vnTFIg/1HTlwNLxs74DO4HNZSnw7sZQGn1IiLXVWMDaxuYB/LFMBTRgWFP3PGNwJxZI525OE+ToNU8G6LNSAJJTCSl2VeON1LAi+8H6E14JQzuAQn+X355yFU87dMiVtBz53ymTrPkoBE0jMFHwjE7I9XivH1spZ2uFkZfU9Uq6h08igPJ9e25AhvdzAtlaRO9QwpKOCQVmB3texBCuftzgOAMse96h1xymObgv1tUjJNhmUGrz/lkFhVlPaoYfI4m2TuF1t9URci34Yenj6zJ9HTMAmnpk6W7N0uo4zU4HQlOD3k9SO0Jpf3yiRGLV5KkIiudu3g== Received: from BLAPR03CA0151.namprd03.prod.outlook.com (2603:10b6:208:32f::15) by BL3PR12MB6644.namprd12.prod.outlook.com (2603:10b6:208:3b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 06:38:41 +0000 Received: from BN2PEPF000044A9.namprd04.prod.outlook.com (2603:10b6:208:32f:cafe::d7) by BLAPR03CA0151.outlook.office365.com (2603:10b6:208:32f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Mon, 11 Nov 2024 06:38:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF000044A9.mail.protection.outlook.com (10.167.243.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:38:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:38:29 -0800 Received: from nvidia.com (10.126.231.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.1544.4; Sun, 10 Nov 2024 22:38:26 -0800 From: Xueming Li To: Joshua Washington CC: , Praveen Kaligineedi , Rushil Gupta , dpdk stable Subject: patch 'net/gve: add IO memory barriers before reading descriptors' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:28:19 +0800 Message-ID: <20241111062847.216344-94-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: BN2PEPF000044A9:EE_|BL3PR12MB6644:EE_ X-MS-Office365-Filtering-Correlation-Id: 9574a6e4-a822-42f1-6dde-08dd021b7b59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vNRrvf2IkkcIzsiUfJ91yYoC/RnFdqlQWtcAiTuQRMETPS+l3G+UxUeS5ZTM?= =?us-ascii?Q?6IPZ0m2UiacqdUYr55OfoNpnYWhNBS4R+003fRBt/pGhuoLWdTMc/ugobfoU?= =?us-ascii?Q?dBlLtFCW/pNA9atOvevm+deimDNm9fq6JC3PIgv9ZrZFnMfYvfBtiVDCTvmM?= =?us-ascii?Q?0FQvTDl2D1flhOzQRpcNSUl96d1ff29NAJlz9RtyqLE+asNFEPNoS1ybPUkr?= =?us-ascii?Q?Pp9HmvQgNsadrAs8LXvxJ4DJY/sxkURFa6w2XgAU+R4Z86Swj9+Xe7FvjNEs?= =?us-ascii?Q?69uwn1bcKaP+JnzirlRV7exQIljgMH9umpsXFg1oazb1kBwK712YdHurn4bT?= =?us-ascii?Q?xKFdUSZl5Eh5XmxyAz8qzKObixR08Gv4WSA0pBMsiPDZUUwoeOzU7e7xnd1L?= =?us-ascii?Q?h4PsUQ7dZMRzzoFWcrraXaY88n+skhYrpiYbWa411o0NRmzUONyeQYZDpkgl?= =?us-ascii?Q?i+7TVBC+wE5xD3ReY3IqivK3o5bUkWTZhPcKb4IptUG8TE0frShH2sYyzEmO?= =?us-ascii?Q?jNbk52Mil/VgivFlPcFiszlh/WRtTNFcgG0H11dAKWsCGgAqA+inm+xBjFLJ?= =?us-ascii?Q?lwHf8IxVLvknnk6njp2YedehBVmTyeZBVwbdxh4N7vaAGNXy+fbLfBslG1HG?= =?us-ascii?Q?DqzBZxA+B5jYTWxfbglZO52gkuE16FNU9NI4Fdv5QryQkUY+mrxpOzUyqK7D?= =?us-ascii?Q?DpZ5YnJ10ubAujNLBy+Xu8+yU+ihmcjYjLIBPk4wYRvW0Pe8X5csStz5i6ey?= =?us-ascii?Q?2Cn92Z8ujj+SpedguBXyihJ0pqATl1f8BTnFVoT0CeTGTImmHRl1L1n2YAm6?= =?us-ascii?Q?ATPZatADnHwBrSfGF2F0D3SsPOK5VREph3j4qc67XGSR8uXZDTb21QC16zKT?= =?us-ascii?Q?uixqFEJ0hgT7PjV0Jr2z6obHq9k8bOgM7lDdwUl355jqN2kxfNtJWTH7/hXB?= =?us-ascii?Q?lJ99KGY8Am53+ky4XtpsSOpTtbEqPLKdpGFqH/RgyV+Luqwq2sIXccPIYDg3?= =?us-ascii?Q?pBhAr0624NLkiNOQYDL952jB6WofskfXLGcD5jXC6jShg+zvlVf0HNCtG/Sn?= =?us-ascii?Q?aZpZGHwQgycHyxSf/Ap0xkdV6MqMyjSPxWixojAAx+1WUSiXuzTDK91g0IUq?= =?us-ascii?Q?+QVA8FoM7ilE0leI4JhrjpIRVL90j6qF4M2lBYT84Lq66HaEZZ8+fDy9UGgX?= =?us-ascii?Q?3li3FmCxInEUjh9PG5IyjstBdi0565gAXrRdId6gdRWJZaRsq4IbRteDzpTG?= =?us-ascii?Q?CAONzvN9F8UO0aW/AZzoxg+lUfkhD7S9FvThI8xF8ttAjvdfSLzCRoZhwNjT?= =?us-ascii?Q?H2/jxTMJ8/KpwhMvgBJT9czHmkVTr0wx6+moMDTCgRIbSzG2CLP841wwvScW?= =?us-ascii?Q?2Mbaipf4kR4BGcApqProFscaGumduIBrJwDbhwUaYryeIwsEjA=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:38:41.1278 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9574a6e4-a822-42f1-6dde-08dd021b7b59 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A9.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6644 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 23.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 11/30/24. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1c6a6173878598d07e8fbfef9fe64114a89cb003 Thanks. Xueming Li --- >From 1c6a6173878598d07e8fbfef9fe64114a89cb003 Mon Sep 17 00:00:00 2001 From: Joshua Washington Date: Thu, 3 Oct 2024 18:05:35 -0700 Subject: [PATCH] net/gve: add IO memory barriers before reading descriptors Cc: Xueming Li [ upstream commit f8fee84eb48cdf13a7a29f5851a2e2a41045813a ] Without memory barriers, there is no guarantee that the CPU will actually wait until after the descriptor has been fully written before loading descriptor data. In this case, it is possible that stale data is read and acted on by the driver when processing TX or RX completions. This change adds read memory barriers just after the generation bit is read in both the RX and the TX path to ensure that the NIC has properly passed ownership to the driver before descriptor data is read in full. Note that memory barriers should not be needed after writing the RX buffer queue/TX descriptor queue tails because rte_write32 includes an implicit write memory barrier. Fixes: 4022f9999f56 ("net/gve: support basic Tx data path for DQO") Fixes: 45da16b5b181 ("net/gve: support basic Rx data path for DQO") Signed-off-by: Joshua Washington Reviewed-by: Praveen Kaligineedi Reviewed-by: Rushil Gupta --- drivers/net/gve/gve_rx_dqo.c | 2 ++ drivers/net/gve/gve_tx_dqo.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c index f55a03f8c4..3f694a4d9a 100644 --- a/drivers/net/gve/gve_rx_dqo.c +++ b/drivers/net/gve/gve_rx_dqo.c @@ -72,6 +72,8 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (rx_desc->generation != rxq->cur_gen_bit) break; + rte_io_rmb(); + if (unlikely(rx_desc->rx_error)) { rxq->stats.errors++; continue; diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c index b9d6d01749..ce3681b6c6 100644 --- a/drivers/net/gve/gve_tx_dqo.c +++ b/drivers/net/gve/gve_tx_dqo.c @@ -24,6 +24,8 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq) if (compl_desc->generation != txq->cur_gen_bit) return; + rte_io_rmb(); + compl_tag = rte_le_to_cpu_16(compl_desc->completion_tag); aim_txq = txq->txqs[compl_desc->id]; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:09.326330154 +0800 +++ 0093-net-gve-add-IO-memory-barriers-before-reading-descri.patch 2024-11-11 14:23:05.242192837 +0800 @@ -1 +1 @@ -From f8fee84eb48cdf13a7a29f5851a2e2a41045813a Mon Sep 17 00:00:00 2001 +From 1c6a6173878598d07e8fbfef9fe64114a89cb003 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f8fee84eb48cdf13a7a29f5851a2e2a41045813a ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -32 +34 @@ -index 5371bab77d..285c6ddd61 100644 +index f55a03f8c4..3f694a4d9a 100644 @@ -35 +37 @@ -@@ -132,6 +132,8 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +@@ -72,6 +72,8 @@ gve_rx_burst_dqo(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) @@ -45 +47 @@ -index 731c287224..6984f92443 100644 +index b9d6d01749..ce3681b6c6 100644