From: Jerin Jacob <jerinjacobk@gmail.com>
To: Xiaoyu Min <jackmin@mellanox.com>
Cc: Slava Ovsiienko <viacheslavo@mellanox.com>,
Matan Azrad <matan@mellanox.com>,
Raslan Darawsheh <rasland@mellanox.com>,
Wenzhuo Lu <wenzhuo.lu@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>,
Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Ori Kam <orika@mellanox.com>, dpdk-dev <dev@dpdk.org>,
Xueming Li <xuemingl@mellanox.com>
Subject: Re: [dpdk-dev] [RFC 2/4] app/testpmd: new flow dump CLI
Date: Tue, 14 Jan 2020 10:01:31 +0530 [thread overview]
Message-ID: <CALBAE1NOAUjZTCOGP92yyyWRCWFFePBVaNrjkbUfmAM2vxzQYQ@mail.gmail.com> (raw)
In-Reply-To: <620a2408b0dd370b8483c452d2b5957b3144fac7.1578969179.git.jackmin@mellanox.com>
On Tue, Jan 14, 2020 at 9:15 AM Xiaoyu Min <jackmin@mellanox.com> wrote:
>
> From: Xueming Li <xuemingl@mellanox.com>
>
> New flow dump CLI to dump MLX5 PMD specific flows into screen.
>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
> app/test-pmd/Makefile | 4 ++
> app/test-pmd/cmdline_flow.c | 91 +++++++++++++++++++++++++++++++++++++
> app/test-pmd/config.c | 33 ++++++++++++++
> app/test-pmd/meson.build | 3 ++
> app/test-pmd/testpmd.h | 1 +
> 5 files changed, 132 insertions(+)
>
>
> +/** Dump all flow rules. */
> +int
> +port_flow_dump(portid_t port_id __rte_unused,
> + const char *file_name __rte_unused)
> +{
> + int ret = 0;
> +#ifdef RTE_LIBRTE_MLX5_PMD
IMO, It should be the last resort to add driver-specific symbols in testpmd.
Why not introduce rte_flow_dump() and hook the MLX driver underneath?
> + FILE * file = stdout;
> +
> + if (file_name && strlen(file_name)) {
> + file = fopen(file_name, "w");
> + if (!file) {
> + printf("Failed to create file %s: %s\n", file_name,
> + strerror(errno));
> + return -errno;
> + }
> + }
> + ret = rte_pmd_mlx5_flow_dump(port_id, file);
> + if (ret)
> + printf("Failed to dump flow: %s\n", strerror(-ret));
> + else
> + printf("Flow dump finished\n");
> + if (file_name && strlen(file_name))
> + fclose(file);
> +#else
> + printf("MLX5 PMD driver disabled\n");
> +#endif
> + return ret;
> +}
next prev parent reply other threads:[~2020-01-14 4:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 3:45 [dpdk-dev] [RFC 0/4] net/mlx5: dump software steering flows in HW Xiaoyu Min
2020-01-14 3:45 ` [dpdk-dev] [RFC 1/4] net/mlx5: support flow dump Api Xiaoyu Min
2020-01-14 3:45 ` [dpdk-dev] [RFC 2/4] app/testpmd: new flow dump CLI Xiaoyu Min
2020-01-14 4:31 ` Jerin Jacob [this message]
2020-01-14 10:15 ` Jack Min
2020-01-14 14:00 ` Jerin Jacob
2020-01-15 12:49 ` Jack Min
2020-01-14 3:45 ` [dpdk-dev] [RFC 3/4] net/mlx5: add socket server for external tools Xiaoyu Min
2020-01-14 3:45 ` [dpdk-dev] [RFC 4/4] doc: update mlx5 document for flow dump feature Xiaoyu Min
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALBAE1NOAUjZTCOGP92yyyWRCWFFePBVaNrjkbUfmAM2vxzQYQ@mail.gmail.com \
--to=jerinjacobk@gmail.com \
--cc=adrien.mazarguil@6wind.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=jackmin@mellanox.com \
--cc=jingjing.wu@intel.com \
--cc=matan@mellanox.com \
--cc=orika@mellanox.com \
--cc=rasland@mellanox.com \
--cc=viacheslavo@mellanox.com \
--cc=wenzhuo.lu@intel.com \
--cc=xuemingl@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).