drivers/net/ethernet/intel/ice/ice_parser.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_parser.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_parser.c- Extension
.c- Size
- 74608 bytes
- Lines
- 2431
- 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.
- 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
ice_common.h
Detected Declarations
struct ice_pkg_sect_hdrfunction ice_parser_create_tablefunction ice_imem_bst_bm_dumpfunction ice_imem_bst_kb_dumpfunction ice_imem_np_kb_dumpfunction ice_imem_pg_kb_dumpfunction ice_imem_alu_dumpfunction ice_imem_dumpfunction ice_imem_bm_initfunction ice_imem_bkb_initfunction ice_imem_npkb_initfunction ice_imem_pgkb_initfunction ice_imem_alu_initfunction ice_imem_parse_itemfunction ice_metainit_dumpfunction ice_metainit_parse_itemfunction ice_bst_tcam_searchfunction ice_pg_cam_key_dumpfunction ice_pg_nm_cam_key_dumpfunction ice_pg_cam_action_dumpfunction ice_pg_cam_dumpfunction ice_pg_nm_cam_dumpfunction ice_pg_cam_action_initfunction ice_pg_nm_cam_key_initfunction ice_pg_cam_key_initfunction ice_pg_cam_parse_itemfunction ice_pg_sp_cam_parse_itemfunction ice_pg_nm_cam_parse_itemfunction ice_pg_nm_sp_cam_parse_itemfunction __ice_pg_cam_matchfunction __ice_pg_nm_cam_matchfunction ice_pg_nm_cam_matchfunction Rulesfunction ice_ternary_matchfunction ice_bst_np_kb_dumpfunction ice_bst_pg_kb_dumpfunction ice_bst_alu_dumpfunction ice_bst_tcam_dumpfunction ice_lbl_dumpfunction ice_bst_alu_initfunction ice_bst_pgkb_initfunction ice_bst_npkb_initfunction ice_bst_parse_itemfunction ice_parse_lbl_itemfunction ice_bst_tcam_matchfunction ice_ptype_mk_tcam_dumpfunction ice_parse_ptype_mk_tcam_itemfunction ice_ptype_mk_tcam_match
Annotated Snippet
struct ice_pkg_sect_hdr {
__le16 count;
__le16 offset;
};
/**
* ice_parser_sect_item_get - parse an item from a section
* @sect_type: section type
* @section: section object
* @index: index of the item to get
* @offset: dummy as prototype of ice_pkg_enum_entry's last parameter
*
* Return: a pointer to the item or NULL.
*/
static void *ice_parser_sect_item_get(u32 sect_type, void *section,
u32 index, u32 __maybe_unused *offset)
{
size_t data_off = ICE_SEC_DATA_OFFSET;
struct ice_pkg_sect_hdr *hdr;
size_t size;
if (!section)
return NULL;
switch (sect_type) {
case ICE_SID_RXPARSER_IMEM:
size = ICE_SID_RXPARSER_IMEM_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_METADATA_INIT:
size = ICE_SID_RXPARSER_METADATA_INIT_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_CAM:
size = ICE_SID_RXPARSER_CAM_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_PG_SPILL:
size = ICE_SID_RXPARSER_PG_SPILL_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_NOMATCH_CAM:
size = ICE_SID_RXPARSER_NOMATCH_CAM_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_NOMATCH_SPILL:
size = ICE_SID_RXPARSER_NOMATCH_SPILL_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_BOOST_TCAM:
size = ICE_SID_RXPARSER_BOOST_TCAM_ENTRY_SIZE;
break;
case ICE_SID_LBL_RXPARSER_TMEM:
data_off = ICE_SEC_LBL_DATA_OFFSET;
size = ICE_SID_LBL_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_MARKER_PTYPE:
size = ICE_SID_RXPARSER_MARKER_TYPE_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_MARKER_GRP:
size = ICE_SID_RXPARSER_MARKER_GRP_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_PROTO_GRP:
size = ICE_SID_RXPARSER_PROTO_GRP_ENTRY_SIZE;
break;
case ICE_SID_RXPARSER_FLAG_REDIR:
size = ICE_SID_RXPARSER_FLAG_REDIR_ENTRY_SIZE;
break;
default:
return NULL;
}
hdr = section;
if (index >= le16_to_cpu(hdr->count))
return NULL;
return section + data_off + index * size;
}
/**
* ice_parser_create_table - create an item table from a section
* @hw: pointer to the hardware structure
* @sect_type: section type
* @item_size: item size in bytes
* @length: number of items in the table to create
* @parse_item: the function to parse the item
* @no_offset: ignore header offset, calculate index from 0
*
* Return: a pointer to the allocated table or ERR_PTR.
*/
static void *
ice_parser_create_table(struct ice_hw *hw, u32 sect_type,
u32 item_size, u32 length,
void (*parse_item)(struct ice_hw *hw, u16 idx,
void *item, void *data,
int size), bool no_offset)
Annotation
- Immediate include surface: `ice_common.h`.
- Detected declarations: `struct ice_pkg_sect_hdr`, `function ice_parser_create_table`, `function ice_imem_bst_bm_dump`, `function ice_imem_bst_kb_dump`, `function ice_imem_np_kb_dump`, `function ice_imem_pg_kb_dump`, `function ice_imem_alu_dump`, `function ice_imem_dump`, `function ice_imem_bm_init`, `function ice_imem_bkb_init`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.