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 0894645D41; Tue, 19 Nov 2024 10:54:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FA71427E3; Tue, 19 Nov 2024 10:54:42 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id A318D40268; Tue, 19 Nov 2024 10:54:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732010081; x=1763546081; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=GhqzXWhqMOcTEuK3VSm8l9lvx9WWNYzdvdmf3WMFuWw=; b=Hnjo3ykRK0kf8QrixnPMT6l1DwRJW4TiZ/fqDhp4tWGmRXyz1L2akKt1 dUA6+nEKvbdCuoOvATKsgOGS4fcDJ53aFifT9JrJbU8S/u7fKm4+I9g/C JCAkWv65AT1qNDG9dU9p++w/ZGn1M42bUwChjH5rLKzofgrkpAdTNlSPL FIhOcEUqCpYSpis4q/cWr8tf8Dn/viPzewEqbkzoDMiMeRrdyoLelV0/8 PI0umbW+Chc96maRgLK1fOJiGPVyz86T4f2sW00imVWaMFRZwhvJe8Fvc XYLub/C8u20fI8kt0b+lPj6ZYCpJzVLMk5XSgt3WLeh+40nWxXb7cKntm A==; X-CSE-ConnectionGUID: y1sTYdmOTdS4IoxM+EnwOg== X-CSE-MsgGUID: nivcs2uFRkaPHXB8Mejdlg== X-IronPort-AV: E=McAfee;i="6700,10204,11260"; a="32058624" X-IronPort-AV: E=Sophos;i="6.12,165,1728975600"; d="scan'208,217";a="32058624" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 01:54:40 -0800 X-CSE-ConnectionGUID: rtM99fy0Sr6beVxRi6ezXg== X-CSE-MsgGUID: HC/fEYwuR+agSum4d+FWLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,165,1728975600"; d="scan'208,217";a="89441334" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 01:54:39 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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.39; Tue, 19 Nov 2024 01:54:38 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 19 Nov 2024 01:54:38 -0800 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.44) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 19 Nov 2024 01:54:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZYTbbQToshOoJoTWSILPjREVcwdg+MqAnASBIYZvcbGcGT8HPDpbbQOtXJkSKZDdZkiFh1XPCI8OByBCZDR/zzZKBCuFf+lv/NvRNDxDBqr+xV5UgDZWhkfHGePGhc5XQ7yPtEgKSW4gKOByS8EimkEvdvYXNEK7/duJVCfrbpHL7mKrjc7/t14VBbOCMAZKzaPrKL8D/R3Xg/IrW7fw5hujIpWuWSPu7QfTGsvv2d4aFACSsOWTlEnCCAchLshd4RPR1nDRY1dEj4BZhTjLbkgNUjG4UHByS+85yz7faUXpYGnyb8weyRAQUWHuyNkHTKzn1qUR3plTn2yny/BzGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=AbwoFlJ1izO4Aa5gGQL4iq5jugbrQIlr8nRYL71OLCU=; b=bKfixigsnh0oN9NVhALZ8zxIZ2GqaIvSG7LnXMFJQD9KDVpqgu64epqgi+XTxkCEHrGwLsS+6SVP3DXekLpd3jIJsXT6nRcWcpTCoMEPi0Mn4IM4c2h5Chh9pnAiNrkgsoZrS4ZHRKkBUMdAbmJj5EiblOnb4+PokdONbpnlnC2PZik74yoeKHcoJ9WggHNZGfFJBVtkg6PQnh9c7rw5vL60Vb6ywrmPjGMHK9O9i+IfH3/QEF3WsqGpbiTx+1aj7A53zwqog5mE3TgzeJ7Ot9R0r9OJkMali0WXyA+wXxpiOtJIRLv4d0qFMFsfJAL/h15kzWH+CmKa6pppF4Vjzw== 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 DS7PR11MB6015.namprd11.prod.outlook.com (2603:10b6:8:74::17) by BL1PR11MB5319.namprd11.prod.outlook.com (2603:10b6:208:31b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 09:54:34 +0000 Received: from DS7PR11MB6015.namprd11.prod.outlook.com ([fe80::ee9:9647:c9d:a7e0]) by DS7PR11MB6015.namprd11.prod.outlook.com ([fe80::ee9:9647:c9d:a7e0%4]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 09:54:33 +0000 From: "Connolly, Padraig J" To: "Medvedkin, Vladimir" , "Richardson, Bruce" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Stokes, Ian" , "Zhang, Qi Z" , Kevin Liu Subject: Re: [PATCH] net/iavf: add segment-length check to Tx prep Thread-Topic: [PATCH] net/iavf: add segment-length check to Tx prep Thread-Index: AQHbNFi8OJIsjcDroEWBquhWYnlE2rKyWpSAgAwCIEKAAAuu/A== Date: Tue, 19 Nov 2024 09:54:33 +0000 Message-ID: References: <20241111164221.3031276-1-bruce.richardson@intel.com> <1acab313-ba0a-4934-8183-624ab8a1cb07@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-IE X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: 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: DS7PR11MB6015:EE_|BL1PR11MB5319:EE_ x-ms-office365-filtering-correlation-id: b8cb3be6-9dab-4bd7-325e-08dd08802bbd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|8096899003|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?3iix2M02FNVL6IKuQ/XJHKrb55uq1RrL+dkrgROxA6/p99W4wuSotO4bKI?= =?iso-8859-1?Q?RXqgzEgvvbtSWxnrgQZ1uVoTd/jKzBWQcikBwx/Lqs145SDqk0pv4P16dD?= =?iso-8859-1?Q?aIEOsTWbBaajr4jSgffRGbKGewzucXcjOt/prAeUSt3ZfwwQEvHHNDPBgh?= =?iso-8859-1?Q?79wz6CSc4HmwVdO3Cj9Od8eFk53toeObxz6DikxRoQyEO/w3f6qPDkZ+vB?= =?iso-8859-1?Q?bjjkImdYv1Q4fjPAg78Vz1PyQnh8ELXPqpfJzZVASnl9ZFg0SSj6ecK8uN?= =?iso-8859-1?Q?nTnqv6RhHglgQXhq/WboefWyVo+9uhJcJRjClrKIlS9c+5KTDO0EI0erbj?= =?iso-8859-1?Q?9+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xxng9jab73P7MYF?= =?iso-8859-1?Q?02VA8/+AQpPMDDC99fn81R9NTySrvr5UdPHJtpOeKwa+uTWER5HriuHunz?= =?iso-8859-1?Q?oeG5Z69iw45/Tb8xlKCqy7SjWhk/JJ/fsT0P6/qRdSQb6T18da/f0MhYVy?= =?iso-8859-1?Q?iIMAYUEpLwLTaNm1ZyOlkH+vPRA9xx+3GJ7d74f0UiDCdh12MpGCo=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR11MB6015.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(8096899003)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?dgQ/GbcD5sN4VIY0tfIE3c+Un5RNE4p8YAoGpUpu4izK/Ur4j7t4R8+5cn?= =?iso-8859-1?Q?iYVU72MSeiUKMwVord+EC2m2aReviYTOmfMEsu+4PzVVMAui4kDGKKplcM?= =?iso-8859-1?Q?RWxDH4MvQt+aAdytPlzBalJydND6VqJL8q+iGHeMUt3s5vBPWp9TScLDVH?= =?iso-8859-1?Q?aoMk54KsQWUtRS2jRkSIlEKagddg/R6szDKHUns7/BEoM5UomZdu4DWhMK?= =?iso-8859-1?Q?rjI313JcHS10LPrMN9KU0nZkZ8drSEE1ymgxtBFgD6jzR86UGOxdgVMSQ1?= =?iso-8859-1?Q?D02lQHqIw6LOZN/v/l/MUbOi9l4ZfAxbnz48neWv/SCUfAC1rWQiWJn0RC?= =?iso-8859-1?Q?8NUZEXe5jqxlb3Vtv1DTPK3omDujljpX/8Torw3f77i7DU18DjHRREQKDo?= =?iso-8859-1?Q?TL2cCp6RJsqV9s/nKG4ShwHoIMG9Yk5xEwouzPf1focbWZHT1HWhphl5P6?= =?iso-8859-1?Q?ODZ+AlXalZhUempNz4NOCglejCHdoJc/8VAAEm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0LuJsabYiduUlzy+QgvtfvkDk7m1JAaekH?= =?iso-8859-1?Q?reJjJTw6dGqcZE66TLf8ZZwEUpwKu2YFrGlayCwmltIDoD6wnzWyrbuvxw?= =?iso-8859-1?Q?A+OTm7sminDRA/eI8Xvneq7yYS8oRhjTQN3NBCQ5GveF578k4boi4oSETu?= =?iso-8859-1?Q?2JHB4hYOnSyCgFY8qlsh04kojNPkNmY/TWOM7P/NAl+KcJHFajgXNN/e5r?= =?iso-8859-1?Q?ogW6eB79wIHx0J6XS7qOBu+aFIWE/HGsw4lyieYIFT9iyxngbKisnqbA?= =?iso-8859-1?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_DS7PR11MB60150DB22F2F19EFF6999019D7202DS7PR11MB6015namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB6015.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8cb3be6-9dab-4bd7-325e-08dd08802bbd X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2024 09:54:33.8498 (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: 3/MxUeDVge7DN7vCDRyf3TmaWIpYVc8NONe4EBIYAi+sY7uug0OAH5+vHb4BQbVa7/yCq4OoXI1cvge/prAxqcaButvfgAENZju/4GckNRA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5319 X-OriginatorOrg: intel.com 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 --_000_DS7PR11MB60150DB22F2F19EFF6999019D7202DS7PR11MB6015namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Tested-by: Padraig Connolly > Acked-by: Vladimir Medvedkin >On 11/11/2024 16:42, Bruce Richardson wrote: > > In the Tx prep function, the metadata checks were only checking the > > packet length and ignoring the data length. For single-buffer packets w= e > > can quickly check that the data length is the packet length. > > > > Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes") > > Cc: stable@dpdk.org > > > > Reported-by: Padraig Connolly > > Signed-off-by: Bruce Richardson > > --- > > drivers/net/iavf/iavf_rxtx.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.= c > > index 4850b9e381..6a093c6746 100644 > > --- a/drivers/net/iavf/iavf_rxtx.c > > +++ b/drivers/net/iavf/iavf_rxtx.c > > @@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue, stru= ct rte_mbuf **tx_pkts, > > return i; > > } > > > > - if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) { > > + /* valid packets are greater than min size, and single-bu= ffer pkts > > + * must have data_len =3D=3D pkt_len > > + */ > > + if (m->pkt_len < IAVF_TX_MIN_PKT_LEN || > > + (m->nb_segs =3D=3D 1 && m->data_len !=3D = m->pkt_len)) { > > rte_errno =3D EINVAL; > > return i; > > } -- Regards, Vladimir Tested-by: Padraig Connolly --_000_DS7PR11MB60150DB22F2F19EFF6999019D7202DS7PR11MB6015namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

 Tested-by: Padr= aig Connolly <padraig.j.connolly@intel.com>
