From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60066.outbound.protection.outlook.com [40.107.6.66]) by dpdk.org (Postfix) with ESMTP id 9A5C5378B; Mon, 11 Mar 2019 20:58:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mNQqc5G6uvQ7QCo7RsfbLTrDTOeUEIQ9PoWJkkVGLb4=; b=c9CukiYN1PgbQ/u9r5XA4QEIk4n/9Ji485H48Bx6bdyW9kPIq5Qn48EhHteR/aDjGwFmxx4pUeI/HxV+0mgx+AeGBU+qKkbBuzTTF5o2AnTAUVH9GWg0tWIYwY6nQYELMi9yixRAiSkXqXMoheyhhFa70muRWO0wr1Iq9p8dDng= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3978.eurprd05.prod.outlook.com (52.134.65.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 19:58:02 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::580c:ae7b:8278:cc50]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::580c:ae7b:8278:cc50%3]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 19:58:02 +0000 From: Yongseok Koh To: Shahaf Shuler CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix packet inline on Tx queue wraparound Thread-Index: AQHU1xlIFd7LaimPt0SOgEcweUO1LqYG20QA Date: Mon, 11 Mar 2019 19:58:02 +0000 Message-ID: <44AC735D-DF85-4883-A612-979D6D6DD59C@mellanox.com> References: <20190310081410.94830-1-shahafs@mellanox.com> In-Reply-To: <20190310081410.94830-1-shahafs@mellanox.com> 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=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c8d061e1-7075-426e-6a83-08d6a65bdec7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3978; x-ms-traffictypediagnostic: DB3PR0502MB3978: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; DB3PR0502MB3978; 23:vqDlJIQWfwYYHvCYMU9aoYu2nKnlEfA0a+yrRad?= =?us-ascii?Q?FPsKJghVJT3coxgsBnH8h1kTaofHeZfP92IczFhrOFWVRud5SRojO4gFJo94?= =?us-ascii?Q?h7BqXNo2p2SUM3rFxGKcC4FFmaujTL5xbzx6afu2iYnNivjCzmSNrslg+qnT?= =?us-ascii?Q?GWx7ZziDN65dkPfMoQ4kvZo+rt0+OwiQzJz6qLA5JAzGJBpq78psGAO8HMSh?= =?us-ascii?Q?ZYXnDz8FrmuUj97aHVqivCRQyqzrv+4BiUAyPHmvqWQn6lb061r719V3nk8S?= =?us-ascii?Q?+kSGRjNj0ex3/Hv3jEYrfiFEQ0iX8d9Q+ov/uPAujmVixo/M0MEw4PYSqPjL?= =?us-ascii?Q?wKmdfc3uybtvYXV+dab1kubkgKQDdnGoxcd8ouidAsZelKJiNTdN0hxosaSU?= =?us-ascii?Q?D87qDtJon0jF6dzlDjhWnpkrdqeNYP7Gs+VOuOzjohaY7F8VDIBbLBP8Tu2M?= =?us-ascii?Q?96JEUVBWPqQq0DrcCCtaOufmWnJx672OA7rR6hSED37LsPX1soC5hV1rH50A?= =?us-ascii?Q?P9ITmOo49Ezf4l1ZBUqMWrzVso00L/SutPW+pjMb0PxRN0XRF71130HVbCkJ?= =?us-ascii?Q?xA/EjqtP58SxnxVuRNggymVtwMEJBrxl0doppEuDp80IHEDkZrZwSp4W6Mrn?= =?us-ascii?Q?bcX4mDsZNlaTcp/xpqsDhqbKjihf/XTLUuMhnOutUmDUZUvakx0+L+sgwV/X?= =?us-ascii?Q?3CQM5alB6Brq3lZdEPT+3kf0d1mEiwtb4Ao5ZzXnbRdInQayH0php3AJ7BLk?= =?us-ascii?Q?t1fyd/olG+W/SdAGQzldFTstURB/BdKA/gvUO+H5nvwNthZZZ5ulIiY3mFPc?= =?us-ascii?Q?RHV8vLRTfMfAgaXkIdax8wHOEKda4xLwCJZhTEfL0UR8qwiUzBUmmeDqpoFm?= =?us-ascii?Q?6DzgYeyy+i3S4+C4jKahrZpYtYD2COQSbocapA4XVexo+W7r+/1hutfUc5sQ?= =?us-ascii?Q?+NQYb22fD7sJD+IhgQc0qvMI/EbKNYum6cIL2q8UqBR4pcSqt+8qY5IB/38e?= =?us-ascii?Q?SUEEYx/eW54fcaCZZ/KXMWeHlcrdPYN/dAdDYwp7QMFenA7TRL4R4XmD0ntz?= =?us-ascii?Q?8MXOXY0IXHbD+17TF7keG99KEutAOyYAqiXKNzuxZxJDQ8SS3H+1MoOHeoZe?= =?us-ascii?Q?DqzHVW+iwsmx2jPXpwJJDAiPfM75fBLibNOIXjdG4y46MQbvEiGyFRHomS6v?= =?us-ascii?Q?tNTvH5JDFzc4QWb5E0deeGJlvST/VxaXPEbqHLILQMTblXqV/z6LDzaUUE5L?= =?us-ascii?Q?BarKlBekiNIVSP21gvCrczQWVFlY6TwfAnsAsbsxqznWTHa1uqt9BwVyom7A?= =?us-ascii?Q?8r8oinU/q9s12XFjUxVB7G+YpTHI8fSf29hNDy1FQr2kI?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(396003)(346002)(39860400002)(199004)(189003)(6512007)(97736004)(81156014)(82746002)(81166006)(305945005)(6486002)(53936002)(486006)(6436002)(68736007)(3846002)(36756003)(7736002)(6862004)(2906002)(25786009)(8676002)(8936002)(4326008)(6116002)(450100002)(76176011)(83716004)(186003)(86362001)(446003)(5660300002)(6636002)(71190400001)(37006003)(54906003)(105586002)(99286004)(14454004)(2616005)(102836004)(106356001)(33656002)(6246003)(256004)(14444005)(11346002)(229853002)(66066001)(26005)(478600001)(316002)(476003)(53546011)(6506007)(71200400001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3978; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 6MSwohcrnNmPhPKRaRcUxaX7LPj9s2cCVgeQXYpqYC/m7V8K59j2llfJUOC8GBJ621gOcT09FxP/9RSHaAPZGCXZEaTtyFI06Gdn4AKpwZoKo1FQPrpVx2SMDHGNH5KW+6307HqgLI/buEmiIhtabf8uC8zi7mVVB1VOXyYKMjNmT3qXUgZ+5C2EW4+bMlMYi7g93csovlDXJ/KFWQaAtKLMobFwutF8N/90pWnAKCVh9chUqA/4CLzGxWy+NIgqq6vwgoUse35nL9NIqHGZLJ9t55/iLq0AIpmtjX1kgpuc7HUtiAW9czURg5xyRf066N8YS9SdXORXMIzk3/I8YArvnoaD+TrJ2/J00orPe350v3eQNLp3J7ytFnqfLOpSFrqCFWa8nH4VTg1cn5iYee4p9w2OKX601fQzReDQJDA= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8d061e1-7075-426e-6a83-08d6a65bdec7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 19:58:02.7958 (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-Transport-CrossTenantHeadersStamped: DB3PR0502MB3978 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix packet inline on Tx queue wraparound 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: , X-List-Received-Date: Mon, 11 Mar 2019 19:58:04 -0000 > On Mar 10, 2019, at 12:14 AM, Shahaf Shuler wrote: >=20 > Inlining a packet to WQE that cross the WQ wraparound, i.e. the WQE > starts on the end of the ring and ends on the beginning, is not > supported and blocked by the data path logic. >=20 > However, in case of TSO, an extra inline header is required before > inlining. This inline header is not taken into account when checking if > there is enough room left for the required inline size. > On some corner cases were > (ring_tailroom - inline header) < inline size < ring_tailroom , > this can lead to WQE being written outsize of the ring buffer. >=20 > Fixing it by always assuming the worse case that inline of packet will > require the inline header. >=20 > Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") > Cc: stable@dpdk.org >=20 > Signed-off-by: Shahaf Shuler > --- Acked-by: Yongseok Koh =20 Thanks > drivers/net/mlx5/mlx5_rxtx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > index baa4079c14..38ce0e29a2 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -693,7 +693,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts,= uint16_t pkts_n) > RTE_CACHE_LINE_SIZE); > copy_b =3D (addr_end > addr) ? > RTE_MIN((addr_end - addr), length) : 0; > - if (copy_b && ((end - (uintptr_t)raw) > copy_b)) { > + if (copy_b && ((end - (uintptr_t)raw) > > + (copy_b + sizeof(inl)))) { > /* > * One Dseg remains in the current WQE. To > * keep the computation positive, it is > --=20 > 2.12.0 >=20