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.48.27 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795963225; b=GKUmeStARPBauqAdkiVIeKulGED2We5NnetRYhhTjQF6XsRHb6BLlVlh44vyJwW7zs0t x0dX2FZG4a1aJT+YTbGRlMi5Cq7xKQu/G/abU2Apgnl1N1RelcLrqT7f3+B0vIhaSqwto aD4zOczcyDAgHRTA21F5zBZ/WfrAADhfonfC5nCyB7jppF++BfuIY48HWQt+sWMRMqorJ PJ+gw7sJ2cjsTGoeV6axXnEfzyq0dIFK1afcc3q7IU3BJ+YaYsezHOMiFIV4TGm02bU6x wNSsq3sGEQNQfjx9tv8C5gsdX2U7RaimhP+y39ZuisMD+0LDFAHw14qDzMh4iB+1X7A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795963225; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: 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-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=GueYMAkgury6u1c+r5IxUS7DZBPDuR5SVSgEfO02rZk=; b=eesGS7arbNsfH9rrAThhCc5/cbk1MhQK9zNRWWpLidusxn9Uq51GGacnGKr8hh4uFY6l xQkzzge5A5N11i1QP0eGRFilCgBZLScHUXDmGxWQBwRvKNuAe+8yfzWV3UjPIMtZmS4Ua f2t7aNwvptKuBGQTfdb3d030MsxWhiis5vt8wDa9EFGUIK9JounuJ1RbnBJVLYNi8lF8w 1HPHVLCmpVMix5/tohpOsyBBw90dcRO+Rj0fILzYiOCd52dPsxv/sYVvmEl1QXimuSsQ3 xefuKnodLbuUHlu/rgu/JDSqlFeLfrPAjYoVBFrWiJYy32GNWosepkcy72QcwwF+jJA== 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=hMYNnows; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.48.27 Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11012027.outbound.protection.outlook.com [52.101.48.27]) (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 B84D7606A323; Sun, 29 Nov 2026 14:40:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B84D7606A323 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=hMYNnows ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s1lNKPwDb/ZkOGPQslR0nZPEypyTKrFTK4wp6Z4VapcBBFwdkc2l/Ko8yVS0iKFCGuTCybc+Ho4lXkowIONNrItx3wXkpnuUHW6+jeeUr7yndEJePRuXaO9K6smucCAWNljCS8U7+h11g74cqZzVRbhllLyMQYZ9maHpDZiFpsWFB8kU3aWugpI0YdlnSf1eFHjaidY+Ick8GkEddvTzrCjc+TgrvrC1NhUqwbyJUQjhYb/rDiCdWlgFYFUIvwqwEQEK3ByzYv3E1W5mx0nQNQ/AeACRSswjuOKrj9/n0o5iTRsKeFek1mmn5bFgWlZR3wdo3kUBRgexVEzLvioOTw== 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=GueYMAkgury6u1c+r5IxUS7DZBPDuR5SVSgEfO02rZk=; b=eUGVqW+b1+QZdATugJi0wagcYp8twG89ClxLuy+y1mFWj0oXXYza7CP/VPiXznHpNODrEOMsZ8hhIB1wMPb8MTM851uBDrFpzUv0bH3khxxWCLoKptIUAeQvTbZ4tPrHzIvaiNg7Cu8FSRtzxEDRni4X5UBHWg0BHGDdGfTwfCEjRXCylvGUAaDxWgR9sND/gRiQ2zwH0l2/mi/WA9tI/3qlLGUaMEpR+rnUVXXjVy6EMqTjYMU08U+E1rRkgRo3gp7cq4uHaFC4SDIagpLFXT3ObycXHsIc7ULoTqXEgrk0hr9rmkh6gtJcUDQDQB72auYPAa9cPQXUFOyldNeMSQ== 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=GueYMAkgury6u1c+r5IxUS7DZBPDuR5SVSgEfO02rZk=; b=hMYNnows+qd010jXN09JkJs4XEGnSjLd6ckri6x9JMQOLGit5Gi0zR7psWW51+Ky8vlCAWf3fp6i+Yhwa5guX/vIX1wqN+GIk6lR45vUJNxQB7IyUGeovWzgPu2Wd0RDsAIXNjX9KT57NjMJhCt0lf/aXW+FJdGICrUodSJutdThucrF6mUrJmR2zPGpp1bPlGScLMYQw0wpAMhBvU5q8Bo3TKYdycUJqNscr2NggHWKFMtB4shFBWvP7yzzPirF75ykyfP5dvhhsuYZLp+NIm8L7RfV2fYraAMRz8ODfeg+Rj1YbbK2qbAxYw+jzHZ4NnWwX5TGK5NKXgaEVJM4pw== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5505.namprd12.prod.outlook.com (2603:10b6:208:1ce::7) by LV5PR12MB9828.namprd12.prod.outlook.com (2603:10b6:408:304::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.11; Sun, 29 Nov 2026 14:40:21 +0000 Received: from BL0PR12MB5505.namprd12.prod.outlook.com ([fe80::9329:96cf:507a:eb21]) by BL0PR12MB5505.namprd12.prod.outlook.com ([fe80::9329:96cf:507a:eb21%5]) with mapi id 15.21.0662.007; Sun, 29 Nov 2026 14:40:21 +0000 Message-ID: <1fa2cac2-cced-4cb7-8e32-90863a83a6a6@nvidia.com> Date: Sun, 29 Nov 2026 16:40:17 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next V3 1/5] net/mlx5: nodnic: Introduce the mlx5_nodnic driver To: netdev-bot+sashiko@kernel.org, tariqt@nvidia.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, cjubran@nvidia.com, gal@nvidia.com, linux-kernel@vger.kernel.org, horms@kernel.org References: <20261126182448.707782-2-tariqt@nvidia.com> <179580621973.3135.8962207596415842315@kernel.org> Content-Language: en-US From: Shahar Shitrit In-Reply-To: <179580621973.3135.8962207596415842315@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: TLZP290CA0006.ISRP290.PROD.OUTLOOK.COM (2603:1096:950:9::16) To BL0PR12MB5505.namprd12.prod.outlook.com (2603:10b6:208:1ce::7) 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 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR12MB5505:EE_|LV5PR12MB9828:EE_ X-MS-Office365-Filtering-Correlation-Id: 866d4802-080b-43c0-bf99-08df4e26b20a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|366016|1800799024|10067099003|56012099006|11063799006|5023799004|261021135927099003|261026121527099003|261022113327099003|261026140227099003|261022105027099003|261009223027099003|261021121427099003|261022075727099003|261028144727099003|261102123227099003|261102130727099003|18002099003|22082099003|4143699003|6133799003; X-Microsoft-Antispam-Message-Info: VyEmue+DZwM/Znza2szbNR3yiGSD/jXUZYTsypD+WgGrMexaoVY7ZmPhIwo/S1KBCGCUT2b4BalJ2T1ViyNay1Gp/Lf2qtJ3aozdCj2mSiRPKgCeA4RFq3rN4kytj5Ztbccv8dWHTO4FEx7j0c3UKlvDbXP5ait1ZcZg0Vj1s4Cri0SQUcXcJAVl1jJFJ6EibSOnmmazN+iQdcT871KXmWpi4d9Yb1LnFe6CdjWraVNTKBFSjSE5LVE+kTsSp8864TPb1vovCkpsGxRCoG6wEx+M6Twqh5WCBKA6pAzZvzYvhawWLlb5ErvkKEPZyLz3XOxyMjO+CYvJQp7YGSshj/sIkl6aOqXyRXimIgEtE4gQNuQMAjTYaWzQuInu+iL4RR0Y1gdfPEYJ5E2zym1KmxtGBiaRvvi0Stso30qcXvhEJP769GEFXu4sqsXVzIonzG6/naLcAQPJ8LqRXw6K8F3IHOGgAB2jnjnlq43i1QitqrVP3mzBr2vyq1NEzTlM1cqZfksgJhyFjfAxSmvxRonm+rrgIKVBAsx2avcV5k2IehzHNugRWFx+XK4W+/Ki83YcaXpmgZoL98XPUmBHAYElN86NxZ9LnaBlfFclTxN2cvVtvQMqM0kWzq1VnsCKYpIvPIOnmq287SNaqUPryaFlsZe96eUc43U17Fmp9Uc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5505.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(1800799024)(10067099003)(56012099006)(11063799006)(5023799004)(261021135927099003)(261026121527099003)(261022113327099003)(261026140227099003)(261022105027099003)(261009223027099003)(261021121427099003)(261022075727099003)(261028144727099003)(261102123227099003)(261102130727099003)(18002099003)(22082099003)(4143699003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aHZPYTJLOURheEdqeG9YanQwT2RxZVZGaFN2SE1FYU1TQXcweG0yRlhiVEdL?= =?utf-8?B?UWpHYVdJaldHQmNhRXU2SlRtSVI0UEFVR0ZJcW5Vc1MrNktJMWV3U2J0T3lM?= =?utf-8?B?Qk9yYXFNUnUwQ1V0UE1YY2VYekFRcDdUZkg2SjhwYjBSZVRZbjZvWFlkSmho?= =?utf-8?B?SGhEMmg2QXVtc0dzRWJNeDlTM2xtV2haczNLa1R0VFg1MHlaNDRlcnVyMW5J?= =?utf-8?B?NTNQdGxDdzN3TnpVUyt0VlBrY0k1L29TdlI2WEsxT00vdmNsWG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L0NLbnRaTlUyOXRiSll4aDV6KzNVV1A3UmNVTDlWY0FP?= =?utf-8?B?NGwvVjNWVHluU3VyMm5YM05TQU0wdWFhblltVTR2TEhOL3FNbVV5aFpPd2hv?= =?utf-8?B?YUpwNDc2NzhZSzEyL2xycDZPZHhYa3F2QTJzTUFtREZIZ0QvMHUwdy9zVVJT?= =?utf-8?B?SUhnbFA4aVY4Mkg5TTRQMTRSRDlCM2thLzVUZmtQVVBXNFJ2THA0N3lySkJU?= =?utf-8?B?c2Rzd3VUaG1ZNHdCcFlmN1F1aEF1MW05UE5TOVY1YWhRUU03Wm5hUT09?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 866d4802-080b-43c0-bf99-08df4e26b20a X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5505.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2026 14:40:21.3849 (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: SlXINctv3DX+/VF1iyZcxbPxZM3N4XacXusZsVPNJGXpVL+6MvSMtyHoR9sDjIbvTEyby7ok6mV94ObJufLkBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV5PR12MB9828 On 27/11/2026 21:03, netdev-bot+sashiko@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 11 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 4 · Low: 7 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] mlx5_core's sync FW reset code > (drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c) lists PCI ID… > - [Medium] mlx5_nodnic_update_carrier() calls netif_carrier_event() > whenever the HW state equals the current carrier state, and that… > - [Medium] In mlx5_nodnic_dev_init(), any failure of > mlx5_nodnic_set_nic_interface() jumps to disable_nic ->… > - [Medium] mlx5_nodnic_init_working_buffer() allocates size = 1U << > dev->log_working_buffer_size bytes and gives that buffer's DMA address… > - [Low] The commit message describes mlx5_nodnic as a generic driver for > 'any resource-constrained instantiation of a ConnectX NIC'. > - [Low] One IFC layout, nodnic_q_addr_l.log_size, is used with two > different units and nothing documents the difference. > - [Low] mlx5_nodnic_init_working_buffer() programs PORT_WORK_BUF_ADDR_L > through mlx5_nodnic_write_ring_addr(). > - [Low] mlx5_nodnic_read_mac_address() builds the MAC from raw FW dwords > with u64_to_ether_addr(), and mlx5_nodnic_build_netdev() passes it… > - [Low] Several reserved fields in nodnic_ifc.h have names that break the > mlx5_ifc reserved_at_ convention: - In… > - [Low] mlx5_nodnic_open_queues() acquires the VSC context with > mlx5_nodnic_vsc_context_acquire(). > - [Low] net/mlx5: nodnic: unused definitions and non-static local helpers > > -- > > net/mlx5: nodnic: Introduce the mlx5_nodnic driver > > This commit adds mlx5_nodnic, a PCI driver for DRAM-less ConnectX NIC > functions. It does FLR, firmware readiness polling, NODNIC interface > selection and capability discovery over a PCI config-space VSC gateway. > It then programs the rings, the event IRQ and the MAC address, and > registers a netdev with ndo_open/ndo_stop. > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c >> new file mode 100644 >> index 0000000000000..79cd2527966c4 >> --- /dev/null >> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c >> @@ -0,0 +1,840 @@ > > [ ... ] > >> +static u32 mlx5_nodnic_calc_ring_size(struct mlx5_nodnic_core_dev *dev, >> + int stride) >> +{ >> + u32 ring_size = MLX5_NODNIC_RING_ENTRIES * stride; >> + u32 max_supported = 1U << dev->log_max_ring_size; >> + >> + return min(ring_size, max_supported); >> +} >> + >> +static int mlx5_nodnic_write_ring_size(struct mlx5_nodnic_core_dev *dev, >> + int offset, int size) >> +{ >> + __be32 addr_l; >> + int err; >> + >> + err = mlx5_nodnic_vsc_cfg_read_be32(dev->vsc_ctx, offset, &addr_l); >> + if (err) { >> + mlx5_nodnic_core_err(dev, "failed to read ring size: %d\n", >> + err); >> + return err; >> + } >> + >> + MLX5_SET(nodnic_q_addr_l, &addr_l, log_size, ilog2(size)); > > [Severity: Low] > What unit does the send/receive ring log_size field use? Here size is a > byte count. For the SQ that is 1024 * 64, so log 16. For the RQ it is > 1024 * 16, so log 14. mlx5_nodnic_calc_ring_size() also compares the > byte count with 1 << log_max_ring_size. > > mlx5_nodnic_read_cq_ring_size() reads the same nodnic_q_addr_l layout > from cq_addr_l, but treats it as log2 of an entry count: > > log_cq_size = MLX5_GET(nodnic_q_addr_l, &cq_addr_l, log_size); > cq->num_entries = 1ULL << log_cq_size; > > If the ring field counts entries, the device would see a 65536-entry SQ > and a 16384-entry RQ. Only 64KB and 16KB are allocated. > > Could the unit used by each register be documented, or the conversion > checked? Will add documentation for the units in nodnic_ifc.h. > > [ ... ] > >> +int mlx5_nodnic_init_working_buffer(struct mlx5_nodnic_core_dev *dev) >> +{ >> + struct mlx5_nodnic_ring *work_buf = &dev->priv->working_buffer; >> + u32 size = 1U << dev->log_working_buffer_size; > > [Severity: Medium] > Is log_working_buffer_size really log2 of a byte count? It is a 3-bit > field in nodnic_gen_cfg_caps, so in bytes this buffer could never be > larger than 128 bytes. > > The iPXE/FlexBoot NODNIC implementation (nodnic_port_allocate_eq()) > treats this capability as log2 in KB, (1 << log) * 1024. If the hardware > uses KB, any value of 3 or more gives firmware a buffer smaller than it > expects. Here dma_alloc_coherent() only backs a single page. > > The data path patch later in the series sets dma_en and bus mastering on > every open. Once that happens, could firmware DMA run past this buffer > into adjacent memory? > >> + int err; >> + >> + err = mlx5_nodnic_alloc_ring(dev, work_buf, size); >> + if (err) >> + return err; >> + >> + err = mlx5_nodnic_write_ring_addr(dev, work_buf->dma_handle, >> + MLX5_NODNIC_PORT_WORK_BUF_ADDR_H, >> + MLX5_NODNIC_PORT_WORK_BUF_ADDR_L); > Will fix. > [Severity: Low] > mlx5_nodnic_write_ring_addr() does a read-modify-write of the low > register using the nodnic_q_addr_l layout: > > MLX5_SET(nodnic_q_addr_l, &addr_l, q_addr_l, > lower_32_bits(dma_handle) >> 12); > > That keeps whatever low 12 bits are read back from the device. However, > nodnic_ifc.h defines working_buffer_addr_l as a plain 32-bit field: > > u8 working_buffer_addr_l[0x20]; > > cq_addr_l, by contrast, does use struct mlx5_ifc_nodnic_q_addr_l_bits. > > Is the IFC definition wrong here? If it is right, could non-zero low bits > left in the register end up in the address given to firmware? The working_buffer_addr_l is bits 31:12. > > [ ... ] > >> +static int mlx5_nodnic_open_queues(struct mlx5_nodnic_core_dev *dev) >> +{ >> + struct mlx5_nodnic_vsc_ctx *vsc_ctx = dev->vsc_ctx; >> + int err; >> + >> + /* one doorbell record shared by both SQ and RQ */ >> + err = mlx5_nodnic_alloc_dbr(dev, &dev->priv->dbr); >> + if (err) >> + return err; >> + >> + err = mlx5_nodnic_vsc_context_acquire(vsc_ctx); >> + if (err) >> + goto err_free_dbr; >> + >> + err = mlx5_nodnic_open_sq(dev); > > [Severity: Low] > This isn't a bug, but mlx5_nodnic_vsc_context_acquire() takes > pci_cfg_access_lock() and the hardware VSC semaphore. Both stay held > across every GFP_KERNEL dma_alloc_coherent() call: SQ, RQ, CQ ring, CQ > DBR and working buffer. Later in the series they are also held across > kvcalloc() and request_irq(). > > While they are held, userspace config-space access (lspci, setpci, > sysfs config) blocks in pci_wait_cfg(). Other agents polling the > semaphore keep retrying. > > Could the buffers be allocated before the acquire, as priv->dbr already > is, so that only the register writes happen under the lock? > > [ ... ] > >> +static void mlx5_nodnic_update_carrier(struct mlx5_nodnic_priv *priv, >> + __be32 event) >> +{ >> + u32 port_state = MLX5_GET(nodnic_port_event, &event, port_state); >> + bool up = port_state == MLX5_NODNIC_PORT_STATE_ACTIVE; >> + >> + /* Force re-notification if state is unchanged */ >> + if (up == netif_carrier_ok(priv->netdev)) { >> + netif_carrier_event(priv->netdev); >> + return; >> + } > > [Severity: Medium] > Should the re-notification happen only when up is true? Both > mlx5_nodnic_create_netdev() and mlx5_nodnic_close_locked() leave the > carrier off. So every ndo_open without a link goes down this path: > > mlx5_nodnic_open() > mlx5_nodnic_open_locked() > mlx5_nodnic_refresh_carrier_locked() > mlx5_nodnic_update_carrier() > up == false == netif_carrier_ok() > netif_carrier_event() > > netif_carrier_event() increments both carrier_up_count and > carrier_down_count and fires linkwatch. That records a link flap that > never happened. Event IRQs that arrive while the link stays down would > do the same. It matches the mlx5 behavior and we are fine with that. > [ ... ] > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/main.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/main.c >> new file mode 100644 >> index 0000000000000..b905deda56dcd >> --- /dev/null >> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/main.c >> @@ -0,0 +1,867 @@ > > [ ... ] > >> + err = mlx5_nodnic_vsc_context_acquire(vsc_ctx); >> + if (err) >> + return err; >> + >> + err = mlx5_nodnic_set_nic_interface(dev); >> + mlx5_nodnic_vsc_context_release(vsc_ctx); >> + if (err) { >> + mlx5_nodnic_core_err(dev, >> + "mlx5_nodnic_set_nic_interface failed with error code %d\n", >> + err); >> + goto disable_nic; >> + } > > [Severity: Medium] > Suppose the device doesn't advertise NO_DRAM_NIC. Then > mlx5_nodnic_check_supported() returns -EOPNOTSUPP inside > mlx5_nodnic_set_nic_interface(), and nothing has been written yet: > > err = mlx5_nodnic_check_supported(dev); > if (err) > return err; > > Should that case still jump to disable_nic? > > mlx5_nodnic_dev_cleanup() then writes > MLX5_NODNIC_ISEG_NIC_INTERFACE_DISABLED into nic_interface. It also > calls mlx5_nodnic_wait_fw_init(dev, "teardown"), which can poll for up > to MLX5_NODNIC_FW_INIT_TIMEOUT_MS (120 seconds). > > On a device or firmware without NODNIC support, wouldn't a failed probe > leave the function's interface forced to DISABLED? > The driver only binds to the dedicated NODNIC PF (device ID 0xc2d6), so check_supported() failing is a firmware-misconfiguration case and not something a regular NIC can hit. On that PF, putting the interface to DISABLED on a failed probe is the safe end state. > [ ... ] > >> + mac = ((u64)mac_h << 32) | mac_l; >> + >> + u64_to_ether_addr(mac, dev->mac_address); >> + >> + return 0; >> +} > > [Severity: Low] > Should this MAC be checked with is_valid_ether_addr() before > mlx5_nodnic_build_netdev() passes it to eth_hw_addr_set()? A zero, > multicast or broadcast address from unprovisioned firmware would become > the netdev address unchanged. > > mlx5_nodnic_netdev_ops also has no .ndo_validate_addr. In a similar case > mlx5e falls back to a random address. > > [ ... ] > >> +static const struct pci_device_id mlx5_nodnic_core_pci_table[] = { >> + { PCI_VDEVICE(MELLANOX, 0xc2d6) }, /* BlueField-4 nodnic rshim PF */ >> + { } >> +}; > > [Severity: Low] > The commit message describes a generic driver: > > "... or any resource-constrained instantiation of a ConnectX NIC." > > The only ID bound here is 0xc2d6, the BlueField-4 rshim/management PF. > Because of MODULE_DEVICE_TABLE, the module will autoload on every > BlueField-4 host. It claims BAR0, runs pcie_flr() and switches > nic_interface to NO_DRAM_NIC. > > On remove, mlx5_nodnic_dev_cleanup() writes > MLX5_NODNIC_ISEG_NIC_INTERFACE_DISABLED. It does not restore the > previous value. > > Could the commit message name the device that is bound, and say how > that function's behaviour changes on module load and unload? > >> + >> +MODULE_DEVICE_TABLE(pci, mlx5_nodnic_core_pci_table); >> + >> +static struct pci_driver mlx5_nodnic_core_driver = { >> + .name = KBUILD_MODNAME, >> + .id_table = mlx5_nodnic_core_pci_table, >> + .probe = mlx5_nodnic_probe_one, >> + .remove = mlx5_nodnic_remove_one, >> +}; > > [Severity: Medium] > How does this interact with mlx5_core's sync firmware reset? In > drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c, 0xc2d6 is listed in > mgt_ifc_device_ids: > > { PCI_VDEVICE(MELLANOX, 0xc2d6) }, /* BlueField4 MGT interface device ID */ > > So mlx5_check_dev_ids() skips this function and allows reset now. Then > mlx5_pci_link_toggle(), or mlx5_pci_reset_bus(), resets every function > on the bridge bus: > > devlink reload action fw_activate > mlx5_sync_reset_request_event() > mlx5_is_reset_now_capable() > mlx5_check_dev_ids() /* 0xc2d6 skipped */ > mlx5_pci_link_toggle() > pci_save_state(sdev); pci_cfg_access_lock(sdev); > ... link toggle ... > > Before this patch no in-tree driver bound 0xc2d6. Now a reset like this > wipes the NO_DRAM_NIC interface selection. It also wipes the ring, CQ, > DBR and working buffer addresses programmed through the VSC. > > This pci_driver has no .err_handler (reset_prepare/reset_done), and > there is no re-init path. The health poller added later in the series > only marks the device INTERNAL_ERROR. > > Would the nodnic netdev just stop working until the driver is rebound? FW reset is a follow-feature. For now our workaround is to disable this driver before reset so it doesn't disturb the process. > > [ ... ] > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic_ifc.h b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic_ifc.h >> new file mode 100644 >> index 0000000000000..5939d39ddb9d1 >> --- /dev/null >> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic_ifc.h >> @@ -0,0 +1,317 @@ > > [ ... ] > >> +struct mlx5_ifc_nodnic_iseg_initializing_word_bits { >> + u8 initializing[0x1]; >> + u8 nic_interface_supported[0x7]; >> + u8 embedded_cpu[0x1]; >> + u8 driver_reset_ack[0x1]; >> + u8 recovery[0x1]; >> + u8 pre_boot_bios_hold[0x1]; >> + u8 initializing_state[0x4]; >> + u8 reset_state_machine[0x4]; >> + u8 reserved_at_14[0x1]; >> + u8 pre_boot_action[0x3]; >> + u8 reserved_at_17[0x8]; >> +}; > > [Severity: Low] > This isn't a bug, but several reserved field names don't follow the > reserved_at_ convention: > > - reserved_at_17 here sits at bit 0x18. > - In nodnic_gen_cfg_caps, reserved_at_13 is at bit 0x14 and > reserved_at_1a is at bit 0x1c. > - In nodnic_port_settings, reserved_at_104 is at bit 0x820. > - In nodnic_config_seg, reserved_at_24 is at bit 0x120. > > Also, MLX5_NODNIC_ISEG_CMD_ADDR_L evaluates to 0, relative to the > nodnic_iseg_cmdq_addr_l sub-struct. The other MLX5_NODNIC_ISEG_* > macros are relative to the iseg. Will fix. > > [ ... ] > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h >> --- /dev/null >> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h >> @@ -0,0 +1,105 @@ >> +/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ >> +// Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. >> + >> +#ifndef __MLX5_NODNIC_H__ >> +#define __MLX5_NODNIC_H__ >> + >> +#include >> +#include >> +#include >> + >> +struct mlx5_nodnic_priv; >> + >> +#define mlx5_nodnic_core_dbg(__dev, format, ...) \ >> + dev_dbg((__dev)->device, "%s:%d:(pid %d): " format, \ >> + __func__, __LINE__, current->pid, \ >> + ##__VA_ARGS__) >> + >> +#define mlx5_nodnic_core_err(__dev, format, ...) \ >> + dev_err((__dev)->device, "%s:%d:(pid %d): " format, \ >> + __func__, __LINE__, current->pid, \ >> + ##__VA_ARGS__) >> + >> +#define mlx5_nodnic_core_warn(__dev, format, ...) \ >> + dev_warn((__dev)->device, "%s:%d:(pid %d): " format, \ >> + __func__, __LINE__, current->pid, \ >> + ##__VA_ARGS__) >> + >> +enum { >> + MLX5_NODNIC_PORT_STATE_DOWN, >> + MLX5_NODNIC_PORT_STATE_INITIALIZE, >> + MLX5_NODNIC_PORT_STATE_ARMED, >> + MLX5_NODNIC_PORT_STATE_ACTIVE, >> +}; >> + >> +enum mlx5_nodnic_pci_status { >> + MLX5_NODNIC_PCI_STATUS_DISABLED, >> + MLX5_NODNIC_PCI_STATUS_ENABLED, >> +}; >> + >> +enum mlx5_nodnic_device_state { >> + NODNIC_DEVICE_STATE_UP = 1, >> + NODNIC_DEVICE_STATE_INTERNAL_ERROR, >> +}; >> + >> +enum mlx5_nodnic_msix { >> + MLX5_NODNIC_DATA_MSIX, >> + MLX5_NODNIC_EVENT_MSIX, >> + MLX5_NODNIC_NUM_MSIX, >> +}; >> + >> +struct mlx5_nodnic_vsc_ctx; >> + >> +struct mlx5_nodnic_core_dev { >> + struct mlx5_nodnic_priv *priv; >> + struct device *device; >> + struct pci_dev *pdev; >> + bool netdev_registered; >> + >> + /* sync pci state */ >> + struct mutex pci_status_mutex; >> + enum mlx5_nodnic_pci_status pci_status; >> + >> + struct mlx5_init_seg __iomem *iseg; >> + phys_addr_t bar_addr; >> + struct mlx5_nodnic_vsc_ctx *vsc_ctx; >> + void __iomem *uar_base; >> + >> + u8 log_working_buffer_size; >> + u8 log_max_ring_size; >> + u8 log_uar_page_size; >> + u32 send_ring0_uar_index; >> + >> + u8 mac_address[6]; >> + u32 lkey; >> + >> + int event_irqn; >> + >> + enum mlx5_nodnic_device_state state; >> +}; >> + >> +void mlx5_nodnic_start_health_poll(struct mlx5_nodnic_core_dev *dev); >> +void mlx5_nodnic_stop_health_poll(struct mlx5_nodnic_core_dev *dev); >> + >> +/* >> + * VSC-gated helpers: the caller must hold the VSC context across these calls. >> + */ >> +int mlx5_nodnic_open_rq(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_open_sq(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_open_cq(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_init_working_buffer(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_enable_port(struct mlx5_nodnic_core_dev *dev); >> +void mlx5_nodnic_disable_port(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_get_fw_initializing(struct mlx5_nodnic_core_dev *dev, >> + u8 *initializing); >> +int mlx5_nodnic_set_nic_interface(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_check_supported(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_write_nic_interface(struct mlx5_nodnic_core_dev *dev, >> + int interface); >> +int mlx5_nodnic_read_config(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_validate_port_link_type(struct mlx5_nodnic_core_dev *dev); >> +int mlx5_nodnic_read_mac_address(struct mlx5_nodnic_core_dev *dev); >> + >> +/* end of VSC-gated helpers */ >> + >> +#endif /* __MLX5_NODNIC_H__ */ > > [Severity: Low] > This isn't a bug, but some of the new definitions are unused, and > some helpers are exported with no reason to be. > > struct mlx5_nodnic_working_buffer in en.h is never referenced. > mlx5_nodnic_priv declares working_buffer as a struct mlx5_nodnic_ring, > and the alloc and free paths treat it as one. > > mlx5_nodnic_vsc_cfg_write_cpu32() is declared in nodnic_pci_vsc.h and > defined in nodnic_pci_vsc.c. Nothing calls it, in this patch or later > in the series. > > Every VSC-gated helper declared in nodnic.h is called only from the > file that defines it, even at the end of the series. > > In en_cfg.c these are: > > - mlx5_nodnic_open_rq() > - mlx5_nodnic_open_sq() > - mlx5_nodnic_open_cq() > - mlx5_nodnic_init_working_buffer() > - mlx5_nodnic_enable_port() > - mlx5_nodnic_disable_port() > > In main.c these are: > > - mlx5_nodnic_get_fw_initializing() > - mlx5_nodnic_set_nic_interface() > - mlx5_nodnic_check_supported() > - mlx5_nodnic_write_nic_interface() > - mlx5_nodnic_read_config() > - mlx5_nodnic_validate_port_link_type() > - mlx5_nodnic_read_mac_address() > > They all become global symbols for no benefit. > > Could these be made static and their prototypes dropped from > nodnic.h? The note about holding the VSC context could move to the > definitions. > > In this patch, mlx5_nodnic_enable_port() and > mlx5_nodnic_disable_port() have no callers at all. Making them static > here would trigger -Wunused-function. Would it be better to add them > in the patch that first uses them? >