On Fri, Nov 01, 2024 at 06:34:26AM -0700, Jakub Kicinski wrote:
> On Fri,  1 Nov 2024 00:48:33 +0000 Joe Damato wrote:
> > +   ip netns exec nscl nc -N 192.168.1.1 48675 < $tmp_file
> 
> Thanks a lot for adding the test.

Thanks for the review.

> Could you replace nc with socat or
> a similar tool? There are multiple incompatible implementations of
> netcat packaged by various distros, we get:
> 
> # selftests: net: busy_poll_test.sh
> # nc: invalid option -- 'N'
> # Ncat: Try `--help' or man(1) ncat for more information, usage options and 
> help. QUITTING.
> 
> nc is a known PITA.

OK, I've replaced with socat for the v4 I am working on. I've also
added some additional documentation to the FAQ in the cover letter
and the kernel documentation to help answer Sridhar's question
because it may be a question others have as well.

> > +   # set the suspend parameter for the server via its IFIDX
> > +
> > +   DUMP_CMD="${YNL_PATH} --spec ${SPEC_PATH} --dump napi-get 
> > --json=\"{\\\"ifindex\\\": ${NSIM_DEV_1_IFIDX}}\" --output-json"
> > +   NSIM_DEV_1_NAPIID=$(ip netns exec nssv bash -c "$DUMP_CMD")
> > +   NSIM_DEV_1_NAPIID=$(echo $NSIM_DEV_1_NAPIID | jq '.[] | .id')
> > +
> > +   SUSPEND_CMD="${YNL_PATH} --spec ${SPEC_PATH} --do napi-set 
> > --json=\"{\\\"id\\\": ${NSIM_DEV_1_NAPIID}, \\\"irq-suspend-timeout\\\": 
> > 20000000, \\\"gro-flush-timeout\\\": 50000, \\\"defer-hard-irqs\\\": 100}\""
> > +   NSIM_DEV_1_SETCONFIG=$(ip netns exec nssv bash -c "$SUSPEND_CMD")
> 
> Can you try to run this test in installed mode?
> 
> https://docs.kernel.org/dev-tools/kselftest.html#install-selftests
> 
> IIRC YNL moves around when we install, you'd either need to do
> autodetection of the path (see tools/testing/selftests/net/lib/py/ynl.py
> and if you go down this route please move the helper which exports the
> YNL variables to lib.sh so other tests can reuse); or teach the C code
> to do the setup, you can link against YNL fairly easily (look at where
> ncdevmem is added in the Makefile, it uses YNL)

I think I'm going to go the C route.

Just to make sure I'm following how to do this properly:
  - I've added busy_poller to YNL_GEN_FILES (and removed it from
    TEST_GEN_FILES)
  - It still needs to be run via the script (which sets up netdevsim
    etc), so I am leaving that script (busy_poll_test.sh) in
    TEST_PROGS. busy_poller is not intended to be run on its own for
    selftest purposes.

I am not sure if YNL_GEN_FILES are expected to run standalone when
invoked or if this will work as I expect it to (busy_poll_test.sh is
run):

  [...]
  TEST_PROGS += busy_poll_test.sh
  
  # YNL files, must be before "include ..lib.mk"
  YNL_GEN_FILES := ncdevmem busy_poller
  [...]

Doing the above: I am hoping that busy_poll_test.sh will be run
(which will use busy_poller) and that busy_poller won't be run on
its own.

Thanks for the guidance.

Reply via email to