eth: fbnic: Allocate a netdevice and napi vectors with queues
authorAlexander Duyck <alexanderduyck@fb.com>
Fri, 12 Jul 2024 15:49:43 +0000 (08:49 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Jul 2024 19:50:43 +0000 (12:50 -0700)
commitbc6107771bb4be3009168cfda24d22131c026fe8
tree8840c4069ea664a1c79c7547bf5c04f0b605236e
parentda3cde08209ec1c915195c2331c275397f34a731
eth: fbnic: Allocate a netdevice and napi vectors with queues

Allocate a netdev and figure out basics like how many queues
we need, MAC address, MTU bounds. Kick off a service task
to do various periodic things like health checking.
The service task only runs when device is open.

We have four levels of objects here:
 - ring - A HW ring with head / tail pointers,
 - triad - Two submission and one completion ring,
 - NAPI - NAPI, with one IRQ and any number of Rx and Tx triads,
 - Netdev - The ultimate container of the rings and napi vectors.

The "triad" is the only less-than-usual construct. On Rx we have
two "free buffer" submission rings, one for packet headers and
one for packet data. On Tx we have separate rings for XDP Tx
and normal Tx. So we ended up with ring triplets in both
directions.

We keep NAPIs on a local list, even though core already maintains a list.
Later on having a separate list will matter for live reconfig.
We introduce the list already, the churn would not be worth it.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/172079938358.1778861.11681469974633489463.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/meta/fbnic/Makefile
drivers/net/ethernet/meta/fbnic/fbnic.h
drivers/net/ethernet/meta/fbnic/fbnic_csr.h
drivers/net/ethernet/meta/fbnic/fbnic_irq.c
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c [new file with mode: 0644]
drivers/net/ethernet/meta/fbnic/fbnic_netdev.h [new file with mode: 0644]
drivers/net/ethernet/meta/fbnic/fbnic_pci.c
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c [new file with mode: 0644]
drivers/net/ethernet/meta/fbnic/fbnic_txrx.h [new file with mode: 0644]