diff mbox series

[net-next,06/13] selftests: ncdevmem: Remove client_ip

Message ID 20240912171251.937743-7-sdf@fomichev.me (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series selftests: ncdevmem: Add ncdevmem to ksft | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch warning WARNING: line length of 98 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest warning net-next-2024-09-13--00-00 (tests: 536)

Commit Message

Stanislav Fomichev Sept. 12, 2024, 5:12 p.m. UTC
It's used only in ntuple filter, but having dst address/port should
be enough.

Cc: Mina Almasry <almasrymina@google.com>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
 tools/testing/selftests/net/ncdevmem.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Mina Almasry Sept. 12, 2024, 8:35 p.m. UTC | #1
On Thu, Sep 12, 2024 at 10:13 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
>
> It's used only in ntuple filter, but having dst address/port should
> be enough.
>
> Cc: Mina Almasry <almasrymina@google.com>
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> ---
>  tools/testing/selftests/net/ncdevmem.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/net/ncdevmem.c
> index c0da2b2e077f..77f6cb166ada 100644
> --- a/tools/testing/selftests/net/ncdevmem.c
> +++ b/tools/testing/selftests/net/ncdevmem.c
> @@ -62,7 +62,6 @@
>   */
>
>  static char *server_ip = "192.168.1.4";
> -static char *client_ip = "192.168.1.2";
>  static char *port = "5201";
>  static int start_queue = 8;
>  static int num_queues = 8;
> @@ -228,8 +227,8 @@ static int configure_channels(unsigned int rx, unsigned int tx)
>
>  static int configure_flow_steering(void)
>  {
> -       return run_command("sudo ethtool -N %s flow-type tcp4 src-ip %s dst-ip %s src-port %s dst-port %s queue %d >&2",
> -                          ifname, client_ip, server_ip, port, port, start_queue);
> +       return run_command("sudo ethtool -N %s flow-type tcp4 dst-ip %s dst-port %s queue %d >&2",
> +                          ifname, server_ip, port, start_queue);
>  }

Oh, sorry. I need 5-tuple rules here. Unfortunately GVE doesn't (yet)
support 3 tuple rules that you're converting to here, AFAIR. Other
drivers may also have a similar limitation.

If you would like to add support for 3-tuples rules because your
driver needs it, that's more than fine, but I would ask that this be
configurable via a flag, or auto-detected by ncdevmem.
Stanislav Fomichev Sept. 12, 2024, 9:48 p.m. UTC | #2
On 09/12, Mina Almasry wrote:
> On Thu, Sep 12, 2024 at 10:13 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
> >
> > It's used only in ntuple filter, but having dst address/port should
> > be enough.
> >
> > Cc: Mina Almasry <almasrymina@google.com>
> > Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
> > ---
> >  tools/testing/selftests/net/ncdevmem.c | 8 ++------
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/net/ncdevmem.c
> > index c0da2b2e077f..77f6cb166ada 100644
> > --- a/tools/testing/selftests/net/ncdevmem.c
> > +++ b/tools/testing/selftests/net/ncdevmem.c
> > @@ -62,7 +62,6 @@
> >   */
> >
> >  static char *server_ip = "192.168.1.4";
> > -static char *client_ip = "192.168.1.2";
> >  static char *port = "5201";
> >  static int start_queue = 8;
> >  static int num_queues = 8;
> > @@ -228,8 +227,8 @@ static int configure_channels(unsigned int rx, unsigned int tx)
> >
> >  static int configure_flow_steering(void)
> >  {
> > -       return run_command("sudo ethtool -N %s flow-type tcp4 src-ip %s dst-ip %s src-port %s dst-port %s queue %d >&2",
> > -                          ifname, client_ip, server_ip, port, port, start_queue);
> > +       return run_command("sudo ethtool -N %s flow-type tcp4 dst-ip %s dst-port %s queue %d >&2",
> > +                          ifname, server_ip, port, start_queue);
> >  }
> 
> Oh, sorry. I need 5-tuple rules here. Unfortunately GVE doesn't (yet)
> support 3 tuple rules that you're converting to here, AFAIR. Other
> drivers may also have a similar limitation.
> 
> If you would like to add support for 3-tuples rules because your
> driver needs it, that's more than fine, but I would ask that this be
> configurable via a flag, or auto-detected by ncdevmem.

Ah, cool, in this case I'll make client ip optional (will keep existing
behavior when client_ip is provided).
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/net/ncdevmem.c
index c0da2b2e077f..77f6cb166ada 100644
--- a/tools/testing/selftests/net/ncdevmem.c
+++ b/tools/testing/selftests/net/ncdevmem.c
@@ -62,7 +62,6 @@ 
  */
 
 static char *server_ip = "192.168.1.4";
-static char *client_ip = "192.168.1.2";
 static char *port = "5201";
 static int start_queue = 8;
 static int num_queues = 8;
@@ -228,8 +227,8 @@  static int configure_channels(unsigned int rx, unsigned int tx)
 
 static int configure_flow_steering(void)
 {
-	return run_command("sudo ethtool -N %s flow-type tcp4 src-ip %s dst-ip %s src-port %s dst-port %s queue %d >&2",
-			   ifname, client_ip, server_ip, port, port, start_queue);
+	return run_command("sudo ethtool -N %s flow-type tcp4 dst-ip %s dst-port %s queue %d >&2",
+			   ifname, server_ip, port, start_queue);
 }
 
 static int bind_rx_queue(unsigned int ifindex, unsigned int dmabuf_fd,
@@ -553,9 +552,6 @@  int main(int argc, char *argv[])
 		case 's':
 			server_ip = optarg;
 			break;
-		case 'c':
-			client_ip = optarg;
-			break;
 		case 'p':
 			port = optarg;
 			break;