&g= t; Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

>On 11/11/2024 16:42, Bruce Richardson wrote:
> > In the Tx prep function, the metadata checks were only checking t= he
> > packet length and ignoring the data length. For single-buffer pac= kets we
> > can quickly check that the data length is the packet length.
> >
> > Fixes: 19ee91c6bd9a ("net/iavf: check illegal packet sizes&q= uot;)
> > Cc: stable@dpdk.org
> >
> > Reported-by: Padraig Connolly <padraig.j.connolly@intel.com>= ;
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>= ;
> > ---
> >   drivers/net/iavf/iavf_rxtx.c | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf= _rxtx.c
> > index 4850b9e381..6a093c6746 100644
> > --- a/drivers/net/iavf/iavf_rxtx.c
> > +++ b/drivers/net/iavf/iavf_rxtx.c
> > @@ -3677,7 +3677,11 @@ iavf_prep_pkts(__rte_unused void *tx_queue= , struct rte_mbuf **tx_pkts,
> >           =              re= turn i;
> >           =      }
> >  
> > -          &nbs= p;  if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
> > +          &nbs= p;  /* valid packets are greater than min size, and single-buffer pkts=
> > +          &nbs= p;   * must have data_len =3D=3D pkt_len
> > +          &nbs= p;   */
> > +          &nbs= p;  if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
> > +          &nbs= p;            &= nbsp;     (m->nb_segs =3D=3D 1 && m->data= _len !=3D m->pkt_len)) {
> >           =              rt= e_errno =3D EINVAL;
> >           =              re= turn i;
> >           =      }

--
Regards,
Vladimir
Tested-by: Padraig Connolly <padraig.j.connolly@intel.com>
--_000_DS7PR11MB60150DB22F2F19EFF6999019D7202DS7PR11MB6015namp_--