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 11A3C43E57 for ; Sat, 13 Apr 2024 14:57:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B7AC402CB; Sat, 13 Apr 2024 14:57:50 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2079.outbound.protection.outlook.com [40.107.92.79]) by mails.dpdk.org (Postfix) with ESMTP id AD2B5400D6 for ; Sat, 13 Apr 2024 14:57:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FmeHH0SD5PUms+/l5u6Kk/d5EoOsQ6gbJPRIWMlPHVCc3ARh+6dhPTwYpNj9bUR0kL4pslBlgkdxxzxrh8h2JvO8mQJoLZ2ciTZA+VkrnPrcARJFBd4gcjk0IiARpwITqDzht0uUhK0Ss4FmoVll1NDI7H8ZnqW2FXbby1SO/9x8NhcqsEkvhUA/asSW96ru0f/b28jKdZ4ulCR8EV1B7JY6ciJyLjgoGJr4KRPBFv51tK8svKVDJKcxvo8Ka/bhZ15/fwMsEh5VxXUEF5+ITrjpjFiDQm7gTNZt7oLxFEpNHPPcu8MZfPvW29o2L2vtG8k77lsX7eSGClMlPRReUA== 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=O3mibHaMxMKf0ijxvUSG/XBi2Qdyp9qMKWsdbd0wEMA=; b=UMiHVAVbFF5uTGu/mwdIB5rVHyVEeUtzScdA1FBrG3JzeGoKqs7NweESAitTd9ulgrZaZWvlcYwwK/lUHc8QwE1isYqlu+Hs238wGx335WwrcCmf8+q+IVijOyw3PGjmDUEjHCqS4wBdseA2e+4QEf0JRSN8bUaHS5lfv+Yo3RjhuIqdHsry9wo+UHwU9U4QciYCwFRDd0JWWIy0TNcMSRJy44a3RPHnArTazZOUeB9EDENAAma5R2f5ODEt30QklkPQwkBzrgNmKVgOcTvkBtVxFWSFkGRACs1so3N2ivHYIMLXnR8+ZMtmgr1UmqkCxmWzRquDbMAf5cuDtNZ2OQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amazon.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=O3mibHaMxMKf0ijxvUSG/XBi2Qdyp9qMKWsdbd0wEMA=; b=YSfujPR7IEuDMXW0wnRCEs54pt9VEGKw3KNjZXbHzaU/ny3KrvtjoEvpL5gmzWE0iVE+s9JVm9Cm9Ck9WD8EGv5R+n6MB5XUb75YtXd6yxLCze6/YNUgrmQpR62gSPRm7caiaWmwkJlrME5ffsfkogfxCC7aYWpG2icpSBbPG7oTmy6GCb62GP08Om22UCLhrlTm9/pfhXzIfhOZgZhBFrZGBFatfFHoG+tXiNllD0bCFnW+34u62MD1kWx+0lqxEjzZT9UNtZnN7/Gu8kSh6yXtEj/9/ve/nV1lc5vyex7vUsw+Za6SRcj3UgE7G7H/IsUidWEuh9TMgkhJ05SQtQ== Received: from BYAPR05CA0028.namprd05.prod.outlook.com (2603:10b6:a03:c0::41) by IA1PR12MB6089.namprd12.prod.outlook.com (2603:10b6:208:3ef::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 13 Apr 2024 12:57:45 +0000 Received: from MWH0EPF000A672F.namprd04.prod.outlook.com (2603:10b6:a03:c0:cafe::dd) by BYAPR05CA0028.outlook.office365.com (2603:10b6:a03:c0::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.14 via Frontend Transport; Sat, 13 Apr 2024 12:57:45 +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 MWH0EPF000A672F.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:57:45 +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.986.41; Sat, 13 Apr 2024 05:57:37 -0700 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.1258.12; Sat, 13 Apr 2024 05:57:36 -0700 From: Xueming Li To: Shai Brandes CC: Amit Bernstein , dpdk stable Subject: patch 'net/ena: fix fast mbuf free' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:49:23 +0800 Message-ID: <20240413125005.725659-83-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A672F:EE_|IA1PR12MB6089:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d4e91e5-9209-43a5-0520-08dc5bb95037 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: loT0A0mqoeIL+2awP5yXV5/2eGtIJ895BA1hJvCYtPjugxmkiYg6TWvUafDKALm9e4wk7y4W9JElgLt9nj8OC6sY/TE1lLmNhvd0SM9gyOTeTWweMJSOAjPIy+ClLqMFzfDxFYIyv2SL2TUycHnL/GUFhXfEMuuaeqjHUwYIeodVjSpTYrsa4IybCzTRNq5TpvnLsAEZ8z2jcVrh4e55vDxwl012KP+mlP2vGOe+xgPxVwnMsdV61Cpdv4R1GmJU5zZVr6yqtIEVP6DIQPk/dTONIhQRWqfJAok2ixtz4a+TBLh6W8SlxyMSWy1UcXz0ur65o4XTTeyzNB+52GIOqfdQHJJhxH4Qp5gjrPqf4Dc2lZhicRjjiMFtjIbNfAk9I9vd0gNpyE+exvrGv4RuFd5DFj6eLBltRtjklxY3hy4ut0kHtzrytWJecc1lPllX5ku9/MKSbK2mgGL8TWJmd6nprmJMjUyR0qXuafk2zpzygzkSR/GSDp0yp6K9/MWmysx8ZIEe+DId1n7Gc3Rj3ovepWzUJZYrmOPirsCy/KAYL1d9fJYUWRVmTQPQDwpLipou3fP9KNkscSEtaFgIuksnAzgXbZgGeyXiWU1E2qCWRoRxMV9zlXz76bhJSX3NK8Sat2E+8MCddzSCqUVI9lnGPXnS3YqB6S/yyml+a06vRY/0l8LDLvy6yuhqOgMhstogI5DNrJh9uFNWksUGHhjjnQ5MH+L1NroOv7AYa5x142NF7xCEKfXo3zJXCXLe 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:(13230031)(1800799015)(376005)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:57:45.1690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d4e91e5-9209-43a5-0520-08dc5bb95037 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: MWH0EPF000A672F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6089 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/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=2fa8497bd30eb130c45d8e6f3538f8e50b4102c2 Thanks. Xueming Li --- >From 2fa8497bd30eb130c45d8e6f3538f8e50b4102c2 Mon Sep 17 00:00:00 2001 From: Shai Brandes Date: Tue, 12 Mar 2024 20:06:50 +0200 Subject: [PATCH] net/ena: fix fast mbuf free Cc: Xueming Li [ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ] In case the application enables fast mbuf release optimization, the driver releases 256 TX mbufs in bulk upon reaching the TX free threshold. The existing implementation utilizes rte_mempool_put_bulk for bulk freeing TXs, which exclusively supports direct mbufs. In case the application transmits indirect bufs, the driver must also decrement the mbuf reference count and unlink the mbuf segment. For such case, the driver should employ rte_pktmbuf_free_bulk. Fixes: c339f53823f3 ("net/ena: support fast mbuf free") Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/ena_ethdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index dc846d2e84..1e138849cc 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -3117,8 +3117,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, m_next = mbuf->next; mbufs_to_clean[mbuf_cnt++] = mbuf; if (mbuf_cnt == buf_size) { - rte_mempool_put_bulk(mbufs_to_clean[0]->pool, (void **)mbufs_to_clean, - (unsigned int)mbuf_cnt); + rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt); mbuf_cnt = 0; } mbuf = m_next; @@ -3186,8 +3185,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt) } if (mbuf_cnt != 0) - rte_mempool_put_bulk(mbufs_to_clean[0]->pool, - (void **)mbufs_to_clean, mbuf_cnt); + rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt); /* Notify completion handler that full cleanup was performed */ if (free_pkt_cnt == 0 || total_tx_pkts < cleanup_budget) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:07.531356222 +0800 +++ 0083-net-ena-fix-fast-mbuf-free.patch 2024-04-13 20:43:05.037753879 +0800 @@ -1 +1 @@ -From 89b081e154c5f81295014fd8b5b32193dd01b9cb Mon Sep 17 00:00:00 2001 +From 2fa8497bd30eb130c45d8e6f3538f8e50b4102c2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 3157237c0d..537ee9f8c3 100644 +index dc846d2e84..1e138849cc 100644 @@ -28 +30 @@ -@@ -3122,8 +3122,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, +@@ -3117,8 +3117,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean, @@ -38 +40 @@ -@@ -3191,8 +3190,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt) +@@ -3186,8 +3185,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)