From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CEB45A0352; Thu, 16 Jan 2020 11:37:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC51E1C1C2; Thu, 16 Jan 2020 11:37:23 +0100 (CET) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 2710C1C1B2 for ; Thu, 16 Jan 2020 11:37:22 +0100 (CET) Received: by mail-io1-f67.google.com with SMTP id c16so21169900ioh.6 for ; Thu, 16 Jan 2020 02:37:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=23qYwpwaWjpYOKyM1oP0JjESOjxduyC1i8dBYOotvYk=; b=ODkDHYq5eakcn8k+o66s/rlRREdNK8m5kmANVcgdQOilO5jS9UndGejB3lXwGFC26l OzVy74krovcMq4PBdLM5s3AEndL2bIh/HKfXwdHINqFUAz9/0giJZrrmVfWf3iRnX2hv zR66Py0qkRqAeckLbB4ozakcggkAv16TjzF7SsnFA1VI0S4ci6hrPd0Rif+JvPXZwMeX oY6tqKy8K8XW7DbDZRKgAPrr0dLFDK9ALq5ySg95nffxima5gOspZUztoI/fJHAyvuR/ 69k0V01dhBzP+qLzwfuPY6SUVosdo4IQiOcZoS3pbslU10A5pjlz8jLxIeMWqzlgLVia AMpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=23qYwpwaWjpYOKyM1oP0JjESOjxduyC1i8dBYOotvYk=; b=WIp0quPq1Afzf6FvWev6zFzM+zV4kxWeA5hbCrlalyQrfHusRrYWOg5APev7+ksQgi 3kUj05NdUWd7Qwf5qoVvVmBTMfz4WNDSfe4TNNeho/PjoiKhb9kQOdInpCigi5g7ENJE Zt91YZ1TDT0jITbvZEwIlDeYw+LkLM3OPqItO0H0b7alK6PS8ZSIt/f+BVEPYqHbItHD nYI86B2zoIOZpJ9t7E5xNeleuaDNyctC6Vs+HxcK4Z39JFGa4lOzlWcndTXfwDdZHVXj xL+kzEbes5OhXvAWnmscdpHq8eNN53MQkR1DFnW+L89LkMtFF1+bGLznNKdf2nBFkGnM wjvQ== X-Gm-Message-State: APjAAAV00Or7fU8ZRF3pA+M5obx4Of2B5xSuZTtSTcMrCWq49epP4GgK Cbz5NPuAcruROhglFbkRH7e3U25x61P0gkTzCok= X-Google-Smtp-Source: APXvYqxOlCnwxxN/GAXXTTPNHw5EnLgQZkVs/NXGQ3HFEVQ4ani3sCIFW41QCMLZCTnFhFr86yDTiA67de+gur5W+kg= X-Received: by 2002:a6b:c742:: with SMTP id x63mr26081934iof.162.1579171041185; Thu, 16 Jan 2020 02:37:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jerin Jacob Date: Thu, 16 Jan 2020 16:07:05 +0530 Message-ID: To: Xiaoyu Min Cc: Ori Kam , Slava Ovsiienko , Matan Azrad , Raslan Darawsheh , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Adrien Mazarguil , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/5] ethdev: add API to dump device internal flow info 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jan 16, 2020 at 3:45 PM Xiaoyu Min wrote: > > Introduce an API which dump the device's internal representation > information of rte flows in hardware. > > Signed-off-by: Xiaoyu Min Looks good to me. > --- > lib/librte_ethdev/rte_ethdev_version.map | 3 +++ > lib/librte_ethdev/rte_flow.c | 16 ++++++++++++++++ > lib/librte_ethdev/rte_flow.h | 21 +++++++++++++++++++++ > lib/librte_ethdev/rte_flow_driver.h | 5 +++++ > 4 files changed, 45 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map > index a7dacf2cf2..3f32fdecf7 100644 > --- a/lib/librte_ethdev/rte_ethdev_version.map > +++ b/lib/librte_ethdev/rte_ethdev_version.map > @@ -227,4 +227,7 @@ EXPERIMENTAL { > rte_flow_dynf_metadata_mask; > rte_flow_dynf_metadata_register; > rte_eth_dev_set_ptypes; > + > + # added in 20.02 > + rte_flow_dev_dump; > }; > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 87a3e8c4c6..751ce721b2 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -1212,3 +1212,19 @@ rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size, > } > return lsize; > } > + > +int > +rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error) > +{ > + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; > + const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); > + > + if (unlikely(!ops)) > + return -rte_errno; > + if (likely(!!ops->dev_dump)) > + return flow_err(port_id, ops->dev_dump(dev, file, error), > + error); > + return rte_flow_error_set(error, ENOSYS, > + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > + NULL, rte_strerror(ENOSYS)); > +} > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index 58b50265d2..cf7cf61ae8 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -2790,6 +2790,27 @@ enum rte_flow_conv_op { > RTE_FLOW_CONV_OP_ACTION_NAME_PTR, > }; > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Dump hardware internal representation information of > + * rte flow to file. > + * > + * @param[in] port_id > + * The port identifier of the Ethernet device. > + * @param[in] file > + * A pointer to a file for output. > + * @param[out] error > + * Perform verbose error reporting if not NULL. PMDs initialize this > + * structure in case of error only. > + * @return > + * 0 on success, a nagative value otherwise. > + */ > +__rte_experimental > +int > +rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error); > + > /** > * Check if mbuf dynamic field for metadata is registered. > * > diff --git a/lib/librte_ethdev/rte_flow_driver.h b/lib/librte_ethdev/rte_flow_driver.h > index a0359853e6..51a9a57a0f 100644 > --- a/lib/librte_ethdev/rte_flow_driver.h > +++ b/lib/librte_ethdev/rte_flow_driver.h > @@ -96,6 +96,11 @@ struct rte_flow_ops { > (struct rte_eth_dev *, > int, > struct rte_flow_error *); > + /** See rte_flow_dev_dump(). */ > + int (*dev_dump) > + (struct rte_eth_dev *dev, > + FILE *file, > + struct rte_flow_error *error); > }; > > /** > -- > 2.24.1 >