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 6E2CD45C00 for ; Mon, 28 Oct 2024 18:08:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B444427A1; Mon, 28 Oct 2024 18:08:28 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2041.outbound.protection.outlook.com [40.107.96.41]) by mails.dpdk.org (Postfix) with ESMTP id 4712A41060; Mon, 28 Oct 2024 18:08:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lcMbVv/3UB+Z6UzhY6u61NTosUdu0NKToctglSSJZm8K6I/AxYv81oxm35xgxUf1f9O8bYWhjSBlTzTEqOggLG1MFTUflJdMvJ6JG4nrfCQHAuOsvTJKKJHwOIcLSzYD+KB2lDtggdVoMd/6VADfL/t4MjbsI9iZ+wGONJzqjFleoeJ5eEDkI+clu4Q3hUtCci0qEVDDzwoNNydR5iVqMEAYHCGZp8pyPTvowoQsxfTZOq2RUKD+huWvDMr3II5z3yqIXIHzkjUVHoBlt70Zsy+Oz6lWgzwWy0IIzz3KdgfINu1ctXeEuOLACm8mM/i4i5Rh8/zX9k9Kn4FKugj9Tw== 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=4LOnESI+4EiqYBRF/rsQCpI4Ur4ESvMaqgHrMWJUIm0=; b=DGj5j/rnHTaUhY1ukG9kZc4cp4SNPdZo5fq0tM522WRDcdaGKe0Y8rUD7Mza96GQDKFMda13KxunHuJIIM8O5V6ctr80cSYPvldauGlOIxz7Yan6Nyi07kgSxfreaVVh0LT7ZmCl2jF8/ZCYq+mhfh6jhOXWq5gW3RAXGulXOsLtLi61DtstraLMLhPie3Qhtm0nxk4+cgB91VM41QOKE2Xhuau8DkmVoIy7GOzaVocpWTgkdRUTGiMyqX6usITI379HjkQcA7uNh3lBSWFGKxA+58fLoBsOWBdH3qq7wfeSBa8N6sxbTJbWE4xomDR+W0VudRLNmhLOlFpWur9fuQ== 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=4LOnESI+4EiqYBRF/rsQCpI4Ur4ESvMaqgHrMWJUIm0=; b=VoHX/+MwDQAgC7A0LLsmqt7yWPP88TiMNyrbrfydYUorAFwgh/Pt79RpOLjJDIkaibRyEy+tn7nSIk43knHhPIjf00wbxltrm1Z8Bo4MD3LT/HCUkmOENGmtslNdHhJHTk4Uh3KQHQb2/DnGhAW4SLoAb0aeOV8nxeHSrdanhywZJqjd5uTjkSqh/XxmwnwqfkCpFi7hWjZ/fbRybg9ja7DPXO51xE3xbqx2ZX+KS18DaM2AMrwnfzbRiPIjzwWgHlfUDWcr985YEcqSXSkxnz5GqzUfBHsKRwk2nQvxk0KwjOmPXV1Ow4MNz8LDbNSTyhPchcKjnJTuOaH/GCTbNQ== Received: from DM4PR12MB7549.namprd12.prod.outlook.com (2603:10b6:8:10f::14) by CY8PR12MB8243.namprd12.prod.outlook.com (2603:10b6:930:78::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 17:08:23 +0000 Received: from DM4PR12MB7549.namprd12.prod.outlook.com ([fe80::36a0:7d17:4418:7c62]) by DM4PR12MB7549.namprd12.prod.outlook.com ([fe80::36a0:7d17:4418:7c62%4]) with mapi id 15.20.8093.024; Mon, 28 Oct 2024 17:08:22 +0000 From: Slava Ovsiienko To: Alexander Kozyrev , "dev@dpdk.org" CC: "stable@dpdk.org" , Raslan Darawsheh , Matan Azrad , Dariusz Sosnowski , Bing Zhao , Suanming Mou Subject: RE: [PATCH] net/mlx5: fix miniCQEs number calculation Thread-Topic: [PATCH] net/mlx5: fix miniCQEs number calculation Thread-Index: AQHbKViE+k4xFuDE7UybgeIiqxOWWLKcZTdA Date: Mon, 28 Oct 2024 17:08:22 +0000 Message-ID: References: <20241028164244.2262641-1-akozyrev@nvidia.com> In-Reply-To: <20241028164244.2262641-1-akozyrev@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: DM4PR12MB7549:EE_|CY8PR12MB8243:EE_ x-ms-office365-filtering-correlation-id: 96b57288-f98c-45a4-a84b-08dcf77320d5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?td7ShMiyIneDo2ioBTv3/jWhkBWE885/YYzztgSqX/1H5Qg53oowjURx65sX?= =?us-ascii?Q?gNpn3BB7JW1FpHKoo2HQjFc3aEI3QmAwI4mh5SzwTtCHG9oIsaO1OiECB6OC?= =?us-ascii?Q?yQjwUElNQ2K3NiJYav6eEUk8dW8IgCWV3GXHcL+ssgEtkI+WeNvj8+/PzWHJ?= =?us-ascii?Q?YVH6PYWZld19NWnnBJWO24kODn1/WfYJ9b5k6CrwvshPULmknF70fIjbdN65?= =?us-ascii?Q?7OnGzMwhlN/JydltXAuV1loUQLsMcu3p0/gJG7DIN3hEwrGj6ouc/4ul8JPo?= =?us-ascii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vd+ZH2zpjtuQgTOmhzvv6?= =?us-ascii?Q?pYhRIS8FNtEqEq/kDEsGipxvghbZXLUO9938XfqqGJVgcMBe4/7/9MqTvYRn?= =?us-ascii?Q?FogzDKEux94HkzyYcoIPDzVcvMSLU5rHn3OhxIPTA+RgD7ZFCphOkHWnwHka?= =?us-ascii?Q?IPXQI5ha8j8pS0VT2DJETrVlXigv5udd1mn0uRILOm5qtHcgzeD5biRev7M6?= =?us-ascii?Q?EIjsFVE=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB7549.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?x+F1wGDCoqWEsKCYjlicUWra7lbNtlJYhidPKpUkJDB/nw8pRfeCTtqGFWxO?= =?us-ascii?Q?6SQtNuKtRbnuj1+qssYTpBpiWC8j8YCrsTX5BUrlDOOt7ShKSf0AT+izUWsN?= =?us-ascii?Q?RdIin7Mfhqi6TeiydMVdL9IYY07JdbHA6CAgd2ShcwrlC8fDm7UXt1vkR+NQ?= =?us-ascii?Q?fXTSmYfDQE6OvslRQfz9RdsEu/PvOgOY9KPgkjeDDMbuQgipxGbSPKCHBR1I?= =?us-ascii?Q?lX3kUTfh7zk0/kINgsMeiHX7sASeIog+EsJRdO7xetHbzErEQuwqA12/WMdj?= =?us-ascii?Q?qopVcVmCuzGNXrwToYJrkIX3yy4VeSfXUzi/8XEZ5kc4XaeaEdT66UOIMeFa?= =?us-ascii?Q?9H1mri9OTGDx7x1I87Hq3comf0dJDe7cePBCjZB867BDEHqYI4HrLRC2U/qs?= =?us-ascii?Q?i1uEh0xTsfHp8QyOEpCSlNw+QuqwNjGAF/8NvSYGeLBikQWIMM14dUfmA/+B?= =?us-ascii?Q?/UUI1Q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6wUEnKg?= =?us-ascii?Q?NxLrmo8U6424LpYwH7GOuLhQdRB0+ZB/11wLSLlBekTaipJJvzsmkPqgejET?= =?us-ascii?Q?ClB2sB4CTep0GKar0m1mOqZaTkFd1mHTFopZx6PPWXif7hD1/nvD1mbJD0CK?= =?us-ascii?Q?mZKvSAx7zqUTV7nx0ifZ8MPnRVM/dfjaXhoSECYzXEaTcBAjAdh5IJBT4iYz?= =?us-ascii?Q?oQDq65psQzS/h1HQzrVEDe3sQhYNzKg9RGxwdmB4?= 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: DM4PR12MB7549.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96b57288-f98c-45a4-a84b-08dcf77320d5 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2024 17:08:22.3460 (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: xpjq3bI4S75CRYY27T7WgAa9wCFxrWcIvY6Vu05GCQrPaB9lbertTsUNJFfu1cLejvqaiNmu4kc9vpDkyu+G7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8243 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: Alexander Kozyrev > Sent: Monday, October 28, 2024 6:43 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Raslan Darawsheh ; Slava > Ovsiienko ; Matan Azrad ; > Dariusz Sosnowski ; Bing Zhao > ; Suanming Mou > Subject: [PATCH] net/mlx5: fix miniCQEs number calculation >=20 > Use the information from the CQE, not from the title packet, for getting = the > number of miniCQEs in the compressed CQEs array. > This way we can avoid segfaults in the rxq_cq_decompress_v() in case of > mbuf corruption (due to double mbuf free, for example). >=20 > Fixes: 6cb559d67b ("net/mlx5: add vectorized Rx/Tx burst for x86") >=20 > Signed-off-by: Alexander Kozyrev > --- > drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 3 +-- > drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 3 +-- > drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 3 +-- > 3 files changed, 3 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > index b2bbc4ba17..3c6a14670d 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h > @@ -98,8 +98,7 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, > volatile struct mlx5_cqe *cq, > 11, 10, 9, 8}; /* bswap32, rss */ > /* Restore the compressed count. Must be 16 bits. */ > uint16_t mcqe_n =3D (rxq->cqe_comp_layout) ? > - (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > - t_pkt->data_len + (rxq->crc_present * > RTE_ETHER_CRC_LEN); > + (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > +rte_be_to_cpu_32(cqe->byte_cnt) > uint16_t pkts_n =3D mcqe_n; > const __vector unsigned char rearm =3D > (__vector unsigned char)vec_vsx_ld(0, diff --git > a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > index 510f60b25d..ba79b460a4 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h > @@ -97,8 +97,7 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, > volatile struct mlx5_cqe *cq, > }; > /* Restore the compressed count. Must be 16 bits. */ > uint16_t mcqe_n =3D (rxq->cqe_comp_layout) ? > - (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > - t_pkt->data_len + (rxq->crc_present * > RTE_ETHER_CRC_LEN); > + (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > +rte_be_to_cpu_32(cq->byte_cnt); > uint16_t pkts_n =3D mcqe_n; > const uint64x2_t rearm =3D > vld1q_u64((void *)&t_pkt->rearm_data); diff --git > a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > index e71d6c303f..bd4010f2fe 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h > @@ -96,8 +96,7 @@ rxq_cq_decompress_v(struct mlx5_rxq_data *rxq, > volatile struct mlx5_cqe *cq, > -1, -1, -1, -1 /* skip packet_type */); > /* Restore the compressed count. Must be 16 bits. */ > uint16_t mcqe_n =3D (rxq->cqe_comp_layout) ? > - (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > - t_pkt->data_len + (rxq->crc_present * > RTE_ETHER_CRC_LEN); > + (MLX5_CQE_NUM_MINIS(cq->op_own) + 1) : > +rte_be_to_cpu_32(cq->byte_cnt); > uint16_t pkts_n =3D mcqe_n; > const __m128i rearm =3D > _mm_loadu_si128((__m128i *)&t_pkt->rearm_data); > -- > 2.43.5