Skip to content

eth: mpnic: initial support for Meta Platforms NIC

Daniel Zahka bpf lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20260918-linux-mpnic-8fa318d530fa

Versions newest first

  1. v2 Latest8 patches 10 repliesApplied 8/8
  2. v18 patches 7 repliesSuperseded

Changes in v2 from the cover letter · 20 lines

- eth: mpnic: add register init for the device
- derive the TQS TXB credit limits from the TXB private credit config
- program the BMC to MAC XOFF threshold (TXB_THRESHOLDS_P0[16])
instead of the host to BMC one, and drop the now unused MPNIC_TXB_BMC_THRESH
- drop L2_HLEN from the default TWD, it only matters for csum/LSO
- eth: mpnic: implement Tx queue allocation and cleanup
- add mpnic_nv_irq_trigger()
- eth: mpnic: add a netdevice and basic Tx handling
- trim the real Tx queue count before register_netdev()
- eth: mpnic: implement Rx queue allocation and cleanup
- drop an inaccurate comment on mpnic_bdq_desc_unused()
- drop the unused data_truesize field from struct mpnic_pkt_ctxt
- trim the real Rx queue count before register_netdev() too
- eth: mpnic: add basic Rx handling
- skip Rx cleaning and BDQ refill when polled with a budget of 0 (netpoll), page pool must not be used in that context
- keep struct mpnic_pkt_ctxt instead of replacing it with a bare xdp_buff, and move add_frag_failed into it
- give each Rx queue only the NAPI budget left over by the previous
ones instead of the full budget
- sync Rx buffers for the CPU with page_pool_dma_sync_for_cpu() instead of dma_sync_single_range_for_cpu()
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 All 8 applied

#Subject and filesSizeRepliesApplied
1/8eth: mpnic: add scaffolding for Meta Platforms NICdrivers/net/ethernet/meta/Kconfig drivers/net/ethernet/meta/Makefile drivers/net/ethernet/meta/mpnic/Makefile +3 more+236 -01 replyApplied
2/8eth: mpnic: add register init for the devicedrivers/net/ethernet/meta/mpnic/Makefile drivers/net/ethernet/meta/mpnic/mpnic.h drivers/net/ethernet/meta/mpnic/mpnic_csr.h +2 more+737 -01 replyApplied
3/8eth: mpnic: allocate MSI-X vectorsdrivers/net/ethernet/meta/mpnic/Makefile drivers/net/ethernet/meta/mpnic/mpnic.h drivers/net/ethernet/meta/mpnic/mpnic_irq.c +1 more+88 -11 replyApplied
4/8eth: mpnic: implement Tx queue allocation and cleanupdrivers/net/ethernet/meta/mpnic/Makefile drivers/net/ethernet/meta/mpnic/mpnic_csr.h drivers/net/ethernet/meta/mpnic/mpnic_netdev.h +2 more+625 -01 replyApplied
5/8eth: mpnic: start and stop the Tx HW queuesdrivers/net/ethernet/meta/mpnic/mpnic_csr.h drivers/net/ethernet/meta/mpnic/mpnic_txrx.c drivers/net/ethernet/meta/mpnic/mpnic_txrx.h+207 -01 replyApplied
6/8eth: mpnic: add a netdevice and basic Tx handlingdrivers/net/ethernet/meta/mpnic/Makefile drivers/net/ethernet/meta/mpnic/mpnic.h drivers/net/ethernet/meta/mpnic/mpnic_csr.h +5 more+381 -01 replyApplied
7/8eth: mpnic: implement Rx queue allocation and cleanupdrivers/net/ethernet/meta/Kconfig drivers/net/ethernet/meta/mpnic/mpnic_csr.h drivers/net/ethernet/meta/mpnic/mpnic_netdev.c +3 more+554 -451 replyApplied
8/8eth: mpnic: add basic Rx handlingdrivers/net/ethernet/meta/mpnic/mpnic_csr.h drivers/net/ethernet/meta/mpnic/mpnic_txrx.c drivers/net/ethernet/meta/mpnic/mpnic_txrx.h+212 -52 repliesApplied

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchJakub Kicinski
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/8] eth: mpnic: initial support for Meta Platforms NIC

