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 4121BA034F for ; Wed, 10 Nov 2021 07:51:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A87840142; Wed, 10 Nov 2021 07:51:10 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by mails.dpdk.org (Postfix) with ESMTP id 02C3540142 for ; Wed, 10 Nov 2021 07:51:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eUb8xovViCVEaAHg77m51HN0+BQb02NcfIRsQ8eT4RFYFvQWWNg5GmDS9vOvys+f1mnYH6DlJYuzP4iza53Yj/yTPnaSKXanLj9YwyEGY56FF2n/V1hd7nN2CBQh197uOahrQiEMTXavKH8d26GZ9UcQCPuzlWpem4nLntKJbbtgzsEj3d0RyIdeA5GSlSKJXDfnUqvYMcwjkch50xzDkJU3NvkngMKepapTJe+GkLTc4aucMsPLQMa30l/73a/ftBsEkSWxLsIqQiDCB2hgh7TjWx9Ocljsm/T9bf4bjpxDImf1Bro2jo/QVRZqdutz4J6GPQ0Iuy8EBOt7bk0S9A== 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=HKE5zK/ZQFiAv2pBKKAZW6f2VqxCcCIteTK+WtXjbe8=; b=epFT8L+IBJXEE2ZcTtVuH4US8k/muETaQNo9DQrndX0B46se4AhvFRm7+TkMy69elJMWvKFw8F++tzAgPvO5tPDPsjRBQpl+UmKLj1MjCLJMNDRLivm6cZEUmUp/2GiZy4CJjG4i2T80zHiUDZ0XdxdRfmISu3WgkuSSwU3wet9I0AZSQekIMDCpWoFlOCLwwUbypXrlmQ6RTiXNGuTGgGPe+cLQr/9NqSP/SeyPfghYkb/TiA+zAXAb/YHwg9+4UH1QFVc7bSgF2xO09CSWHgamQH2aJ42vLhq3sNjvyAsb94nUs0aFnV04DrRvUMWJPQmB259pjM5Ly/j0cmNexg== 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=HKE5zK/ZQFiAv2pBKKAZW6f2VqxCcCIteTK+WtXjbe8=; b=jbPA4BLZjCRY9r+QWPd87wcwaDafF+2yPbBiFyibIziPYdshkSexL9eX2JogU1qVfx2a4otR5fe2osndsOlK6an4COdO4TRekuLPINsyZIlQLzj+y56q9XgUEM7ACiXK9LX9O9wgidXRrFjt8DPomrvjC19J6Sarc7OwpDL+tBYVwJBThAdvgKQz3WkhuRC0ig1XGMFdveggFf97Rqv15gyQd3agOrEG41JYl0MVtTHsx5bY+d82vY/5S0lg9uaXBFeQHol0Z4GfDt+g+9EHNmnoKrXTTo2LbE45L1D4RUjVAKOZEy6nZDLeVniOYoP6nBJ62zIhiCdEHVG9aVrEkA== Received: from BN8PR07CA0011.namprd07.prod.outlook.com (2603:10b6:408:ac::24) by MWHPR12MB1214.namprd12.prod.outlook.com (2603:10b6:300:e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 06:51:04 +0000 Received: from BN8NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::1) by BN8PR07CA0011.outlook.office365.com (2603:10b6:408:ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Wed, 10 Nov 2021 06:51:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; arm.com; dkim=none (message not signed) header.d=none;arm.com; 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 BN8NAM11FT025.mail.protection.outlook.com (10.13.177.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:51:03 +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; Wed, 10 Nov 2021 06:51:02 +0000 From: Xueming Li To: Ruifeng Wang CC: Luca Boccassi , Honnappa Nagarahalli , dpdk stable Date: Wed, 10 Nov 2021 14:30:50 +0800 Message-ID: <20211110063216.2744012-167-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-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: d1f6ed17-8b02-42c8-9272-08d9a41676d5 X-MS-TrafficTypeDiagnostic: MWHPR12MB1214: 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: n6zxRIT1pOd2H96YHgZU1eBbvJ1qlv79bG7RqfNnFZ8XTtZ8WSOvRt6OVRqD28P3KO2dWtfrHw8FaxMAXfdxIiJV7D+F102KkTSlIgcQvnGQPoszdBLSDhc7ckt7zmrYcxLofcwPal6qm9CSTR0AyTTZ8WbPcL1ScmpJjZsTwErhSsLQTJP5unNQ8bAqkRr9K9CYK/c/CHPNnJIyIVxcPpLcLHggQzf23D0pY0JcqBgyM5PbiW6yffof5R1vBV4G4uq0yA/+nGQkn9WzHWdBZDznPGAl0j5STLmSxtAk2JL/F+RB4vabmgD6kg5ktMFz7VjplSGdoP2ZR+LUjXEB5G1VaYOYk7coZQt9eSmTC1H8wuwslsRYR2sXJPXXHDmd75hXWXAjEAZBTVdUkAuhFSK/SXEkO2uwVdGia3y7r7Yqb6nQcBBXpyhHeLfpfcmnn++ftsjfSX6JRGm0LxB8JguRdvU8ePVx4ZTD+wlPzymk6ny66eKfG/WMKWRonL7rxDnN8xZWV+/PvP/Q/+GdkL35dxMkLuIuWxJGMlaLTh6YgQD5uP6bOGrb0VeEryJzHxKmNEPxrQJlhsxUCRu6cxk2nrCOxaqQ+LCr3MRskkFb87TfBXxxSQyS2fRkgA60oxKTorfAVIq5zobw/A27HArhbP9KQ6MFRST9iijg7+u7Y3yTNRIlGPyLdHBpiSQ4yM5nV8t6Fb9RMvFlC+y8qlnRyOaxJ1tzREpjqfCggUk2lEqXjHbc5TzI/8ZF9KHTzMyl4W4RWga5AzX3O83WeqkroAQg/CD+vdNF9mqvr7zqcZDHJY3ha0/E2SnkUuCARvMW43EBNOViMyQgJPssQA== 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)(36840700001)(46966006)(55016002)(1076003)(6666004)(508600001)(6286002)(36756003)(5660300002)(2906002)(4326008)(16526019)(966005)(70586007)(53546011)(7696005)(26005)(186003)(426003)(70206006)(86362001)(36860700001)(8936002)(7636003)(336012)(47076005)(316002)(6916009)(36906005)(54906003)(83380400001)(82310400003)(8676002)(2616005)(4001150100001)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:51:03.7910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1f6ed17-8b02-42c8-9272-08d9a41676d5 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: BN8NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1214 Subject: [dpdk-stable] patch 'net/i40e: fix risk in descriptor read in NEON Rx' has been queued to stable release 20.11.4 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 Sender: "stable" 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/12/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/364b772782cfb891c250376d6ce020dc13a508d5 Thanks. Xueming Li --- >From 364b772782cfb891c250376d6ce020dc13a508d5 Mon Sep 17 00:00:00 2001 From: Ruifeng Wang Date: Wed, 15 Sep 2021 16:33:38 +0800 Subject: [PATCH] net/i40e: fix risk in descriptor read in NEON Rx Cc: Xueming Li [ upstream commit 778602fe570a138224de94a38eca3ce2e344138c ] 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. In NEON vector PMD, vector load loads two contiguous 8B of descriptor data into vector register. Given vector load ensures no 16B atomicity, read of the word that includes DD field could be reordered after read of other words. In this case, some words could contain invalid data. Read barrier is added after read of qword1 that includes DD field. And qword0 is reloaded to update vector register. This ensures that the fetched data is correct. Testpmd single core test on N1SDP/ThunderX2 showed no performance drop. Fixes: ae0eb310f253 ("net/i40e: implement vector PMD for ARM") Signed-off-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli --- drivers/net/i40e/i40e_rxtx_vec_neon.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c index 0df315b162..67b88e64ec 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_neon.c +++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c @@ -297,6 +297,14 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq, descs[1] = vld1q_u64((uint64_t *)(rxdp + 1)); descs[0] = vld1q_u64((uint64_t *)(rxdp)); + /* Use acquire fence to order loads of descriptor qwords */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); + /* A.2 reload qword0 to make it ordered after qword1 load */ + descs[3] = vld1q_lane_u64((uint64_t *)(rxdp + 3), descs[3], 0); + descs[2] = vld1q_lane_u64((uint64_t *)(rxdp + 2), descs[2], 0); + descs[1] = vld1q_lane_u64((uint64_t *)(rxdp + 1), descs[1], 0); + descs[0] = vld1q_lane_u64((uint64_t *)(rxdp), descs[0], 0); + /* B.2 copy 2 mbuf point into rx_pkts */ vst1q_u64((uint64_t *)&rx_pkts[pos + 2], mbp2); -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:09.315002961 +0800 +++ 0166-net-i40e-fix-risk-in-descriptor-read-in-NEON-Rx.patch 2021-11-10 14:17:01.977411885 +0800 @@ -1 +1 @@ -From 778602fe570a138224de94a38eca3ce2e344138c Mon Sep 17 00:00:00 2001 +From 364b772782cfb891c250376d6ce020dc13a508d5 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 778602fe570a138224de94a38eca3ce2e344138c ] @@ -24 +26,0 @@ -Cc: stable@dpdk.org @@ -33 +35 @@ -index b2683fda60..71191c7cc8 100644 +index 0df315b162..67b88e64ec 100644 @@ -36 +38 @@ -@@ -286,6 +286,14 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq, +@@ -297,6 +297,14 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq, @@ -48,3 +50,3 @@ - /* B.1 load 4 mbuf point */ - mbp1 = vld1q_u64((uint64_t *)&sw_ring[pos]); - mbp2 = vld1q_u64((uint64_t *)&sw_ring[pos + 2]); + /* B.2 copy 2 mbuf point into rx_pkts */ + vst1q_u64((uint64_t *)&rx_pkts[pos + 2], mbp2); +