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 4B73AA0C41; Thu, 7 Oct 2021 19:26:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05F3441155; Thu, 7 Oct 2021 19:26:24 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id C8F9A40140 for ; Thu, 7 Oct 2021 19:26:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="289815773" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="289815773" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 10:26:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="568714478" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 07 Oct 2021 10:26:19 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 10:26:19 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 7 Oct 2021 10:26:19 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 10:26:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EOhXujSvmGR+HnK/xNpGI61kqAhdUDIGSED6FYUC5ft/EAFYnBHRh9mQ30Z4aTLYL74IKFaHyWm47mnxmVRoo95JbYroDPJ2987TSqjzwnQJXxPWOT92XPXqMTI0Ua9kvekw2mguEC1F62iE6D9W57UXcGtyv1lGvKomVG/W0IhASzD+Bzm3lpaGcqH1p4V+eT9CQmmQnJpti5sLPxXO8uTtU9ZAYyHYeSJee0OGtv7WoINOgHF2Sd7rFy7gl+uWICxlXKHe5qpNriVzX7VVLz5Dubt6Ekv0RVQFxc7yv5Sokg3EIe/nGO7UjMVau3IWa0E4CeCheg3axo+5TT2kmQ== 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=qokwOKx34DPVixLCp/7cPJuOUxfCZvc2AUyEjlzWpOc=; b=nAGXDZV5yj5zjtF8XC0zhf4OYFZPT0fqO8xa+dkSDC7WtPyrG7ZZKYEAPA1OdfKrk7wDd7y87n0xkpSiv/MEt1bsewFnXj1nRdPq1zeeZxkdoVYIvbdcgCb4D9QrnjBwArdLgWDh/vz8I2dduiD2gBzwNUnZI33+PSqwAyltILWWh7u5LOk2f1o1JbidyFmb0zMWrQXOikwWMtuwddmFqffdnqlLcsqpXH5iQg0G0mxShMji41eUeSO0nU36nwrRvYRktACeHHxdVi0KhUX8fDUOUHGIfrASwZWigwK2RtbYJmXzDKh0kiwKZV1Uc23NDW3EAelS8njBKC6l6dx+qQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qokwOKx34DPVixLCp/7cPJuOUxfCZvc2AUyEjlzWpOc=; b=rXVy+QYyDQFP3N7GWF/QXee7KBD9RyeiBVRCRN/g0YpAMpPBeiYUYWQfMagufl11jC2W5iIqaTj7gGcjd6GwM3j5P7seY4xy0dB1jgHxF7CPobxR0BFIkerYJCN75T0CqaNjzRIFcMbieX5uWt6F42YihzqYJTfQwMV9ItAqutA= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB4186.namprd11.prod.outlook.com (2603:10b6:5:196::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Thu, 7 Oct 2021 17:26:17 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4587.019; Thu, 7 Oct 2021 17:26:17 +0000 From: "Ananyev, Konstantin" To: "caihc1@chinatelecom.cn" CC: "dev@dpdk.org" , huichao cai Thread-Topic: [PATCH] ip_frag: modify the fragment offset and mf Thread-Index: AQHXs4dktefX2R5M1ky7XKVs8OracKvH1fAw Date: Thu, 7 Oct 2021 17:26:17 +0000 Message-ID: References: <1632737174-86870-1-git-send-email-caihc1@chinatelecom.cn> In-Reply-To: <1632737174-86870-1-git-send-email-caihc1@chinatelecom.cn> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: chinatelecom.cn; dkim=none (message not signed) header.d=none;chinatelecom.cn; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d9536208-f219-4c35-a8c9-08d989b79276 x-ms-traffictypediagnostic: DM6PR11MB4186: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yl7Gj0vb7GLN1V/6pD7TpO3IuSxJGx4qHNeCYee2otHgOn9hNMCEUg0MyGvpecGtY9T+b4Yomrr5EmefopQJlk0RlT9mTiQA6JnDbjNdPL0xbjJdg/SjRKRBYMqBqF9D8B4lJ0NJiMvunhIGjkOclw4eQ8KQy9nFuW+8HVRZueCds/ZtsA2Tf4srU8QgL2yz50aUnMRwlF10jOGbJsF0mr6pq0zK6GgQF4jcCxGlVzmiBzTdE9WhgMJzo1gD1Al/NQGUmms04X+A3j4+jvtrk4oEDKQVeMowwhXrEME1f3a9RR5VCoYKc6EWrdi5iYJu3ENreTBul7G3o0eavfG6djPhoRFViiddFFi8tdeQhPN5nJrLci2LUT4G7hdP8A90b46NHKNu7SWU3URIYQXQa16ahOoeskM75hiiiJY9ZxUSUcEJylXvieBmJ1YsVy5w+qkdhlcKiw1+YTpqI8nAxtRmyDEXrBcr6VWiwlPlkjy1NOMTkgkuvy5gxhj4/Bh2jbPPZOPSESDippupKkEPGg8nXudIoKPWf4rfMAwA8vZRaHzJ7J/iRZlv0H4j9hHgo+GRKJifx0s4ptk0sR9hb5hfwHWy5SVDGskkgYirnG9wOWvEXW54q2dxmeRvCMIz/v2wvVURSuU2dSo0ZsfmkEqRuPmFfNVW8f4CkEEyu70dqGempiCvhYekHQj399RiW42HMOtoCsh4cw+syiCvpyPe5FTefEGyNRKUiVbFl9C00b972eI+wLbuzgr6cPA9vVfcIJ7aoOOAXEAXaivINvTJbQm5A54Oeuy8QQWmquo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(186003)(966005)(66446008)(38100700002)(38070700005)(122000001)(52536014)(76116006)(6506007)(4326008)(55236004)(26005)(8676002)(7696005)(508600001)(6916009)(33656002)(9686003)(55016002)(71200400001)(66946007)(316002)(8936002)(5660300002)(2906002)(64756008)(66556008)(66476007)(86362001)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Kxu/6fOOLE7Qsj+C+AF9tvlAb40RxihtHmeSKtImGjd44u/WKqoPKJxZLqVX?= =?us-ascii?Q?PKdtDjfgYxgiXn4p0pWZlqM+n3oCJhTqpXgDsPsC4IEPZeyMbEgGxBzo22ry?= =?us-ascii?Q?kVLIF3RtunaV+KLgMz7lrGxYB8rZHRQ5XZ2MFtlv+/2ClDVTI1bqCLBGkZ2+?= =?us-ascii?Q?8AdpuVCdkFs698MNtOniGwgfQVHuAq00c9znZe+TpGMVNIAQcT7GF5u883la?= =?us-ascii?Q?EuBc2Zc4ys5XLL6f8wDaEbBNjQfPO12t1WfFC36AAfT1It8CTpj5quMIO9Ub?= =?us-ascii?Q?xyNJRFROvNWWdGmFLFDQ0CEECcR/4E1i01QdxDnI9h5ppVUM2BRXAlCUmwYi?= =?us-ascii?Q?5XpB0QVwCe9sidr+Z9zbmAg7Um2GpBPpRmudktBvq8KzONs4t6RjqB0OLG6v?= =?us-ascii?Q?AoFwERbtjRVcD2kVDuX/eiEcQ9xqg2uMt1dmjkf3h84X5GL+UO95yDJNMa54?= =?us-ascii?Q?LYI+LQe3skZJvDzqV8cFh59G5D2LJIIr3r1IO4KmUK2SmMQa4/pE2Y61fWJa?= =?us-ascii?Q?uWk/PDEnNevIGNsl8dOJedHtidK0rk7QTrBVLwXTubJPXRZrZFRdtIJles+o?= =?us-ascii?Q?QC+yyerITVdja9KxKZtdgHaN4D/5WV844BydXyCZ08inSyG0fLsgfefhFrUw?= =?us-ascii?Q?ykFMSeCpXaQav1KrgV/ZIkiE9/Hek1vymHrU/JBbX6PJRszS/Yf/7+3KhEDT?= =?us-ascii?Q?VeW/Vacema2Pd9G46+w4CJiuOQpCor/1C0VFQ2DmmLKjAkqYPZ3JJCgBvmVT?= =?us-ascii?Q?gq3Tbsrf7lJmyeU3bZz51XPIzPja3iPF9RubZM41FXqG7i6ZMiN//t2K6gJB?= =?us-ascii?Q?mOYPlNDYOCQgb0vHAYMp7aenRPnWT2YXc3imJuzigHM5SLImyvmzADJ80Pwl?= =?us-ascii?Q?8+yXkUhvk+0qy+XkyPA7ebfccWP1+G2TrGOVTspkI8/zjo9JTGfCR8xr6dyb?= =?us-ascii?Q?+CuzpLPOe/AIynhZ4yIdTWQfk9dYAzoYHbJVmadMRd/9TsAMlrtmDjGc2+dD?= =?us-ascii?Q?TXfP9U9gd0yvJ83+ETJ0K4I0Jyt8ecKE2EvQCtXkGf5s7dBag3Lgu9fdBmoE?= =?us-ascii?Q?5DRq7DVb5r2ieoBg0xUwxYqRzrAGsKtnNiP/j0qkGDEAJpvbgrw/Ldbt7sJp?= =?us-ascii?Q?KdUDAB8XwppyzJ6Wu/kiRFQu5eCE7JBqolemgsWIbgG7H5lOUw8eZtrHcLj/?= =?us-ascii?Q?zA9Re0676XvT1RD1TqygdHhcGRf46UuAjS0XwD70WO0J43LT8F1zBHF6Y2O9?= =?us-ascii?Q?wQqGOWgHqjBXGeP+Il5dbhTIG5bFdp1AK82OMdt78MkYHWYcmFYNiw2YUafh?= =?us-ascii?Q?HSO5tziYjku/xZL0iwi2YB+v?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9536208-f219-4c35-a8c9-08d989b79276 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 17:26:17.7277 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GpepJM9wOEvValZBOAWVzzYV3DalrCe4xxnxNcXTjfRjbPiWN5cqpr7SDcCVvZ0dXEK2hxKTbDCKp9HaaikLuy9Ms71eEpFYS6KaLUpCgF0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4186 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] ip_frag: modify the fragment offset and mf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > From: huichao cai >=20 > According to RFC791,the fragment offset value should be > calculated based on the long datagram,the more fragments flag > for the last fragment carries the same value as the long datagram. Have to admit, that commit log is really cryptic. I couldn't figure out what it is about till I read the actual code. As I understand what that patch does - fixes the case when we have to fragment already fragmented ip datagram, correct? The code changes itself look ok to me. Can I ask you to do few things: 1. Reword commit message, it is really misleading right now. Also if is a fix, then you need to follow: https://doc.dpdk.org/guides/contributing/patches.html#patch-fix-related= -issues 2. Add new test-case for it into app/test/test_ipfrag.c Thanks >=20 > Signed-off-by: huichao cai > --- > lib/ip_frag/rte_ipv4_fragmentation.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_= fragmentation.c > index 2e7739d..fead5a9 100644 > --- a/lib/ip_frag/rte_ipv4_fragmentation.c > +++ b/lib/ip_frag/rte_ipv4_fragmentation.c > @@ -75,7 +75,7 @@ static inline void __free_fragments(struct rte_mbuf *mb= [], uint32_t num) > 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; >=20 > /* > * Formal parameter checking. > @@ -116,7 +116,9 @@ static inline void __free_fragments(struct rte_mbuf *= mb[], uint32_t num) > in_seg =3D pkt_in; > in_seg_data_pos =3D header_len; > out_pkt_pos =3D 0; > - fragment_offset =3D 0; > + fragment_offset =3D (uint16_t)((flag_offset & > + RTE_IPV4_HDR_OFFSET_MASK) << RTE_IPV4_HDR_FO_SHIFT); > + not_last_frag =3D (uint16_t)(flag_offset & IPV4_HDR_MF_MASK); >=20 > more_in_segs =3D 1; > while (likely(more_in_segs)) { > @@ -186,7 +188,8 @@ static inline void __free_fragments(struct rte_mbuf *= mb[], uint32_t num) >=20 > __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); >=20 > fragment_offset =3D (uint16_t)(fragment_offset + > out_pkt->pkt_len - header_len); > -- > 1.8.3.1