DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Robin Jarry <rjarry@redhat.com>, <dev@dpdk.org>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Subject: Re: [PATCH] usertools: add tool to generate balanced rss traffic flows
Date: Thu, 18 May 2023 14:33:03 +0100	[thread overview]
Message-ID: <85046b64-da3d-1fe5-ed57-bdcf241aa6b0@intel.com> (raw)
In-Reply-To: <20230413203010.638406-1-rjarry@redhat.com>

On 4/13/2023 9:30 PM, Robin Jarry wrote:
> From: 6WIND <grumly@6wind.com>
> 
> usage: dpdk-rss-flows.py [-h] [-s SPORT_RANGE] [-d DPORT_RANGE] [-r]
>                           [-k RSS_KEY] [-t RETA_SIZE] [-j]
>                           RX_QUEUES SRC DST
> 
> Craft IP{v6}/{TCP/UDP} traffic flows that will evenly spread over a
> given number of RX queues according to the RSS algorithm.
> 
> positional arguments:
>    RX_QUEUES             The number of RX queues to fill.
>    SRC                   The source IP network/address.
>    DST                   The destination IP network/address.
> 
> options:
>    -h, --help            show this help message and exit
>    -s SPORT_RANGE, --sport-range SPORT_RANGE
>                          The layer 4 (TCP/UDP) source port range. Can
>                          be a single fixed value or a range
>                          <start>-<end>.
>    -d DPORT_RANGE, --dport-range DPORT_RANGE
>                          The layer 4 (TCP/UDP) destination port range.
>                          Can be a single fixed value or a range
>                          <start>-<end>.
>    -r, --check-reverse-traffic
>                          The reversed traffic (source <-> dest) should
>                          also be evenly balanced in the queues.
>    -k RSS_KEY, --rss-key RSS_KEY
>                          The random key byte-stream used to compute the
>                          RSS hash. This option supports either a
>                          supported driver name or the hex value of the
>                          key (default: intel).
>    -t RETA_SIZE, --reta-size RETA_SIZE
>                          Size of the redirection table or "RETA"
>                          (default: 128).
>    -j, --json            Output in parseable JSON format.
> 
> Examples:
> 
>    ~$ dpdk-rss-flows.py 8 28.0.0.0/24 40.0.0.0/24
>    SRC_IP      DST_IP       QUEUE
>    28.0.0.1    40.0.0.1     5
>    28.0.0.1    40.0.0.2     4
>    28.0.0.1    40.0.0.3     2
>    28.0.0.1    40.0.0.6     3
>    28.0.0.1    40.0.0.8     0
>    28.0.0.1    40.0.0.9     6
>    28.0.0.1    40.0.0.10    7
>    28.0.0.1    40.0.0.11    1
> 
>    ~$ dpdk-rss-flows.py 8 28.0.0.0/24 40.0.0.0/24 -r
>    SRC_IP      DST_IP       QUEUE    QUEUE_REVERSE
>    28.0.0.1    40.0.0.1     5        3
>    28.0.0.1    40.0.0.2     4        2
>    28.0.0.1    40.0.0.8     0        6
>    28.0.0.1    40.0.0.9     6        7
>    28.0.0.1    40.0.0.16    2        4
>    28.0.0.1    40.0.0.19    3        5
>    28.0.0.1    40.0.0.24    1        0
>    28.0.0.1    40.0.0.25    7        1
> 
>    ~$ dpdk-rss-flows.py 8 28.0.0.0/24 40.0.0.0/24 -s 32000-64000 -d 53
>    SRC_IP      SPORT    DST_IP      DPORT    QUEUE
>    28.0.0.1    32000    40.0.0.1    53       0
>    28.0.0.1    32001    40.0.0.1    53       1
>    28.0.0.1    32004    40.0.0.1    53       4
>    28.0.0.1    32005    40.0.0.1    53       5
>    28.0.0.1    32008    40.0.0.1    53       2
>    28.0.0.1    32009    40.0.0.1    53       3
>    28.0.0.1    32012    40.0.0.1    53       6
>    28.0.0.1    32013    40.0.0.1    53       7
> 
>    ~$ dpdk-rss-flows.py 4 2a01:cb00:f8b:9700::/64 2620:52:0:2592::/64 -rj
>    [
>      {
>        "queue": 0,
>        "queue_reverse": 3,
>        "src_ip": "2a01:cb00:f8b:9700::1",
>        "dst_ip": "2620:52:0:2592::1",
>        "src_port": 0,
>        "dst_port": 0
>      },
>      {
>        "queue": 3,
>        "queue_reverse": 0,
>        "src_ip": "2a01:cb00:f8b:9700::1",
>        "dst_ip": "2620:52:0:2592::2",
>        "src_port": 0,
>        "dst_port": 0
>      },
>      {
>        "queue": 2,
>        "queue_reverse": 1,
>        "src_ip": "2a01:cb00:f8b:9700::1",
>        "dst_ip": "2620:52:0:2592::3",
>        "src_port": 0,
>        "dst_port": 0
>      },
>      {
>        "queue": 1,
>        "queue_reverse": 2,
>        "src_ip": "2a01:cb00:f8b:9700::1",
>        "dst_ip": "2620:52:0:2592::1a",
>        "src_port": 0,
>        "dst_port": 0
>      }
>    ]
> 
> Cc: Olivier Matz <olivier.matz@6wind.com>
> Cc: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
> Signed-off-by: Robin Jarry <rjarry@redhat.com>
> ---

I won't comment on the merits of inclusion of this into DPDK, but as far 
as code itself, this script makes me feel insecure about my Python 
skills! Can't really offer any constructive criticism, also learned a 
few new tricks.

So, for the code,

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly


      parent reply	other threads:[~2023-05-18 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 20:30 Robin Jarry
2023-04-14  7:23 ` Thomas Monjalon
2023-04-14  7:41   ` Robin Jarry
2023-05-09 12:03 ` Robin Jarry
2023-05-18 13:33 ` Burakov, Anatoly [this message]

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=85046b64-da3d-1fe5-ed57-bdcf241aa6b0@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jean-mickael.guerin@6wind.com \
    --cc=olivier.matz@6wind.com \
    --cc=rjarry@redhat.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).