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 11F0FA0567; Wed, 10 Mar 2021 08:05:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91F3A4068C; Wed, 10 Mar 2021 08:05:41 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2059.outbound.protection.outlook.com [40.107.95.59]) by mails.dpdk.org (Postfix) with ESMTP id 7BA5A40687 for ; Wed, 10 Mar 2021 08:05:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OJTphAcVEmCiZhK0j0+VUvlKe8skm2T+Y8nSo/PgrCWvsTHk4RdEwdefiC5U4C2FRObo4QcadcwyrDbncShjobInTi+YetdbwDAGwVvRYgP0+qXl2NSAnHYrqF6ZozhV2IgI/w0j1eENtrQIpHK1zimfBk1jLzjT1zXBAZDRql/OnB8SoQOjc+wkjbblAVPacR6vvTV9eXFPHFonrF8y8Xj+Tj6ZH8b+bwpsoix4MegX2PBjHU7KP7K50PsiMQjIcmJRQaLCWt65vrwE6Vr6kNZTMq9oV4J6Ir0L11zBzREhqt0wWSQZ6D2U2I83rUZCPDaS7cMRLXzQ1MQ5I5mm2Q== 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=KrRwbRmyxJpxN1lJaSWSYjSmWAHDv2xv9bs41LEcA1g=; b=h3gXTFH05rix9XJpNvS4UwUCfgNc5Bs0ojNwsgQSEpdYz1tQe2vHt9ykgkoO+tecqYTxBEmHsbomxGNFeH/Hde00XKmsm/wB3TLO9Xh8WL0ZqLdRBe9U/npxqyndUv+v40FLMrQj0LG0Bu1Ca36XDPxpsAOU1w7F4YQdYk2mAMNKCPDXmj9DP91srjew/KYrcknq+YqNgxml3nSMOfuFTKfZFbQ8tqYeryNlWkRUMvDJYNicVREoEF9cSAWi4W8ecI4V6vp8y2oQm5JeVz9XS2dMFjLs99Q76B3cfre10oDiiCx5+E99Xmd/7fCOT8Gja3C4RL/y+PnhKvGfFgNghg== 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=KrRwbRmyxJpxN1lJaSWSYjSmWAHDv2xv9bs41LEcA1g=; b=q1uQ95GB6HDUlr9UHU6/h4PoHOiee+uCf1TyflOB4RSR7cuqsF+nv5ekldMBbuPYn6UeMAEsGLN6YXhkQc7LQOtdd6obxpkONvs/iEhb/fokgXKfA8co7iCzvlIS2FktSyKWxa+nXJcrdwwrLvE0IGWJ/bISKGwmy+QvdSkaaa47W9plXIQSdZsacY2z0ykpgEwCH3Ev/i7BfSQ9aC0S+ObPHjPPmhOgFVb9MoV8ca3B63QvgcGmJBTQaJxRIl6N6ycCLzmBLBWgbirO2NKqQIAPFrczlncVdp1S+G7R5wjb3OA1eHM2JOhgTGsMU5FiqgjHz7J4yyZXIO0rxs0ZeA== Received: from DM6PR12MB4987.namprd12.prod.outlook.com (2603:10b6:5:163::31) by DM6PR12MB3961.namprd12.prod.outlook.com (2603:10b6:5:1cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Wed, 10 Mar 2021 07:05:37 +0000 Received: from DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308]) by DM6PR12MB4987.namprd12.prod.outlook.com ([fe80::f5ce:c5a8:6aec:e308%7]) with mapi id 15.20.3912.030; Wed, 10 Mar 2021 07:05:37 +0000 From: Ori Kam To: Haifei Luo , "ferruh.yigit@intel.com" , Slava Ovsiienko , Matan Azrad , "xiaoyun.li@intel.com" , NBU-Contact-Thomas Monjalon CC: "dev@dpdk.org" , Raslan Darawsheh , Ori Kam , "Xueming(Steven) Li" Thread-Topic: [PATCH 1/4] ethdev: add rte API for single flow dump Thread-Index: AQHXFLxvcHFRAeQNg0etRP2jVRRcrap8zLGQ Date: Wed, 10 Mar 2021 07:05:37 +0000 Message-ID: References: <1615277716-64404-1-git-send-email-haifeil@nvidia.com> <1615277716-64404-2-git-send-email-haifeil@nvidia.com> In-Reply-To: <1615277716-64404-2-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: [147.236.145.126] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f85c212-5284-41a6-dd00-08d8e392e848 x-ms-traffictypediagnostic: DM6PR12MB3961: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: qeAXoyVkERMyoga3QRcXeFdTm/puPnubKinGejHO5CUFN+K+XRRdvEzNzy5I7uI9/78Y7CvmgHUAH9PClfz4Yy2ycRDeeHcbIrCrUzvOHgw2mtzAnd2+dpNrGjNZH2h/fuvI/7dpk9Yr496EbzbEUtzh7b//opGmUpoZqMmMdrSaD3r/NVIzk4WtiYBv4rR+wkL/jIKidwsyjxZCUoFJdWLiPtA2ACrOapxKd5WMcxs76TfBrhDOraAoHh/nyWZ+1Zmh8nDQM/n/h1wJfEE1cdU3e57uLtMo0Y+Dqh+0b1Tnoh1qW3IfXPr0M3zxyFfoRS/XRIqZaoNewOI0BZslgqSt8773BMB/Um+ICOmh8KfC+C6Pv6f13s1N+dz2UwcTjRYVp0Zw3tyZ5yYaMgqKjwmGstZF5XetsrrAkCB86IDVnLhjmAZ3haXtS+h6mcbhKILv4FxTBizrprVemQhwsC5oindYXN9/c8V1p/OshnAOvNbQ8uoyKBt77jTCJYfFKwBVQfDqe7DwbLw/49PuCQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4987.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(136003)(366004)(346002)(376002)(39860400002)(6506007)(83380400001)(478600001)(316002)(86362001)(107886003)(7696005)(110136005)(54906003)(26005)(2906002)(5660300002)(55016002)(8936002)(71200400001)(33656002)(52536014)(4326008)(186003)(76116006)(66946007)(64756008)(66556008)(66476007)(9686003)(66446008)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?3qp7XWlQDqYsBggwEkK+sM9eatJwQ/VVUStQo5GwrODxfZ88uun7uxrRopyS?= =?us-ascii?Q?Eoeo83f/mJgQ3u2crdr+JgBWOHSAII4KAX7ksOlSILwqZmNntor/PqwDeTwm?= =?us-ascii?Q?CcZh0MjJuRXWQG+fl3WKFsA1zGesULK0aA0TC5TKyv7KMip7fr/Q4j+aQWce?= =?us-ascii?Q?sMC4SWAJsIZLVvC2VJZxaLygOSuA05s2KY2CRdUS2JRvo9RtRUjIwerQVxI6?= =?us-ascii?Q?2WqsaP1c1R0FOiqOXt8Qiufccki7pcgYiCPpK7EueOYQBPX5Uas941WjDFk+?= =?us-ascii?Q?rW+4FwRC6Xwia9hs0kYJgZjNeKxcAn1ynMRG6j+tjLh7Ml7mjm2vnZZX58u3?= =?us-ascii?Q?QpX8wFoH9kQJAM3eu4prT4xXKDN2yMhqxhJ5QoSDWWDdBIqmzjTfvltQFtaW?= =?us-ascii?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KFKftSQHtCG2ZSsqCH9Z4bHI?= =?us-ascii?Q?KPq6fv3NAQ6yxnjkDpLMmIdX?= 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: DM6PR12MB4987.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f85c212-5284-41a6-dd00-08d8e392e848 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2021 07:05:37.4345 (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: TOBegVc1l5/xbasxFe1AxWqIhs6pJ7cv74x+vhiC//G0cyAI9Xa4jxIpCDmTOAIwTJ2zR8tYS8qG5nlRucDrfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3961 Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add rte API for single flow dump 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 Haifei, PSB > -----Original Message----- > From: Haifei Luo > Subject: [PATCH 1/4] ethdev: add rte API for single flow dump >=20 > Previous implementations support dump all the flows.Add new ones > to dump one flow. > New API added: rte_flow_dump. >=20 > Signed-off-by: Haifei Luo > --- > doc/guides/nics/mlx5.rst | 10 +++++++-- > doc/guides/prog_guide/rte_flow.rst | 44 > +++++++++++++++++++++++++++++++++++++ > lib/librte_ethdev/rte_flow.c | 21 ++++++++++++++++++ > lib/librte_ethdev/rte_flow.h | 24 ++++++++++++++++++++ > lib/librte_ethdev/rte_flow_driver.h | 6 +++++ > lib/librte_ethdev/version.map | 1 + > 6 files changed, 104 insertions(+), 2 deletions(-) >=20 > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index 7c50497..b8b6b02 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -1778,13 +1778,19 @@ all flows with assistance of external tools. >=20 > .. code-block:: console >=20 > - testpmd> flow dump > + To dump all flows: > + testpmd> flow dump all > + and dump one flow: > + testpmd> flow dump rule >=20 > - call rte_flow_dev_dump api: >=20 > .. code-block:: console >=20 > + To dump all flows: > rte_flow_dev_dump(port, file, NULL); > + and dump one flow: > + rte_flow_dump(port, flow, file, NULL); >=20 > #. Dump human-readable flows from raw file: >=20 > @@ -1792,4 +1798,4 @@ all flows with assistance of external tools. >=20 > .. code-block:: console >=20 > - mlx_steering_dump.py -f > + mlx_steering_dump.py -f -flowptr > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 62a5791..17e4351 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -3023,6 +3023,50 @@ Return values: >=20 > - 0 on success, a negative errno value otherwise and ``rte_errno`` is se= t. >=20 > +Dump > +~~~~~ > + > +Dump information for all or one flows. > + > +This Function rte_flow_dev_dump will dump the information for all the fl= ows. > + > +.. code-block:: c > + > + int > + rte_flow_dev_dump(uint16_t port_id, FILE *file, > + struct rte_flow_error *error); > + > +Arguments: > + > +- ``port_id``: port identifier of Ethernet device. > +- ``file``: a pointer to a file for output > +- ``error``: perform verbose error reporting if not NULL. PMDs initializ= e > + this structure in case of error only. > + > +Return values: > + > +- 0 on success, a negative errno value otherwise and ``rte_errno`` is se= t. > + > +This Function rte_flow_dump will dump the information for one flow. > + > +.. code-block:: c > + > + int > + rte_flow_dump(uint16_t port_id, struct rte_flow *flow, FILE *file, > + struct rte_flow_error *error); > + > +Arguments: > + > +- ``port_id``: port identifier of Ethernet device. > +- ``file``: a pointer to a file for output > +- ``flow``: flow rule handle to dump. > +- ``error``: perform verbose error reporting if not NULL. PMDs initializ= e > + this structure in case of error only. > + > +Return values: > + > +- 0 on success, a negative errno value otherwise and ``rte_errno`` is se= t. > + > Query > ~~~~~ >=20 > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 241af6c..ff051e7 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -1044,6 +1044,27 @@ enum rte_flow_conv_item_spec_type { > } >=20 > int > +rte_flow_dump(uint16_t port_id, struct rte_flow *flow, > + FILE *file, struct rte_flow_error *error) Why not update the current dump function to support dumping one flow? Best, Ori