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 94E4645BFF for ; Mon, 28 Oct 2024 18:55:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C923427A1; Mon, 28 Oct 2024 18:55:16 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2080.outbound.protection.outlook.com [40.107.223.80]) by mails.dpdk.org (Postfix) with ESMTP id E9121427A1; Mon, 28 Oct 2024 18:55:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=I+pMIv1pHkklARq3xYsXp+jgl166m1EVdPOb215VLBh41VxxZ4dnYOxQmuUX9vSk6hiMbql/P+AS2GjyMDLvONXxTww6MGrBHv4D+GX5KmmUQlez6i1MTGr9XOr6pTYCCzLVLHAkKzDnoum7xyGzGXvHO/7NoNs1ug10lf0ywFSrbKjlVNtHLHGnJUIOAm1Bfuh0t7N+yqYN1nME6oSuMynAJGBocNbWuFG1qumeyrNpt6Ee+dXV0hhACpNNH0h68UYOqZo1scYob/kKDQ2/Bs3RJVsP8/y8CQanHndJaupNXvoxOd0NC4l9sKtFpyJFkWMybzc+MLTcJBQYo5jCMg== 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=8Kz84M/1Hc7Wkf32aA2OM2feKYMpIdZHfZHXcFer00k=; b=bt6Ch0sg/mh+TSGKaYYoY7Z7HtkzQUVirwVBEwXz+d7ZhuD5WV89PDKkFZXvSi3jvMrcR5t77sY3IH5sPwmfpUrEWybBn/aTZpCainzWTnyBu0mUHEc6PRpdiCV+Kv7Ny4YJTU/Fw2d+HrFR4SkHPJmvZjeL7HZrseMjcsquCxUgVFHX2Ot44FzK4kH3nn6ooOdD5B1Y//Pb2ZaG+grnBDHuduYZUg+jCkRWEnnXxxK/iE/cUEPvu7hqaiuH5mFdXjrfUxGJbX4KcjQiiVTx9u65L9Y5uiFxyN5RcYSjrDInHCYl1g1+1QwRq4NOR8ncV8aoxljob68/aXAaBSrOhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=8Kz84M/1Hc7Wkf32aA2OM2feKYMpIdZHfZHXcFer00k=; b=MNwYrNGopvrxUygeJ6mmJgKyP+Jt9CPmi5CTWIpXBxjItcKByynwPs6IONqrthOgHbk/IpH5q/+EPAAxe5TyZEHnKUSmRuQ0TAb8YJDfGPpDXCdQFex5inR+Z7QlsKRR2lSPBFtMVxcI0LYnzwU9LZgV8a1uRlksD+IQ32SQkbYrIiIWc29UY9V1fMrrkRzwC/1wzDp+3jiLN+bfmeYI3LFTjOcebgJ1aG1t4dkus6zrJppb17orQQTX087EOXixbhUQz86EPcnR5m4y9qO2bUBZX1jJ3E6AKQ6hcR1DPK+yB0rWPRY3+/yYNCTNH5tI0tRQpQTa3HbKjAxypYn4hg== Received: from CH5PR04CA0007.namprd04.prod.outlook.com (2603:10b6:610:1f4::7) by SA1PR12MB9002.namprd12.prod.outlook.com (2603:10b6:806:38b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.24; Mon, 28 Oct 2024 17:55:12 +0000 Received: from CH3PEPF0000000F.namprd04.prod.outlook.com (2603:10b6:610:1f4:cafe::ff) by CH5PR04CA0007.outlook.office365.com (2603:10b6:610:1f4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.26 via Frontend Transport; Mon, 28 Oct 2024 17:55:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 28 Oct 2024 17:55:11 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 28 Oct 2024 10:55:02 -0700 Received: from pegasus01.mtr.labs.mlnx (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 28 Oct 2024 10:54:59 -0700 From: Alexander Kozyrev To: CC: , , , , , , Subject: [PATCH] net/mlx5: fix shared Rx queue port number in data path Date: Mon, 28 Oct 2024 19:53:54 +0200 Message-ID: <20241028175358.2268101-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.43.5 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0000000F:EE_|SA1PR12MB9002:EE_ X-MS-Office365-Filtering-Correlation-Id: e01e6ff8-d780-4aff-703a-08dcf779ab51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?4ybJQRCmetdXHjpzfs19Y7xeQi+uYcr2ZCab2HAoJ6JDC7ByM/0p1gYDnLJQ?= =?us-ascii?Q?KZdYqH8hmdL8vBKXXmlWz0WUVuUvVSCsE/Pkz8Mpb/SamESoimENDqtF6qAK?= =?us-ascii?Q?PHu6M+JgsysgZKXC7g+E6L/H9j6GlYlbHjQIev/CSUeiDYRaLfYMDUK30Otk?= =?us-ascii?Q?6T2cHnmldSPFLinJ8ae4DMddLURuUZQe1gipeJDcRazmg/Er1MBj4aYH6DI2?= =?us-ascii?Q?FJ3U//iDp1EawS6UKFSay6dI2gqCyHsOP+UTH9wvoOOoJE5q77ngqDnZ9KO1?= =?us-ascii?Q?ILgxSdvPkoQR2DPMhUVk6oqu9UCzXtnHh9lip1vFwKshUdAfl02MLit2FoWp?= =?us-ascii?Q?nd8jDZP/9UFGas7z40Ho2rpRDPCkuk3SHajko5fuqeRyJshZnAbO92Olw5Nz?= =?us-ascii?Q?DA6DwuDuK8I9jdtvMELK0GH6y2TYB8aTBhPXA/LPclus1oRMD4gh/dE2Tdmg?= =?us-ascii?Q?5OYlSgcrOSvUyTeMQv+CWgxY05pdOYJooFQrgNCtw0iZ7/haUIiy2HiNMt5V?= =?us-ascii?Q?hUCSj8rV0laZQE0Y3TGuCs4CZoCk3jwdX973j9EwN119QBpw2edp6pVC3Aqr?= =?us-ascii?Q?8uoTbdJtRxn4qzDTt6YR/E7OmMbl6nccbB6cH3uA8jQRIHSYJ9VYltvPto0h?= =?us-ascii?Q?aRcpXloS3R72xNHSOuew8mgr1TeiYv0x1NyXyn951zxulI6bYn1TzeT/EDY/?= =?us-ascii?Q?E8FqQ2ZXgG7pbq9jua7zVnBnARbsQbM+TeOTkhpsovcDjuMY4/Nw3Q3IUYwl?= =?us-ascii?Q?J8bAH5dNhc8R1WAXSN9yYrJwtFZLnjO1IToMGIdiz+5890bfCP2tqhVl/M6/?= =?us-ascii?Q?BRIihN8nYyf1Uq0m1crl/MiDC3GDTNigU+DoWOtfNADK5LOU/ZXJVIPhLxaH?= =?us-ascii?Q?CwwKNxUUENXCYe9d2f40LXmEiH2ov2LPvWlNJ+8WjiA0olaEPvVaaX6oDWxu?= =?us-ascii?Q?0kk4ynsFmq6V2BWuZ6em1OLyRtjprgLTfr8V7IU0Ziz+SSIj43rLl7cBaUOz?= =?us-ascii?Q?SWze2HRvSjxvvpkCudYryXWyvZtpbIbGic1xzeiOrDsysf5TunIDvHDpMJW0?= =?us-ascii?Q?IEIYmaIBaM5NP0szP9jokC96zvdqWM+mt1scUGHWulyYpKHw7Yue6i8Q8DbB?= =?us-ascii?Q?fwD3GJpdte5plZYPCtv9nO+3OpgCkQJWvO1i1asWCkMorHaNRr9yiWSCUNIp?= =?us-ascii?Q?P1hKJGsmFfSeGPlxno14iNQ+//VTf/r9mULIOi5SQJHr2sRa+ZzSGjRrnORc?= =?us-ascii?Q?nEn6RlWYNJdnnroEnbKW3QQXpq5MWFJ3GyVJy+x9hbbbpeViDg4NBlwMiaD+?= =?us-ascii?Q?fP/BbDp5L2P7Dk+NdSSUANWTBUdTXZkOv8SuF3FPWC5a26xUmfqiiX+iVTbk?= =?us-ascii?Q?2Knx69bPPCcQtrsmYw8izszKpGJN9jtlLba6fzwIyQT7mJ69WQ=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 17:55:11.5548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e01e6ff8-d780-4aff-703a-08dcf779ab51 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF0000000F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB9002 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 Wrong CQE is used to get the shared Rx queue port number in vectorized Rx burst routine. Fix the CQE indexing. Fixes: 25ed2ebff1 ("net/mlx5: support shared Rx queue port data path") Signed-off-by: Alexander Kozyrev --- drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 12 ++++++------ drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 24 ++++++++++++------------ drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h index cccfa7f2d3..f6e74f4180 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h @@ -1249,9 +1249,9 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq, rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); if (unlikely(rxq->shared)) { pkts[pos]->port = cq[pos].user_index_low; - pkts[pos + p1]->port = cq[pos + p1].user_index_low; - pkts[pos + p2]->port = cq[pos + p2].user_index_low; - pkts[pos + p3]->port = cq[pos + p3].user_index_low; + pkts[pos + 1]->port = cq[pos + p1].user_index_low; + pkts[pos + 2]->port = cq[pos + p2].user_index_low; + pkts[pos + 3]->port = cq[pos + p3].user_index_low; } if (rxq->hw_timestamp) { int offset = rxq->timestamp_offset; @@ -1295,17 +1295,17 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq, metadata; pkts[pos]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 1].flow_table_metadata) & mask; + (cq[pos + p1].flow_table_metadata) & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 1], offs, uint32_t *) = metadata; pkts[pos + 1]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 2].flow_table_metadata) & mask; + (cq[pos + p2].flow_table_metadata) & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 2], offs, uint32_t *) = metadata; pkts[pos + 2]->ol_flags |= metadata ? flag : 0ULL; metadata = rte_be_to_cpu_32 - (cq[pos + 3].flow_table_metadata) & mask; + (cq[pos + p3].flow_table_metadata) & mask; *RTE_MBUF_DYNFIELD(pkts[pos + 3], offs, uint32_t *) = metadata; pkts[pos + 3]->ol_flags |= metadata ? flag : 0ULL; diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h index 3ed688191f..942d395dc9 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h @@ -835,13 +835,13 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq, rxq_cq_to_ptype_oflags_v(rxq, ptype_info, flow_tag, opcode, &elts[pos]); if (unlikely(rxq->shared)) { - elts[pos]->port = container_of(p0, struct mlx5_cqe, + pkts[pos]->port = container_of(p0, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 1]->port = container_of(p1, struct mlx5_cqe, + pkts[pos + 1]->port = container_of(p1, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 2]->port = container_of(p2, struct mlx5_cqe, + pkts[pos + 2]->port = container_of(p2, struct mlx5_cqe, pkt_info)->user_index_low; - elts[pos + 3]->port = container_of(p3, struct mlx5_cqe, + pkts[pos + 3]->port = container_of(p3, struct mlx5_cqe, pkt_info)->user_index_low; } if (unlikely(rxq->hw_timestamp)) { @@ -853,34 +853,34 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq, ts = rte_be_to_cpu_64 (container_of(p0, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos], offset, + mlx5_timestamp_set(pkts[pos], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p1, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 1], offset, + mlx5_timestamp_set(pkts[pos + 1], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p2, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 2], offset, + mlx5_timestamp_set(pkts[pos + 2], offset, mlx5_txpp_convert_rx_ts(sh, ts)); ts = rte_be_to_cpu_64 (container_of(p3, struct mlx5_cqe, pkt_info)->timestamp); - mlx5_timestamp_set(elts[pos + 3], offset, + mlx5_timestamp_set(pkts[pos + 3], offset, mlx5_txpp_convert_rx_ts(sh, ts)); } else { - mlx5_timestamp_set(elts[pos], offset, + mlx5_timestamp_set(pkts[pos], offset, rte_be_to_cpu_64(container_of(p0, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 1], offset, + mlx5_timestamp_set(pkts[pos + 1], offset, rte_be_to_cpu_64(container_of(p1, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 2], offset, + mlx5_timestamp_set(pkts[pos + 2], offset, rte_be_to_cpu_64(container_of(p2, struct mlx5_cqe, pkt_info)->timestamp)); - mlx5_timestamp_set(elts[pos + 3], offset, + mlx5_timestamp_set(pkts[pos + 3], offset, rte_be_to_cpu_64(container_of(p3, struct mlx5_cqe, pkt_info)->timestamp)); } diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h index 2bdd1f676d..fb59c11346 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h @@ -783,9 +783,9 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq, rxq_cq_to_ptype_oflags_v(rxq, cqes, opcode, &pkts[pos]); if (unlikely(rxq->shared)) { pkts[pos]->port = cq[pos].user_index_low; - pkts[pos + p1]->port = cq[pos + p1].user_index_low; - pkts[pos + p2]->port = cq[pos + p2].user_index_low; - pkts[pos + p3]->port = cq[pos + p3].user_index_low; + pkts[pos + 1]->port = cq[pos + p1].user_index_low; + pkts[pos + 2]->port = cq[pos + p2].user_index_low; + pkts[pos + 3]->port = cq[pos + p3].user_index_low; } if (unlikely(rxq->hw_timestamp)) { int offset = rxq->timestamp_offset; -- 2.43.5