All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: Stanislav Fomichev <sdf@fomichev.me>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, andrew+netdev@lunn.ch,
	shuah@kernel.org, horms@kernel.org, willemb@google.com,
	petrm@nvidia.com
Subject: Re: [PATCH net-next v6 00/12] selftests: ncdevmem: Add ncdevmem to ksft
Date: Thu, 31 Oct 2024 12:41:18 -0700	[thread overview]
Message-ID: <ZyPdXr1hJ4OtWwf3@mini-arch> (raw)
In-Reply-To: <CAHS8izPCFVd=opRiGMYu3u0neOP7yCJDX8Ff+TdURq2U-Pi27A@mail.gmail.com>

On 10/31, Mina Almasry wrote:
> On Wed, Oct 30, 2024 at 8:37 AM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> >
> > On 10/30, Mina Almasry wrote:
> > > On Wed, Oct 30, 2024 at 8:13 AM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> > > >
> > > > On 10/30, Mina Almasry wrote:
> > > > > On Wed, Oct 30, 2024 at 7:27 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
> > > > > >
> > > > > > The goal of the series is to simplify and make it possible to use
> > > > > > ncdevmem in an automated way from the ksft python wrapper.
> > > > > >
> > > > > > ncdevmem is slowly mutated into a state where it uses stdout
> > > > > > to print the payload and the python wrapper is added to
> > > > > > make sure the arrived payload matches the expected one.
> > > > > >
> > > > > > v6:
> > > > > > - fix compilation issue in 'Unify error handling' patch (Jakub)
> > > > > >
> > > > >
> > > > > Since I saw a compilation failures on a couple of iterations I
> > > > > cherry-picked this locally and tested compilation. I'm seeing this:
> > > >
> > > > Are you cherry picking the whole series or just this patch? It looks
> > > > too broken.
> > > >
> > > > > sudo CFLAGS="-static" make -C ./tools/testing/selftests/drivers/net/hw
> > > > > TARGETS=ncdevmem 2>&1
> > > > > make: Entering directory
> > > > > '/usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/drivers/net/hw'
> > > > >   CC       ncdevmem
> > > > > In file included from ncdevmem.c:63:
> > > > > /usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/../../../tools/net/ynl/generated/ethtool-user.h:23:43:
> > > > > warning: ‘enum ethtool_header_flags’ declared inside parameter list
> > > > > will not be visible outside of this definition or declaration
> > > > >    23 | const char *ethtool_header_flags_str(enum ethtool_header_flags value);
> > > > >       |                                           ^~~~~~~~~~~~~~~~~~~~
> > > > > /usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/../../../tools/net/ynl/generated/ethtool-user.h:25:41:
> > > > > warning: ‘enum ethtool_module_fw_flash_status’ declared inside
> > > > > parameter list will not be visible outside of this definition or
> > > > > declaration
> > > > >    25 | ethtool_module_fw_flash_status_str(enum
> > > > > ethtool_module_fw_flash_status value);
> > > > >       |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > /usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/../../../tools/net/ynl/generated/ethtool-user.h:6766:45:
> > > > > error: field ‘status’ has incomplete type
> > > > >  6766 |         enum ethtool_module_fw_flash_status status;
> > > > >       |                                             ^~~~~~
> > > >
> > > > This has been fixed via '#include <linux/ethtool_netlink.h>'
> > > >
> > > > > ncdevmem.c: In function ‘do_server’:
> > > > > ncdevmem.c:517:37: error: storage size of ‘token’ isn’t known
> > > > >   517 |                 struct dmabuf_token token;
> > > >
> > > > And this, and the rest, don't make sense at all?
> > > >
> > > > I'll double check on my side.
> > >
> > > Oh, whoops, I forgot to headers_install first. This works for me:
> > >
> > > ➜  cos-kernel git:(tcpdevmem-fixes-1) ✗ sudo make headers_install &&
> > > sudo CFLAGS="-static" make -C ./tools/testing/selftests/drivers/net/hw
> > > TARGETS=ncdevmem 2>&1
> > >   INSTALL ./usr/include
> > > make: Entering directory
> > > '/usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/drivers/net/hw'
> > > make: Nothing to be done for 'all'.
> > > make: Leaving directory
> > > '/usr/local/google/home/almasrymina/cos-kernel/tools/testing/selftests/drivers/net/hw'
> > > ➜  cos-kernel git:(tcpdevmem-fixes-1) ✗ find . -iname ncdevmem
> > > ./tools/testing/selftests/drivers/net/hw/ncdevmem
> > >
> > > Sorry for the noise :D
> >
> > Whew, thanks and no worries!
> 
> Sorry, 2 issues testing this series:

