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 3BCFD432B3; Mon, 6 Nov 2023 02:41:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92517402D9; Mon, 6 Nov 2023 02:41:02 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 1BDA74025D; Mon, 6 Nov 2023 02:40:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699234859; x=1730770859; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qaXUoFq60+DfhRWAweq7FsDUMOFgUpCyD8F+PDW5E0Q=; b=IOhwiLqoCzi7VY/QNKxlFxFlf/ljLiaVueWvGofXcPCk9hOVZodpA4Rt 0HPQR4uW4Atht6HifWpaIrZjJEzKmf5V6nxd7EAWd6/PPEXdxPvSYO+g2 mLXloHlwTTf+XbGjlpiPPoENoJMBQQBAT5etDAj7pBpDMOr2p8GmM3Bpi myDk9l2ki0Bt8QDyZTN3wFSVFR0F70B2t9WxsZMX1VW4EdhXGMTXPZve/ t6pgUv7BNzBqWEhpoxhgz6f1vEtTAAbuXmV7dt6Gs8cm1kTHS98l3CzU3 o/9C6g4raYMwCSF0wLlkhcL6+mcsVqY+1+rnJSG92O8vQRFOJWr0RO9q/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="455674939" X-IronPort-AV: E=Sophos;i="6.03,279,1694761200"; d="scan'208";a="455674939" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2023 17:40:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="712058953" X-IronPort-AV: E=Sophos;i="6.03,279,1694761200"; d="scan'208";a="712058953" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Nov 2023 17:40:58 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.34; Sun, 5 Nov 2023 17:40:57 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sun, 5 Nov 2023 17:40:57 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.34 via Frontend Transport; Sun, 5 Nov 2023 17:40:57 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) 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.34; Sun, 5 Nov 2023 17:40:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoKEjEOgx/sfueNvv8v8msvpLfICy6XPmY7oM+M2RuabWowsglG6j0hVAzqqIQulK/FCn7kRsz0fOrJXzdZCzofn4pLafhUi+nj69f5UVn6Aq65CW3/EKlx9GcsXx+pzK6axXQkSDnwsKOi78ETLA5wff23qSQ6hwyRrwz3YfJnj7RmFn9f2lllma1khPRXOIz9O5BUuCJX2tD4G+l08cHEkra9115yLvkLVSuzyDBSWdyCG6NcCHkw8EeNBgK3BEXD+IS2QJepLiRnLPuArQu7ubNj7fHhjEA0e71/qP6qxQqMWMTgdx3go6+SIOjCtVacJN+tzLXp6dy3Syg0ueg== 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=+qnvrbVKAJSHJmAOkReOxb48cMXAuccgGzNdIOLfw5U=; b=UipRxIG3aID7Dq8xwYSEk++MOi5NzyIbotn0hxae176473hjkRCtiwGJEvO+MKmoTgQ5D/khpf1GIcFpY/7jvTKtPL5OYEqUSysr6RJXPKQs11S4B2rOQYbb183FrgfCttMLAtFW4WevvZF+sSIKXLZNzBKrmyJZS3W/qahk3wng8srMWs8X1tpJ9CsNeHNxrn9yoEg5DtevNVRWsWg7LbanbHFeiAaPb0kaO27cSWq/Q4eSBu6LHL1jg/9N1SuRm8eWVqcbBdycBeLB2cUqXUkAiFoLykAsaA2bSljHozRzQJZxoa9/9cCAj+ZXwT/HEw2ngGDOpKYWI1ZsQgSlyA== 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 DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 01:40:52 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::62e2:b53a:6a07:f136]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::62e2:b53a:6a07:f136%6]) with mapi id 15.20.6954.024; Mon, 6 Nov 2023 01:40:51 +0000 From: "Zhang, Qi Z" To: "Yang, Qiming" CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/ice: fix Tx preparation Thread-Topic: [PATCH v2] net/ice: fix Tx preparation Thread-Index: AQHaDVIRBTiSVofQvECacEGMv6C/+LBmlI6AgAX1UqA= Date: Mon, 6 Nov 2023 01:40:51 +0000 Message-ID: References: <20231102101213.1446007-1-qi.z.zhang@intel.com> <20231102142207.1510973-1-qi.z.zhang@intel.com> In-Reply-To: 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: DM4PR11MB5994:EE_|MW4PR11MB5872:EE_ x-ms-office365-filtering-correlation-id: 6d20f7e0-91a4-48d7-98c5-08dbde69690d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: G067YmNcV6/kRJNX13zpedP/37EKQyrNyHdZE9SMJdcuRYlAmuGUDqY2u69PSJpZimtrS67k0V4PrUTHb5SZ54TiklihTdlS8q5KxpqYfJ4Zxslr9QOR8rT/T6JMmUxmbx9YoU/IqYq9R29wmZUDYeKDrAvEg9ViruVUX+2Juhonettr/YfbvFpO7K8VKAmlArmPdXyjyiLTGnJc+zRuXw6Uk5XkMP36rj+IXDCv0h/ypYHRz1WTdRt9nF9LAm6sz+sjSjAkwvApUL+tPYvJMKvsgYiJOgQeWiOA79iMMcJZYFD9dWgBLJo8fUxrwpIgZ4luz8zj0LpUVhds85lfnbTtkRJmyh0bXfWQCG6JeWAjTdSk8LgxmB6s/kPT4TTo4hy56eUGCKoInju1PArH2anvQvN5EmUmD88XU4Ga1rUuix/L4hgkD/hhdJ68nS/sOBWdF74ieShxDR2R07Awnjtnd2EwWSKt0wm+/rmutggIV3N67oUkwp4R/IqANfF/9P3dUzrIy0ECfW1z0RjF4xbUMXFPWHIGJPzQcarRdWZxxdnwe9Cn+vAGHsl9IzJlZ7TSX+CpooGND0g9F02KxPxwbpdNFHAqlY11/FYOC8pT7QXlZejCzrr3qZP7ped2 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(136003)(39860400002)(396003)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(41300700001)(5660300002)(8936002)(52536014)(450100002)(6862004)(4326008)(2906002)(478600001)(8676002)(55016003)(6636002)(64756008)(54906003)(66556008)(66476007)(66446008)(66946007)(76116006)(86362001)(38070700009)(26005)(71200400001)(6506007)(7696005)(9686003)(53546011)(122000001)(82960400001)(33656002)(83380400001)(316002)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?u1tUPIg9h+S1dsmKqrwPZAPpOjQzqjC8FLlfBDZUgnV6m1UTwkOZAAqG22d2?= =?us-ascii?Q?qCC6CZw2+WqJg7azbPQ1f5nXxVQG3suopi7hiJ/hOe5fcl+XytIg0Rc0smhC?= =?us-ascii?Q?ov2fIdjmrZydCNvd10ePRsGoMvRu4Z5pW6aEasfksQrzVTuMYut1XGHQib2m?= =?us-ascii?Q?2C05+snw3fUcREHqQ/o0TFFH1FkCn8lBY+YC81HMU4Ipq7AZFkbUzckQS0cd?= =?us-ascii?Q?Mq+e4nX2ofXUQDv4y2zi/e41LEXlg4yEGcET3C1h3KSSPNTMNoof5G6QtuqA?= =?us-ascii?Q?NLfX7RMVlhe+Ypt0Vm3fPY1k9tynGyDVrKZc1qer/wb7je7LjcnJZSZRsuJL?= =?us-ascii?Q?gpOmo5fokGAUPSvUh0IEGyBnawaLe4hMcTzXAHRXig+pkjWWPbaI3MScbLAa?= =?us-ascii?Q?87jhwqxHeH5zIKQGBdO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Wnb3AN3?= =?us-ascii?Q?d8kA5+jon7bOYSX9b+MoMM91ZSYLOVBE8hql97+gPKkfeIIEMpI0nF6YhKsg?= =?us-ascii?Q?7MY6ur0cK7GcmO6skYMnfDT5v1wOP03sQK3Hk12Gv3AWJ5FNrHpXkMNlmUnn?= =?us-ascii?Q?c0DcElhrxRQhQXb17Qg0mLPG/MRqFjomD5XOKQzMBF7NijEuwD5eOAHGOGFg?= =?us-ascii?Q?u9zFCAE3r7ValWw6WfRJSoWbgBdhMs4lUkyyGPYSGIOBgCrHkOwyaX1ej9L1?= =?us-ascii?Q?FAtZZ2S42w9go0wIwut+WlcvH0PVSAvlaG5/jYJf?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d20f7e0-91a4-48d7-98c5-08dbde69690d X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2023 01:40:51.8202 (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: Sywq+3LU+oe88Go033n6eqja9KmAnvJHxQ0PVwrzNnOQ3IF77XWzlT17xZ2ojtd1fGLBPdBNSSbjqNGjPcol5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB5872 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 > -----Original Message----- > From: Yang, Qiming > Sent: Thursday, November 2, 2023 2:41 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; stable@dpdk.org > Subject: RE: [PATCH v2] net/ice: fix Tx preparation >=20 > Hi, >=20 > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: Thursday, November 2, 2023 10:22 PM > > To: Yang, Qiming > > Cc: dev@dpdk.org; Zhang, Qi Z ; stable@dpdk.org > > Subject: [PATCH v2] net/ice: fix Tx preparation > > > > 1. Check nb_segs > 8 for NO TSO case > > 2. Check nb_segs > Tx ring size for TSO case 3. report nb_mtu_seg_max > > and nb_seg_max in dev_info. > > > > Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") > > Cc: stable@dpdk.org > > > > Signed-off-by: Qi Zhang > > --- > > drivers/net/ice/ice_ethdev.c | 2 ++ > > drivers/net/ice/ice_rxtx.c | 18 ++++++++++++++++-- > > drivers/net/ice/ice_rxtx.h | 2 ++ > > 3 files changed, 20 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ice/ice_ethdev.c > > b/drivers/net/ice/ice_ethdev.c index > > 6ef06b9926..3ccba4db80 100644 > > --- a/drivers/net/ice/ice_ethdev.c > > +++ b/drivers/net/ice/ice_ethdev.c > > @@ -3918,6 +3918,8 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct > > rte_eth_dev_info *dev_info) > > .nb_max =3D ICE_MAX_RING_DESC, > > .nb_min =3D ICE_MIN_RING_DESC, > > .nb_align =3D ICE_ALIGN_RING_DESC, > > + .nb_mtu_seg_max =3D ICE_TX_MTU_SEG_MAX, > > + .nb_seg_max =3D ICE_MAX_RING_DESC, > > }; > > > > dev_info->speed_capa =3D RTE_ETH_LINK_SPEED_10M | diff --git > > a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index > > ee9cb7b955..73e47ae92d 100644 > > --- a/drivers/net/ice/ice_rxtx.c > > +++ b/drivers/net/ice/ice_rxtx.c > > @@ -3679,7 +3679,7 @@ ice_check_empty_mbuf(struct rte_mbuf > *tx_pkt) } > > > > uint16_t > > -ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, > > +ice_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > > uint16_t nb_pkts) > > { > > int i, ret; > > @@ -3690,9 +3690,23 @@ ice_prep_pkts(__rte_unused void *tx_queue, > > struct rte_mbuf **tx_pkts, > > m =3D tx_pkts[i]; > > ol_flags =3D m->ol_flags; > > > > - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG && > > + if (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG) && > > + /** > > + * No TSO case: nb->segs, pkt_len to not exceed > > + * the limites. > > + */ > > + (m->nb_segs > ICE_TX_MTU_SEG_MAX || > > + m->pkt_len > ICE_FRAME_SIZE_MAX)) { > > + rte_errno =3D EINVAL; > > + return i; > > + } else if (ol_flags & RTE_MBUF_F_TX_TCP_SEG && > > + /** TSO case: tso_segsz, nb_segs, pkt_len not exceed > > + * the limits. > > + */ > > (m->tso_segsz < ICE_MIN_TSO_MSS || > > m->tso_segsz > ICE_MAX_TSO_MSS || > > + m->nb_segs > > > + ((struct ice_tx_queue *)tx_queue)->nb_tx_desc || > > m->pkt_len > ICE_MAX_TSO_FRAME_SIZE)) { > > /** > > * MSS outside the range are considered malicious diff > --git > > a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index > > 268289716e..bd2c4abec9 100644 > > --- a/drivers/net/ice/ice_rxtx.h > > +++ b/drivers/net/ice/ice_rxtx.h > > @@ -56,6 +56,8 @@ extern int ice_timestamp_dynfield_offset; > > > > #define ICE_HEADER_SPLIT_ENA BIT(0) > > > > +#define ICE_TX_MTU_SEG_MAX 8 > > + > > typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq); > > typedef void (*ice_tx_release_mbufs_t)(struct ice_tx_queue *txq); > > typedef void (*ice_rxd_to_pkt_fields_t)(struct ice_rx_queue *rxq, > > -- > > 2.31.1 >=20 > Acked-by: Qiming Yang Applied to dpdk-next-net-intel. Thanks Qi