drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h- Extension
.h- Size
- 3368 bytes
- Lines
- 96
- 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/mroute.hlinux/mroute6.hspectrum_router.hspectrum.h
Detected Declarations
struct mlxsw_sp_mr_route_keystruct mlxsw_sp_mr_route_infostruct mlxsw_sp_mr_route_paramsstruct mlxsw_sp_mr_opsstruct mlxsw_sp_mrstruct mlxsw_sp_mr_tableenum mlxsw_sp_mr_route_action
Annotated Snippet
struct mlxsw_sp_mr_route_key {
int vrid;
enum mlxsw_sp_l3proto proto;
union mlxsw_sp_l3addr group;
union mlxsw_sp_l3addr group_mask;
union mlxsw_sp_l3addr source;
union mlxsw_sp_l3addr source_mask;
};
struct mlxsw_sp_mr_route_info {
enum mlxsw_sp_mr_route_action route_action;
u16 irif_index;
u16 *erif_indices;
size_t erif_num;
u16 min_mtu;
};
struct mlxsw_sp_mr_route_params {
struct mlxsw_sp_mr_route_key key;
struct mlxsw_sp_mr_route_info value;
enum mlxsw_sp_mr_route_prio prio;
};
struct mlxsw_sp_mr_ops {
int priv_size;
int route_priv_size;
int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv);
int (*route_create)(struct mlxsw_sp *mlxsw_sp, void *priv,
void *route_priv,
struct mlxsw_sp_mr_route_params *route_params);
int (*route_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
struct mlxsw_sp_mr_route_info *route_info);
int (*route_stats)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
u64 *packets, u64 *bytes);
int (*route_action_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
enum mlxsw_sp_mr_route_action route_action);
int (*route_min_mtu_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
u16 min_mtu);
int (*route_irif_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
u16 irif_index);
int (*route_erif_add)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
u16 erif_index);
int (*route_erif_del)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
u16 erif_index);
void (*route_destroy)(struct mlxsw_sp *mlxsw_sp, void *priv,
void *route_priv);
void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv);
};
struct mlxsw_sp_mr;
struct mlxsw_sp_mr_table;
int mlxsw_sp_mr_init(struct mlxsw_sp *mlxsw_sp,
const struct mlxsw_sp_mr_ops *mr_ops);
void mlxsw_sp_mr_fini(struct mlxsw_sp *mlxsw_sp);
int mlxsw_sp_mr_route_add(struct mlxsw_sp_mr_table *mr_table,
struct mr_mfc *mfc, bool replace);
void mlxsw_sp_mr_route_del(struct mlxsw_sp_mr_table *mr_table,
struct mr_mfc *mfc);
int mlxsw_sp_mr_vif_add(struct mlxsw_sp_mr_table *mr_table,
struct net_device *dev, vifi_t vif_index,
unsigned long vif_flags,
const struct mlxsw_sp_rif *rif);
void mlxsw_sp_mr_vif_del(struct mlxsw_sp_mr_table *mr_table, vifi_t vif_index);
int mlxsw_sp_mr_rif_add(struct mlxsw_sp_mr_table *mr_table,
const struct mlxsw_sp_rif *rif);
void mlxsw_sp_mr_rif_del(struct mlxsw_sp_mr_table *mr_table,
const struct mlxsw_sp_rif *rif);
void mlxsw_sp_mr_rif_mtu_update(struct mlxsw_sp_mr_table *mr_table,
const struct mlxsw_sp_rif *rif, int mtu);
struct mlxsw_sp_mr_table *mlxsw_sp_mr_table_create(struct mlxsw_sp *mlxsw_sp,
u32 tb_id,
enum mlxsw_sp_l3proto proto);
void mlxsw_sp_mr_table_destroy(struct mlxsw_sp_mr_table *mr_table);
void mlxsw_sp_mr_table_flush(struct mlxsw_sp_mr_table *mr_table);
bool mlxsw_sp_mr_table_empty(const struct mlxsw_sp_mr_table *mr_table);
#endif
Annotation
- Immediate include surface: `linux/mroute.h`, `linux/mroute6.h`, `spectrum_router.h`, `spectrum.h`.
- Detected declarations: `struct mlxsw_sp_mr_route_key`, `struct mlxsw_sp_mr_route_info`, `struct mlxsw_sp_mr_route_params`, `struct mlxsw_sp_mr_ops`, `struct mlxsw_sp_mr`, `struct mlxsw_sp_mr_table`, `enum mlxsw_sp_mr_route_action`.
- 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.