drivers/scsi/lpfc/lpfc_sli4.h
Source file repositories/reference/linux-study-clean/drivers/scsi/lpfc/lpfc_sli4.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/lpfc/lpfc_sli4.h- Extension
.h- Size
- 37942 bytes
- Lines
- 1213
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irq_poll.hlinux/cpufreq.h
Detected Declarations
struct lpfc_rqbstruct lpfc_idle_statstruct lpfc_queuestruct lpfc_sli4_linkstruct lpfc_fcf_recstruct lpfc_fcf_pri_recstruct lpfc_fcf_pristruct lpfc_fcfstruct lpfc_fip_param_hdrstruct lpfc_fcoe_paramsstruct lpfc_fcf_conn_hdrstruct lpfc_fcf_conn_recstruct lpfc_fcf_conn_entrystruct lpfc_bmbxstruct lpfc_max_cfg_paramstruct lpfc_hbastruct lpfc_hba_eq_hdlstruct lpfc_bbscn_paramsstruct lpfc_pc_sli4_paramsstruct lpfc_iovstruct lpfc_sli4_lnk_infostruct lpfc_vector_map_infostruct lpfc_pbl_poolstruct lpfc_pvt_poolstruct lpfc_multixri_poolstruct lpfc_fc4_ctrl_statstruct lpfc_lock_statstruct lpfc_eq_intr_infostruct lpfc_sli4_hdw_queuestruct lpfc_hdwq_statstruct lpfc_sli4_hbastruct lpfc_sglqstruct lpfc_rpi_hdrstruct lpfc_rsrc_blksstruct lpfc_rdp_contextstruct lpfc_lcb_contextenum lpfc_sli4_queue_typeenum lpfc_sli4_queue_subtypeenum lpfc_poll_modeenum lpfc_sge_typeenum lpfc_sgl_statefunction lpfc_sli4_unrecoverable_port
Annotated Snippet
struct lpfc_rqb {
uint16_t entry_count; /* Current number of RQ slots */
uint16_t buffer_count; /* Current number of buffers posted */
struct list_head rqb_buffer_list; /* buffers assigned to this HBQ */
/* Callback for HBQ buffer allocation */
struct rqb_dmabuf *(*rqb_alloc_buffer)(struct lpfc_hba *);
/* Callback for HBQ buffer free */
void (*rqb_free_buffer)(struct lpfc_hba *,
struct rqb_dmabuf *);
};
enum lpfc_poll_mode {
LPFC_QUEUE_WORK,
LPFC_THREADED_IRQ,
};
struct lpfc_idle_stat {
u64 prev_idle;
u64 prev_wall;
};
struct lpfc_queue {
struct list_head list;
struct list_head wq_list;
/*
* If interrupts are in effect on _all_ the eq's the footprint
* of polling code is zero (except mode). This memory is chec-
* ked for every io to see if the io needs to be polled and
* while completion to check if the eq's needs to be rearmed.
* Keep in same cacheline as the queue ptr to avoid cpu fetch
* stalls. Using 1B memory will leave us with 7B hole. Fill
* it with other frequently used members.
*/
uint16_t last_cpu; /* most recent cpu */
uint16_t hdwq;
uint8_t qe_valid;
uint8_t mode; /* interrupt or polling */
#define LPFC_EQ_INTERRUPT 0
#define LPFC_EQ_POLL 1
struct list_head wqfull_list;
enum lpfc_sli4_queue_type type;
enum lpfc_sli4_queue_subtype subtype;
struct lpfc_hba *phba;
struct list_head child_list;
struct list_head page_list;
struct list_head sgl_list;
struct list_head cpu_list;
uint32_t entry_count; /* Number of entries to support on the queue */
uint32_t entry_size; /* Size of each queue entry. */
uint32_t entry_cnt_per_pg;
uint32_t notify_interval; /* Queue Notification Interval
* For chip->host queues (EQ, CQ, RQ):
* specifies the interval (number of
* entries) where the doorbell is rung to
* notify the chip of entry consumption.
* For host->chip queues (WQ):
* specifies the interval (number of
* entries) where consumption CQE is
* requested to indicate WQ entries
* consumed by the chip.
* Not used on an MQ.
*/
#define LPFC_EQ_NOTIFY_INTRVL 16
#define LPFC_CQ_NOTIFY_INTRVL 16
#define LPFC_WQ_NOTIFY_INTRVL 16
#define LPFC_RQ_NOTIFY_INTRVL 16
uint32_t max_proc_limit; /* Queue Processing Limit
* For chip->host queues (EQ, CQ):
* specifies the maximum number of
* entries to be consumed in one
* processing iteration sequence. Queue
* will be rearmed after each iteration.
* Not used on an MQ, RQ or WQ.
*/
#define LPFC_EQ_MAX_PROC_LIMIT 256
#define LPFC_CQ_MIN_PROC_LIMIT 64
#define LPFC_CQ_MAX_PROC_LIMIT LPFC_CQE_EXP_COUNT // 4096
#define LPFC_CQ_DEF_MAX_PROC_LIMIT LPFC_CQE_DEF_COUNT // 1024
#define LPFC_CQ_MIN_THRESHOLD_TO_POLL 64
#define LPFC_CQ_MAX_THRESHOLD_TO_POLL LPFC_CQ_DEF_MAX_PROC_LIMIT
#define LPFC_CQ_DEF_THRESHOLD_TO_POLL LPFC_CQ_DEF_MAX_PROC_LIMIT
uint32_t queue_claimed; /* indicates queue is being processed */
uint32_t queue_id; /* Queue ID assigned by the hardware */
uint32_t assoc_qid; /* Queue ID associated with, for CQ/WQ/MQ */
uint32_t host_index; /* The host's index for putting or getting */
uint32_t hba_index; /* The last known hba index for get or put */
uint32_t q_mode;
Annotation
- Immediate include surface: `linux/irq_poll.h`, `linux/cpufreq.h`.
- Detected declarations: `struct lpfc_rqb`, `struct lpfc_idle_stat`, `struct lpfc_queue`, `struct lpfc_sli4_link`, `struct lpfc_fcf_rec`, `struct lpfc_fcf_pri_rec`, `struct lpfc_fcf_pri`, `struct lpfc_fcf`, `struct lpfc_fip_param_hdr`, `struct lpfc_fcoe_params`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.