From: Suanming Mou <suanmingm@mellanox.com>
To: Tonghao Zhang <xiangxia.m.yue@gmail.com>,
Matan Azrad <matan@mellanox.com>,
Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: avoid crash when meter action conf is NULL
Date: Mon, 16 Dec 2019 06:50:29 +0000 [thread overview]
Message-ID: <HE1PR05MB3484F30D7D860FD669D54918CC510@HE1PR05MB3484.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <CAMDZJNWO9B7PWwtJjPe9cZ7qxgxfrSki4C-bxAZKjutaFG-97g@mail.gmail.com>
> -----Original Message-----
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> Sent: Monday, December 16, 2019 9:29 AM
> To: Matan Azrad <matan@mellanox.com>; Shahaf Shuler
> <shahafs@mellanox.com>
> Cc: dev@dpdk.org; Suanming Mou <suanmingm@mellanox.com>
> Subject: Re: [PATCH v2] net/mlx5: avoid crash when meter action conf is
> NULL
>
> On Fri, Dec 13, 2019 at 10:21 PM <xiangxia.m.yue@gmail.com> wrote:
> >
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > When offloading the meter, should check the action conf and make sure
> > it is valid.
> >
> > Fixes: f46bf7488705 ("net/mlx5: support meter flow action")
> > Cc: Suanming Mou <suanmingm@mellanox.com>
> >
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > ---
> > v2: coding style issues:
> > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatch
> >
> es.dpdk.org%2Fpatch%2F63849%2F&data=02%7C01%7Csuanmingm%4
> 0mellanox
> > .com%7C65507f811a6c4e942c1d08d781c77b2a%7Ca652971c7d2e4d9ba6a4
> d149256f
> >
> 461b%7C0%7C0%7C637120566090170306&sdata=0qTU8puaLH8IQkUm
> %2B4nIDG8G
> > 3dTi9ktvYKp%2BcxJ8dE4%3D&reserved=0
> > ---
> > drivers/net/mlx5/mlx5_flow_dv.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > b/drivers/net/mlx5/mlx5_flow_dv.c index 73aaea4..7528556 100644
> > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > @@ -3402,7 +3402,12 @@ struct field_modify_info modify_tcp[] = { {
> > struct mlx5_priv *priv = dev->data->dev_private;
> > const struct rte_flow_action_meter *am = action->conf;
> > - struct mlx5_flow_meter *fm = mlx5_flow_meter_find(priv, am-
> >mtr_id);
> > + struct mlx5_flow_meter *fm;
> > +
> > + if (!am)
> > + return rte_flow_error_set(error, EINVAL,
> > + RTE_FLOW_ERROR_TYPE_ACTION, NULL,
> > + "meter action conf is
> > + NULL");
> >
> > if (action_flags & MLX5_FLOW_ACTION_METER)
> > return rte_flow_error_set(error, ENOTSUP, @@ -3417,6
> > +3422,8 @@ struct field_modify_info modify_tcp[] = {
> > RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
> > NULL,
> > "meter action not
> > supported");
> > +
Redundant empty line.
Reviewed-by: Suanming Mou <suanmingm@mellanox.com>
> > + fm = mlx5_flow_meter_find(priv, am->mtr_id);
> > if (!fm)
> > return rte_flow_error_set(error, EINVAL,
> > RTE_FLOW_ERROR_TYPE_ACTION,
> > NULL,
> > --
> > 1.8.3.1
> >
> ping
next prev parent reply other threads:[~2019-12-16 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 14:21 xiangxia.m.yue
2019-12-16 1:29 ` Tonghao Zhang
2019-12-16 6:50 ` Suanming Mou [this message]
2020-01-07 6:39 ` Tonghao Zhang
2020-01-08 9:17 ` Raslan Darawsheh
2020-01-08 14:38 ` Ferruh Yigit
2020-01-08 15:09 ` Ferruh Yigit
2020-01-08 15:11 ` Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=HE1PR05MB3484F30D7D860FD669D54918CC510@HE1PR05MB3484.eurprd05.prod.outlook.com \
--to=suanmingm@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=shahafs@mellanox.com \
--cc=xiangxia.m.yue@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).