drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c- Extension
.c- Size
- 21331 bytes
- Lines
- 782
- 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
ixgbe.hlinux/dcbnl.hixgbe_dcb_82598.hixgbe_dcb_82599.hixgbe_sriov.h
Detected Declarations
function ixgbe_copy_dcb_cfgfunction ixgbe_dcbnl_get_statefunction ixgbe_dcbnl_set_statefunction ixgbe_dcbnl_get_perm_hw_addrfunction ixgbe_dcbnl_set_pg_tc_cfg_txfunction ixgbe_dcbnl_set_pg_bwg_cfg_txfunction ixgbe_dcbnl_set_pg_tc_cfg_rxfunction ixgbe_dcbnl_set_pg_bwg_cfg_rxfunction ixgbe_dcbnl_get_pg_tc_cfg_txfunction ixgbe_dcbnl_get_pg_bwg_cfg_txfunction ixgbe_dcbnl_get_pg_tc_cfg_rxfunction ixgbe_dcbnl_get_pg_bwg_cfg_rxfunction ixgbe_dcbnl_set_pfc_cfgfunction ixgbe_dcbnl_get_pfc_cfgfunction ixgbe_dcbnl_devresetfunction ixgbe_dcbnl_set_allfunction ixgbe_dcbnl_getcapfunction ixgbe_dcbnl_getnumtcsfunction ixgbe_dcbnl_setnumtcsfunction ixgbe_dcbnl_getpfcstatefunction ixgbe_dcbnl_setpfcstatefunction ixgbe_dcbnl_getappfunction ixgbe_dcbnl_ieee_getetsfunction ixgbe_dcbnl_ieee_setetsfunction ixgbe_dcbnl_ieee_getpfcfunction ixgbe_dcbnl_ieee_setpfcfunction ixgbe_dcbnl_ieee_setappfunction ixgbe_dcbnl_ieee_delappfunction ixgbe_dcbnl_getdcbxfunction ixgbe_dcbnl_setdcbx
Annotated Snippet
if (dst->path[tx].prio_type != src->path[tx].prio_type) {
dst->path[tx].prio_type = src->path[tx].prio_type;
changes |= BIT_PG_TX;
}
if (dst->path[tx].bwg_id != src->path[tx].bwg_id) {
dst->path[tx].bwg_id = src->path[tx].bwg_id;
changes |= BIT_PG_TX;
}
if (dst->path[tx].bwg_percent != src->path[tx].bwg_percent) {
dst->path[tx].bwg_percent = src->path[tx].bwg_percent;
changes |= BIT_PG_TX;
}
if (dst->path[tx].up_to_tc_bitmap !=
src->path[tx].up_to_tc_bitmap) {
dst->path[tx].up_to_tc_bitmap =
src->path[tx].up_to_tc_bitmap;
changes |= (BIT_PG_TX | BIT_PFC | BIT_APP_UPCHG);
}
if (dst->path[rx].prio_type != src->path[rx].prio_type) {
dst->path[rx].prio_type = src->path[rx].prio_type;
changes |= BIT_PG_RX;
}
if (dst->path[rx].bwg_id != src->path[rx].bwg_id) {
dst->path[rx].bwg_id = src->path[rx].bwg_id;
changes |= BIT_PG_RX;
}
if (dst->path[rx].bwg_percent != src->path[rx].bwg_percent) {
dst->path[rx].bwg_percent = src->path[rx].bwg_percent;
changes |= BIT_PG_RX;
}
if (dst->path[rx].up_to_tc_bitmap !=
src->path[rx].up_to_tc_bitmap) {
dst->path[rx].up_to_tc_bitmap =
src->path[rx].up_to_tc_bitmap;
changes |= (BIT_PG_RX | BIT_PFC | BIT_APP_UPCHG);
}
}
for (i = DCB_PG_ATTR_BW_ID_0; i < DCB_PG_ATTR_BW_ID_MAX; i++) {
j = i - DCB_PG_ATTR_BW_ID_0;
if (dcfg->bw_percentage[tx][j] != scfg->bw_percentage[tx][j]) {
dcfg->bw_percentage[tx][j] = scfg->bw_percentage[tx][j];
changes |= BIT_PG_TX;
}
if (dcfg->bw_percentage[rx][j] != scfg->bw_percentage[rx][j]) {
dcfg->bw_percentage[rx][j] = scfg->bw_percentage[rx][j];
changes |= BIT_PG_RX;
}
}
for (i = DCB_PFC_UP_ATTR_0; i < DCB_PFC_UP_ATTR_MAX; i++) {
j = i - DCB_PFC_UP_ATTR_0;
if (dcfg->tc_config[j].dcb_pfc != scfg->tc_config[j].dcb_pfc) {
dcfg->tc_config[j].dcb_pfc = scfg->tc_config[j].dcb_pfc;
changes |= BIT_PFC;
}
}
if (dcfg->pfc_mode_enable != scfg->pfc_mode_enable) {
dcfg->pfc_mode_enable = scfg->pfc_mode_enable;
changes |= BIT_PFC;
}
return changes;
}
static u8 ixgbe_dcbnl_get_state(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED);
}
static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
{
struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
/* Fail command if not in CEE mode */
if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
return 1;
/* verify there is something to do, if not then exit */
if (!state == !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
Annotation
- Immediate include surface: `ixgbe.h`, `linux/dcbnl.h`, `ixgbe_dcb_82598.h`, `ixgbe_dcb_82599.h`, `ixgbe_sriov.h`.
- Detected declarations: `function ixgbe_copy_dcb_cfg`, `function ixgbe_dcbnl_get_state`, `function ixgbe_dcbnl_set_state`, `function ixgbe_dcbnl_get_perm_hw_addr`, `function ixgbe_dcbnl_set_pg_tc_cfg_tx`, `function ixgbe_dcbnl_set_pg_bwg_cfg_tx`, `function ixgbe_dcbnl_set_pg_tc_cfg_rx`, `function ixgbe_dcbnl_set_pg_bwg_cfg_rx`, `function ixgbe_dcbnl_get_pg_tc_cfg_tx`, `function ixgbe_dcbnl_get_pg_bwg_cfg_tx`.
- 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.