Meta Platforms NIC is the second-generation NIC from Meta. There are quite a few high-level similarities to fbnic, but all of the CSRs and descriptors have been reshuffled, and new features have been added. Since the device is sufficiently different from fbnic, and the design of our FW is minimal, we have decided a separate driver is appropriate.

Major new features compared to fbnic will take a while to land. This series includes only the bare-bones Tx/Rx datapath.

Our high-level patch sequence and plan for the upcoming series is:
1. Core datapath (this series)
2. Basic offloads, RSS, and counters
3. Firmware mailbox support
4. Base ethtool operations

This patch series was prepared in part with these LLM prompts:
https://github.com/kuba-moo/ai-prompts/blob/main/driver-upstreaming-prompts.md

The prompts were used to distill our fully-featured OOT driver into this minimal Tx/Rx capable upstream driver. We then performed human review on the output to create this posting. Jakub has made the prompts public in case people would like to take a look.

---
Changes in v2:
- eth: mpnic: add register init for the device
- derive the TQS TXB credit limits from the TXB private credit config
- program the BMC to MAC XOFF threshold (TXB_THRESHOLDS_P0[16])
instead of the host to BMC one, and drop the now unused MPNIC_TXB_BMC_THRESH
- drop L2_HLEN from the default TWD, it only matters for csum/LSO
- eth: mpnic: implement Tx queue allocation and cleanup
- add mpnic_nv_irq_trigger()
- eth: mpnic: add a netdevice and basic Tx handling
- trim the real Tx queue count before register_netdev()
- eth: mpnic: implement Rx queue allocation and cleanup
- drop an inaccurate comment on mpnic_bdq_desc_unused()
- drop the unused data_truesize field from struct mpnic_pkt_ctxt
- trim the real Rx queue count before register_netdev() too
- eth: mpnic: add basic Rx handling
- skip Rx cleaning and BDQ refill when polled with a budget of 0 (netpoll), page pool must not be used in that context
- keep struct mpnic_pkt_ctxt instead of replacing it with a bare xdp_buff, and move add_frag_failed into it
- give each Rx queue only the NAPI budget left over by the previous
ones instead of the full budget
- sync Rx buffers for the CPU with page_pool_dma_sync_for_cpu() instead of dma_sync_single_range_for_cpu()
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Daniel Zahka (7):
eth: mpnic: add scaffolding for Meta Platforms NIC
eth: mpnic: allocate MSI-X vectors
eth: mpnic: implement Tx queue allocation and cleanup
eth: mpnic: start and stop the Tx HW queues
eth: mpnic: add a netdevice and basic Tx handling
eth: mpnic: implement Rx queue allocation and cleanup
eth: mpnic: add basic Rx handling

Mohsin Bashir (1):
eth: mpnic: add register init for the device

 drivers/net/ethernet/meta/Kconfig              |   13 +
 drivers/net/ethernet/meta/Makefile             |    1 +
 drivers/net/ethernet/meta/mpnic/Makefile       |   16 +
 drivers/net/ethernet/meta/mpnic/mpnic.h        |   66 ++
 drivers/net/ethernet/meta/mpnic/mpnic_csr.h    |  319 ++++++
 drivers/net/ethernet/meta/mpnic/mpnic_init.c   |  556 ++++++++++
 drivers/net/ethernet/meta/mpnic/mpnic_irq.c    |   64 ++
 drivers/net/ethernet/meta/mpnic/mpnic_netdev.c |  186 ++++
 drivers/net/ethernet/meta/mpnic/mpnic_netdev.h |   35 +
 drivers/net/ethernet/meta/mpnic/mpnic_pci.c    |  187 ++++
 drivers/net/ethernet/meta/mpnic/mpnic_txrx.c   | 1395 ++++++++++++++++++++++++
 drivers/net/ethernet/meta/mpnic/mpnic_txrx.h   |  151 +++
 12 files changed, 2989 insertions(+)

---
base-commit: 42a9fb3382fc2573e92f41d203b095d9a372cfc9
change-id: 20260918-linux-mpnic-8fa318d530fa

Best regards,

Signature · 1 line
Daniel Zahka <[email protected]>