drivers/net/ethernet/intel/i40e/i40e_dcb.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_dcb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_dcb.c- Extension
.c- Size
- 55115 bytes
- Lines
- 1916
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hi40e_adminq.hi40e_alloc.hi40e_dcb.hi40e_prototype.h
Detected Declarations
function i40e_get_dcbx_statusfunction i40e_parse_ieee_etscfg_tlvfunction i40e_parse_ieee_etsrec_tlvfunction i40e_parse_ieee_pfccfg_tlvfunction i40e_parse_ieee_app_tlvfunction i40e_parse_ieee_tlvfunction i40e_parse_cee_pgcfg_tlvfunction i40e_parse_cee_pfccfg_tlvfunction i40e_parse_cee_app_tlvfunction i40e_parse_cee_tlvfunction i40e_parse_org_tlvfunction i40e_lldp_to_dcb_configfunction i40e_aq_get_dcb_configfunction i40e_cee_to_dcb_v1_configfunction i40e_cee_to_dcb_configfunction i40e_get_ieee_dcb_configfunction i40e_get_dcb_configfunction i40e_init_dcbfunction Protocolfunction i40e_add_ieee_ets_tlvfunction i40e_add_ieee_etsrec_tlvfunction i40e_add_ieee_pfc_tlvfunction i40e_add_ieee_app_pri_tlvfunction i40e_add_dcb_tlvfunction i40e_set_dcb_configfunction i40e_dcb_config_to_lldpfunction i40e_dcb_hw_rx_fifo_configfunction i40e_dcb_hw_rx_cmd_monitor_configfunction i40e_dcb_hw_pfc_configfunction i40e_dcb_hw_set_num_tcfunction i40e_dcb_hw_rx_ets_bw_configfunction i40e_dcb_hw_rx_up2tc_configfunction i40e_dcb_hw_calculate_pool_sizesfunction i40e_dcb_hw_rx_pb_configfunction _i40e_read_lldp_cfgfunction i40e_read_lldp_cfg
Annotated Snippet
switch (selector) {
case I40E_CEE_APP_SEL_ETHTYPE:
dcbcfg->app[i].selector = I40E_APP_SEL_ETHTYPE;
break;
case I40E_CEE_APP_SEL_TCPIP:
dcbcfg->app[i].selector = I40E_APP_SEL_TCPIP;
break;
default:
/* Keep selector as it is for unknown types */
dcbcfg->app[i].selector = selector;
}
dcbcfg->app[i].protocolid = ntohs(app->protocol);
/* Move to next app */
offset += sizeof(*app);
}
}
/**
* i40e_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 i40e_parse_cee_tlv(struct i40e_lldp_org_tlv *tlv,
struct i40e_dcbx_config *dcbcfg)
{
u16 len, tlvlen, sublen, typelength;
struct i40e_cee_feat_tlv *sub_tlv;
u8 subtype, feat_tlv_count = 0;
u32 ouisubtype;
ouisubtype = ntohl(tlv->ouisubtype);
subtype = FIELD_GET(I40E_LLDP_TLV_SUBTYPE_MASK, ouisubtype);
/* Return if not CEE DCBX */
if (subtype != I40E_CEE_DCBX_TYPE)
return;
typelength = ntohs(tlv->typelength);
tlvlen = FIELD_GET(I40E_LLDP_TLV_LEN_MASK, typelength);
len = sizeof(tlv->typelength) + sizeof(ouisubtype) +
sizeof(struct i40e_cee_ctrl_tlv);
/* Return if no CEE DCBX Feature TLVs */
if (tlvlen <= len)
return;
sub_tlv = (struct i40e_cee_feat_tlv *)((char *)tlv + len);
while (feat_tlv_count < I40E_CEE_MAX_FEAT_TYPE) {
typelength = ntohs(sub_tlv->hdr.typelen);
sublen = FIELD_GET(I40E_LLDP_TLV_LEN_MASK, typelength);
subtype = FIELD_GET(I40E_LLDP_TLV_TYPE_MASK, typelength);
switch (subtype) {
case I40E_CEE_SUBTYPE_PG_CFG:
i40e_parse_cee_pgcfg_tlv(sub_tlv, dcbcfg);
break;
case I40E_CEE_SUBTYPE_PFC_CFG:
i40e_parse_cee_pfccfg_tlv(sub_tlv, dcbcfg);
break;
case I40E_CEE_SUBTYPE_APP_PRI:
i40e_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 i40e_cee_feat_tlv *)((char *)sub_tlv +
sizeof(sub_tlv->hdr.typelen) +
sublen);
}
}
/**
* i40e_parse_org_tlv
* @tlv: Organization specific TLV
* @dcbcfg: Local store to update ETS REC data
*
* Currently only IEEE 802.1Qaz TLV is supported, all others
* will be returned
**/
static void i40e_parse_org_tlv(struct i40e_lldp_org_tlv *tlv,
struct i40e_dcbx_config *dcbcfg)
{
u32 ouisubtype;
u32 oui;
ouisubtype = ntohl(tlv->ouisubtype);
oui = FIELD_GET(I40E_LLDP_TLV_OUI_MASK, ouisubtype);
Annotation
- Immediate include surface: `linux/bitfield.h`, `i40e_adminq.h`, `i40e_alloc.h`, `i40e_dcb.h`, `i40e_prototype.h`.
- Detected declarations: `function i40e_get_dcbx_status`, `function i40e_parse_ieee_etscfg_tlv`, `function i40e_parse_ieee_etsrec_tlv`, `function i40e_parse_ieee_pfccfg_tlv`, `function i40e_parse_ieee_app_tlv`, `function i40e_parse_ieee_tlv`, `function i40e_parse_cee_pgcfg_tlv`, `function i40e_parse_cee_pfccfg_tlv`, `function i40e_parse_cee_app_tlv`, `function i40e_parse_cee_tlv`.
- 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.