From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 17B24A0553; Mon, 17 Feb 2020 16:09:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F37471DA9E; Mon, 17 Feb 2020 16:09:38 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 579CE1DA9E; Mon, 17 Feb 2020 16:09:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2020 07:09:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,453,1574150400"; d="scan'208";a="407801181" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga005.jf.intel.com with ESMTP; 17 Feb 2020 07:09:36 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Feb 2020 07:09:35 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 17 Feb 2020 07:09:35 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 17 Feb 2020 07:09:35 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Feb 2020 07:09:34 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bcamGHUzrS9n20DrbGuMU0j0YCe8jviqj8ad+88EukJhptU4TSfNxRbhLsPty0Kf2PtaAqVoZo8zghtbziDtT7RnbmCoH+5DUaQD7OuU26qHnkaq5JLH5Nbx2py7T1IrIub10GxQuK+mNtiNBt5oI5ye7inbO+9v3pNYT+R0yiJ9OGEMWPvT65UqzCnAK6hb4JagH6ELQthx7Gsm/SDAAynZkZFrp4NWizcdP1dK8hze8porDzAh7Z99resX+6Q248UFNLqCIrDNLoYOTKYv29tXmiwMePrpPiYQSCKR6o4JUeVQtCaLNEZRx+TeOWyyi9Lx+LQkOwflqfokPBlvgw== 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-SenderADCheck; bh=EC3MwijE1It2ZzeTbhIzwC0ttFFKoym9H9hfGe+WYEM=; b=iy6JvRoHLkoDXJJQptDDwQGroW45fWg/4msFhQRsAHURM6iqxbYbX5TActj5e86UQClISauAzIIIQrG3Dy2DBVE7owD7rdERhecjvXtiskm0e5G1McL1CzdxcnjnWAoq8ucuYNbm/e1Hv6QmIzd/wJ18yyl5IEDRKiWK1emes/BGBYeYgVfVieyoYCPBX6rIEzrnNZGvyyR4iJb9kKNSMDm9/9ATL7mZvU6zsygyvu8J+DEJhWmb+QLbj+4yJf3KUfQeFtPTONeHu5+D014xZspHNXQlJqr5a7nEq7FuVgLrPwVMOUY6y1+e+dp7rnSMjy/UDzntg17ADbg7ahf6/g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EC3MwijE1It2ZzeTbhIzwC0ttFFKoym9H9hfGe+WYEM=; b=UBJW+WyT+ucSaz56SLK0snkhAKpKVMo5z5/3z+MIbpc5sqz0HvFYx6Qt0l3nqVsU1bmLwTOMBLrSWlQzVEJLtrZLcm7KaOaG7+qiVWQkN4M7WEASMtw/uWZT6Th9ZY/VjClovt287tIpN+lsV3LcC8GF5TtkH/MkL0QnCBc5WvI= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3024.namprd11.prod.outlook.com (52.135.127.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.25; Mon, 17 Feb 2020 15:09:28 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::395e:eb75:6ab7:2ba5]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::395e:eb75:6ab7:2ba5%3]) with mapi id 15.20.2729.032; Mon, 17 Feb 2020 15:09:28 +0000 From: "Ananyev, Konstantin" To: "Zhang, Xiao" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "stable@dpdk.org" Thread-Topic: [v2] net/ixgbe: check illegal packets Thread-Index: AQHV4wgrlx49kyGmH0SM+SeOhx4yUKgffVeAgAAErIA= Date: Mon, 17 Feb 2020 15:09:28 +0000 Message-ID: References: <1581664785-67507-1-git-send-email-xiao.zhang@intel.com> <1581951075-56261-1-git-send-email-xiao.zhang@intel.com> In-Reply-To: <1581951075-56261-1-git-send-email-xiao.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTlhN2RmMWEtNWI4OS00ZmExLTgyOTEtZTcwYWRkYzIxYzI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibTA1YWJSdWhFM3lTYnZUalYzMHlNVE5zNG4yaHM3Qm5lTkhMQUdvVGladXhGNWNHaUlheHRoTjV2S3JIKzhcL1YifQ== dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.180] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2df61a90-e78c-41f5-9c3c-08d7b3bb6261 x-ms-traffictypediagnostic: SN6PR11MB3024: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 0316567485 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(366004)(346002)(136003)(39860400002)(199004)(189003)(9686003)(7696005)(6506007)(478600001)(186003)(2906002)(316002)(33656002)(110136005)(76116006)(86362001)(66946007)(26005)(55016002)(71200400001)(54906003)(66446008)(64756008)(8676002)(4326008)(52536014)(81166006)(5660300002)(66476007)(66556008)(81156014)(450100002)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3024; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MwY1F9CKiLcat+MzG+uLLsyBcLkiGeVrIySh/yRQiZNdM4Lz+O1oVyGJSZf97vZZf4pHU0Tb2LAi/EzCWV6p7xIHC/YwnGqNfN5LvEkFqeSFh0TvNVKsGQ71i7gRQCxlEoIFPo45Ms+hcv1DqDJxvWj/HRtUS9iytA0zK07d/Jfw9SE0jBeHLpUe/zXBJ2ho2LOlqDGDEixaC+feqdRob8xsbY+4CjtUIDlakymwg1B3s/D/NMVaMw/0193vYpPR+25yBHRv6dXUZ0nG9cKp+J3QfodDhAgWec7LEq+Mt0AdRip+wg5VvNpV1hBM9ol6L32l1u6tjZOnaOA9umkkTHWi9v7FldJugdfQvxDMlV0WB0t66b48HN4K5bKo9obUMjcOC8q9mV+YUgHCuXzB9d1DHnXfu5N/eGXGI+K67KA3upHvKcpMmG+4SHKi8iZZ x-ms-exchange-antispam-messagedata: VnP4sw//Ua9Bk3VcycpWZhpltQhsXQ6XwfA9JjzG4zcehK7ANd1wjAiiMo7WWU9UVnIh5X0AJFSnfTmN1aq7o659mosLgYz+dflwJjo8O9qe9kOUYsGQf2Z4GCs+W0MRto5c4ToG+B5NQSDoCVfzlw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2df61a90-e78c-41f5-9c3c-08d7b3bb6261 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Feb 2020 15:09:28.5395 (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: 2kz209n6JUaMtbrUmZPmLofHGIbecWkV4uZbHtMSlPIW9etE8g50BJqqvBGG/V/z7JBONchm3UlefUZUpGGC/nWtwU9gxNVkKoix7zRS6rI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3024 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [v2] net/ixgbe: check illegal packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=20 > Some illegal packets will lead to TX hang. This patch checks those > illegal packets and protects TX from hanging. >=20 > Fixes: 7829b8d52be0 ("net/ixgbe: add Tx preparation") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiao Zhang > --- > v2 change the minimum packet length according to the datasheet. > --- > drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++ > drivers/net/ixgbe/ixgbe_rxtx.h | 2 ++ > 2 files changed, 8 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxt= x.c > index 7b398f1..f839bca 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -986,6 +986,12 @@ ixgbe_prep_pkts(void *tx_queue, struct rte_mbuf **tx= _pkts, uint16_t nb_pkts) > return i; > } >=20 > + /* check the size of packet */ > + if (m->pkt_len < IXGBE_TX_MIN_PKT_LEN) { > + rte_errno =3D EINVAL; > + return i; > + } > + > #ifdef RTE_LIBRTE_ETHDEV_DEBUG > ret =3D rte_validate_tx_offload(m); > if (ret !=3D 0) { > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxt= x.h > index 000c5b1..20a8b29 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.h > +++ b/drivers/net/ixgbe/ixgbe_rxtx.h > @@ -53,6 +53,8 @@ >=20 > #define IXGBE_TX_MAX_SEG 40 >=20 > +#define IXGBE_TX_MIN_PKT_LEN 14 > + > #define IXGBE_PACKET_TYPE_MASK_82599 0X7F > #define IXGBE_PACKET_TYPE_MASK_X550 0X10FF > #define IXGBE_PACKET_TYPE_MASK_TUNNEL 0XFF > -- Acked-by: Konstantin Ananyev > 2.7.4