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 2532245E58 for ; Mon, 9 Dec 2024 09:10:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 111D8402D1; Mon, 9 Dec 2024 09:10:51 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2050.outbound.protection.outlook.com [40.107.92.50]) by mails.dpdk.org (Postfix) with ESMTP id 3B1464025D; Mon, 9 Dec 2024 09:10:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FAQhqKU10wVdF8/3IuUS7AS6opwS9T2iWL7+QB+GK+/s62fmd0ChxBbH1s4sncBkoqIxSNrN9ckftOS4wIYDzEaP+jpR7xHmLkisJ1rQsB5eW+aF09+q/Mnh/jiPlpFjYKGsMgLd5PP9taPper7qSQwQzNDipY83uFuDFCqM1yZU4JWrXOsa13yJbrJe7tBdOAXy0sfP1S0iUTaWMp7kArIeH9ypj/JFIuAb13pnc6sGFbvKHkc34FPkuFvtcugDKTvaxnXq4JW8mHcRl1pIEzfWPdXCbYuRQ7Bjcvz2Vrh2b3TF8ZgtoLgrHR4PvZ8BzDIsn1+BGmjJ+AVXL2Zh7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=SlBFWS5DvkCFH6Tp/85NBt9ilGZv0Emn0hoyz4UWGUY=; b=DqZ27ZAbt5HfC+RNiepTpSSJr7QZxe4ubz7QTYnCq5aCOA0Z2+5vKVH4CKSwJSHjNGi4s1keniMgq4JnDh86E7Z7EtQvfaASJV5iUtdAvDB2KAVef5UJY2hfLfQEY8xlZEojnpuvlkWga6p8YI5ZQEBxzlhp/2TUN0nLPbopFcE15CvImpcG2n/UJaYawYBk+8195t4Qz3dIOjoj9GYQESsgw/PsIAk9Z7RYXh3Y0l+D6qtsGIuENFRIFF8Izq7FMc9VQfHhbkrMwGgQRJDOAjwew6Jw7vxDx7pt/z8E1GBedMJYPbdMab0eNGuKjxAsekvyAn06W9gHYskv+HVbZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SlBFWS5DvkCFH6Tp/85NBt9ilGZv0Emn0hoyz4UWGUY=; b=R51wPCc4ELMHf8BImjCQemFPO5OAwRW2ymbinZ/1oZntnnpAVohKpXD6lxs1btnDMUv+3SyGp8Sqp9q+nhCyRdvi0/Ou19JbJDgbBVwieUl9oob0mLl33yOBAL6i0rVfrZHbjUwZt3kVCsa6nS1i2LnGa4Yjgbi6D0cuev6aoZ6XgKkUdB4KuLyFcAtMNNT9hrv64z8CWwnW0ey4Co7dwdFoHndMERu4mnzfg/VnnqpRQdVtkuZ9tc4qtD6o551VAgHXAruWyCmSPKlJ/O+vaBEP/rSCr4LUmQGbqOjdFurRMMLdSveOVddYuWoeAYYfH7rB0mcomRyKyGlFZoJNwQ== Received: from MN6PR12MB8567.namprd12.prod.outlook.com (2603:10b6:208:478::12) by SN7PR12MB7980.namprd12.prod.outlook.com (2603:10b6:806:341::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.18; Mon, 9 Dec 2024 08:10:44 +0000 Received: from MN6PR12MB8567.namprd12.prod.outlook.com ([fe80::9bde:b697:6d6d:ee04]) by MN6PR12MB8567.namprd12.prod.outlook.com ([fe80::9bde:b697:6d6d:ee04%7]) with mapi id 15.20.8230.016; Mon, 9 Dec 2024 08:10:44 +0000 From: Slava Ovsiienko To: Gavin Hu , "dev@dpdk.org" CC: "stable@dpdk.org" , Dariusz Sosnowski , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad , Alexander Kozyrev Subject: RE: [PATCH] net/mlx5: do not poll CQEs when no available elts Thread-Topic: [PATCH] net/mlx5: do not poll CQEs when no available elts Thread-Index: AQHbR3oFoIiatcJ6t0Cve5SIhI0b0LLdlJzw Date: Mon, 9 Dec 2024 08:10:44 +0000 Message-ID: References: <20241206005811.948293-1-gahu@nvidia.com> In-Reply-To: <20241206005811.948293-1-gahu@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR12MB8567:EE_|SN7PR12MB7980:EE_ x-ms-office365-filtering-correlation-id: e59f9cef-13a1-4106-4c70-08dd1828fb1e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|7053199007|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?zbknbMBmZmL9HvQdGUQQOo7xP59WxWQnWzGVnTZC4jU3r5hWstTGxgut4JIs?= =?us-ascii?Q?yxCD4hiEfeYRZpjCRlR32hoNjmKZth+XyJwj89FUxTUszHqsbdTK7uLFudsX?= =?us-ascii?Q?bfRDuPSgQu+WU5rEva9KwCofXPgqHBhc33EK3AuQc2LWAPPX1rXZXP0RjcNO?= =?us-ascii?Q?VPgG+5O3nig5tzMFR0WaImhdeVLjDMVjwvmjF2TUTVK82LteQuog6Vh9Vi78?= =?us-ascii?Q?ufTl8OfzO4yoDdQP9uU9S9vGMEPFwDPI+raSQaTtkuja2xwDFH9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TP51nOiV8vVoZQ0XQubQW1sGcwcUmkI3lWmfsP9uXuZ?= =?us-ascii?Q?uKc21nsn3tQBnw+nL56+yxW8Pdko1Lae/WzWQ2mWAtob1ra4M0EHU+h8dKIQ?= =?us-ascii?Q?RGBWy07ZvQiC0R8+Kls9aYDYbOgnMHsxpAI2XudvufOxz2hpnGHQ8EE8ildT?= =?us-ascii?Q?NgV8URGzO3i+tVB1GKqJNRhtMKfQxPTK9W7pnZfgnfWcvXxTayeAp1f35ypL?= =?us-ascii?Q?c2x9hneP+/izyhoaEfoukBYQnUvDRoyImojH08yEoVy7n2gxXg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN6PR12MB8567.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(7053199007)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qMRlH4Qs7KhOb43g9SV2WjzPifcXKgG5L365+ABGgo978XwkRRmkD5WAIDzk?= =?us-ascii?Q?eEYq7UfYhshhtdoNlMjGX4o5AB+UfZg2gibRs0BMPxfU14cPzA4ALylp/Kwz?= =?us-ascii?Q?vf/Oq7v4dH/R45PJG/al2TOwW5ShFKo2y733npjjQQgiReSQbv+DdorM+boV?= =?us-ascii?Q?Bvf4yF/lNlXSB0Do2sKC1QGnEJPReZdUJ8i600edAaQq4gjKsuZGhPwglr5E?= =?us-ascii?Q?OeHn0LKUvfNL/ndK95X6yVtKFd8KZFOeze9v80AMd14SyVd/BUMTXC4SUBUa?= =?us-ascii?Q?jjZjwlN9+SxnJW3qNkH1L5Xit6kIWKsh/EIYVMxc0qKKoFDsedXJNCNyz8Ag?= =?us-ascii?Q?IuGdD0e1epXENR/XZNt9ZbnNlEaWiWHQnEKBhDu938XVWyn34LykzvfZKC/A?= =?us-ascii?Q?ZVTMRY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IqE/Chya9+CHahKyzssWhJ?= =?us-ascii?Q?wMfVezseXuItOyaRLfJAKdNJaVgcMJbSTsMjbNaS7SHGZtcRQ6N/ts4YzTD1?= =?us-ascii?Q?TFd4hpz/8Igh9iVT1lm40CfKAqSqP07+MIzynb/g4dI1IDGssJwuaD5fIDOd?= =?us-ascii?Q?YHTsx4JlaT6D8LrkCLMUjV4lwoXokRTxhuDE2msbi2MYSkI54J9Dyj2U5rfV?= =?us-ascii?Q?fLN5Q0qEacppI61u9rSLGD/lM99VC/2iKM4SZao40WQquKuqGhZinOtPKUbr?= =?us-ascii?Q?YFeK051cju/Mr3HGj3lC5AZkAbGS3cSiLC2OZEfs?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR12MB8567.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e59f9cef-13a1-4106-4c70-08dd1828fb1e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Dec 2024 08:10:44.6825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uaZGu6KBFEJQj525yt+nVtV8MHBp4w8HKcDBTBcQ/WJS3YItZSMCR9PYb/OQekNv5uKSavfczqJgX4G8Vq1UwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7980 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 Acked-by: Viacheslav Ovsiienko > -----Original Message----- > From: Gavin Hu > Sent: Friday, December 6, 2024 2:58 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; Dariusz Sosnowski ; Slava > Ovsiienko ; Bing Zhao ; Ori > Kam ; Suanming Mou ; Matan > Azrad ; Alexander Kozyrev > Subject: [PATCH] net/mlx5: do not poll CQEs when no available elts >=20 > In certain situations, the receive queue (rxq) fails to replenish its int= ernal ring > with memory buffers (mbufs) from the pool. This can happen when the pool > has a limited number of mbufs allocated, and the user application holds > incoming packets for an extended period, resulting in a delayed release o= f > mbufs. Consequently, the pool becomes depleted, preventing the rxq from > replenishing from it. >=20 > There was a bug in the behavior of the vectorized rxq_cq_process_v routin= e, > which handled completion queue entries (CQEs) in batches of four. This > routine consistently accessed four mbufs from the internal queue ring, > regardless of whether they had been replenished. As a result, it could ac= cess > mbufs that no longer belonged to the poll mode driver (PMD). >=20 > The fix involves checking if there are four replenished mbufs available b= efore > allowing rxq_cq_process_v to handle the batch. Once replenishment succeed= s > during the polling process, the routine will resume its operation. >=20 > Fixes: 1ded26239aa0 ("net/mlx5: refactor vectorized Rx") > Cc: stable@dpdk.org >=20 > Reported-by: Changqi Dingluo > Signed-off-by: Gavin Hu > --- > drivers/net/mlx5/mlx5_rxtx_vec.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c > b/drivers/net/mlx5/mlx5_rxtx_vec.c > index 1872bf310c..1b701801c5 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec.c > +++ b/drivers/net/mlx5/mlx5_rxtx_vec.c > @@ -325,6 +325,9 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct > rte_mbuf **pkts, > /* Not to cross queue end. */ > pkts_n =3D RTE_MIN(pkts_n, q_n - elts_idx); > pkts_n =3D RTE_MIN(pkts_n, q_n - cq_idx); > + /* Not to move past the allocated mbufs. */ > + pkts_n =3D RTE_MIN(pkts_n, RTE_ALIGN_FLOOR(rxq->rq_ci - rxq- > >rq_pi, > + > MLX5_VPMD_DESCS_PER_LOOP)); > if (!pkts_n) { > *no_cq =3D !rcvd_pkt; > return rcvd_pkt; > -- > 2.18.2