Linux PCI subsystem development
 help / color / mirror / Atom feed
* [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface
@ 2024-07-09 17:28 Alexander Duyck
  2024-07-09 17:28 ` [net-next PATCH v4 01/15] PCI: Add Meta Platforms vendor ID Alexander Duyck
  2024-07-10 18:12 ` [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Duyck @ 2024-07-09 17:28 UTC (permalink / raw)
  To: netdev
  Cc: Bjorn Helgaas, linux-pci, Russell King, Sanman Pradhan,
	Andrew Lunn, Alexander Duyck, kuba, davem, pabeni, edumazet,
	kernel-team

This patchest includes the necessary patches to enable basic Tx and Rx over
the Meta Platforms Host Network Interface. To do this we introduce a new
driver and driver directories in the form of
"drivers/net/ethernet/meta/fbnic".

The NIC itself is fairly simplistic. As far as speeds we support 25Gb,
50Gb, and 100Gb and we are mostly focused on speeds and feeds. As far as
future patch sets we will be supporting the basic Rx/Tx offloads such as
header/payload data split, TSO, checksum, and timestamp offloads. We have
access to the MAC and PCS from the NIC, however the PHY and QSFP are hidden
behind a FW layer as it is shared between 4 slices and the BMC.

Due to submission limits the the general plan to submit a minimal driver
for now almost equivilent to a UEFI driver in functionality, and then
follow up over the coming months enabling additional offloads and enabling
more features for the device.

v2:
- Pulled out most of the link logic leaving minimal phylink link interface
- Added support for up to 64K pages by spanning multiple descriptors
- Limited driver load message to only display on successful loading
- Removed LED configuration, will add back in follow-on patch
- Replaced pci_enable_msix_range with pci_alloc_irq_vectors
- Updated comments to start with a capital letter
- Limited architectures to x86_64 for now
- Updated to "Return:" tag for kernel-doc
- Added fbd to read/write CSR macros

v3:
- Fixed resource issues due to not calling pci_disable_device
- Addressed sparse errors for !x | y
- CCed Eric Dumazet and Kernel Team at meta to submission
- Cleaned up kdoc to include missing Return: and formatting issues
- Removed unneeded inlines from fbnic_txrx.c
- Added support for setting queue to NAPI mapping
- Added support for setting NAPI to IRQ mapping
- Updated phylink to make use of rx_pause, tx_pause in mac_link_up function

v4:
- Removed _pause variables from fbnic_net
- Removed link_state variable
- Make link_direction an enum from fbnic_pcs_get_link_event_asic
- Switched to using phylink_resume/suspend to avoid blocking BMC traffic
- Always pass "false" to phylink_pcs_change
- Added "TBD:" comments to call out temporary workarounds for phylink code
- moved fbnic_fill to Rx enablement patch to address several issues
- Refactored BMC MAC address configuration to avoid MACDA reads

---

Alexander Duyck (15):
      PCI: Add Meta Platforms vendor ID
      eth: fbnic: Add scaffolding for Meta's NIC driver
      eth: fbnic: Allocate core device specific structures and devlink interface
      eth: fbnic: Add register init to set PCIe/Ethernet device config
      eth: fbnic: Add message parsing for FW messages
      eth: fbnic: Add FW communication mechanism
      eth: fbnic: Allocate a netdevice and napi vectors with queues
      eth: fbnic: Implement Tx queue alloc/start/stop/free
      eth: fbnic: Implement Rx queue alloc/start/stop/free
      eth: fbnic: Add initial messaging to notify FW of our presence
      eth: fbnic: Add link detection
      eth: fbnic: Add basic Tx handling
      eth: fbnic: Add basic Rx handling
      eth: fbnic: Add L2 address programming
      eth: fbnic: Write the TCAM tables used for RSS control and Rx to host


 MAINTAINERS                                   |    7 +
 drivers/net/ethernet/Kconfig                  |    1 +
 drivers/net/ethernet/Makefile                 |    1 +
 drivers/net/ethernet/meta/Kconfig             |   31 +
 drivers/net/ethernet/meta/Makefile            |    6 +
 drivers/net/ethernet/meta/fbnic/Makefile      |   19 +
 drivers/net/ethernet/meta/fbnic/fbnic.h       |  144 ++
 drivers/net/ethernet/meta/fbnic/fbnic_csr.h   |  838 ++++++++
 .../net/ethernet/meta/fbnic/fbnic_devlink.c   |   88 +
 .../net/ethernet/meta/fbnic/fbnic_drvinfo.h   |    5 +
 drivers/net/ethernet/meta/fbnic/fbnic_fw.c    |  791 +++++++
 drivers/net/ethernet/meta/fbnic/fbnic_fw.h    |  124 ++
 drivers/net/ethernet/meta/fbnic/fbnic_irq.c   |  210 ++
 drivers/net/ethernet/meta/fbnic/fbnic_mac.c   |  666 ++++++
 drivers/net/ethernet/meta/fbnic/fbnic_mac.h   |   86 +
 .../net/ethernet/meta/fbnic/fbnic_netdev.c    |  488 +++++
 .../net/ethernet/meta/fbnic/fbnic_netdev.h    |   63 +
 drivers/net/ethernet/meta/fbnic/fbnic_pci.c   |  564 +++++
 .../net/ethernet/meta/fbnic/fbnic_phylink.c   |  161 ++
 drivers/net/ethernet/meta/fbnic/fbnic_rpc.c   |  651 ++++++
 drivers/net/ethernet/meta/fbnic/fbnic_rpc.h   |  189 ++
 drivers/net/ethernet/meta/fbnic/fbnic_tlv.c   |  529 +++++
 drivers/net/ethernet/meta/fbnic/fbnic_tlv.h   |  175 ++
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c  | 1913 +++++++++++++++++
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.h  |  127 ++
 include/linux/pci_ids.h                       |    2 +
 26 files changed, 7879 insertions(+)
 create mode 100644 drivers/net/ethernet/meta/Kconfig
 create mode 100644 drivers/net/ethernet/meta/Makefile
 create mode 100644 drivers/net/ethernet/meta/fbnic/Makefile
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_csr.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_devlink.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_drvinfo.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_fw.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_fw.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_irq.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_mac.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_mac.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_netdev.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_pci.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_phylink.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_rpc.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_rpc.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_tlv.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_tlv.h
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
 create mode 100644 drivers/net/ethernet/meta/fbnic/fbnic_txrx.h

--


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [net-next PATCH v4 01/15] PCI: Add Meta Platforms vendor ID
  2024-07-09 17:28 [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Alexander Duyck
@ 2024-07-09 17:28 ` Alexander Duyck
  2024-07-10 18:12 ` [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Duyck @ 2024-07-09 17:28 UTC (permalink / raw)
  To: netdev
  Cc: linux-pci, Alexander Duyck, Bjorn Helgaas, kuba, davem, pabeni,
	edumazet, kernel-team

From: Alexander Duyck <alexanderduyck@fb.com>

Add Meta as a vendor ID for PCI devices so we can use the macro for future
drivers.

CC: linux-pci@vger.kernel.org
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
 include/linux/pci_ids.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 677aea20d3e1..76a8f2d6bd64 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2601,6 +2601,8 @@
 
 #define PCI_VENDOR_ID_HYGON		0x1d94
 
+#define PCI_VENDOR_ID_META		0x1d9b
+
 #define PCI_VENDOR_ID_FUNGIBLE		0x1dad
 
 #define PCI_VENDOR_ID_HXT		0x1dbf



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface
  2024-07-09 17:28 [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Alexander Duyck
  2024-07-09 17:28 ` [net-next PATCH v4 01/15] PCI: Add Meta Platforms vendor ID Alexander Duyck
@ 2024-07-10 18:12 ` Jakub Kicinski
  2024-07-10 23:51   ` Alexander Duyck
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-07-10 18:12 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: netdev, Bjorn Helgaas, linux-pci, Russell King, Sanman Pradhan,
	Andrew Lunn, Alexander Duyck, davem, pabeni, edumazet,
	kernel-team

On Tue, 09 Jul 2024 10:28:30 -0700 Alexander Duyck wrote:
> This patchest includes the necessary patches to enable basic Tx and Rx over
> the Meta Platforms Host Network Interface. To do this we introduce a new
> driver and driver directories in the form of
> "drivers/net/ethernet/meta/fbnic".
> 
> The NIC itself is fairly simplistic. As far as speeds we support 25Gb,
> 50Gb, and 100Gb and we are mostly focused on speeds and feeds. As far as
> future patch sets we will be supporting the basic Rx/Tx offloads such as
> header/payload data split, TSO, checksum, and timestamp offloads. We have
> access to the MAC and PCS from the NIC, however the PHY and QSFP are hidden
> behind a FW layer as it is shared between 4 slices and the BMC.
> 
> Due to submission limits the the general plan to submit a minimal driver
> for now almost equivilent to a UEFI driver in functionality, and then
> follow up over the coming months enabling additional offloads and enabling
> more features for the device.

cocci says:

drivers/net/ethernet/meta/fbnic/fbnic_irq.c:42:7-27: WARNING: Threaded IRQ with no primary handler requested without IRQF_ONESHOT (unless it is nested IRQ)
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface
  2024-07-10 18:12 ` [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Jakub Kicinski
@ 2024-07-10 23:51   ` Alexander Duyck
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Duyck @ 2024-07-10 23:51 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, Bjorn Helgaas, linux-pci, Russell King, Sanman Pradhan,
	Andrew Lunn, Alexander Duyck, davem, pabeni, edumazet,
	kernel-team

On Wed, Jul 10, 2024 at 11:12 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 09 Jul 2024 10:28:30 -0700 Alexander Duyck wrote:
> > This patchest includes the necessary patches to enable basic Tx and Rx over
> > the Meta Platforms Host Network Interface. To do this we introduce a new
> > driver and driver directories in the form of
> > "drivers/net/ethernet/meta/fbnic".
> >
> > The NIC itself is fairly simplistic. As far as speeds we support 25Gb,
> > 50Gb, and 100Gb and we are mostly focused on speeds and feeds. As far as
> > future patch sets we will be supporting the basic Rx/Tx offloads such as
> > header/payload data split, TSO, checksum, and timestamp offloads. We have
> > access to the MAC and PCS from the NIC, however the PHY and QSFP are hidden
> > behind a FW layer as it is shared between 4 slices and the BMC.
> >
> > Due to submission limits the the general plan to submit a minimal driver
> > for now almost equivilent to a UEFI driver in functionality, and then
> > follow up over the coming months enabling additional offloads and enabling
> > more features for the device.
>
> cocci says:
>
> drivers/net/ethernet/meta/fbnic/fbnic_irq.c:42:7-27: WARNING: Threaded IRQ with no primary handler requested without IRQF_ONESHOT (unless it is nested IRQ)

Ah, okay. Looks like I should have set the IRQF_ONESHOT flag as that
was the intended use.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-10 23:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 17:28 [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Alexander Duyck
2024-07-09 17:28 ` [net-next PATCH v4 01/15] PCI: Add Meta Platforms vendor ID Alexander Duyck
2024-07-10 18:12 ` [net-next PATCH v4 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Jakub Kicinski
2024-07-10 23:51   ` Alexander Duyck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox