BPF List
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: martin.lau@kernel.org
Cc: kuba@kernel.org, razor@blackwall.org, sdf@google.com,
	horms@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: [PATCH bpf v3 0/8] bpf_redirect_peer fixes
Date: Tue, 14 Nov 2023 01:42:12 +0100	[thread overview]
Message-ID: <20231114004220.6495-1-daniel@iogearbox.net> (raw)

This fixes bpf_redirect_peer stats accounting for veth and netkit,
and adds tstats in the first place for the latter. Utilise indirect
call wrapper for bpf_redirect_peer, and improve test coverage of the
latter also for netkit devices. Details in the patches, thanks!

The series was targeted at bpf originally, and is done here as well,
so it can trigger BPF CI. Jakub, if you think directly going via net
is better since the majority of the diff touches net anyway, that is
fine, too.

Thanks!

v2 -> v3:
  - Add kdoc for pcpu_stat_type (Simon)
  - Reject invalid type value in netdev_do_alloc_pcpu_stats (Simon)
  - Add Reviewed-by tags from list
v1 -> v2:
  - Move stats allocation/freeing into net core (Jakub)
  - As prepwork for the above, move vrf's dstats over into the core
  - Add a check into stats alloc to enforce tstats upon
    implementing ndo_get_peer_dev
  - Add Acked-by tags from list

Daniel Borkmann (6):
  net, vrf: Move dstats structure to core
  net: Move {l,t,d}stats allocation to core and convert veth & vrf
  netkit: Add tstats per-CPU traffic counters
  bpf, netkit: Add indirect call wrapper for fetching peer dev
  selftests/bpf: De-veth-ize the tc_redirect test case
  selftests/bpf: Add netkit to tc_redirect selftest

Peilin Ye (2):
  veth: Use tstats per-CPU traffic counters
  bpf: Fix dev's rx stats for bpf_redirect_peer traffic

 drivers/net/netkit.c                          |  22 +-
 drivers/net/veth.c                            |  44 +--
 drivers/net/vrf.c                             |  38 +--
 include/linux/netdevice.h                     |  30 +-
 include/net/netkit.h                          |   6 +
 net/core/dev.c                                |  57 +++-
 net/core/filter.c                             |  19 +-
 .../selftests/bpf/prog_tests/tc_redirect.c    | 317 +++++++++++-------
 8 files changed, 334 insertions(+), 199 deletions(-)

-- 
2.34.1


             reply	other threads:[~2023-11-14  0:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14  0:42 Daniel Borkmann [this message]
2023-11-14  0:42 ` [PATCH bpf v3 1/8] net, vrf: Move dstats structure to core Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 2/8] net: Move {l,t,d}stats allocation to core and convert veth & vrf Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 3/8] netkit: Add tstats per-CPU traffic counters Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 4/8] veth: Use " Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 5/8] bpf: Fix dev's rx stats for bpf_redirect_peer traffic Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 6/8] bpf, netkit: Add indirect call wrapper for fetching peer dev Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 7/8] selftests/bpf: De-veth-ize the tc_redirect test case Daniel Borkmann
2023-11-14  0:42 ` [PATCH bpf v3 8/8] selftests/bpf: Add netkit to tc_redirect selftest Daniel Borkmann
2023-11-15  9:25 ` [PATCH bpf v3 0/8] bpf_redirect_peer fixes Simon Horman
2023-11-18  0:00 ` Martin KaFai Lau
2023-11-20 18:40 ` patchwork-bot+netdevbpf

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=20231114004220.6495-1-daniel@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=sdf@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox