From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C0665A0577; Tue, 7 Apr 2020 13:10:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 364882BD8; Tue, 7 Apr 2020 13:10:10 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 366662B83 for ; Tue, 7 Apr 2020 13:10:08 +0200 (CEST) IronPort-SDR: JFKlBu1vW03l7oLW2lXFc/Db6OVkYT1aoGU0AJDJBX6B5g1bwWTq3X8xqpspD/1CczlV4Kz3P0 g+BsS1P28NLw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2020 04:10:07 -0700 IronPort-SDR: G5uLH/QeiZ0cB8je+3ypyklEEw/GpPJrq/p251zH8eaaCsoleey2qtF1v3QLTO6J7Zz+YrAkvl rKAuI4IB98FQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,353,1580803200"; d="scan'208";a="361503058" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 07 Apr 2020 04:10:07 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 04:10:06 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 04:10:07 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 04:10:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PPJjGdL0SH6ea6MpkZRA0wa1v7GUbgznBiBOir7r547/VML+3u6/aheyx1p8xh+tGARriuIiWDeXsRR06LQe3CflRgZiq8amhNAYjUN3V/3Wr8tFHHKVxYpT9jRi8yj6BiBp+xCNVCCKpsSLgeB4AFrr4w6T39JIg2l1QSux5qrnBf7FVn0u95s08UhaIZu/hpfzY42QSDJQttemj8r6AvQ9VZ55dlja/T2ZF11cv94Js0AU/2f7xo/LLwkm4DFvPqndNssCRkZw5QXyfYIlqjfkbXkQlsaD4J98Rnc/wnT9P0BzM1fMPp+pp58rcFHf4dhkiGYTj6yqJ87D5F7JUg== 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-SenderADCheck; bh=wWQv/9tgNHbNMGO8y31DWjpxosnqSz6qZ5SiCEnkK0E=; b=Rle7s8qQhjUQ3BEZysoQfmqYuyUHJu/M8KeAF3N3pJJhFJ09mwzI6tVoWn0E2ZH8X8poAFvlgWaz6wxOSPQ1EMc4iNzy31svaBezrxZTLqq7dng7qdHGCDhqBye6aWjL1EO7q+m6erDDz6qonJQtftqjvuESY2zyERxdSYRHQQ9obLxjp1TP1ZRVU0P2EwPmbnbWL/VjJHElZAGLRHW00n0gWgHOOLABJ4ao8HvhE3HnLOMO2NYS/tPI8yV5wb8y9GgvOgmVN/bdD5akUfjq9ZMHuEN3LX7f2sNez93BRweXxvdWFefQX8tDTUBvhYfynQKfOf3MWGgB4I1qjoc9qw== 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=wWQv/9tgNHbNMGO8y31DWjpxosnqSz6qZ5SiCEnkK0E=; b=hO2I9k6GiObWnIZ7U5Ncntp51dN/6fjEOu/eAjapqSGLiBA8zyWD4F06mpeSIvVSy1xQ3YHr9tvw3pln4QLDaS5QT9oP9CRBuWS0W+YWrAxPEmRnnxhwfTPG0Sqcys6y5ZdMqOZchf9T5lQRDqOycliFncYxPrqswyzvdGSHfrA= Received: from BYAPR11MB2549.namprd11.prod.outlook.com (2603:10b6:a02:c4::33) by BYAPR11MB3576.namprd11.prod.outlook.com (2603:10b6:a03:b4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Tue, 7 Apr 2020 11:10:04 +0000 Received: from BYAPR11MB2549.namprd11.prod.outlook.com ([fe80::141d:cf28:589e:5f49]) by BYAPR11MB2549.namprd11.prod.outlook.com ([fe80::141d:cf28:589e:5f49%4]) with mapi id 15.20.2878.018; Tue, 7 Apr 2020 11:10:03 +0000 From: "Ananyev, Konstantin" To: Aaron Conole , "dev@dpdk.org" CC: Sunil Kumar Kori , "Burakov, Anatoly" , Chas Williams , "Richardson, Bruce" , David Marchand Thread-Topic: [PATCH v3 1/4] ip_frag: ensure minimum v4 fragmentation length Thread-Index: AQHWCFT5t7STmfoiVEqeJTT1QdTvGahtiAqA Date: Tue, 7 Apr 2020 11:10:03 +0000 Message-ID: References: <20200401131849.2209336-1-aconole@redhat.com> <20200401183917.3620845-1-aconole@redhat.com> <20200401183917.3620845-2-aconole@redhat.com> In-Reply-To: <20200401183917.3620845-2-aconole@redhat.com> 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.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ba3f2648-9993-4609-651b-08d7dae438df x-ms-traffictypediagnostic: BYAPR11MB3576: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 036614DD9C x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2549.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(39860400002)(366004)(136003)(376002)(396003)(346002)(66476007)(66446008)(66556008)(55016002)(6506007)(66946007)(76116006)(71200400001)(8676002)(5660300002)(7696005)(9686003)(2906002)(26005)(110136005)(52536014)(33656002)(81156014)(86362001)(64756008)(186003)(316002)(81166006)(478600001)(4326008)(54906003)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y4e/WDWLLwZ5DF9YugSyOS6WTgHtmeJX0VR5P4J2MOQxKlRARjIKP8rX0x9XY/jaqCSBdRE6xiyhwUQY+1IPJdR9vfst3n5C6mKt33khybhtb0WNoaUXtQY/upMogQqAMmagUz2SXLb1/F2RA9gl8iSsXcAQxJnwZ1bsK7DkCBwcGT4LJBb3dEobM89zRxbWjLlbav77avWJ9a+iTaNwMjMjHBz4D5/fteqOAQLYVaMEq/J3yz8yXkOoJstqzePJCEoZm7N/siWKG4ve/3IzYfzMbp5pMv1SEuHpbqN4T81W7WUVPv95fb9EdqHnwtIjVm6BGzyRZMnaA4pFSyzpgIqHBycjyTOwHPs3cuF08jiqfv89Z73Dx1PUu0JWmOejAmMm1wxBs0iXNNV2Zyk8dTr9D9qyINq9JWvMQ160645hzFv9x1BBqUsoGVKXuFU6 x-ms-exchange-antispam-messagedata: KjB1sKYMuns4EBj1QhiVZGxdeMEFSHVKvI/y3fqVwlIC33+ce2yMmS1arQi/UMFfU6KKh7fmeYImhkEX1FsGOZbhdUWj7SLLFfJ00y87HYDh4ZT5R8zQibe3bcuakjqjsh1Db7RdMHePokFYOol5OQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ba3f2648-9993-4609-651b-08d7dae438df X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2020 11:10:03.6778 (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: nDqp6zhsWMF6S86E5krzDz/RU7slc19kaVXfRXaRw/QYh2+tEckUb3noD6mY1Nbuu+YWSkV/vzOktHYz5/Q+tsIQnTxWGtTcI9l48HMtF24= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3576 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/4] ip_frag: ensure minimum v4 fragmentation length X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" >=20 > The IPv4 specification says that each fragment must at least the size of > an IP header plus 8 octets. When attempting to run ipfrag using a > smaller size, the fragment library will return successful completion, > even though it is a violation of RFC791 (and updates). >=20 > Signed-off-by: Aaron Conole > --- > lib/librte_ip_frag/rte_ipv4_fragmentation.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_= frag/rte_ipv4_fragmentation.c > index 9e9f986cc5..4baaf6355c 100644 > --- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c > +++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c > @@ -76,6 +76,12 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, > uint16_t fragment_offset, flag_offset, frag_size; > uint16_t frag_bytes_remaining; >=20 > + /* > + * Ensure the IP fragmentation size is at least iphdr length + 8 octets > + */ > + if (unlikely(mtu_size < (sizeof(struct rte_ipv4_hdr) + 8*sizeof(char)))= ) > + return -EINVAL; > + Same comment as for ipv6: ipv4 min MTU is 68B. Why do we need extra checking here? > /* > * Ensure the IP payload length of all fragments is aligned to a > * multiple of 8 bytes as per RFC791 section 2.3. > -- > 2.25.1