drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c- Extension
.c- Size
- 28204 bytes
- Lines
- 1033
- 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
net/dcbnl.hi40e.h
Detected Declarations
function i40e_get_pfc_delayfunction i40e_dcbnl_ieee_getetsfunction i40e_dcbnl_ieee_getpfcfunction i40e_dcbnl_ieee_setetsfunction i40e_dcbnl_ieee_setpfcfunction i40e_dcbnl_ieee_setappfunction i40e_dcbnl_ieee_delappfunction i40e_dcbnl_getstatefunction i40e_dcbnl_setstatefunction i40e_dcbnl_set_pg_tc_cfg_txfunction i40e_dcbnl_set_pg_bwg_cfg_txfunction i40e_dcbnl_set_pg_tc_cfg_rxfunction i40e_dcbnl_set_pg_bwg_cfg_rxfunction i40e_dcbnl_get_pg_tc_cfg_txfunction i40e_dcbnl_get_pg_bwg_cfg_txfunction Rxfunction i40e_dcbnl_get_pg_bwg_cfg_rxfunction i40e_dcbnl_set_pfc_cfgfunction i40e_dcbnl_get_pfc_cfgfunction i40e_dcbnl_cee_set_allfunction i40e_dcbnl_get_capfunction i40e_dcbnl_getnumtcsfunction TCsfunction i40e_dcbnl_getpfcstatefunction i40e_dcbnl_setpfcstatefunction i40e_dcbnl_getappfunction i40e_dcbnl_setdcbxfunction i40e_dcbnl_getdcbxfunction i40e_dcbnl_get_perm_hw_addrfunction i40e_dcbnl_set_allfunction i40e_dcbnl_vsi_del_appfunction i40e_dcbnl_del_appfunction i40e_pf_for_each_vsifunction i40e_dcbnl_find_appfunction i40e_dcbnl_flush_appsfunction i40e_dcbnl_setup
Annotated Snippet
if (state) {
set_bit(I40E_FLAG_DCB_ENA, pf->flags);
memcpy(&pf->hw.desired_dcbx_config,
&pf->hw.local_dcbx_config,
sizeof(struct i40e_dcbx_config));
} else {
clear_bit(I40E_FLAG_DCB_ENA, pf->flags);
}
} else {
/* Cannot directly manipulate FW LLDP Agent */
ret = I40E_DCBNL_STATUS_ERROR;
}
return ret;
}
/**
* i40e_dcbnl_set_pg_tc_cfg_tx - Set CEE PG Tx config
* @netdev: the corresponding netdev
* @tc: the corresponding traffic class
* @prio_type: the traffic priority type
* @bwg_id: the BW group id the traffic class belongs to
* @bw_pct: the BW percentage for the corresponding BWG
* @up_map: prio mapped to corresponding tc
*
* Set Tx PG settings for CEE mode
**/
static void i40e_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
u8 prio_type, u8 bwg_id, u8 bw_pct,
u8 up_map)
{
struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
int i;
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED))
return;
/* LLTC not supported yet */
if (tc >= I40E_MAX_TRAFFIC_CLASS)
return;
/* prio_type, bwg_id and bw_pct per UP are not supported */
/* Use only up_map to map tc */
for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
if (up_map & BIT(i))
pf->tmp_cfg.etscfg.prioritytable[i] = tc;
}
pf->tmp_cfg.etscfg.tsatable[tc] = I40E_IEEE_TSA_ETS;
dev_dbg(&pf->pdev->dev,
"Set PG config tc=%d bwg_id=%d prio_type=%d bw_pct=%d up_map=%d\n",
tc, bwg_id, prio_type, bw_pct, up_map);
}
/**
* i40e_dcbnl_set_pg_bwg_cfg_tx - Set CEE PG Tx BW config
* @netdev: the corresponding netdev
* @pgid: the corresponding traffic class
* @bw_pct: the BW percentage for the specified traffic class
*
* Set Tx BW settings for CEE mode
**/
static void i40e_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int pgid,
u8 bw_pct)
{
struct i40e_pf *pf = i40e_netdev_to_pf(netdev);
if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) ||
(pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED))
return;
/* LLTC not supported yet */
if (pgid >= I40E_MAX_TRAFFIC_CLASS)
return;
pf->tmp_cfg.etscfg.tcbwtable[pgid] = bw_pct;
dev_dbg(&pf->pdev->dev, "Set PG BW config tc=%d bw_pct=%d\n",
pgid, bw_pct);
}
/**
* i40e_dcbnl_set_pg_tc_cfg_rx - Set CEE PG Rx config
* @netdev: the corresponding netdev
* @prio: the corresponding traffic class
* @prio_type: the traffic priority type
* @pgid: the BW group id the traffic class belongs to
* @bw_pct: the BW percentage for the corresponding BWG
* @up_map: prio mapped to corresponding tc
*
* Set Rx BW settings for CEE mode. The hardware does not support this
Annotation
- Immediate include surface: `net/dcbnl.h`, `i40e.h`.
- Detected declarations: `function i40e_get_pfc_delay`, `function i40e_dcbnl_ieee_getets`, `function i40e_dcbnl_ieee_getpfc`, `function i40e_dcbnl_ieee_setets`, `function i40e_dcbnl_ieee_setpfc`, `function i40e_dcbnl_ieee_setapp`, `function i40e_dcbnl_ieee_delapp`, `function i40e_dcbnl_getstate`, `function i40e_dcbnl_setstate`, `function i40e_dcbnl_set_pg_tc_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.