|
iPXE
|
Cavium ThunderX Ethernet driver. More...
#include <stdint.h>#include <string.h>#include <strings.h>#include <stdio.h>#include <unistd.h>#include <errno.h>#include <assert.h>#include <byteswap.h>#include <ipxe/netdevice.h>#include <ipxe/ethernet.h>#include <ipxe/if_ether.h>#include <ipxe/iobuf.h>#include <ipxe/malloc.h>#include <ipxe/pci.h>#include <ipxe/pciea.h>#include <ipxe/umalloc.h>#include "thunderx.h"#include "thunderxcfg.h"Go to the source code of this file.
Macros | |
| #define | TXNICCOL(x) ( &txnic_pfs + (x)->node ) |
| Debug colour for physical function and BGX messages. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static | LIST_HEAD (txnic_bgxs) |
| List of BGX Ethernet interfaces. More... | |
| static | LIST_HEAD (txnic_pfs) |
| List of physical functions. More... | |
| EFI_REQUEST_PROTOCOL (EFI_THUNDER_CONFIG_PROTOCOL, &txcfg) | |
| static void | txnic_diag (struct txnic *vnic) |
| Show virtual NIC diagnostics (for debugging) More... | |
| static int | txnic_create_sq (struct txnic *vnic) |
| Create send queue. More... | |
| static int | txnic_disable_sq (struct txnic *vnic) |
| Disable send queue. More... | |
| static void | txnic_destroy_sq (struct txnic *vnic) |
| Destroy send queue. More... | |
| static int | txnic_send (struct txnic *vnic, struct io_buffer *iobuf) |
| Send packet. More... | |
| static void | txnic_complete_sqe (struct txnic *vnic, struct txnic_cqe_send *cqe) |
| Complete send queue entry. More... | |
| static int | txnic_create_rq (struct txnic *vnic) |
| Create receive queue. More... | |
| static int | txnic_disable_rq (struct txnic *vnic) |
| Disable receive queue. More... | |
| static void | txnic_destroy_rq (struct txnic *vnic) |
| Destroy receive queue. More... | |
| static void | txnic_refill_rq (struct txnic *vnic) |
| Refill receive queue. More... | |
| static void | txnic_complete_rqe (struct txnic *vnic, struct txnic_cqe_rx *cqe) |
| Complete receive queue entry. More... | |
| static int | txnic_create_cq (struct txnic *vnic) |
| Create completion queue. More... | |
| static int | txnic_disable_cq (struct txnic *vnic) |
| Disable completion queue. More... | |
| static void | txnic_destroy_cq (struct txnic *vnic) |
| Destroy completion queue. More... | |
| static void | txnic_poll_cq (struct txnic *vnic) |
| Poll completion queue. More... | |
| static int | txnic_open (struct txnic *vnic) |
| Open virtual NIC. More... | |
| static void | txnic_close (struct txnic *vnic) |
| Close virtual NIC. More... | |
| static void | txnic_poll (struct txnic *vnic) |
| Poll virtual NIC. More... | |
| static struct txnic * | txnic_alloc (struct pci_device *pci, unsigned long membase) |
| Allocate virtual NIC. More... | |
| static void | txnic_free (struct txnic *vnic) |
| Free virtual NIC. More... | |
| static void | txnic_lmac_diag (struct txnic_lmac *lmac) |
| Show LMAC diagnostics (for debugging) More... | |
| static void | txnic_lmac_update_link (struct txnic_lmac *lmac) |
| Update LMAC link state. More... | |
| static void | txnic_lmac_poll_link (struct txnic_lmac *lmac) |
| Poll LMAC link state. More... | |
| static void | txnic_lmac_reset (struct txnic_lmac *lmac) |
| Reset LMAC. More... | |
| static int | txnic_lmac_open (struct net_device *netdev) |
| Open network device. More... | |
| static void | txnic_lmac_close (struct net_device *netdev) |
| Close network device. More... | |
| static int | txnic_lmac_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
| Transmit packet. More... | |
| static void | txnic_lmac_poll (struct net_device *netdev) |
| Poll network device. More... | |
| static int | txnic_lmac_probe (struct txnic_lmac *lmac) |
| Probe logical MAC virtual NIC. More... | |
| static void | txnic_lmac_remove (struct txnic_lmac *lmac) |
| Remove logical MAC virtual NIC. More... | |
| static int | txnic_lmac_probe_all (struct txnic_pf *pf, struct txnic_bgx *bgx) |
| Probe all LMACs on a BGX Ethernet interface. More... | |
| static void | txnic_lmac_remove_all (struct txnic_pf *pf, struct txnic_bgx *bgx) |
| Remove all LMACs on a BGX Ethernet interface. More... | |
| static int | txnic_pf_probe (struct pci_device *pci) |
| Probe PCI device. More... | |
| static void | txnic_pf_remove (struct pci_device *pci) |
| Remove PCI device. More... | |
| static int | txnic_bgx_detect (struct txnic_bgx *bgx) |
| Detect BGX Ethernet interface LMAC type. More... | |
| static void | txnic_bgx_init (struct txnic_bgx *bgx, unsigned int type) |
| Initialise BGX Ethernet interface. More... | |
| static void | txnic_bgx_mac (struct txnic_lmac *lmac) |
| Get MAC address. More... | |
| static void | txnic_bgx_spu_init (struct txnic_lmac *lmac) |
| Initialise Super PHY Unit (SPU) More... | |
| static void | txnic_bgx_lmac_init (struct txnic_bgx *bgx, unsigned int lmac_idx) |
| Initialise LMAC. More... | |
| static int | txnic_bgx_probe (struct pci_device *pci) |
| Probe PCI device. More... | |
| static void | txnic_bgx_remove (struct pci_device *pci) |
| Remove PCI device. More... | |
Variables | |
| static EFI_THUNDER_CONFIG_PROTOCOL * | txcfg |
| Board configuration protocol. More... | |
| static struct net_device_operations | txnic_lmac_operations |
| Network device operations. More... | |
| static struct pci_device_id | txnic_pf_ids [] |
| NIC physical function PCI device IDs. More... | |
| struct pci_driver txnic_pf_driver | __pci_driver |
| NIC physical function PCI driver. More... | |
| static struct txnic_lmac_type | txnic_lmac_types [] |
| LMAC types. More... | |
| static struct pci_device_id | txnic_bgx_ids [] |
| BGX PCI device IDs. More... | |
Cavium ThunderX Ethernet driver.
Definition in file thunderx.c.
Debug colour for physical function and BGX messages.
Definition at line 58 of file thunderx.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
List of BGX Ethernet interfaces.
|
static |
List of physical functions.
| EFI_REQUEST_PROTOCOL | ( | EFI_THUNDER_CONFIG_PROTOCOL | , |
| & | txcfg | ||
| ) |
|
static |
Show virtual NIC diagnostics (for debugging)
| vnic | Virtual NIC |
Definition at line 76 of file thunderx.c.
References txnic_sq::cons, txnic_rq::cons, txnic_cq::cons, txnic::cq, DBGC, txnic::name, txnic_sq::prod, txnic_rq::prod, readq(), txnic::regs, txnic::rq, txnic::sq, TXNIC_CQ_STRIDE, TXNIC_CQES, TXNIC_QS_CQ_HEAD, TXNIC_QS_CQ_STATUS, TXNIC_QS_CQ_STATUS2, TXNIC_QS_CQ_TAIL, TXNIC_QS_RBDR_HEAD, TXNIC_QS_RBDR_STATUS0, TXNIC_QS_RBDR_TAIL, TXNIC_QS_SQ_HEAD, TXNIC_QS_SQ_STATUS, TXNIC_QS_SQ_TAIL, TXNIC_RQ_STRIDE, TXNIC_RQES, TXNIC_SQ_STRIDE, and TXNIC_SQES.
|
static |
Create send queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 113 of file thunderx.c.
References txnic_sq::cons, DBGC, txnic::name, txnic_sq::prod, txnic::regs, txnic::sq, txnic_sq::sqe, TXNIC_QS_SQ_BASE, TXNIC_QS_SQ_CFG, TXNIC_QS_SQ_CFG_ENA, TXNIC_QS_SQ_CFG_QSIZE_1K, TXNIC_QS_SQ_CFG_RESET, TXNIC_SQ_SIZE, and writeq().
Referenced by txnic_open().
|
static |
Disable send queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 138 of file thunderx.c.
References DBGC, ETIMEDOUT, mdelay(), txnic::name, readq(), txnic::regs, status, TXNIC_QS_SQ_CFG, TXNIC_QS_SQ_STATUS, TXNIC_QS_SQ_STATUS_STOPPED, TXNIC_SQ_STOP_MAX_WAIT_MS, and writeq().
Referenced by txnic_destroy_sq().
|
static |
Destroy send queue.
| vnic | Virtual NIC |
Definition at line 166 of file thunderx.c.
References rc, txnic::regs, txnic_disable_sq(), TXNIC_QS_SQ_CFG, TXNIC_QS_SQ_CFG_RESET, and writeq().
Referenced by txnic_close(), and txnic_open().
Send packet.
| vnic | Virtual NIC |
| iobuf | I/O buffer |
| rc | Return status code |
Definition at line 186 of file thunderx.c.
References txnic_sq::cons, cpu_to_le16, cpu_to_le32, cpu_to_le64, io_buffer::data, DBGC, DBGC2, ENOBUFS, ETH_ZLEN, ena_tx_sqe::flags, iob_len(), len, memset(), txnic::name, txnic_sq::prod, txnic::regs, txnic::sq, txnic_sq::sqe, sqe, TXNIC_QS_SQ_DOOR, TXNIC_SEND_GATHER_FLAGS, TXNIC_SEND_HDR_FLAGS, TXNIC_SQ_FILL, TXNIC_SQE_SUBDESCS, TXNIC_SQES, virt_to_bus(), wmb(), and writeq().
Referenced by txnic_lmac_transmit().
|
static |
Complete send queue entry.
| vnic | Virtual NIC |
| cqe | Send completion queue entry |
Definition at line 226 of file thunderx.c.
References assert(), txnic_sq::cons, DBGC, DBGC2, EIO, le16_to_cpu, txnic::name, netdev, txnic::netdev, netdev_tx_complete_next(), netdev_tx_complete_next_err(), txnic_cqe_send::send_status, txnic::sq, txnic_cqe_send::sqe_ptr, status, TXNIC_SQE_SUBDESCS, and TXNIC_SQES.
Referenced by txnic_poll_cq().
|
static |
Create receive queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 267 of file thunderx.c.
References txnic_rq::cons, DBGC, txnic::name, txnic_rq::prod, txnic::regs, txnic::rq, txnic_rq::rqe, TXNIC_LINE_SIZE, TXNIC_QS_RBDR_BASE, TXNIC_QS_RBDR_CFG, TXNIC_QS_RBDR_CFG_ENA, TXNIC_QS_RBDR_CFG_LINES, TXNIC_QS_RBDR_CFG_QSIZE_8K, TXNIC_QS_RBDR_CFG_RESET, TXNIC_QS_RQ_CFG, TXNIC_QS_RQ_CFG_ENA, TXNIC_RQ_SIZE, TXNIC_RQE_SIZE, and writeq().
Referenced by txnic_open().
|
static |
Disable receive queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 298 of file thunderx.c.
References cfg, DBGC, ETIMEDOUT, mdelay(), txnic::name, readq(), txnic::regs, TXNIC_QS_RQ_CFG, TXNIC_QS_RQ_CFG_ENA, TXNIC_RQ_DISABLE_MAX_WAIT_MS, and writeq().
Referenced by txnic_destroy_rq().
|
static |
Destroy receive queue.
| vnic | Virtual NIC |
Definition at line 326 of file thunderx.c.
References free_iob(), txnic_rq::iobuf, NULL, rc, txnic::regs, txnic::rq, txnic_disable_rq(), TXNIC_QS_RBDR_CFG, TXNIC_QS_RBDR_CFG_RESET, TXNIC_RQ_FILL, and writeq().
Referenced by txnic_close(), and txnic_open().
|
static |
Refill receive queue.
| vnic | Virtual NIC |
Definition at line 356 of file thunderx.c.
References txnic_rbdr_entry::addr, alloc_iob(), assert(), txnic_rq::cons, cpu_to_le64, io_buffer::data, DBGC2, txnic_rq::iobuf, txnic::name, NULL, txnic_rq::prod, txnic_rqe::rbdre, txnic::regs, txnic::rq, txnic_rq::rqe, TXNIC_QS_RBDR_DOOR, TXNIC_RQ_FILL, TXNIC_RQE_SIZE, TXNIC_RQES, virt_to_bus(), wmb(), and writeq().
Referenced by txnic_open(), and txnic_poll().
|
static |
Complete receive queue entry.
| vnic | Virtual NIC |
| cqe | Receive completion queue entry |
Definition at line 403 of file thunderx.c.
References txnic_cqe_rx::apad, txnic_rq::cons, DBGC, DBGC2, EIO, txnic_cqe_rx::errop, iob_put, iob_reserve, txnic_rq::iobuf, le16_to_cpu, len, txnic_cqe_rx::len, txnic::name, netdev, txnic::netdev, netdev_rx(), netdev_rx_err(), NULL, txnic::rq, TXNIC_CQE_RX_APAD_LEN, TXNIC_RQ_FILL, and TXNIC_RQES.
Referenced by txnic_poll_cq().
|
static |
Create completion queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 453 of file thunderx.c.
References txnic_cq::cons, txnic::cq, txnic_cq::cqe, DBGC, txnic::name, txnic::regs, TXNIC_CQ_SIZE, TXNIC_QS_CQ_BASE, TXNIC_QS_CQ_CFG, TXNIC_QS_CQ_CFG_ENA, TXNIC_QS_CQ_CFG_QSIZE_256, TXNIC_QS_CQ_CFG_RESET, and writeq().
Referenced by txnic_open().
|
static |
Disable completion queue.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 477 of file thunderx.c.
References cfg, DBGC, ETIMEDOUT, mdelay(), txnic::name, readq(), txnic::regs, TXNIC_CQ_DISABLE_MAX_WAIT_MS, TXNIC_QS_CQ_CFG, TXNIC_QS_CQ_CFG_ENA, and writeq().
Referenced by txnic_destroy_cq().
|
static |
Destroy completion queue.
| vnic | Virtual NIC |
Definition at line 505 of file thunderx.c.
References rc, txnic::regs, txnic_disable_cq(), TXNIC_QS_CQ_CFG, TXNIC_QS_CQ_CFG_RESET, and writeq().
Referenced by txnic_close(), and txnic_open().
|
static |
Poll completion queue.
| vnic | Virtual NIC |
Definition at line 523 of file thunderx.c.
References txnic_cqe::common, txnic_cq::cons, txnic::cq, txnic_cq::cqe, txnic_cqe_common::cqe_type, DBGC, DBGC_HDA, txnic::name, readq(), txnic::regs, txnic_cqe::rx, txnic_cqe::send, status, txnic_complete_rqe(), txnic_complete_sqe(), TXNIC_CQE_TYPE_RX, TXNIC_CQE_TYPE_SEND, TXNIC_CQES, TXNIC_QS_CQ_DOOR, TXNIC_QS_CQ_STATUS, TXNIC_QS_CQ_STATUS_QCOUNT, and writeq().
Referenced by txnic_poll().
|
static |
Open virtual NIC.
| vnic | Virtual NIC |
| rc | Return status code |
Definition at line 577 of file thunderx.c.
References rc, txnic_create_cq(), txnic_create_rq(), txnic_create_sq(), txnic_destroy_cq(), txnic_destroy_rq(), txnic_destroy_sq(), and txnic_refill_rq().
Referenced by txnic_lmac_open().
|
static |
Close virtual NIC.
| vnic | Virtual NIC |
Definition at line 611 of file thunderx.c.
References txnic_destroy_cq(), txnic_destroy_rq(), and txnic_destroy_sq().
Referenced by txnic_lmac_close(), and txnic_lmac_open().
|
static |
Poll virtual NIC.
| vnic | Virtual NIC |
Definition at line 628 of file thunderx.c.
References txnic_poll_cq(), and txnic_refill_rq().
Referenced by txnic_lmac_poll().
|
static |
Allocate virtual NIC.
| pci | Underlying PCI device |
| membase | Register base address |
| vnic | Virtual NIC, or NULL on failure |
Definition at line 644 of file thunderx.c.
References alloc_etherdev(), txnic::cq, txnic_cq::cqe, pci_device::dev, net_device::dev, iounmap(), device::name, txnic::name, netdev, txnic::netdev, netdev_nullify(), netdev_put(), NULL, pci_ioremap(), net_device::priv, txnic::regs, txnic::rq, txnic_rq::rqe, txnic::sq, txnic_sq::sqe, TXNIC_CQ_SIZE, TXNIC_RQ_SIZE, TXNIC_SQ_SIZE, TXNIC_VF_BAR_SIZE, ufree(), and umalloc().
Referenced by txnic_lmac_probe().
|
static |
Free virtual NIC.
| vnic | Virtual NIC |
Definition at line 704 of file thunderx.c.
References txnic::cq, txnic_cq::cqe, iounmap(), netdev, txnic::netdev, netdev_nullify(), netdev_put(), txnic::regs, txnic::rq, txnic_rq::rqe, txnic::sq, txnic_sq::sqe, and ufree().
Referenced by txnic_lmac_probe(), and txnic_lmac_remove().
|
static |
Show LMAC diagnostics (for debugging)
| lmac | Logical MAC |
Definition at line 737 of file thunderx.c.
References BGX_CMR_RX_STAT0, BGX_CMR_RX_STAT1, BGX_CMR_RX_STAT10, BGX_CMR_RX_STAT2, BGX_CMR_RX_STAT3, BGX_CMR_RX_STAT4, BGX_CMR_RX_STAT5, BGX_CMR_RX_STAT6, BGX_CMR_RX_STAT7, BGX_CMR_RX_STAT8, BGX_CMR_RX_STAT9, BGX_CMR_TX_STAT0, BGX_CMR_TX_STAT1, BGX_CMR_TX_STAT10, BGX_CMR_TX_STAT11, BGX_CMR_TX_STAT12, BGX_CMR_TX_STAT13, BGX_CMR_TX_STAT14, BGX_CMR_TX_STAT15, BGX_CMR_TX_STAT16, BGX_CMR_TX_STAT17, BGX_CMR_TX_STAT2, BGX_CMR_TX_STAT3, BGX_CMR_TX_STAT4, BGX_CMR_TX_STAT5, BGX_CMR_TX_STAT6, BGX_CMR_TX_STAT7, BGX_CMR_TX_STAT8, BGX_CMR_TX_STAT9, BGX_SPU_AN_STATUS, BGX_SPU_AN_STATUS_AN_COMPLETE, BGX_SPU_AN_STATUS_LINK_STATUS, BGX_SPU_AN_STATUS_LP_AN_ABLE, BGX_SPU_AN_STATUS_PAGE_RX, BGX_SPU_AN_STATUS_XNP_STAT, BGX_SPU_BR_ALGN_STATUS, BGX_SPU_BR_ALGN_STATUS_ALIGND, BGX_SPU_BR_PMD_STATUS, BGX_SPU_BR_STATUS1, BGX_SPU_BR_STATUS1_BLK_LOCK, BGX_SPU_BR_STATUS1_HI_BER, BGX_SPU_BR_STATUS1_RCV_LNK, BGX_SPU_BR_STATUS2, BGX_SPU_BR_STATUS2_LATCHED_BER, BGX_SPU_BR_STATUS2_LATCHED_LOCK, BGX_SPU_STATUS1, BGX_SPU_STATUS1_FLT, BGX_SPU_STATUS1_RCV_LNK, BGX_SPU_STATUS2, BGX_SPU_STATUS2_RCVFLT, DBGC, txnic::name, readq(), txnic_lmac::regs, status1, status2, txnic_lmac::vnic, and writeq().
|
static |
Update LMAC link state.
| lmac | Logical MAC |
Definition at line 846 of file thunderx.c.
References BGX_SPU_STATUS1, BGX_SPU_STATUS1_RCV_LNK, netdev, txnic::netdev, netdev_link_down(), netdev_link_up(), readq(), txnic_lmac::regs, status1, txnic_lmac::vnic, and writeq().
Referenced by txnic_lmac_open(), txnic_lmac_poll_link(), and txnic_lmac_probe().
|
static |
Poll LMAC link state.
| lmac | Logical MAC |
Definition at line 868 of file thunderx.c.
References BGX_SPU_INT, BGX_SPU_INT_ALGNLOS, BGX_SPU_INT_AN_COMPLETE, BGX_SPU_INT_AN_LINK_GOOD, BGX_SPU_INT_AN_PAGE_RX, BGX_SPU_INT_BIP_ERR, BGX_SPU_INT_BITLCKLS, BGX_SPU_INT_DBG_SYNC, BGX_SPU_INT_ERR_BLK, BGX_SPU_INT_FEC_CORR, BGX_SPU_INT_FEC_UNCORR, BGX_SPU_INT_RX_LINK_DOWN, BGX_SPU_INT_RX_LINK_UP, BGX_SPU_INT_SYNLOS, BGX_SPU_INT_TRAINING_DONE, BGX_SPU_INT_TRAINING_FAIL, DBGC, intr, txnic::name, readq(), txnic_lmac::regs, txnic_lmac_update_link(), txnic_lmac::vnic, and writeq().
Referenced by txnic_lmac_poll().
|
static |
Reset LMAC.
| lmac | Logical MAC |
Definition at line 906 of file thunderx.c.
References txnic_pf::bgx, txnic_lmac::bgx, txnic_lmac::idx, txnic_bgx::lmac, txnic_bgx::pf, txnic_pf::regs, TXNIC_PF_QS, TXNIC_PF_QS_CFG, TXNIC_PF_QS_RQ_BP_CFG, TXNIC_PF_QS_RQ_CFG, TXNIC_PF_QS_RQ_DROP_CFG, TXNIC_PF_QS_SQ_CFG, and writeq().
Referenced by txnic_lmac_probe(), and txnic_lmac_remove().
|
static |
Open network device.
| netdev | Network device |
| rc | Return status code |
Definition at line 928 of file thunderx.c.
References txnic_pf::bgx, txnic_lmac::bgx, ETH_ZLEN, txnic_lmac::idx, txnic_bgx::lmac, net_device::max_pkt_len, netdev, txnic_bgx::pf, net_device::priv, rc, txnic_pf::regs, TXNIC_CHAN_IDX, txnic_close(), txnic_lmac_update_link(), txnic_open(), TXNIC_PF_CHAN, TXNIC_PF_CHAN_RX_BP_CFG, TXNIC_PF_CHAN_RX_BP_CFG_BPID, TXNIC_PF_CHAN_RX_BP_CFG_ENA, TXNIC_PF_CHAN_RX_CFG, TXNIC_PF_CHAN_RX_CFG_CPI_BASE, TXNIC_PF_CHAN_TX_CFG, TXNIC_PF_CHAN_TX_CFG_BP_ENA, TXNIC_PF_LMAC, TXNIC_PF_LMAC_CFG, TXNIC_PF_LMAC_CFG2, TXNIC_PF_LMAC_CFG2_MAX_PKT_SIZE, TXNIC_PF_LMAC_CFG_ADJUST_DEFAULT, TXNIC_PF_LMAC_CFG_MIN_PKT_SIZE, TXNIC_PF_LMAC_CREDIT, TXNIC_PF_LMAC_CREDIT_CC_ENABLE, TXNIC_PF_LMAC_CREDIT_CC_PACKET_CNT_DEFAULT, TXNIC_PF_LMAC_CREDIT_CC_UNIT_CNT_DEFAULT, TXNIC_PF_MPI_CFG, TXNIC_PF_MPI_CFG_RSSI_BASE, TXNIC_PF_MPI_CFG_VNIC, TXNIC_PF_QS, TXNIC_PF_QS_CFG, TXNIC_PF_QS_CFG_ENA, TXNIC_PF_QS_CFG_VNIC, TXNIC_PF_QS_RQ_BP_CFG, TXNIC_PF_QS_RQ_BP_CFG_BPID, TXNIC_PF_QS_RQ_BP_CFG_CQ_BP_ENA, TXNIC_PF_QS_RQ_BP_CFG_RBDR_BP_ENA, TXNIC_PF_QS_RQ_CFG, TXNIC_PF_QS_RQ_CFG_CACHING_ALL, TXNIC_PF_QS_RQ_CFG_CQ_QS, TXNIC_PF_QS_RQ_CFG_RBDR_CONT_QS, TXNIC_PF_QS_RQ_CFG_RBDR_STRT_QS, TXNIC_PF_QS_SQ_CFG, TXNIC_PF_QS_SQ_CFG2, TXNIC_PF_QS_SQ_CFG2_TL4, TXNIC_PF_QS_SQ_CFG_CQ_QS, TXNIC_PF_RSSI_RQ, TXNIC_PF_RSSI_RQ_RQ_QS, TXNIC_PF_TL2_CFG, TXNIC_PF_TL2_CFG_RR_QUANTUM_DEFAULT, TXNIC_PF_TL3_CFG, TXNIC_PF_TL3_CFG_RR_QUANTUM_DEFAULT, TXNIC_PF_TL3_CHAN, TXNIC_PF_TL3_CHAN_CHAN, TXNIC_PF_TL4_CFG, TXNIC_PF_TL4_CFG_RR_QUANTUM_DEFAULT, TXNIC_PF_TL4_CFG_SQ_QS, TXNIC_TL2_IDX, TXNIC_TL3_IDX, TXNIC_TL4_IDX, txnic_lmac::vnic, and writeq().
|
static |
Close network device.
| netdev | Network device |
Definition at line 1024 of file thunderx.c.
References txnic_pf::bgx, txnic_lmac::bgx, txnic_lmac::idx, txnic_bgx::lmac, netdev, txnic_bgx::pf, net_device::priv, txnic_pf::regs, txnic_close(), TXNIC_PF_QS, TXNIC_PF_QS_CFG, txnic_lmac::vnic, and writeq().
|
static |
Transmit packet.
| netdev | Network device |
| iobuf | I/O buffer |
| rc | Return status code |
Definition at line 1045 of file thunderx.c.
References netdev, net_device::priv, txnic_send(), and txnic_lmac::vnic.
|
static |
Poll network device.
| netdev | Network device |
Definition at line 1058 of file thunderx.c.
References netdev, net_device::priv, txnic_lmac_poll_link(), txnic_poll(), and txnic_lmac::vnic.
|
static |
Probe logical MAC virtual NIC.
| lmac | Logical MAC |
| rc | Return status code |
Definition at line 1083 of file thunderx.c.
References assert(), txnic_pf::bgx, txnic_lmac::bgx, DBGC, ENOMEM, ETH_ALEN, eth_ntoa(), net_device::hw_addr, txnic_lmac::idx, txnic_bgx::idx, txnic_bgx::lmac, txnic_lmac::mac, memcpy(), net_device::name, txnic::name, netdev, txnic::netdev, netdev_init(), txnic_pf::node, NULL, txnic_bgx::pci, txnic_bgx::pf, net_device::priv, txnic_lmac_address::raw, rc, register_netdev(), txnic_alloc(), txnic_free(), txnic_lmac_operations, txnic_lmac_reset(), txnic_lmac_update_link(), TXNICCOL, unregister_netdev(), txnic_pf::vf_membase, txnic_pf::vf_stride, and txnic_lmac::vnic.
Referenced by txnic_lmac_probe_all().
|
static |
Remove logical MAC virtual NIC.
| lmac | Logical MAC |
Definition at line 1140 of file thunderx.c.
References assert(), BGX_CMR_CONFIG, BGX_CMR_CONFIG_DATA_PKT_RX_EN, BGX_CMR_CONFIG_DATA_PKT_TX_EN, txnic::netdev, NULL, readq(), txnic_lmac::regs, txnic_free(), txnic_lmac_reset(), unregister_netdev(), txnic_lmac::vnic, and writeq().
Referenced by txnic_lmac_probe_all(), and txnic_lmac_remove_all().
Probe all LMACs on a BGX Ethernet interface.
| pf | Physical function |
| bgx | BGX Ethernet interface |
| rc | Return status code |
Definition at line 1170 of file thunderx.c.
References assert(), txnic_pf::bgx, count, txnic_bgx::count, txnic_bgx::idx, txnic_bgx::lmac, txnic_pf::node, txnic_bgx::node, NULL, txnic_bgx::pf, rc, txnic_lmac_probe(), and txnic_lmac_remove().
Referenced by txnic_bgx_probe(), and txnic_pf_probe().
Remove all LMACs on a BGX Ethernet interface.
| pf | Physical function |
| bgx | BGX Ethernet interface |
Definition at line 1210 of file thunderx.c.
References assert(), txnic_pf::bgx, txnic_bgx::count, txnic_bgx::idx, txnic_bgx::lmac, NULL, txnic_bgx::pf, and txnic_lmac_remove().
Referenced by txnic_bgx_probe(), txnic_bgx_remove(), txnic_pf_probe(), and txnic_pf_remove().
|
static |
Probe PCI device.
| pci | PCI device |
| rc | Return status code |
Definition at line 1240 of file thunderx.c.
References adjust_pci_device(), txnic_pf::bgx, DBGC, pci_device::dev, ENODEV, ENOMEM, free, iounmap(), txnic_pf::list, txnic_bgx::list, list_add_tail, list_del, list_for_each_entry, device::name, txnic_pf::node, txnic_bgx::node, txnic_pf::pci, txnic_bgx::pci, pci_ioremap(), pci_set_drvdata(), pciea_bar_size(), pciea_bar_start(), PCIEA_BEI_BAR_0, PCIEA_BEI_VF_BAR_0, txnic_bgx::pf, rc, txnic_pf::regs, txnic_address_node(), txnic_lmac_probe_all(), txnic_lmac_remove_all(), TXNIC_NUM_BGX, TXNIC_PF_BAR_SIZE, TXNIC_PF_BP_CFG, TXNIC_PF_BP_CFG_BP_POLL_DLY_DEFAULT, TXNIC_PF_BP_CFG_BP_POLL_ENA, TXNIC_PF_CFG, TXNIC_PF_CFG_ENA, TXNIC_PF_INTF_BP_CFG, TXNIC_PF_INTF_BP_CFG_BP_ENA, TXNIC_PF_INTF_BP_CFG_BP_ID, TXNIC_PF_INTF_BP_CFG_BP_ID_BGX, TXNIC_PF_INTF_SEND_CFG, TXNIC_PF_INTF_SEND_CFG_BLOCK, TXNIC_PF_INTF_SEND_CFG_BLOCK_BGX, TXNIC_PF_PKIND_CFG, TXNIC_PF_PKIND_CFG_LENERR_EN, TXNIC_PF_PKIND_CFG_MAXLEN_DISABLE, TXNIC_PF_PKIND_CFG_MINLEN_DISABLE, TXNICCOL, txnic_pf::vf_membase, txnic_pf::vf_stride, writeq(), and zalloc().
|
static |
Remove PCI device.
| pci | PCI device |
Definition at line 1327 of file thunderx.c.
References txnic_pf::bgx, free, iounmap(), txnic_pf::list, list_del, txnic_pf::pci, pci_get_drvdata(), txnic_pf::regs, txnic_lmac_remove_all(), and TXNIC_NUM_BGX.
|
static |
Detect BGX Ethernet interface LMAC type.
| bgx | BGX Ethernet interface |
| type | LMAC type, or negative error |
Definition at line 1397 of file thunderx.c.
References BGX_CMR_CONFIG, BGX_CMR_CONFIG_LMAC_TYPE_GET, BGX_CMR_RX_LMACS, BGX_CMR_RX_LMACS_LMACS_GET, BGX_SPU_BR_PMD_CONTROL, BGX_SPU_BR_PMD_CONTROL_TRAIN_EN, count, txnic_lmac_type::count, txnic_bgx::count, DBGC, ENOTTY, txnic_bgx::idx, txnic_bgx::node, readq(), txnic_bgx::regs, txnic_bgx::training, TXNIC_NUM_LMAC, TXNICCOL, type, and txnic_bgx::type.
Referenced by txnic_bgx_probe().
|
static |
Initialise BGX Ethernet interface.
| bgx | BGX Ethernet interface |
| type | LMAC type |
Definition at line 1444 of file thunderx.c.
References BGX_CMR_CHAN_MSK_AND, BGX_CMR_CHAN_MSK_AND_ALL, BGX_CMR_CONFIG, BGX_CMR_CONFIG_LANE_TO_SDS, BGX_CMR_CONFIG_LMAC_TYPE_SET, BGX_CMR_GLOBAL_CONFIG, BGX_CMR_GLOBAL_CONFIG_FCS_STRIP, BGX_CMR_RX_DMAC_CAM, BGX_CMR_RX_LMACS, BGX_CMR_RX_LMACS_LMACS_SET, BGX_CMR_RX_STEERING, BGX_CMR_TX_LMACS, BGX_CMR_TX_LMACS_LMACS_SET, BGX_LMAC, txnic_bgx::count, txnic_lmac_type::lane_to_sds, readq(), txnic_bgx::regs, TXNIC_NUM_DMAC, TXNIC_NUM_STEERING, type, txnic_bgx::type, and writeq().
Referenced by txnic_bgx_probe().
|
static |
Get MAC address.
| lmac | Logical MAC |
Definition at line 1487 of file thunderx.c.
References txnic_lmac_address::be64, txnic_lmac::bgx, cpu_to_be64, DBGC, EEFI, eth_random_addr(), _EFI_THUNDER_CONFIG_PROTOCOL::GetLmacProp, txnic_lmac::idx, txnic_bgx::idx, txnic_bgx::lmac, mac, txnic_lmac::mac, MAC_ADDRESS, txnic_bgx::node, txnic_lmac_address::raw, rc, strerror(), txcfg, TXNIC_LMAC_IDX, and TXNICCOL.
Referenced by txnic_bgx_lmac_init().
|
static |
Initialise Super PHY Unit (SPU)
| lmac | Logical MAC |
Definition at line 1526 of file thunderx.c.
References txnic_lmac::bgx, BGX_SPU_AN_CONTROL, BGX_SPU_BR_PMD_CONTROL, BGX_SPU_BR_PMD_CONTROL_TRAIN_EN, BGX_SPU_BR_PMD_LD_CUP, BGX_SPU_BR_PMD_LD_REP, BGX_SPU_BR_PMD_LP_CUP, BGX_SPU_CONTROL1, BGX_SPU_CONTROL1_LO_PWR, BGX_SPU_CONTROL1_RESET, BGX_SPU_FEC_CONTROL, BGX_SPU_RESET_DELAY_MS, txnic_bgx::lmac, mdelay(), txnic_lmac::regs, txnic_bgx::training, and writeq().
Referenced by txnic_bgx_lmac_init().
|
static |
Initialise LMAC.
| bgx | BGX Ethernet interface |
| lmac_idx | LMAC index |
Definition at line 1561 of file thunderx.c.
References txnic_lmac::bgx, BGX_CMR_CONFIG, BGX_CMR_CONFIG_DATA_PKT_RX_EN, BGX_CMR_CONFIG_DATA_PKT_TX_EN, BGX_CMR_CONFIG_ENABLE, BGX_CMR_RX_DMAC_CTL, BGX_CMR_RX_DMAC_CTL_BCST_ACCEPT, BGX_CMR_RX_DMAC_CTL_MCST_MODE_ACCEPT, BGX_LMAC, txnic_lmac::idx, txnic_bgx::idx, txnic_bgx::lmac, readq(), txnic_lmac::regs, txnic_bgx::regs, txnic_bgx_mac(), txnic_bgx_spu_init(), TXNIC_VNIC_IDX, and writeq().
Referenced by txnic_bgx_probe().
|
static |
Probe PCI device.
| pci | PCI device |
| rc | Return status code |
Definition at line 1600 of file thunderx.c.
References adjust_pci_device(), txnic_pf::bgx, txnic_bgx::count, DBGC, pci_device::dev, ENODEV, ENOMEM, free, txnic_bgx::idx, iounmap(), txnic_pf::list, txnic_bgx::list, list_add_tail, list_del, list_for_each_entry, device::name, txnic_lmac_type::name, txnic_pf::node, txnic_bgx::node, txnic_pf::pci, txnic_bgx::pci, pci_ioremap(), pci_set_drvdata(), pciea_bar_start(), PCIEA_BEI_BAR_0, txnic_bgx::pf, rc, txnic_bgx::regs, txnic_bgx::training, txnic_address_bgx(), txnic_address_node(), TXNIC_BGX_BAR_SIZE, txnic_bgx_detect(), txnic_bgx_init(), txnic_bgx_lmac_init(), txnic_lmac_probe_all(), txnic_lmac_remove_all(), TXNICCOL, type, txnic_bgx::type, and zalloc().
|
static |
Remove PCI device.
| pci | PCI device |
Definition at line 1680 of file thunderx.c.
References free, iounmap(), txnic_bgx::list, list_del, txnic_bgx::pci, pci_get_drvdata(), txnic_bgx::pf, txnic_bgx::regs, and txnic_lmac_remove_all().
|
static |
Board configuration protocol.
Definition at line 61 of file thunderx.c.
Referenced by txnic_bgx_mac().
|
static |
Network device operations.
Definition at line 1070 of file thunderx.c.
Referenced by txnic_lmac_probe().
|
static |
NIC physical function PCI device IDs.
Definition at line 1348 of file thunderx.c.
| struct pci_driver txnic_bgx_driver __pci_driver |
NIC physical function PCI driver.
BGX PCI driver.
Definition at line 1353 of file thunderx.c.
|
static |
LMAC types.
Definition at line 1368 of file thunderx.c.
|
static |
1.8.15