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 80D6DA0524; Tue, 13 Apr 2021 09:22:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63A48160BA8; Tue, 13 Apr 2021 09:22:29 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2048.outbound.protection.outlook.com [40.107.244.48]) by mails.dpdk.org (Postfix) with ESMTP id C0F75160BA2 for ; Tue, 13 Apr 2021 09:22:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kF2bDjg2Zt4vG51fRq6yHuNBmj6goRY++j2zyBDMWd8Jgt7dJ5cnriI2xQWwnNWgrGexlaDSe2j2p2+NTN3nUIB/HBlmKmQWz3rbZKTSCPn8dKSO8HUuqWYq0/gsUNVNJoKUWC9XfDvbkCGhew6fnqGwEnu0jErwh9UzcJQnGZVtWBXzUgPjyUUmdTTQeAF7gjPIV9VltfVBWWtkOE2MSXUgq9z/dQeDZwulaEmMmICP8m3c+vu9hUkzd1j7sqe10ocoOh7j8yN7XTwkr8WJqA3gQqeQOykCLwHLjTpuxOZ96cCyWQ7CuUfd28FIrfKDB4nbrYQurptsa/KywR9hKw== 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=zoZ3glI3i4O8Yr3txPpEnsLNb7XcN/YH+9cbRnOVzO8=; b=ZDJt2N/k2RPPvrZc2QEOGo91dPDzCkowIhOomUrPBbffFytfdqBqdDzty8Ux1ERaBbfJtuPxJOdT5Q/USDsCJDZPZO8UJLG8/7sFihYqGbwJlUyH0FFO32JPDYGKwLXymFrKFMIhiQqgqOR5YJ5unRADWxaEOqddC7kxg4jLoYnhR8kTfpSbhgqiFEm8DR1JS8UBwDGha/oATe1FTReHD9SsNgkoexUiJkoF6Q/KLa/YIv9Lto5CGXydXl8qApqmXeL7ir25rxbIe/s5OAUonKfeviWPAwz7QvvFwcT14kKaF9GMyBfCc8cUumWKSCwJ0nyFSAP8xLfKjapChldISA== 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=zoZ3glI3i4O8Yr3txPpEnsLNb7XcN/YH+9cbRnOVzO8=; b=S4FXQ3Yud8vn19sQ/JmJK1oiTkitx8c49CPykziW9NmYX2/OhZufG1qPrOz4EFfj70FEaJJijA/0EA11JZ+B/GNFoZQEuv3rr82XfA6/xVMcJGAksmHQvg0KD03MhMySX5xWQ6WnM6yjuj03Rf6nH2fMlXCVPPE1GX/lGDIY9IVjhQtWGEB9SkKqVeP46LFzc1OUfcCx9HRUYzkEpuBDM2jWHe4ZqLr120fvUrpPidzbs66cPM665KhGqs59r5E5s1nvYN+E2GrD9Hm+UTIONlaOfNVUzAoVYme5avpAn75JcvxlnzWPlns+Xf7YFDGOHRzVDERTcZ3IaO66FTRd0Q== Received: from MW2PR12MB4667.namprd12.prod.outlook.com (2603:10b6:302:12::28) by MW3PR12MB4411.namprd12.prod.outlook.com (2603:10b6:303:5e::24) 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:22:25 +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 07:22:25 +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: AQHXK3SXvol87KYeq0qP2Tn1RLkO5qqwhpEAgAEmPdCAAGXvMA== Date: Tue, 13 Apr 2021 07:22:24 +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: f30484f5-56a1-47e6-faaa-08d8fe4ce2f9 x-ms-traffictypediagnostic: MW3PR12MB4411: 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: 9Xg+o8W3e2Tb44XOwIDYQQUAHz9LXCMscBazR9BbRS9CR5BfmPH6apN92taubm5Y6nMn56nabIssXfLTGD3MpqDv1mDKPfzGZV2uuR31szrAyCFX1lZq9pZvJ18zIyyBRAk/Iv397rtRoorz6wwa23Juzv3AZXNHaRQU8HsLeMlPL6CWNgwgetoa3bkCYynmya++m07SScf8k3FrcvJ00joVknIPUNjKIF8m8Xg/pMu/KjZuT4nALjf3qkPOdk+McLItl/4Pkkh+oWXyLM3V1kZiU43/7z+bBGNIfYYNPT7cZAHYlx6nRW/yZtsNuEd5o8Z48ASAUblMolkuzVIg83xPMq+xQPuJqWUyhU76hfNyqvdE+rGOZ8yqtTFa2kjloCD1MlyrKmVDczHHU403VUwdnleyVss5JBfwfIaTkHZ8Mdk5J+x7oOR0aGM8hpxgiufkPF/aKkUqfZ/dFb3WsMrBXOYfnI43ZFVCyxJIyaIE6GZj7K8b/TDV09J7c50a3wdTw7lc9xeZFDZV1mCLaOatXrXRsyiRLUV1tBfTyDIjLOYzRX6HR4fiJddcu/64qwC2eZZFs+aF4U5i7N3Y8gkfXptF/Hcz430e5dkyiCc= 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)(136003)(396003)(39860400002)(366004)(54906003)(316002)(110136005)(2906002)(122000001)(33656002)(8936002)(6506007)(7696005)(53546011)(86362001)(5660300002)(8676002)(186003)(478600001)(83380400001)(4326008)(52536014)(2940100002)(71200400001)(64756008)(9686003)(76116006)(66946007)(38100700002)(66476007)(66556008)(26005)(107886003)(66446008)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?1ar6wrMymzDEcmb76pCJBIm6FoiHYN0EVqXS+Le7D/YKxFS+mHgFHJCH0sr2?= =?us-ascii?Q?+dzun+C9HFrZlzJFpYOTUSwEyCl7iwaUoYplNgaT3qEhIDN7RdsoimHbFRxl?= =?us-ascii?Q?OvFRUlp1yoqVnPbZNBRnSZudhSmjvvELCLceMeezcoYpVJEwka+H7PZ+DH1g?= =?us-ascii?Q?D679qrZmWNjSjw7h+9gz0VLZ6O8DawDCf1vRj0S4ASyHraP7ZVBLFjPzshS0?= =?us-ascii?Q?uNpNSY34Fmo3KIKW/rZv1WgeaQniNA0C/nKtmrQYNuviRi7c3eYimmJeylt3?= =?us-ascii?Q?7TsuP1rIj99YGz3kN4N2q+jiaOGT6ylqLbuV7yxaXEdUFHFnsXUIeteHfb2F?= =?us-ascii?Q?piJqVSn63N3E+lXq0RDMNU6l7LoxII36OxjdF4bl8Msu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vHUmEi3I4HV+qW/bsO/6wao3JOETNi36rflXGvN3QNlqjiHi2AKvD?= =?us-ascii?Q?IJY=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: f30484f5-56a1-47e6-faaa-08d8fe4ce2f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 07:22:24.9559 (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: 6a70c4wGuvNdhtqV4s3FOyEF7po4T7EtRnLXjGsuX8o+KRIgZf+Hmq6HEugKa0Ct/Zj+LVXyReallazV098/Nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4411 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, Yes for "we define 36/72 bytes array?".=20 Correction for my last comment, not byte , and it is one "int" for = port_id , 8 "int" for flowptr. Sorry for the possible confusion. -----Original Message----- From: Haifei Luo=20 Sent: Tuesday, April 13, 2021 9:29 AM To: Slava Ovsiienko ; dev@dpdk.org Cc: Ori Kam ; Raslan Darawsheh ; Xuem= ing(Steven) Li ; Matan Azrad ; Shaha= f Shuler Subject: RE: [PATCH v2 4/5] net/mlx5: add mlx5 APIs for single flow dump fe= ature 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 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 ; > 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