drivers/net/ethernet/intel/ice/ice_sched.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_sched.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_sched.c- Extension
.c- Size
- 126079 bytes
- Lines
- 4448
- 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.
- 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
net/devlink.hice_sched.h
Detected Declarations
function ice_sched_add_root_nodefunction ice_sched_find_node_by_teidfunction ice_sched_find_next_vsi_nodefunction cmdfunction elementsfunction ice_sched_add_nodefunction elementsfunction ice_sched_remove_elemsfunction ice_sched_get_first_nodefunction ice_free_sched_nodefunction topologyfunction elementsfunction elementsfunction elementsfunction elementsfunction elementsfunction allocationfunction ice_sched_suspend_resume_elemsfunction ice_alloc_lan_q_ctxfunction ice_alloc_rdma_q_ctxfunction ice_aq_rl_profilefunction profilefunction profilefunction ice_sched_del_rl_profilefunction ice_sched_clear_rl_proffunction list_for_each_entry_safefunction ice_sched_clear_aggfunction list_for_each_entry_safefunction list_for_each_entry_safefunction ice_sched_clear_tx_topofunction ice_sched_clear_portfunction ice_sched_cleanup_allfunction ice_sched_add_elemsfunction ice_sched_add_nodes_to_hw_layerfunction ice_sched_add_nodes_to_layerfunction ice_sched_get_qgrp_layerfunction ice_sched_get_vsi_layerfunction ice_sched_get_agg_layerfunction ice_rm_dflt_leaf_nodefunction ice_sched_rm_dflt_nodesfunction ice_sched_init_portfunction ice_sched_query_res_allocfunction ice_sched_get_psm_clk_freqfunction ice_sched_find_node_in_subtreefunction ice_sched_get_free_qgrpfunction ice_sched_get_free_qparentfunction ice_sched_get_vsi_nodefunction ice_sched_get_agg_node
Annotated Snippet
if (!node->children) {
devm_kfree(ice_hw_to_dev(hw), node);
return -ENOMEM;
}
}
node->in_use = true;
node->parent = parent;
node->tx_sched_layer = layer;
parent->children[parent->num_children++] = node;
node->info = elem;
return 0;
}
/**
* ice_aq_delete_sched_elems - delete scheduler elements
* @hw: pointer to the HW struct
* @grps_req: number of groups to delete
* @buf: pointer to buffer
* @buf_size: buffer size in bytes
* @grps_del: returns total number of elements deleted
* @cd: pointer to command details structure or NULL
*
* Delete scheduling elements (0x040F)
*/
static int
ice_aq_delete_sched_elems(struct ice_hw *hw, u16 grps_req,
struct ice_aqc_delete_elem *buf, u16 buf_size,
u16 *grps_del, struct ice_sq_cd *cd)
{
return ice_aqc_send_sched_elem_cmd(hw, ice_aqc_opc_delete_sched_elems,
grps_req, (void *)buf, buf_size,
grps_del, cd);
}
/**
* ice_sched_remove_elems - remove nodes from HW
* @hw: pointer to the HW struct
* @parent: pointer to the parent node
* @node_teid: node teid to be deleted
*
* This function remove nodes from HW
*/
static int
ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent,
u32 node_teid)
{
DEFINE_RAW_FLEX(struct ice_aqc_delete_elem, buf, teid, 1);
u16 buf_size = __struct_size(buf);
u16 num_groups_removed = 0;
int status;
buf->hdr.parent_teid = parent->info.node_teid;
buf->hdr.num_elems = cpu_to_le16(1);
buf->teid[0] = cpu_to_le32(node_teid);
status = ice_aq_delete_sched_elems(hw, 1, buf, buf_size,
&num_groups_removed, NULL);
if (status || num_groups_removed != 1)
ice_debug(hw, ICE_DBG_SCHED, "remove node failed FW error %d\n",
hw->adminq.sq_last_status);
return status;
}
/**
* ice_sched_get_first_node - get the first node of the given layer
* @pi: port information structure
* @parent: pointer the base node of the subtree
* @layer: layer number
*
* This function retrieves the first node of the given layer from the subtree
*/
static struct ice_sched_node *
ice_sched_get_first_node(struct ice_port_info *pi,
struct ice_sched_node *parent, u8 layer)
{
return pi->sib_head[parent->tc_num][layer];
}
/**
* ice_sched_get_tc_node - get pointer to TC node
* @pi: port information structure
* @tc: TC number
*
* This function returns the TC node pointer
*/
struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc)
{
u8 i;
Annotation
- Immediate include surface: `net/devlink.h`, `ice_sched.h`.
- Detected declarations: `function ice_sched_add_root_node`, `function ice_sched_find_node_by_teid`, `function ice_sched_find_next_vsi_node`, `function cmd`, `function elements`, `function ice_sched_add_node`, `function elements`, `function ice_sched_remove_elems`, `function ice_sched_get_first_node`, `function ice_free_sched_node`.
- 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.
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.