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 0834E45D41; Tue, 19 Nov 2024 10:18:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED5BD427D7; Tue, 19 Nov 2024 10:18:04 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mails.dpdk.org (Postfix) with ESMTP id 2E62F427C6; Tue, 19 Nov 2024 10:18:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732007882; x=1763543882; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=8kd7OxST1a/CcKp+sUZxLg8+oP6FeeEm97Zz3u4Ugy4=; b=D4ukSMLCwECTd2Du5jS56fmL1rMXMuHlN0BZXjZ0NW4i/bCb97G6AHDD ew2tG41wRd/4nbmeXBXX00h2gO0VD7M4DowNrtivGj+kCdYENodguPboz ItX9kMl/DRuY1pbv8aD0WxG13J03LO8/WhYeVpdi9rImkOW6cXfEPh/jS ifMbooH/y249reTPvLpQJuqLo8s2Lfpgrk6yqOGhA6SHIVEpwxsCXuDYZ 9MSfOCDR8xxjiJgDwP4mOlrV5UfwOI/XXC2+KRxldU6LjzRT/03HYJrkO FcYjcF57rDwCWDLmy3X2BYqx49bFCIzRprrb+Q3wHVEZE0QuDIFXKP4no Q==; X-CSE-ConnectionGUID: QYn6VqUDRiCebWCbI+7SBg== X-CSE-MsgGUID: uOoapq3hSQmA+bjprCNHJw== X-IronPort-AV: E=McAfee;i="6700,10204,11260"; a="31844080" X-IronPort-AV: E=Sophos;i="6.12,165,1728975600"; d="scan'208,217";a="31844080" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 01:18:01 -0800 X-CSE-ConnectionGUID: ZTrDfvKRRVSN/nfoiyl5Zg== X-CSE-MsgGUID: RP0UM38dQ/2cRZuHqQ2Akw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,165,1728975600"; d="scan'208,217";a="89886400" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 01:18:01 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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; Tue, 19 Nov 2024 01:18:00 -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:18:00 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.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:18:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S3G+V0pQ1JH4MSjiZtQRUYVs2eeBP0Bq7UhZ5dT7YESs6BBwIVRdjL2U5NRik1dqKUJ5TmrvF49MV6qG+lrDqAbgzY4dFUHew8swNpCug5U94BcL1+EP2PsTyd/FL8XZl14gKUYTt+K5lpyHRMtsTiCCvpCqX+TM7WEVObmsDL35653JkMsVCJ0cSZthO7g7gCukf1mmfN7h50hDMv942QNsT1RoUOBuXAlyUCi75RYUlALhMkULM6D1aHZLBuH1XIymWBKdatYJSf2E9D3Y+Ai7H+zG0pPk3U8bE62kL2Jc/ZaKVT0/U1Fb0VftfuhFScXRBL8ogtw1pnWSYclOVA== 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=D8iSDy9QQOtT8uPB8Hm6FhFHMv5+/D5NeCMT0zrY82o=; b=YC2AOgUNjga+EWtfzPxgdj6WYoW8WyX1YZEH929DJnsvSmdS/o0ifeznrR3LkY88VUiLlhe6AlpW6wCMOQXB8geeMmfO2knqMyc5Ehgkm0Sdri2BzrtYK/1/iVXKWp9AH7FviPmMoCcEW9YmodUuYHeb+nwGDY/jMBbRUj2MSY5BHSu2YTl/ViKumCfD8/lRsPZkAon9TgnC954iS53ogA3vyl8iw8LFcr2ktJfOW6LwSnjNVwwGrm7e9/HQFG7qNRTTdXFntrDEt1s7YqGxE3K0gLQk2Rqqn2x+ZlvuMlXhmOtoGZj+p5GatgzhPP5QRmM8MP7GhVkNpVC/EYclrw== 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 DM6PR11MB4610.namprd11.prod.outlook.com (2603:10b6:5:2ab::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24; Tue, 19 Nov 2024 09:17:57 +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:17:57 +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: AQHbNFi8OJIsjcDroEWBquhWYnlE2rKyWpSAgAwCIEI= Date: Tue, 19 Nov 2024 09:17:57 +0000 Message-ID: References: <20241111164221.3031276-1-bruce.richardson@intel.com> <1acab313-ba0a-4934-8183-624ab8a1cb07@intel.com> In-Reply-To: <1acab313-ba0a-4934-8183-624ab8a1cb07@intel.com> 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_|DM6PR11MB4610:EE_ x-ms-office365-filtering-correlation-id: 43b3b530-f191-427b-fa83-08dd087b0ec9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|8096899003|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?AXjPDn+scEwlFWVfdqKw7YHAotPwN+BUreklDsSadyGrmyS0hDwsHv5idL?= =?iso-8859-1?Q?Zk+hMJB5joYCp3OznydDQJnWB2Dt2NGvbZ/9Wbxgir37XjrExNgsZnUjHx?= =?iso-8859-1?Q?cg7oz8938J3g9JSlOZNL3SnIn+jxWsA+7haKkb6jVsYqpDy1eH6Sd659Gz?= =?iso-8859-1?Q?HBNVgQNvzUGifKXM3zoTKYq5MjyZOZqn+wLQYAQUrOv3juNzf58soxNJA5?= =?iso-8859-1?Q?du1y2vWdLBZVWkA8606GiNbeoa8ZaLXfCYiZ/BfZ41RXbl5JAAA6ipswdt?= =?iso-8859-1?Q?uSdfivTwUi7kiwd0fyGipqQNdaqXojzRvJzPRs+lJr4d0UN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08o0M9/DTELrLztqbpPMdcHatRfRDcqWdLQVcPp?= =?iso-8859-1?Q?kN35/gP+uvAh4MxlPFylHgJhmQ/kRNPw9O4PkzCjvM0yCGeAyImAb3d80N?= =?iso-8859-1?Q?XHBOb6KdnIlcotZm+b0FDtoSPKsEk7gyB8J1jQd9+x4X30NSNY+AdYFq+s?= =?iso-8859-1?Q?DBwKf1vSCJtqFM5hbBzlOv3x8LKrLZvbAqlKkPXvIdw7T8TSsap8E=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)(1800799024)(376014)(366016)(8096899003)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?jHW1K1j/LkNI6sSv/E76XPLPNB6EolaNK8CO0Xb8djhjVKktZF6dneSUim?= =?iso-8859-1?Q?u4LDVDQcXWiZRgnps484Sr3kxhiZyOQ1wktV6PSbO2D6FFMG+vdgLDD95u?= =?iso-8859-1?Q?x8VDGN9cBA2qfalaRLbkYPIjbbrUzcgyOtM1vDaRnljgxkHYDo89YdhlT0?= =?iso-8859-1?Q?Sih1/9hX9ZWfUcgLAP/KR2ysh3O43oBvkKYWmrkZfPJlOl0Ogm1vumj1k2?= =?iso-8859-1?Q?o1iNuWrvfFFfVUedV/FHWxy7wOuywpW2OwYH1BJHXGFdoI46gflqgXfHVC?= =?iso-8859-1?Q?OK9YRKIyTclK7qpMJCsSD3qPyTI7LzoZMwD6aP3piXkt/jeCmtvb0iyKX4?= =?iso-8859-1?Q?BxpjFmnL6dqmp084RYgzH/cXSQy+4Kh8wyGqZXT3a4qD6hiuqVs6q+jRWs?= =?iso-8859-1?Q?pLmjje2Cl47rzpF+9GsmpNJZ6qoBqdzFkaFL1KHXVAoNJnJA8L3f4ipA0R?= =?iso-8859-1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VItzFYpjtjmkQ+NoMLl?= =?iso-8859-1?Q?2ZpMVdKu7p+iCvBEQ7RJh095+4gRWIiw9QHRTXCPKevDj2y6lqWsjNlntT?= =?iso-8859-1?Q?z8m5afQjSv8OtG8T996Dx4zPWoCrFI4N/wnIGAvXjucWZDWcP9ExM1pc7u?= =?iso-8859-1?Q?4hAxAAbewcR+FnNXR0FdUueBBPKjZHSaXoLde+X/4FOC4VvAUOoxFnrRYs?= =?iso-8859-1?Q?sY2VALF7LitvMXfBUZOhzEe2CBj1kxFu8EsnVreInQWbTc05cxGCH2ToIS?= =?iso-8859-1?Q?RZuNhD18KCRX84uLWwWUOeVFK/fb5M6JD8kNeGuQeqIDX0b2p/Rbn3+A?= =?iso-8859-1?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_DS7PR11MB60158B50DDE23437F2B70E86D7202DS7PR11MB6015namp_" 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: 43b3b530-f191-427b-fa83-08dd087b0ec9 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2024 09:17:57.8515 (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: uBJL11SQYRwziP0kbd4WG79jNlMNughfUbsMa4No7t2bOnG27PdJYZzmftcJJkg9foiNb5u04WDKbivcpN7xf1giMfZqy3zuzAS6/YCxObg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4610 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_DS7PR11MB60158B50DDE23437F2B70E86D7202DS7PR11MB6015namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable ________________________________ From: Medvedkin, Vladimir Sent: Monday 11 November 2024 5:46 pm To: Richardson, Bruce ; dev@dpdk.org Cc: stable@dpdk.org ; Connolly, Padraig J ; Stokes, Ian ; Zhang, Qi Z ; Kevin Liu Subject: Re: [PATCH] net/iavf: add segment-length check to Tx prep 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 we > 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, struct= rte_mbuf **tx_pkts, > return i; > } > > - if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) { > + /* valid packets are greater than min size, and single-buff= er 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_DS7PR11MB60158B50DDE23437F2B70E86D7202DS7PR11MB6015namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable



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 the > packet length and ignoring the data length. For single-buffer packets = we
> 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 <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, str= uct rte_mbuf **tx_pkts,
>            = ;            return = i;
>            = ;    }
>  
> -           &nb= sp; if (m->pkt_len < IAVF_TX_MIN_PKT_LEN) {
> +           &nb= sp; /* valid packets are greater than min size, and single-buffer pkts
> +           &nb= sp;  * must have data_len =3D=3D pkt_len
> +           &nb= sp;  */
> +           &nb= sp; if (m->pkt_len < IAVF_TX_MIN_PKT_LEN ||
> +           &nb= sp;            =      (m->nb_segs =3D=3D 1 && m->data_len = !=3D m->pkt_len)) {
>            = ;            rte_err= no =3D EINVAL;
>            = ;            return = i;
>            = ;    }

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