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 B962AA0548 for ; Sun, 28 Nov 2021 15:56:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A973A40E5A; Sun, 28 Nov 2021 15:56:03 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2069.outbound.protection.outlook.com [40.107.93.69]) by mails.dpdk.org (Postfix) with ESMTP id F325A42735 for ; Sun, 28 Nov 2021 15:56:01 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NpkjHhBaVLTPG6ElHiqB/5Pna/5uoG9k4AJta0YDycgFz4M6N0T8mb1mLq2Urz2bHl8okDGmexdqDuSkY86gtG+tldCiGjpjLc3wVGao9qlEP5lIiIAq3NLFLpgMEDa5mi2HFrQO7rIXuS9v8s/BMxpRwidcVNFcY8aQsEK7/cw19KWRzxyuqmPvNNIUx/8TAaWf2AnheAUqZMZlkqK+SXTXoKGzbwS9/l4kBUPeqxzjaQNV+PYKZ/GoN5szzoPr07vzqtIjUCvImF0hBJG/7KQ+dZ7VNMZFjmBLI9MEUdTXs9WzFARYC7z78V+b2rFRw6ijmfWTh9XbutQJC7WU6w== 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=MYWvHsgf5BHQRiKI5CnS0Qn1e3KADiKhIv3zZgKCDYo=; b=M7K+QTXsbTE2WvoHGr/g3rEYraHdpDIIiajAaxko6unw5Zwqlicbv1xUXNZ3WHCrZxGg/7XbcGVgy/EZjTJrtNn5XBHUcw9IMG+fjZ9lJcM4h7zr3tqAAoFSo3M6oLvOvWEz0nuUUutjOzzroNu802jbAy3mVWjpxYP5W32Ra352B47d3koAjXr7uYEX3teHok7vlpEovuLAQc1s1RuUdWLKizBMvgEfWGu5Ee32tHloeNL6Y0y6mNpjr4E51S4csfhfirb62GlSDtR0ZP2JIjhHkwIoqS0xdBMmNNAHN85aimJXCiqc2H4E161I0o419b9VqMr1Z/6oD6kVHoyInw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=arm.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=MYWvHsgf5BHQRiKI5CnS0Qn1e3KADiKhIv3zZgKCDYo=; b=jk966Ixfvqf7bE1BAZNlkm8RCTDigHKqlArnDY+0L/aIXir8tD9UEoQT1agkyR8U4cGVWmM7Q+B6GJgUTvBKYMmlZnFCCgBDw7Gm9VN3jfOlkCPxhkg/zVeoNs/qIfoPdwnGuVh2XuXpLJK/wOfLeqaQelAOYJvfPSDYSL8KXPP1l8Yx3x92ODFMxjxrpFlxCg+nMPI1TRkP1n3L8W6mbxIrhLrTgTg890XrIVi4yK/LAqYk082aUhp33oFPGxD0TwHb02YDf9KjEmxntVbQcEUwpwbXQ6bZq1ys+tKiZnlWcwXPIcOaOIaMK3sBhKlWvoarGG9xRYj9t1cuq5HyzA== Received: from DM5PR19CA0002.namprd19.prod.outlook.com (2603:10b6:3:151::12) by BN8PR12MB3377.namprd12.prod.outlook.com (2603:10b6:408:46::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sun, 28 Nov 2021 14:56:00 +0000 Received: from DM6NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:3:151:cafe::ca) by DM5PR19CA0002.outlook.office365.com (2603:10b6:3:151::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Sun, 28 Nov 2021 14:56:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT022.mail.protection.outlook.com (10.13.172.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:55:59 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 28 Nov 2021 14:55:58 +0000 From: Xueming Li To: Ruifeng Wang CC: Luca Boccassi , Honnappa Nagarahalli , dpdk stable Subject: patch 'net/i40e: fix risk in descriptor read in scalar Rx' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:16 +0800 Message-ID: <20211128145423.3974892-13-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 300a6b7d-1f86-4256-12ec-08d9b27f30e7 X-MS-TrafficTypeDiagnostic: BN8PR12MB3377: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pojxlLISaMtigjnWOjzgFXOJF3Un+uTGWRWne0nyNI4uwbAhlWge/wojP+0MnnJHcnU2+x2rWJaTwwmoU8Acykrj+LAuvTm5QuwJEs/cQOftkVzZKR1kASB0titKivooCbCEJR8iGLt+EnpQxwlqAK+1e7R6m7zJ8Ikg/ue27gV7KxcgRaS7/XerOUOLEgkuN/JXNEKPFAmsf98j5m7YKmnY7ZJrSFhCCyUuaZJcXFvCe8p3MJSNPCQr0vsUekLGXZnsooxTV7G9Fq+qht8eKiwLnFQ8Ig431LBRPO5p7D2YHX/lgnrT9AFTUE5TklN8OuSo+PMHSb9oBptSbJfLuC7r2MWto22nqj2+nAcuo4NlMTvKQhxx0GIEbk/31uSPbhi3s17NwvfLpmx+B1yzks573dySX/o+xQ2gI3qCqV0Mc4PsO0fYMXkjXbF0hT1Xxp48Vbk4blM4cudxGyeHTiiJrWApkNfEgiGfzqL7uH1+qf+uZWcHmUztivDnDvqghUsyh9bqMOWwlWX6RkOsvD2ryIxy5i57bbh77uHbVJDOw9fVRR/bOI7a2BxmFxCU3UoRvxvgZc66wDCqqFQjh8wyQZ77CiMIB+xmJ6LbfgcJOClKxMNyKhjmBal+6BQ3N2/fCwdxUk7e7pAqeVWROyBQOB26OdYdstBUcuuiv9F/rm7wcjOlPc6LUw1T5NJbsLUbv+H68XNYibwztNQcnUAvKlcY09Cv12hzx6AXATdFyKhgs3l8yB8vGeEV8/Go46YSvgpprSflgpqwLsFRM7JaVWeUvHT54CfImPEbFMVVGpTIzJDYhj76eNp3LP4nz66oJm20FPoYkQmgRY3p3w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(8936002)(70206006)(7696005)(7636003)(36860700001)(83380400001)(70586007)(6286002)(356005)(36756003)(1076003)(8676002)(54906003)(26005)(4326008)(336012)(186003)(2616005)(55016003)(16526019)(82310400004)(4001150100001)(316002)(426003)(6666004)(966005)(6916009)(508600001)(53546011)(86362001)(5660300002)(47076005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 14:55:59.9647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 300a6b7d-1f86-4256-12ec-08d9b27f30e7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3377 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 20.11.4 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/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba Thanks. Xueming Li --- >From 2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba Mon Sep 17 00:00:00 2001 From: Ruifeng Wang Date: Wed, 15 Sep 2021 16:33:39 +0800 Subject: [PATCH] net/i40e: fix risk in descriptor read in scalar Rx Cc: Xueming Li [ upstream commit c4d3e8fbe485f244391797f7610512de377675e0 ] Rx descriptor is 16B/32B in size. If the DD bit is set, it indicates that the rest of the descriptor words have valid values. Hence, the word containing DD bit must be read first before reading the rest of the descriptor words. Since the entire descriptor is not read atomically, on relaxed memory ordered systems like Aarch64, read of the word containing DD field could be reordered after read of other words. Read barrier is inserted between read of the word with DD field and read of other words. The barrier ensures that the fetched data is correct. Testpmd single core test showed no performance drop on x86 or N1SDP. On ThunderX2, 22% performance regression was observed. Fixes: 7b0cf70135d1 ("net/i40e: support ARM platform") Signed-off-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli --- drivers/net/i40e/i40e_rxtx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 02389905ce..b26bd0640d 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -704,6 +704,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) break; } + /** + * Use acquire fence to ensure that qword1 which includes DD + * bit is loaded before loading of other descriptor words. + */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); + rxd = *rxdp; nb_hold++; rxe = &sw_ring[rx_id]; @@ -820,6 +826,12 @@ i40e_recv_scattered_pkts(void *rx_queue, break; } + /** + * Use acquire fence to ensure that qword1 which includes DD + * bit is loaded before loading of other descriptor words. + */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); + rxd = *rxdp; nb_hold++; rxe = &sw_ring[rx_id]; -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:04.164049443 +0800 +++ 0012-net-i40e-fix-risk-in-descriptor-read-in-scalar-Rx.patch 2021-11-28 22:41:03.220209457 +0800 @@ -1 +1 @@ -From c4d3e8fbe485f244391797f7610512de377675e0 Mon Sep 17 00:00:00 2001 +From 2f5b7df1e4ce4f3c2d1bc5e41408d5df80401fba Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c4d3e8fbe485f244391797f7610512de377675e0 ] @@ -23 +25,0 @@ -Cc: stable@dpdk.org @@ -32 +34 @@ -index 41fe3bf481..e4cb33dc3c 100644 +index 02389905ce..b26bd0640d 100644 @@ -35 +37 @@ -@@ -744,6 +744,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +@@ -704,6 +704,12 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) @@ -48 +50 @@ -@@ -860,6 +866,12 @@ i40e_recv_scattered_pkts(void *rx_queue, +@@ -820,6 +826,12 @@ i40e_recv_scattered_pkts(void *rx_queue,