Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a69cb9f authored by Or Gerlitz's avatar Or Gerlitz Committed by Saeed Mahameed
Browse files

net/mlx5: Introduce modify header structures, commands and steering action definitions



Add the definitions related to creation/deletion of a modify header
context and the modify header steering action which are used for HW
packet header modify (re-write) as part of steering. Add as well the
modify header id into two intermediate structs and set it to the FTE.

Note that as the push/pop vlan steering actions are emulated by the
ewitch management code, we're not breaking any compatibility while
changing their values to make room for the modify header action which
is not emulated and whose value is part of the FW API. The new bit
values for the emulated actions are at the end of the possible range.

Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent a750276f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -285,8 +285,8 @@ enum {
	SET_VLAN_INSERT	= BIT(1)
	SET_VLAN_INSERT	= BIT(1)
};
};


#define MLX5_FLOW_CONTEXT_ACTION_VLAN_POP  0x40
#define MLX5_FLOW_CONTEXT_ACTION_VLAN_POP  0x4000
#define MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH 0x80
#define MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH 0x8000


struct mlx5_encap_entry {
struct mlx5_encap_entry {
	struct hlist_node encap_hlist;
	struct hlist_node encap_hlist;
+1 −0
Original line number Original line Diff line number Diff line
@@ -249,6 +249,7 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
	MLX5_SET(flow_context, in_flow_context, flow_tag, fte->flow_tag);
	MLX5_SET(flow_context, in_flow_context, flow_tag, fte->flow_tag);
	MLX5_SET(flow_context, in_flow_context, action, fte->action);
	MLX5_SET(flow_context, in_flow_context, action, fte->action);
	MLX5_SET(flow_context, in_flow_context, encap_id, fte->encap_id);
	MLX5_SET(flow_context, in_flow_context, encap_id, fte->encap_id);
	MLX5_SET(flow_context, in_flow_context, modify_header_id, fte->modify_id);
	in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context,
	in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context,
				      match_value);
				      match_value);
	memcpy(in_match_value, &fte->val, MLX5_ST_SZ_BYTES(fte_match_param));
	memcpy(in_match_value, &fte->val, MLX5_ST_SZ_BYTES(fte_match_param));
+1 −0
Original line number Original line Diff line number Diff line
@@ -476,6 +476,7 @@ static struct fs_fte *alloc_fte(struct mlx5_flow_act *flow_act,
	fte->index = index;
	fte->index = index;
	fte->action = flow_act->action;
	fte->action = flow_act->action;
	fte->encap_id = flow_act->encap_id;
	fte->encap_id = flow_act->encap_id;
	fte->modify_id = flow_act->modify_id;


	return fte;
	return fte;
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -152,6 +152,7 @@ struct fs_fte {
	u32				index;
	u32				index;
	u32				action;
	u32				action;
	u32				encap_id;
	u32				encap_id;
	u32				modify_id;
	enum fs_fte_status		status;
	enum fs_fte_status		status;
	struct mlx5_fc			*counter;
	struct mlx5_fc			*counter;
};
};
+2 −1
Original line number Original line Diff line number Diff line
@@ -134,11 +134,12 @@ struct mlx5_flow_act {
	u32 action;
	u32 action;
	u32 flow_tag;
	u32 flow_tag;
	u32 encap_id;
	u32 encap_id;
	u32 modify_id;
};
};


#define MLX5_DECLARE_FLOW_ACT(name) \
#define MLX5_DECLARE_FLOW_ACT(name) \
	struct mlx5_flow_act name = {MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\
	struct mlx5_flow_act name = {MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\
				     MLX5_FS_DEFAULT_FLOW_TAG, 0}
				     MLX5_FS_DEFAULT_FLOW_TAG, 0, 0}


/* Single destination per rule.
/* Single destination per rule.
 * Group ID is implied by the match criteria.
 * Group ID is implied by the match criteria.
Loading