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 7BEB2A034F for ; Wed, 10 Nov 2021 07:48:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C9D740142; Wed, 10 Nov 2021 07:48:19 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2063.outbound.protection.outlook.com [40.107.223.63]) by mails.dpdk.org (Postfix) with ESMTP id 73AB54068B for ; Wed, 10 Nov 2021 07:48:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IbwONMJBh2LakSs3Q+fD5sfnNuE0vpIOoKVNU3SGibmGxJ31lEIZUwz2j8BIUNhjm3ztGNPz0D4CSzmhWWAK906OG5x+dSgVyhfZpszaOFpLTqQf97dlPZ3kd+UMA6XnR+5flrF7DObO3j5qNnTQOqMER/uSWp5XMXZT+YIfMoH5y4gOYX9b0r0dU6vfOKlLPyc4gxyH/cmIHO+svwYQHVPyXniL6IUTdX1zP4m2go9R6uoQy1DqHO0/OIrmFm1Mokgp+TV66Pt4wqtwyc+VGgot4gAgjEwxVrxtkCbwrmBBK3N0Sl4GaVulc8eAFwTQ1ffgKgf2TIC+3DjbOxReCg== 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=krm1YGrcSDpghf9TnpjwmcwukARU2DQSyBOFbs7f8/I=; b=A9uR1QLa0wWYU92JGnYpLBitV5HB4bX5axwv/ZwTr+EtuurMFbXEO4KU98EycqhG2Ubi3oF92VHOT5YuzNuDWpdtEWTmk1C7Hb5KTkyZSe0XhulT/haacPSvZmrRQIGZgYbPNdREPbWgh+dRhVxFjsXfI4czL80eYsFIYOnUzysZR7lkeeymqUjNGqVigpYxzj3PDFwUukgdQj8GVnscfCJsy8TCmSeYTzoJQoCmO+QkJBKG1EIwlJPI4xxsRs9YxTPUo+blOzEQOZdoIy3kOb4gSesePOxjQ+ArFA8eywwLr6nxDl/5Fn1gtrmnqtwFhD1mYvd60Oh9qM18owRnIA== 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=krm1YGrcSDpghf9TnpjwmcwukARU2DQSyBOFbs7f8/I=; b=Z+bH2+o/KU5quPKvwRAbiXDQ9E6/T+f6MQlglS52GiyBVByK6jlOP941qAWEVoUgkQNXzBxiv/EuMXKO4bzxR45lsuRIAYK1WyewD7VlNEwty2tHrhlVTNPEyG3ml+S22OKG2eErtrbP8DRJMYLl+nVt1EBcDEw1vuBd1JJRa2VIOYxObMsYiRAyv8HdPUm6ac5c19k/bfA/Ehhpnqwgf0YchNBICUr3/UvgLNX7hnVZCn1hZsYqsB0SCTk8SoCrhFl9Ze7IqJsDzTfauvE9f52cXVDSFVAiM24IxY6fEsE9jPr0N+cEVYo1QGEhaGp/+J61Wu116hSD9p8m6i+EKQ== Received: from BN0PR03CA0050.namprd03.prod.outlook.com (2603:10b6:408:e7::25) by BYAPR12MB3302.namprd12.prod.outlook.com (2603:10b6:a03:12f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Wed, 10 Nov 2021 06:48:15 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::1) by BN0PR03CA0050.outlook.office365.com (2603:10b6:408:e7::25) 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:48:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.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 BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) 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:48:14 +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:48:09 +0000 From: Xueming Li To: Julien Meunier CC: Luca Boccassi , Haiyue Wang , dpdk stable Date: Wed, 10 Nov 2021 14:30:25 +0800 Message-ID: <20211110063216.2744012-142-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: 04595be3-c523-42bd-c29b-08d9a41611f3 X-MS-TrafficTypeDiagnostic: BYAPR12MB3302: 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: x8aD5rOUg9G6wFqJ9Zs5WmTDHihjMvQHhDj57L297X45uK+dZc2OWj7Y2pv+CfmyY5GfOLZ+Q2aL7sUxnvqFDu5Nek4DD6ynVngwAD2/7u5CHi+7R23nswZjcJ/3WYd68uSv5g5TsLRarlcJASCFWtMAmvjUzey19qaU/dQNndPQCpQ5ntd2NIrQ/s58JxRhU2loOfyt0vjm3yoXMs/YIhUwwb6PxIfJlpJkuinAnKB0+kdwFfVEztZ34ifKl0f4s3wh+GGtF2YOeREg7nY/nCbTjPMzuwEIXC6k75ODdJg6T3/2YSntJW5uupaS0jw59qk58ITyKbEA0Im0I5dipIqbiE/ETtV6cEaoLT2jiRtpbgmeX4cb24IdncEp84zo8r07e5PzmGiGSz6CA98N8MU6pehWKHDjUDljVodf/pwSg/G0EQzJCRQrjXyw7Yll7Y2kMux/Duh8tPhx/4BrOYk0pZgjRsvceASkIfXIhFKb7c6HiKuUqGf5S3tLTEtPhznOvfCUosg7XZLGVHRdm5MjbSz6Hx47XkWifopnzpu8c5JB/y93ZIY8St+UMYs7n2aY4NU2MtQIF2cPZNCjiM9cdIq2WhwBpQcvMiXuguMDLG7MolcHwVAAzl1dfVCr1wnc6c8sbLinMybgXTZcsC1LA9G/4Z1r+Z+ZjxZSnbcbcha43+lPxP6KfkExntTZTrXq2RUY7JSkWB3ukTcG0BjjxrNWOm8kY7GKw1pUoqWRJ5gLMHHclcIAdtM49atv30AECABecOx3C1zjLIFWUAvQLG7cQoarhPVFU4Uf5hNNmYvyhbXcE5Ad5vBn3dQRVM9OU69q4fGuSPbOxaStbQ== 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)(7636003)(7696005)(4326008)(336012)(6666004)(70586007)(53546011)(83380400001)(356005)(70206006)(86362001)(36756003)(4001150100001)(54906003)(82310400003)(55016002)(426003)(47076005)(36860700001)(6286002)(6862004)(2616005)(5660300002)(36906005)(966005)(26005)(316002)(186003)(8676002)(1076003)(2906002)(16526019)(508600001)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:48:14.5260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04595be3-c523-42bd-c29b-08d9a41611f3 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: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3302 Subject: [dpdk-stable] patch 'net/ixgbe: fix queue release' 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/d55700c3a0f711a2e374609b7b8319cdc1576509 Thanks. Xueming Li --- >From d55700c3a0f711a2e374609b7b8319cdc1576509 Mon Sep 17 00:00:00 2001 From: Julien Meunier Date: Tue, 28 Sep 2021 10:12:38 +0200 Subject: [PATCH] net/ixgbe: fix queue release Cc: Xueming Li [ upstream commit 6507e67af817183c69b684e81d820791eef18259 ] On the vector implementation, during the tear-down, the mbufs not drained in the RxQ and TxQ are freed based on an algorithm which supposed that the number of descriptors is a power of 2 (max_desc). Based on this hypothesis, this algorithm uses a bitmask in order to detect an index overflow during the iteration, and to restart the loop from 0. However, there is no such power of 2 requirement in the ixgbe for the number of descriptors in the RxQ / TxQ. The only requirement is to have a number correctly aligned. If a user requested to configure a number of descriptors which is not a power of 2, as a consequence, during the tear-down, it was possible to be in an infinite loop, and to never reach the exit loop condition. By removing the bitmask and changing the loop method, we can avoid this issue, and allow the user to configure a RxQ / TxQ which is not a power of 2. Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx") Signed-off-by: Julien Meunier Acked-by: Haiyue Wang --- drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h index a97c27189b..e650feac82 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h @@ -152,7 +152,7 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq) /* release the used mbufs in sw_ring */ for (i = txq->tx_next_dd - (txq->tx_rs_thresh - 1); i != txq->tx_tail; - i = (i + 1) & max_desc) { + i = (i + 1) % txq->nb_tx_desc) { txe = &txq->sw_ring_v[i]; rte_pktmbuf_free_seg(txe->mbuf); } @@ -168,7 +168,6 @@ _ixgbe_tx_queue_release_mbufs_vec(struct ixgbe_tx_queue *txq) static inline void _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) { - const unsigned int mask = rxq->nb_rx_desc - 1; unsigned int i; if (rxq->sw_ring == NULL || rxq->rxrearm_nb >= rxq->nb_rx_desc) @@ -183,7 +182,7 @@ _ixgbe_rx_queue_release_mbufs_vec(struct ixgbe_rx_queue *rxq) } else { for (i = rxq->rx_tail; i != rxq->rxrearm_start; - i = (i + 1) & mask) { + i = (i + 1) % rxq->nb_rx_desc) { if (rxq->sw_ring[i].mbuf != NULL) rte_pktmbuf_free_seg(rxq->sw_ring[i].mbuf); } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:08.207121592 +0800 +++ 0141-net-ixgbe-fix-queue-release.patch 2021-11-10 14:17:01.910745763 +0800 @@ -1 +1 @@ -From 6507e67af817183c69b684e81d820791eef18259 Mon Sep 17 00:00:00 2001 +From d55700c3a0f711a2e374609b7b8319cdc1576509 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 6507e67af817183c69b684e81d820791eef18259 ] @@ -26 +28,0 @@ -Cc: stable@dpdk.org @@ -35 +37 @@ -index adba855ca3..005e60668a 100644 +index a97c27189b..e650feac82 100644