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 C2913A2E1B for ; Tue, 3 Sep 2019 15:43:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 816441E92A; Tue, 3 Sep 2019 15:43:37 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40074.outbound.protection.outlook.com [40.107.4.74]) by dpdk.org (Postfix) with ESMTP id 4FB665B3A; Tue, 3 Sep 2019 15:43:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TACynoWfHE+oawXWxTtjRTJk+N3+dsYiqzgC1IEP6Q7FC8RKVkzoXVSXfzS6aP94zKRuHAOYlqovAL3pSMb9vM6iWz+WVip+2Pc61pgKRZ58XuKdxHnkiH9u2vipkq54RGlMy1NAMXhzf5UPWO7LnK/A3lob8ISYgYbTFdbjlvQNvHgMiyCiFFtEBUybxupZay1y0Qx8igTUdt3LAnTcm9LtmrR7pa61E4yDQgcKZ3KZh+5Ee2FV3jrpGO4o043Lj2WNyryWmm60wh0EAq99t9AD5I+8tUHUwR75D3Fl5suwgEs6dJwcVdWQay6AQro2X8sAmscLySKzh6txLiJ1hw== 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=HVwlK4f9zQtIrbqFNY+IkDNtKH7TR6qK+9F26NCHsoc=; b=Q1Pi2TzdYIIRazq/yFC32MLvY0fwgaHXdUmOfeRCmFDweztdL4KJZRmUGrQftODj2XpzLsBBD4oL4GcMYZq3chybNB9GzcRXsZLmk5Xhay494BCL6RY3YJo/4YW4vJvQUm1TL7lh/odpfDhtYHauWcPNCGh1Z171qmW4tIQrWhWGsajJsoxGb0mA5LAjzSoJS/sh0Vi2hPdd0UhGnEEJ+ftdLQbXKz7Qr6trPJ+AEc1K87s+0w/Ra2BH5SGO76tTJ+vWzfpqIyJirCtWgr1kPFQAO4TJ3uUUCMwUDyvigU+Mb5F2b7ou4JP5cWwkl94yVC9Ul0Mo15PL6YbGZMfwtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HVwlK4f9zQtIrbqFNY+IkDNtKH7TR6qK+9F26NCHsoc=; b=CALvedlsnMhiBh5/00BDM/lpB4pclq9ZwDUU3WYFsfiosG/4Z+yO4GGjko0YFYGW+rFmMAKzcD2kjT9k6ZWm3PTkXVCPpvdC0kz+RkN7qLdau1C8SVVQ6aUG4Gs9ZSB6qPIh5u6/D9GR4zGPVCZlwfbpR1EaM3pKnoPz73AQjHw= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3393.eurprd05.prod.outlook.com (10.171.189.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.18; Tue, 3 Sep 2019 13:43:32 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::da9:65ba:1323:a39b%7]) with mapi id 15.20.2220.022; Tue, 3 Sep 2019 13:43:32 +0000 From: Slava Ovsiienko To: Matan Azrad , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix transmit descriptor with VLAN insertions Thread-Index: AQHVYlg5OQx5uYpjG0eRfXX/RzsZ2KcZ8jag Date: Tue, 3 Sep 2019 13:43:32 +0000 Message-ID: References: <1567514105-24264-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2bcd27ff-da3e-4152-ef03-08d73074b64b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM4PR05MB3393; x-ms-traffictypediagnostic: AM4PR05MB3393:|AM4PR05MB3393: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01494FA7F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(366004)(346002)(376002)(136003)(396003)(189003)(199004)(13464003)(6436002)(2501003)(53546011)(256004)(14454004)(486006)(316002)(5660300002)(11346002)(6506007)(478600001)(66066001)(86362001)(74316002)(33656002)(305945005)(446003)(186003)(71200400001)(2906002)(76176011)(66446008)(99286004)(66556008)(71190400001)(8936002)(55016002)(450100002)(7696005)(66946007)(53936002)(64756008)(102836004)(9686003)(7736002)(476003)(25786009)(6246003)(110136005)(26005)(4326008)(6116002)(81166006)(81156014)(8676002)(3846002)(52536014)(66476007)(76116006)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3393; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: rdjoT9uW9JQbbgNg97Q2tn+cauH9IEvA/V17x3WuXkVgcEVoCtpX6Zd0mI/R0OiaHf5GjBKJotaUjVazihAYtWR3OeWcxErNE4xfQGKEXq9nXbxaxAhbNEdc+n1YRHDzI7dvQ/+nG2vujkqIjJGNlhZ9XW5RtSX3KjFkuJ2Xy4ZgfCPRPVTAdFSf60b7Br/H+OZeORubSGm9GjYp6+RiXst07XfFaHSolPMSQQjFn3T0kR4mUv5do/W88XfBkm0h2PV7Max+r699ojdowr4iZMwC79dvD0DcJVoWNCNr5RQ7MArSXFR8IMk3b23dkvrh0QRocHz00UxA2O0b9k4jvouOqgvEG0twd2aVODNz9ol02baNnzUI7PhUcwFcYVvdK/HBZwKxPUaib6JGGvhVcMH7x0uaOPbB6B3B/Apzq5M= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bcd27ff-da3e-4152-ef03-08d73074b64b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2019 13:43:32.7614 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YilyKabwTX9x3Z1oKCpF055IYOM0JVmgGySQrACf7bBy5XMO16sbKC9x3LVRQTC9hnCm/ETbTeGwifh7TrzIX6Laq+G+PxXs5k1JIn1i0FQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3393 Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix transmit descriptor with VLAN insertions X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, Matan Please, see below. > -----Original Message----- > From: Matan Azrad > Sent: Tuesday, September 3, 2019 16:05 > To: Slava Ovsiienko ; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH] net/mlx5: fix transmit descriptor with VLAN insertio= ns >=20 > Hi Slava >=20 > From: Viacheslav Ovsiienko > > If VLAN tag insertion transmit offload is engaged > > (DEV_TX_OFFLOAD_VLAN_INSERT in tx queue configuration is set) the > > transmit descriptor may be built with wrong format, due to packet > > length is not adjusted. Also, the ring buffer wrapup is not handled cor= rectly. > > > > Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") > > Cc: stable@dpdk.org > > > > Signed-off-by: Viacheslav Ovsiienko > > --- > > drivers/net/mlx5/mlx5_rxtx.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_rxtx.c > > b/drivers/net/mlx5/mlx5_rxtx.c index 8ec90c3..f540977 100644 > > --- a/drivers/net/mlx5/mlx5_rxtx.c > > +++ b/drivers/net/mlx5/mlx5_rxtx.c > > @@ -2861,13 +2861,14 @@ enum mlx5_txcmp_code { > > memcpy(pdst, buf, MLX5_DSEG_MIN_INLINE_SIZE); > > buf +=3D MLX5_DSEG_MIN_INLINE_SIZE; > > pdst +=3D MLX5_DSEG_MIN_INLINE_SIZE; > > + len -=3D MLX5_DSEG_MIN_INLINE_SIZE; > > /* Insert VLAN ethertype + VLAN tag. Pointer is aligned. */ > > assert(pdst =3D=3D RTE_PTR_ALIGN(pdst, MLX5_WSEG_SIZE)); > > + if (unlikely(pdst >=3D (uint8_t *)txq->wqes_end)) >=20 > Why unlikely? > Wraparound is expected even in good cases, no? It is good case but supposed to be rare. Wraparound happens once on entire = ring buffer fill. At this codepoint it ever has the less chance to happen - many of wraparoun= ds happen on data copying (the code below in this function). With best regards, Slava >=20 >=20 >=20 > > + pdst =3D (uint8_t *)txq->wqes; > > *(uint32_t *)pdst =3D rte_cpu_to_be_32((RTE_ETHER_TYPE_VLAN << > > 16) | > > loc->mbuf->vlan_tci); > > pdst +=3D sizeof(struct rte_vlan_hdr); > > - if (unlikely(pdst >=3D (uint8_t *)txq->wqes_end)) > > - pdst =3D (uint8_t *)txq->wqes; > > /* > > * The WQEBB space availability is checked by caller. > > * Here we should be aware of WQE ring buffer wraparound only. > > -- > > 1.8.3.1