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 CE00345CE3 for ; Mon, 11 Nov 2024 07:32:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C693240685; Mon, 11 Nov 2024 07:32:45 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by mails.dpdk.org (Postfix) with ESMTP id 999C640685 for ; Mon, 11 Nov 2024 07:32:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sryTC8+3eNiuYw16DTO7dcFftigpvPlHkfl57Pi6p4j/via3ZEHtyrq75R8au0O6zM9ue2SMAhzYuP0m6mzpgXQACp3p4Bfrg093jmm3k7Qox2A+FDDC/oTOUZ8kPiLlbON+31qO4HaPdw92MEVKzam38VQOXn9T6iVlEbdZvaEejXlGNAOt+pgAlV7Ws/Yy8dQ+kAMybEIZbEJgOGCKdS3Dz+a/NZOeKK0WnSecaBLwLjlfZue2NpMxwNvRjm4zN6m7uPRdydQ7QyAz2FzlmP4qYufW0TUnibOKXbujHl1L5CUXRv8oV/SXHkqpQjE/23jiv1O8t4L7+u0i2KNcbw== 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=r3nP2oVNUd+QmSVELTWxwgoSPo/vKpfgbqTZdGd+ML0=; b=tPRa2Gxxt1XotmViqM4JPSGqzLctWoF8SgQsDE0zyNAcCzjEry9f4NyH3o8M1H/RWGKOkEMdtJC+LnUFno0d4OWnTlxGi4tvUD7agB1wYuvk5ZDf5oZn/slcux4U0e4Cm4xXNwj1rLVq9Fkmov2sRVGmO4uRwo/ILecQ0H8vyHmfIL5Y+uKO4O5OI6/Fs6Sp6KBRfKEL++TcjV4vOhhF6gES8IEnj1VpJxK1NVFWM4YjfQBU3YpaWDGTjF9RHXMPj5X9cqaffc1Kgz1Cn62/yf140WAR3CfrBav15hGoZXYLPDB2zqvETyZo+batNshI3FF8yw99fdTeLX6/H5bO8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=r3nP2oVNUd+QmSVELTWxwgoSPo/vKpfgbqTZdGd+ML0=; b=AtgafZXqh+f81bSQNvC+zwr9CansHqr3vc2Zk6DDWT7UkuOFoRl949igB+uJrlVDt9MPVMh2QHdveJTgenKN6cnwX+lqxO+0W2VV8MrM8ZxvMa+XDSDk354uUQTaAYLxnuK0yBEo6+xtnn+GJTTkQZCg9wLmq4AEC1lu0oCQmmUAv/A2q61RBisZAkTu0zvwj+XyvNDLoUuelibeOHcSeWIlp0QahBsLgwdmvrMWl7IAh074q9V68fg474CUapVTvkh8nCx384sO7yHKC2dhwwVZxIk3KXTonfkXf2BbL76+m9cgC0dJn1SMUlMtSWRNG3QFrvw/F9U+3EeZ9PZ4lw== Received: from BN0PR04CA0205.namprd04.prod.outlook.com (2603:10b6:408:e9::30) by PH0PR12MB7957.namprd12.prod.outlook.com (2603:10b6:510:281::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Mon, 11 Nov 2024 06:32:39 +0000 Received: from BL02EPF00021F69.namprd02.prod.outlook.com (2603:10b6:408:e9:cafe::6b) by BN0PR04CA0205.outlook.office365.com (2603:10b6:408:e9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27 via Frontend Transport; Mon, 11 Nov 2024 06:32:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F69.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:32:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:32:26 -0800 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.1544.4; Sun, 10 Nov 2024 22:32:23 -0800 From: Xueming Li To: Stephen Hemminger CC: , Tianli Lai , dpdk stable Subject: patch 'app/dumpcap: fix handling of jumbo frames' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:18 +0800 Message-ID: <20241111062847.216344-33-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F69:EE_|PH0PR12MB7957:EE_ X-MS-Office365-Filtering-Correlation-Id: 219b2957-4c11-4db4-36d1-08dd021aa35e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/oSHHg144TwqZguH4m27JR5llWlnNzQdOyoO7MuVHbNMwgYsobmWfcpNPc5b?= =?us-ascii?Q?OGxm4XbXyLKEUl3k1yabNDfdzaO7oJ6vTdFb0l/8lxIBS+4WM6iFsXiVq6/4?= =?us-ascii?Q?LZAjYYAOdgdSCPDWo4kinTu3fECD853zHnIFmqYWVVjUBrUBGAVEmtz2JSsc?= =?us-ascii?Q?mjK2KGl4u5/S0hlxTBHR8egiz84RJO2/+lrH7I8VWBlNPeJdM5rCS4hDQLO7?= =?us-ascii?Q?ErmyqXVgs90nmP89N5tRN0zm0dLdq/0eAbandJ4/pAUaHlE/ZeyWSqt/7/Fv?= =?us-ascii?Q?DQlhVh0OlUeCB+6gwLkuF/CtGpgY5e9U39DL6yz6YZuN8Yb0+L/J+Sd6PGs6?= =?us-ascii?Q?MJqDBM9Kokei6qvVt/Km/A3Z4FllatZYfY8cA2I2hgLmqa4PqIHp5k/+Oobs?= =?us-ascii?Q?fZg24IGehylcHvD6ypexqZWH1czsZcTyk2TgsDD8akCcAWRwOY5076E1SwXW?= =?us-ascii?Q?9fuvhQZj39iukzB/RFTAL/T7HjST2CtuashANeVjEtGrUkEBuy2FPtEyAFZ8?= =?us-ascii?Q?9HRs/u8BbJ3i8dRNJyupebzOennRVNfT4ulp0P661ZnpbX0jJ85RmHgGmpJP?= =?us-ascii?Q?LDPHk7SEe4fnq7rXwS4gvqGnP2zVCzStLwN+7kgX6lXZts87vvAqEQXWM9IS?= =?us-ascii?Q?fUQ4HZe3eqmKkd6v5gqMzmw7vw1Svd845r7CFfQ1bK7bcS/n4pi16gUxS+6t?= =?us-ascii?Q?lh0Cki8Z38iww4YG68xGBHy/eNlJGqp1eilod6YDudtt+kevk/O2XY45V4jm?= =?us-ascii?Q?rdrEiKt7FbGrSvPHYTxiTqOjZ+qZW6UkhzyjBtFoA1nsJ11i5lhA48IhLnWl?= =?us-ascii?Q?yVHTjT7owt/lYA7TuGzeRbQi6B+MOzpZStsffGvdYeFE6k4O9Nw0t2MfrjQq?= =?us-ascii?Q?8Avt793/SwjDr9R4/oA5U68jBAIPATsqOZpdhbi+a3dEmFbTpRuNUBG5BCdo?= =?us-ascii?Q?SbKujtz9EHv2AV7j4vWQ+MrFIZeGnYQ5LDN4fHWnNHb4GPScQVwWqpNulogN?= =?us-ascii?Q?g8FmntjTjpHX3V9lBMouezgmI8ckXwoJfnQ+p6dI9Vmz828aBaMHYVA4bw3g?= =?us-ascii?Q?AO6zha/Gq5bd4Gzdvo/9bqeRoGP6IhWtnC3jkzUdHy5ICpzrRg3mY/wzYDug?= =?us-ascii?Q?4iOfhknD7x+jl+GTzQN9r8Ioqm+0d6SeIYvTEiUvc5LembS0lllSv0RlOgtx?= =?us-ascii?Q?evOpkQsrfNKSY1x0HD1vGtpDNHJi/h6YER6pKY+Jw8UreX0YRgZzysV5IiGY?= =?us-ascii?Q?52pZuz0ma3/ZkOd2+1mU8YjT/HUEyuLLMhrvx33MV95RBd5myjMD3CPimh5A?= =?us-ascii?Q?wjjl5U0U9tf2nbjdi6p8X0z9EPzBTqhH+OTLAv1XJrazN1HUiYQ6wSKoibgE?= =?us-ascii?Q?tCn2Ikrv+nJLZmYF2QJ09yto5n2W7KVXv9n5TPteAmnEgkwokw=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:32:38.7713 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 219b2957-4c11-4db4-36d1-08dd021aa35e 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F69.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7957 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.3 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/30/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=09c32b20ec3718838ed7e0e089dc2e7104770e40 Thanks. Xueming Li --- >From 09c32b20ec3718838ed7e0e089dc2e7104770e40 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 3 Oct 2024 15:09:03 -0700 Subject: [PATCH] app/dumpcap: fix handling of jumbo frames Cc: Xueming Li [ upstream commit 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 ] If dumpcap (in legacy pcap mode) tried to handle a large segmented frame it would core dump because rte_pktmbuf_read() would return NULL. Fix by using same logic as in pcap PMD. Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application") Reported-by: Tianli Lai Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 76c7475114..213e764c2e 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -874,7 +874,7 @@ static ssize_t pcap_write_packets(pcap_dumper_t *dumper, struct rte_mbuf *pkts[], uint16_t n) { - uint8_t temp_data[RTE_MBUF_DEFAULT_BUF_SIZE]; + uint8_t temp_data[RTE_ETHER_MAX_JUMBO_FRAME_LEN]; struct pcap_pkthdr header; uint16_t i; size_t total = 0; @@ -883,14 +883,19 @@ pcap_write_packets(pcap_dumper_t *dumper, for (i = 0; i < n; i++) { struct rte_mbuf *m = pkts[i]; + size_t len, caplen; - header.len = rte_pktmbuf_pkt_len(m); - header.caplen = RTE_MIN(header.len, sizeof(temp_data)); + len = caplen = rte_pktmbuf_pkt_len(m); + if (unlikely(!rte_pktmbuf_is_contiguous(m) && len > sizeof(temp_data))) + caplen = sizeof(temp_data); + + header.len = len; + header.caplen = caplen; pcap_dump((u_char *)dumper, &header, - rte_pktmbuf_read(m, 0, header.caplen, temp_data)); + rte_pktmbuf_read(m, 0, caplen, temp_data)); - total += sizeof(header) + header.len; + total += sizeof(header) + caplen; } return total; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.767246206 +0800 +++ 0032-app-dumpcap-fix-handling-of-jumbo-frames.patch 2024-11-11 14:23:05.082192840 +0800 @@ -1 +1 @@ -From 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 Mon Sep 17 00:00:00 2001 +From 09c32b20ec3718838ed7e0e089dc2e7104770e40 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 5c0f970c0d0e2a963a7a970a71cad4f4244414a5 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 6feb8f5672..fcfaa19951 100644 +index 76c7475114..213e764c2e 100644 @@ -23 +25 @@ -@@ -902,7 +902,7 @@ static ssize_t +@@ -874,7 +874,7 @@ static ssize_t @@ -32 +34 @@ -@@ -911,14 +911,19 @@ pcap_write_packets(pcap_dumper_t *dumper, +@@ -883,14 +883,19 @@ pcap_write_packets(pcap_dumper_t *dumper,