drivers/net/ethernet/intel/ice/ice_dcb.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_dcb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_dcb.c- Extension
.c- Size
- 43461 bytes
- Lines
- 1642
- 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
ice_common.hice_sched.hice_dcb.h
Detected Declarations
function MIBfunction changesfunction Agentfunction ice_aq_start_lldpfunction ice_get_dcbx_statusfunction ice_parse_ieee_ets_common_tlvfunction Tablefunction ice_parse_ieee_etscfg_tlvfunction ice_parse_ieee_etsrec_tlvfunction ice_parse_ieee_pfccfg_tlvfunction ice_parse_ieee_app_tlvfunction ice_parse_ieee_tlvfunction ice_parse_cee_pgcfg_tlvfunction ice_parse_cee_pfccfg_tlvfunction ice_parse_cee_app_tlvfunction ice_parse_cee_tlvfunction ice_parse_org_tlvfunction ice_lldp_to_dcb_cfgfunction ice_aq_get_dcb_cfgfunction ice_aq_start_stop_dcbxfunction firmwarefunction ice_aq_set_pfc_modefunction ice_cee_to_dcb_cfgfunction ice_for_each_traffic_classfunction ice_get_ieee_or_cee_dcb_cfgfunction ice_get_dcb_cfgfunction ice_get_dcb_cfg_from_mib_changefunction ice_init_dcbfunction Configurefunction ice_add_ieee_ets_common_tlvfunction Tablefunction ice_add_ieee_ets_tlvfunction ice_add_ieee_etsrec_tlvfunction ice_add_ieee_pfc_tlvfunction ice_add_ieee_app_pri_tlvfunction ice_add_dscp_up_tlvfunction ice_add_dscp_enf_tlvfunction ice_add_dscp_tc_bw_tlvfunction ice_add_dscp_pfc_tlvfunction ice_add_dcb_tlvfunction ice_dcb_cfg_to_lldpfunction ice_set_dcb_cfgfunction ice_aq_query_port_etsfunction ice_update_port_tc_tree_cfgfunction ice_for_each_traffic_classfunction ice_query_port_ets
Annotated Snippet
switch (selector) {
case ICE_CEE_APP_SEL_ETHTYPE:
dcbcfg->app[i].selector = ICE_APP_SEL_ETHTYPE;
break;
case ICE_CEE_APP_SEL_TCPIP:
dcbcfg->app[i].selector = ICE_APP_SEL_TCPIP;
break;
default:
/* Keep selector as it is for unknown types */
dcbcfg->app[i].selector = selector;
}
dcbcfg->app[i].prot_id = ntohs(app->protocol);
/* Move to next app */
offset += sizeof(*app);
}
}
/**
* ice_parse_cee_tlv
* @tlv: CEE DCBX TLV
* @dcbcfg: Local store to update DCBX config data
*
* Get the TLV subtype and send it to parsing function
* based on the subtype value
*/
static void
ice_parse_cee_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
struct ice_cee_feat_tlv *sub_tlv;
u8 subtype, feat_tlv_count = 0;
u16 len, tlvlen, typelen;
u32 ouisubtype;
ouisubtype = ntohl(tlv->ouisubtype);
subtype = FIELD_GET(ICE_LLDP_TLV_SUBTYPE_M, ouisubtype);
/* Return if not CEE DCBX */
if (subtype != ICE_CEE_DCBX_TYPE)
return;
typelen = ntohs(tlv->typelen);
tlvlen = FIELD_GET(ICE_LLDP_TLV_LEN_M, typelen);
len = sizeof(tlv->typelen) + sizeof(ouisubtype) +
sizeof(struct ice_cee_ctrl_tlv);
/* Return if no CEE DCBX Feature TLVs */
if (tlvlen <= len)
return;
sub_tlv = (struct ice_cee_feat_tlv *)((char *)tlv + len);
while (feat_tlv_count < ICE_CEE_MAX_FEAT_TYPE) {
u16 sublen;
typelen = ntohs(sub_tlv->hdr.typelen);
sublen = FIELD_GET(ICE_LLDP_TLV_LEN_M, typelen);
subtype = FIELD_GET(ICE_LLDP_TLV_TYPE_M, typelen);
switch (subtype) {
case ICE_CEE_SUBTYPE_PG_CFG:
ice_parse_cee_pgcfg_tlv(sub_tlv, dcbcfg);
break;
case ICE_CEE_SUBTYPE_PFC_CFG:
ice_parse_cee_pfccfg_tlv(sub_tlv, dcbcfg);
break;
case ICE_CEE_SUBTYPE_APP_PRI:
ice_parse_cee_app_tlv(sub_tlv, dcbcfg);
break;
default:
return; /* Invalid Sub-type return */
}
feat_tlv_count++;
/* Move to next sub TLV */
sub_tlv = (struct ice_cee_feat_tlv *)
((char *)sub_tlv + sizeof(sub_tlv->hdr.typelen) +
sublen);
}
}
/**
* ice_parse_org_tlv
* @tlv: Organization specific TLV
* @dcbcfg: Local store to update ETS REC data
*
* Currently IEEE 802.1Qaz and CEE DCBX TLV are supported, others
* will be returned
*/
static void
ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
u32 ouisubtype;
u32 oui;
Annotation
- Immediate include surface: `ice_common.h`, `ice_sched.h`, `ice_dcb.h`.
- Detected declarations: `function MIB`, `function changes`, `function Agent`, `function ice_aq_start_lldp`, `function ice_get_dcbx_status`, `function ice_parse_ieee_ets_common_tlv`, `function Table`, `function ice_parse_ieee_etscfg_tlv`, `function ice_parse_ieee_etsrec_tlv`, `function ice_parse_ieee_pfccfg_tlv`.
- 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.