net/mlx5: DR, Remove unneeded vlan check from L2 builder
When we create a matcher we check that all fields are consumed. There is no need for this specific check. This keeps the STE builder functions simple and clean. Signed-off-by: Alex Vesker <valex@nvidia.com> Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
38a5c59d7e
commit
e6422d1da0
|
@ -258,10 +258,8 @@ static int dr_matcher_set_ste_builders(struct mlx5dr_matcher *matcher,
|
||||||
|
|
||||||
if (dr_mask_is_smac_set(&mask.outer) &&
|
if (dr_mask_is_smac_set(&mask.outer) &&
|
||||||
dr_mask_is_dmac_set(&mask.outer)) {
|
dr_mask_is_dmac_set(&mask.outer)) {
|
||||||
ret = mlx5dr_ste_build_eth_l2_src_des(&sb[idx++], &mask,
|
mlx5dr_ste_build_eth_l2_src_des(&sb[idx++], &mask,
|
||||||
inner, rx);
|
inner, rx);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dr_mask_is_smac_set(&mask.outer))
|
if (dr_mask_is_smac_set(&mask.outer))
|
||||||
|
@ -338,10 +336,8 @@ static int dr_matcher_set_ste_builders(struct mlx5dr_matcher *matcher,
|
||||||
|
|
||||||
if (dr_mask_is_smac_set(&mask.inner) &&
|
if (dr_mask_is_smac_set(&mask.inner) &&
|
||||||
dr_mask_is_dmac_set(&mask.inner)) {
|
dr_mask_is_dmac_set(&mask.inner)) {
|
||||||
ret = mlx5dr_ste_build_eth_l2_src_des(&sb[idx++],
|
mlx5dr_ste_build_eth_l2_src_des(&sb[idx++],
|
||||||
&mask, inner, rx);
|
&mask, inner, rx);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dr_mask_is_smac_set(&mask.inner))
|
if (dr_mask_is_smac_set(&mask.inner))
|
||||||
|
|
|
@ -766,8 +766,8 @@ int mlx5dr_ste_build_ste_arr(struct mlx5dr_matcher *matcher,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dr_ste_build_eth_l2_src_des_bit_mask(struct mlx5dr_match_param *value,
|
static void dr_ste_build_eth_l2_src_des_bit_mask(struct mlx5dr_match_param *value,
|
||||||
bool inner, u8 *bit_mask)
|
bool inner, u8 *bit_mask)
|
||||||
{
|
{
|
||||||
struct mlx5dr_match_spec *mask = inner ? &value->inner : &value->outer;
|
struct mlx5dr_match_spec *mask = inner ? &value->inner : &value->outer;
|
||||||
|
|
||||||
|
@ -795,13 +795,6 @@ static int dr_ste_build_eth_l2_src_des_bit_mask(struct mlx5dr_match_param *value
|
||||||
MLX5_SET(ste_eth_l2_src_dst, bit_mask, first_vlan_qualifier, -1);
|
MLX5_SET(ste_eth_l2_src_dst, bit_mask, first_vlan_qualifier, -1);
|
||||||
mask->svlan_tag = 0;
|
mask->svlan_tag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask->cvlan_tag || mask->svlan_tag) {
|
|
||||||
pr_info("Invalid c/svlan mask configuration\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dr_ste_copy_mask_misc(char *mask, struct mlx5dr_match_misc *spec)
|
static void dr_ste_copy_mask_misc(char *mask, struct mlx5dr_match_misc *spec)
|
||||||
|
@ -1092,23 +1085,17 @@ static int dr_ste_build_eth_l2_src_des_tag(struct mlx5dr_match_param *value,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mlx5dr_ste_build_eth_l2_src_des(struct mlx5dr_ste_build *sb,
|
void mlx5dr_ste_build_eth_l2_src_des(struct mlx5dr_ste_build *sb,
|
||||||
struct mlx5dr_match_param *mask,
|
struct mlx5dr_match_param *mask,
|
||||||
bool inner, bool rx)
|
bool inner, bool rx)
|
||||||
{
|
{
|
||||||
int ret;
|
dr_ste_build_eth_l2_src_des_bit_mask(mask, inner, sb->bit_mask);
|
||||||
|
|
||||||
ret = dr_ste_build_eth_l2_src_des_bit_mask(mask, inner, sb->bit_mask);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
sb->rx = rx;
|
sb->rx = rx;
|
||||||
sb->inner = inner;
|
sb->inner = inner;
|
||||||
sb->lu_type = DR_STE_CALC_LU_TYPE(ETHL2_SRC_DST, rx, inner);
|
sb->lu_type = DR_STE_CALC_LU_TYPE(ETHL2_SRC_DST, rx, inner);
|
||||||
sb->byte_mask = dr_ste_conv_bit_to_byte_mask(sb->bit_mask);
|
sb->byte_mask = dr_ste_conv_bit_to_byte_mask(sb->bit_mask);
|
||||||
sb->ste_build_tag_func = &dr_ste_build_eth_l2_src_des_tag;
|
sb->ste_build_tag_func = &dr_ste_build_eth_l2_src_des_tag;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dr_ste_build_eth_l3_ipv6_dst_bit_mask(struct mlx5dr_match_param *value,
|
static void dr_ste_build_eth_l3_ipv6_dst_bit_mask(struct mlx5dr_match_param *value,
|
||||||
|
|
|
@ -288,9 +288,9 @@ int mlx5dr_ste_build_ste_arr(struct mlx5dr_matcher *matcher,
|
||||||
struct mlx5dr_matcher_rx_tx *nic_matcher,
|
struct mlx5dr_matcher_rx_tx *nic_matcher,
|
||||||
struct mlx5dr_match_param *value,
|
struct mlx5dr_match_param *value,
|
||||||
u8 *ste_arr);
|
u8 *ste_arr);
|
||||||
int mlx5dr_ste_build_eth_l2_src_des(struct mlx5dr_ste_build *builder,
|
void mlx5dr_ste_build_eth_l2_src_des(struct mlx5dr_ste_build *builder,
|
||||||
struct mlx5dr_match_param *mask,
|
struct mlx5dr_match_param *mask,
|
||||||
bool inner, bool rx);
|
bool inner, bool rx);
|
||||||
void mlx5dr_ste_build_eth_l3_ipv4_5_tuple(struct mlx5dr_ste_build *sb,
|
void mlx5dr_ste_build_eth_l3_ipv4_5_tuple(struct mlx5dr_ste_build *sb,
|
||||||
struct mlx5dr_match_param *mask,
|
struct mlx5dr_match_param *mask,
|
||||||
bool inner, bool rx);
|
bool inner, bool rx);
|
||||||
|
|
Loading…
Reference in New Issue