From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out28-2.mail.aliyun.com (out28-2.mail.aliyun.com [115.124.28.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD550238C0A; Wed, 8 Jul 2026 06:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.2 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783493279; cv=none; b=lrvRxTQK1lq5ZbUTrH8YP4Z4gclgfsa4w17dSaWBaMTuH5oV0sS4SZWNMNgRqmYEX6Yeh2fB8XvF12k1jDJmSc9QPAoVIRxC4BhNbKoumIXDYbwsrDrvDlehI1TkTe88UuF4ijyC+h638UlAJQ4I7IvbPn3/MYBYZyKbUzVPOq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783493279; c=relaxed/simple; bh=wIX1BvCIs1OXFmwJwQEczccJqPrxCV4oqY17ez/4b3s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=SUk6G1MsQkwKJ6Sp+nhldqArDrayOqUNqszTOoyuA507/uQm6WywfeunUMLq5yyb1NvxRWLKcKavdW1mlpHRJb0YHeSaZW85wrpmtezUL6QX3x7NIZjZdTA9EaKXO+DR7f6nCDyAz867xBctY7W6lrNbUs79RfpuGt6C4Q2FJN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nebula-matrix.com; spf=pass smtp.mailfrom=nebula-matrix.com; arc=none smtp.client-ip=115.124.28.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nebula-matrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nebula-matrix.com X-Alimail-AntiSpam:AC=CONTINUE;BC=0.07329495|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_alarm|0.104959-0.00966442-0.885376;FP=2626160830735468050|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033032062159;MF=illusion.wang@nebula-matrix.com;NM=1;PH=DS;RN=18;RT=18;SR=0;TI=SMTPD_---.iG5uJ.5_1783493265; Received: from localhost.localdomain(mailfrom:illusion.wang@nebula-matrix.com fp:SMTPD_---.iG5uJ.5_1783493265 cluster:ay29) by smtp.aliyun-inc.com; Wed, 08 Jul 2026 14:47:46 +0800 From: "illusion.wang" To: dimon.zhao@nebula-matrix.com, illusion.wang@nebula-matrix.com, alvin.wang@nebula-matrix.com, sam.chen@nebula-matrix.com, netdev@vger.kernel.org Cc: andrew+netdev@lunn.ch, corbet@lwn.net, kuba@kernel.org, horms@kernel.org, linux-doc@vger.kernel.org, pabeni@redhat.com, vadim.fedorenko@linux.dev, lukas.bulwahn@redhat.com, edumazet@google.com, enelsonmoore@gmail.com, skhan@linuxfoundation.org, hkallweit1@gmail.com, linux-kernel@vger.kernel.org (open list) Subject: [PATCH v21 net-next 00/12] nbl driver for Nebulamatrix NICs Date: Wed, 8 Jul 2026 14:47:26 +0800 Message-ID: <20260708064742.35391-1-illusion.wang@nebula-matrix.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: illusion wang This patch series represents the first phase. We plan to integrate it in two phases: the first phase covers mailbox and chip configuration, while the second phase involves net dev configuration. Together, they will provide basic PF-based Ethernet port transmission and reception capabilities. After that, we will consider other features, such as ethtool support, flow management, adminq messaging, VF support, debugfs support, etc. To ensure compatibility, our architecture is divided into the following layers: 1. Dev Layer (Device Layer) The top-level business logic layer where all operations are device-centric. Every operation is performed relative to the device context. The intergration of base functions encompasses: management(ctrl only for leonis pf0), network(net_dev,this time not contained),common. 2. Dispatch Layer The distribution from services to specific data operations is mainly divided into two types: direct pass-through and handling by the management PF. It shields the upper layer from the differences in specific underlying locations. It describes the processing locations and paths of the services. 3. Resource Layer Handles tasks dispatched from Dispatch Layer. These tasks fall into two categories: 3.1 Hardware control The Resource Layer further invokes the HW Layer when hardware access is needed, as only the HW Layer has OS-level privileges. 3.2 Software resource management Operations like packet statistics collection that don't require hardware access. 4. HW Layer (Hardware Layer) Serves the Resource Layer by interacting with different hardware chipsets.Writes to hardware registers to drive the hardware based on Resource Layer directives. 5. Channel Layer Handle communication between PF0(has ctrl func) and other PF,and provide basic interaction channels. 6. Common Layer Provides fundamental services changes v20->v21 Link to v20:https://lore.kernel.org/netdev/20260630010718.4346-1-illusion.wang@nebula-matrix.com/ I have dropped the old Patch 2 titled "add our driver architecture" Add new Patch 2 "add core driver architecture and HW layer initialization". Split original patch8 into three separate patches as suggested changes v19->v20 Link to v19:https://lore.kernel.org/netdev/20260617044702.2439-1-illusion.wang@nebula-matrix.com/ Starting from V20, I have dropped the old Patch 3 titled "P4 configuration invoked during chip initialization". This functionality will be reimplemented in next phase using the request_firmware() API with an external firmware blob. changes v18->v19 Link to v18:https://lore.kernel.org/netdev/20260611044916.2383-1-illusion.wang@nebula-matrix.com/ changes v17->v18 Link to v17:https://lore.kernel.org/netdev/20260601093149.25905-1-illusion.wang@nebula-matrix.com/ changes v16->v17 Link to v16:https://lore.kernel.org/netdev/20260526035453.2359-1-illusion.wang@nebula-matrix.com/ AI review issues changes v15->v16 Link to v15:https://lore.kernel.org/netdev/20260520032950.4874-1-illusion.wang@nebula-matrix.com/ AI review issues changes v14->v15 Link to v14:https://lore.kernel.org/netdev/20260513011649.4404-1-illusion.wang@nebula-matrix.com/ AI review issues changes v13->v14 Link to v13:https://lore.kernel.org/netdev/20260428114910.2616-1-illusion.wang@nebula-matrix.com/ AI review issues changes v12->v13 Link to v12:https://lore.kernel.org/netdev/20260415033608.2438-1-illusion.wang@nebula-matrix.com/ AI review issues changes v11->v12 Link to v11:https://lore.kernel.org/netdev/20260408093739.56001-1-illusion.wang@nebula-matrix.com/ AI review issues changes v10->v11 Link to v10:https://lore.kernel.org/netdev/20260401022318.28550-1-illusion.wang@nebula-matrix.com/ 1.Issues found by Mohsin 2.AI review issues changes v9->v10 Link to v9:https://lore.kernel.org/netdev/20260325040048.2313-1-illusion.wang@nebula-matrix.com/ 1.Issues found by Jakub 2.AI review issue changes v8->v9 Link to v8:https://lore.kernel.org/netdev/20260317034533.5600-1-illusion.wang@nebula-matrix.com/ 1.Issues found by Jakub 2.AI review issue Changes v7→v8 Link to v7:https://lore.kernel.org/netdev/20260310120959.22015-1-illusion.wang@nebula-matrix.com/ 1.Issues found by Paolo Changes v6->v7 Link to v6:https://lore.kernel.org/netdev/20260306033451.5196-1-illusion.wang@nebula-matrix.com/ 1.Issue found by Jakub 2.AI review issue Changes v5->v6 Link to V5:https://lore.kernel.org/netdev/20260226073840.3222-1-illusion.wang@nebula-matrix.com/ 1.put all standard linux includes files the .c file which needs it & others --Andrew 2.AI review issue Changes v4->v5 Link to V4:https://lore.kernel.org/netdev/20260206021608.85381-1-illusion.wang@nebula-matrix.com/ 1.change nbl_core to nbl & change ** pointers to *pointers & others --Andrew 2.AI review issue Changes v3->v4 Link to v3: https://lore.kernel.org/netdev/20260123011804.31263-1-illusion.wang@nebula-matrix.com 1.cut down to part of a mini driver(mailbox and chip init) --Jakub Kicinski Simon Horman(some sort of staged approached) 2.modify issues found by ai. 3. Reverse Christmas tree/nbl_err/devm_kfree/remove some macros/ void type to real type/others --Andrew Lunn 4.change deprecated pci_enable_msix_range to pci_alloc_irq_vectors 5.delete service layer 6.the style of kconfig---Randy Dunlap 7.add to Documentation/networking/device_drivers/ethernet/index.rst --Simon Horman Changes v2 →v3 Link to v2: https://lore.kernel.org/netdev/20260109100146.63569-1-illusion.wang@nebula-matrix.com/ 1.cut down to a mini driver: delete vf support use promisc mode to cut down flow management drop patch15 in v2 delete adminq msg delete abnormal handling delete some unimportant interfaces 2.modify issues found by ai review Changes v1->v2 Link to v1: https://lore.kernel.org/netdev/20251223035113.31122-1-illusion.wang@nebula-matrix.com/ 1.Format Issues and Compilation Issues - Paolo Abeni 2.add sysfs patch and drop coexisting patch - Andrew Lunn 3.delete some unimportant ndo operations 4.add machine generated headers patch 5.Modify the issues found in patch1-2 and apply the same fixes to other patches 6.modify issues found by nipa illusion wang (12): net/nebula-matrix: add minimum nbl build framework net/nebula-matrix: add core driver architecture and HW layer initialization net/nebula-matrix: add channel wire opcode enum definitions net/nebula-matrix: add channel layer net/nebula-matrix: add common resource implementation net/nebula-matrix: add intr resource implementation net/nebula-matrix: add vsi resource implementation net/nebula-matrix: dispatch: add control-level routing core infrastructure net/nebula-matrix: dispatch: add cross-version channel message framework net/nebula-matrix: dispatch: add resource ops lock protection net/nebula-matrix: add common/ctrl dev init/remove operation net/nebula-matrix: add common dev start/stop operation .../device_drivers/ethernet/index.rst | 1 + .../ethernet/nebula-matrix/nbl.rst | 28 + MAINTAINERS | 10 + drivers/net/ethernet/Kconfig | 1 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/nebula-matrix/Kconfig | 34 + drivers/net/ethernet/nebula-matrix/Makefile | 6 + .../net/ethernet/nebula-matrix/nbl/Makefile | 15 + .../nbl/nbl_channel/nbl_channel.c | 1098 +++++++++++++++++ .../nbl/nbl_channel/nbl_channel.h | 168 +++ .../nebula-matrix/nbl/nbl_common/nbl_common.c | 183 +++ .../nebula-matrix/nbl/nbl_common/nbl_common.h | 33 + .../net/ethernet/nebula-matrix/nbl/nbl_core.h | 56 + .../nebula-matrix/nbl/nbl_core/nbl_dev.c | 464 +++++++ .../nebula-matrix/nbl/nbl_core/nbl_dev.h | 55 + .../nebula-matrix/nbl/nbl_core/nbl_dispatch.c | 540 ++++++++ .../nebula-matrix/nbl/nbl_core/nbl_dispatch.h | 42 + .../nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c | 982 +++++++++++++++ .../nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.h | 368 ++++++ .../nbl_hw_leonis/nbl_resource_leonis.c | 295 +++++ .../nbl_hw_leonis/nbl_resource_leonis.h | 12 + .../nebula-matrix/nbl/nbl_hw/nbl_hw_reg.h | 73 ++ .../nebula-matrix/nbl/nbl_hw/nbl_interrupt.c | 288 +++++ .../nebula-matrix/nbl/nbl_hw/nbl_interrupt.h | 21 + .../nebula-matrix/nbl/nbl_hw/nbl_resource.c | 148 +++ .../nebula-matrix/nbl/nbl_hw/nbl_resource.h | 108 ++ .../nebula-matrix/nbl/nbl_hw/nbl_vsi.c | 26 + .../nebula-matrix/nbl/nbl_hw/nbl_vsi.h | 12 + .../nbl/nbl_include/nbl_def_channel.h | 371 ++++++ .../nbl/nbl_include/nbl_def_common.h | 68 + .../nbl/nbl_include/nbl_def_dev.h | 16 + .../nbl/nbl_include/nbl_def_dispatch.h | 42 + .../nbl/nbl_include/nbl_def_hw.h | 53 + .../nbl/nbl_include/nbl_def_resource.h | 38 + .../nbl/nbl_include/nbl_include.h | 66 + .../net/ethernet/nebula-matrix/nbl/nbl_main.c | 253 ++++ 36 files changed, 5975 insertions(+) create mode 100644 Documentation/networking/device_drivers/ethernet/nebula-matrix/nbl.rst create mode 100644 drivers/net/ethernet/nebula-matrix/Kconfig create mode 100644 drivers/net/ethernet/nebula-matrix/Makefile create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/Makefile create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_channel/nbl_channel.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_channel/nbl_channel.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_common/nbl_common.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_common/nbl_common.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_core.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dev.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dev.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_core/nbl_dispatch.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_hw_leonis.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_resource_leonis.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_leonis/nbl_resource_leonis.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_hw_reg.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_interrupt.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_interrupt.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_resource.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_resource.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_vsi.c create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_hw/nbl_vsi.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_channel.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_common.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_dev.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_dispatch.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_hw.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_def_resource.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_include/nbl_include.h create mode 100644 drivers/net/ethernet/nebula-matrix/nbl/nbl_main.c -- 2.47.3