All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC net-next 0/6] xdp: make stack perform remove and tests
@ 2017-11-24  2:36 Jakub Kicinski
  2017-11-24  2:36 ` [RFC net-next 1/6] net: xdp: avoid output parameters when querying XDP prog Jakub Kicinski
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Jakub Kicinski @ 2017-11-24  2:36 UTC (permalink / raw)
  To: netdev; +Cc: oss-drivers, daniel, alexei.starovoitov, jiri, Jakub Kicinski

Hi!

The purpose of this series is to add a software model of BPF offloads
to make it easier for everyone to test them and make some of the more
arcane rules and assumptions more clear.

The series starts with 3 patches aiming to make XDP handling in the
drivers less error prone.  Currently driver authors have to remember
to free XDP programs if XDP is active during unregister.  With this
series the core will disable XDP on its own.  It will take place
after close, drivers are not expected to perform reconfiguration
when disabling XDP on a downed device.

Next two patches add the software netdev driver.  Last but not least
there is a python test which exercises all the corner cases which
came to my mind.

Test needs to be run as root.  It will print basic information to
stdout, but can also create a more detailed log of all commands
when --log option is passed.  Log is in Emacs Org-mode format.

  ./tools/testing/selftests/bpf/test_offload.py --log /tmp/log

Something I'm still battling with, and would appreciate help of
wiser people is that occasionally during the test something makes
the refcount of init_net drop to 0 :S  I tried to create a simple
reproducer, but seems like just running the script in the loop is
the easiest way to go...  Could it have something to do with the
recent TC work?  The driver is pretty simple and never touches
ref counts.  The only slightly unusual thing is that the BPF code
sleeps for a bit on remove in the netdev notifier.


Jakub Kicinski (6):
  net: xdp: avoid output parameters when querying XDP prog
  net: xdp: report flags program was installed with on query
  net: xdp: make the stack take care of the tear down
  netdevsim: add software driver for testing offloads
  netdevsim: add bpf offload support
  selftests/bpf: add offload test based on netdevsim

 MAINTAINERS                                        |   5 +
 drivers/net/Kconfig                                |  10 +
 drivers/net/Makefile                               |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |   2 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   3 -
 drivers/net/ethernet/netronome/nfp/bpf/main.c      |   7 -
 .../net/ethernet/netronome/nfp/nfp_net_common.c    |   4 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c       |   4 -
 drivers/net/netdevsim/Makefile                     |   7 +
 drivers/net/netdevsim/bpf.c                        | 391 +++++++++++++
 drivers/net/netdevsim/netdev.c                     | 241 ++++++++
 drivers/net/netdevsim/netdevsim.h                  |  84 +++
 drivers/net/tun.c                                  |   4 -
 include/linux/netdevice.h                          |   5 +-
 net/core/dev.c                                     |  42 +-
 net/core/rtnetlink.c                               |   6 +-
 tools/testing/selftests/bpf/Makefile               |   5 +-
 tools/testing/selftests/bpf/sample_ret0.c          |   8 +
 tools/testing/selftests/bpf/test_offload.py        | 634 +++++++++++++++++++++
 19 files changed, 1426 insertions(+), 37 deletions(-)
 create mode 100644 drivers/net/netdevsim/Makefile
 create mode 100644 drivers/net/netdevsim/bpf.c
 create mode 100644 drivers/net/netdevsim/netdev.c
 create mode 100644 drivers/net/netdevsim/netdevsim.h
 create mode 100644 tools/testing/selftests/bpf/sample_ret0.c
 create mode 100755 tools/testing/selftests/bpf/test_offload.py

-- 
2.14.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-11-28 16:20 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24  2:36 [RFC net-next 0/6] xdp: make stack perform remove and tests Jakub Kicinski
2017-11-24  2:36 ` [RFC net-next 1/6] net: xdp: avoid output parameters when querying XDP prog Jakub Kicinski
2017-11-24  2:36 ` [RFC net-next 2/6] net: xdp: report flags program was installed with on query Jakub Kicinski
2017-11-24  2:36 ` [RFC net-next 3/6] net: xdp: make the stack take care of the tear down Jakub Kicinski
2017-11-24 23:24   ` Daniel Borkmann
2017-11-25  3:28     ` Jakub Kicinski
2017-11-24  2:36 ` [RFC net-next 4/6] netdevsim: add software driver for testing offloads Jakub Kicinski
2017-11-24  7:24   ` Jiri Pirko
2017-11-24  7:49     ` Jakub Kicinski
2017-11-24  8:07       ` Jiri Pirko
2017-11-27 19:30   ` David Miller
2017-11-27 19:42     ` Jakub Kicinski
2017-11-28 14:55       ` Phil Sutter
2017-11-28 16:20       ` Jiri Pirko
2017-11-24  2:36 ` [RFC net-next 5/6] netdevsim: add bpf offload support Jakub Kicinski
2017-11-24  2:36 ` [RFC net-next 6/6] selftests/bpf: add offload test based on netdevsim Jakub Kicinski
2017-11-24  7:45 ` [RFC net-next 0/6] xdp: make stack perform remove and tests Jiri Pirko
2017-11-24  8:02   ` Jakub Kicinski
2017-11-25  4:55     ` Jakub Kicinski
2017-11-26  1:02 ` Alexei Starovoitov
2017-11-26  1:43   ` Jakub Kicinski
2017-11-26  7:43     ` Jiri Pirko

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.