drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h- Extension
.h- Size
- 17185 bytes
- Lines
- 537
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cache.hlinux/spinlock.hlinux/skbuff.hlinux/inetdevice.hlinux/atomic.hnet/tls.hcxgb4.h
Detected Declarations
struct serv_entrystruct eotid_entrystruct tid_infostruct in6_addrstruct filter_ctxstruct chcr_ktlsstruct ch_filter_specificationstruct adapterstruct pci_devstruct l2t_datastruct net_devicestruct pkt_glstruct tp_tcp_statsstruct t4_lro_mgrstruct cxgb4_rangestruct cxgb4_virt_resstruct ch_ktls_port_stats_debugstruct ch_ktls_stats_debugstruct chcr_stats_debugstruct ch_ipsec_stats_debugstruct cxgb4_lld_infostruct cxgb4_uld_infoenum cxgb4_uldenum cxgb4_tx_uldenum cxgb4_txq_typeenum cxgb4_stateenum cxgb4_controlenum cxgb4_bar2_qtypefunction tid_out_of_rangefunction cxgb4_insert_tidfunction cxgb4_get_free_eotidfunction cxgb4_alloc_eotidfunction cxgb4_free_eotidfunction set_wr_txq
Annotated Snippet
struct serv_entry {
void *data;
};
union aopen_entry {
void *data;
union aopen_entry *next;
};
struct eotid_entry {
void *data;
};
/*
* Holds the size, base address, free list start, etc of the TID, server TID,
* and active-open TID tables. The tables themselves are allocated dynamically.
*/
struct tid_info {
void **tid_tab;
unsigned int tid_base;
unsigned int ntids;
struct serv_entry *stid_tab;
unsigned long *stid_bmap;
unsigned int nstids;
unsigned int stid_base;
unsigned int nhash;
unsigned int hash_base;
union aopen_entry *atid_tab;
unsigned int natids;
unsigned int atid_base;
struct filter_entry *hpftid_tab;
unsigned long *hpftid_bmap;
unsigned int nhpftids;
unsigned int hpftid_base;
struct filter_entry *ftid_tab;
unsigned long *ftid_bmap;
unsigned int nftids;
unsigned int ftid_base;
unsigned int aftid_base;
unsigned int aftid_end;
/* Server filter region */
unsigned int sftid_base;
unsigned int nsftids;
spinlock_t atid_lock ____cacheline_aligned_in_smp;
union aopen_entry *afree;
unsigned int atids_in_use;
spinlock_t stid_lock;
unsigned int stids_in_use;
unsigned int v6_stids_in_use;
unsigned int sftids_in_use;
/* ETHOFLD range */
struct eotid_entry *eotid_tab;
unsigned long *eotid_bmap;
unsigned int eotid_base;
unsigned int neotids;
/* TIDs in the TCAM */
atomic_t tids_in_use;
/* TIDs in the HASH */
atomic_t hash_tids_in_use;
atomic_t conns_in_use;
/* ETHOFLD TIDs used for rate limiting */
atomic_t eotids_in_use;
/* lock for setting/clearing filter bitmap */
spinlock_t ftid_lock;
unsigned int tc_hash_tids_max_prio;
};
static inline void *lookup_tid(const struct tid_info *t, unsigned int tid)
{
tid -= t->tid_base;
return tid < t->ntids ? t->tid_tab[tid] : NULL;
}
static inline bool tid_out_of_range(const struct tid_info *t, unsigned int tid)
{
return ((tid - t->tid_base) >= t->ntids);
}
static inline void *lookup_atid(const struct tid_info *t, unsigned int atid)
Annotation
- Immediate include surface: `linux/cache.h`, `linux/spinlock.h`, `linux/skbuff.h`, `linux/inetdevice.h`, `linux/atomic.h`, `net/tls.h`, `cxgb4.h`.
- Detected declarations: `struct serv_entry`, `struct eotid_entry`, `struct tid_info`, `struct in6_addr`, `struct filter_ctx`, `struct chcr_ktls`, `struct ch_filter_specification`, `struct adapter`, `struct pci_dev`, `struct l2t_data`.
- 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.