mbox series

[v3,0/3] testpmd control C fixes

Message ID 20230314173648.69528-1-stephen@networkplumber.org (mailing list archive)
Headers
Series testpmd control C fixes |

Message

Stephen Hemminger March 14, 2023, 5:36 p.m. UTC
  Resolve issues around using control-C in testpmd.
Using cmdline_poll() is broken and won't work right so
don't use it. Instead use cmdline_interact() and fix
the signal handling.

Stephen Hemminger (3):
  testpmd: go back to using cmdline_interact
  testpmd: use sig_atomic_t for flag
  testpmd: enable interrupt in interactive mode

 app/test-pmd/cmdline.c           | 27 ++++++++++++++-------------
 app/test-pmd/testpmd.c           | 17 ++++++++++++-----
 app/test-pmd/testpmd.h           |  3 ++-
 lib/cmdline/cmdline.h            | 10 ++++++++++
 lib/cmdline/cmdline_os_unix.c    |  8 +++++++-
 lib/cmdline/cmdline_os_windows.c | 18 ++++++++++++++++--
 lib/cmdline/cmdline_private.h    |  2 +-
 lib/cmdline/version.map          |  3 +++
 8 files changed, 65 insertions(+), 23 deletions(-)
  

Comments

Stephen Hemminger March 14, 2023, 10:40 p.m. UTC | #1
On Tue, 14 Mar 2023 10:36:45 -0700
Stephen Hemminger <stephen@networkplumber.org> wrote:

> Resolve issues around using control-C in testpmd.
> Using cmdline_poll() is broken and won't work right so
> don't use it. Instead use cmdline_interact() and fix
> the signal handling.
> 
> Stephen Hemminger (3):
>   testpmd: go back to using cmdline_interact
>   testpmd: use sig_atomic_t for flag
>   testpmd: enable interrupt in interactive mode
> 
>  app/test-pmd/cmdline.c           | 27 ++++++++++++++-------------
>  app/test-pmd/testpmd.c           | 17 ++++++++++++-----
>  app/test-pmd/testpmd.h           |  3 ++-
>  lib/cmdline/cmdline.h            | 10 ++++++++++
>  lib/cmdline/cmdline_os_unix.c    |  8 +++++++-
>  lib/cmdline/cmdline_os_windows.c | 18 ++++++++++++++++--
>  lib/cmdline/cmdline_private.h    |  2 +-
>  lib/cmdline/version.map          |  3 +++
>  8 files changed, 65 insertions(+), 23 deletions(-)
> 

This patch is failing the CI tests from something that seems unrelated.
Looks like recent cyrptodev or ixgbe change broke something.


 -Idrivers/net/ice/base -I../drivers/net/ice/base -Idrivers/net/ice/../../common/iavf -I../drivers/net/ice/../../common/iavf -Idrivers/common/iavf -I../drivers/common/iavf -Idrivers/net/mlx5 -I../drivers/net/mlx5 -Idrivers/net/mlx5/linux -I../drivers/net/mlx5/linux -Idrivers/net/mlx5/hws -I../drivers/net/mlx5/hws -Idrivers/common/mlx5 -I../drivers/common/mlx5 -Idrivers/common/mlx5/linux -I../drivers/common/mlx5/linux -Idrivers/bus/auxiliary -I../drivers/bus/auxiliary -I/usr/include/libnl3 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -O3 -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototyp
 es -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE -march=armv8-a+crc+crypto -march=armv8-a+crc -moutline-atomics -DALLOW_EXPERIMENTAL_API -Wno-deprecated-declarations -MD -MQ 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o' -MF 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o.d' -o 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o' -c ../drivers/net/ixgbe/ixgbe_testpmd.c
In file included from ../drivers/net/ixgbe/ixgbe_ethdev.h:11,
from ../drivers/net/ixgbe/ixgbe_testpmd.c:9:
../drivers/net/ixgbe/base/ixgbe_type.h:2945:17: error: conflicting types for 'u64'
2945 | #define __le64  u64
|                 ^~~
In file included from ../drivers/net/ixgbe/base/ixgbe_type.h:46,
from ../drivers/net/ixgbe/ixgbe_ethdev.h:11,
from ../drivers/net/ixgbe/ixgbe_testpmd.c:9:
../drivers/net/ixgbe/base/ixgbe_osdep.h:94:18: note: previous declaration of 'u64' was here
94 | typedef uint64_t u64;
|                  ^~~
[2968/3157] Compiling C object 'app/test/3062f5d@@dpdk-test@exe/test_alarm.c.o'.
[2969/3157] Compiling C object 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_mlx5_mlx5_testpmd.c.o'.
[2970/3157] Compiling C object 'drivers/a715181@@tmp_rte_event_cnxk@sta/event_cnxk_tx_cn10k_tx_112_127_seg.c.o'.
ninja: build stopped: subcommand failed.
==== End log output ====
  
