drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h
Extension
.h
Size
1781 bytes
Lines
59
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct lag_mpesw {
	struct work_struct mpesw_work;
	u32 pf_metadata[MLX5_MAX_PORTS];
};

enum mpesw_op {
	MLX5_MPESW_OP_ENABLE,
	MLX5_MPESW_OP_DISABLE,
};

struct mlx5_mpesw_work_st {
	struct work_struct work;
	struct mlx5_lag    *lag;
	enum mpesw_op      op;
	struct completion  comp;
	int result;
};

int mlx5_lag_mpesw_do_mirred(struct mlx5_core_dev *mdev,
			     struct net_device *out_dev,
			     struct netlink_ext_ack *extack);
bool mlx5_lag_is_mpesw(struct mlx5_core_dev *dev);
void mlx5_lag_mpesw_disable(struct mlx5_core_dev *dev);
int mlx5_lag_mpesw_enable(struct mlx5_core_dev *dev);
#ifdef CONFIG_MLX5_ESWITCH
void mlx5_lag_disable_mpesw(struct mlx5_lag *ldev);
void mlx5_mpesw_sd_devcoms_lock(struct mlx5_lag *ldev);
void mlx5_mpesw_sd_devcoms_unlock(struct mlx5_lag *ldev);
#else
static inline void mlx5_lag_disable_mpesw(struct mlx5_lag *ldev) {}
static inline void mlx5_mpesw_sd_devcoms_lock(struct mlx5_lag *ldev) {}
static inline void mlx5_mpesw_sd_devcoms_unlock(struct mlx5_lag *ldev) {}
#endif /* CONFIG_MLX5_ESWITCH */

#ifdef CONFIG_MLX5_ESWITCH
void mlx5_mpesw_speed_update_work(struct work_struct *work);
int mlx5_lag_mpesw_port_change_event(struct notifier_block *nb,
				     unsigned long event, void *data);
#else
static inline void mlx5_mpesw_speed_update_work(struct work_struct *work) {}
static inline int mlx5_lag_mpesw_port_change_event(struct notifier_block *nb,
						   unsigned long event,
						   void *data)
{
	return NOTIFY_DONE;
}
#endif /* CONFIG_MLX5_ESWITCH */

#endif /* __MLX5_LAG_MPESW_H__ */

Annotation

Implementation Notes