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 4D895A0524; Tue, 13 Apr 2021 09:39:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBF33160BE1; Tue, 13 Apr 2021 09:39:57 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by mails.dpdk.org (Postfix) with ESMTP id 8476E160BDF for ; Tue, 13 Apr 2021 09:39:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z050EZwEV3ZX74vk72oOr+WSRPD+WCGxAGlzxHOdAzUgjzU0kTPw/lYJhNIc0r0/GugoRGy+v3nnR9CkiF4kQfz2xLG7SF/mbvbasv/B+PAEIFGWfQEMTLhmGkkOsKTlXsYUyvUrQ35OaWxkbh7+dvoPi+DesiE+QSynXVnJFMVYeQYhzjHnuCuBxzOmkf/2HwZ78tFFx+5ThA/a5LDIZWKG/aTkikM0gx/DUgqRRJZCR6IS8s0YJlJqVNgfzg2nifTlgm28UuQMxzm1yieomlECbSLjvWOcf65V4UPD206k7KfMPmFU1fIusErmPgnY+Fb+eu8TzkWVW5mxUpcvCA== 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=vuDrneegJxDIGIRhfMo2jFmd2u6ChPORcOxRUpEX9gM=; b=aH6qzoQ1CNEKFEch2JocfqERsKyo7jMmVQZi/GQSRXoiC4sjFay8aJ2oEyMgRuQMZ7181SclFH1sGeeg0y+2RPjl7MaaqAnym0HVIwC2r1IIrD3h0b5wApA25G9U04kFgfWJX5R9Xx/x3Q2BIxpp3nngdJtrRNlQifiSzr31uOaxCPSmzn0wOca7BztYdzbJ0DOaV7CGasT+vJdEkDJQV5xDggM0WWvmysRv2tPutnuTJv48Nf1RTCCz96BObDdozdxSzZrFU0y/pSvBF0/8k/dwnqHx1NnrGBuX/+zsbe9prkPBMl9TWXb88Rg/cMbfMtBA31Sl09do/xQBbebhyA== 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=vuDrneegJxDIGIRhfMo2jFmd2u6ChPORcOxRUpEX9gM=; b=O0xwwtXTdL1aj9FxkIRnpVpsT9SZT1yQs38SbFYtBY07Hozj0hNM76bGfZTxcFqeExFwceXBlv8430AhBW04rOLefHS4kxmNSl2Bl75K+pslUX4x9sRqUuKg5oWF1TrWGSsRft/xKZv24RbNjvImYHZVcC+xBiHH7bH0XMQ1eDvD/PeLzTwvCEIVUxzjf0ZSwW2b3p2P7ZdnKn4w3iP/ubrG1V0om4Gydk9tQTnZtjGHhAazVWHD46b2mUCADEGNc5oxR/sIT3qX64RRapLkgQaZH4y63w7GbKrXTPBd86tNVfsLjZ5yUFGYoGFRJ/ioQhQil1GkFZCF1xzNhCS38w== Received: from DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM6PR12MB2713.namprd12.prod.outlook.com (2603:10b6:5:4c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.22; Tue, 13 Apr 2021 07:39:55 +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; Tue, 13 Apr 2021 07:39:55 +0000 From: Slava Ovsiienko To: Haifei Luo , "dev@dpdk.org" CC: Ori Kam , Raslan Darawsheh , "Xueming(Steven) Li" , Matan Azrad , Shahaf Shuler Thread-Topic: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump feature Thread-Index: AQHXK3SXkIOw8d1hkkGReblxGt+ykqqwhUPAgAEsoYCAAGKyAIAAAnNg Date: Tue, 13 Apr 2021 07:39:54 +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: 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: 5a931c51-289a-4277-2ba8-08d8fe4f54c5 x-ms-traffictypediagnostic: DM6PR12MB2713: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8Ku8u3Vo2lu8HPxQFdErk2KWYsH20aqJPFlASrNdgOgXt4XeKJhUTmX2oppBkxZOEVW1MnSAAdeVLZGB9ldrhG8uUwXgHldXX+XDyH40j4UU2ExgsiZxobBTq/yvF6j6DLWXkkODpS0sYZ5X/ejROXx65zmGqrmXz9M980Bp4kXuHOvI/I+xeERuDikkay3zHVmwUjKT/H93aHhSdm6Vnt8SFlQ16SPrfxOx/nf2lyQlsOEXBzYrBFlx69tzh5dLm8MNNExhyD73JEjm88/9U+3+6wWhY2XKMbDHiCEmvAN7s7BBsv4hqaslByFTwVzDIuC2DCLv+D6s2U+344T9JmHipVYhZRLTRrtx9jhAGsvJt0tsBytAQD5ATZK32zrR3TBp7hwQ678JUlLDWMBgHonOT8oJb8s9uXJyLhGcuC8vuH75EIDSruf91hWUhFjBv0aNiBrjjjF+aF+akgvAZhlMy1+BO69amiKoCU9bNc+kvO5ILs5DeNTWEkTEePy+SFIfW8lO+BbueSxQV8ckU91kMMucXYsLLSi2MLzkXNeF5euursHnerVk3kH8SZ851ZR2eNxtqdInf3llur/X0JpB2Bnx+1m+aknuajwxBTE= 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)(136003)(346002)(366004)(376002)(396003)(39860400002)(52536014)(5660300002)(9686003)(66446008)(66946007)(26005)(86362001)(38100700002)(64756008)(54906003)(7696005)(83380400001)(316002)(66476007)(66556008)(8936002)(55016002)(4326008)(186003)(71200400001)(33656002)(2906002)(478600001)(76116006)(107886003)(110136005)(8676002)(53546011)(6506007)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Jr6qkRohOOGJy7HAxqA2UsJjHEXfa4B7mYdxwPheQC4QMKEgNtUyw8IudW2h?= =?us-ascii?Q?cAtx/jZdSh71nGDkm0VmVtSX+j6t9eg16VsLmm+mgyYlgf9ld07zaRc1O/Jx?= =?us-ascii?Q?Xox0/CplwbTLvPBVlPu1yLcAw6lInoZ6HkOyenp6974sTZhQBlVF9mAo1ISu?= =?us-ascii?Q?8hVoKAPaCUoCPbU9xHNI2Q4iWG16Y8zzcrK5qE0reixYh6Ykh0IypG35DXid?= =?us-ascii?Q?Ru1QBwzIYHcIzcl5lBDsjAZw5xYBA3X8MCPjK39LFssqJhHhHOXwVI7jCdU3?= =?us-ascii?Q?i5/R59RZWXbqYOIFhh5XbjRG7LjUWIo4ETiyEiYfFBzAqi4D48/T2ZVIHDEQ?= =?us-ascii?Q?BN2Lsbi07B1BpJQ12fZEl+zqoVgYnWBasIivG/jilB9WrdmNkieEwcR4nyVa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5JBgKOitPhBvplrIwxmWaGgJRu53EY?= =?us-ascii?Q?l/o=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: 5a931c51-289a-4277-2ba8-08d8fe4f54c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 07:39:54.8446 (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: b8ev3NiFeZHO4O5wLEI/giJT0kGsLTlr2aN8hi6N87dASqz0yY8GR0dw7OjdDA0q7swpNv/FUJdErHI94QgpHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2713 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: Tuesday, April 13, 2021 9:29 AM > To: Slava Ovsiienko ; dev@dpdk.org > Cc: Ori Kam ; Raslan Darawsheh ; > Xueming(Steven) Li ; Matan Azrad > ; Shahaf Shuler > Subject: RE: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump > feature >=20 > Hi Slava, > For #1, The steering tool send messages to DPDK to request dump. > Server/Client use data structure "struct msghdr" > to communicate. It has " msg_iov " ," msg_iovlen" and etc. > In the tool side, Msg_iov is constructed as 1 byte for port_id, 8 = bytes for > flowptr. In DPDK, then we parse the message this way. Yes, it is clear. In my opinion we should not use byte array and parse we should present the some structure instead: struct mlx5_flow_dump_req { uint8_t port_id; void *flow_id; } __rte_packed; BTW, why port_id is 1 byte? port_id in DPDK is 16-bit value. If the request dump tool uses somr structure - it should be defined in some common file. IMO, it is not a good practice to rely on raw byte array layou= t. With best regards, Slava > For #2, I will move them to the beginning. >=20 > -----Original Message----- > From: Slava Ovsiienko > Sent: Monday, April 12, 2021 3:38 PM > To: Haifei Luo ; dev@dpdk.org > Cc: Ori Kam ; Raslan Darawsheh ; > Xueming(Steven) Li ; Haifei Luo > ; Matan Azrad ; Shahaf Shuler > > Subject: RE: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump > feature >=20 > > -----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 > > > > Modify API mlx5_flow_dev_dump to support the feature. > > Modify mlx5_socket since one extra arg flow_ptr is added. > > > > Signed-off-by: Haifei Luo >=20 > Sorry, this patch is errorneously acked instead of the > "common/mlx5: add mlx5 APIs for single flow dump feature" >=20 > I have comment for this one. >=20 > > +#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]; >=20 > 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 > stead of using ints array, something likle this: >=20 > struct mlx5_ipc_msg { > int status; > void* flow_idx; > } >=20 > > + /* 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 >=20 > > + 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); > > + >=20 > > + /*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 >=20 > With best regards, Slava