drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c- Extension
.c- Size
- 54146 bytes
- Lines
- 1794
- 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.
- 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/types.hlinux/crc8.hlinux/delay.hlinux/kernel.hlinux/slab.hlinux/string.hqed_hsi.hqed_hw.hqed_init_ops.hqed_iro_hsi.hqed_reg_addr.h
Detected Declarations
function qed_get_ext_voqfunction qed_enable_pf_rlfunction qed_enable_pf_wfqfunction qed_enable_global_rlfunction qed_enable_vport_wfqfunction qed_cmdq_lines_voq_rt_initfunction qed_cmdq_lines_rt_initfunction followsfunction speedfunction qed_get_vport_rl_upper_boundfunction qed_vport_rl_rt_initfunction qed_tx_pq_map_rt_initfunction qed_other_pq_map_rt_initfunction qed_pf_wfq_rt_initfunction qed_pf_rl_rt_initfunction qed_vp_wfq_rt_initfunction qed_poll_on_qm_cmd_readyfunction qed_send_qm_cmdfunction qed_qm_pf_mem_sizefunction qed_qm_common_rt_initfunction qed_qm_pf_rt_initfunction qed_init_pf_wfqfunction qed_init_pf_rlfunction qed_init_vport_wfqfunction qed_init_vport_tc_wfqfunction qed_init_global_rlfunction qed_send_qm_stop_cmdfunction qed_dmae_to_grcfunction qed_set_vxlan_dest_portfunction qed_set_vxlan_enablefunction qed_set_gre_enablefunction qed_set_geneve_dest_portfunction qed_set_geneve_enablefunction qed_set_vxlan_no_l2_enablefunction qed_gft_disablefunction qed_gft_configfunction qed_enable_context_validationfunction qed_get_rdma_assert_ram_addrfunction qed_set_rdma_error_levelfunction qed_get_overlay_addr_ram_addrfunction qed_fw_overlay_init_ramfunction qed_fw_overlay_mem_free
Annotated Snippet
if (inc_val > upper_bound) {
DP_NOTICE(p_hwfn,
"Invalid RL rate - limit configuration\n");
return -1;
}
STORE_RT_REG(p_hwfn, QM_REG_RLGLBLCRD_RT_OFFSET + rl_id,
(u32)QM_RL_CRD_REG_SIGN_BIT);
STORE_RT_REG(p_hwfn, QM_REG_RLGLBLUPPERBOUND_RT_OFFSET + rl_id,
upper_bound | (u32)QM_RL_CRD_REG_SIGN_BIT);
STORE_RT_REG(p_hwfn, QM_REG_RLGLBLINCVAL_RT_OFFSET + rl_id,
inc_val);
}
return 0;
}
/* Prepare Tx PQ mapping runtime init values for the specified PF */
static int qed_tx_pq_map_rt_init(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
struct qed_qm_pf_rt_init_params *p_params,
u32 base_mem_addr_4kb)
{
u32 tx_pq_vf_mask[MAX_QM_TX_QUEUES / QM_PF_QUEUE_GROUP_SIZE] = { 0 };
struct init_qm_vport_params *vport_params = p_params->vport_params;
u32 num_tx_pq_vf_masks = MAX_QM_TX_QUEUES / QM_PF_QUEUE_GROUP_SIZE;
u16 num_pqs, first_pq_group, last_pq_group, i, j, pq_id, pq_group;
struct init_qm_pq_params *pq_params = p_params->pq_params;
u32 pq_mem_4kb, vport_pq_mem_4kb, mem_addr_4kb;
num_pqs = p_params->num_pf_pqs + p_params->num_vf_pqs;
first_pq_group = p_params->start_pq / QM_PF_QUEUE_GROUP_SIZE;
last_pq_group = (p_params->start_pq + num_pqs - 1) /
QM_PF_QUEUE_GROUP_SIZE;
pq_mem_4kb = QM_PQ_MEM_4KB(p_params->num_pf_cids);
vport_pq_mem_4kb = QM_PQ_MEM_4KB(p_params->num_vf_cids);
mem_addr_4kb = base_mem_addr_4kb;
/* Set mapping from PQ group to PF */
for (pq_group = first_pq_group; pq_group <= last_pq_group; pq_group++)
STORE_RT_REG(p_hwfn, QM_REG_PQTX2PF_0_RT_OFFSET + pq_group,
(u32)(p_params->pf_id));
/* Set PQ sizes */
STORE_RT_REG(p_hwfn, QM_REG_MAXPQSIZE_0_RT_OFFSET,
QM_PQ_SIZE_256B(p_params->num_pf_cids));
STORE_RT_REG(p_hwfn, QM_REG_MAXPQSIZE_1_RT_OFFSET,
QM_PQ_SIZE_256B(p_params->num_vf_cids));
/* Go over all Tx PQs */
for (i = 0, pq_id = p_params->start_pq; i < num_pqs; i++, pq_id++) {
u16 *p_first_tx_pq_id, vport_id_in_pf;
struct qm_rf_pq_map tx_pq_map;
u8 tc_id = pq_params[i].tc_id;
bool is_vf_pq;
u8 ext_voq;
ext_voq = qed_get_ext_voq(p_hwfn,
pq_params[i].port_id,
tc_id,
p_params->max_phys_tcs_per_port);
is_vf_pq = (i >= p_params->num_pf_pqs);
/* Update first Tx PQ of VPORT/TC */
vport_id_in_pf = pq_params[i].vport_id - p_params->start_vport;
p_first_tx_pq_id =
&vport_params[vport_id_in_pf].first_tx_pq_id[tc_id];
if (*p_first_tx_pq_id == QM_INVALID_PQ_ID) {
u32 map_val =
(ext_voq << QM_VP_WFQ_PQ_VOQ_SHIFT) |
(p_params->pf_id << QM_VP_WFQ_PQ_PF_SHIFT);
/* Create new VP PQ */
*p_first_tx_pq_id = pq_id;
/* Map VP PQ to VOQ and PF */
STORE_RT_REG(p_hwfn,
QM_REG_WFQVPMAP_RT_OFFSET +
*p_first_tx_pq_id,
map_val);
}
/* Prepare PQ map entry */
QM_INIT_TX_PQ_MAP(p_hwfn,
tx_pq_map,
pq_id,
*p_first_tx_pq_id,
pq_params[i].rl_valid,
Annotation
- Immediate include surface: `linux/types.h`, `linux/crc8.h`, `linux/delay.h`, `linux/kernel.h`, `linux/slab.h`, `linux/string.h`, `qed_hsi.h`, `qed_hw.h`.
- Detected declarations: `function qed_get_ext_voq`, `function qed_enable_pf_rl`, `function qed_enable_pf_wfq`, `function qed_enable_global_rl`, `function qed_enable_vport_wfq`, `function qed_cmdq_lines_voq_rt_init`, `function qed_cmdq_lines_rt_init`, `function follows`, `function speed`, `function qed_get_vport_rl_upper_bound`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- 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.