From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B0D9A0C44; Mon, 12 Apr 2021 09:38:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 262E140698; Mon, 12 Apr 2021 09:38:17 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by mails.dpdk.org (Postfix) with ESMTP id B814C4003D for ; Mon, 12 Apr 2021 09:38:15 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRd1Rn/iQ4tfFYSabl+1sbeiXUnhR3ISgdrH40HyzFZZqjtEWpbTWaFTntRQJQaCrluD891R+dKXn5Aa27KjKJHegLGyY0c1K4mM8DVNYdx0R3lvusrmJ1j5CV9/km8nQ3z1LfTKj/ZLPTl5YNnD4Z54HmQj2t0/Bi+8r1EYyf3HfsuQ6TZt7Enl1ggCy0BNhPcblacrzq5b1GchAiMaGQ4kjMSOsJsKbd1UrCMtqD489ieZvAB4MwTYEFz6W0IbRZKg0mOo1jiJcKod6gLpSemBiHPJ0U8ppeQpatjXID08u3nsBQSYfNUEN/3m16nBY8Atfa9T6ie4KDfP79HzNg== 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=7LPVNZZpgZH3BLGGEpegxAf9HGeMn58fldnzKe6fsA4=; b=HJkaMk+AQU+eHuR1Kd6xqyY8lIEtcnpYf0BYJjubT6uHloj52vgfgKuA2Amc0xEd0vB1RqEzSZ9Gb/3GOSFqnpC8j+3HPXV/mUIK9ARga6Z9QC9n+e0w3Ffsyn81ughKAB1O2lCx34L3tNj4Gy3gz/DbFxZVZ7OGPDEB3C6R0AQJLuFnyjiVuJZv0b83y6c+tUSTMA4iKUb1bKAZ+O5+KRzejJiJ1jeTqUzzO1OFyB1yhz52jcZ/K5o35d2E51eAI0Ig3IoL1N7HFZ3PVsMyJsr5VS+jkvH2xo+hfnYGQGi6uDix3mIHCWxx2Q0a7xwAwaps0EXgRXoPDGDEXmeh0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7LPVNZZpgZH3BLGGEpegxAf9HGeMn58fldnzKe6fsA4=; b=UQnN8RQJgfutrB+Cpg91+5WNclJEINhvAC+DNc6X988Lyc9I+tpCCjAWxBWbxvHsQ5XowZUzJzoT2UcZvxRuGfhacH8qqXHVj2zDyZ9oLu8eCjIr1epDgEyngpao8J3VfmQs9u57NJ6TDzPidk0f7qkJkMG1Hj2phNbWVGVBEU6NTaZ8Ch921dv+/OxA+BD2VE4Y6L/2LK0bOars1IIg++68XeIaJj4dsy0O9GekUEbozia08vOas35+Bf+3Jv2F/VcwMWcV8pKnhQ6LPYXojXaiJbML2qGLIXN22EPw5Ki4ZSP0523TATdhZSFd2H+/YUEvn1RXI6nLuGgKOwqP0A== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM5PR12MB1402.namprd12.prod.outlook.com (2603:10b6:3:73::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Mon, 12 Apr 2021 07:37:50 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::20f7:11fc:9d46:9258]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::20f7:11fc:9d46:9258%6]) with mapi id 15.20.4020.022; Mon, 12 Apr 2021 07:37:50 +0000 From: Slava Ovsiienko To: Haifei Luo , "dev@dpdk.org" CC: Ori Kam , Raslan Darawsheh , "Xueming(Steven) Li" , Haifei Luo , Matan Azrad , Shahaf Shuler Thread-Topic: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump feature Thread-Index: AQHXK3SXkIOw8d1hkkGReblxGt+ykqqwhUPA Date: Mon, 12 Apr 2021 07:37:50 +0000 Message-ID: References: <1615277716-64404-1-git-send-email-haifeil@nvidia.com> <1617775762-171898-1-git-send-email-haifeil@nvidia.com> <1617775762-171898-5-git-send-email-haifeil@nvidia.com> In-Reply-To: <1617775762-171898-5-git-send-email-haifeil@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f79e0a44-9ddb-47bd-34c4-08d8fd85dfef x-ms-traffictypediagnostic: DM5PR12MB1402: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +6xpWSIbtHRwCmLHt+aepJzA/6j3HHCzsmXk/AwS+4+wuXcwWIBkd2rUsFlAbpj4Y7UyreLnSwHbjKIS+GFF+Ue46IqAStLY5c12N9BCOx4n2eGKoP3yRgXm10t2zmnPtQwLsU8fyGj3DhZESJo7guP4HLNB0WB04iIRbfsM4DIetDO5dptQ0jdtDVJvTfotxSqo5rx0AgCTMcl3/0k+YjwPbSykBDiQCnyny48V7d/pBfg6FwrsjTaViEMLGfKy8u4fUdKRIJ8Wws5UIhu/fGjkr4LdcALo8R2+oYjEp+vseUSQFcWG35B2ufxdio2ngbrKH13UI51hDAdV/4QT1cTX2aWVzvsxisyUW3RJMFNv32KA3djZyOpcGNQVeXrKBuuv5ALMczz5t5jbI2FKw5jR6cJl7P7KDvH4mcYqQ3mF8bdX+0U/dGWguwJV9nw85sbANjWFvmvkT7DxDKpKU2Z+Mzh4RijKjP6KNdzvER+RpG7G7zaV52/AcV6GNr3vkO3LN+rNaEnRJOmHx7IWqwM/zXNLn2GUr2F5r5mdl3aeYgzAq4863B3j2pO8X46d8YJllHHKlVw2LpGB7J3FkOF3QatQfexZe+3aCScnxpc= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(396003)(376002)(366004)(136003)(316002)(8936002)(107886003)(6506007)(66556008)(71200400001)(54906003)(53546011)(64756008)(66446008)(2906002)(33656002)(26005)(52536014)(478600001)(38100700002)(5660300002)(76116006)(83380400001)(66476007)(8676002)(86362001)(9686003)(55016002)(4326008)(66946007)(186003)(110136005)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?APk0eAKIstZacvbjCN8eLQA5GZiCREhGuuWE6ZypPaFBdc4sNFF2Makr9j98?= =?us-ascii?Q?Fp4zonH/G2dBeRm+45aHE8xohafPZ9GHuWzU1NhLymSGp7zoGy5boI0z1b4j?= =?us-ascii?Q?lXfO999WCr/QzTbMN5mBdS3DDx9KngqNZInWOe3OQwJUttjHvClPBqEHHBDr?= =?us-ascii?Q?U4IMYNw6qwtTvd61sJqOiDWYOhWNsSUavl6c/+wVr1McsBkdgHDKlpuvphgJ?= =?us-ascii?Q?t3AMdGQHJiU3+Ef1t219BPCOKzviX0/BaYkprjNrxjVslgOKcqBWScIke7JG?= =?us-ascii?Q?lZ9D4xGg3afhN+Sqid/ApYevQcWauWXpsr0PKopDoke/wV7SJcSKN7ov6nYB?= =?us-ascii?Q?UhuauF3GLSD+Lvs3MGHtUno73Lmt4qlY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dw/KAZofqUeMkFWVGoEhclsbRpvRymb4gVGucgcA2Tt3Zsvws56OTiy6fc?= =?us-ascii?Q?SLc=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f79e0a44-9ddb-47bd-34c4-08d8fd85dfef X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2021 07:37:50.0819 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Mm532hToHLDN/ierQ5ediJdoxqsIjVmhLZC14ZBHnsU2Yfu3yQCpP1s7Z8g7IEtBUnsNCUrA6YsBUaQ+taa6ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1402 Subject: Re: [dpdk-dev] [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump feature X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Haifei Luo > Sent: Wednesday, April 7, 2021 9:09 > To: dev@dpdk.org > Cc: Ori Kam ; Slava Ovsiienko ; > Raslan Darawsheh ; Xueming(Steven) Li > ; Haifei Luo ; Matan Azrad > ; Shahaf Shuler > Subject: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump > feature >=20 > Modify API mlx5_flow_dev_dump to support the feature. > Modify mlx5_socket since one extra arg flow_ptr is added. >=20 > Signed-off-by: Haifei Luo Sorry, this patch is errorneously acked instead of the=20 "common/mlx5: add mlx5 APIs for single flow dump feature" I have comment for this one. > +#ifndef _GNU_SOURCE > +#define _GNU_SOURCE > +#endif > + > #include > #include > #include > @@ -29,11 +33,15 @@ > { > int conn_sock; > int ret; > + int j; > struct cmsghdr *cmsg =3D NULL; > - int data; > + #define LENGTH 9 > + /* The first byte for port_id and the rest for flowptr. */ > + int data[LENGTH]; So, we define 36/72 bytes array? And then use each int as byte to save flow= _idx value? I suppose the correct way would be to define the structure of message in st= ead of using ints array, something likle this: struct mlx5_ipc_msg { int status; void* flow_idx; } > + /* The first byte in data for port_id and the following 8 for flowptr *= / > + for (j =3D 1; j < LENGTH; j++) > + flow_ptr =3D (flow_ptr << 8) + data[j]; If structure is define, there should be: flow_ptr =3D msg->flow_idx > + if (flow_ptr =3D=3D 0) > + ret =3D mlx5_flow_dev_dump(dev, NULL, file, NULL); > + else > + ret =3D mlx5_flow_dev_dump(dev, > + (struct rte_flow *)((uintptr_t)flow_ptr), file, &err); > + > + /*dump one*/ > + uint32_t handle_idx; > + int ret; > + struct mlx5_flow_handle *dh; > + struct rte_flow *flow =3D mlx5_ipool_get(priv->sh->ipool > + [MLX5_IPOOL_RTE_FLOW], (uintptr_t)(void *)flow_idx); > + Please, move variable declarations to the routine beginning, to others With best regards, Slava