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 C3CAF43269; Thu, 2 Nov 2023 07:41:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10CE540691; Thu, 2 Nov 2023 07:41:33 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D85B540282; Thu, 2 Nov 2023 07:41:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698907291; x=1730443291; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=K2fa1nMEFW2sFQk2+uBr/lhm1rEaA1aqOoeshzZyegg=; b=JN5B9ukd3WkW0w1KLm3+DVRDjMjp8DnHcjotQNdOT8EkWVsVqT5N/Xmx E6uefZpa9zoadqvEdRRewJvaL8qUwbKfYFyBOFvBOJdvZgrSg5ltsaNXU kzSBfhjE15b1vDvGn3LwL+ClUnrYij1xD3WWhotqfy400vqzKPaQkZaM8 IBuWJQbbsgSorASRcE420eEz5BC7zv0UQ0JrihPDlk/WnEV87pTy53ozP A3DMnsmmZO1h+Jwxd1XvjoXCXfJeE2BKbU1oxfJfffWr0r6/oF0vOTygR +TZY12nxtBWCbasXrBdjl68WpCSQ7XWdOyifOUIK9ZhH0ibqnuigOW4jE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10881"; a="379043044" X-IronPort-AV: E=Sophos;i="6.03,270,1694761200"; d="scan'208";a="379043044" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2023 23:41:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10881"; a="764814650" X-IronPort-AV: E=Sophos;i="6.03,270,1694761200"; d="scan'208";a="764814650" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Nov 2023 23:41:29 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 1 Nov 2023 23:41:28 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Wed, 1 Nov 2023 23:41:28 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Wed, 1 Nov 2023 23:41:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U6Re1x4Y12oXi6BZAqkugJvdTP/LwwthI2iOVgX0oF/nm0kweg5MD2jmK9c69NDn9gtP+LVESSeiK5veZuUbh9QMpq3WiKBpsiCrPIx3tNJwnlppams62fBHewrWzLhZzp9uwjmTjM1dSh15RI9jxJF3pE+69J6qPdTKmQyQXDHGmrQiC6vUiMbLYJTvxzLmnBB/+/gMGmWPq2grmVafJbRiZd7rYt4GyIlWDre7yL830mLCfHA0Ceu91O/5ZNg4t4nvzVqt+nfCwwQfLlnyl6Av1vlIppWxO7TNaeb24hRxbrRaZdOAIlNl8YC/ahNQUDZfrudSexAmzSnlPjeZZw== 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=+/AB1PMsf53Ds6pZAiCYUtki5JGcI3j4t5sDIP5X3NY=; b=G93OlSLThptKVgRksUtZoEsLw4me83PD+0I84bX44NyKDJUnuEmoeFXO7MaPN0yXMGJ1QQgqdnGX6UkNeivithTUQvvhIkgHzn43zG8QKR6Z+EymlaDWMJkoFrHLvUSUhK6f+CoD/fPzLJ8EhMqoWD6KNRz1ek4kfQFfGbbfmMfiglQkLZPl9Tw9x3G4W3Av4kx5RSlviD7QBwYrRp8jMk9uFDV11gNvmpLzEzUqWQZI1VEyL5/VDqaKITqhWcKBI0+ycVBTulTgbuLffRplq/XVRkoHTnfwCBlezp7CiKFZCVHoZNbBlIgx52ZvRGSCaI8DHgCbC47Gz6aFgtlTXw== 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 CH0PR11MB8086.namprd11.prod.outlook.com (2603:10b6:610:190::8) by CY8PR11MB7083.namprd11.prod.outlook.com (2603:10b6:930:51::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 06:41:26 +0000 Received: from CH0PR11MB8086.namprd11.prod.outlook.com ([fe80::4aeb:f1:461:2f1f]) by CH0PR11MB8086.namprd11.prod.outlook.com ([fe80::4aeb:f1:461:2f1f%3]) with mapi id 15.20.6933.024; Thu, 2 Nov 2023 06:41:26 +0000 From: "Yang, Qiming" To: "Zhang, Qi Z" 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: AQHaDVIRDoYIkGEo4kKEalNigPJbKLBmlGYQ Date: Thu, 2 Nov 2023 06:41:25 +0000 Message-ID: References: <20231102101213.1446007-1-qi.z.zhang@intel.com> <20231102142207.1510973-1-qi.z.zhang@intel.com> In-Reply-To: <20231102142207.1510973-1-qi.z.zhang@intel.com> Accept-Language: en-US, zh-CN 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: CH0PR11MB8086:EE_|CY8PR11MB7083:EE_ x-ms-office365-filtering-correlation-id: cccce459-2cd7-4c01-41e5-08dbdb6ebc83 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j7Pt2R/f6cUx4abYW69oQNZ1S7PYOq15bZboPYRmDrsXW6OufRU342k7ZEiZXf1jfKTp2iHv7h6pl+mpOfGQmjMpfwI9GMOgJmONu3scGOeeDN6UEdJuSGJX8GbxUq2BrmmFXq4wpQHd6fuwtqjdDYKJrFeJqI8EpGFwFGZPbNNvro9gnL8fuabI9J4MJ9NvsZuHPddJ+Pi25/4xeJs1SEJ6ql4XxvxZL0Kw33eGGZBsIO6ihs+Zo+sOyoKPNC+o31fS9F9kzvbWfzrk95tQO8uzdY4LWmqP3L7KMwiXKwG3XVy4hvbV9M8OEndq9t7/sxi9uzS7flsA+C+qE61ayEWFocnI9/iUBguu0vaO+DFGPlvToi/LLbYDkos6Ez90CoA4xUuuWn01VrrTkO1z3HZeZhnDtXRpqrTz+xY+gTCR17qeyZUnlIGEz5Xg9WCE11ckkwKnX4sJ1lN+By91DOlTgk51FA5HNgH6VohLtHLZFqOUiDFLEDgcFnAxpHEdokr4x6fTiinzXkBtimcxJ5If6pN1eMG/pCRUjbD88jbJdNOghdGgmxNaSKU3vx4TLkEmiGQazu/H8IzPoeTeZZc6qU7aFhFb5/Ps8s+T70KXcLxG1iw3OsWO0STDxQ4c x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR11MB8086.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(39860400002)(346002)(376002)(396003)(366004)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(2906002)(38100700002)(5660300002)(122000001)(86362001)(82960400001)(41300700001)(55016003)(33656002)(9686003)(76116006)(66946007)(26005)(64756008)(6636002)(66446008)(316002)(66556008)(54906003)(66476007)(71200400001)(53546011)(7696005)(478600001)(6506007)(83380400001)(38070700009)(52536014)(8936002)(450100002)(6862004)(8676002)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3iUBl9st5pg4hzXZmPYVaqS5zwuyRT40mXbMH1sX8ZTLPiyImylMJHtHqvah?= =?us-ascii?Q?+xhgz6JZ10q6RUzYw179hX2XZChXJwPDki0AT54tEONvvXNgiYH0KDWevGzQ?= =?us-ascii?Q?OePoTZl7fHYbLuTvqwhLv5ZC026aG5I8IEW28OqwinAjU917mgIfiAncKEqs?= =?us-ascii?Q?dMrrJq7AtQsABbH/e1/Kaf4NIT0iHJtNQt1OvSPKymUeO7SJDOAfVLzT5WFj?= =?us-ascii?Q?fH64S5hi+EJuWLP/kz4oOR9zfvvppkahZFQ+ISf97CPZQxPfV0/PptMzANC/?= =?us-ascii?Q?mfERC/u4W/0V7awG5LcM0ZjWBtp5dwhupQAGlAmR6qazLeQ4flJ9Oo8siywl?= =?us-ascii?Q?89Y6m76aiH2LjZ2cn9c9jb+kmy0bX3hghbFiwMJxKaBHpSMO8xQBeZ6QAROe?= =?us-ascii?Q?2i01otcaLtHhCLnIUUb2L/pYEdEXoI7Omn8gptFHV3Ij2D7jg7FYTOTDIlRE?= =?us-ascii?Q?evaeaCkWKeVWnZtqNeduZjIu0M8X7PUbWRy+0tKKaO2KxMpyCWWCH26Nn/8C?= =?us-ascii?Q?KKQBvehJ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aa6fB49B6jeRlJhcZx/VN?= =?us-ascii?Q?ukn+IxqDvhgahjGkiuHUqm5bny7MWqiIqRWZH3xd8NDq13YFzj51NhwiS7wH?= =?us-ascii?Q?2cXLsiS8T8fEnJ29v6V99rX4rvLbBtqs1bpijfjcFHNxftpHoqF/Hn/EX4b1?= =?us-ascii?Q?njJ4h3yJRiyKvXgb/ygXzqP+EUROsjQPXuCcrGc2?= 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: CH0PR11MB8086.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cccce459-2cd7-4c01-41e5-08dbdb6ebc83 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2023 06:41:25.8047 (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: SUFbPguND1n/ppBU7Xs2q0yTBvWAfqMyO12i4cXrxx+JM8FsukMx0f2FgpvRTnllhIpmghbT6+VWRmnQWrkvUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7083 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 Hi, > -----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 >=20 > 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. >=20 > Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") > Cc: stable@dpdk.org >=20 > 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(-) >=20 > 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, > }; >=20 > 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) } >=20 > 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; >=20 > - 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 inde= x > 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; >=20 > #define ICE_HEADER_SPLIT_ENA BIT(0) >=20 > +#define ICE_TX_MTU_SEG_MAX 8 > + > typedef void (*ice_rx_release_mbufs_t)(struct ice_rx_queue *rxq); typed= ef > 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 Acked-by: Qiming Yang