From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.42 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796213702; b=IqpdtMRlyUFVhiB0zS8FM9GVjn8Yechpfl187eNtmEW/ISNweED3FK19MUl0TfW0CABY c49/2/iJ4cLQwQLkb/HIJkDD9xlLlqj0rWaGT74SjjUopuqxVvO4ac0UDnHpeuhNul6WK 69ftj5hqvRxvr02SgV8TDaXxZQQNlwOzS0+FjOvf+6HvzJSL6F62kF/XKIn76Ojn65S4m jN6j4yMuA8J3OQrfn7G/DlDH3bVKQuQ3vn50FLLiZGxwMir4vMCiB08/Ckn13sFK16DPc Yp2KGaZ7QBE3n/n47mP5Ocf05K/NON7CRzt0H3O4WdqifarSDjRpgKdc0dAIXB73+UQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213702; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Received:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding:Content-Type: X-NV-OnPremToCloud:X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=vvqfuS9LxQROGN3jAkw1U4lJnVTi/USXKOK2Ffd7+sk=; b=4m8vdPYKoher86lusr0+encR1CLxX/DX7oRXUW2+iDN7AJ1GUWSGlndMe4Qb/SPut5MU pIqcRTTNrMHMJpxy+HQS0AFlGtVtjlvmKA9YeNI71rHXXInCPUwYoxfjb2gca85MXmktG A7CHb70SsYFVcCNsptcIaM3ttR80XbdeUtvwSRbNQ3nz0s5tNImdRx5Bt1XEkFf53DFhr 75KiqM3RL07QHdiOrLMrYqnOjvgZQKjD8iv9zTlhQfSJ0DqiRGCkWjAV5Bi+qBNklQ6fZ mUugjIBrsAOhEUK2+PoDpEXVxcH1eqmnu4kO+Xqm3//4VBsH5pW0w80kvFFpVh2rHpA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=HKSX9LDx; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.42 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010042.outbound.protection.outlook.com [52.101.201.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A3F6606A327; Wed, 2 Dec 2026 12:15:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5A3F6606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=HKSX9LDx ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c7DexPchuSUcJvRPMernV31NuC/OsjuTk6BHwmAYy/mbkIlIdaCP/nrUEq+qMDhSquGQMqVpdw6WkT3caq4QiEMZkm9V8Bwd8Jwlh0Cf6HlVocFEFHBgtNxKrUiOrT1Jv9zLH0/zL3XHBgC6RcPsiuxjt9FT4xuXTFwj6OJN1S/f50FE0WOAJfVUnJHdBLfbZdl+5lQoiy1BFhOT7+YzhTVqdaWnAF/pxMA+IF4WZybxhmfUh4iWPRJ7XvPsgdYRUDLTrlV1b2trfVTCeYoUaDj/T0gkBLoW1LFdkbdoQ0RWQW2nQ0oPoODn+vpH/PW/gikpDm2JWHCFlHcCu7NlQA== 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=vvqfuS9LxQROGN3jAkw1U4lJnVTi/USXKOK2Ffd7+sk=; b=UvXqO5NH4uG78nc/UlNs5JxiHPd0Xdan+1V7oIFQUs7dBTQy+y7OVVGjZ83gh5lgEBs7fEkj4SowN4Z2ITfMZ81JA3muEratg93m0a4Q6iVrbpbH5cuZFvV01hH+C/mpuVVYtOQ6d1+mU+v9Et26FDvJrubJTwvUOZYtSq3YNqqgSfmAmt0+uXR2yD/wjRLZrlwhVhyr9h2GEBscfkj5Ti9RJeMKuhfe7nONnOLqenM9PXil8A/vtlFRzoVuTelZpsTdpwnNLXLKrbyrC0RY33GmTIOfbXnupTIOLeenn23j1845JkqkrkXB90gP1Bbo5ywFF+JviafkPeaRWRK+Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=lunn.ch 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=vvqfuS9LxQROGN3jAkw1U4lJnVTi/USXKOK2Ffd7+sk=; b=HKSX9LDxjxa1++TF1GgbId2N/TWy/FM60/+/RR02bj53TUWumyOCQmSrK1M4kOe069ENDnHTAQUA2A1Z0Mh++rkxx3U9FVyn27dUHKrcZ/FZmbvmtyTPsGcPVVj1Ezpni8T9pJjrCJkYozhiEOE8viZLYU8oB3ZUpMRWPUqhV0djwv6tXCj0gQGT2U5Z4V12lZM18sZ9p+9nXWbG3u53zmf2JSAzp2TW9+5MQCc/9sWToNxy2TxcszRVy1JUHzWJn13NIuHoTikIuNx5qKUlNNIzJ+FaE61ncfnbq/XgzHw15cWhAxCxMbW8u7zJeExZ0BNQjQmk6Og1mHEXimlzzg== Received: from BN9PR03CA0071.namprd03.prod.outlook.com (2603:10b6:408:fc::16) by SJ2PR12MB7798.namprd12.prod.outlook.com (2603:10b6:a03:4c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Wed, 2 Dec 2026 12:14:57 +0000 Received: from BN2PEPF0000A895.namprd04.prod.outlook.com (2603:10b6:408:fc:cafe::2b) by BN9PR03CA0071.outlook.office365.com (2603:10b6:408:fc::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.10 via Frontend Transport; Wed, 2 Dec 2026 12:14:57 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BN2PEPF0000A895.mail.protection.outlook.com (10.167.248.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 12:14:56 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 04:14:38 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 04:14:37 -0800 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Wed, 2 Dec 2026 04:14:33 -0800 From: Tariq Toukan To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , , Paolo Abeni , Willem de Bruijn CC: Dragos Tatulea , Gal Pressman , "Leon Romanovsky" , , Mark Bloch , Saeed Mahameed , Saeed Mahameed , Tariq Toukan , Tariq Toukan Subject: [PATCH net] net/mlx5e: Fix the missing WQE count of large striding RQs Date: Wed, 2 Dec 2026 14:14:22 +0200 Message-ID: <20261202121422.3422569-1-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF0000A895:EE_|SJ2PR12MB7798:EE_ X-MS-Office365-Filtering-Correlation-Id: fc19b4c8-4f04-4c5b-69c0-08df506de0d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700016|23010399003|1800799024|11063799006|261009223027099003|18002099003|56012099006|261022105027099003|261028144727099003|261102123227099003|261021123027099003|10067099003|261021121427099003|261026140227099003; X-Microsoft-Antispam-Message-Info: KMTEzRYQFfvqu0IkCDKDYpsDo8RtwlVqz5EywUxj/PAwkHE00jju/mYCbDNowAwgP2gWHKBAIlv50Gbdj1gFD67j6bPU6pX8/4y4Xm/5FOt0AsGitniiRsOY05ubiGcAV4fY920DjMk1CxjsQwQFNEcFBQjz/JfLFLFjj9QRz4Yxe9Nyt+Ny41llC+c/DL10ZNhqooBsqBHSQDIC9TWDlRc+xWtJ2d63OCEpA1emsamxEGwXA6bS1qvbodfdVDoeYcDaC7aNVDf+A1uw9NL6CuOcPYznD1SedN4E3rgPRR/CmZNmbX+E5kLBzZv/2MGbS4qdKkY4RGxrf7bV0OcGUZSJAiaCXQ7RK+WkN+hTTl1ImOTgH+byAaqNtIvmFIp3k1zSTqUDM25ifdusdRDTHBT8Kk+bwpS8/KtIPrsl84xxxUqv6hsCekIcZnRJzWWz992maF7YFnXrf0entTo8NZ3lKGjuLTVpeb9xxYJrAIsSJ0he4qxiGx/1uC9gHtiNBlx0Mf2LzslmgCEhfGsWKHDdjd6+3W9ltVeBv5EowJy0gzrNMQH81Bb/g1kOI/fTPuqSar+RSCGlv20zbQ09K6/2dBhOJ1ZdC74Jj81oCTW/eSLuODnbgBJltn5n6wFrpdgafbhg3p1LGmvcKWPIWaAFJigjFpH289Ztws4jt+EUMXDH+5DiLtBlzxrKjW+ZK7gkBKTdKqfy9qMO8UJKqg== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(11063799006)(261009223027099003)(18002099003)(56012099006)(261022105027099003)(261028144727099003)(261102123227099003)(261021123027099003)(10067099003)(261021121427099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: witrafsZ1qEJizuB6qlfOG/N+OSIlYGhEcbeL3uJ6KIgvpGU6dEWHdWDSYkQkOQh0ugOueCsaUii/6PsU74D24Dtb0WURv0hjJ6zP/BcEdrT48X/IX+wc7KobrLdqLNjhRyeiSSSele+ygDzE8e3iYqGZqMoo9PEFJ2JL92QAx+mxMB1JOdBN/t+G39f5ZldzuZdneNQez+J41jkjs97A6ijqsSxBm9S+YvCf78wp8cG2pMkG8W9ddeaf6VPU1qYea6ahRzKkWNnV/cCfgV2XIrQcykjqzoCE0zeAj4sXmwbwk5bnsMmkDAyKpM60J1Pt7WLMlgLv8Z5srLw3SQihwiIyMQ9V507zwTvgfCmIPKqVfQqfVhXmLzunM6DsdJ4j3+tI+X4q5mUei/H1twUpjgfrSUBr4jARIOfr0b1tlB8ly3Md6PGeHslIVqcBgqB X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 12:14:56.2011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc19b4c8-4f04-4c5b-69c0-08df506de0d8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF0000A895.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7798 mlx5e_post_rx_mpwqes() counts the WQEs to post in a u8, and the RQ keeps its in-flight UMR counters in u8 fields: missing = mlx5_wq_ll_missing(wq) - rq->mpwqe.umr_in_progress; A striding RQ can have more than 256 WQEs. Its size is set in packets of up to the MTU, up to 8K of them, and a WQE holds fewer such packets as the MTU grows: with 4K pages and an MTU of 9000, a WQE holds 16 of them, so a ring of 8K packets takes 512 WQEs. An XSK RQ can exceed 256 WQEs at any MTU: a WQE holds only 8 or 16 frames of an unaligned UMEM whose frame size is not a power of two, so a ring of 8K frames takes up to 1024 WQEs. The first refill of such an RQ computes 511 missing WQEs, truncates that to 255 and posts them. From then on, the missing count is 256 plus the WQEs consumed since, which truncates to only the consumed ones, so each refill tops the RQ up to 255 WQEs again and never above. The RQ uses at most half of the ring that was configured, and drops bursts that the full ring would absorb. Widen the missing count, the loop counter and the UMR counters to u16, which fits any RQ size. The counters take part of an existing hole, so struct mlx5e_rq keeps its size. The ICOSQ is already sized for the UMR WQEs of the whole RQ, so posting them in one refill fits. Results on ConnectX-7 with an RX ring of 8K packets, at MTU 9000 for the regular RQ. Before this patch that ring behaves as one of 4K packets, and the XSK one as one of 2K frames. Before After Posted WQEs per RQ 255 511 Largest UDP burst with no drops 9000-byte packets 9,000 19,000 1500-byte packets 50,000 100,000 Longest NAPI period with no drops 20 ms 45 ms TCP incast, 200 rounds Dropped packets 22,313 0 Retransmitted segments 20,515 435 Rounds over 200 ms 42 0 Longest round 284 ms 53 ms XSK RQ, MTU 1500, 3072-byte frames Posted WQEs 255 1023 Largest UDP burst with no drops 2,000 8,000 The UDP bursts are of a single flow, and the drops are counted by rx_out_of_buffer. The NAPI period is gro_flush_timeout, with napi_defer_hard_irqs set, under a 21.7 Gb/s stream of 9000-byte packets. In the TCP test, 192 connections on one RX queue send 1MB each at the same time. The XSK frames are of an unaligned UMEM. Fixes: fd9b4be8002c ("net/mlx5e: RX, Support multiple outstanding UMR posts") Signed-off-by: Tariq Toukan Reviewed-by: Dragos Tatulea --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 6 +++--- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index a3945195f454..a794c178a571 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -687,9 +687,9 @@ struct mlx5e_rq { u16 num_strides; u16 actual_wq_head; u8 log_stride_sz; - u8 umr_in_progress; - u8 umr_last_bulk; - u8 umr_completed; + u16 umr_in_progress; + u16 umr_last_bulk; + u16 umr_completed; u8 min_wqe_bulk; u8 page_shift; u8 pages_per_wqe; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 1586cb2404c0..63ac293bfceb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -626,7 +626,7 @@ mlx5e_free_rx_mpwqe(struct mlx5e_rq *rq, struct mlx5e_mpw_info *wi) } } -static void mlx5e_post_rx_mpwqe(struct mlx5e_rq *rq, u8 n) +static void mlx5e_post_rx_mpwqe(struct mlx5e_rq *rq, u16 n) { struct mlx5_wq_ll *wq = &rq->mpwqe.wq; @@ -933,11 +933,11 @@ static void mlx5e_reclaim_mpwqe_pages(struct mlx5e_rq *rq, int head, INDIRECT_CALLABLE_SCOPE bool mlx5e_post_rx_mpwqes(struct mlx5e_rq *rq) { struct mlx5_wq_ll *wq = &rq->mpwqe.wq; - u8 umr_completed = rq->mpwqe.umr_completed; + u16 umr_completed = rq->mpwqe.umr_completed; struct mlx5e_icosq *sq = rq->icosq; bool reclaimed = false; int alloc_err = 0; - u8 missing, i; + u16 missing, i; u16 head; if (unlikely(!test_bit(MLX5E_RQ_STATE_ENABLED, &rq->state))) base-commit: b6c8f45ed340f00bf2004d407cf7316fe3e24c48 -- 2.44.0