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 674BFA0543 for ; Fri, 11 Nov 2022 06:09:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DF8840F16; Fri, 11 Nov 2022 06:09:14 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id C254B400EF; Fri, 11 Nov 2022 06:09:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668143352; x=1699679352; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=IBuxS4f+rZrskiwqHHNPPH9fLMnvCdHViTRUf19ku2I=; b=QhjKfGJJDJLnZUQVwXLCvPtP/QaJhk/2gTiiMSrwstar8CXVTr78wog5 7LvwBwIDWgW8l2FzRhWO0BTw6o7wy4yqCf5ihMGPuegc2u74Im0u4knOJ DEU6uHRDW0Pv8dQ+oTuRThXrQMaRrAcTXMqmzjP7WYgbXA+r+XVjKKN43 Wpf+TAZij68uffhQwnicVQYYqNjdCeFYm4IUyNg9JBofc+/bhOuPCRhxd iWGVXL+g+mJC4hc0kwSmc80i+LzfobAtitqZIwEsVvW/MZEyDCAVi2Sa1 uFtaEYqW+MOkY98KtO8RzI948fXreEQf4y7bQ0xO7OvpPZJI8rsnXUHlD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="338292758" X-IronPort-AV: E=Sophos;i="5.96,155,1665471600"; d="scan'208";a="338292758" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 21:09:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="882643298" X-IronPort-AV: E=Sophos;i="5.96,155,1665471600"; d="scan'208";a="882643298" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 10 Nov 2022 21:09:10 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 21:09:09 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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; Thu, 10 Nov 2022 21:09:09 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 10 Nov 2022 21:09:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MwINANG8l/qskIOK2qCF6o9kVCQKbJSt2jDPRNu+rQ2t73JTNSYW/hsNBqCQBPMyqMFfE3ChWiSJfavBIH6JDhjMPikJTFwIujxaS/0jsbw3q927F3S3cW3EMEtRoJk/RPL9hIean3YkUA5sITO1soZiibDiNAknY2f0cUJiJ8L/g3As3+B5uWIatk5rxUuM6sLOkZcxgTPVYHDb9NDOSoDb1E9+m9egXF4ev+CQHrw1XqM68ygl0Qy0s0SeXLF6roRy1vjx7SnH4+S1wyGR3cGQ4nWDg0r13BgetGdsETlGI8FObfxNFT1Jv8GfvO15gmXeNet2DJg+wDxmqkVeCA== 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=ESas1U1T9a2Nb3Wt0TenBAYfTQ3N+SN4o7SoKOOzVDc=; b=Dx9fXyPLWLBhMzs5Q/sb6WGPCmQyJXM8nZ00SBlb5XY0qtN2iBvU36nOv3rTx8juuxWFyStP3YtAg1++ktwLUe/e4dZ0n/CYJRb4qo6BGd4ueWhqDqsapQJ1evQkmLFNkYVa+reRbHt/vYSY8yeESXSstpO7dfUwmYs6mTFAGzgMmEj96w9O1RHUf70JkliXQTCGTTbR9phvtA91LZfec+sx5HpJ/3FKHQdFApBEWsVnKNYJMxFLkrT9O4YuYDFYBhH8x76JJ6yscEpKOG9vzdrDC0t0GDy/TSSi2CTfPqq+KzNzrhkFtvouN+O6sTo181YnHB90DduuPZMRjUN9aA== 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 SA2PR11MB5082.namprd11.prod.outlook.com (2603:10b6:806:115::5) 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 05:09:02 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e2ac:cde3:4d74:3fa7]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e2ac:cde3:4d74:3fa7%3]) with mapi id 15.20.5791.025; Fri, 11 Nov 2022 05:09:02 +0000 From: "Zhang, Qi Z" 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 Thread-Topic: [PATCH v3 2/2] net/ice: fix scalar Tx path segment Thread-Index: AQHY9YR+RJh4fdpEdEa6hyG0xntkVa45Kwnw Date: Fri, 11 Nov 2022 05:09:02 +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: <20221111120401.802805-2-mingjinx.ye@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows 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_|SA2PR11MB5082:EE_ x-ms-office365-filtering-correlation-id: 3c829582-9467-4d09-dc2c-08dac3a2d955 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nNXee30kwGHc+IzE9wrUL5k0R9AacGZogLrH6z24MnY+qYtR69gizT4EK2FE3yo2JkJYr2sn7Hinbr6xonWc0t2WYBVN2wAISgIE1q/qyfYPe2A/McNRrcgmX+f910VTR0s4OcN51CrBFARKgvcUnygNmswEiN7czmZPpvPwPAT65UwXDY9xit5cCM2daA96MoL1nyIh5zSvTYjyRPb8rpEfRB2x+s9YQzNyxRmt8EWYJmG2M7V4HgwtQPncW4LD4GqEbJ4whU4iSRhMMXlM733Tmd8Jq8QLBryPwCqJK5xQY4JQwHxe7mSAMhM6H49iNoKr8F2YTJNlTEDJ0tGYH3m/F+NU8R+PdhJUUf/MRefL0Tm9SLSi3rC+JjT9N+cEQK9Rzgj0/J0WPxaA/umwyXII7zNXJbM3dqPn8IYUbkQjBl/njh1b7golN1ZbxVaLp1nDwtSeytVnNMSW3kbkfghagSFspjYkDe6biUd2b7EEv46BB2iH1PV9Ag6gKxnhyyA6pIQmyoKKR1ESz83ptkwUyR8tVOH2PBA9tqgxhKm94MVNN0KSuQW4mazw2UautiAYkg2D7rtfvlUc1qcyIA5enJvQQofcswZ+6imHn/EvtTLjimL0KHddSWn6IPU+dzMvm1rMSPPT45IY8O9IHmravUvNv2eI27sYwCJ13Tw0r1QuC+ULExXDn6wcmjohkovEzSqxIvNEn8Qb/OrN8USpDsJWU9lwpmmfma0bmFpQvk+Vj4Z662Uuiiz56lvnslyOZuBA4GSIXN+qR3Xk6g== 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:(13230022)(39860400002)(136003)(366004)(396003)(346002)(376002)(451199015)(38070700005)(316002)(110136005)(54906003)(82960400001)(52536014)(71200400001)(478600001)(38100700002)(64756008)(8936002)(83380400001)(122000001)(26005)(107886003)(55016003)(9686003)(33656002)(41300700001)(76116006)(2906002)(53546011)(86362001)(66476007)(450100002)(8676002)(5660300002)(66556008)(4326008)(66446008)(186003)(7696005)(6506007)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wyBeP3HxV4ZLi5kbTv5FUpWNl/3GMRlibI8DhtOoCl+a6vYwJS7WB3CypcA8?= =?us-ascii?Q?3p4jxCyfalp7oxo4/YpMEps8IqnMpiAxZYFIl4t0wo6CV3RTur/3A7uFgB/T?= =?us-ascii?Q?zvjT27dWB5GriiqArMqLpZo2QebMe/uSCVxlqKoXCU+cq+YxLRB5j6ZPMGIT?= =?us-ascii?Q?u2rQOecBGsg1M55PMkhAo5O9Bj3JfVvjfsKrcJccIzLJBPU2JW82virHtopd?= =?us-ascii?Q?AqSbSlweba4LvLpGQb4lcCbXVP/I2+8d4ap+afAgHoQ0p9UAxhjNWZu/4806?= =?us-ascii?Q?HhsUcg3Peso00+wI4ga+lo+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A?= =?us-ascii?Q?ZcdcTEcX2I3VBJ4SiYbot+7KE5pXn18EOZjxLvvpb2Wci9ahoghflQeKJwoz?= =?us-ascii?Q?b2bnFpxFSRfjx4xMKe1vOxGt3yLYqC+hmgPl/EoTwRVx7T7jx9rkM7nDRjcM?= =?us-ascii?Q?/bMNC+fSQknGUyCTEx6ibdA97eWO15x9OOz25qgSME7D4GPQ/dDKmgeT3bMc?= =?us-ascii?Q?Fyxuu3HTaK/GPXyAq72DhWbIwnMrVHlbYO3Ddj5xGu3hrFsBNpVFCO51cUF1?= =?us-ascii?Q?UgR98uISthHkORwTMS+EopAv3b/qNj0KPdV9VID5bLGymTWfg86YdF/Q7RzV?= =?us-ascii?Q?wcPcWlNzx84zJtI2Kkl+1yKTRXqjR6qspR+Ge+hB/sBIhA0uKcfGhjmUWo1t?= =?us-ascii?Q?o+I1UvQ88o43ODKPF7gcjz1WW5NDKUp1Ca/9REGU?= 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: 3c829582-9467-4d09-dc2c-08dac3a2d955 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 05:09:02.4262 (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: 4OwWPsQ6mSrOaL2QAvCDxE+5uXTpERQD1bCbf418rgS9adVcB9saePy4Espwf98umTwM9mYnVHh6S7F44D0V5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5082 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: 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 >=20 > The scalar Tx path would send empty buffer that causes the Tx queue to > overflow. >=20 > 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 buffer is empty. >=20 > Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") > Fixes: ccf33dccf7aa ("net/ice: check illegal packet sizes") > Cc: stable@dpdk.org >=20 > Signed-off-by: Mingjin Ye > --- > drivers/net/ice/ice_rxtx.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c inde= x > 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) { Better to name the function to exactly match what it does.=20 e.g.: ice_check_emtpy_mbuf and also declare it as inline. > + 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; >=20 > 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)) { Why "!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)" is needed here? A empty mbuf with TSO enabled is still acceptable? > + rte_errno =3D EINVAL; > + PMD_DRV_LOG(ERR, "INVALID mbuf: last mbuf > data_len=3D[0]"); > + return i; > + } > } > return i; > } > -- > 2.34.1