From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60051.outbound.protection.outlook.com [40.107.6.51]) by dpdk.org (Postfix) with ESMTP id C768C2BE6 for ; Tue, 11 Dec 2018 08:24:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JQd53TLmjX1u/j3TZtTD8RIrNiXt6lkmwuQsCe7JUX4=; b=azyUYeW7ql7WiHrLgydmRIpdlPlme7KpsMiXn/99GJOfROH9z9twvmJ3Q3W5TxhyheqZ6ZFZI6VbOFPUxECYhuJtV3eNawLT2jRpvjiREdO01XV2AwZKc31QzQ9VFXovz7MZW13ZkGxihcIRYpfKbN8OO7srEBcor7++6DOl/5g= Received: from DB7PR05MB4187.eurprd05.prod.outlook.com (52.134.107.156) by DB7PR05MB5432.eurprd05.prod.outlook.com (20.177.123.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.20; Tue, 11 Dec 2018 07:24:40 +0000 Received: from DB7PR05MB4187.eurprd05.prod.outlook.com ([fe80::986a:870a:d964:7788]) by DB7PR05MB4187.eurprd05.prod.outlook.com ([fe80::986a:870a:d964:7788%3]) with mapi id 15.20.1404.026; Tue, 11 Dec 2018 07:24:39 +0000 From: Asaf Penso To: Stephen Hemminger CC: Adrien Mazarguil , "dev@dpdk.org" , Shahaf Shuler , Ori Kam , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] ethdev: add function to print a flow Thread-Index: AQHUhy6uk2CN7DZIq0ujCLWKDIF8yaVyS1AAgAbrAXA= Date: Tue, 11 Dec 2018 07:24:39 +0000 Message-ID: References: <1543418758-23748-1-git-send-email-asafp@mellanox.com> <20181206134418.475b8d06@xeon-e3> In-Reply-To: <20181206134418.475b8d06@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=asafp@mellanox.com; x-originating-ip: [176.12.152.144] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5432; 6:5YqZ/nE4Ma5ci0d3+hGDxIBU5sjsBJwcXX39llOKkBS/PzPMTAXuMaHHbGrBm/0WSwubJFYd+t6Dh1luHOcRn4JgTgmjlnwTx1gj7HSr+xWQxrnQL8hp/RhXeS4o2Rzw1ObKJ7pdAVdSPTvuJn/nRvPJ6nXOJnS+fhFdX7EAnWScjGoVGnONadmeG/tPW0thd+0QadKKQ12LOI/KMN7F+mWPLvAhBO9Glmfsy0nM+sMVvqpS1VzJ+ZuSgXXTdQ2zW5LiRUplY5OczWcqgfQqwbxaO1y78qIQauRqd9CvHspv5bU/d7+H+73az0SjWrYZs1Qx8wxPPiUk4OTF8C8JuAHLPH46Rn0Iu05H20wSbe4TaRuyiRfJOmpGWOqRkQJZnmYdr8iUIEnCBIsdKYQ0KXn90/YXLmHjF6MrZWnpKZnN6hErPBBXsz1n1Nm6sp/i5ZXZz5Vo9NriPwA0xyDgLw==; 5:aNlILBf5lmyB7Boew98pvSZOW0dmiqsoFE2gKq2DcPSVWVT2Gk1cLn0lvv1PgEkF5CsjyDt87D8asSREzDMtikLx43HUR06xHbpAbR8Yo3/V6UaTTaKToXYu4hC7Gfm4gTmMRcMtAmzG/Gc+Atu8yAQ1lYUx+CDS/FFu34hgq28=; 7:yJnB078Te481m8D73oVO0yAf5VDHIlbwIMUSq8i3ABlguUudQJBrS84RT0rZYkzztIiz9HESewzGRBYNt8uURs+cSYC0Y3esTuyBgd+MybUhC2MhZ+RwrdBd+Dip4Ad+BLE7wdBGBa9wFb+RoIyG7Q== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 5a5937b9-4e2f-4a8d-4f4c-08d65f39b67b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5432; x-ms-traffictypediagnostic: DB7PR05MB5432: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231455)(999002)(944501520)(52105112)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB5432; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5432; x-forefront-prvs: 08831F51DC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(376002)(136003)(366004)(199004)(189003)(13464003)(9686003)(71200400001)(54906003)(55016002)(97736004)(5660300001)(71190400001)(4744004)(66066001)(105586002)(106356001)(6506007)(102836004)(478600001)(446003)(99286004)(6916009)(2906002)(186003)(53546011)(14454004)(26005)(486006)(8676002)(6246003)(7736002)(6436002)(7696005)(53936002)(305945005)(476003)(316002)(11346002)(76176011)(33656002)(25786009)(74316002)(256004)(81156014)(81166006)(14444005)(68736007)(575784001)(86362001)(6116002)(4326008)(8936002)(3846002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5432; H:DB7PR05MB4187.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: elYRFwXwMr9hV6PqLQVRkpczj20yME8HKJSFdXzhSQts+z1OmABZot4pVT1svSL8mE78+SVXL0D6SHadYyayc91llztrvRv2ubmNuh5RZcbhmdTqYHFxZXeCGT+ap+ZtjIK/8s1VXNszflIU787jfPaByKz/2MEdOaqGl5vY576Dc5qZDGG4Znn8NcM2GRb3cBG1wRL2ZHc/sHLjwHnjTeAl5p4Hapcc7clusTJyT0lwmff9+M/YWRdvJDedjCpkuQPNpYHr3QHgG7tZsjYqIS6looer4rkYU7Tga0bPBfoWQOFGV5MW1AsBz27oGW38 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a5937b9-4e2f-4a8d-4f4c-08d65f39b67b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2018 07:24:39.7672 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5432 Subject: Re: [dpdk-dev] [PATCH] ethdev: add function to print a flow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 07:24:42 -0000 Regards, Asaf Penso > -----Original Message----- > From: Stephen Hemminger > Sent: Thursday, December 6, 2018 11:44 PM > To: Asaf Penso > Cc: Adrien Mazarguil ; dev@dpdk.org; > Shahaf Shuler ; Ori Kam ; > Thomas Monjalon > Subject: Re: [dpdk-dev] [PATCH] ethdev: add function to print a flow >=20 > On Wed, 28 Nov 2018 15:26:06 +0000 > Asaf Penso wrote: >=20 > > Flow contains the following information: port id, attributes, patterns > > and actions. > > The function rte_flow_print prints all above information. > > > > It can be used for debugging purposes to validate the behavior of > > different dpdk applications. > > > > Example: running testpmd with the following flow create: > > flow create 1 transfer ingress > > pattern eth src is 52:54:00:15:b1:b1 dst is 24:8A:07:8D:AE:C6 / end > > actions of_push_vlan ethertype 0x8100 / of_set_vlan_vid vlan_vid 0x888 > > / of_set_vlan_pcp vlan_pcp 7 / port_id id 0 / end Will result in this > > output: > > Print flow info > > port_id =3D1 > > group =3D0 > > priority =3D0 > > ingress =3D1 > > egress =3D0 > > transfer =3D1 > > group =3D0 > > reserved =3D0 > > pattern type =3D9 > > name=3DRTE_FLOW_ITEM_TYPE_ETH > > spec type=3D0x0, src=3D52:54:00:15:b1:b1, dst=3D24:8a:07:8d:ae:c6 > > mask type=3D0x0, src=3Dff:ff:ff:ff:ff:ff, dst=3Dff:ff:ff:ff:ff:ff act= ions > > type =3D23 name=3DRTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN > > ethertype=3D0x81 > > actions type =3D24 > > name=3DRTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID > > vlan_vid=3D0x8808 > > actions type =3D25 > > name=3DRTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP > > vlan_pcp=3D7 > > actions type =3D13 > > name=3DRTE_FLOW_ACTION_TYPE_PORT_ID > > id=3D0 > > reserved=3D0 > > > > Signed-off-by: Asaf Penso > > --- > > lib/librte_ethdev/rte_ethdev_version.map | 1 + > > lib/librte_ethdev/rte_flow.c | 226 > ++++++++++++++++++++++++++++++ > > lib/librte_ethdev/rte_flow.h | 31 ++++ > > 3 files changed, 258 insertions(+), 0 deletions(-) > > > > diff --git a/lib/librte_ethdev/rte_ethdev_version.map > > b/lib/librte_ethdev/rte_ethdev_version.map > > index 92ac3de..7676983 100644 > > --- a/lib/librte_ethdev/rte_ethdev_version.map > > +++ b/lib/librte_ethdev/rte_ethdev_version.map > > @@ -249,6 +249,7 @@ EXPERIMENTAL { > > rte_eth_switch_domain_free; > > rte_flow_conv; > > rte_flow_expand_rss; > > + rte_flow_print; > > rte_mtr_capabilities_get; > > rte_mtr_create; > > rte_mtr_destroy; > > diff --git a/lib/librte_ethdev/rte_flow.c > > b/lib/librte_ethdev/rte_flow.c index 3277be1..742d892 100644 > > --- a/lib/librte_ethdev/rte_flow.c > > +++ b/lib/librte_ethdev/rte_flow.c > > @@ -16,6 +16,8 @@ > > #include "rte_flow_driver.h" > > #include "rte_flow.h" > > > > +int rte_flow_logtype; > > + > > /** > > * Flow elements description tables. > > */ > > @@ -202,6 +204,222 @@ struct rte_flow_desc_data { > > NULL, rte_strerror(ENOSYS)); > > } > > > > +/* Example: > > + * > > + * struct eth_addr mac; > > + * [...] > > + * printf("The Ethernet address is "RTE_ETH_ADDR_FMT"\n", > > + * RTE_ETH_ADDR_ARGS(mac)); > > + * > > + */ > > +#define RTE_ETH_ADDR_FMT \ > > + > "%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"P > RIx8 > > +#define RTE_ETH_ADDR_ARGS(addr) > RTE_ETH_ADDR_BYTES_ARGS((addr).ea) > > +#define RTE_ETH_ADDR_BYTES_ARGS(bytes) \ > > + (bytes)[0], (bytes)[1], (bytes)[2], (bytes)[3], (bytes)[4], > > +(bytes)[5] > > + > > +/* Print the flow fields. */ > > +void __rte_experimental > > +rte_flow_print(uint16_t port_id, > > + const struct rte_flow_attr *attr, > > + const struct rte_flow_item pattern[], > > + const struct rte_flow_action actions[]) { > > + RTE_FLOW_LOG(INFO, "Print flow info\n"); > > + RTE_FLOW_LOG(INFO, "port_id =3D%u\n", port_id); > > + RTE_FLOW_LOG(INFO, "group =3D%u\n", attr->group); > > + RTE_FLOW_LOG(INFO, "priority =3D%u\n", attr->priority); > > + RTE_FLOW_LOG(INFO, "ingress =3D%u\n", attr->ingress); > > + RTE_FLOW_LOG(INFO, "egress =3D%u\n", attr->egress); > > + RTE_FLOW_LOG(INFO, "transfer =3D%u\n", attr->transfer); > > + RTE_FLOW_LOG(INFO, "group =3D%u\n", attr->group); > > + RTE_FLOW_LOG(INFO, "reserved =3D%u\n", attr->reserved); > > + > > + for (; pattern->type !=3D RTE_FLOW_ITEM_TYPE_END; pattern++) { > > + RTE_FLOW_LOG(INFO, "pattern type =3D%u\n", pattern- > >type); > > + switch (pattern->type) { > > + case RTE_FLOW_ITEM_TYPE_ETH: { > > + RTE_FLOW_LOG(INFO, " > name=3DRTE_FLOW_ITEM_TYPE_ETH\n"); > > + if (pattern->spec) { > > + const struct rte_flow_item_eth *spec =3D > > + pattern->spec; > > + RTE_FLOW_LOG(INFO, " spec type=3D0x%x, " > > + "src=3D"RTE_ETH_ADDR_FMT", > dst=3D"RTE_ETH_ADDR_FMT > > + "\n", > > + spec->type, > > + RTE_ETH_ADDR_BYTES_ARGS(spec- > >src.addr_bytes), > > + RTE_ETH_ADDR_BYTES_ARGS(spec- > >dst.addr_bytes)); > > + } > > + > > + if (pattern->mask) { > > + const struct rte_flow_item_eth *mask =3D > > + pattern->mask; > > + RTE_FLOW_LOG(INFO, " mask type=3D0x%x, " > > + "src=3D"RTE_ETH_ADDR_FMT", > dst=3D"RTE_ETH_ADDR_FMT > > + "\n", > > + mask->type, > > + RTE_ETH_ADDR_BYTES_ARGS(mask- > >src.addr_bytes), > > + RTE_ETH_ADDR_BYTES_ARGS(mask- > >dst.addr_bytes)); > > + } > > + break; > > + } > > + case RTE_FLOW_ITEM_TYPE_VLAN: { > > + RTE_FLOW_LOG(INFO, " > name=3DRTE_FLOW_ITEM_TYPE_VLAN\n"); > > + if (pattern->spec) { > > + const struct rte_flow_item_vlan *spec =3D > > + pattern->spec; > > + RTE_FLOW_LOG(INFO, " spec tci=3D0x%x\n", > > + spec->tci); > > + RTE_FLOW_LOG(INFO, " spec > inner_type=3D%u\n", > > + spec->inner_type); > > + } > > + if (pattern->mask) { > > + const struct rte_flow_item_vlan *mask =3D > > + pattern->mask; > > + RTE_FLOW_LOG(INFO, " mask tci=3D0x%x\n", > > + mask->tci); > > + RTE_FLOW_LOG(INFO, " mask > inner_type=3D%u\n", > > + mask->inner_type); > > + } > > + break; > > + } > > + case RTE_FLOW_ITEM_TYPE_IPV4: { > > + RTE_FLOW_LOG(INFO, " > name=3DRTE_FLOW_ITEM_TYPE_IPV4\n"); > > + if (pattern->spec) { > > + const struct rte_flow_item_ipv4 *spec =3D > > + pattern->spec; > > + RTE_FLOW_LOG(INFO, " spec > version_ihl=3D%u\n", > > + spec->hdr.version_ihl); > > + RTE_FLOW_LOG(INFO, " spec > type_of_service=3D%u\n", > > + spec->hdr.type_of_service); > > + RTE_FLOW_LOG(INFO, " spec > total_length=3D%u\n", > > + spec->hdr.total_length); > > + RTE_FLOW_LOG(INFO, " spec > packet_id=3D%u\n", > > + spec->hdr.packet_id); > > + RTE_FLOW_LOG(INFO, " spec > fragment_offset=3D%u\n", > > + spec->hdr.fragment_offset); > > + RTE_FLOW_LOG(INFO, " spec > time_to_live=3D%u\n", > > + spec->hdr.time_to_live); > > + RTE_FLOW_LOG(INFO, " spec > next_proto_id=3D%u\n", > > + spec->hdr.next_proto_id); > > + RTE_FLOW_LOG(INFO, " spec > hdr_checksum=3D0x%x\n", > > + spec->hdr.hdr_checksum); > > + RTE_FLOW_LOG(INFO, > > + " spec src_addr=3D%d.%d.%d.%d\n", > > + (spec->hdr.src_addr & 0x000000FF), > > + (spec->hdr.src_addr & 0x0000FF00) > >> 8, > > + (spec->hdr.src_addr & 0x00FF0000) > >> 16, > > + (spec->hdr.src_addr & 0xFF000000) > > + >> 24); > > + RTE_FLOW_LOG(INFO, > > + " spec dst_addr=3D%d.%d.%d.%d\n", > > + (spec->hdr.dst_addr & 0x000000FF), > > + (spec->hdr.dst_addr & 0x0000FF00) > >> 8, > > + (spec->hdr.dst_addr & 0x00FF0000) > >> 16, > > + (spec->hdr.dst_addr & 0xFF000000) > > + >> 24); > > + } > > + > > + if (pattern->mask) { > > + const struct rte_flow_item_ipv4 *mask =3D > > + pattern->mask; > > + RTE_FLOW_LOG(INFO, " mask > version_ihl=3D%u\n", > > + mask->hdr.version_ihl); > > + RTE_FLOW_LOG(INFO, " mask > type_of_service=3D%u\n", > > + mask->hdr.type_of_service); > > + RTE_FLOW_LOG(INFO, " mask > total_length=3D%u\n", > > + mask->hdr.total_length); > > + RTE_FLOW_LOG(INFO, " mask > packet_id=3D%u\n", > > + mask->hdr.packet_id); > > + RTE_FLOW_LOG(INFO, " mask > fragment_offset=3D%u\n", > > + mask->hdr.fragment_offset); > > + RTE_FLOW_LOG(INFO, " mask > time_to_live=3D%u\n", > > + mask->hdr.time_to_live); > > + RTE_FLOW_LOG(INFO, " mask > next_proto_id=3D%u\n", > > + mask->hdr.next_proto_id); > > + RTE_FLOW_LOG(INFO, " mask > hdr_checksum=3D0x%x\n", > > + mask->hdr.hdr_checksum); > > + RTE_FLOW_LOG(INFO, > > + " mask src_addr=3D%d.%d.%d.%d\n", > > + (mask->hdr.src_addr & 0x000000FF), > > + (mask->hdr.src_addr & 0x0000FF00) > >> 8, > > + (mask->hdr.src_addr & 0x00FF0000) > >> 16, > > + (mask->hdr.src_addr & 0xFF000000) > > + >> 24); > > + RTE_FLOW_LOG(INFO, > > + " mask dst_addr=3D%d.%d.%d.%d\n", > > + (mask->hdr.dst_addr & 0x000000FF), > > + (mask->hdr.dst_addr & 0x0000FF00) > >> 8, > > + (mask->hdr.dst_addr & 0x00FF0000) > >> 16, > > + (mask->hdr.dst_addr & 0xFF000000) > > + >> 24); > > + } > > + break; > > + } > > + default: > > + RTE_FLOW_LOG(INFO, "unfamiliar pattern item\n"); > > + } > > + } > > + > > + for (; actions->type !=3D RTE_FLOW_ACTION_TYPE_END; actions++) { > > + RTE_FLOW_LOG(INFO, "actions type =3D%u\n", actions- > >type); > > + switch (actions->type) { > > + case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: { > > + RTE_FLOW_LOG(INFO, > > + " > name=3DRTE_FLOW_ACTION_TYPE_OF_POP_VLAN\n"); > > + break; > > + } > > + case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: { > > + RTE_FLOW_LOG(INFO, > > + " > name=3DRTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN\n"); > > + if (actions->conf) { > > + const struct rte_flow_action_of_push_vlan > > + *conf =3D actions->conf; > > + RTE_FLOW_LOG(INFO, " > ethertype=3D0x%x\n", > > + conf->ethertype); > > + } > > + break; > > + } > > + case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: { > > + RTE_FLOW_LOG(INFO, > > + " > name=3DRTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID\n"); > > + if (actions->conf) { > > + const struct > rte_flow_action_of_set_vlan_vid > > + *conf =3D actions->conf; > > + RTE_FLOW_LOG(INFO, " vlan_vid=3D0x%x\n", > > + conf->vlan_vid); > > + } > > + break; > > + } > > + case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP: { > > + RTE_FLOW_LOG(INFO, > > + " > name=3DRTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP\n"); > > + if (actions->conf) { > > + const struct > rte_flow_action_of_set_vlan_pcp > > + *conf =3D actions->conf; > > + RTE_FLOW_LOG(INFO, " vlan_pcp=3D%u\n", > > + conf->vlan_pcp); > > + } > > + break; > > + } > > + case RTE_FLOW_ACTION_TYPE_PORT_ID: { > > + RTE_FLOW_LOG(INFO, > > + " > name=3DRTE_FLOW_ACTION_TYPE_PORT_ID\n"); > > + if (actions->conf) { > > + const struct rte_flow_action_port_id > > + *conf =3D actions->conf; > > + RTE_FLOW_LOG(INFO, " id=3D%u\n", conf- > >id); > > + RTE_FLOW_LOG(INFO, " reserved=3D%u\n", > > + conf->reserved); > > + } > > + break; > > + } > > + default: > > + RTE_FLOW_LOG(INFO, "unfamiliar action item\n"); > > + } > > + } > > +} > > + > > /* Create a flow rule on a given port. */ struct rte_flow * > > rte_flow_create(uint16_t port_id, @@ -1001,3 +1219,11 @@ enum > > rte_flow_conv_item_spec_type { > > }; > > return lsize; > > } > > + > > +RTE_INIT(flow_init_log) > > +{ > > + rte_flow_logtype =3D rte_log_register("lib.flow"); > > + if (rte_flow_logtype >=3D 0) > > + rte_log_set_level(rte_flow_logtype, RTE_LOG_INFO); } > > + > > diff --git a/lib/librte_ethdev/rte_flow.h > > b/lib/librte_ethdev/rte_flow.h index c0fe879..0a7e70b 100644 > > --- a/lib/librte_ethdev/rte_flow.h > > +++ b/lib/librte_ethdev/rte_flow.h > > @@ -28,6 +28,12 @@ > > #include > > #include > > #include > > +#include > > + > > +extern int rte_flow_logtype; > > + > > +#define RTE_FLOW_LOG(level, ...) \ > > + rte_log(RTE_LOG_ ## level, rte_flow_logtype, "" __VA_ARGS__) > > > > #ifdef __cplusplus > > extern "C" { > > @@ -2414,6 +2420,31 @@ enum rte_flow_conv_op { > > struct rte_flow_error *error); > > > > /** > > + * Print the flow fields. > > + * > > + * The flow contains the port id, different attributes, the pattern's > > + * items and the action's items, which are all being printed. > > + * > > + * @b EXPERIMENTAL: this API may change without prior notice > > + * > > + * @param port_id > > + * Port identifier of Ethernet device. > > + * @param[in] attr > > + * Flow rule attributes. > > + * @param[in] pattern > > + * Pattern specification (list terminated by the END pattern item). > > + * @param[in] actions > > + * Associated actions (list terminated by the END action). > > + * > > + * @note not all enum values of patterns and actions are printed. > > + */ > > +void __rte_experimental > > +rte_flow_print(uint16_t port_id, > > + const struct rte_flow_attr *attr, > > + const struct rte_flow_item pattern[], > > + const struct rte_flow_action actions[]); > > + > > +/** > > * Create a flow rule on a given port. > > * > > * @param port_id >=20 > Since this is a debug function, it would make more sense for it to take a= 'FILE > *' > for output like the other debug functions do. That would make it consist= ent > with rte_pktmbuf_dump rte_event_dev_dump, rte_mempool_dump, etc. >=20 > Why not name it rte_flow_dump? Thanks for pointing this out. I'll consider renaming and make it accept a f= ile. I'll wait for more comments first before uploading another version of the p= atch.