* [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check
@ 2019-10-07 13:56 Viacheslav Ovsiienko
2019-10-08 9:34 ` Raslan Darawsheh
0 siblings, 1 reply; 3+ messages in thread
From: Viacheslav Ovsiienko @ 2019-10-07 13:56 UTC (permalink / raw)
To: dev; +Cc: matan, rasland
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(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2a7e3ed..20e66f6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -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");
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check
2019-10-07 13:56 [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check Viacheslav Ovsiienko
@ 2019-10-08 9:34 ` Raslan Darawsheh
2019-10-08 11:02 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Raslan Darawsheh @ 2019-10-08 9:34 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check
2019-10-08 9:34 ` Raslan Darawsheh
@ 2019-10-08 11:02 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-10-08 11:02 UTC (permalink / raw)
To: Raslan Darawsheh, Slava Ovsiienko, dev; +Cc: Matan Azrad
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-08 11:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 13:56 [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check Viacheslav Ovsiienko
2019-10-08 9:34 ` Raslan Darawsheh
2019-10-08 11:02 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).