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 0D004A034F for ; Wed, 10 Nov 2021 07:51:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06D2840142; Wed, 10 Nov 2021 07:51:45 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2063.outbound.protection.outlook.com [40.107.244.63]) by mails.dpdk.org (Postfix) with ESMTP id A064A40142 for ; Wed, 10 Nov 2021 07:51:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1OSWitaZbzcgYQT6VDdOjx8YMbGYMFNty4oufB87HeaWrtxgdSFWQpXSnAIh4e+r0CIYNWEDhu7iYHy+RaeusJmFV2zU+416VmiYDFWINhGDOUjE9CugsBHsQRJ/iAhFTEJWt8PesrhqN5awi901Bf4eugRSnN5WM7ueRWUY6mv9wDiSRxqjowjJCa8GLniqMdPXJXwQItYpaD1BO6jVTG3ylCz7Kcowx5xJLC1wEOd6Arwu4TefQh/mWspRzxIPNsHpzVwmN+skzJ9U+OHN7UZQixIrRvlHQfXwX6xDPPHMi8cTP8lS3vn9+lTtJZlw785mA0O09AvnXXeP2bXjg== 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=5rhXZO9OSxcLeQWQzsLWodd3wYx4G4zHdtBgJcHUAeo=; b=HFtEfYrTbxOB2PVJJUdd0tuNmlC8C0FIVJHDLiuI2QUaZgdOPBUBVZtdW3pGaAy8IMkYccwl3w+QFMRr2JQD2pTQ0FQ7VPx27/l3Hi763f3H4+ABPcN38FR87Y+4ONHcQ/f72OfofPuqQLCcMQm3NTlneGuPkxpA8PV/iRyM9Lb7T/RH3I11iyK78XZuo/Mba6eYeqnZytanN8tWfIvMmPT+g5lot0H/USSGB1Cz0Cfm0EeKtvwE7ZlOOww/jsGmaD94gP7+HktKYXl11GCmX3D97xgTGJq/KR0pkhVlWSJRbMzvqRMjj1JmfOWaJbFp4laeIppQKkBkBaoeBw3joQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.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=5rhXZO9OSxcLeQWQzsLWodd3wYx4G4zHdtBgJcHUAeo=; b=aB3s/BYPA4n+J963WW7I0Xk781D4vo9H+EU0PGDDXa7CuZOlHRyH9z07TATH12l21dRQKIB9rwFHXKayfRoihsWpce+CiEc71IQTbdtiON3qZT7pYzcx356YXbIVRqM6yx4T6IhEASW04ytN3gYIHKrSu+BPGXVPMa1tWHj4SfLlL2NoWj6m7VZ9FTKZqKNvLZfooHlOQayYOVayLzrh+vbrGiZaFCvsIqSrZzq1LdS1VtWuVKbfF3Glt552IVcj1Bb4RJVjvuPWrxrmXf9MjtSyXGl+lV2cY9a7BX7nombVxOU4qEGDN+pkCRxh1rF/x0Ae7gVrLQBKq2gVLG6teg== Received: from BN6PR11CA0055.namprd11.prod.outlook.com (2603:10b6:404:f7::17) by BL0PR12MB4884.namprd12.prod.outlook.com (2603:10b6:208:1ca::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 06:51:41 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:404:f7:cafe::42) by BN6PR11CA0055.outlook.office365.com (2603:10b6:404:f7::17) 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:41 +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 BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:51:41 +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:36 +0000 From: Xueming Li To: Naga Harish K S V CC: Luca Boccassi , Jay Jayatheerthan , dpdk stable Date: Wed, 10 Nov 2021 14:30:55 +0800 Message-ID: <20211110063216.2744012-172-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: 039307e6-d086-49d6-c533-08d9a4168d3d X-MS-TrafficTypeDiagnostic: BL0PR12MB4884: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rj4TdZLARrJnt/+wDjONhPbuxiPuOYPhD+0d70mzFV0pJYOFS2QqnRor5CLOFV+0vHRAiqKewfbS0KEmLni/bep24W/oIwS8EhaFXvoLwqPsy+zDiZai5i4Fusx/n3sAEIgpMmF1TAaKUyy/tOFI9FhH+QIwUfpDTkFsZn9KJg1d6Qzfd6zCuFxcC+MonBcSbRD0KJUSC6kQXbbscvvpuJ6l4OUd9DQj82XdNCT+I5h9T/3iHykCi8dgUMWGLAuINZe4Z+fZQ8W/rmnCPVNiBs/b5aiHkIF+QRKlEelgfjegTMdO/xCb7IDFJL1FwaMtcojM4A+C+gs5OaNdTFYgGiJpU1F7c0EwH0tiuq1HiQj8fEKwz/3xz0yWegZBP6083gQZ5vbIlan2fvghBj9Xe4vNURfmw8VuTNEx5kuBJUTerGGSI5G34zV/ASWEESMbj+NMAqMjcPBmHsxGS7YG+5g6sHtpjwv+XG4yBHO40z+/ghPS2GOWvDkdSycjWAf0jfdYWZKSCyGZg0Q0+soDHLKQ1WxnJFJdau71WLerENaSXLvBcp7QV8auoEYHLeCXKWEuhj18MSLRr+f0zxBMvzs6s6gI/kw+Ahk508s/KdpUGA9yyxVGpzw9l5+OrNOnu87nDGI6SnT1O4KdLalaWdpGIYB1k44cdesztazaH9Gmnd7BzzNa99VoZBgRL3rFuERAUXFKQE1I5fQsWeGVOOFDu6HJ3MM93PM+S6BHx6JunVRhZ5CbF78u7bWzn3WOZQ09NAm7Lfzo2tLxTxsi94IugCJnP7w7QRuWtkUl5MoONPWN3QFTDn2KGVLTqTrPdtWqecxMhF0Y4TAIDw5RSA== 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)(26005)(16526019)(54906003)(4001150100001)(7696005)(53546011)(186003)(4326008)(5660300002)(8676002)(316002)(426003)(336012)(2906002)(47076005)(8936002)(2616005)(966005)(508600001)(86362001)(83380400001)(6666004)(36756003)(70206006)(36860700001)(70586007)(356005)(82310400003)(1076003)(6916009)(55016002)(6286002)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:51:41.3898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 039307e6-d086-49d6-c533-08d9a4168d3d 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: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4884 Subject: [dpdk-stable] patch 'eventdev/eth_rx: fix WRR buffer overrun' 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/1d47c1198e1c7b982e5b5f13775bf1d628a5bfd1 Thanks. Xueming Li --- >From 1d47c1198e1c7b982e5b5f13775bf1d628a5bfd1 Mon Sep 17 00:00:00 2001 From: Naga Harish K S V Date: Mon, 18 Oct 2021 03:25:41 -0500 Subject: [PATCH] eventdev/eth_rx: fix WRR buffer overrun Cc: Xueming Li [ upstream commit 81da8a5ff440eda60635c849c9e9b3d253838da9 ] When a poll queue is removed from a rx_adapter instance, the WRR poll array is recomputed. The wrr array length is reduced in this case. The next wrr position to poll is stored in wrr_pos variable of rx_adapter instance. This wrr_pos can become invalid in some cases after wrr is recomputed. Using this variable to get the next queue and device pair may leed to wrr buffer overruns. Resetting the wrr_pos to zero after recomputation of wrr array fixes the buffer overrun issue. Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation") Signed-off-by: Naga Harish K S V Acked-by: Jay Jayatheerthan --- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index 663b446c05..89213297db 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -2239,6 +2239,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, rx_adapter->eth_rx_poll = rx_poll; rx_adapter->wrr_sched = rx_wrr; rx_adapter->wrr_len = nb_wrr; + /* + * reset next poll start position (wrr_pos) to avoid buffer + * overrun when wrr_len is reduced in case of queue delete + */ + rx_adapter->wrr_pos = 0; rx_adapter->num_intr_vec += num_intr_vec; if (dev_info->nb_dev_queues == 0) { -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:09.533836359 +0800 +++ 0171-eventdev-eth_rx-fix-WRR-buffer-overrun.patch 2021-11-10 14:17:01.984078497 +0800 @@ -1 +1 @@ -From 81da8a5ff440eda60635c849c9e9b3d253838da9 Mon Sep 17 00:00:00 2001 +From 1d47c1198e1c7b982e5b5f13775bf1d628a5bfd1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 81da8a5ff440eda60635c849c9e9b3d253838da9 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -22 +24 @@ - lib/eventdev/rte_event_eth_rx_adapter.c | 5 +++++ + lib/librte_eventdev/rte_event_eth_rx_adapter.c | 5 +++++ @@ -25,5 +27,5 @@ -diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c -index e570f2f085..f07dd4d822 100644 ---- a/lib/eventdev/rte_event_eth_rx_adapter.c -+++ b/lib/eventdev/rte_event_eth_rx_adapter.c -@@ -2739,6 +2739,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, +diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c +index 663b446c05..89213297db 100644 +--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c ++++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c +@@ -2239,6 +2239,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id,