drivers/net/ethernet/mellanox/mlxsw/spectrum.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/spectrum.h- Extension
.h- Size
- 52056 bytes
- Lines
- 1498
- 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/ethtool.hlinux/types.hlinux/netdevice.hlinux/rhashtable.hlinux/bitops.hlinux/if_bridge.hlinux/if_vlan.hlinux/list.hlinux/dcbnl.hlinux/in6.hlinux/notifier.hlinux/net_namespace.hlinux/spinlock.hnet/psample.hnet/pkt_cls.hnet/red.hnet/vxlan.hnet/flow_offload.hnet/inet_ecn.hport.hcore.hcore_acl_flex_keys.hcore_acl_flex_actions.hreg.h
Detected Declarations
struct mlxsw_sp_portstruct mlxsw_sp_rifstruct mlxsw_sp_span_entrystruct mlxsw_sp_router_opsstruct mlxsw_sp_switchdev_opsstruct mlxsw_sp_sbstruct mlxsw_sp_bridgestruct mlxsw_sp_routerstruct mlxsw_sp_mrstruct mlxsw_sp_aclstruct mlxsw_sp_counter_poolstruct mlxsw_sp_fid_corestruct mlxsw_sp_kvdlstruct mlxsw_sp_nvestruct mlxsw_sp_kvdl_opsstruct mlxsw_sp_mr_tcam_opsstruct mlxsw_sp_acl_rulei_opsstruct mlxsw_sp_acl_tcam_opsstruct mlxsw_sp_nve_opsstruct mlxsw_sp_sb_opsstruct mlxsw_sp_sb_valsstruct mlxsw_sp_port_type_speed_opsstruct mlxsw_sp_ptp_statestruct mlxsw_sp_ptp_opsstruct mlxsw_sp_span_opsstruct mlxsw_sp_qdisc_statestruct mlxsw_sp_mall_entrystruct mlxsw_sp_pgtstruct mlxsw_sp_lagstruct mlxsw_sp_port_mappingstruct mlxsw_sp_port_mapping_eventsstruct mlxsw_sp_parsingstruct mlxsw_spstruct mlxsw_sp_ptp_opsstruct mlxsw_sp_fid_core_opsstruct mlxsw_sp_port_pcpu_statsstruct mlxsw_sp_sample_triggerstruct mlxsw_sp_sample_paramsstruct mlxsw_sp_bridge_portstruct mlxsw_sp_fidstruct mlxsw_sp_port_vlanstruct mlxsw_sp_port_xstatsstruct mlxsw_sp_ptp_port_dir_statsstruct mlxsw_sp_ptp_port_statsstruct mlxsw_sp_portstruct mlxsw_sp_port_type_speed_opsstruct mlxsw_sp_ports_bitmapstruct mlxsw_sp_hdroom_prio
Annotated Snippet
struct mlxsw_sp_port_mapping {
u8 module;
u8 slot_index;
u8 width; /* Number of lanes used by the port */
u8 module_width; /* Number of lanes in the module (static) */
u8 lane;
};
struct mlxsw_sp_port_mapping_events {
struct list_head queue;
spinlock_t queue_lock; /* protects queue */
struct work_struct work;
};
struct mlxsw_sp_parsing {
refcount_t parsing_depth_ref;
u16 parsing_depth;
u16 vxlan_udp_dport;
struct mutex lock; /* Protects parsing configuration */
};
struct mlxsw_sp {
struct mlxsw_sp_port **ports;
struct mlxsw_core *core;
const struct mlxsw_bus_info *bus_info;
unsigned char base_mac[ETH_ALEN];
const unsigned char *mac_mask;
struct mlxsw_sp_lag *lags;
u16 max_lag;
struct mlxsw_sp_port_mapping *port_mapping;
struct mlxsw_sp_port_mapping_events port_mapping_events;
struct rhashtable sample_trigger_ht;
struct mlxsw_sp_sb *sb;
struct mlxsw_sp_bridge *bridge;
struct mlxsw_sp_router *router;
struct mlxsw_sp_mr *mr;
struct mlxsw_afa *afa;
struct mlxsw_sp_acl *acl;
struct mlxsw_sp_fid_core *fid_core;
struct mlxsw_sp_policer_core *policer_core;
struct mlxsw_sp_port_range_core *pr_core;
struct mlxsw_sp_kvdl *kvdl;
struct mlxsw_sp_nve *nve;
struct notifier_block netdevice_nb;
struct mlxsw_sp_ptp_clock *clock;
struct mlxsw_sp_ptp_state *ptp_state;
struct mlxsw_sp_counter_pool *counter_pool;
struct mlxsw_sp_span *span;
struct mlxsw_sp_trap *trap;
struct mlxsw_sp_parsing parsing;
const struct mlxsw_sp_switchdev_ops *switchdev_ops;
const struct mlxsw_sp_kvdl_ops *kvdl_ops;
const struct mlxsw_afa_ops *afa_ops;
const struct mlxsw_afk_ops *afk_ops;
const struct mlxsw_sp_mr_tcam_ops *mr_tcam_ops;
const struct mlxsw_sp_acl_rulei_ops *acl_rulei_ops;
const struct mlxsw_sp_acl_tcam_ops *acl_tcam_ops;
const struct mlxsw_sp_acl_bf_ops *acl_bf_ops;
const struct mlxsw_sp_nve_ops **nve_ops_arr;
const struct mlxsw_sp_sb_vals *sb_vals;
const struct mlxsw_sp_sb_ops *sb_ops;
const struct mlxsw_sp_port_type_speed_ops *port_type_speed_ops;
const struct mlxsw_sp_ptp_ops *ptp_ops;
const struct mlxsw_sp_span_ops *span_ops;
const struct mlxsw_sp_policer_core_ops *policer_core_ops;
const struct mlxsw_sp_trap_ops *trap_ops;
const struct mlxsw_sp_mall_ops *mall_ops;
const struct mlxsw_sp_router_ops *router_ops;
const struct mlxsw_listener *listeners;
const struct mlxsw_sp_fid_core_ops *fid_core_ops;
size_t listeners_count;
u32 lowest_shaper_bs;
struct rhashtable ipv6_addr_ht;
struct mutex ipv6_addr_ht_lock; /* Protects ipv6_addr_ht */
struct mlxsw_sp_pgt *pgt;
bool pgt_smpe_index_valid;
u16 lag_pgt_base;
};
struct mlxsw_sp_ptp_ops {
struct mlxsw_sp_ptp_clock *
(*clock_init)(struct mlxsw_sp *mlxsw_sp, struct device *dev);
void (*clock_fini)(struct mlxsw_sp_ptp_clock *clock);
struct mlxsw_sp_ptp_state *(*init)(struct mlxsw_sp *mlxsw_sp);
void (*fini)(struct mlxsw_sp_ptp_state *ptp_state);
/* Notify a driver that a packet that might be PTP was received. Driver
* is responsible for freeing the passed-in SKB.
*/
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/types.h`, `linux/netdevice.h`, `linux/rhashtable.h`, `linux/bitops.h`, `linux/if_bridge.h`, `linux/if_vlan.h`, `linux/list.h`.
- Detected declarations: `struct mlxsw_sp_port`, `struct mlxsw_sp_rif`, `struct mlxsw_sp_span_entry`, `struct mlxsw_sp_router_ops`, `struct mlxsw_sp_switchdev_ops`, `struct mlxsw_sp_sb`, `struct mlxsw_sp_bridge`, `struct mlxsw_sp_router`, `struct mlxsw_sp_mr`, `struct mlxsw_sp_acl`.
- 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.