* Re: [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table
2020-04-15 8:52 [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table xiangxia.m.yue
@ 2020-04-17 2:02 ` Suanming Mou
2020-04-21 7:47 ` Slava Ovsiienko
2020-04-21 15:02 ` Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Suanming Mou @ 2020-04-17 2:02 UTC (permalink / raw)
To: xiangxia.m.yue, david.marchand, Slava Ovsiienko, Matan Azrad; +Cc: dev, stable
Hi Tonghao,
Good catch.
Add maintainers.
Thanks,
SuanmingMou
> -----Original Message-----
> From: xiangxia.m.yue@gmail.com <xiangxia.m.yue@gmail.com>
> Sent: Wednesday, April 15, 2020 4:52 PM
> To: Suanming Mou <suanmingm@mellanox.com>;
> david.marchand@redhat.com
> Cc: dev@dpdk.org; Tonghao Zhang <xiangxia.m.yue@gmail.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix crash when releasing the meter table
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The meters of ports share the same meter table on the port. When releasing
> meters, don't check value returned using assert. Because other meters may
> reference to it.
>
> Fixes: 46a5e6bc6a85 ("net/mlx5: prepare meter flow tables")
> Fixes: 708aa5608f98 ("net/mlx5: fix meter suffix table leak")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-off-by: Suanming Mou <suanmingm@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index ae00ca431eec..2174b9aa37dc
> 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -8552,11 +8552,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->egress.any_matcher));
> if (mtd->egress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->egress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.tbl);
> if (mtd->egress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->egress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.sfx_tbl);
> if (mtd->ingress.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.color_matcher));
> @@ -8564,11 +8562,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.any_matcher));
> if (mtd->ingress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->ingress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.tbl);
> if (mtd->ingress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->ingress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.sfx_tbl);
> if (mtd->transfer.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.color_matcher));
> @@ -8576,11 +8572,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.any_matcher));
> if (mtd->transfer.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->transfer.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.tbl);
> if (mtd->transfer.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->transfer.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.sfx_tbl);
> if (mtd->drop_actn)
> claim_zero(mlx5_glue->destroy_flow_action(mtd->drop_actn));
> rte_free(mtd);
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table
2020-04-15 8:52 [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table xiangxia.m.yue
2020-04-17 2:02 ` Suanming Mou
@ 2020-04-21 7:47 ` Slava Ovsiienko
2020-04-21 15:02 ` Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Slava Ovsiienko @ 2020-04-21 7:47 UTC (permalink / raw)
To: xiangxia.m.yue, Suanming Mou, david.marchand; +Cc: dev, stable
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> xiangxia.m.yue@gmail.com
> Sent: Wednesday, April 15, 2020 11:52
> To: Suanming Mou <suanmingm@mellanox.com>;
> david.marchand@redhat.com
> Cc: dev@dpdk.org; Tonghao Zhang <xiangxia.m.yue@gmail.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter
> table
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The meters of ports share the same meter table on the port. When releasing
> meters, don't check value returned using assert. Because other meters may
> reference to it.
>
> Fixes: 46a5e6bc6a85 ("net/mlx5: prepare meter flow tables")
> Fixes: 708aa5608f98 ("net/mlx5: fix meter suffix table leak")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c index ae00ca431eec..2174b9aa37dc
> 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -8552,11 +8552,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->egress.any_matcher));
> if (mtd->egress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->egress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.tbl);
> if (mtd->egress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >egress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.sfx_tbl);
> if (mtd->ingress.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.color_matcher));
> @@ -8564,11 +8562,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.any_matcher));
> if (mtd->ingress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->ingress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.tbl);
> if (mtd->ingress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >ingress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.sfx_tbl);
> if (mtd->transfer.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.color_matcher));
> @@ -8576,11 +8572,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.any_matcher));
> if (mtd->transfer.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->transfer.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.tbl);
> if (mtd->transfer.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >transfer.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.sfx_tbl);
> if (mtd->drop_actn)
> claim_zero(mlx5_glue->destroy_flow_action(mtd-
> >drop_actn));
> rte_free(mtd);
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table
2020-04-15 8:52 [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter table xiangxia.m.yue
2020-04-17 2:02 ` Suanming Mou
2020-04-21 7:47 ` Slava Ovsiienko
@ 2020-04-21 15:02 ` Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-04-21 15:02 UTC (permalink / raw)
To: xiangxia.m.yue, Suanming Mou, david.marchand; +Cc: dev, stable
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> xiangxia.m.yue@gmail.com
> Sent: Wednesday, April 15, 2020 11:52 AM
> To: Suanming Mou <suanmingm@mellanox.com>;
> david.marchand@redhat.com
> Cc: dev@dpdk.org; Tonghao Zhang <xiangxia.m.yue@gmail.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix crash when releasing the meter
> table
>
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> The meters of ports share the same meter table on
> the port. When releasing meters, don't check value returned
> using assert. Because other meters may reference to it.
>
> Fixes: 46a5e6bc6a85 ("net/mlx5: prepare meter flow tables")
> Fixes: 708aa5608f98 ("net/mlx5: fix meter suffix table leak")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> ---
> drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index ae00ca431eec..2174b9aa37dc 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -8552,11 +8552,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->egress.any_matcher));
> if (mtd->egress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->egress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.tbl);
> if (mtd->egress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >egress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->egress.sfx_tbl);
> if (mtd->ingress.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.color_matcher));
> @@ -8564,11 +8562,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->ingress.any_matcher));
> if (mtd->ingress.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->ingress.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.tbl);
> if (mtd->ingress.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >ingress.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->ingress.sfx_tbl);
> if (mtd->transfer.color_matcher)
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.color_matcher));
> @@ -8576,11 +8572,9 @@ struct field_modify_info modify_tcp[] = {
> claim_zero(mlx5_glue->dv_destroy_flow_matcher
> (mtd->transfer.any_matcher));
> if (mtd->transfer.tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd->transfer.tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.tbl);
> if (mtd->transfer.sfx_tbl)
> - claim_zero(flow_dv_tbl_resource_release(dev,
> - mtd-
> >transfer.sfx_tbl));
> + flow_dv_tbl_resource_release(dev, mtd->transfer.sfx_tbl);
> if (mtd->drop_actn)
> claim_zero(mlx5_glue->destroy_flow_action(mtd-
> >drop_actn));
> rte_free(mtd);
> --
> 1.8.3.1
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 4+ messages in thread