DPDK patches and discussions
 help / color / mirror / Atom feed
From: Robin Jarry <rjarry@redhat.com>
To: dev@dpdk.org
Subject: [PATCH v2 2/3] usertools/rss: add --info flag
Date: Mon, 20 Nov 2023 17:22:58 +0100	[thread overview]
Message-ID: <20231120162256.74399-5-rjarry@redhat.com> (raw)
In-Reply-To: <20231120162256.74399-4-rjarry@redhat.com>

Add a flag to print the RSS key and RETA size that are used to compute
balanced traffic. Example:

 $ usertools/dpdk-rss-flows.py -i 4 1.0.0.0 2.2.0.0/24 -k mlx
 RSS key:     2cc681d15bdbf4f7fca28319db1a3e946b9e38d92c9c03d1ad9944a7d…
 RETA size:   4

 SRC_IP     DST_IP     QUEUE
 1.0.0.0    2.2.0.1    2
 1.0.0.0    2.2.0.2    0
 1.0.0.0    2.2.0.4    1
 1.0.0.0    2.2.0.6    3

The flag is only available with the default text output.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 usertools/dpdk-rss-flows.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/usertools/dpdk-rss-flows.py b/usertools/dpdk-rss-flows.py
index 241ee4fe28c6..fd225a697f08 100755
--- a/usertools/dpdk-rss-flows.py
+++ b/usertools/dpdk-rss-flows.py
@@ -352,6 +352,14 @@ def parse_args():
         Output in parseable JSON format.
         """,
     )
+    parser.add_argument(
+        "-i",
+        "--info",
+        action="store_true",
+        help="""
+        Print RETA size and RSS key above the results. Not available with --json.
+        """,
+    )
 
     args = parser.parse_args()
 
@@ -360,6 +368,9 @@ def parse_args():
             f"{args.ip_src} and {args.ip_dst} don't have the same protocol version"
         )
 
+    if args.json and args.info:
+        parser.error("--json and --info are mutually exclusive")
+
     if args.rss_key in DEFAULT_DRIVERS:
         driver_info = DEFAULT_DRIVERS[args.rss_key]
     else:
@@ -442,6 +453,11 @@ def main():
             cells.append(r)
         rows.append(tuple(cells))
 
+    if args.info:
+        print(f"RSS key:     {binascii.hexlify(args.rss_key).decode()}")
+        print(f"RETA size:   {args.reta_size}")
+        print()
+
     fmt = [f"%-{w}s" for w in widths]
     fmt[-1] = "%s"  # avoid trailing whitespace
     fmt = "    ".join(fmt)
-- 
2.42.0


  reply	other threads:[~2023-11-20 16:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  8:07 [PATCH 1/2] usertools/rss: add driver abstractions Robin Jarry
2023-10-23  8:07 ` [PATCH 2/2] usertools/rss: add --info flag Robin Jarry
2023-11-20 13:28 ` [PATCH 1/2] usertools/rss: add driver abstractions Robin Jarry
2023-11-20 15:13   ` [EXT] " Sunil Kumar Kori
2023-11-20 16:22 ` [PATCH v2 1/3] " Robin Jarry
2023-11-20 16:22   ` Robin Jarry [this message]
2023-11-21  6:15     ` [EXT] [PATCH v2 2/3] usertools/rss: add --info flag Sunil Kumar Kori
2023-11-20 16:22   ` [PATCH v2 3/3] usertools/rss: add CNXK well-known key Robin Jarry
2023-11-20 16:41     ` Stephen Hemminger
2023-11-21  6:08     ` [EXT] " Sunil Kumar Kori
2023-11-21  6:14   ` [EXT] [PATCH v2 1/3] usertools/rss: add driver abstractions Sunil Kumar Kori
2023-11-22 23:43   ` Thomas Monjalon
2023-11-21  6:11 ` [EXT] [PATCH 1/2] " Sunil Kumar Kori
2023-11-21 16:38 ` Stephen Hemminger
2023-11-21 16:49   ` Thomas Monjalon
2023-11-21 16:51   ` Jerin Jacob
2023-11-21 17:04     ` Stephen Hemminger
2023-11-21 17:21       ` Jerin Jacob
2023-11-21 17:27         ` Stephen Hemminger
2023-11-22  8:28           ` Robin Jarry
2023-11-22  9:37             ` fengchengwen
2023-11-22 23:27               ` Thomas Monjalon

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=20231120162256.74399-5-rjarry@redhat.com \
    --to=rjarry@redhat.com \
    --cc=dev@dpdk.org \
    /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).