net/mlx5: fix port id action domain check
Checks
Commit Message
The validating routines flow_dv_validate_action_port_id() and
flow_dv_validate_item_port_id() could return the positive or
ever zero value in case of domains mismatch and the validation
routine missed the rules for ports belonging to different
switching domains.
Fixes: 812909392b52 ("net/mlx5: elaborate E-Switch port parameters query")
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Comments
Hi,
> -----Original Message-----
> From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> Sent: Monday, October 7, 2019 4:56 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>
> Subject: [PATCH] net/mlx5: fix port id action domain check
>
> The validating routines flow_dv_validate_action_port_id() and
> flow_dv_validate_item_port_id() could return the positive or ever zero
> value in case of domains mismatch and the validation routine missed the
> rules for ports belonging to different switching domains.
>
> Fixes: 812909392b52 ("net/mlx5: elaborate E-Switch port parameters query")
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
On 10/8/2019 10:34 AM, Raslan Darawsheh wrote:
> Hi,
>
>> -----Original Message-----
>> From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
>> Sent: Monday, October 7, 2019 4:56 PM
>> To: dev@dpdk.org
>> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
>> <rasland@mellanox.com>
>> Subject: [PATCH] net/mlx5: fix port id action domain check
>>
>> The validating routines flow_dv_validate_action_port_id() and
>> flow_dv_validate_item_port_id() could return the positive or ever zero
>> value in case of domains mismatch and the validation routine missed the
>> rules for ports belonging to different switching domains.
>>
>> Fixes: 812909392b52 ("net/mlx5: elaborate E-Switch port parameters query")
>>
>> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
>
>
> Patch applied to next-net-mlx,
Squashed into relevant commit in next-net, thanks.
@@ -847,18 +847,18 @@ struct field_modify_info modify_tcp[] = {
return 0;
esw_priv = mlx5_port_to_eswitch_info(spec->id);
if (!esw_priv)
- return rte_flow_error_set(error, -rte_errno,
+ return rte_flow_error_set(error, rte_errno,
RTE_FLOW_ERROR_TYPE_ITEM_SPEC, spec,
"failed to obtain E-Switch info for"
" port");
dev_priv = mlx5_dev_to_eswitch_info(dev);
if (!dev_priv)
- return rte_flow_error_set(error, -rte_errno,
+ return rte_flow_error_set(error, rte_errno,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
"failed to obtain E-Switch info");
if (esw_priv->domain_id != dev_priv->domain_id)
- return rte_flow_error_set(error, -ret,
+ return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM_SPEC, spec,
"cannot match on a port from a"
" different E-Switch");
@@ -2462,7 +2462,7 @@ struct field_modify_info modify_tcp[] = {
" a flow");
dev_priv = mlx5_dev_to_eswitch_info(dev);
if (!dev_priv)
- return rte_flow_error_set(error, -rte_errno,
+ return rte_flow_error_set(error, rte_errno,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL,
"failed to obtain E-Switch info");
@@ -2471,12 +2471,12 @@ struct field_modify_info modify_tcp[] = {
act_priv = mlx5_port_to_eswitch_info(port);
if (!act_priv)
return rte_flow_error_set
- (error, -rte_errno,
+ (error, rte_errno,
RTE_FLOW_ERROR_TYPE_ACTION_CONF, port_id,
"failed to obtain E-Switch port id for port");
if (act_priv->domain_id != dev_priv->domain_id)
return rte_flow_error_set
- (error, -rte_errno,
+ (error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"port does not belong to"
" E-Switch being configured");