drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c- Extension
.c- Size
- 75551 bytes
- Lines
- 2585
- 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/netdevice.hlinux/types.hlinux/errno.hlinux/rtnetlink.hnet/dcbnl.hbnx2x.hbnx2x_cmn.hbnx2x_dcb.h
Detected Declarations
function bnx2x_read_datafunction bnx2x_write_datafunction bnx2x_pfc_setfunction bnx2x_pfc_clearfunction bnx2x_dump_dcbx_drv_paramfunction bnx2x_dcbx_get_ap_priorityfunction bnx2x_dcbx_get_ap_featurefunction bnx2x_dcbx_get_ets_featurefunction bnx2x_dcbx_get_pfc_featurefunction bnx2x_dcbx_map_nwfunction bnx2x_get_dcbx_drv_paramfunction bnx2x_dcbx_read_mibfunction bnx2x_pfc_set_pfcfunction bnx2x_dcbx_stop_hw_txfunction bnx2x_dcbx_resume_hw_txfunction bnx2x_dcbx_2cos_limit_update_ets_configfunction bnx2x_dcbx_update_ets_configfunction bnx2x_dcbx_update_ets_paramsfunction bnx2x_dcbx_read_shmem_remote_mibfunction bnx2x_dcbx_read_shmem_neg_resultsfunction bnx2x_dcbx_dcbnl_app_upfunction bnx2x_dcbx_dcbnl_app_idtypefunction bnx2x_dcbnl_update_applistfunction bnx2x_dcbx_update_tc_mappingfunction bnx2x_dcbx_set_paramsfunction BP_PORTfunction bnx2x_dcbx_set_statefunction bnx2x_dcbx_init_paramsfunction bnx2x_dcbx_initfunction bnx2x_dcbx_print_cos_paramsfunction bnx2x_dcbx_get_num_pg_traf_typefunction bnx2x_dcbx_ets_disabled_entry_datafunction bnx2x_dcbx_add_to_cos_bwfunction bnx2x_dcbx_separate_pauseable_from_nonfunction bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_paramsfunction bnx2x_dcbx_2cos_limit_cee_two_pg_to_cos_paramsfunction bnx2x_dcbx_join_pgsfunction bnx2x_dcbx_2cos_limit_cee_three_pg_to_cos_paramsfunction bnx2x_dcbx_2cos_limit_cee_fill_cos_paramsfunction bnx2x_dcbx_spread_strict_prifunction bnx2x_dcbx_cee_fill_strict_prifunction bnx2x_dcbx_cee_fill_cos_paramsfunction bnx2x_dcbx_fill_cos_paramsfunction bnx2x_dcbx_get_ets_pri_pg_tblfunction bnx2x_dcbx_fw_structfunction bnx2x_dcbx_pmf_updatefunction bnx2x_dcbnl_set_validfunction bnx2x_dcbnl_get_state
Annotated Snippet
if (ttp[LLFC_TRAFFIC_TYPE_NW] != 0) {
if (!iscsi_pri_found) {
ttp[LLFC_TRAFFIC_TYPE_ISCSI] =
ttp[LLFC_TRAFFIC_TYPE_NW];
DP(BNX2X_MSG_DCB,
"ISCSI is using default priority.\n");
}
if (!fcoe_pri_found) {
ttp[LLFC_TRAFFIC_TYPE_FCOE] =
ttp[LLFC_TRAFFIC_TYPE_NW];
DP(BNX2X_MSG_DCB,
"FCoE is using default priority.\n");
}
}
} else {
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");
bp->dcbx_port_params.app.enabled = false;
for (index = 0 ; index < LLFC_DRIVER_TRAFFIC_TYPE_MAX; index++)
ttp[index] = INVALID_TRAFFIC_TYPE_PRIORITY;
}
}
static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,
struct dcbx_ets_feature *ets,
u32 error) {
int i = 0;
u32 pg_pri_orginal_spread[DCBX_MAX_NUM_PG_BW_ENTRIES] = {0};
struct pg_help_data pg_help_data;
struct bnx2x_dcbx_cos_params *cos_params =
bp->dcbx_port_params.ets.cos_params;
memset(&pg_help_data, 0, sizeof(struct pg_help_data));
if (GET_FLAGS(error, DCBX_LOCAL_ETS_ERROR))
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_ERROR\n");
if (GET_FLAGS(error, DCBX_REMOTE_ETS_TLV_NOT_FOUND))
DP(BNX2X_MSG_DCB, "DCBX_REMOTE_ETS_TLV_NOT_FOUND\n");
/* Clean up old settings of ets on COS */
for (i = 0; i < ARRAY_SIZE(bp->dcbx_port_params.ets.cos_params) ; i++) {
cos_params[i].pauseable = false;
cos_params[i].strict = BNX2X_DCBX_STRICT_INVALID;
cos_params[i].bw_tbl = DCBX_INVALID_COS_BW;
cos_params[i].pri_bitmask = 0;
}
if (bp->dcbx_port_params.app.enabled && ets->enabled &&
!GET_FLAGS(error,
DCBX_LOCAL_ETS_ERROR | DCBX_REMOTE_ETS_TLV_NOT_FOUND)) {
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_ENABLE\n");
bp->dcbx_port_params.ets.enabled = true;
bnx2x_dcbx_get_ets_pri_pg_tbl(bp,
pg_pri_orginal_spread,
ets->pri_pg_tbl);
bnx2x_dcbx_get_num_pg_traf_type(bp,
pg_pri_orginal_spread,
&pg_help_data);
bnx2x_dcbx_fill_cos_params(bp, &pg_help_data,
ets, pg_pri_orginal_spread);
} else {
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_DISABLED\n");
bp->dcbx_port_params.ets.enabled = false;
ets->pri_pg_tbl[0] = 0;
for (i = 0; i < DCBX_MAX_NUM_PRI_PG_ENTRIES ; i++)
DCBX_PG_BW_SET(ets->pg_bw_tbl, i, 1);
}
}
static void bnx2x_dcbx_get_pfc_feature(struct bnx2x *bp,
struct dcbx_pfc_feature *pfc, u32 error)
{
if (GET_FLAGS(error, DCBX_LOCAL_PFC_ERROR))
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_PFC_ERROR\n");
if (GET_FLAGS(error, DCBX_REMOTE_PFC_TLV_NOT_FOUND))
DP(BNX2X_MSG_DCB, "DCBX_REMOTE_PFC_TLV_NOT_FOUND\n");
if (bp->dcbx_port_params.app.enabled && pfc->enabled &&
!GET_FLAGS(error, DCBX_LOCAL_PFC_ERROR | DCBX_LOCAL_PFC_MISMATCH |
DCBX_REMOTE_PFC_TLV_NOT_FOUND)) {
bp->dcbx_port_params.pfc.enabled = true;
bp->dcbx_port_params.pfc.priority_non_pauseable_mask =
~(pfc->pri_en_bitmap);
} else {
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_PFC_DISABLED\n");
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/types.h`, `linux/errno.h`, `linux/rtnetlink.h`, `net/dcbnl.h`, `bnx2x.h`, `bnx2x_cmn.h`, `bnx2x_dcb.h`.
- Detected declarations: `function bnx2x_read_data`, `function bnx2x_write_data`, `function bnx2x_pfc_set`, `function bnx2x_pfc_clear`, `function bnx2x_dump_dcbx_drv_param`, `function bnx2x_dcbx_get_ap_priority`, `function bnx2x_dcbx_get_ap_feature`, `function bnx2x_dcbx_get_ets_feature`, `function bnx2x_dcbx_get_pfc_feature`, `function bnx2x_dcbx_map_nw`.
- 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.