DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Xiaoyu Min <jackmin@mellanox.com>,
	thomas@monjalon.net, asafp@mellanox.com,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC] app/testpmd: add generic swap forwarding engine
Date: Tue, 21 Apr 2020 21:56:59 +0100	[thread overview]
Message-ID: <da71c632-9045-1207-d315-e3f6291ed6df@intel.com> (raw)
In-Reply-To: <47cf5b417fb3c74c04e5a020dba700c5d748383d.1586958002.git.jackmin@mellanox.com>

On 4/15/2020 2:48 PM, Xiaoyu Min wrote:
> This RFC propose a generic `swap` forwarding engine, which could be seen
> as an extension of existing `macswap` but provide more flexibility.
> 
> With this generic `swap` forwarding engine, we can `swap` the source and
> destination of L2/L3 address as well as the source and destination port
> of L4 according to the user inputs.
> 
> This will be very helpful for developer/tester in some test scenarios.
> For example, connection tracking functinality in OVS, which needs to
> swap UDP ports in addition to L2/L3 addresses in order to complete one
> connection.

Why not, if this will be an additional forwarding engine, I am OK with it. It
increases the testpmd capabilities.

> 
> Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
> ---
>  app/test-pmd/parameters.c                   |  2 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 15 ++++++++++++++-
>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 404dba2b20..5c9aecd6cb 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -147,6 +147,8 @@ usage(char* progname)
>  	       "is default).\n");
>  	printf("  --forward-mode=N: set forwarding mode (N: %s).\n",
>  	       list_pkt_forwarding_modes());
> +	printf("  --forward-mode=swap[:TYPE[,TYPE]]: set forwarding mode to swap "
> +	       "(TYPE: auto (default) or mac or ip or tp).\n");
>  	printf("  --rss-ip: set RSS functions to IPv4/IPv6 only .\n");
>  	printf("  --rss-udp: set RSS functions to IPv4/IPv6 + UDP.\n");
>  	printf("  --rxq=N: set the number of RX queues per port to N.\n");
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index dcee5de455..27f0600493 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -298,7 +298,7 @@ set fwd
>  Set the packet forwarding mode::
>  
>     testpmd> set fwd (io|mac|macswap|flowgen| \
> -                     rxonly|txonly|csum|icmpecho|noisy) (""|retry)
> +                     rxonly|txonly|csum|icmpecho|noisy|swap) (""|retry)
>  
>  ``retry`` can be specified for forwarding engines except ``rx_only``.
>  
> @@ -336,6 +336,19 @@ The available information categories are:
>    Simulate more realistic behavior of a guest machine engaged in receiving
>    and sending packets performing Virtual Network Function (VNF).
>  
> +* ``swap[:TYPE[,TYPE]*]``: Generic swap forwarding mode.
> + 
> +  Swap the source and destination address or/and source and destination port of packet according to ``TYPE`` before forwarding them.
> +  ``TYPE`` could be:
> +
> +  - ``auto``: swaps all supported fields (L2 to L4) if available, default.
> + 
> +  - ``mac``: swaps the source address and destination address of Ethernet, as same as ``macswap``.
> + 
> +  - ``ip``: swaps the source address and destination address of IP (v4 and v6).
> + 
> +  - ``tp``: swaps the source port and destination port of transport layer (TCP and UDP).
> +
>  Example::
>  
>     testpmd> set fwd rxonly
> 


  parent reply	other threads:[~2020-04-21 20:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 13:48 Xiaoyu Min
2020-04-21 15:47 ` Iremonger, Bernard
2020-04-22  2:12   ` Xiaoyu Min
2020-04-21 20:56 ` Ferruh Yigit [this message]
2020-04-22  2:15   ` Xiaoyu Min
2020-04-22  9:26 ` Kevin Traynor
2020-04-22 13:43   ` 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=da71c632-9045-1207-d315-e3f6291ed6df@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=asafp@mellanox.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jackmin@mellanox.com \
    --cc=jingjing.wu@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.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).