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 A714AA0524; Tue, 13 Apr 2021 03:29:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23376160971; Tue, 13 Apr 2021 03:29:13 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2078.outbound.protection.outlook.com [40.107.223.78]) by mails.dpdk.org (Postfix) with ESMTP id D640D160968 for ; Tue, 13 Apr 2021 03:29:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edOTDc1i4Fomyv+PJFwM9XqHsurQEbSRwf9pYZnX7Q48tayJZ2exTa3elHLuUDgRR+fM8EhJweIJH61JoP3Zp94gTO3v9145hB4twANwsDmpk4GspohzLH5VxY+aTVLq+z1vJflL1AdWHG8uHo5qieOdCju7XP8qGanPtJKqVmKSTM+ACXwQxK1Cc3ghcfIAxEZNfitIHga0gC+o5eJe97y3Rz/G7GW88IDIeGq/lGCzpGzae3gVXdxTsgwn1Vefp1Bzr+z2ecHnYWpQTKff0Gww0wDxkfS3Zwyebu3JZ7QcL/ukQ1X8Soug5Df3tVUMrzOeyIVfatJ2YTwcI0gjAw== 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=0A/qhFrh1+u8EJs+othuMe+0eArAAoy5yY9AyBsAxi8=; b=ij4d2zqeKbY6qnjH8JWl37GvXoz9yjPBEE/fDG3g10hCsHQF+2Aqu5DnYMt+uQwpwp1EKZ5Mj33k8kMuatDewpgx8XFgRI8Kd2d3ZglGkIX39If4hw0VkE/K4ejRAaNX4hDY/Y32LIGltGJTKbdQ5papVw7mShwBnJxvsiLkvjJHy8wUa66Lsy+qv4HywVg1fNAZXhQzE/S/EH+kx6bqHSMdRfRQVxnhbObwrfVdkjB6eBnATJGdu3ZqAHzfBdkDZcZYuPMskiFCE2EtYEthdzH2ja54U9v1uGzNtSf/UqueTgnPhOnWazVwV579lFt3YZacUsa+uH2HMTdC2/Pq8A== 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=0A/qhFrh1+u8EJs+othuMe+0eArAAoy5yY9AyBsAxi8=; b=l2HU96pgvWAX1YVSuFqgHXBDEaMtR8Vw7+weV25iihHeIeKfK63RIlVHxzjTPdwyBR7J1sh/xN5WBmb0zyvuE9a9+KiRkbBcHjI36JdZQpqrZIuBLZAMzHRGjSU/wZs96PuxalQMQKwoKhGSWxEaBOGfEY7hIaeFK9OGUKkOHWsKSkRqXYiFgpxDbpZV/6Zdh0Q9Uv8JG7Um0ZxXcXPRcOZoo1YE7bSTiGKbHtXlXQUltA/7OrKiGGS5SYUf3I8lCjd8uTFLymdmXkgdaa3vLiL68sa7k9hoCHb+Bfr84R02N138UxvSymzGll0TwWjkLFmyFbyC9I8N2LNXGBYD3g== Received: from MW2PR12MB4667.namprd12.prod.outlook.com (2603:10b6:302:12::28) by MW3PR12MB4361.namprd12.prod.outlook.com (2603:10b6:303:5a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Tue, 13 Apr 2021 01:29:10 +0000 Received: from MW2PR12MB4667.namprd12.prod.outlook.com ([fe80::6c71:eb7f:ad9d:335b]) by MW2PR12MB4667.namprd12.prod.outlook.com ([fe80::6c71:eb7f:ad9d:335b%6]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 01:29:10 +0000 From: Haifei Luo To: Slava Ovsiienko , "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: AQHXK3SXvol87KYeq0qP2Tn1RLkO5qqwhpEAgAEmPdA= Date: Tue, 13 Apr 2021 01:29:09 +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: [112.65.62.40] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5656c460-3996-4a7c-6cd6-08d8fe1b89ca x-ms-traffictypediagnostic: MW3PR12MB4361: 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: rRwjC8dyDChNVUCsafjQEaJmtp7YAHUXXHx4+W7uXfsd1XXH4FVgkYLuVvV0Z4WCDPz3uNmNkzQbKxaCIUaJyYIA4fQ1InaWPD6El+Q9UbcLVgALx4+eJakTIzcQJ677DaErDFqEaWQ9qXU2fd7ttJbPgUZOj0bh3aT12jRmcwi6XFbOU7I0hi6q4eXVDMZPqiwObSIBA9XOFWCUJIHPpZYh77GqLOf74JnXoodM5VS65f7RQFm5HjO6fzNEDE/KIriecAJDzcwhlZ16XhqfKI75lXFzs3Bf23jCuYrFSESAyUIPAxpwTQ9Q4I075qrFYT5ASHq0zXTfNFwx4Go+lm6+CHs+BMkoT60AsoDvzD49o2CrexCUCs8+6460b26oxV1+G86Djd/nxHEaRI9er4kpU/TNBJSRWRph+1sN7o4Wg89WaJ/rUE6xAI6aDDydp0oJ8MeroFDRix57cu6g69KjOXuwIazU4nTMZQBXbs0hcwrNV0rFqdAGpM7PzWQ64zl5A08gy3G9E0+kiCc4ekbTTpXD2E/egBfeMkXy0t8Hp1SvHbyM+HCRGy2mzEM8asvUunWUaXl+8ExW3JFm1Y4sJJI5IBzKccOGgeDljWk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB4667.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(396003)(39860400002)(366004)(136003)(76116006)(64756008)(478600001)(8936002)(66446008)(2906002)(316002)(53546011)(52536014)(6506007)(26005)(38100700002)(122000001)(71200400001)(9686003)(83380400001)(7696005)(8676002)(86362001)(107886003)(186003)(4326008)(110136005)(55016002)(5660300002)(66556008)(66946007)(66476007)(33656002)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?HveWl6cu/PNWc75RnVYb8jLl3tnDb+Pbt47kuqWGTHHo5PAltKGIyF2GXRjb?= =?us-ascii?Q?//zshyPjnNejv10QStmAu+HYdrP/ZNZji5XtX5beHPLoYUMI7/qe78VhQe5s?= =?us-ascii?Q?rftKgDJ42NTrnIYiS+7QfuIwENFjGZtZlElfhm73fLZeqTbbARjfN1pnEaH7?= =?us-ascii?Q?hAjB1/yu7gPJCpcsXPOQ/w22Ld4hsoq0WbBkFx968cnIzpgvQouyZZbwG4ft?= =?us-ascii?Q?uTIMxabruIXW9Qwai3sAwUgauh2QPtBpj3eRefxQdYpYGE4QeQVG3oyeGzDH?= =?us-ascii?Q?GwYioADBv4AIYFd9H5+L0B2uBqY63aGUZgISDlxe9WZ127gLTX1hlhhyd9CU?= =?us-ascii?Q?MRAI+kh9pYK/jMUzigq2cKCh06tkxF0usr1x+OYAlAzO1auA0S/JmDDPjurY?= =?us-ascii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NVC7jszcKVyhYWwQxIo?= =?us-ascii?Q?6oU=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: MW2PR12MB4667.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5656c460-3996-4a7c-6cd6-08d8fe1b89ca X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 01:29:09.9763 (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: qtQj2XTs7No+PSbjfWbwt8ZCoduX8sDrnfbxbALpSV/egy33mytrWFienhtuZyuM2TOYzmhD6IDItCkfWimTWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4361 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" Hi Slava, For #1, The steering tool send messages to DPDK to request dump. Serv= er/Client use data structure "struct msghdr" to communicate. It has " msg_iov " ," msg_iovlen" and etc.=20 In the tool side, Msg_iov is constructed as 1 byte for port_id, 8 by= tes for flowptr. In DPDK, then we parse the message this way. =20 For #2, I will move them to the beginning. -----Original Message----- From: Slava Ovsiienko =20 Sent: Monday, April 12, 2021 3:38 PM To: Haifei Luo ; dev@dpdk.org Cc: Ori Kam ; Raslan Darawsheh ; Xuem= ing(Steven) Li ; Haifei Luo ; Mata= n Azrad ; Shahaf Shuler Subject: RE: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump fe= ature > -----Original Message----- > From: Haifei Luo > Sent: Wednesday, April 7, 2021 9:09 > To: dev@dpdk.org > Cc: Ori Kam ; Slava Ovsiienko=20 > ; Raslan Darawsheh ;=20 > Xueming(Steven) Li ; Haifei Luo=20 > ; Matan Azrad ; Shahaf Shuler=20 > > Subject: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump=20 > 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 "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