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 1077546A63 for ; Thu, 26 Jun 2025 14:11:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A08C402B6; Thu, 26 Jun 2025 14:11:51 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) by mails.dpdk.org (Postfix) with ESMTP id A39AD402B6 for ; Thu, 26 Jun 2025 14:11:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aRpdzFWL3pkj0yxjBZEbKaX3GpWLW4fpEV+LxlreotMdrVNvQFvnwMSzsoT8NZNgSaw5C7hqvCaADKQlOP+FqnOxzo/bCWfn2NTLvxrWhaMzqrNMOT94FWIWiBEf+Y77TUxlotBljDLliMOmp6ogpbVna5Rv33udIbw0sOmvt2X3+Eea5PzUvtsJlhbJjF5FoaERGcnRS3TfUvrVy8TeyM5L4qLD09d9VoHJ++6KVCxvq3lWmQiVZbX54Q32iFTK+Jk5rNoCBnLn9+gxbVNs3+td/FlyhxILBCIfEDCTDitl/dc3g55b0hf9slLKtjwPAPqfaX4TOolbWytxHvOIeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=p3JgJtv+riuM5oLIV9hlgmbv/fobK2lHwPo6fTT7iBA=; b=GJrgs+cHi/TOhVu+1ntPSNWa88pSL1eQyHbxuadslXTi/4OicrFQSuEA6dsBNqrhhHFsSlOauH3mnmpxWmEyZP0sTzrf6el9AiNMSs7N3yce5hc11YLKOHOYyU/nbypYDDTl4eBM6hyYTsOI9RdwhesDxgagBp00L2tLbNoQxSgp8WpURZ2i1LtwZk3mpPLld2nGyCGhceUtIfv+C7DQEqBkNJoJ68ANt+2IMRUZbyg79mDSYvTJeNTxcvi/i5LKLAT27oRICI/oIDKydzFMLHHfjJSDZLHy3xbTYA1obWJaBHuKKpgT1K8djv/KXfHwkRaI6Z+j6oztHuOdbenhAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=networkplumber.org 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=p3JgJtv+riuM5oLIV9hlgmbv/fobK2lHwPo6fTT7iBA=; b=eT6nDiVcYo9qPgwksC1vaGqDz+JhPmeI6CXSEHZ8VdUcBNb/iXBqpSlJGfgQaCK4Vt2DZf+w51Kp+FanNuKbzeszW6w1iT/AiHz3Bx5RYG4RHqFoJpRozjootHx0xT4qkAvcsb/zhuTJnhZ6KXBGHP6/q5LP6bPIBa0zcg7R7IDZOixzwnecu/Xt9LRAtwatmHTgdGxJ7xNMXpO0LEXgxOk+i4fRgYWJjDvdz0q4PiX5aA2MStZy3iosURGZ1wNzBf9aVl8vw85c99Q60cH4ykDkbc8JyKIEBEenPQv/zqReHBGsAMhzQ4DA8N/w5GR/kBwMn95pMrTR+P5bdbt/3g== Received: from DS7PR06CA0031.namprd06.prod.outlook.com (2603:10b6:8:54::11) by MW4PR12MB7333.namprd12.prod.outlook.com (2603:10b6:303:21b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.23; Thu, 26 Jun 2025 12:11:41 +0000 Received: from DS2PEPF00003447.namprd04.prod.outlook.com (2603:10b6:8:54:cafe::aa) by DS7PR06CA0031.outlook.office365.com (2603:10b6:8:54::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8880.20 via Frontend Transport; Thu, 26 Jun 2025 12:11:41 +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 DS2PEPF00003447.mail.protection.outlook.com (10.167.17.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.14 via Frontend Transport; Thu, 26 Jun 2025 12:11:40 +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.1544.4; Thu, 26 Jun 2025 05:06:02 -0700 Received: from nvidia.com (10.126.230.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.1544.14; Thu, 26 Jun 2025 05:06:01 -0700 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , dpdk stable Subject: patch 'net/null: fix packet copy' has been queued to stable release 23.11.5 Date: Thu, 26 Jun 2025 20:01:05 +0800 Message-ID: <20250626120145.27369-46-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250626120145.27369-1-xuemingl@nvidia.com> References: <20250626120145.27369-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: DS2PEPF00003447:EE_|MW4PR12MB7333:EE_ X-MS-Office365-Filtering-Correlation-Id: 58642007-0069-4f12-3760-08ddb4aa9bff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aQCAkyZBUbVj4V9oUwAKqR+jpPE23Sjr+iU37vTNyUDcjpF7LoNf0oV8XK8O?= =?us-ascii?Q?RKFqYooKMMLLopIaxitoDAK5OSfij3YPqKCGpBTm+HMO0x3AJ6mFp7w5W1uG?= =?us-ascii?Q?tkG2stvAS0mLqUxMMytUCy616DuC6GuGjIF3hy/zGP18XbnfyGk/Ddpshwi0?= =?us-ascii?Q?qDtVn34Ffpi+QLuDlweEY8ImKq0AKTV4lfrWjkr+UwBePsgVfEP3tdHvhCcm?= =?us-ascii?Q?WRUsRdwJCo3SowuVLF2rsxOb2YRGGMyll0v7E6bNFOvE7EHoNbqcriWFK+CV?= =?us-ascii?Q?b+fjkqUfw2EaRasPOlwOmd42yUO455rfJ12LjMMzlLJkKdWAvwGWEiPmB4qH?= =?us-ascii?Q?CpciRNosRm7YO8t/qf18m9wmDgMzj1nznX75Yf7ATMCYFYvKz+6Ytp5ex+E6?= =?us-ascii?Q?nWhjbQd5Ht4LK2lSNtlEeOxCSBcSFNYO+SAnz1fYjhpHyyoLCWY5IgkWOT6a?= =?us-ascii?Q?GpWX3xTjJUaC4plNx2Xz2sw/6JrFZHTMNVXsqq/KBM83pgJJEXepolbUGxUF?= =?us-ascii?Q?Pj7g3eycYm81J9u6SsB9MYJxsmqrVmDdAxVzQNrPhkdvJWwAHr6A4uJd1S8l?= =?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C6pzw18wAIOKiJGoiHdEX?= =?us-ascii?Q?EfwzObrB71yUm2T3jlTLVkTv59uE6LQUHhWxzNjx5XmBB8EN3iKNZEC2/w?= =?us-ascii?Q?=3D=3D?= 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:(13230040)(82310400026)(376014)(36860700013)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2025 12:11:40.9948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58642007-0069-4f12-3760-08ddb4aa9bff 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: DS2PEPF00003447.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7333 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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/28/25. 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=0fc340a7d8b42ba81b01e54cc00ae4fa07486349 Thanks. Xueming Li --- >From 0fc340a7d8b42ba81b01e54cc00ae4fa07486349 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 1 Apr 2025 16:47:26 -0700 Subject: [PATCH] net/null: fix packet copy Cc: Xueming Li [ upstream commit 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da ] If doing copy on transmit, can potentially copy paste the data in the mbuf. Change to only copy data from that segment. Fixes: c743e50c475f ("null: new poll mode driver") Signed-off-by: Stephen Hemminger --- drivers/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 7c46004f1e..5b732f28be 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -35,7 +35,7 @@ struct null_queue { struct pmd_internals *internals; struct rte_mempool *mb_pool; - struct rte_mbuf *dummy_packet; + void *dummy_packet; uint64_t rx_pkts; uint64_t tx_pkts; @@ -163,17 +163,17 @@ eth_null_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) static uint16_t eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) { - int i; struct null_queue *h = q; - unsigned int packet_size; + unsigned int i; if ((q == NULL) || (bufs == NULL)) return 0; - packet_size = h->internals->packet_size; for (i = 0; i < nb_bufs; i++) { - rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(bufs[i], void *), - packet_size); + struct rte_mbuf *m = bufs[i]; + size_t len = RTE_MIN(h->internals->packet_size, m->data_len); + + rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(m, void *), len); rte_pktmbuf_free(bufs[i]); } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-26 19:59:19.599372352 +0800 +++ 0045-net-null-fix-packet-copy.patch 2025-06-26 19:59:17.386418044 +0800 @@ -1 +1 @@ -From 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da Mon Sep 17 00:00:00 2001 +From 0fc340a7d8b42ba81b01e54cc00ae4fa07486349 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 0ffd3bc09be5f77b26c16e501e4b4465b1bcb8da ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -18 +20 @@ -index 6764cf2ec1..966748689f 100644 +index 7c46004f1e..5b732f28be 100644 @@ -28,2 +30,2 @@ - RTE_ATOMIC(uint64_t) rx_pkts; - RTE_ATOMIC(uint64_t) tx_pkts; + uint64_t rx_pkts; + uint64_t tx_pkts;