From: Gregory Etelson Date: Fri, 11 Dec 2020 14:46:14 +0000 (+0200) Subject: net/mlx5: fix tunnel rules validation on VF representor X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=187f942b2de0856e62ae10a8b79469f8c4c487fa;p=dpdk.git net/mlx5: fix tunnel rules validation on VF representor MLX5 PMD implicitly adds vxlan_decap flow action to tunnel offload match type rules. However, VXLAN decap action on VF representors is not supported on MLX5 PMD hardware. The patch rejects attempt to create tunnel offload flow rules on VF representor. Refer commit 9c4971e5231d ("net/mlx5: update VLAN and encap actions validation") Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7c2b389c63..4f638e24ad 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5280,6 +5280,11 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, } else { tunnel = NULL; } + if (tunnel && priv->representor) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "decap not supported " + "for VF representor"); grp_info.std_tbl_fix = tunnel_use_standard_attr_group_translate (dev, tunnel, attr, items, actions); ret = flow_dv_validate_attributes(dev, tunnel, attr, &grp_info, error);