* [dpdk-stable] [PATCH] net/mlx5: fix incorrect pointer operation
@ 2020-01-07 8:56 Suanming Mou
2020-01-07 14:29 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2020-01-08 10:41 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Suanming Mou
0 siblings, 2 replies; 5+ messages in thread
From: Suanming Mou @ 2020-01-07 8:56 UTC (permalink / raw)
To: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko
Cc: dev, xiangxia.m.yue, rasland, stable
The meter suffix flow item pointer restore is not correct to minus a
fixed value. It should minus the real offset it increases.
Set the value to the real offset the pointer increases to fix the issue.
Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Tested-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
drivers/net/mlx5/mlx5_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cb9d265..52ffcb2 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
sfx_items++;
}
sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
- sfx_items -= METER_SUFFIX_ITEM;
+ sfx_items -= sfx_port_id_item ? 2 : 1;
/* Setting the sfx group atrr. */
sfx_attr.group = sfx_attr.transfer ?
(MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix incorrect pointer operation
2020-01-07 8:56 [dpdk-stable] [PATCH] net/mlx5: fix incorrect pointer operation Suanming Mou
@ 2020-01-07 14:29 ` Thomas Monjalon
2020-01-08 10:41 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Suanming Mou
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2020-01-07 14:29 UTC (permalink / raw)
To: Suanming Mou
Cc: dev, Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko,
xiangxia.m.yue, rasland, stable
Hi,
How this issue was seen? Is it related to the bug reported by Tonghao Zhang?
If yes, you may use "Reported-by:".
One comment about the title, please describe which area is fixed,
instead of "incorrect pointer operation" which is very generic.
The title should probably include the word "meter".
Then in the explanations below, please explain what is the impact of the bug.
Thanks
07/01/2020 09:56, Suanming Mou:
> The meter suffix flow item pointer restore is not correct to minus a
> fixed value. It should minus the real offset it increases.
>
> Set the value to the real offset the pointer increases to fix the issue.
>
> Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
> Cc: stable@dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> Tested-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
2020-01-07 8:56 [dpdk-stable] [PATCH] net/mlx5: fix incorrect pointer operation Suanming Mou
2020-01-07 14:29 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
@ 2020-01-08 10:41 ` Suanming Mou
2020-01-20 13:08 ` Slava Ovsiienko
2020-01-20 14:03 ` Raslan Darawsheh
1 sibling, 2 replies; 5+ messages in thread
From: Suanming Mou @ 2020-01-08 10:41 UTC (permalink / raw)
To: Matan Azrad, Shahaf Shuler, Viacheslav Ovsiienko
Cc: dev, xiangxia.m.yue, rasland, stable
The meter suffix flow item pointer restore is not correct to decrease
a fixed value. The incorrect operation will cause incorrect match to
the meter suffix flow, the flow create will fail once the magic number
in the wrong offset memory start with RTE_FLOW_ITEM_TYPE_END.
The pointer should decrease the real offset it increases.
Set the decrease value to the real offset the pointer increases to fix
the issue.
Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
v2: commit message adjust.
---
drivers/net/mlx5/mlx5_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index cb9d265..52ffcb2 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
sfx_items++;
}
sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
- sfx_items -= METER_SUFFIX_ITEM;
+ sfx_items -= sfx_port_id_item ? 2 : 1;
/* Setting the sfx group atrr. */
sfx_attr.group = sfx_attr.transfer ?
(MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
2020-01-08 10:41 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Suanming Mou
@ 2020-01-20 13:08 ` Slava Ovsiienko
2020-01-20 14:03 ` Raslan Darawsheh
1 sibling, 0 replies; 5+ messages in thread
From: Slava Ovsiienko @ 2020-01-20 13:08 UTC (permalink / raw)
To: Suanming Mou, Matan Azrad, Shahaf Shuler
Cc: dev, xiangxia.m.yue, Raslan Darawsheh, stable
> -----Original Message-----
> From: Suanming Mou <suanmingm@mellanox.com>
> Sent: Wednesday, January 8, 2020 12:41
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; xiangxia.m.yue@gmail.com; Raslan Darawsheh
> <rasland@mellanox.com>; stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
>
> The meter suffix flow item pointer restore is not correct to decrease a fixed
> value. The incorrect operation will cause incorrect match to the meter suffix
> flow, the flow create will fail once the magic number in the wrong offset
> memory start with RTE_FLOW_ITEM_TYPE_END.
> The pointer should decrease the real offset it increases.
>
> Set the decrease value to the real offset the pointer increases to fix the issue.
>
> Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
> Cc: stable@dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>
> v2: commit message adjust.
>
> ---
> drivers/net/mlx5/mlx5_flow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index cb9d265..52ffcb2 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> sfx_items++;
> }
> sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
> - sfx_items -= METER_SUFFIX_ITEM;
> + sfx_items -= sfx_port_id_item ? 2 : 1;
> /* Setting the sfx group atrr. */
> sfx_attr.group = sfx_attr.transfer ?
> (MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
2020-01-08 10:41 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Suanming Mou
2020-01-20 13:08 ` Slava Ovsiienko
@ 2020-01-20 14:03 ` Raslan Darawsheh
1 sibling, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2020-01-20 14:03 UTC (permalink / raw)
To: Suanming Mou, Matan Azrad, Shahaf Shuler, Slava Ovsiienko
Cc: dev, xiangxia.m.yue, stable
Hi,
> -----Original Message-----
> From: Suanming Mou <suanmingm@mellanox.com>
> Sent: Wednesday, January 8, 2020 12:41 PM
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Cc: dev@dpdk.org; xiangxia.m.yue@gmail.com; Raslan Darawsheh
> <rasland@mellanox.com>; stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix incorrect pointer operation in meter
>
> The meter suffix flow item pointer restore is not correct to decrease
> a fixed value. The incorrect operation will cause incorrect match to
> the meter suffix flow, the flow create will fail once the magic number
> in the wrong offset memory start with RTE_FLOW_ITEM_TYPE_END.
> The pointer should decrease the real offset it increases.
>
> Set the decrease value to the real offset the pointer increases to fix
> the issue.
>
> Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
> Cc: stable@dpdk.org
>
> Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
> Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
>
> v2: commit message adjust.
>
> ---
> drivers/net/mlx5/mlx5_flow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index cb9d265..52ffcb2 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -4037,7 +4037,7 @@ uint32_t mlx5_flow_adjust_priority(struct
> rte_eth_dev *dev, int32_t priority,
> sfx_items++;
> }
> sfx_items->type = RTE_FLOW_ITEM_TYPE_END;
> - sfx_items -= METER_SUFFIX_ITEM;
> + sfx_items -= sfx_port_id_item ? 2 : 1;
> /* Setting the sfx group atrr. */
> sfx_attr.group = sfx_attr.transfer ?
> (MLX5_FLOW_TABLE_LEVEL_SUFFIX - 1) :
> --
> 1.8.3.1
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-20 14:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 8:56 [dpdk-stable] [PATCH] net/mlx5: fix incorrect pointer operation Suanming Mou
2020-01-07 14:29 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2020-01-08 10:41 ` [dpdk-stable] [PATCH v2] net/mlx5: fix incorrect pointer operation in meter Suanming Mou
2020-01-20 13:08 ` Slava Ovsiienko
2020-01-20 14:03 ` Raslan Darawsheh
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).