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 7966CA0561; Mon, 20 Apr 2020 14:50:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 52B771D59F; Mon, 20 Apr 2020 14:50:45 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 747C51D58F for ; Mon, 20 Apr 2020 14:50:43 +0200 (CEST) IronPort-SDR: 6Low204LynME21dJd4GTsBMZ2gN1gLelcatm0faI4sKeG69oTm2fTkUOABdHIRqxu79XgDsViO SfrCVlMQYXmQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 05:50:42 -0700 IronPort-SDR: hviYupNUyePArfKNicxh5pBNMQix7Qpm9bxrKIpiOcCzY9ZdLi4Nxr5xpHI5bfHU4ByqvlSEAO 39F76mD0EKQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,406,1580803200"; d="scan'208";a="258332273" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga006.jf.intel.com with ESMTP; 20 Apr 2020 05:50:42 -0700 Received: from orsmsx126.amr.corp.intel.com (10.22.240.126) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Apr 2020 05:50:42 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX126.amr.corp.intel.com (10.22.240.126) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Apr 2020 05:50:41 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Apr 2020 05:50:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1o9v9xFVVePjD0HSOw9ftyzo7/QWAFEg0e/JFvxt6x4clmfCOOsNPwtPmnl8xsyX9wSm4hsHGOZldTtI16KxCc6aegx+O8W/nf/tur2jXGbROL+u8jC+NX3LBABDwM1dmKxfWlmAVR3thwAyGN0+1wpLbmcEIEQ9RTk2gyokyNXndn0FMY1KQNeAsca7ne8y0O6dqvIfaXZepbcYwdBu9hwPuAggN0q/KN4xJ4AK6SHIIzctVLH9jju9yB6xKKtsWfN2E5zvFIN7DyXii22Hs/FjZOmxqAhtskTRCc33qnD2d9hL1MFRtDV1iAkgGnNphyWiiIP9cmSzDRWWAfkuA== 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=7b98OFlFq2bkqyeBaHoQw07sGFn1taIVae472X5SNcc=; b=To631ecA+U2vRb/rZevFpdgzqHfsnKjIXlqyMsgotmpZ7CgL80qAekvAKpScDRhv7TtWxAHIW9ASOhYWh9OMjDmhfViVl9U6qeb5KU9fRuBjmMetoXCEEIkhw0AmaRsZsH2lVWKTJ7xKVMkMJP4wdRj8zX5MeQiee6hCVDbbEjZ00V+LP45+b67ZGncZU6d4a2tGNSd5q1wn/lLPmL29RgYZt1HMZk6soLvw4JaFBGkaa0Hqqd+eWHUZU8hDeXY/Mv4VaRqRjHN3/2cUNFkeTtHqfviFWWVX2DYLAJGxZZj6pvpfWgJOcaBKboiPAX0IXmWnHW7fk0PCELORB5tKDA== 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=7b98OFlFq2bkqyeBaHoQw07sGFn1taIVae472X5SNcc=; b=EjhGZV5nQBrJ7PCCQD4pFkjVwAY5JjrGTNleN4Sij2pOC3e3fTe6N0sZkf5Q+eoFYW1ui7F+MEBaMb3FIgiJ8fBkC8D1hLSCtJPZvLAV6c5xwcHnwtPeNoziAZS1arUgekh6IJnjNtGiHp5wquZUfApXbw8npEhnDROP4uMGpKY= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3384.namprd11.prod.outlook.com (2603:10b6:a03:75::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Mon, 20 Apr 2020 12:50:40 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.2921.027; Mon, 20 Apr 2020 12:50:39 +0000 From: "Ananyev, Konstantin" To: Aaron Conole , "dev@dpdk.org" CC: Pavan Nikhilesh , "Richardson, Bruce" , David Marchand , "Yigit, Ferruh" , "Burakov, Anatoly" , Lukasz Wojciechowski Thread-Topic: [PATCH v5 1/3] ip_frag: ensure minimum v4 fragmentation length Thread-Index: AQHWFLo6go6vrcZ1WEaL+Nsti711FKiB+mcQ Date: Mon, 20 Apr 2020 12:50:39 +0000 Message-ID: References: <20200415172547.1421587-1-aconole@redhat.com> <20200417131410.1343135-1-aconole@redhat.com> <20200417131410.1343135-2-aconole@redhat.com> In-Reply-To: <20200417131410.1343135-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.170] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cb07a695-1bf7-4b2a-b27b-08d7e5296deb x-ms-traffictypediagnostic: BYAPR11MB3384: 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:8882; x-forefront-prvs: 03793408BA x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(366004)(376002)(396003)(346002)(39860400002)(136003)(316002)(52536014)(55016002)(76116006)(66556008)(66446008)(478600001)(186003)(64756008)(66946007)(66476007)(8676002)(5660300002)(81156014)(7696005)(6506007)(4326008)(26005)(54906003)(110136005)(86362001)(9686003)(33656002)(2906002)(8936002)(71200400001); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZStxn+xLT0orSQFtj4jsy4+6l+oz4Udo7M7+jRKzpG7uVvHTzwYCjoPQ3Glk+K17YEnUQ1U0EGXTx6f69R3R1AlFdQhdQX561sLBGJqvZDj0yK54e/ZrakcdRL7uCtU/fSJdFPemXxZrMMChWEsk0/GuYvQS6ysqKQp0o9c1Yg+7Op1p9otVYbxMOloZy/G16Vz6EqQwQ0WeIdUmf3aWp2oaoc6diPjebK9DYNrXJPANGqCbYEkug8NXhMgd96sey/uUr3hvnHCpA0HLkHn1BlVOpCDsm/yr+gWZLVIXpVyrlZn6oRPkS2N+vxLIFqywceq7LRiLUvQh//mxGos3eUfNpG9+c4FUF9S4B0yON62oDdBiewRvbj+CzbgWLwsFwf/wGh0VAYhXtcHThnaBkXwTkiceVP5Na1pFRGcmypX1fiwcyyAAU4gj7V4Okn7P x-ms-exchange-antispam-messagedata: 9SNd264q2p05eYsKPS9D3+YUj6rVouwA5Fj5DCy4aUcpCDDo3SqU+mairqovdk3SGDQwUVQhQmYhL8AC2ZaouyJt75MvtIGqH8jJkPolMNirVbEKc8vrFZYS8MRhKwr6aEBp9Cep8T/yFEbRYa1NDg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cb07a695-1bf7-4b2a-b27b-08d7e5296deb X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2020 12:50:39.3509 (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: uezcDKnKLJIVWOFe7In8yu3hA3zKMjq/VMh3NpPc8vQE4tq7ysMtVIyopold5RWxbwETdjT4afHwKDOzO0oBaHtGGbLHejJQoI6UY14BtNQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3384 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 1/3] 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 > Do a formal parameter check of mtu length, as well as > checking the the various inputs for validity. If any > aren't acceptable, we bail. >=20 > Acked-by: Lukasz Wojciechowski > Signed-off-by: Aaron Conole > --- > lib/librte_ip_frag/rte_ipv4_fragmentation.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_= frag/rte_ipv4_fragmentation.c > index 9e9f986cc5..c36678a6d2 100644 > --- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c > +++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c > @@ -76,6 +76,15 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, > uint16_t fragment_offset, flag_offset, frag_size; > uint16_t frag_bytes_remaining; >=20 > + /* > + * Formal parameter checking. > + */ > + if (unlikely(pkt_in =3D=3D NULL) || unlikely(pkts_out =3D=3D NULL) || > + unlikely(nb_pkts_out =3D=3D 0) || > + unlikely(pool_direct =3D=3D NULL) || unlikely(pool_indirect =3D=3D = NULL) || > + unlikely(mtu_size < 68)) It is better not to use hard-coded constant values. I think we have a macro for it at lib/librte_net/rte_ether.h: #define RTE_ETHER_MIN_MTU 68 /**< Minimum MTU for IPv4 packets, see RFC 791= . */ Apart from that: Acked-by: Konstantin Ananyev > + return -EINVAL; > + > /* > * 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