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.

Dependency Surface

Detected Declarations

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

Implementation Notes