drivers/net/ethernet/qlogic/qed/qed_dcbx.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qed/qed_dcbx.c- Extension
.c- Size
- 65439 bytes
- Lines
- 2415
- 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
linux/types.hasm/byteorder.hlinux/bitops.hlinux/dcbnl.hlinux/errno.hlinux/kernel.hlinux/slab.hlinux/string.hqed.hqed_cxt.hqed_dcbx.hqed_hsi.hqed_sp.hqed_sriov.hqed_rdma.hlinux/qed/qed_eth_if.h
Detected Declarations
function qed_dcbx_app_ethtypefunction qed_dcbx_ieee_app_ethtypefunction qed_dcbx_app_portfunction qed_dcbx_ieee_app_portfunction qed_dcbx_default_tlvfunction qed_dcbx_iscsi_tlvfunction qed_dcbx_fcoe_tlvfunction qed_dcbx_roce_tlvfunction qed_dcbx_roce_v2_tlvfunction qed_dcbx_dp_protocolfunction qed_dcbx_set_paramsfunction qed_dcbx_update_app_infofunction qed_dcbx_get_app_protocol_typefunction qed_dcbx_process_tlvfunction qed_dcbx_process_mib_infofunction qed_dcbx_copy_mibfunction qed_dcbx_get_priority_infofunction qed_dcbx_get_app_datafunction qed_dcbx_get_pfc_datafunction qed_dcbx_get_ets_datafunction qed_dcbx_get_common_paramsfunction qed_dcbx_get_local_paramsfunction qed_dcbx_get_remote_paramsfunction qed_dcbx_get_operational_paramsfunction qed_dcbx_get_local_lldp_paramsfunction qed_dcbx_get_remote_lldp_paramsfunction qed_dcbx_get_paramsfunction qed_dcbx_read_local_lldp_mibfunction qed_dcbx_read_remote_lldp_mibfunction qed_dcbx_read_operational_mibfunction qed_dcbx_read_remote_mibfunction qed_dcbx_read_local_mibfunction qed_dcbx_read_mibfunction qed_dcbx_aenfunction qed_dcbx_mib_update_eventfunction qed_dcbx_info_allocfunction qed_dcbx_info_freefunction qed_dcbx_update_protocol_datafunction qed_dcbx_set_pf_update_paramsfunction qed_dcbx_get_priority_tcfunction qed_dcbx_query_paramsfunction qed_dcbx_set_pfc_datafunction qed_dcbx_set_ets_datafunction qed_dcbx_set_app_datafunction qed_dcbx_set_local_paramsfunction qed_dcbx_config_paramsfunction qed_dcbx_get_config_paramsfunction qed_dcbnl_getstate
Annotated Snippet
if (priority < 0) {
DP_ERR(p_hwfn, "Invalid priority\n");
return -EINVAL;
}
tc = QED_DCBX_PRIO2TC(pri_tc_tbl, priority);
if (qed_dcbx_get_app_protocol_type(p_hwfn, p_tbl[i].entry,
protocol_id, &type, ieee)) {
/* ETH always have the enable bit reset, as it gets
* vlan information per packet. For other protocols,
* should be set according to the dcbx_enabled
* indication, but we only got here if there was an
* app tlv for the protocol, so dcbx must be enabled.
*/
if (type == DCBX_PROTOCOL_ETH) {
enable = false;
eth_tlv = true;
} else {
enable = true;
}
qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, true,
enable, priority, tc, type);
}
}
/* If Eth TLV is not detected, use UFP TC as default TC */
if (test_bit(QED_MF_UFP_SPECIFIC, &p_hwfn->cdev->mf_bits) && !eth_tlv)
p_data->arr[DCBX_PROTOCOL_ETH].tc = p_hwfn->ufp_info.tc;
/* Update ramrod protocol data and hw_info fields
* with default info when corresponding APP TLV's are not detected.
* The enabled field has a different logic for ethernet as only for
* ethernet dcb should disabled by default, as the information arrives
* from the OS (unless an explicit app tlv was present).
*/
tc = p_data->arr[DCBX_PROTOCOL_ETH].tc;
priority = p_data->arr[DCBX_PROTOCOL_ETH].priority;
for (type = 0; type < DCBX_MAX_PROTOCOL_TYPE; type++) {
if (p_data->arr[type].update)
continue;
enable = (type == DCBX_PROTOCOL_ETH) ? false : !!dcbx_version;
qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, false, enable,
priority, tc, type);
}
return 0;
}
/* Parse app TLV's to update TC information in hw_info structure for
* reconfiguring QM. Get protocol specific data for PF update ramrod command.
*/
static int
qed_dcbx_process_mib_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
{
struct dcbx_app_priority_feature *p_app;
struct dcbx_app_priority_entry *p_tbl;
struct qed_dcbx_results data = { 0 };
struct dcbx_ets_feature *p_ets;
struct qed_hw_info *p_info;
u32 pri_tc_tbl, flags;
u8 dcbx_version;
int num_entries;
int rc = 0;
flags = p_hwfn->p_dcbx_info->operational.flags;
dcbx_version = QED_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION);
p_app = &p_hwfn->p_dcbx_info->operational.features.app;
p_tbl = p_app->app_pri_tbl;
p_ets = &p_hwfn->p_dcbx_info->operational.features.ets;
pri_tc_tbl = p_ets->pri_tc_tbl[0];
p_info = &p_hwfn->hw_info;
num_entries = QED_MFW_GET_FIELD(p_app->flags, DCBX_APP_NUM_ENTRIES);
rc = qed_dcbx_process_tlv(p_hwfn, p_ptt, &data, p_tbl, pri_tc_tbl,
num_entries, dcbx_version);
if (rc)
return rc;
p_info->num_active_tc = QED_MFW_GET_FIELD(p_ets->flags,
DCBX_ETS_MAX_TCS);
p_hwfn->qm_info.ooo_tc = QED_MFW_GET_FIELD(p_ets->flags, DCBX_OOO_TC);
data.pf_id = p_hwfn->rel_pf_id;
data.dcbx_enabled = !!dcbx_version;
qed_dcbx_dp_protocol(p_hwfn, &data);
Annotation
- Immediate include surface: `linux/types.h`, `asm/byteorder.h`, `linux/bitops.h`, `linux/dcbnl.h`, `linux/errno.h`, `linux/kernel.h`, `linux/slab.h`, `linux/string.h`.
- Detected declarations: `function qed_dcbx_app_ethtype`, `function qed_dcbx_ieee_app_ethtype`, `function qed_dcbx_app_port`, `function qed_dcbx_ieee_app_port`, `function qed_dcbx_default_tlv`, `function qed_dcbx_iscsi_tlv`, `function qed_dcbx_fcoe_tlv`, `function qed_dcbx_roce_tlv`, `function qed_dcbx_roce_v2_tlv`, `function qed_dcbx_dp_protocol`.
- 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.