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 28630A04A4; Sun, 24 May 2020 12:48:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D13B91D17D; Sun, 24 May 2020 12:48:12 +0200 (CEST) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by dpdk.org (Postfix) with ESMTP id 0D75E1BF87 for ; Sun, 24 May 2020 12:48:11 +0200 (CEST) Received: by mail-ej1-f66.google.com with SMTP id nr22so1402276ejb.6 for ; Sun, 24 May 2020 03:48:10 -0700 (PDT) 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=Jx8ISOxdkzJR215WXNpDB0eFoighlFq+8Gk7oVily70=; b=t5vIBC6DN+A0FAggpW3QroUp7gh1A1nVKLdW728tRY11yvxhL4Z4yinBlSUXfKB9Ld VVpf2M6VUS6sJqXPsJbcXlKuWrkmTxZxVfIvOGnEnvgkBiSlJ+KboD7NG/2NtZy4/AgJ ymCbg9Ce9wFn9yQBmJFaLi7i5tV9z5xeN6sgDFEXL2dT4jyD+D7/0QhDxFw6Ht/kZ4dc kYYii4a/WzWgI8abxaQ+zOKkXW3OTqMUclo+eQG6MMknNQwKxJtO7csd4a5z0TZvhnzV V0wehptObxFMocqCqajdOwtPXtz6V4D4aBWzgAFbff7DqocOapaXvHX9MbEgTLaRX8XC SxGA== 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=Jx8ISOxdkzJR215WXNpDB0eFoighlFq+8Gk7oVily70=; b=LhOW7YByzh2rwJgWodQRT2zPyhB07PRyIS+I7rNE4HMENUwhBYEwqXwftKEAI2ILrb Waw7AqLKRa386tzf/MLTDYDzTKlHI1+o6iqUouM8RtxdSNtUnbQJ651LjhbrJ8+7otY1 ko3jlYYFpWhz4UMNhTw4uQza5NyeMI3O/yX/9ESN3gAJpLOleXweIWJ4Vtea7McUqz7V BgNFk9YoUJeMMXoZxH6udtxgFCSMgZSrkU2AwDZxZqgEvdV3CvNv1SipdZ8ZQstuXMBj JJi1WEc2dQlHoAgakaZZNel8vd8hZc+8C85NgRuVAtPwK+9DZv+HILKYLrJCiOvNPHWt yoNA== X-Gm-Message-State: AOAM530TC9/xFO6lzrTjgQEr0rTjlJXsytucZwRuAqsKIoZ6E+SYhP6c +s2Yryq9kzWFX76ftG3yKRQBPN71lPzyGOYT9AI= X-Google-Smtp-Source: ABdhPJx1n1xiwZZK8/2SoTgCqt2yMo9Te8IhsaK0KBmNjNVsZBpQ/PVq7ZYFpwjE86ei80b91KM1ifeC+xYAvqHQas4= X-Received: by 2002:a17:906:9605:: with SMTP id s5mr15806590ejx.135.1590317290644; Sun, 24 May 2020 03:48:10 -0700 (PDT) MIME-Version: 1.0 References: <20200520013328.98838-1-xiangxia.m.yue@gmail.com> In-Reply-To: From: Tonghao Zhang Date: Sun, 24 May 2020 18:47:34 +0800 Message-ID: To: Slava Ovsiienko Cc: "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH dpdk-dev] net/mlx5: check the reg available for metadata action 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 Sat, May 23, 2020 at 1:17 AM Slava Ovsiienko wrote: > > Hi, Tonghao > > Thank you for the patch. > I suppose, the patch should be extended to encompass the routines: > - flow_dv_convert_action_mark > - flow_dv_convert_action_set_meta (done in the patch) > - flow_dv_validate_item_mark > - flow_dv_validate_item_mark > - flow_dv_validate_action_flag > - flow_dv_validate_action_mark > > In action converting routines we should add MLX5_ASSERT() > (returning REG_NONE must not happen there - the wrong > conditions must be filtered out on validation stage) > > One more point - it would be good to add cc:stable@dpdk.org > > Would you like to extend the patch or let us do it? Hi Slava, thanks for your reviews. I haven't done some research for tag/flag/mark so you can send a patch to fix it. and I will sent v2 for metadata action. Thanks. > With best regards, > Slava > > > -----Original Message----- > > From: xiangxia.m.yue@gmail.com > > Sent: Wednesday, May 20, 2020 4:33 > > To: Slava Ovsiienko ; dev@dpdk.org > > Cc: Tonghao Zhang > > Subject: [PATCH dpdk-dev] net/mlx5: check the reg available for metadata > > action > > > > From: Tonghao Zhang > > > > If user don't set the dv_xmeta_en to 1 or 2, in the > > flow_dv_convert_action_set_meta function: > > * flow_dv_get_metadata_reg may return the REG_NONE, > > when MLX5_METADATA_FDB enabled for metadata set > > action. > > * reg_to_field(REG_NONE) return MLX5_MODI_OUT_NONE > > which is invalid. > > > > The rdma-core calltrace: > > dr_action_create_modify_action > > dr_actions_convert_modify_header > > dr_action_modify_sw_to_hw > > dr_action_modify_sw_to_hw_set > > dr_ste_get_modify_hdr_hw_field > > > > sw_field [MLX5_MODI_OUT_NONE 4095] > > should not > ste_ctx->modify_hdr_field_arr_sz [92] > > > > As doc[1] says: > > | dv_xmeta_en 0, this is default value, defines the legacy mode, the > > | MARK and META related actions and items operate only within NIC Tx and > > | NIC Rx steering domains, no MARK and META information crosses the > > | domain boundaries. > > > > This patch add check for that case to warn that not supported. > > > > [1] - > > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdoc.dp > > dk.org%2Fguides- > > 20.02%2Fnics%2Fmlx5.html&data=02%7C01%7Cviacheslavo%40mellan > > ox.com%7C49a86a92f7884fb4d45808d7fc5de31a%7Ca652971c7d2e4d9ba6 > > a4d149256f461b%7C0%7C0%7C637255352498582078&sdata=cDfb%2F > > oJAPNvGhMjUrjmjAE3R%2FH4wUpOI7WcZ5miTLvA%3D&reserved=0 > > > > Signed-off-by: Tonghao Zhang > > --- > > drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > > b/drivers/net/mlx5/mlx5_flow_dv.c index e4818319507c..dfcaf90eda11 > > 100644 > > --- a/drivers/net/mlx5/mlx5_flow_dv.c > > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > > @@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_meta > > > > if (reg < 0) > > return reg; > > + > > + if (reg == REG_NONE) > > + return rte_flow_error_set(error, ENOTSUP, > > + RTE_FLOW_ERROR_TYPE_ITEM, > > + NULL, "unavailable " > > + "metadata register"); > > /* > > * In datapath code there is no endianness > > * coversions for perfromance reasons, all > > -- > > 2.26.1 > -- Best regards, Tonghao