drivers/net/ethernet/sfc/siena/siena_sriov.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/siena/siena_sriov.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/siena/siena_sriov.c- Extension
.c- Size
- 47815 bytes
- Lines
- 1687
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/module.hnet_driver.hefx.hefx_channels.hnic.hio.hmcdi.hfilter.hmcdi_pcol.hfarch_regs.hsiena_sriov.hvfdi.h
Detected Declarations
struct siena_vfstruct efx_memcpy_reqstruct efx_local_addrstruct efx_endpoint_pageenum efx_vf_tx_filter_modefunction abs_indexfunction efx_siena_sriov_cmdfunction efx_siena_sriov_usrevfunction efx_siena_sriov_memcpyfunction efx_siena_sriov_reset_tx_filterfunction efx_siena_sriov_reset_rx_filterfunction __efx_siena_sriov_update_vf_addrfunction efx_siena_sriov_peer_workfunction efx_siena_sriov_bufsfunction bad_vf_indexfunction bad_buf_countfunction map_vi_indexfunction efx_vfdi_init_evqfunction efx_vfdi_init_rxqfunction efx_vfdi_init_txqfunction efx_vfdi_flush_wakefunction efx_vfdi_flush_clearfunction efx_vfdi_fini_all_queuesfunction efx_vfdi_insert_filterfunction efx_vfdi_remove_all_filtersfunction efx_vfdi_set_status_pagefunction efx_vfdi_clear_status_pagefunction efx_siena_sriov_vfdifunction efx_siena_sriov_reset_vffunction efx_siena_sriov_reset_vf_workfunction efx_siena_sriov_handle_no_channelfunction efx_siena_sriov_probe_channelfunction efx_siena_sriov_get_channel_namefunction efx_siena_sriov_probefunction efx_siena_sriov_peer_workfunction efx_siena_sriov_free_localfunction efx_siena_sriov_vf_allocfunction efx_siena_sriov_vfs_finifunction efx_siena_sriov_vfs_initfunction efx_siena_sriov_initfunction efx_siena_sriov_finifunction efx_siena_sriov_eventfunction efx_siena_sriov_flrfunction efx_siena_sriov_mac_address_changedfunction efx_siena_sriov_tx_flush_donefunction efx_siena_sriov_rx_flush_donefunction efx_siena_sriov_desc_fetch_errfunction efx_siena_sriov_reset
Annotated Snippet
struct siena_vf {
struct efx_nic *efx;
unsigned int pci_rid;
char pci_name[13]; /* dddd:bb:dd.f */
unsigned int index;
struct work_struct req;
u64 req_addr;
int req_type;
unsigned req_seqno;
unsigned msg_seqno;
bool busy;
struct efx_buffer buf;
unsigned buftbl_base;
bool rx_filtering;
enum efx_filter_flags rx_filter_flags;
unsigned rx_filter_qid;
int rx_filter_id;
enum efx_vf_tx_filter_mode tx_filter_mode;
int tx_filter_id;
struct vfdi_endpoint addr;
u64 status_addr;
struct mutex status_lock;
u64 *peer_page_addrs;
unsigned peer_page_count;
u64 evq0_addrs[EFX_MAX_VF_EVQ_SIZE * sizeof(efx_qword_t) /
EFX_BUF_SIZE];
unsigned evq0_count;
wait_queue_head_t flush_waitq;
struct mutex txq_lock;
unsigned long txq_mask[VI_MASK_LENGTH];
unsigned txq_count;
unsigned long rxq_mask[VI_MASK_LENGTH];
unsigned rxq_count;
unsigned long rxq_retry_mask[VI_MASK_LENGTH];
atomic_t rxq_retry_count;
struct work_struct reset_work;
};
struct efx_memcpy_req {
unsigned int from_rid;
void *from_buf;
u64 from_addr;
unsigned int to_rid;
u64 to_addr;
unsigned length;
};
/**
* struct efx_local_addr - A MAC address on the vswitch without a VF.
*
* Siena does not have a switch, so VFs can't transmit data to each
* other. Instead the VFs must be made aware of the local addresses
* on the vswitch, so that they can arrange for an alternative
* software datapath to be used.
*
* @link: List head for insertion into efx->local_addr_list.
* @addr: Ethernet address
*/
struct efx_local_addr {
struct list_head link;
u8 addr[ETH_ALEN];
};
/**
* struct efx_endpoint_page - Page of vfdi_endpoint structures
*
* @link: List head for insertion into efx->local_page_list.
* @ptr: Pointer to page.
* @addr: DMA address of page.
*/
struct efx_endpoint_page {
struct list_head link;
void *ptr;
dma_addr_t addr;
};
/* Buffer table entries are reserved txq0,rxq0,evq0,txq1,rxq1,evq1 */
#define EFX_BUFTBL_TXQ_BASE(_vf, _qid) \
((_vf)->buftbl_base + EFX_VF_BUFTBL_PER_VI * (_qid))
#define EFX_BUFTBL_RXQ_BASE(_vf, _qid) \
(EFX_BUFTBL_TXQ_BASE(_vf, _qid) + \
(EFX_MAX_DMAQ_SIZE * sizeof(efx_qword_t) / EFX_BUF_SIZE))
#define EFX_BUFTBL_EVQ_BASE(_vf, _qid) \
(EFX_BUFTBL_TXQ_BASE(_vf, _qid) + \
(2 * EFX_MAX_DMAQ_SIZE * sizeof(efx_qword_t) / EFX_BUF_SIZE))
#define EFX_FIELD_MASK(_field) \
((1 << _field ## _WIDTH) - 1)
/* VFs can only use this many transmit channels */
Annotation
- Immediate include surface: `linux/pci.h`, `linux/module.h`, `net_driver.h`, `efx.h`, `efx_channels.h`, `nic.h`, `io.h`, `mcdi.h`.
- Detected declarations: `struct siena_vf`, `struct efx_memcpy_req`, `struct efx_local_addr`, `struct efx_endpoint_page`, `enum efx_vf_tx_filter_mode`, `function abs_index`, `function efx_siena_sriov_cmd`, `function efx_siena_sriov_usrev`, `function efx_siena_sriov_memcpy`, `function efx_siena_sriov_reset_tx_filter`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.