drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c- Extension
.c- Size
- 19961 bytes
- Lines
- 751
- 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/dcbnl.hlinux/math64.hmlx4_en.hfw_qos.h
Detected Declarations
struct mlx4_congestion_control_mb_prio_802_1_qau_paramsstruct mlx4_congestion_control_mb_prio_802_1_qau_statisticsfunction mlx4_en_dcbnl_getcapfunction mlx4_en_dcbnl_getpfcstatefunction mlx4_en_dcbnl_setpfcstatefunction mlx4_en_dcbnl_get_pfc_cfgfunction mlx4_en_dcbnl_set_pfc_cfgfunction mlx4_en_dcbnl_getnumtcsfunction mlx4_en_dcbnl_set_allfunction mlx4_en_dcbnl_get_statefunction mlx4_en_dcbnl_set_statefunction mlx4_en_dcbnl_getappfunction mlx4_en_dcbnl_setappfunction mlx4_en_dcbnl_ieee_getetsfunction mlx4_en_ets_validatefunction mlx4_en_config_port_schedulerfunction mlx4_en_dcbnl_ieee_setetsfunction mlx4_en_dcbnl_ieee_getpfcfunction mlx4_en_dcbnl_ieee_setpfcfunction mlx4_en_dcbnl_getdcbxfunction mlx4_en_dcbnl_setdcbxfunction mlx4_en_dcbnl_ieee_getmaxratefunction mlx4_en_dcbnl_ieee_setmaxratefunction mlx4_en_dcbnl_ieee_getqcnfunction mlx4_en_dcbnl_ieee_setqcnfunction mlx4_en_dcbnl_ieee_getqcnstats
Annotated Snippet
struct mlx4_congestion_control_mb_prio_802_1_qau_params {
__be32 modify_enable_high;
__be32 modify_enable_low;
__be32 reserved1;
__be32 extended_enable;
__be32 rppp_max_rps;
__be32 rpg_time_reset;
__be32 rpg_byte_reset;
__be32 rpg_threshold;
__be32 rpg_max_rate;
__be32 rpg_ai_rate;
__be32 rpg_hai_rate;
__be32 rpg_gd;
__be32 rpg_min_dec_fac;
__be32 rpg_min_rate;
__be32 max_time_rise;
__be32 max_byte_rise;
__be32 max_qdelta;
__be32 min_qoffset;
__be32 gd_coefficient;
__be32 reserved2[5];
__be32 cp_sample_base;
__be32 reserved3[39];
};
struct mlx4_congestion_control_mb_prio_802_1_qau_statistics {
__be64 rppp_rp_centiseconds;
__be32 reserved1;
__be32 ignored_cnm;
__be32 rppp_created_rps;
__be32 estimated_total_rate;
__be32 max_active_rate_limiter_index;
__be32 dropped_cnms_busy_fw;
__be32 reserved2;
__be32 cnms_handled_successfully;
__be32 min_total_limiters_rate;
__be32 max_total_limiters_rate;
__be32 reserved3[4];
};
static u8 mlx4_en_dcbnl_getcap(struct net_device *dev, int capid, u8 *cap)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
switch (capid) {
case DCB_CAP_ATTR_PFC:
*cap = true;
break;
case DCB_CAP_ATTR_DCBX:
*cap = priv->dcbx_cap;
break;
case DCB_CAP_ATTR_PFC_TCS:
*cap = 1 << mlx4_max_tc(priv->mdev->dev);
break;
default:
*cap = false;
break;
}
return 0;
}
static u8 mlx4_en_dcbnl_getpfcstate(struct net_device *netdev)
{
struct mlx4_en_priv *priv = netdev_priv(netdev);
return priv->cee_config.pfc_state;
}
static void mlx4_en_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
{
struct mlx4_en_priv *priv = netdev_priv(netdev);
priv->cee_config.pfc_state = state;
}
static void mlx4_en_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
u8 *setting)
{
struct mlx4_en_priv *priv = netdev_priv(netdev);
*setting = priv->cee_config.dcb_pfc[priority];
}
static void mlx4_en_dcbnl_set_pfc_cfg(struct net_device *netdev, int priority,
u8 setting)
{
struct mlx4_en_priv *priv = netdev_priv(netdev);
priv->cee_config.dcb_pfc[priority] = setting;
Annotation
- Immediate include surface: `linux/dcbnl.h`, `linux/math64.h`, `mlx4_en.h`, `fw_qos.h`.
- Detected declarations: `struct mlx4_congestion_control_mb_prio_802_1_qau_params`, `struct mlx4_congestion_control_mb_prio_802_1_qau_statistics`, `function mlx4_en_dcbnl_getcap`, `function mlx4_en_dcbnl_getpfcstate`, `function mlx4_en_dcbnl_setpfcstate`, `function mlx4_en_dcbnl_get_pfc_cfg`, `function mlx4_en_dcbnl_set_pfc_cfg`, `function mlx4_en_dcbnl_getnumtcs`, `function mlx4_en_dcbnl_set_all`, `function mlx4_en_dcbnl_get_state`.
- 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.