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 DF0FAA034F for ; Wed, 10 Nov 2021 07:46:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D98E04014D; Wed, 10 Nov 2021 07:46:38 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2042.outbound.protection.outlook.com [40.107.93.42]) by mails.dpdk.org (Postfix) with ESMTP id D2DFD40142 for ; Wed, 10 Nov 2021 07:46:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhRnihluSmV+2EyzubdF89b3Uga0Yl0te6snimpNNWN86ds2tU/eJl9hZq//CvTAhAOsgmN1LM8vOGoX4RppEhGmXVLLihvJzWNz222eauKMJm37EDcwt9fZ2dEyj5tQSyw8kJL2GExpnx3ytsmdD10WyPu3DIVC13lDcIHvOHtA0EJU76cwbgccCvk0RI25AqL3D+lLmQuGe+DosRur+4ekDl+X/LSoENVERqohpNWpz003G3TX5dkZwZLmBq6KL4PWZaMT9ox5s+nd10jj6CLbb4flgRxAg8mWOkCN/nuTEwx6qJUJh+jA1PafRuhwN5EYqyzeoNnJMI1zUsCOkw== 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=pg25zFgnhs75XCjnKb+VQMtazJnwVdpvR4SIKEl1IKk=; b=IjE4YoyfM++pXytEeYQWNL+r9hN/kF8ny3uJQGje1wFjaSCxn6B27fDqgQm7dSh3D41/9RWvMKransCXaSrFutSUZbxF4diGbRUPsAz+873iHnuIryBXs2J6gwlCVhK31F9a7YiRYuFOQO3/ovZYgPB+cTOUMXNZWSC8t58tA+hVxQbaUViEWTYE1pTE8z2A+xPpEW2E2tSLVJapl7ULTHJ/AY09hv6ZXcQl1nW+o4qBYPv9wva3RL8lNTipkiTSwfe6VVSH5ir2lGKjOklBwDJqw2OPPstqRI/7oBedK83zO0c+ouWDSEhHKMJ9imPgTR7+khZvI9wRm2jnzdkuyg== 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=pg25zFgnhs75XCjnKb+VQMtazJnwVdpvR4SIKEl1IKk=; b=VX/tZQ8flbtJAPYCH4qH5yIsr7duT6mOKMxyIKB7J5O6a7CRxmNINhgmogLBRlPzSd1r9AxwUVYetG8JWxWMzuMjgsqeAdDCeL3R44NGR0KQl5qvEW0Amk8T5cdYl5FPeUf6YppaNOIWFuPVb9X3bxbcvSr4JXlAW3dkR+IhhYkUt6yTJHuSpzcEO4Gbq4dqIzwn2uyTr7yZnewLdB3TDNTvaPuPSytqEWAtYCYRe4rNGc4kF2hDQ8A8C865Wm7TxnfIJ6AzFFktjQtMgpb2w5tkOZS/O5tYLRv6sYq1VdUv8t8w3xgZVPOOAEwipptvn2Hv9A2Y2i3gRRr7l4sZgg== Received: from BN9PR03CA0660.namprd03.prod.outlook.com (2603:10b6:408:13b::35) by SN1PR12MB2478.namprd12.prod.outlook.com (2603:10b6:802:23::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:46:35 +0000 Received: from BN8NAM11FT036.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::84) by BN9PR03CA0660.outlook.office365.com (2603:10b6:408:13b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:46:35 +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 BN8NAM11FT036.mail.protection.outlook.com (10.13.177.168) 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:46:33 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:46:31 +0000 From: Xueming Li To: Huichao Cai CC: Luca Boccassi , Konstantin Ananyev , dpdk stable Date: Wed, 10 Nov 2021 14:30:09 +0800 Message-ID: <20211110063216.2744012-126-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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.20.187.6] 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: 642bb3bf-1443-450a-1740-08d9a415d5bf X-MS-TrafficTypeDiagnostic: SN1PR12MB2478: 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: zCv3xaq/VnDmDd5RgRaC1W5l2n75cAuu1jP4RN4ELXIT794k0SX4s2EawBhzxA1YJJelnXCk9ysM77gwwNTEQbGJozv9B6nWkVSOtDHx4texzbtBhpZMw7RzugR0QSRxdI/fODJy50CavBcqn0TU9+9BkpYh/JA8QXJyAiDQQUD4jLGrh+yYt5iO2S2uZT2Tae4fWqFBkCuPnM/F6rJxuueQCgA2oqKnfcV8l+SIfEh3QzZzI/c5r2NAHb2q0m7M7v0NoI4evzJd0p9ALY+CN4yJ9RuWkbc3Jo1+o+dvIMrpr/TXByLkAZ8Ld78mDAr35jMnPdgv/zIhGJrH0RFmbW5Wbl+AYHIfNfB0mn6Wlo6ipQLdKYmH+6RSL5Nw5tRGLaxGY2iL9q75vj0vRorwZGjLD5uPK91gqUZyPNyuv+1jAMfvL7GTsHZFuD7tSF1zuTbGzgdlE8Rr90KYXa4Ex5t6i0YnM0y0jUAxih0w9ehk7g3NIvpOEShrH5jATk3L2xJ9U+yrUsmP3KwhSJoDAmHfbrm5oXSqhwHU1w8PVD4TCvhylPkwCrLn9beLdbllgBjTE8cJpkg+9vBJwOsN9vF71IJTDymdX1I/oh+6GNOqJwGcBOrEktWcVp7TnrusSy4rJILFbx9wunscayzY2uMOIUQ6ie1LWSVpE3gXRPkIJS4pz3N2dKWncLWI6PICj+JDbRWLwf/Qog7LQLfbKbxORYYDPXTJjPCCR9BRnHf2GO3w1kVEyB0rq86Oq2o/GK3E0ePHKhTo7LZCwmYCdVzYGaCxqFjsO3GBF6ekLE1jih4i9+7SJndaeTnlyB7k5IxBNFxWpYSWR9I/naJwQg== 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)(16526019)(186003)(2616005)(83380400001)(508600001)(70586007)(4326008)(36756003)(70206006)(966005)(336012)(426003)(4001150100001)(1076003)(8936002)(8676002)(86362001)(2906002)(47076005)(7636003)(6286002)(26005)(5660300002)(6916009)(356005)(54906003)(316002)(82310400003)(53546011)(6666004)(55016002)(36860700001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:46:33.5385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 642bb3bf-1443-450a-1740-08d9a415d5bf 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: BN8NAM11FT036.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2478 Subject: [dpdk-stable] patch 'ip_frag: fix fragmenting IPv4 fragment' 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/8250620e98bcc548945a3879d861ad9d9ee542c3 Thanks. Xueming Li --- >From 8250620e98bcc548945a3879d861ad9d9ee542c3 Mon Sep 17 00:00:00 2001 From: Huichao Cai Date: Sat, 9 Oct 2021 15:27:04 +0800 Subject: [PATCH] ip_frag: fix fragmenting IPv4 fragment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 567473433b7e63e12943be29926c13bd491bcca6 ] Current implementation of rte_ipv4_fragment_packet() doesn’t take into account offset and flag values of the given packet, but blindly assumes they are always zero (original packet is not fragmented). According to RFC791, fragment and flag values for new fragment should take into account values provided in the original IPv4 packet. Fixes: 4c38e5532a07 ("ip_frag: refactor IPv4 fragmentation into a proper library") Signed-off-by: Huichao Cai Acked-by: Konstantin Ananyev --- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c index 2e7739d027..fead5a985a 100644 --- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c +++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c @@ -75,7 +75,7 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, uint32_t out_pkt_pos, in_seg_data_pos; uint32_t more_in_segs; uint16_t fragment_offset, flag_offset, frag_size, header_len; - uint16_t frag_bytes_remaining; + uint16_t frag_bytes_remaining, not_last_frag; /* * Formal parameter checking. @@ -116,7 +116,9 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, in_seg = pkt_in; in_seg_data_pos = header_len; out_pkt_pos = 0; - fragment_offset = 0; + fragment_offset = (uint16_t)((flag_offset & + RTE_IPV4_HDR_OFFSET_MASK) << RTE_IPV4_HDR_FO_SHIFT); + not_last_frag = (uint16_t)(flag_offset & IPV4_HDR_MF_MASK); more_in_segs = 1; while (likely(more_in_segs)) { @@ -186,7 +188,8 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, __fill_ipv4hdr_frag(out_hdr, in_hdr, header_len, (uint16_t)out_pkt->pkt_len, - flag_offset, fragment_offset, more_in_segs); + flag_offset, fragment_offset, + not_last_frag || more_in_segs); fragment_offset = (uint16_t)(fragment_offset + out_pkt->pkt_len - header_len); -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:07.516214039 +0800 +++ 0125-ip_frag-fix-fragmenting-IPv4-fragment.patch 2021-11-10 14:17:01.887412621 +0800 @@ -1 +1 @@ -From 567473433b7e63e12943be29926c13bd491bcca6 Mon Sep 17 00:00:00 2001 +From 8250620e98bcc548945a3879d861ad9d9ee542c3 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 567473433b7e63e12943be29926c13bd491bcca6 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ - lib/ip_frag/rte_ipv4_fragmentation.c | 9 ++++++--- + lib/librte_ip_frag/rte_ipv4_fragmentation.c | 9 ++++++--- @@ -24 +26 @@ -diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_fragmentation.c +diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c @@ -26,2 +28,2 @@ ---- a/lib/ip_frag/rte_ipv4_fragmentation.c -+++ b/lib/ip_frag/rte_ipv4_fragmentation.c +--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c ++++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c