drivers/net/ethernet/mellanox/mlx5/core/eswitch.h

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
Extension
.h
Size
38009 bytes
Lines
1123
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 mlx5_mapped_obj {
	enum mlx5_mapped_obj_type type;
	union {
		u32 chain;
		u64 act_miss_cookie;
		struct {
			u32 group_id;
			u32 rate;
			u32 trunc_size;
			u32 tunnel_id;
		} sample;
		u32 int_port_metadata;
	};
};

struct mlx5_esw_pf_info {
	bool pf_not_exist;
	bool pf_disabled;
	u16 num_of_vfs;
	u16 total_vfs;
	u16 host_number;
	u16 pf_num;
};

#ifdef CONFIG_MLX5_ESWITCH

#define ESW_OFFLOADS_DEFAULT_NUM_GROUPS 15

#define MLX5_MAX_UC_PER_VPORT(dev) \
	(1 << MLX5_CAP_GEN(dev, log_max_current_uc_list))

#define MLX5_MAX_MC_PER_VPORT(dev) \
	(1 << MLX5_CAP_GEN(dev, log_max_current_mc_list))

#define mlx5_esw_has_fwd_fdb(dev) \
	MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_to_table)

#define esw_chains(esw) \
	((esw)->fdb_table.offloads.esw_chains_priv)

enum {
	MAPPING_TYPE_CHAIN,
	MAPPING_TYPE_TUNNEL,
	MAPPING_TYPE_TUNNEL_ENC_OPTS,
	MAPPING_TYPE_LABELS,
	MAPPING_TYPE_ZONE,
	MAPPING_TYPE_INT_PORT,
};

struct vport_ingress {
	struct mlx5_flow_table *acl;
	struct mlx5_flow_handle *allow_rule;
	struct {
		struct mlx5_flow_group *allow_spoofchk_only_grp;
		struct mlx5_flow_group *allow_untagged_spoofchk_grp;
		struct mlx5_flow_group *allow_untagged_only_grp;
		struct mlx5_flow_group *drop_grp;
		struct mlx5_flow_handle *drop_rule;
		struct mlx5_fc *drop_counter;
	} legacy;
	struct {
		/* Optional group to add an FTE to do internal priority
		 * tagging on ingress packets.
		 */
		struct mlx5_flow_group *metadata_prio_tag_grp;
		/* Group to add default match-all FTE entry to tag ingress
		 * packet with metadata.
		 */
		struct mlx5_flow_group *metadata_allmatch_grp;
		/* Optional group to add a drop all rule */
		struct mlx5_flow_group *drop_grp;
		struct mlx5_modify_hdr *modify_metadata;
		struct mlx5_flow_handle *modify_metadata_rule;
		struct mlx5_flow_handle *drop_rule;
	} offloads;
};

enum vport_egress_acl_type {
	VPORT_EGRESS_ACL_TYPE_DEFAULT,
	VPORT_EGRESS_ACL_TYPE_SHARED_FDB,
};

struct vport_egress {
	struct mlx5_flow_table *acl;
	enum vport_egress_acl_type type;
	struct mlx5_flow_handle  *allowed_vlan;
	struct mlx5_flow_group *vlan_grp;
	union {
		struct {
			struct mlx5_flow_group *drop_grp;

Annotation

Implementation Notes