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 0AACEA04A2; Fri, 22 May 2020 19:17:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 493B71DA00; Fri, 22 May 2020 19:17:20 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2043.outbound.protection.outlook.com [40.107.21.43]) by dpdk.org (Postfix) with ESMTP id 9BF961D9F9 for ; Fri, 22 May 2020 19:17:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksTHt3KpasM3HfeGza47/04Wq1Fo5i5NUDSYffEJ2abpx9SnbHdLEAHwUrHj0jMSdGp1+3cX//J7EW3HAk/oNrMAG2D+UU4Sx0zyHxlOxugI0I1/lk1VrfxKYbKspb+Vtn3BD7GG+KOnNy6wJgrGuiJUxw3KzEY9WDS7ovRqQZQq3UE4aUPDvC/2S67p93p53DQSbabDhU4H7weMNfo7fz32q5XtQaG+SBhqW0JkkxWgZIOI28rVN7QiQMfJgOmtp6jhy4FWDpDnVAI9zQRrQzf0o4rwrQ8wAKTrSV7DmWwHA/YXcsT0xaFh3lzdhF8mPb4rdH/Nzz9SKQ83ulMXvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nQJnTvZSpxb5mKCiHuY4JgO188vZujUCzOBN++zSPpg=; b=EkwKZE4HZ4Ij88WE2bQ+pt0r/pMn9mklvVexqVxu4CkY76g0aEBecZsIj+mlUVKv5fej3Ks05E8zQgtEBgxj8tF8gnBfuNxc65nztrpCj96e5ZnGpUqo7C2qRTsCVCL52UAztxI3LliKce+oznnWqXMJMpVy6/TVAHgEEzFoOMUO0P3DRZ6lYCKjA6ytBCCMitRGBk54Fgl6M684Pd05Z3UWjFHOUoz4kr1bAdC50ERXIY5iJnMEsQbtWpJYxZWA7YZhbXyDrT1E2oOlWixsGcgdMXB/TmVusetwZxwIhE2Z7C9UREeEnLdwJIw0jdPUDuRrOfSte/4m0ToY+SiQuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nQJnTvZSpxb5mKCiHuY4JgO188vZujUCzOBN++zSPpg=; b=M7/HKNMCsbjEIcaZn2PFWJsq0FXeXuUv+E4g0K5usH+rHWbLWumQQ08UHw5WLUdRYiDVpJTvJAkidIsx5Mh9O6g3MakTmpKjGFHTHpGqNlPJGxDotv795yiqpZpDmnMCnVpzMttujR4FVjiOLs3GKl/WpmjlIhwlQjQpYdwtfU8= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:8::26) by AM4PR05MB3218.eurprd05.prod.outlook.com (2603:10a6:205:f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Fri, 22 May 2020 17:17:12 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4%7]) with mapi id 15.20.3000.034; Fri, 22 May 2020 17:17:11 +0000 From: Slava Ovsiienko To: "xiangxia.m.yue@gmail.com" , "dev@dpdk.org" Thread-Topic: [PATCH dpdk-dev] net/mlx5: check the reg available for metadata action Thread-Index: AQHWLkbC6Dn/NS2dAE6C3JL0aD8eFKi0JKqw Date: Fri, 22 May 2020 17:17:11 +0000 Message-ID: References: <20200520013328.98838-1-xiangxia.m.yue@gmail.com> In-Reply-To: <20200520013328.98838-1-xiangxia.m.yue@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 27404b05-19f0-4139-17cc-08d7fe73f735 x-ms-traffictypediagnostic: AM4PR05MB3218: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 04111BAC64 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: u8duVuO0MR96bm6o03+diFSl8GEANFFazu5vjxX8CzjsUCrrJ+uOBUAKpA7RLiDI2t5kkoevo7ei+/V48NeqV0iafBLMmsH/zFEMESaXSaDzwN4T1+sbGTjI++p/ZCmMzp7kOR8pS+mb3j1O2Yya3xyG6zLv2bJAzfPmVlqnx34+cHCXDtPQ3wVafJw8x+ytO71/sSVj9UDM41GNFGSHeN32tIRi8c+YD166CfvKy50L7+l7cIx9Hbf2lBcSar6Nbqc0waUmbGYdDWDscDOsGV3fF7+BlkrZsZNhbgcT7DKstJV58s/27qJ7zcOCC9Ky6zxec5SFrqooFGPdbTMLMhxOVqGmro88NLPHX13wEr8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR05MB3265.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(136003)(39860400002)(376002)(396003)(8936002)(9686003)(66446008)(55016002)(26005)(8676002)(64756008)(66556008)(71200400001)(6506007)(86362001)(5660300002)(76116006)(53546011)(66946007)(186003)(7696005)(52536014)(66476007)(110136005)(478600001)(2906002)(45080400002)(966005)(316002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: cx7sttZq8KCjMNgfJsK03/J5xAJUXzQDqT6LaEMnDXKoe5/e17UlB9GEdwl1pX18o7ZwscG1bnAcTLyVIJS1817edpfKg5lymVMqioTOWccnJF+L56PfdimDT+yW1IEdoMgO8U9G3WlImUJJ1bO0E+dyA4bA+RBwGgXl+vbm3kYUVgS9MGZc2k5EWAysZyeditBl2DEcxKuu5ZF/IuXag1CmjTYBcZZLboXuDuSV4UNk8Kqrch6Y3m7nHXYPCmrFgnoM5gFD2u0rv4gnCx7Raq8fHUnPHS1ahgw7sgf03oDJNCMt9vG55ZvZbVey+YnRgSxPAc5eC/N9mmhD/cADET7+1jzh5wDcdT9R0khbKcYQnvFM8cDCNlkHkrrdyuv3kWUzXAS+gpPm4BNjNoMFyjyVe6a7Yod4ta76JGJIehbzMt3LUCxp48AcMJbGb2RBVYsaCEcWgK+83drBZAkQnmOVW67xzJjz1/46sus8068= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27404b05-19f0-4139-17cc-08d7fe73f735 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2020 17:17:11.6471 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dYBQ3seTgY5bI6PyM31zR266KbACElAXZ/GL3FCyk0dpyKcpe51aDS+uhWS0UKeKwrsx+7WzVJvIcTo4pdgZzuijm6FIl7fUMF2ZZgfouN8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3218 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" 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? 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 >=20 > From: Tonghao Zhang >=20 > 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. >=20 > 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 >=20 > sw_field [MLX5_MODI_OUT_NONE 4095] > should not > ste_ctx->modify_hdr_field_arr_sz [92] >=20 > 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. >=20 > This patch add check for that case to warn that not supported. >=20 > [1] - > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fdoc.dp > dk.org%2Fguides- > 20.02%2Fnics%2Fmlx5.html&data=3D02%7C01%7Cviacheslavo%40mellan > ox.com%7C49a86a92f7884fb4d45808d7fc5de31a%7Ca652971c7d2e4d9ba6 > a4d149256f461b%7C0%7C0%7C637255352498582078&sdata=3DcDfb%2F > oJAPNvGhMjUrjmjAE3R%2FH4wUpOI7WcZ5miTLvA%3D&reserved=3D0 >=20 > Signed-off-by: Tonghao Zhang > --- > drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > 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 >=20 > if (reg < 0) > return reg; > + > + if (reg =3D=3D 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