Article View: linux.kernel.netdev
Article #23130[PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver
From: "Xin Tian"
Date: Thu, 26 Nov 2026 14:57
Date: Thu, 26 Nov 2026 14:57
142 lines
16375 bytes
16375 bytes
This is the first series of v2 for the Yunsilicon XSC converged network
adapter (PCI vendor 0x1f67). Responding to the review of v1, this is a
much smaller, self-contained ethernet-only driver: about 5.7k added
lines, down from the combined ethernet and RDMA driver in v1.
The driver is split into the same two modules as before, which share the
xsc prefix and talk over the auxiliary bus:
1. xsc_pci (CONFIG_YUNSILICON_XSC_PCI) - the PCI core driver. Owns the
PCI function, the command queue, the event queues, MSI-X and the
CQ/QP resource pools, and publishes one auxiliary device per PF.
Patches 01-06.
2. xsc_eth (CONFIG_YUNSILICON_XSC_ETH) - the ethernet driver. Binds to
the auxiliary device, registers the netdev, brings up a single TX/RX
queue pair with NAPI and page_pool, and tracks the link state from
the port events. Patches 07-11.
Patch 01 adds the MAINTAINERS entry together with the Kbuild plumbing.
To keep the series within the requested size, this first series
deliberately omits RDMA, statistics, offloads (TSO/checksum), RSS and the
configuration interfaces (ethtool, module parameters, ndo_change_mtu).
Only the compressed-BAR PF form of the hardware is supported. These will
be submitted as follow-up series once the base driver is accepted.
The series is split so that every patch builds cleanly with GCC 8.3.1 and
W=1. The core patches add the command queue, capabilities, event queues
and resource pools incrementally, and the ethernet patches register the
netdev first, then add the channel and link handling, and finally the TX
and RX data paths.
Changes since v1:
- Split the combined ethernet+RDMA driver into a minimal ethernet-only
first series, about 5.7k added lines instead of 10k, as requested.
Addressing the netdev review of the v1 netdev patch:
- Register the link event handler before register_netdevice(), keying the
interface off xdev->eth_priv which is set before registration.
- Use ether_addr_copy() to copy the firmware MAC address.zaizuo
- Drop the unreachable NULL checks in the remove path.
- Move xsc_cqwq_get_cqe() out of the header into xsc_eth_txrx.c.
- Drop the unreachable "already opened"/"not opened" branches in
ndo_open()/ndo_stop(); the netdev core serialises these via rtnl.
- Keep xsc_set_port_admin_status() void: it runs after open/close, a
rejected call is legitimate (VF, port_link_en, multi-function
arbitration, old firmware), and the real carrier comes from the link
events and QUERY_VPORT_STATE, so we log and carry on.
Xin Tian (11):
net/xsc: add Yunsilicon XSC ethernet PCI driver skeleton
net/xsc: add doorbell and cmdq MMIO accessors
net/xsc: add the command queue
net/xsc: query HCA capabilities and reset function resources
net/xsc: add event queues and MSI-X
net/xsc: add CQ and QP helpers
net/xsc: add the ethernet netdev
net/xsc: add the single TX/RX channel
net/xsc: report link state changes
net/xsc: add the transmit path
net/xsc: add the receive path
MAINTAINERS | 7 +
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/yunsilicon/Kconfig | 27 +
drivers/net/ethernet/yunsilicon/Makefile | 9 +
.../ethernet/yunsilicon/xsc/common/xsc_cmd.h | 560 ++++++++
.../ethernet/yunsilicon/xsc/common/xsc_core.h | 311 +++++
.../ethernet/yunsilicon/xsc/common/xsc_reg.h | 23 +
.../net/ethernet/yunsilicon/xsc/net/Kconfig | 17 +
.../net/ethernet/yunsilicon/xsc/net/Makefile | 9 +
.../net/ethernet/yunsilicon/xsc/net/main.c | 1161 +++++++++++++++++
.../net/ethernet/yunsilicon/xsc/net/xsc_eth.h | 33 +
.../yunsilicon/xsc/net/xsc_eth_common.h | 117 ++
.../ethernet/yunsilicon/xsc/net/xsc_eth_rx.c | 210 +++
.../ethernet/yunsilicon/xsc/net/xsc_eth_tx.c | 87 ++
.../yunsilicon/xsc/net/xsc_eth_txrx.c | 95 ++
.../yunsilicon/xsc/net/xsc_eth_txrx.h | 36 +
.../ethernet/yunsilicon/xsc/net/xsc_eth_wq.c | 80 ++
.../ethernet/yunsilicon/xsc/net/xsc_eth_wq.h | 150 +++
.../ethernet/yunsilicon/xsc/net/xsc_queue.h | 103 ++
.../net/ethernet/yunsilicon/xsc/pci/Kconfig | 16 +
.../net/ethernet/yunsilicon/xsc/pci/Makefile | 9 +
.../net/ethernet/yunsilicon/xsc/pci/adev.c | 133 ++
.../net/ethernet/yunsilicon/xsc/pci/adev.h | 14 +
.../net/ethernet/yunsilicon/xsc/pci/alloc.c | 225 ++++
.../net/ethernet/yunsilicon/xsc/pci/alloc.h | 18 +
drivers/net/ethernet/yunsilicon/xsc/pci/cmd.c | 708 ++++++++++
drivers/net/ethernet/yunsilicon/xsc/pci/cmd.h | 87 ++
drivers/net/ethernet/yunsilicon/xsc/pci/cq.c | 130 ++
drivers/net/ethernet/yunsilicon/xsc/pci/cq.h | 13 +
.../ethernet/yunsilicon/xsc/pci/doorbell.c | 148 +++
drivers/net/ethernet/yunsilicon/xsc/pci/eq.c | 300 +++++
drivers/net/ethernet/yunsilicon/xsc/pci/eq.h | 38 +
.../net/ethernet/yunsilicon/xsc/pci/main.c | 282 ++++
.../net/ethernet/yunsilicon/xsc/pci/pci_irq.c | 345 +++++
.../net/ethernet/yunsilicon/xsc/pci/pci_irq.h | 16 +
drivers/net/ethernet/yunsilicon/xsc/pci/qp.c | 180 +++
drivers/net/ethernet/yunsilicon/xsc/pci/qp.h | 14 +
.../net/ethernet/yunsilicon/xsc/pci/vport.c | 36 +
39 files changed, 5749 insertions(+)
create mode 100644 drivers/net/ethernet/yunsilicon/Kconfig
create mode 100644 drivers/net/ethernet/yunsilicon/Makefile
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/common/xsc_cmd.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/common/xsc_core.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/common/xsc_reg.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/Kconfig
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/Makefile
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/main.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_common.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_rx.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_tx.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_txrx.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_txrx.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_wq.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_eth_wq.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/net/xsc_queue.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/Kconfig
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/Makefile
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/adev.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/adev.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/alloc.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/alloc.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/cmd.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/cmd.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/cq.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/cq.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/doorbell.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/eq.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/eq.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/main.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/pci_irq.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/pci_irq.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/qp.c
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/qp.h
create mode 100644 drivers/net/ethernet/yunsilicon/xsc/pci/vport.c
--
2.43.0
Technical Details
Message-ID:
<20261126145711.70868-1-tianx@yunsilicon.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!border-2.nntp.ord.giganews.com!border-4.nntp.ord.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372178-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!border-2.nntp.ord.giganews.com!border-4.nntp.ord.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372178-linux-kernel-netdev=dewy.ru
From: tianx@yunsilicon.com ("Xin Tian")
Newsgroups: linux.kernel.netdev
Subject: [PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver
Date: Thu, 26 Nov 2026 22:57:47 +0800
Organization: Usenet Network
Message-ID: <20261126145711.70868-1-tianx@yunsilicon.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="491304"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Fpw68lPrDmK3Bi/hYLcZdTuqwEU= sha256:xJ44Epp6+MIrSv956Wpmsj2MnMFO7G/wQNeJ3emJzgo=
sha1:Ou1Bm+SxftA+yfMqYmfk0+4kq/M= sha256:Z+/nlhvqVcr7bgK1g/7XfIVStIEgjgkrBArfUBG+8aQ=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 9DA7A125EDC; Thu, 26 Nov 2026 17:58:42 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=yunsilicon.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id JIYefpV6yrM1;
Thu, 26 Nov 2026 17:58:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-372178-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=yunsilicon.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id B6D9E125EE0; Thu, 26 Nov 2026 17:58:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id B0920609B2F; Thu, 26 Nov 2026 14:58:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795705074;
b=4BBwVkGFsbJojwypbhRdKnrqG7yN3EOv9Qie/WfLwz3ZN/MkpppLWTfjD83UuUvcQd9H
ZmxwfNPa5XbqmKDpnk++XOE+XRsr2NU4NJM7MTzlZkoLoZca02rWiDqvTc3eSxlesSHL5
bYJ9olTH1ID6ggN1Mtr7kji6DNgQNqKj+qW7mKUhtA7vihF9kiJjg1bMFouAo1WF1Vx7s
2Z6IPbjm71PAQsNF42b6wdO+EhHx4EOfWToAxdFSR4Q2IPwbrMTjLGMB929t/Uk0WhCmk
wvf3MG8XZEeTwecsu4PzIwvX4N48yGaCiWqzgN7wrs5Er5G6xjOX5xLSbJRpJDIU/tA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795705074;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:Mime-Version:Received:Date:
Content-Transfer-Encoding:Cc:From:Subject:Content-Type:
X-Lms-Return-Path:X-Mailer:To:Message-Id:X-Original-From;
bh=0LTdOK9tx9CP0JabyqH2MvjVufp0ukif7P+g3Z1t9wM=;
b=iXAE0SJ4yu1FcfjpXhy7491fuSIzZneImmkXT6/oPli8o2eCXXsax7eGUPIen7s87u4D
sD55Xnq7jhGarjQ+3GJhoNaSPC4a5uyMw7inwlxVOOEu3fs1KC6FZ5ufweHEQftAul/fS
IQdk53Zu6RW7NdvofL1TvgWwl4toveOkjLI8AQSq13J6KkTrpUWamc+he3EE6xU1Aiw8m
N1Ch3+uGycabHz8A+ey2QTaEmGYgGU2hgPRnMHGGxzvd/4vEJyKe5eUD8IOyNv8xDGSh+
D9/ykQ9HRF1FKKm43HFNFtoYp9jZ514uLUoUnaQDX5ozbJr4w8R6fomebqrXVHPS7rQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=yunsilicon.com header.i=@yunsilicon.com header.a=rsa-sha256 header.s=feishu2403070942 header.b=XTNpCxVO;
dmarc=none header.from=yunsilicon.com;
spf=pass smtp.mailfrom=yunsilicon.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 91B2D60A3816;
Thu, 26 Nov 2026 14:57:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=yunsilicon.com header.i=@yunsilicon.com header.a=rsa-sha256 header.s=feishu2403070942 header.b=XTNpCxVO
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.59
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795705073;
b=OtwlqDAKOeaeB/YDh1ZW6NKj8+HhCLbIuQpB7sLDpcx4PMQe42qUdxuD2bXt1WT8bIB0
QbFF98l6TSA0MWQc//HyfTYu+Kha7INCgZiehzdS7DTg5tPc4z7jCdXTPTtBm8wTjQ4aq
2lIy19Asy0upWzz+5lIcgnJitTH8cMj7I3ayJDvMVByQ6Ou85bE2HWAISlNBBHLYduRHz
gLjksPjd5Ot/p4HI08MEHyeNnQxMQbQ9o1ukNk72dTZwk5m+8pWhs/92B79zfEmir8qnm
bkFy/yWJPo2eFFLmvbfbd7d8ao2uXJQ4QUTqLrWpEHtubc7F7/03TOlk1N3LlY5wA5A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795705073;
h=DMARC-Filter:DKIM-Signature:Mime-Version:Received:Date:
Content-Transfer-Encoding:Cc:From:Subject:Content-Type:
X-Lms-Return-Path:X-Mailer:To:Message-Id:X-Original-From;
bh=0LTdOK9tx9CP0JabyqH2MvjVufp0ukif7P+g3Z1t9wM=;
b=Bz6/dolhZIWVnl70g036qhR4VapNTuj6VSudhTfTI6Q3cEBXV/8rTQP0ISNTVyi5BEaI
H9lzHqGeI5084XATXGmnhwVOaHSSBEtAPxsVzzmfjDxpYYqdUFLi5YJqU3kIY8HsvHvap
LfMumue7B8B4zl2ltGuKhLBmxEpP1ZoezxqURAAca9jfIUNP0YZP4lEM/GjvNnROtsfKD
J8fYHbRpiovldX+GOyw8WN3olfEDbfyC7ib+3eeiwElhhk+F4qOwJjZWHw4i5QjSggwJ8
bN64CeqYHDvGUXPHAZXRPLwrod9fEPH8V38qa1W+Qv656AaYEXX65/WHPwKBC+NMXlQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=yunsilicon.com;
spf=pass smtp.mailfrom=yunsilicon.com;
dkim=pass header.d=yunsilicon.com header.i=@yunsilicon.com header.a=rsa-sha256 header.s=feishu2403070942 header.b=XTNpCxVO;
arc=none smtp.remote-ip=209.127.231.59
X-Received: from va-2-59.ptr.blmpb.com (va-2-59.ptr.blmpb.com [209.127.231.59])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4952660A3806
for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 14:57:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4952660A3806
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=yunsilicon.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yunsilicon.com
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
s=feishu2403070942; d=yunsilicon.com; t=1795705069; h=from:subject:
mime-version:from:date:message-id:subject:to:cc:reply-to:content-type:
mime-version:in-reply-to:message-id;
bh=0LTdOK9tx9CP0JabyqH2MvjVufp0ukif7P+g3Z1t9wM=;
b=XTNpCxVOBjAzB6VIUnxipHJxJn8BE+EP+r2qmsBXQX4H/BYNa8poeC8Ro4hFHmFQntldFg
/QzmeU7yN96hs/d/WB/tsQv4ScaXPfE/Wv56hu6oxiD5oKN7jAfJZ44+HW5CfrkH3rbJwG
xo0VFx0tQQ3b5id4kCrGKa6+nAjTrCqPCTxne7lHsGKkBUqYrgQmRVZiqPnwfZrWDD0vkB
ry8XIpJ7IvEjKbkmpbZcquMr4Q+bBDzkdLY7MiF/o1/7qP6P+A3P1mQoB0UCIR1ZiNPxr1
tkgUobN8q5s61teXcRSj7R8B9WZRIiNs7aSs6ttPrhgcla4pRKqzwFrVvQ02Lg==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Received: from DESKTOP-TGBQGEC.localdomain ([183.193.56.110]) by smtp.feishu.cn with ESMTPS; Thu, 26 Nov 2026 22:57:47 +0800
X-Cc: <weihg@yunsilicon.com>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
<kerneljasonxing@gmail.com>
X-Lms-Return-Path: <lba+26b0848eb+18bc7a+vger.kernel.org+tianx@yunsilicon.com>
X-Mailer: git-send-email 2.25.1
X-Original-From: Xin Tian <tianx@yunsilicon.com>
Lines: 141