From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D16A7A04F6; Tue, 7 Jan 2020 07:39:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F5F01D61A; Tue, 7 Jan 2020 07:39:38 +0100 (CET) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 2FDFA1D60D for ; Tue, 7 Jan 2020 07:39:37 +0100 (CET) Received: by mail-lj1-f196.google.com with SMTP id y6so45474446lji.0 for ; Mon, 06 Jan 2020 22:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/GE2w9cY0RIbyPVWKkFUMnpTOpfrthxXb3IZa3grhVQ=; b=t34MPyvHWKCVTapii0tqqso+Ok3oE1CFuogFzwo/nXpk9MZuBiXR7eIHOHE/fY/pIX /N4acTGkrJM5l1ytrAkBmMO/WhiRE9DtJMG1p9sqbp0RCVcNQjBmGWil14KCCysYu7U7 7AUu1IwUH7HbVhLMa0/ro6zCm+cqud7CTZX3WkLVd8XkcKHJdC4mxAP+0Y2RCNJcuw09 o8VUeLHb3LopIKy6w6ecZqBEG/Mv/C88RO+D5tM/EOEIC4Nox2hFELW5W1dnkg2lp88X fdInAbySWt2XVzUiOLo7YuVVU416tzlRRs0x9x8DnbgZAoLhoxOcbmvW90lS8ok7lkz2 5s3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/GE2w9cY0RIbyPVWKkFUMnpTOpfrthxXb3IZa3grhVQ=; b=YZo2aaQ7Z4D8qdmCO8k3ELRGXvnOJGKdYvAVn663VvC2vfP8x9XlqHQ4Oqehj3bN3f biuoKF9/aCsyrXunLQXEyOWiEIXAa2BetaM6F2oKbWrVdqH2E++PP3pJX0QjdcD4aTQY cnNIzdI2B4oUlIGZsl28bEv4DUy2D69QDW4yFfB8gAb81UsWZUXm2An9u/VM1i9F5Cq0 hKzN3vy3khugpl9NOWqEG79mphoZAfiFRM+lyyYHF3ZIz3HcOrQMDwiZ7OyhB02+p19b jyEHMnfhxSpuVSru3EJ6d15VC6s5WyZjlRvO7srDHxeS6BoDCLsUK73M7wp3ZtKFDEUg RbnQ== X-Gm-Message-State: APjAAAWSl3bg34xgbtIDn9c65XsqY12ksH6xplzxw2B0eqPSBS6Atvmh 5L92JQK1GPUUS4o80LlbTppowUG5MPk6q5RX2ZA= X-Google-Smtp-Source: APXvYqwwJKwOF6qhZlz91TOndVGJGRJsQ9Y2P49bpifwjlfmdddKoXfXLsI7rRbMDiZ4fK2spZ8faq8jGxIw1OlLqh4= X-Received: by 2002:a2e:9f47:: with SMTP id v7mr40562606ljk.124.1578379176681; Mon, 06 Jan 2020 22:39:36 -0800 (PST) MIME-Version: 1.0 References: <1576246894-31496-1-git-send-email-xiangxia.m.yue@gmail.com> In-Reply-To: From: Tonghao Zhang Date: Tue, 7 Jan 2020 14:39:00 +0800 Message-ID: To: Suanming Mou Cc: Matan Azrad , Shahaf Shuler , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: avoid crash when meter action conf is NULL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Dec 16, 2019 at 2:50 PM Suanming Mou wrote: > > > > -----Original Message----- > > From: Tonghao Zhang > > Sent: Monday, December 16, 2019 9:29 AM > > To: Matan Azrad ; Shahaf Shuler > > > > Cc: dev@dpdk.org; Suanming Mou > > Subject: Re: [PATCH v2] net/mlx5: avoid crash when meter action conf is > > NULL > > > > On Fri, Dec 13, 2019 at 10:21 PM wrote: > > > > > > From: Tonghao Zhang > > > > > > 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 > > > > > > Signed-off-by: Tonghao Zhang > > > --- > > > 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 so this patch will be applied ? > > > + 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