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 ACBE2A0542 for ; Fri, 11 Nov 2022 09:30:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 969174014F; Fri, 11 Nov 2022 09:30:47 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8FC4840143; Fri, 11 Nov 2022 09:30:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668155446; x=1699691446; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vVjQWXlUI43UtoyCsnQ0SSY9LlyyQtoJa7+KiBOMyeA=; b=bUvmeqB59XvtjSzm4E/1aL5uyoQGLZzrW02Zr5KY73Or2yTKSwntihbJ NUMLhkXJjyKgbMwm+q04n4pYqPaLco+vf7x6k9Ggr9EqPi+5cTEQ05SBw VV88z4jy+RAIRbTpyW6QGV+Y8meAggoihU7+iyI+So+1yDrlbuUmEC1FQ X5JwHsvUqTfyAvUqQK96vxXlIvkWTtQdFicTZ0ArVk1mNFhi881DcZ8b1 0us/Wi2AzFifKELxJ/m83iOkU/YUWRBwgolX1yd9U260Zpg8ZPn7wAApX /QG0z5gPlz/6Zq9ZQMmfc3AqvfGOsylO3X9TRYSrNYf9brSlULOLfyRNb g==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="312701805" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="312701805" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 00:30:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="966752831" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="966752831" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga005.fm.intel.com with ESMTP; 11 Nov 2022 00:30:44 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2375.31; Fri, 11 Nov 2022 00:30:43 -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.2375.31 via Frontend Transport; Fri, 11 Nov 2022 00:30:43 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) 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.2375.31; Fri, 11 Nov 2022 00:30:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJZmx3Q3qsaTuKQhvevijT3Okps1B0Y0KTcai/n0pWhfJIFIONmsASIg4dtqUQBfKFGQn3Zmau/RkZ3tU8i6cYBKHo0/hY4iuEQzxiISxce37fdA3qZcQYukTuCQ1m7TfaN2P98cigLBR/ySAbrEptIJNUfNBh00GPKbxCfkZfqYmd9sTNU4sZrm735j1zskpMfxLO8jgT2Hk3QaXcu15eWPoIIWRJmaowg2GxUT6VN6TSziZydxtAlnH9j09oi7v253lSnbkEmXwBGJfDJIgEuImxnGKSUclDEo2XXoI5UrlM28U7wDyyT8Hb+joA9KnWUxZm9aNZvWfPG7wBvz/A== 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=mY256pP0Lr2qLS9/ARrn6kqug6MQfvUxaVdwQA1NIdo=; b=LO5JncY9fo/x0Aa5bgmew8gpu/OkbfxYAdNTpwET6U6HCsPhHlL4hB+4yv4V1CJm99g0VuKSy7Xu4XfcgFbmYln4M6EwXo1y7LUk31QAGu4gjvjqWveZ/+9E5V0QIevOK58qanzoy5fYsqvlQ1tjhEEi4HjDzQncS3hFnxHJEHFPgQuZfblYLw8AVRLwC2Au5JWhRrGPJWtbpQnmV/S6wxTlBJIUKC7H3KJo3V+9cn05kLOp0+vA3h7RZQDY444uuY9vXaXLVuLQxa3HQdKbk6PhPh6x3kxTzFmqLLvrZyqmb9M/panZSurZ9KiEuGFK3DFwvHQMG7nxDhyCOI1HsA== 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 CH0PR11MB5537.namprd11.prod.outlook.com (2603:10b6:610:d4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 08:30:40 +0000 Received: from SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::10d6:ef9:4e14:bab9]) by SN7PR11MB7139.namprd11.prod.outlook.com ([fe80::10d6:ef9:4e14:bab9%3]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 08:30:40 +0000 From: "Ye, MingjinX" To: "Zhang, Qi Z" , "dev@dpdk.org" CC: "Yang, Qiming" , "stable@dpdk.org" , "Zhou, YidingX" , "Wu, Jingjing" , "Lu, Wenzhuo" , Ferruh Yigit , "Li, Xiaoyun" , "Liu, KevinX" Subject: RE: [PATCH v3 2/2] net/ice: fix scalar Tx path segment Thread-Topic: [PATCH v3 2/2] net/ice: fix scalar Tx path segment Thread-Index: AQHY9YR+xFVBwqrxLE6uqmPZCN7qVK45LGQAgAAwv6A= Date: Fri, 11 Nov 2022 08:30:40 +0000 Message-ID: References: <20221109125609.724612-1-mingjinx.ye@intel.com> <20221111120401.802805-1-mingjinx.ye@intel.com> <20221111120401.802805-2-mingjinx.ye@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: SN7PR11MB7139:EE_|CH0PR11MB5537:EE_ x-ms-office365-filtering-correlation-id: 70ee5e26-df61-4442-ee2a-08dac3bf0444 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ErWvrwQbSdrhLoqcDUfXYSHJbq1w06BE6xrziQZwtcxz/fe9JJzFFeoVedBtsY4Uw2070RNgjqSSaStSPAcXNBIB36yMajOFsJYcljFEwwBue650shltqKC5OA0J9mrfky0FY9ZQ7iN+WKoVdNKCmdmSDYcmWEDYjFgH/O3CYPvnUFKVDotODWU23N6fZJ8I1tmkrMWBdOtADL86RyK0vJRAq0mIDe1vKonBNldJJtP3nT7aEkpUA8Dg7llhSe3e/AYqvkEVzplDAVDA1vtGWasJsm+9U96OgHBobcQEC2yDVg3D/8WLJnJ0Ar7/sq6bjjNohBN62QhG2peTSgNfTWeCChtIe9w8GStQHDE/i6HMldF6Ipqw4pvKe0WLZhwNXsxKLcg/Jb7cOY6Txbf+BmBMSqfTh3MfBwwcWyPZ542+1QoqwVJrSfKpHJB1qf5PgUqy+LVtkmugErEphOAB928cT9uQEtmcVTnRqVOnc4NlTmd2EqQSN2MB5kfM4G4ZO7Bc09WwYWabhfnuoQlUv4ZxqA847s4tt38OddyO11wy/qM3A5lMitwqCqITdq7tXiAs+TwUBu4iYKc9Uder4JO9hYGlYT2F0y44s10Q51nT+ucPLN3fAy4I9dXFihy4nPADbOSotP8pcQLf2jUCQzGICGNW8gYgqqHIGK0WUGCugPEEtqA9s7n1/AQKzAye7tstGYDvO3dezW4v2/SE+KAv/yzpYgIT1DwEwgtGICs9jhTP4POwk4IBu06AD3F1582luCsdpThxfIT5uV6JfQ== 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:(13230022)(396003)(346002)(39860400002)(366004)(136003)(376002)(451199015)(4326008)(5660300002)(86362001)(2906002)(52536014)(8936002)(38070700005)(66446008)(82960400001)(66476007)(8676002)(64756008)(66946007)(122000001)(450100002)(76116006)(186003)(41300700001)(83380400001)(38100700002)(110136005)(71200400001)(107886003)(316002)(54906003)(26005)(478600001)(9686003)(53546011)(66556008)(6506007)(7696005)(33656002)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?eE0zanZENnp6aW15d0RCMVA5ZktsNUgzQUdpM0NQbzcrZnh3WXhmUy9V?= =?iso-2022-jp?B?VStDUG55Sngra1ZrdkxWdXd6MmJnNzFERGNoVkdsZkU4bVBkREJ3cmRW?= =?iso-2022-jp?B?RXN0VFM0dTRFOEN3TE9TS3dTY3BObnFIYnYzbmlXdkhnaWNmeUJNWGs3?= =?iso-2022-jp?B?MHVPa3ZZUU9EaW8wbWdaOTZnR0I3ZW1KUWxRR0FDbjU0aHlCUXByeUNT?= =?iso-2022-jp?B?dXpzOE9yYk02Uk5lNnZUODdueGh2cUQ3dkk2SWlMNVlUTklCaUdjVlJX?= =?iso-2022-jp?B?YW5iZlAzeXY3VmVZTEdIVVBwVHFOR3l3OHdHcElpT2lNVis5WmpJMFZT?= =?iso-2022-jp?B?cndKb1crd01mTjVLbE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Ca0IyRUJ0NzBs?= =?iso-2022-jp?B?TkxkQWVuV2M3ZUM1SUd0SHFQQ2pXMUJnSFFnQVpyWWJCS3M4aDFqdWRB?= =?iso-2022-jp?B?aVpWejc3K2lZeDhDNEZPMHJOQVBFeGgrakY4MGdaNnc4RWlzUlZtZmUy?= =?iso-2022-jp?B?cTQwWQ==?= 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: 70ee5e26-df61-4442-ee2a-08dac3bf0444 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 08:30:40.3986 (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: jQBTp0lUDeDO5dZC8v99/W4Hku5NsLhwjH2hKum1LE09TNFf5tnslflfb/rXuih6MnZy3tynmnbSA9e/SGlqDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5537 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 > -----Original Message----- > From: Zhang, Qi Z > Sent: 2022=1B$BG/=1B(B11=1B$B7n=1B(B11=1B$BF|=1B(B 13:09 > To: Ye, MingjinX ; dev@dpdk.org > Cc: Yang, Qiming ; stable@dpdk.org; Zhou, YidingX > ; Wu, Jingjing ; Lu, > Wenzhuo ; Ferruh Yigit ; Li= , > Xiaoyun ; Liu, KevinX > Subject: RE: [PATCH v3 2/2] net/ice: fix scalar Tx path segment >=20 >=20 >=20 > > -----Original Message----- > > From: Ye, MingjinX > > Sent: Friday, November 11, 2022 8:04 PM > > To: dev@dpdk.org > > Cc: Yang, Qiming ; stable@dpdk.org; Zhou, > > YidingX ; Ye, MingjinX > > ; Zhang, Qi Z ; Wu, > > Jingjing ; Lu, Wenzhuo ; > > Ferruh Yigit ; Li, Xiaoyun > > ; Liu, KevinX > > Subject: [PATCH v3 2/2] net/ice: fix scalar Tx path segment > > > > The scalar Tx path would send empty buffer that causes the Tx queue to > > overflow. > > > > This patch adds the last buffer length judgment in tx_prepare to fix > > this issue, rte_errno will be set to EINVAL and returned if the last bu= ffer is > empty. > > > > Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") > > Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes") > > Cc: stable@dpdk.org > > > > Signed-off-by: Mingjin Ye > > --- > > drivers/net/ice/ice_rxtx.c | 24 ++++++++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c > > index e6ddd2513d..69358f6a3a 100644 > > --- a/drivers/net/ice/ice_rxtx.c > > +++ b/drivers/net/ice/ice_rxtx.c > > @@ -3643,6 +3643,22 @@ ice_set_tx_function_flag(struct rte_eth_dev > > *dev, struct ice_tx_queue *txq) > > #define ICE_MIN_TSO_MSS 64 > > #define ICE_MAX_TSO_MSS 9728 > > #define ICE_MAX_TSO_FRAME_SIZE 262144 > > + > > +/*Check for invalid mbuf*/ > > +static inline uint16_t > > +ice_check_mbuf(struct rte_mbuf *tx_pkt) { >=20 > Better to name the function to exactly match what it does. > e.g.: ice_check_emtpy_mbuf > and also declare it as inline. will optimize. >=20 > > + struct rte_mbuf *txd =3D tx_pkt; > > + > > + while (txd !=3D NULL) { > > + if (txd->data_len =3D=3D 0) > > + return -1; > > + txd =3D txd->next; > > + } > > + > > + return 0; > > +} > > + > > uint16_t > > ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, > > uint16_t nb_pkts) > > @@ -3653,6 +3669,7 @@ ice_prep_pkts(__rte_unused void *tx_queue, > > struct rte_mbuf **tx_pkts, > > struct ice_tx_queue *txq =3D tx_queue; > > struct rte_eth_dev *dev =3D &rte_eth_devices[txq->port_id]; > > uint16_t max_frame_size =3D dev->data->mtu + ICE_ETH_OVERHEAD; > > + uint16_t nb_used; > > > > for (i =3D 0; i < nb_pkts; i++) { > > m =3D tx_pkts[i]; > > @@ -3689,6 +3706,13 @@ ice_prep_pkts(__rte_unused void *tx_queue, > > struct rte_mbuf **tx_pkts, > > rte_errno =3D -ret; > > return i; > > } > > + > > + if (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG) && > > + ice_check_mbuf(m)) { >=20 > Why "!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)" is needed here? > A empty mbuf with TSO enabled is still acceptable? Should not be expected to be implemented in test-pmd, should detect. >=20 > > + rte_errno =3D EINVAL; > > + PMD_DRV_LOG(ERR, "INVALID mbuf: last mbuf > > data_len=3D[0]"); > > + return i; > > + } > > } > > return i; > > } > > -- > > 2.34.1