David Marchand March 15, 2023, 9:46 a.m. UTC | #2
On Tue, Mar 14, 2023 at 11:40 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue, 14 Mar 2023 10:36:45 -0700
> Stephen Hemminger <stephen@networkplumber.org> wrote:
>
> > Resolve issues around using control-C in testpmd.
> > Using cmdline_poll() is broken and won't work right so
> > don't use it. Instead use cmdline_interact() and fix
> > the signal handling.
> >
> > Stephen Hemminger (3):
> >   testpmd: go back to using cmdline_interact
> >   testpmd: use sig_atomic_t for flag
> >   testpmd: enable interrupt in interactive mode
> >
> >  app/test-pmd/cmdline.c           | 27 ++++++++++++++-------------
> >  app/test-pmd/testpmd.c           | 17 ++++++++++++-----
> >  app/test-pmd/testpmd.h           |  3 ++-
> >  lib/cmdline/cmdline.h            | 10 ++++++++++
> >  lib/cmdline/cmdline_os_unix.c    |  8 +++++++-
> >  lib/cmdline/cmdline_os_windows.c | 18 ++++++++++++++++--
> >  lib/cmdline/cmdline_private.h    |  2 +-
> >  lib/cmdline/version.map          |  3 +++
> >  8 files changed, 65 insertions(+), 23 deletions(-)
> >
>
> This patch is failing the CI tests from something that seems unrelated.
> Looks like recent cyrptodev or ixgbe change broke something.


There was no recent change in ixgbe.
The build issue is due to added inclusion of signal.h in testpmd.h in patch 2.

root@eb72fb63faec:~/dpdk# git stash
Saved working directory and index state WIP on main: baf13c3135
version: 23.03-rc2
root@eb72fb63faec:~/dpdk# ninja -C build-mini-aarch64
ninja: Entering directory `build-mini-aarch64'
[104/104] Linking target app/dpdk-testpmd.
root@eb72fb63faec:~/dpdk# git stash pop
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   app/test-pmd/testpmd.h

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (71b7fa29df19c6e8c553ca53e62cf89d1ef1ea97)
root@eb72fb63faec:~/dpdk# git diff
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index bdfbfd36d3..ada1d7b438 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -6,6 +6,7 @@
 #define _TESTPMD_H_

 #include <stdbool.h>
+#include <signal.h>

 #ifdef RTE_LIB_GRO
 #include <rte_gro.h>
root@eb72fb63faec:~/dpdk# ninja -C build-mini-aarch64
ninja: Entering directory `build-mini-aarch64'
[24/25] Compiling C object
'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o'.
FAILED: app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o
ccache aarch64-linux-gnu-gcc -Iapp/a172ced@@dpdk-testpmd@exe -Iapp
-I../app -Iapp/test-pmd -I../app/test-pmd -Ilib/ethdev -I../lib/ethdev
-I. -I../ -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include
-Ilib/eal/linux/include -I../lib/eal/linux/include
-Ilib/eal/arm/include -I../lib/eal/arm/include -Ilib/eal/common
-I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs
-I../lib/kvargs -Ilib/telemetry/../metrics
-I../lib/telemetry/../metrics -Ilib/telemetry -I../lib/telemetry
-Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool
-I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter
-Ilib/cmdline -I../lib/cmdline -Ilib/bitratestats
-I../lib/bitratestats -Ilib/metrics -I../lib/metrics -Ilib/bpf
-I../lib/bpf -Ilib/gro -I../lib/gro -Ilib/gso -I../lib/gso
-Ilib/latencystats -I../lib/latencystats -Ilib/pdump -I../lib/pdump
-Ilib/pcapng -I../lib/pcapng -Idrivers/net/ixgbe
-I../drivers/net/ixgbe -Idrivers/net/ixgbe/base
-I../drivers/net/ixgbe/base -Idrivers/bus/pci -I../drivers/bus/pci
-I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev
-I../drivers/bus/vdev -Ilib/hash -I../lib/hash -Ilib/rcu -I../lib/rcu
-Ilib/security -I../lib/security -Ilib/cryptodev -I../lib/cryptodev
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -O3 -include rte_config.h -Wcast-qual
-Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wold-style-definition -Wpointer-arith -Wsign-compare
-Wstrict-prototypes -Wundef -Wwrite-strings
-Wno-address-of-packed-member -Wno-packed-not-aligned
-Wno-missing-field-initializers -D_GNU_SOURCE -march=armv8-a+crc
-moutline-atomics -DALLOW_EXPERIMENTAL_API
-Wno-deprecated-declarations -MD -MQ
'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o'
-MF 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o.d'
-o 'app/a172ced@@dpdk-testpmd@exe/.._drivers_net_ixgbe_ixgbe_testpmd.c.o'
-c ../drivers/net/ixgbe/ixgbe_testpmd.c
In file included from ../drivers/net/ixgbe/ixgbe_ethdev.h:11,
                 from ../drivers/net/ixgbe/ixgbe_testpmd.c:9:
../drivers/net/ixgbe/base/ixgbe_type.h:2945:17: error: conflicting
types for 'u64'
 2945 | #define __le64  u64
      |                 ^~~
In file included from ../drivers/net/ixgbe/base/ixgbe_type.h:46,
                 from ../drivers/net/ixgbe/ixgbe_ethdev.h:11,
                 from ../drivers/net/ixgbe/ixgbe_testpmd.c:9:
../drivers/net/ixgbe/base/ixgbe_osdep.h:94:18: note: previous
declaration of 'u64' was here
   94 | typedef uint64_t u64;
      |                  ^~~
ninja: build stopped: subcommand failed.