Thank you for testing!


> 1. ipv4 addresses seem broken, or maybe i'm using them wrong.
> 
> Client command:
> yes $(echo -e \\x01\\x02\\x03\\x04\\x05\\x06) | tr \\n \\0 | head -c
> 1G | nc 192.168.1.4 5224 -p 5224
> 
> Server command and logs:
> mina-1 /home/almasrymina # ./ncdevmem -s 192.168.1.4 -c 192.168.1.5 -l
> -p 5224 -v 7 -f eth1
> here: ynl.c:887:ynl_req_trampoline
> using queues 15..16
> Running: sudo ethtool -K eth1 ntuple off >&2
> Running: sudo ethtool -K eth1 ntuple on >&2
> Running: sudo ethtool -n eth1 | grep 'Filter:' | awk '{print $2}' |
> xargs -n1 ethtool -N eth1 delete >&2
> ethtool: bad command line argument(s)
> For more information run ethtool -h
> here: ynl.c:887:ynl_req_trampoline
> TCP header split: on
> Running: sudo ethtool -X eth1 equal 15 >&2
> Running: sudo ethtool -N eth1 flow-type tcp6 src-ip 192.168.1.5 dst-ip
> 192.168.1.4 src-port 5224 dst-port 5224 queue 15 >&2
> Invalid src-ip value[192.168.1.5]
> ethtool: bad command line argument(s)
> For more information run ethtool -h
> ./ncdevmem: Failed to configure flow steering
> 
> The ethtool command to configure flow steering is not working for me.
> It thinks it's in v6 mode, when the ip address is a v4 address.
> (notice `-s 192.168.1.4 -c 192.168.1.5`). flow-type should be tcp in
> this case.
> 
> Reverting patch 9e2da4faeccf ("Revert "selftests: ncdevmem: Switch to
> AF_INET6"") resolves this issue. Leading to the second issue:

For IPv4, you have to use IPv4-mapped-IPv6, so your invocation needs to be:

./ncdevmem -s ::ffff:192.168.1.4 -c ::ffff:192.168.1.5 ...

Can you try that? I actually never tested that with non-ffff-prefixed
addresses, maybe that needs some error handling or something. Will
double-check on my side.


