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 99F2745E41 for ; Sat, 7 Dec 2024 09:05:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C53340281; Sat, 7 Dec 2024 09:05:50 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2082.outbound.protection.outlook.com [40.107.244.82]) by mails.dpdk.org (Postfix) with ESMTP id 59C8F40281 for ; Sat, 7 Dec 2024 09:05:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mr/3nGsDELfobIw17tW+KQOnHkHK4EWSU43EFs5ZEB4GKQBVQWJ71IO+C2lKJ1SQfbe+pKimI4RLYa4anDSfHLwsUTP+q6LnZP7SMe7HwUO3oaA7zCbI13aiszGsFdrSiStiaAPJe9lDci4QzGmVtdRVPZfKJ1uaUCFeZo1/sDsHHfWZbCrBKNq20YYM8Gmiw5ix3+Wk7YQJjU1iZB/7Cp7os4YqrGGchZCSa5Ued5Xb0jR98/Yk5iZNhRVkaXxL4dvT0BeKxUqBy8Ab33DnEoyHpinL+TOOrJmTx//gE1vzC+jiU0AYMSSHl6BwpTooUepzXgxgfqOOE9GfjPiPtg== 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=2fnALUttmbuMCIpmTFtS9uSwVDq7ZHj6qiyj6sIs+G4=; b=r4nG0S6cv/fxGyViRv+JJZ7e8aJtz7Jq245hMxCv79iRfuKoX6DAVeMKB71Dq8FJEf0HaCwG29Fx/coATGD5DDVOrWOvVksWgZIlgAaznUpoVZLY3/bJj4Vca4BblJXFx3/U7sG+kobchh+IlB2CB4ljuP7Ivi+DwJ6AcE5jm951N/jWMVmrGnXTSeZhU00QVZFNzgKdmGC8MZD8aiWSsfAw4nK50jKuw3EpyIbg+YaTlTpIhq2jiz8C/ZHUSL1JPmTSV3xgNxwveCYv8k2JLlMd66kumJuKFBsj0lN+5/mDDQ/1VDctOzypCRCCoQIn2xNMEG4y9q2TLxzWFjtYng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=allegro-packets.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=2fnALUttmbuMCIpmTFtS9uSwVDq7ZHj6qiyj6sIs+G4=; b=O5TQ7Qk/tCEDLUSYd1ETSjjr9wov33F5J+G4NrPkSH81MWmJf6TZ4/oE8Fdm9fG24JMTHIgdw6j4jgGuhLp7AG7yuFmqd5N9VeK70DugpQC6fJefkFb9yYLcvRLnmwulSw64VNbQn3VSPNnh3IWAnYs6UpRqcqv66QEQuJorkdi1WyWxmtw5g9XWNfzPBJm0m63Vhagh8EYKYXsRN75/8ldIGIt9+LchO2Q8ave0U8o62z+o5H/gtLtxpJCadqVCOdrOP2q/YQImPCymlqxWdth4iJys2RXF62nf6J3mJVMTyW6BF2AdtdDHPrB+lry08yXNk8Mr9kQN/F4Mje9lqw== Received: from BYAPR11CA0040.namprd11.prod.outlook.com (2603:10b6:a03:80::17) by CY5PR12MB9054.namprd12.prod.outlook.com (2603:10b6:930:36::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Sat, 7 Dec 2024 08:05:42 +0000 Received: from SJ1PEPF00001CE3.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::31) by BYAPR11CA0040.outlook.office365.com (2603:10b6:a03:80::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:05:42 +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 SJ1PEPF00001CE3.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:05:42 +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; Sat, 7 Dec 2024 00:05:29 -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; Sat, 7 Dec 2024 00:05:27 -0800 From: Xueming Li To: Martin Weiser CC: Xueming Li , Bruce Richardson , dpdk stable Subject: patch 'net/igc: fix Rx buffers when timestamping enabled' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:07 +0800 Message-ID: <20241207080055.488538-50-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-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: SJ1PEPF00001CE3:EE_|CY5PR12MB9054:EE_ X-MS-Office365-Filtering-Correlation-Id: 7631b48c-383e-46df-d77e-08dd1695f225 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?j8SHza0ywDQ35hsSR4VJdGiKfUwc0ju/v3a05F/2tlzs3+sXIsftFpPQWtGQ?= =?us-ascii?Q?ieiDIhcb3e8KX+FiukZQIt7whM3IZesA+MWLfD+Gos3plzqYJpy+aEit7C8y?= =?us-ascii?Q?zd8KyC7ONNeosP3c+PZlMQqQgse4axBz/WddD2+y3V6oljkcsGoCHEK0MhK4?= =?us-ascii?Q?cFKZ5njsHgjklPN+p9jrsaYa12ba3X+EkaCI4IZtcVpX8+Ih1JJCYKkiFIWm?= =?us-ascii?Q?KHbfOqdTdBelyhuZGEGg2fmpj4K/I6EGRZur2yhu+NTPA2nNcN7IkEEnCK6o?= =?us-ascii?Q?gwj3xn6pB/E9yEV7M6b9pI7oMpktZtTVwJZYviIR266T/SQZMjD0O1sFWjgM?= =?us-ascii?Q?lmBBNSOA9kCiwGkgHGCPOZFNs+LmC7yKQeM9z+zx+NMdkRMiEa8m0jlAXyKN?= =?us-ascii?Q?kCwfRolh9UFC+GP+A1UsUEySMZsz9wGcKqEkPZR6Dj5+NF3duxb+JkFzTqMV?= =?us-ascii?Q?v1JXq0/xVa3eRKxRWsJt+oqc7A6ek1p/QFOM1dr2kNh1LRkTuzHwZMA640XD?= =?us-ascii?Q?9QyO5/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cqSx?= =?us-ascii?Q?U1ZvYZw9CJ5JJPb73sIXwOzCVUoJ/fEA?= 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)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:05:42.4357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7631b48c-383e-46df-d77e-08dd1695f225 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: SJ1PEPF00001CE3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB9054 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 12/10/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=57f022e772fe4d6249a18b05d6bf2810c1f5a410 Thanks. Xueming Li --- >From 57f022e772fe4d6249a18b05d6bf2810c1f5a410 Mon Sep 17 00:00:00 2001 From: Martin Weiser Date: Fri, 1 Nov 2024 14:57:26 +0100 Subject: [PATCH] net/igc: fix Rx buffers when timestamping enabled Cc: Xueming Li [ upstream commit 4e08d335554ec6d975ded8a7badf81e0edb39234 ] When hardware-timestamping is enabled (RTE_ETH_RX_OFFLOAD_TIMESTAMP), the length of the prepended hardware timestamp was not subtracted from the data length so that received packets were 16 bytes longer than expected. In scatter-gather mode only the first mbuf has a timestamp but the data offset of the follow-up mbufs was not adjusted accordingly. This caused 16 bytes of packet data to be missing between the segments. Fixes: 4f6fbbf6f17d ("net/igc: support IEEE 1588 PTP") Signed-off-by: Martin Weiser Acked-by: Bruce Richardson --- drivers/net/igc/igc_txrx.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c index 5c60e3e997..a54c4681f7 100644 --- a/drivers/net/igc/igc_txrx.c +++ b/drivers/net/igc/igc_txrx.c @@ -347,6 +347,13 @@ igc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxm->data_off = RTE_PKTMBUF_HEADROOM; data_len = rte_le_to_cpu_16(rxd.wb.upper.length) - rxq->crc_len; + /* + * When the RTE_ETH_RX_OFFLOAD_TIMESTAMP offload is enabled the + * length in the descriptor still accounts for the timestamp so + * it must be subtracted. + */ + if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) + data_len -= IGC_TS_HDR_LEN; rxm->data_len = data_len; rxm->pkt_len = data_len; rxm->nb_segs = 1; @@ -509,6 +516,24 @@ next_desc: */ rxm->data_off = RTE_PKTMBUF_HEADROOM; data_len = rte_le_to_cpu_16(rxd.wb.upper.length); + if (rxq->offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) { + /* + * When the RTE_ETH_RX_OFFLOAD_TIMESTAMP offload is enabled + * the pkt_addr of all software ring entries is moved forward + * by IGC_TS_HDR_LEN (see igc_alloc_rx_queue_mbufs()) so that + * when the hardware writes the packet with a prepended + * timestamp the actual packet data still starts at the + * normal data offset. The length in the descriptor still + * accounts for the timestamp so it needs to be subtracted. + * Follow-up mbufs do not have the timestamp so the data + * offset must be adjusted to point to the start of the packet + * data. + */ + if (first_seg == NULL) + data_len -= IGC_TS_HDR_LEN; + else + rxm->data_off -= IGC_TS_HDR_LEN; + } rxm->data_len = data_len; /* @@ -557,6 +582,7 @@ next_desc: last_seg->data_len = last_seg->data_len - (RTE_ETHER_CRC_LEN - data_len); last_seg->next = NULL; + rxm = last_seg; } else { rxm->data_len = (uint16_t) (data_len - RTE_ETHER_CRC_LEN); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:45.729222608 +0800 +++ 0049-net-igc-fix-Rx-buffers-when-timestamping-enabled.patch 2024-12-06 23:26:43.953044828 +0800 @@ -1 +1 @@ -From 4e08d335554ec6d975ded8a7badf81e0edb39234 Mon Sep 17 00:00:00 2001 +From 57f022e772fe4d6249a18b05d6bf2810c1f5a410 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4e08d335554ec6d975ded8a7badf81e0edb39234 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -26 +28 @@ -index d0cee1b016..fabab5b1a3 100644 +index 5c60e3e997..a54c4681f7 100644