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 A33CB41C2C for ; Tue, 7 Feb 2023 09:58:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97AE942D32; Tue, 7 Feb 2023 09:58:09 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 3A877427F2; Tue, 7 Feb 2023 09:58:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675760286; x=1707296286; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4xWqmMe2itXk/aDLDQwjOV5fMz7En+iU5UIB19dgxgI=; b=mfj/AA/1IG488BuedrIq10eWnHgiSwKHo2WOpzHLjMva9QxML2xcpopF pc/HCiuPcUjZMaX0I05wCjQu/rSDvEzSMV/VmoIl8hQzhJ9wQ5QfSdacS xz2cdhfe5JncVYTKjNLKBkRMxGNWg2goWaR0PZf/QViV2OQw+bsJZ3/7v jszh8iz0DSqOB+0F7ZqVPUp1l3gDXghMjaBLlRwHaGuWeGBwSftyChvv+ TQ83GLokzwbp7jvgUx5DMeF8c4JFS2o0L5cDz7DLW2Gmv3evxgRubCFEW iE9b76tYxXKqQ4jE6yiAoKpWKbSLzk/ejugbfrZdeJBh1hsVvh97Enhdb w==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="330745125" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="330745125" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2023 00:58:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="730353260" X-IronPort-AV: E=Sophos;i="5.97,278,1669104000"; d="scan'208";a="730353260" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 07 Feb 2023 00:58:01 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 7 Feb 2023 00:58:00 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 7 Feb 2023 00:58:00 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 7 Feb 2023 00:58:00 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 7 Feb 2023 00:58:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DwLDdVcJzUtks/SPjOi/mPYoDp6wguPJ+WP1IyphxAP+gicipNBiLECG9XYb2XtIdCvpH/kH3P5GwWTcvPZ40jnW+lP3kh+xPdZyQNWUYI6Hg1JXxYsZQ7O0m8FvAlG2t+ougqwDEyMzSj5tW5M+mU8TPT6AuqLua9QFwzF8qNN6Y8S49GbXSgDZw/RQVjO3BpyE19gslqDRt5QOF6bCwPT1+88DNpd7NGiThcgHpM2Ar/a2oS+w6EBhH3cqcxWgnB81JYWHEQDlaUvLjL0z0r+nOuc6PiD0d8tu5eq8ZAvlKu2kPvTlo3PuklLwafuuDFhDKRRDMK5x75a6rmklkw== 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=8zGLVVQauQlCHGeQs4z6JgK/HURbLr0fYidnILT7uGU=; b=UuuXsNjcqJ3V7nM6HIyBZYmJ3wQuMcWGXOHzM/7ahVjYZLbm7xTHSU8z3ugdBvqW/TOG56y/woaqR3QeCY6bhinKxvJ68fV0D4XMeH6Uy2bsRv8DUyzBHg40Jphq9pEjldDqvsESiNl4dMquENj68T1dWLZpO5o1bZkyJiY+KQxI4hC7VPHjlaHfIEKoTakY5AUsbY93Zh/Ie1uzQZWIzuFW0bx2+Cw+UXdElkNVB2SWb4IcU1vbKpYseyFuD0HjdzYb+Jfn9BZgPOzZOuRVtb/JQTNfw1YAXeMrzR3+H7ZftwyxFq3uekARwsTnfq9/GxRl61cnfaCEFbNwMVQjCg== 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 Received: from SN7PR11MB7139.namprd11.prod.outlook.com (2603:10b6:806:2a2::14) by DM6PR11MB4724.namprd11.prod.outlook.com (2603:10b6:5:2ad::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 08:57:53 +0000 Received: from SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::3c5d:f1d4:5462:8976]) by SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::3c5d:f1d4:5462:8976%5]) with mapi id 15.20.6064.027; Tue, 7 Feb 2023 08:57:47 +0000 From: "Ye, MingjinX" To: "dev@dpdk.org" , "Zhang, Qi Z" , "Yang, Qiming" CC: "stable@dpdk.org" , "Zhou, YidingX" , "Wu, Jingjing" , "Xing, Beilei" , "Yang, Guang3" Subject: RE: [PATCH v2] net/iavf: add check for mbuf Thread-Topic: [PATCH v2] net/iavf: add check for mbuf Thread-Index: AQHZNu4aaLYH5ga4YESlpKhegdAoK67DNZHQ Date: Tue, 7 Feb 2023 08:57:46 +0000 Message-ID: References: <20230131100653.336119-1-mingjinx.ye@intel.com> <20230202100350.668809-1-mingjinx.ye@intel.com> In-Reply-To: <20230202100350.668809-1-mingjinx.ye@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR11MB7139:EE_|DM6PR11MB4724:EE_ x-ms-office365-filtering-correlation-id: bee0ad08-1ee6-4ca4-b6a8-08db08e96220 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DUoe2p1LGxsdunFV9l97NxbZBu99Y0PF5PoLxM0f6yKz8WA4wp6O788UEEyWBnM0ieiTvU0iNhHAooiQqH30awwS8vCxIkX0k+vko1GHVL+Egc7rdN80eYCdgrgXD6p/oDOcePx1NraAEgfr0ZXkqQNjaiBZ3vfTnMKZ6bBlwnpuG1QHZvKEiX02McLY35tN3tRDaQts8BkPXuv5HxJec36Ey3PpMuthE5mjfRJBKVN5Ii7/QG+WAl9qaE0EL24Ycx5gAC1KynKbCk/LqYjGnYfPofleQ0BO/8DQg4daWvBRq4L404Kuo8eMWhWu6/BL3Atj2Ma9T6vCspYEKb5LEeJMPeue+Ss9Pzc5VzHKahm7C89JR8Nqnt+OllbXC6DXcInkW0Ul2WiSWf1xXufOIPT1IYhf/1vm9Q3Cn/j3o3vDN4y2qik77GoKb58znjpeMXTBGgVVun5qNbH6+rCdOStzaUJtxSBleq5qf1jDIV2EPN7ywlyfr7QukKpGAUsS8fHGSI4IqdrfiZ88nvYbOEbBR6rqHdopHLDmfqnJJqBcgkePXV53vidgFxhxIi2Rxle+cZYjGTyyyQ628oaAbgjqkekT/f7d6F8uErFS6u2WXaduHTvDJWUvCLitT06E56VrHds1zyp+Q8eGZadc+WF95w/RXM4XwBK1Wvz3/muk5PQeTlgWvLLNTXcQacRA4KcS5k4APDExm/6sj0Qxfw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7139.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(396003)(366004)(39860400002)(136003)(376002)(451199018)(33656002)(54906003)(6636002)(110136005)(26005)(186003)(86362001)(71200400001)(7696005)(55016003)(2906002)(76116006)(5660300002)(30864003)(66476007)(66446008)(64756008)(4326008)(66556008)(8936002)(41300700001)(8676002)(478600001)(9686003)(107886003)(53546011)(6506007)(82960400001)(38100700002)(450100002)(52536014)(66946007)(122000001)(38070700005)(316002)(83380400001)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?VXAzd2gzYlhkcE92VlJacmpubFRYaWM1ZUhMTGxLVlhNZkt2RjNVeG5B?= =?iso-2022-jp?B?TmFoV0FpV0szMzFLUXpoK2JYQ1N4Rm8wTThISFZTejFQL0o1Sll4bzZo?= =?iso-2022-jp?B?QVN2Tk5FTzBMemtYdTh3R1BuSGx6SE9jdVhMUWQzMnRjOThpalkzKzVO?= =?iso-2022-jp?B?Mitydi9YbjVCV1F0MXFzMzFHK3JCbkU2VjZYZmd2NDZQQ3lMVmpocnlo?= =?iso-2022-jp?B?dDI0REk1STBvcHlVTFdiZnZJWEswb0JYa3B1UE5QWUNQTXJxcTlXSGJH?= =?iso-2022-jp?B?NmlLY3E5OXlFQ2s0VVUvZ0xhUWJSZ2R6NDJmM0R4SkxmOEhMYU1Oc3Vv?= =?iso-2022-jp?B?WFM1Mi9EbWRJZTVGVXFoRjRtRHpXdCtia2hXVWZFZmdYR3V5T1VnNGsv?= =?iso-2022-jp?B?VS9VVldPV3NqUFVkNERCOG5ObnFjMXN4Zk9paDFqd0dhVTZSM1d6cDU3?= =?iso-2022-jp?B?dS91VnNyY1NSdWdNZlRXL2lITS90anVWY2hjYUw4NFlLcUVFcVNVZmZy?= =?iso-2022-jp?B?QThoK1l4RTNLVzgzRm1UYUdzU05VVzNNS1pYTHpNR1ZDTTZ1R20rSHd5?= =?iso-2022-jp?B?b1RMQVZtWWhSVlFSWFMrWUFJSUFkVnRqKzhFVkl4TWZGN2VMc2U5My9o?= =?iso-2022-jp?B?bXJoNEt3M0JvS0JLWmQyN05XVWpWWlFhT3dRRDJsUFZ6WVpuV3QxNEJI?= =?iso-2022-jp?B?cXpGM09VRkdGWUlWVlVIRUxSMTF0c0RRVEhtRmQvVXZVZWZoWHRCZitN?= =?iso-2022-jp?B?ZDhVMkdwdDJjRFlOL0gxSVY4eUhHK0orZzlObDVCREZKV1RudkZFSGcx?= =?iso-2022-jp?B?NmIrOFNscTBHZk1tQVVnTXBwYzg2aTdwby9Wem1YaUtPaDdWRk5GWTA4?= =?iso-2022-jp?B?NzJzcHZnWXlxYlNtSDc4OU5GVnc2aG5CTFdzMVNXYVNzcE1vWmtucG5x?= =?iso-2022-jp?B?UUExa051YXhMVFlLd0ZzMFBZZDNYZzM2akd3SzZpeHZwaFBrdis0a1c5?= =?iso-2022-jp?B?dzdRR2x0MDNrZHpjUWpOR0RtdjZiQmJ4V1RpTTJBZUx3bElqOTZtUHJv?= =?iso-2022-jp?B?RXlDbkc4RlFxWW5WYTBwU0FzMTVxU3ZYakpFLzVTTnlIQzkvU1p0SE1L?= =?iso-2022-jp?B?M282MW9VTG05QjZpd2xNSWJvYUZwYkNUOE9SZDVqRTFVR2RxWmZZeFBF?= =?iso-2022-jp?B?RzVwZWQ4bm42WDVPSXJJSnB1STRnWk42VUUvZU5zdFltNXg5VjhDYUxC?= =?iso-2022-jp?B?VmR2VkE4Q1BtUi9OMDA5ZWVteTg5MDZNUEFINktOMm1JVnVIUU5WczVE?= =?iso-2022-jp?B?UkVVYVlqUWVEZnVXdk1KcWwvOVdZbU5relhSRzhiQkl5TlBlbG9ZYlkw?= =?iso-2022-jp?B?c0FEZ0dONFl4MUFaQVpsTkM3cGhyZzZHNTVSSXBIdmFDc2VnN0tpUDR4?= =?iso-2022-jp?B?bzRBSkdpOWJMQXd5NGhyMC9CTXZqZ3FGN09ReEIyS2VtTjdBaDFKTjRa?= =?iso-2022-jp?B?dFlNWWdhZ2dPUTJDWi9tamJjWjAyYytWQ2NwVmVsb2FQQWx2RkxEZktj?= =?iso-2022-jp?B?RDBybiszOGRFcW1SVDhBUjVjWDJHZUtjdUM5dndrL0x6YVNUM1RnNFZi?= =?iso-2022-jp?B?aXNnVDRiSUJLZWFoOVRyZHplYzAzMkpsTmEyaUNGOUVNRTRJbEVESFMy?= =?iso-2022-jp?B?RlpZM2NGTnptWEx6cThEc1pqcis1cVR6VGljOWVBTWJ3U0ZEeXg1eUZp?= =?iso-2022-jp?B?Y1M3NVBQaW5od3BJcnZJVWdxSVN3UWJPQXJSOWZaQVB0b1B3YlZ1WlI3?= =?iso-2022-jp?B?Sjg2ZDlCUVRTQThBc1NyZTF4VHd3WnJjQ1JybkhDL2ZmN0xyUWQ0VU9U?= =?iso-2022-jp?B?U0x6cEdYcTBnOWhJbzdwemdHbXNMd0tJTW9QcEVLRSs0b1FnT1JUUFNN?= =?iso-2022-jp?B?VTVDamUvbGJwNUtUVFBYWDdEM29jOVo1VjZyNGlmMW5ndFM1QXhYTHRI?= =?iso-2022-jp?B?TTVGOFQrS0dWVXhHOGF3RTZtVW42T3hFRVNRUU1OS1JRTjN0V0FLV0lU?= =?iso-2022-jp?B?azAwQ1dBODUwWkNkNmN3Yk1tbnFNVXIyS1l5bHpFekFXUjNmSk4wOGcr?= =?iso-2022-jp?B?b3FYY2U4WlIrSUlGK1pCUVBOTWt0eG9XVmwyNXRkVTc3MVAyZGs0RVRy?= =?iso-2022-jp?B?alBoWmVUMnUwN2xrTUt5bGdTVVdUQ2RZME95K0pSL00xZXVwb0YwRTJF?= =?iso-2022-jp?B?R09NRWNBc0FQM3ZscWJGOTVBTldGMzV3NHkvdTYxRzZPb3ExRjhUM2w3?= =?iso-2022-jp?B?Q3pNNQ==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7139.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bee0ad08-1ee6-4ca4-b6a8-08db08e96220 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2023 08:57:46.9458 (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: h1p0NZNVM5Npy3ilrc7f46JDqo7PrO9BpqgLa6kVof/8FAYpSx4Te9RudZH44OzzuyDqX0mWOeiCHnwvq8QegQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4724 X-OriginatorOrg: intel.com 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 All, Could you please review and provide suggestions if any. Thanks, Mingjin > -----Original Message----- > From: Ye, MingjinX > Sent: 2023=1B$BG/=1B(B2=1B$B7n=1B(B2=1B$BF|=1B(B 18:04 > To: dev@dpdk.org > Cc: Yang, Qiming ; stable@dpdk.org; Zhou, YidingX > ; Ye, MingjinX ; Wu, > Jingjing ; Xing, Beilei > Subject: [PATCH v2] net/iavf: add check for mbuf >=20 > The scalar Tx path would send wrong mbuf that causes the kernel driver to > fire the MDD event. >=20 > This patch adds mbuf detection in tx_prepare to fix this issue, rte_errno= will > be set to EINVAL and returned if the verification fails. >=20 > Fixes: 3fd32df381f8 ("net/iavf: check Tx packet with correct UP and queue= ") > Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") > Fixes: f28fbd1e6b50 ("net/iavf: check max SIMD bitwidth") > Cc: stable@dpdk.org >=20 > Signed-off-by: Mingjin Ye > --- > drivers/net/iavf/iavf_rxtx.c | 647 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 647 insertions(+) >=20 > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c = index > 8d49967538..93138edf01 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -24,12 +24,55 @@ > #include > #include > #include > +#include > +#include > +#include >=20 > #include "iavf.h" > #include "iavf_rxtx.h" > #include "iavf_ipsec_crypto.h" > #include "rte_pmd_iavf.h" >=20 > +#define GRE_CHECKSUM_PRESENT 0x8000 > +#define GRE_KEY_PRESENT 0x2000 > +#define GRE_SEQUENCE_PRESENT 0x1000 > +#define GRE_EXT_LEN 4 > +#define GRE_SUPPORTED_FIELDS (GRE_CHECKSUM_PRESENT | > GRE_KEY_PRESENT |\ > + GRE_SEQUENCE_PRESENT) > + > +#ifndef IPPROTO_IPIP > +#define IPPROTO_IPIP 4 > +#endif > +#ifndef IPPROTO_GRE > +#define IPPROTO_GRE 47 > +#endif > + > +static uint16_t vxlan_gpe_udp_port =3D RTE_VXLAN_GPE_DEFAULT_PORT; > static > +uint16_t geneve_udp_port =3D RTE_GENEVE_DEFAULT_PORT; > + > +struct simple_gre_hdr { > + uint16_t flags; > + uint16_t proto; > +} __rte_packed; > + > +/* structure that caches offload info for the current packet */ struct > +offload_info { > + uint16_t ethertype; > + uint8_t gso_enable; > + uint16_t l2_len; > + uint16_t l3_len; > + uint16_t l4_len; > + uint8_t l4_proto; > + uint8_t is_tunnel; > + uint16_t outer_ethertype; > + uint16_t outer_l2_len; > + uint16_t outer_l3_len; > + uint8_t outer_l4_proto; > + uint16_t tso_segsz; > + uint16_t tunnel_tso_segsz; > + uint32_t pkt_len; > +}; > + > /* Offset of mbuf dynamic field for protocol extraction's metadata */ i= nt > rte_pmd_ifd_dynfield_proto_xtr_metadata_offs =3D -1; >=20 > @@ -2949,6 +2992,603 @@ iavf_check_vlan_up2tc(struct iavf_tx_queue > *txq, struct rte_mbuf *m) > } > } >=20 > +/* Parse an IPv4 header to fill l3_len, l4_len, and l4_proto */ static > +inline void parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct > +offload_info *info) { > + struct rte_tcp_hdr *tcp_hdr; > + > + info->l3_len =3D rte_ipv4_hdr_len(ipv4_hdr); > + info->l4_proto =3D ipv4_hdr->next_proto_id; > + > + /* only fill l4_len for TCP, it's useful for TSO */ > + if (info->l4_proto =3D=3D IPPROTO_TCP) { > + tcp_hdr =3D (struct rte_tcp_hdr *) > + ((char *)ipv4_hdr + info->l3_len); > + info->l4_len =3D (tcp_hdr->data_off & 0xf0) >> 2; > + } else if (info->l4_proto =3D=3D IPPROTO_UDP) { > + info->l4_len =3D sizeof(struct rte_udp_hdr); > + } else { > + info->l4_len =3D 0; > + } > +} > + > +/* Parse an IPv6 header to fill l3_len, l4_len, and l4_proto */ static > +inline void parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct > +offload_info *info) { > + struct rte_tcp_hdr *tcp_hdr; > + > + info->l3_len =3D sizeof(struct rte_ipv6_hdr); > + info->l4_proto =3D ipv6_hdr->proto; > + > + /* only fill l4_len for TCP, it's useful for TSO */ > + if (info->l4_proto =3D=3D IPPROTO_TCP) { > + tcp_hdr =3D (struct rte_tcp_hdr *) > + ((char *)ipv6_hdr + info->l3_len); > + info->l4_len =3D (tcp_hdr->data_off & 0xf0) >> 2; > + } else if (info->l4_proto =3D=3D IPPROTO_UDP) { > + info->l4_len =3D sizeof(struct rte_udp_hdr); > + } else { > + info->l4_len =3D 0; > + } > +} > + > +/* > + * Parse an ethernet header to fill the ethertype, l2_len, l3_len and > + * ipproto. This function is able to recognize IPv4/IPv6 with optional > +VLAN > + * headers. The l4_len argument is only set in case of TCP (useful for T= SO). > + */ > +static inline void > +parse_ethernet(struct rte_ether_hdr *eth_hdr, struct offload_info > +*info) { > + struct rte_ipv4_hdr *ipv4_hdr; > + struct rte_ipv6_hdr *ipv6_hdr; > + struct rte_vlan_hdr *vlan_hdr; > + > + info->l2_len =3D sizeof(struct rte_ether_hdr); > + info->ethertype =3D eth_hdr->ether_type; > + > + while (info->ethertype =3D=3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN) || > + info->ethertype =3D=3D rte_cpu_to_be_16(RTE_ETHER_TYPE_QINQ)) > { > + vlan_hdr =3D (struct rte_vlan_hdr *) > + ((char *)eth_hdr + info->l2_len); > + info->l2_len +=3D sizeof(struct rte_vlan_hdr); > + info->ethertype =3D vlan_hdr->eth_proto; > + } > + > + switch (info->ethertype) { > + case RTE_STATIC_BSWAP16(RTE_ETHER_TYPE_IPV4): > + ipv4_hdr =3D (struct rte_ipv4_hdr *) > + ((char *)eth_hdr + info->l2_len); > + parse_ipv4(ipv4_hdr, info); > + break; > + case RTE_STATIC_BSWAP16(RTE_ETHER_TYPE_IPV6): > + ipv6_hdr =3D (struct rte_ipv6_hdr *) > + ((char *)eth_hdr + info->l2_len); > + parse_ipv6(ipv6_hdr, info); > + break; > + default: > + info->l4_len =3D 0; > + info->l3_len =3D 0; > + info->l4_proto =3D 0; > + break; > + } > +} > + > +/* Fill in outer layers length */ > +static inline void > +update_tunnel_outer(struct offload_info *info) { > + info->is_tunnel =3D 1; > + info->outer_ethertype =3D info->ethertype; > + info->outer_l2_len =3D info->l2_len; > + info->outer_l3_len =3D info->l3_len; > + info->outer_l4_proto =3D info->l4_proto; } > + > +/* > + * Parse a GTP protocol header. > + * No optional fields and next extension header type. > + */ > +static inline void > +parse_gtp(struct rte_udp_hdr *udp_hdr, > + struct offload_info *info) > +{ > + struct rte_ipv4_hdr *ipv4_hdr; > + struct rte_ipv6_hdr *ipv6_hdr; > + struct rte_gtp_hdr *gtp_hdr; > + uint8_t gtp_len =3D sizeof(*gtp_hdr); > + uint8_t ip_ver; > + > + /* Check udp destination port. */ > + if (udp_hdr->dst_port !=3D rte_cpu_to_be_16(RTE_GTPC_UDP_PORT) > && > + udp_hdr->src_port !=3D rte_cpu_to_be_16(RTE_GTPC_UDP_PORT) > && > + udp_hdr->dst_port !=3D rte_cpu_to_be_16(RTE_GTPU_UDP_PORT)) > + return; > + > + update_tunnel_outer(info); > + info->l2_len =3D 0; > + > + gtp_hdr =3D (struct rte_gtp_hdr *)((char *)udp_hdr + > + sizeof(struct rte_udp_hdr)); > + > + /* > + * Check message type. If message type is 0xff, it is > + * a GTP data packet. If not, it is a GTP control packet > + */ > + if (gtp_hdr->msg_type =3D=3D 0xff) { > + ip_ver =3D *(uint8_t *)((char *)udp_hdr + > + sizeof(struct rte_udp_hdr) + > + sizeof(struct rte_gtp_hdr)); > + ip_ver =3D (ip_ver) & 0xf0; > + > + if (ip_ver =3D=3D RTE_GTP_TYPE_IPV4) { > + ipv4_hdr =3D (struct rte_ipv4_hdr *)((char *)gtp_hdr + > + gtp_len); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > + parse_ipv4(ipv4_hdr, info); > + } else if (ip_ver =3D=3D RTE_GTP_TYPE_IPV6) { > + ipv6_hdr =3D (struct rte_ipv6_hdr *)((char *)gtp_hdr + > + gtp_len); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); > + parse_ipv6(ipv6_hdr, info); > + } > + } else { > + info->ethertype =3D 0; > + info->l4_len =3D 0; > + info->l3_len =3D 0; > + info->l4_proto =3D 0; > + } > + > + info->l2_len +=3D RTE_ETHER_GTP_HLEN; > +} > + > +/* Parse a vxlan header */ > +static inline void > +parse_vxlan(struct rte_udp_hdr *udp_hdr, > + struct offload_info *info) > +{ > + struct rte_ether_hdr *eth_hdr; > + > + /* check udp destination port, RTE_VXLAN_DEFAULT_PORT (4789) is > the > + * default vxlan port (rfc7348) or that the rx offload flag is set > + * (i40e only currently) > + */ > + if (udp_hdr->dst_port !=3D > rte_cpu_to_be_16(RTE_VXLAN_DEFAULT_PORT)) > + return; > + > + update_tunnel_outer(info); > + > + eth_hdr =3D (struct rte_ether_hdr *)((char *)udp_hdr + > + sizeof(struct rte_udp_hdr) + > + sizeof(struct rte_vxlan_hdr)); > + > + parse_ethernet(eth_hdr, info); > + info->l2_len +=3D RTE_ETHER_VXLAN_HLEN; /* add udp + vxlan */ } > + > +/* Parse a vxlan-gpe header */ > +static inline void > +parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr, > + struct offload_info *info) > +{ > + struct rte_ether_hdr *eth_hdr; > + struct rte_ipv4_hdr *ipv4_hdr; > + struct rte_ipv6_hdr *ipv6_hdr; > + struct rte_vxlan_gpe_hdr *vxlan_gpe_hdr; > + uint8_t vxlan_gpe_len =3D sizeof(*vxlan_gpe_hdr); > + > + /* Check udp destination port. */ > + if (udp_hdr->dst_port !=3D rte_cpu_to_be_16(vxlan_gpe_udp_port)) > + return; > + > + vxlan_gpe_hdr =3D (struct rte_vxlan_gpe_hdr *)((char *)udp_hdr + > + sizeof(struct rte_udp_hdr)); > + > + if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto =3D=3D > + RTE_VXLAN_GPE_TYPE_IPV4) { > + update_tunnel_outer(info); > + > + ipv4_hdr =3D (struct rte_ipv4_hdr *)((char *)vxlan_gpe_hdr + > + vxlan_gpe_len); > + > + parse_ipv4(ipv4_hdr, info); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > + info->l2_len =3D 0; > + > + } else if (vxlan_gpe_hdr->proto =3D=3D RTE_VXLAN_GPE_TYPE_IPV6) { > + update_tunnel_outer(info); > + > + ipv6_hdr =3D (struct rte_ipv6_hdr *)((char *)vxlan_gpe_hdr + > + vxlan_gpe_len); > + > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); > + parse_ipv6(ipv6_hdr, info); > + info->l2_len =3D 0; > + > + } else if (vxlan_gpe_hdr->proto =3D=3D RTE_VXLAN_GPE_TYPE_ETH) { > + update_tunnel_outer(info); > + > + eth_hdr =3D (struct rte_ether_hdr *)((char *)vxlan_gpe_hdr + > + vxlan_gpe_len); > + > + parse_ethernet(eth_hdr, info); > + } else { > + return; > + } > + > + > + info->l2_len +=3D RTE_ETHER_VXLAN_GPE_HLEN; } > + > +/* Parse a geneve header */ > +static inline void > +parse_geneve(struct rte_udp_hdr *udp_hdr, > + struct offload_info *info) > +{ > + struct rte_ether_hdr *eth_hdr; > + struct rte_ipv4_hdr *ipv4_hdr; > + struct rte_ipv6_hdr *ipv6_hdr; > + struct rte_geneve_hdr *geneve_hdr; > + uint16_t geneve_len; > + > + /* Check udp destination port. */ > + if (udp_hdr->dst_port !=3D rte_cpu_to_be_16(geneve_udp_port)) > + return; > + > + geneve_hdr =3D (struct rte_geneve_hdr *)((char *)udp_hdr + > + sizeof(struct rte_udp_hdr)); > + geneve_len =3D sizeof(struct rte_geneve_hdr) + geneve_hdr->opt_len > * 4; > + if (!geneve_hdr->proto || geneve_hdr->proto =3D=3D > + rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { > + update_tunnel_outer(info); > + ipv4_hdr =3D (struct rte_ipv4_hdr *)((char *)geneve_hdr + > + geneve_len); > + parse_ipv4(ipv4_hdr, info); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > + info->l2_len =3D 0; > + } else if (geneve_hdr->proto =3D=3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { > + update_tunnel_outer(info); > + ipv6_hdr =3D (struct rte_ipv6_hdr *)((char *)geneve_hdr + > + geneve_len); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); > + parse_ipv6(ipv6_hdr, info); > + info->l2_len =3D 0; > + > + } else if (geneve_hdr->proto =3D=3D > rte_cpu_to_be_16(RTE_GENEVE_TYPE_ETH)) { > + update_tunnel_outer(info); > + eth_hdr =3D (struct rte_ether_hdr *)((char *)geneve_hdr + > + geneve_len); > + parse_ethernet(eth_hdr, info); > + } else { > + return; > + } > + > + info->l2_len +=3D > + (sizeof(struct rte_udp_hdr) + sizeof(struct rte_geneve_hdr) > + > + ((struct rte_geneve_hdr *)geneve_hdr)->opt_len * 4); } > + > +/* Parse a gre header */ > +static inline void > +parse_gre(struct simple_gre_hdr *gre_hdr, struct offload_info *info) { > + struct rte_ether_hdr *eth_hdr; > + struct rte_ipv4_hdr *ipv4_hdr; > + struct rte_ipv6_hdr *ipv6_hdr; > + uint8_t gre_len =3D 0; > + > + gre_len +=3D sizeof(struct simple_gre_hdr); > + > + if (gre_hdr->flags & rte_cpu_to_be_16(GRE_KEY_PRESENT)) > + gre_len +=3D GRE_EXT_LEN; > + if (gre_hdr->flags & rte_cpu_to_be_16(GRE_SEQUENCE_PRESENT)) > + gre_len +=3D GRE_EXT_LEN; > + if (gre_hdr->flags & rte_cpu_to_be_16(GRE_CHECKSUM_PRESENT)) > + gre_len +=3D GRE_EXT_LEN; > + > + if (gre_hdr->proto =3D=3D rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { > + update_tunnel_outer(info); > + > + ipv4_hdr =3D (struct rte_ipv4_hdr *)((char *)gre_hdr + gre_len); > + > + parse_ipv4(ipv4_hdr, info); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > + info->l2_len =3D 0; > + > + } else if (gre_hdr->proto =3D=3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { > + update_tunnel_outer(info); > + > + ipv6_hdr =3D (struct rte_ipv6_hdr *)((char *)gre_hdr + gre_len); > + > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); > + parse_ipv6(ipv6_hdr, info); > + info->l2_len =3D 0; > + > + } else if (gre_hdr->proto =3D=3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_TEB)) { > + update_tunnel_outer(info); > + > + eth_hdr =3D (struct rte_ether_hdr *)((char *)gre_hdr + > gre_len); > + > + parse_ethernet(eth_hdr, info); > + } else { > + return; > + } > + > + info->l2_len +=3D gre_len; > +} > + > +/* Parse an encapsulated ip or ipv6 header */ static inline void > +parse_encap_ip(void *encap_ip, struct offload_info *info) { > + struct rte_ipv4_hdr *ipv4_hdr =3D encap_ip; > + struct rte_ipv6_hdr *ipv6_hdr =3D encap_ip; > + uint8_t ip_version; > + > + ip_version =3D (ipv4_hdr->version_ihl & 0xf0) >> 4; > + > + if (ip_version !=3D 4 && ip_version !=3D 6) > + return; > + > + info->is_tunnel =3D 1; > + info->outer_ethertype =3D info->ethertype; > + info->outer_l2_len =3D info->l2_len; > + info->outer_l3_len =3D info->l3_len; > + > + if (ip_version =3D=3D 4) { > + parse_ipv4(ipv4_hdr, info); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4); > + } else { > + parse_ipv6(ipv6_hdr, info); > + info->ethertype =3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6); > + } > + info->l2_len =3D 0; > +} > + > +static inline int > +check_mbuf_len(struct offload_info *info, struct rte_mbuf *m) { > + if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { > + if (info->outer_l2_len !=3D m->outer_l2_len) { > + PMD_TX_LOG(ERR, "outer_l2_len error in mbuf. > Original " > + "length: %hu, calculated length: %u", m- > >outer_l2_len, > + info->outer_l2_len); > + return -1; > + } > + if (info->outer_l3_len !=3D m->outer_l3_len) { > + PMD_TX_LOG(ERR, "outer_l3_len error in mbuf. > Original " > + "length: %hu,calculated length: %u", m- > >outer_l3_len, > + info->outer_l3_len); > + return -1; > + } > + } > + > + if (info->l2_len !=3D m->l2_len) { > + PMD_TX_LOG(ERR, "l2_len error in mbuf. Original " > + "length: %hu, calculated length: %u", m->l2_len, > + info->l2_len); > + return -1; > + } > + if (info->l3_len !=3D m->l3_len) { > + PMD_TX_LOG(ERR, "l3_len error in mbuf. Original " > + "length: %hu, calculated length: %u", m->l3_len, > + info->l3_len); > + return -1; > + } > + if (info->l4_len !=3D m->l4_len) { > + PMD_TX_LOG(ERR, "l4_len error in mbuf. Original " > + "length: %hu, calculated length: %u", m->l4_len, > + info->l4_len); > + return -1; > + } > + > + return 0; > +} > + > +static inline int > +check_ether_type(struct offload_info *info, struct rte_mbuf *m) { > + int ret =3D 0; > + > + if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { > + if (info->outer_ethertype =3D=3D > + rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { > + if (!(m->ol_flags & RTE_MBUF_F_TX_OUTER_IPV4)) { > + PMD_TX_LOG(ERR, "Outer ethernet type is > ipv4, " > + "tx offload missing > `RTE_MBUF_F_TX_OUTER_IPV4` flag."); > + ret =3D -1; > + } > + if (m->ol_flags & RTE_MBUF_F_TX_OUTER_IPV6) { > + PMD_TX_LOG(ERR, "Outer ethernet type is > ipv4, tx " > + "offload contains wrong > `RTE_MBUF_F_TX_OUTER_IPV6` flag"); > + ret =3D -1; > + } > + } else if (info->outer_ethertype =3D=3D > + rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { > + if (!(m->ol_flags & RTE_MBUF_F_TX_OUTER_IPV6)) { > + PMD_TX_LOG(ERR, "Outer ethernet type is > ipv6, " > + "tx offload missing > `RTE_MBUF_F_TX_OUTER_IPV6` flag."); > + ret =3D -1; > + } > + if (m->ol_flags & RTE_MBUF_F_TX_OUTER_IPV4) { > + PMD_TX_LOG(ERR, "Outer ethernet type is > ipv6, tx " > + "offload contains wrong > `RTE_MBUF_F_TX_OUTER_IPV4` flag"); > + ret =3D -1; > + } > + } > + } > + > + if (info->ethertype =3D=3D > + rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { > + if (!(m->ol_flags & RTE_MBUF_F_TX_IPV4)) { > + PMD_TX_LOG(ERR, "Ethernet type is ipv4, tx offload > " > + "missing `RTE_MBUF_F_TX_IPV4` flag."); > + ret =3D -1; > + } > + if (m->ol_flags & RTE_MBUF_F_TX_IPV6) { > + PMD_TX_LOG(ERR, "Ethernet type is ipv4, tx " > + "offload contains wrong `RTE_MBUF_F_TX_IPV6` > flag"); > + ret =3D -1; > + } > + } else if (info->ethertype =3D=3D > + rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { > + if (!(m->ol_flags & RTE_MBUF_F_TX_IPV6)) { > + PMD_TX_LOG(ERR, "Ethernet type is ipv6, tx offload > " > + "missing `RTE_MBUF_F_TX_IPV6` flag."); > + ret =3D -1; > + } > + if (m->ol_flags & RTE_MBUF_F_TX_IPV4) { > + PMD_TX_LOG(ERR, "Ethernet type is ipv6, tx offload > " > + "contains wrong `RTE_MBUF_F_TX_IPV4` flag"); > + ret =3D -1; > + } > + } > + > + return ret; > +} > + > +/* Check whether the parameters of mubf are correct. */ __rte_unused > +static inline int iavf_check_mbuf(struct rte_mbuf *m) { > + struct rte_ether_hdr *eth_hdr; > + void *l3_hdr =3D NULL; /* can be IPv4 or IPv6 */ > + struct offload_info info =3D {0}; > + uint64_t ol_flags =3D m->ol_flags; > + uint64_t tunnel_type =3D ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK; > + > + eth_hdr =3D rte_pktmbuf_mtod(m, struct rte_ether_hdr *); > + parse_ethernet(eth_hdr, &info); > + l3_hdr =3D (char *)eth_hdr + info.l2_len; > + if (info.l4_proto =3D=3D IPPROTO_UDP) { > + struct rte_udp_hdr *udp_hdr; > + > + udp_hdr =3D (struct rte_udp_hdr *) > + ((char *)l3_hdr + info.l3_len); > + parse_gtp(udp_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "gtp tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_GTP` flag."); > + return -1; > + } > + if (tunnel_type !=3D RTE_MBUF_F_TX_TUNNEL_GTP) { > + PMD_TX_LOG(ERR, "gtp tunnel packet, tx > offload has wrong " > + "`%s` flag, correct is > `RTE_MBUF_F_TX_TUNNEL_GTP` flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + parse_vxlan_gpe(udp_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "vxlan gpe tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE` flag."); > + return -1; > + } > + if (tunnel_type !=3D > RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) { > + PMD_TX_LOG(ERR, "vxlan gpe tunnel packet, > tx offload has " > + "wrong `%s` flag, correct is " > + "`RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE` > flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + parse_vxlan(udp_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "vxlan tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_VXLAN` flag."); > + return -1; > + } > + if (tunnel_type !=3D RTE_MBUF_F_TX_TUNNEL_VXLAN) > { > + PMD_TX_LOG(ERR, "vxlan tunnel packet, tx > offload has " > + "wrong `%s` flag, correct is " > + "`RTE_MBUF_F_TX_TUNNEL_VXLAN` flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + parse_geneve(udp_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "geneve tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_GENEVE` flag."); > + return -1; > + } > + if (tunnel_type !=3D > RTE_MBUF_F_TX_TUNNEL_GENEVE) { > + PMD_TX_LOG(ERR, "geneve tunnel packet, > tx offload has " > + "wrong `%s` flag, correct is " > + "`RTE_MBUF_F_TX_TUNNEL_GENEVE` flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + /* Always keep last. */ > + if (unlikely(RTE_ETH_IS_TUNNEL_PKT(m->packet_type) > + !=3D 0)) { > + PMD_TX_LOG(ERR, "Unknown tunnel packet. UDP > dst port: %hu", > + udp_hdr->dst_port); > + return -1; > + } > + } else if (info.l4_proto =3D=3D IPPROTO_GRE) { > + struct simple_gre_hdr *gre_hdr; > + > + gre_hdr =3D (struct simple_gre_hdr *)((char *)l3_hdr + > + info.l3_len); > + parse_gre(gre_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "gre tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_GRE` flag."); > + return -1; > + } > + if (tunnel_type !=3D RTE_MBUF_F_TX_TUNNEL_GRE) { > + PMD_TX_LOG(ERR, "gre tunnel packet, tx > offload has " > + "wrong `%s` flag, correct is " > + "`RTE_MBUF_F_TX_TUNNEL_GRE` flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + } else if (info.l4_proto =3D=3D IPPROTO_IPIP) { > + void *encap_ip_hdr; > + > + encap_ip_hdr =3D (char *)l3_hdr + info.l3_len; > + parse_encap_ip(encap_ip_hdr, &info); > + if (info.is_tunnel) { > + if (!tunnel_type) { > + PMD_TX_LOG(ERR, "Ipip tunnel packet > missing tx " > + "offload missing > `RTE_MBUF_F_TX_TUNNEL_IPIP` flag."); > + return -1; > + } > + if (tunnel_type !=3D RTE_MBUF_F_TX_TUNNEL_IPIP) { > + PMD_TX_LOG(ERR, "Ipip tunnel packet, tx > offload has " > + "wrong `%s` flag, correct is " > + "`RTE_MBUF_F_TX_TUNNEL_IPIP` flag", > + rte_get_tx_ol_flag_name(tunnel_type)); > + return -1; > + } > + goto check_len; > + } > + } > + > + > + > +check_len: > + if (check_mbuf_len(&info, m) !=3D 0) > + return -1; > + > + return check_ether_type(&info, m); > +} > + > /* TX prep functions */ > uint16_t > iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, > @@ -3017,6 +3657,13 @@ iavf_prep_pkts(__rte_unused void *tx_queue, > struct rte_mbuf **tx_pkts, > return i; > } > } > +#ifdef RTE_ETHDEV_DEBUG_TX > + ret =3D iavf_check_mbuf(m); > + if (ret !=3D 0) { > + rte_errno =3D EINVAL; > + return i; > + } > +#endif > } >=20 > return i; > -- > 2.25.1