> 2. Validation is now broken:
> 
> Client command:
> yes $(echo -e \\x01\\x02\\x03\\x04\\x05\\x06) | tr \\n \\0 | head -c
> 1G | nc 192.168.1.4 5224 -p 5224
> 
> Server command and logs: mina-1 /home/almasrymina # ./ncdevmem -s
> 192.168.1.4 -c 192.168.1.5 -l -p 5224 -v 7 -f eth1
> here: ynl.c:887:ynl_req_trampoline
> using queues 15..16
> Running: sudo ethtool -K eth1 ntuple off >&2
> Running: sudo ethtool -K eth1 ntuple on >&2
> Running: sudo ethtool -n eth1 | grep 'Filter:' | awk '{print $2}' |
> xargs -n1 ethtool -N eth1 delete >&2
> ethtool: bad command line argument(s)
> For more information run ethtool -h
> here: ynl.c:887:ynl_req_trampoline
> TCP header split: on
> Running: sudo ethtool -X eth1 equal 15 >&2
> Running: sudo ethtool -N eth1 flow-type tcp4 src-ip 192.168.1.5 dst-ip
> 192.168.1.4 src-port 5224 dst-port 5224 queue 15 >&2
> Added rule with ID 19999
> here: ynl.c:887:ynl_req_trampoline
> got dmabuf id=1
> binding to address 192.168.1.4:5224
> Waiting or connection on 192.168.1.4:5224
> Got connection from 192.168.1.5:5224
> recvmsg ret=8192
> received frag_page=15997, in_page_offset=0, frag_offset=65523712,
> frag_size=4096, token=1, total_received=4096, dmabuf_id=1
> Failed validation: expected=1, actual=0, index=0
> Failed validation: expected=2, actual=0, index=1
> Failed validation: expected=3, actual=0, index=2
> Failed validation: expected=4, actual=0, index=3
> Failed validation: expected=5, actual=0, index=4
> Failed validation: expected=6, actual=0, index=5
> Failed validation: expected=1, actual=0, index=7
> Failed validation: expected=2, actual=0, index=8
> Failed validation: expected=3, actual=0, index=9
> Failed validation: expected=4, actual=0, index=10
> Failed validation: expected=5, actual=0, index=11
> Failed validation: expected=6, actual=0, index=12
> Failed validation: expected=1, actual=0, index=14
> Failed validation: expected=2, actual=0, index=15
> Failed validation: expected=3, actual=0, index=16
> Failed validation: expected=4, actual=0, index=17
> Failed validation: expected=5, actual=0, index=18
> Failed validation: expected=6, actual=0, index=19
> Failed validation: expected=1, actual=0, index=21
> Failed validation: expected=2, actual=0, index=22
> Failed validation: expected=3, actual=0, index=23
> ./ncdevmem: validation failed.
> 
> I haven't debugged issue #2 yet, but both need to be resolved before
> merge. I'm happy to provide more details if you can't repro. My setup:
> 
> mina-1 /home/almasrymina # cat /boot/config-6.12.0-rc4  | grep -i ipv6
> CONFIG_IPV6=y
> mina-1 /home/almasrymina # cat /proc/sys/net/ipv6/bindv6only
> 0

I see you've fixed it out already in a follow up, will pull in the fix!

---
pw-bot: cr

      parent reply	other threads:[~2024-10-31 19:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 14:27 [PATCH net-next v6 00/12] selftests: ncdevmem: Add ncdevmem to ksft Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 01/12] selftests: ncdevmem: Redirect all non-payload output to stderr Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 02/12] selftests: ncdevmem: Separate out dmabuf provider Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 03/12] selftests: ncdevmem: Unify error handling Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 04/12] selftests: ncdevmem: Make client_ip optional Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 05/12] selftests: ncdevmem: Remove default arguments Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 06/12] selftests: ncdevmem: Switch to AF_INET6 Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 07/12] selftests: ncdevmem: Properly reset flow steering Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 08/12] selftests: ncdevmem: Use YNL to enable TCP header split Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 09/12] selftests: ncdevmem: Remove hard-coded queue numbers Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 10/12] selftests: ncdevmem: Run selftest when none of the -s or -c has been provided Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 11/12] selftests: ncdevmem: Move ncdevmem under drivers/net/hw Stanislav Fomichev
2024-10-30 14:27 ` [PATCH net-next v6 12/12] selftests: ncdevmem: Add automated test Stanislav Fomichev
2024-10-30 14:59 ` [PATCH net-next v6 00/12] selftests: ncdevmem: Add ncdevmem to ksft Mina Almasry
2024-10-30 15:13   ` Stanislav Fomichev
2024-10-30 15:19     ` Mina Almasry
2024-10-30 15:37       ` Stanislav Fomichev
2024-10-31 16:45         ` Mina Almasry
2024-10-31 17:20           ` Mina Almasry
2024-10-31 19:41           ` Stanislav Fomichev [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=ZyPdXr1hJ4OtWwf3@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.