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 15BACA2E1B for ; Tue, 3 Sep 2019 15:05:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41DD61E89F; Tue, 3 Sep 2019 15:05:15 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00051.outbound.protection.outlook.com [40.107.0.51]) by dpdk.org (Postfix) with ESMTP id D1E601D454; Tue, 3 Sep 2019 15:05:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJOHTxgwTVhBRSOgXNR9gJN0xEXqAW7ZEOsoOvvKkz9uA7ANwjvIKMkdgj+fq/vAi6o5Jq3+Ab0l9BI6Pq/RWqU4FJwsrDpxRDj3NhRcqETdINsxiC02KB8ld/Gi0DLGXHK1Aa1BBNrEfKLihKsXYg6GZpNSmLGxBbdfTKGd6muCZTOGAJh8l8hBglsvoDtmvlT9dmKZnxLChhmomEUv19PHneYkJALe3NEonj0HAj/TjiJCawx6uYysZMnXzO5URu7S+aDVkdCB0JBAi6TAtUENloTJ1APsK3rv/+eIkzRlKvkcapU74rxISkYhkE4u9rhFNGI02f2GqmTJatij/g== 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=4EzFjY/DqymzjLRsFHeRYXl6iuEA6tOsfxt7Ws4HjSg=; b=Os00uBVC2DiXwjAE/JRowQctu4hV4LwZG2NJm0oPqU7isuOlXYE3f0KQtjq4FwhVLhwOZyLsKl/aFfYf/RzoNWq648S1GXDFnDLXiebmMBD1oxj9rXE8yPYHPuyWX6LF65wU3DIy2rPOKQDYrp+8i9aJN2P0UGu/SOF1pTNFjAzaDKufV7xx4FDpc064Ja6mMQX5VNJnVI2vBTNVaiw+Cpq0O7bCHYaOW5aRP/ERRVLItoshWxTEFds1kQBb4QOL2ng7g0Nr8UGX+Og5OeTrpo2UKqyJd4fgrOkcznEuZiOetHFq6kv26iyYiKcC+3ir+ZYckyP8IYtdPgfXLrThlw== 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=4EzFjY/DqymzjLRsFHeRYXl6iuEA6tOsfxt7Ws4HjSg=; b=nSZom+s/h64SUVRXdJXXYteczb80fgOckKAFjZhL3Li2orzp9nCIsTOLTgYSlznm7y6YgDZ5hZL+AxDjcj02knjQzemPxtcNLa7Ov0Od+0GN/xooBUx5RzDSCPpaHLeL1lMruBTd4fgVaTTGafBu9FmrT2Z/eqsyJeUoQOtx3NI= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.39.139) by AM0PR0502MB3844.eurprd05.prod.outlook.com (52.133.48.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.22; Tue, 3 Sep 2019 13:05:12 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::7deb:8e17:1363:e00e]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::7deb:8e17:1363:e00e%7]) with mapi id 15.20.2220.021; Tue, 3 Sep 2019 13:05:12 +0000 From: Matan Azrad To: Slava Ovsiienko , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix transmit descriptor with VLAN insertions Thread-Index: AQHVYlQWS/d6+THJ1EeaDlm5n/3ba6cZ6xpg Date: Tue, 3 Sep 2019 13:05:12 +0000 Message-ID: References: <1567514105-24264-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1567514105-24264-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d7ac734d-4822-436e-e790-08d7306f5b1e 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:AM0PR0502MB3844; x-ms-traffictypediagnostic: AM0PR0502MB3844:|AM0PR0502MB3844: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 01494FA7F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(366004)(39860400002)(396003)(346002)(189003)(199004)(6506007)(6246003)(102836004)(186003)(11346002)(450100002)(71200400001)(478600001)(26005)(71190400001)(305945005)(256004)(66446008)(55016002)(476003)(64756008)(9686003)(7736002)(74316002)(4326008)(66946007)(446003)(6436002)(76116006)(76176011)(66476007)(316002)(486006)(25786009)(14454004)(53936002)(66556008)(110136005)(229853002)(2501003)(3846002)(33656002)(6116002)(5660300002)(2906002)(81166006)(81156014)(8676002)(86362001)(52536014)(8936002)(99286004)(66066001)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3844; H:AM0PR0502MB4019.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: 5bl2jjT/4Mvn5KQ83lTVPYmooSuQmibInx02AGiTHxbQ0AV7imfxh6cNkzceUuNA2CL6GjB7hFhC1OwbeVBpOsArlLCIFxw7m2Wq+fRz9aKr+N5yEETg4HqPMskCi74/A3NRfJu3PAbHv+gWOE3CoWmNvBXBNBXyr1wt2eAuykAGX5eR9YcpfTPqdIdJxQSM02ff0RDcqn+Wm6VevFETgsMHlSoCMBCUSJGm0tS++eobg9XqOP6RF4/wDBXAguA+qyhq9a7RAmjTerWQDZVDDFgwTgkAbvwW8Z7qths/y5zuwq5JZOUWclYHM15Qb2QQyOwrq7BLudyMiWhnaQRVx/n17H14tKg67LuvuqvXXGkF+U8NwqePv8u9o1Lc3Ng98Km27PyClX8dKxFihKctT9BBorykvpKk6pbEuQKsaSQ= 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: d7ac734d-4822-436e-e790-08d7306f5b1e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2019 13:05:12.2440 (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: YcGYGwrsrUZSmV/0s00+GXKKGa2bhL425Zaksy55FaE0nID3LEY9YUtBwauQNxIlgcusfN6SW3x8gTG2FVyoog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3844 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix transmit descriptor with VLAN insertions 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" Hi Slava 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 correctly. >=20 > Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template") > Cc: stable@dpdk.org >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_rxtx.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > 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)) Why unlikely? Wraparound is expected even in good cases, no? > + 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