drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c- Extension
.c- Size
- 18607 bytes
- Lines
- 802
- 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/netdevice.hlinux/types.hlinux/errno.hlinux/rtnetlink.hlinux/interrupt.hlinux/pci.hlinux/etherdevice.hrdma/ib_verbs.hlinux/bnxt/hsi.hbnxt.hbnxt_hwrm.hbnxt_dcb.h
Detected Declarations
function bnxt_queue_to_tcfunction bnxt_hwrm_queue_pri2cos_cfgfunction bnxt_hwrm_queue_pri2cos_qcfgfunction bnxt_hwrm_queue_cos2bw_cfgfunction bnxt_hwrm_queue_cos2bw_qcfgfunction bnxt_queue_remapfunction bnxt_hwrm_queue_pfc_cfgfunction bnxt_hwrm_queue_pfc_qcfgfunction bnxt_hwrm_set_dcbx_appfunction bnxt_hwrm_queue_dscp_qcapsfunction bnxt_hwrm_queue_dscp2pri_cfgfunction bnxt_ets_validatefunction bnxt_dcbnl_ieee_getetsfunction bnxt_dcbnl_ieee_setetsfunction bnxt_dcbnl_ieee_getpfcfunction bnxt_dcbnl_ieee_setpfcfunction bnxt_dcbnl_ieee_dscp_app_prepfunction bnxt_dcbnl_ieee_setappfunction bnxt_dcbnl_ieee_delappfunction bnxt_dcbnl_getdcbxfunction bnxt_dcbnl_setdcbxfunction bnxt_dcb_initfunction bnxt_dcb_freefunction bnxt_dcb_init
Annotated Snippet
if (bp->q_info[i].queue_id == queue_id) {
for (j = 0; j < bp->max_tc; j++) {
if (bp->tc_to_qidx[j] == i)
return j;
}
}
}
return -EINVAL;
}
static int bnxt_hwrm_queue_pri2cos_cfg(struct bnxt *bp, struct ieee_ets *ets)
{
struct hwrm_queue_pri2cos_cfg_input *req;
u8 *pri2cos;
int rc, i;
rc = hwrm_req_init(bp, req, HWRM_QUEUE_PRI2COS_CFG);
if (rc)
return rc;
req->flags = cpu_to_le32(QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_BIDIR |
QUEUE_PRI2COS_CFG_REQ_FLAGS_IVLAN);
pri2cos = &req->pri0_cos_queue_id;
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
u8 qidx;
req->enables |= cpu_to_le32(
QUEUE_PRI2COS_CFG_REQ_ENABLES_PRI0_COS_QUEUE_ID << i);
qidx = bp->tc_to_qidx[ets->prio_tc[i]];
pri2cos[i] = bp->q_info[qidx].queue_id;
}
return hwrm_req_send(bp, req);
}
static int bnxt_hwrm_queue_pri2cos_qcfg(struct bnxt *bp, struct ieee_ets *ets)
{
struct hwrm_queue_pri2cos_qcfg_output *resp;
struct hwrm_queue_pri2cos_qcfg_input *req;
int rc;
rc = hwrm_req_init(bp, req, HWRM_QUEUE_PRI2COS_QCFG);
if (rc)
return rc;
req->flags = cpu_to_le32(QUEUE_PRI2COS_QCFG_REQ_FLAGS_IVLAN);
resp = hwrm_req_hold(bp, req);
rc = hwrm_req_send(bp, req);
if (!rc) {
u8 *pri2cos = &resp->pri0_cos_queue_id;
int i;
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
u8 queue_id = pri2cos[i];
int tc;
tc = bnxt_queue_to_tc(bp, queue_id);
if (tc >= 0)
ets->prio_tc[i] = tc;
}
}
hwrm_req_drop(bp, req);
return rc;
}
static int bnxt_hwrm_queue_cos2bw_cfg(struct bnxt *bp, struct ieee_ets *ets,
u8 max_tc)
{
struct hwrm_queue_cos2bw_cfg_input *req;
struct bnxt_cos2bw_cfg cos2bw;
int rc, i;
rc = hwrm_req_init(bp, req, HWRM_QUEUE_COS2BW_CFG);
if (rc)
return rc;
for (i = 0; i < max_tc; i++) {
u8 qidx = bp->tc_to_qidx[i];
req->enables |= cpu_to_le32(
QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID <<
qidx);
memset(&cos2bw, 0, sizeof(cos2bw));
cos2bw.queue_id = bp->q_info[qidx].queue_id;
if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_STRICT) {
cos2bw.tsa =
QUEUE_COS2BW_QCFG_RESP_QUEUE_ID0_TSA_ASSIGN_SP;
cos2bw.pri_lvl = i;
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/types.h`, `linux/errno.h`, `linux/rtnetlink.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/etherdevice.h`, `rdma/ib_verbs.h`.
- Detected declarations: `function bnxt_queue_to_tc`, `function bnxt_hwrm_queue_pri2cos_cfg`, `function bnxt_hwrm_queue_pri2cos_qcfg`, `function bnxt_hwrm_queue_cos2bw_cfg`, `function bnxt_hwrm_queue_cos2bw_qcfg`, `function bnxt_queue_remap`, `function bnxt_hwrm_queue_pfc_cfg`, `function bnxt_hwrm_queue_pfc_qcfg`, `function bnxt_hwrm_set_dcbx_app`, `function bnxt_hwrm_queue_dscp_qcaps`.
- 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.