[07/11] net/mlx5: fix block pop VLAN action on Tx
Checks
Commit Message
Add missing check in validation function of 'pop VLAN' action.
Action is not allowed for egress flow rules.
Fixes: b41e47da2592 ("net/mlx5: support pop flow action on VLAN header")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Wednesday, January 22, 2020 16:27
> To: Matan Azrad <matan@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>
> Cc: Raslan Darawsheh <rasland@mellanox.com>; Ori Kam
> <orika@mellanox.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH 07/11] net/mlx5: fix block pop VLAN action on Tx
>
> Add missing check in validation function of 'pop VLAN' action.
> Action is not allowed for egress flow rules.
>
> Fixes: b41e47da2592 ("net/mlx5: support pop flow action on VLAN header")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index 1ed677f..9dc08ce 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -1634,6 +1634,12 @@ struct field_modify_info modify_tcp[] = {
>
> RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> NULL,
> "pop vlan action is not supported");
> + if (attr->egress)
> + return rte_flow_error_set(error, ENOTSUP,
> +
> RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
> + NULL,
> + "pop vlan action not supported for "
> + "egress");
> /*
> * Check for inconsistencies:
> * fail strip_vlan in a flow that matches packets without VLAN tags.
> --
> 1.8.3.1
@@ -1634,6 +1634,12 @@ struct field_modify_info modify_tcp[] = {
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
"pop vlan action is not supported");
+ if (attr->egress)
+ return rte_flow_error_set(error, ENOTSUP,
+ RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
+ NULL,
+ "pop vlan action not supported for "
+ "egress");
/*
* Check for inconsistencies:
* fail strip_vlan in a flow that matches packets without VLAN tags.