Commit f7578df9 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Daniel Borkmann says:

====================
pull-request: bpf 2024-07-25

We've added 14 non-merge commits during the last 8 day(s) which contain
a total of 19 files changed, 177 insertions(+), 70 deletions(-).

The main changes are:

1) Fix af_unix to disable MSG_OOB handling for sockets in BPF sockmap and
   BPF sockhash. Also add test coverage for this case, from Michal Luczaj.

2) Fix a segmentation issue when downgrading gso_size in the BPF helper
   bpf_skb_adjust_room(), from Fred Li.

3) Fix a compiler warning in resolve_btfids due to a missing type cast,
   from Liwei Song.

4) Fix stack allocation for arm64 to align the stack pointer at a 16 byte
   boundary in the fexit_sleep BPF selftest, from Puranjay Mohan.

5) Fix a xsk regression to require a flag when actuating tx_metadata_len,
   from Stanislav Fomichev.

6) Fix function prototype BTF dumping in libbpf for prototypes that have
   no input arguments, from Andrii Nakryiko.

7) Fix stacktrace symbol resolution in perf script for BPF programs
   containing subprograms, from Hou Tao.

* tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
  selftests/bpf: Add XDP_UMEM_TX_METADATA_LEN to XSK TX metadata test
  xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len
  bpf: Fix a segment issue when downgrading gso_size
  tools/resolve_btfids: Fix comparison of distinct pointer types warning in resolve_btfids
  bpf, events: Use prog to emit ksymbol event for main program
  selftests/bpf: Test sockmap redirect for AF_UNIX MSG_OOB
  selftests/bpf: Parametrize AF_UNIX redir functions to accept send() flags
  selftests/bpf: Support SOCK_STREAM in unix_inet_redir_to_connected()
  af_unix: Disable MSG_OOB handling for sockets in sockmap/sockhash
  bpftool: Fix typo in usage help
  libbpf: Fix no-args func prototype BTF dumping syntax
  MAINTAINERS: Update powerpc BPF JIT maintainers
  MAINTAINERS: Update email address of Naveen
  selftests/bpf: fexit_sleep: Fix stack allocation for arm64
====================

Link: https://patch.msgid.link/20240725114312.32197-1-daniel@iogearbox.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c1668292 9b9969c4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -474,6 +474,8 @@ Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy
Naoya Horiguchi <nao.horiguchi@gmail.com> <n-horiguchi@ah.jp.nec.com>
Naoya Horiguchi <nao.horiguchi@gmail.com> <naoya.horiguchi@nec.com>
Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com>
Naveen N Rao <naveen@kernel.org> <naveen.n.rao@linux.ibm.com>
Naveen N Rao <naveen@kernel.org> <naveen.n.rao@linux.vnet.ibm.com>
Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <quic_neeraju@quicinc.com>
Neeraj Upadhyay <neeraj.upadhyay@kernel.org> <neeraju@codeaurora.org>
Neil Armstrong <neil.armstrong@linaro.org> <narmstrong@baylibre.com>
+10 −6
Original line number Diff line number Diff line
@@ -11,12 +11,16 @@ metadata on the receive side.
General Design
==============

The headroom for the metadata is reserved via ``tx_metadata_len`` in
``struct xdp_umem_reg``. The metadata length is therefore the same for
every socket that shares the same umem. The metadata layout is a fixed UAPI,
refer to ``union xsk_tx_metadata`` in ``include/uapi/linux/if_xdp.h``.
Thus, generally, the ``tx_metadata_len`` field above should contain
``sizeof(union xsk_tx_metadata)``.
The headroom for the metadata is reserved via ``tx_metadata_len`` and
``XDP_UMEM_TX_METADATA_LEN`` flag in ``struct xdp_umem_reg``. The metadata
length is therefore the same for every socket that shares the same umem.
The metadata layout is a fixed UAPI, refer to ``union xsk_tx_metadata`` in
``include/uapi/linux/if_xdp.h``. Thus, generally, the ``tx_metadata_len``
field above should contain ``sizeof(union xsk_tx_metadata)``.

Note that in the original implementation the ``XDP_UMEM_TX_METADATA_LEN``
flag was not required. Applications might attempt to create a umem
with a flag first and if it fails, do another attempt without a flag.

The headroom and the metadata itself should be located right before
``xdp_desc->addr`` in the umem frame. Within a frame, the metadata
+5 −3
Original line number Diff line number Diff line
@@ -3946,8 +3946,10 @@ S: Odd Fixes
F:	drivers/net/ethernet/netronome/nfp/bpf/
BPF JIT for POWERPC (32-BIT AND 64-BIT)
M:	Naveen N. Rao <naveen.n.rao@linux.ibm.com>
M:	Michael Ellerman <mpe@ellerman.id.au>
M:	Hari Bathini <hbathini@linux.ibm.com>
M:	Christophe Leroy <christophe.leroy@csgroup.eu>
R:	Naveen N Rao <naveen@kernel.org>
L:	bpf@vger.kernel.org
S:	Supported
F:	arch/powerpc/net/
@@ -12484,7 +12486,7 @@ F: mm/kmsan/
F:	scripts/Makefile.kmsan
KPROBES
M:	Naveen N. Rao <naveen.n.rao@linux.ibm.com>
M:	Naveen N Rao <naveen@kernel.org>
M:	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
M:	"David S. Miller" <davem@davemloft.net>
M:	Masami Hiramatsu <mhiramat@kernel.org>
@@ -12861,7 +12863,7 @@ LINUX FOR POWERPC (32-BIT AND 64-BIT)
M:	Michael Ellerman <mpe@ellerman.id.au>
R:	Nicholas Piggin <npiggin@gmail.com>
R:	Christophe Leroy <christophe.leroy@csgroup.eu>
R:	Naveen N. Rao <naveen.n.rao@linux.ibm.com>
R:	Naveen N Rao <naveen@kernel.org>
L:	linuxppc-dev@lists.ozlabs.org
S:	Supported
W:	https://github.com/linuxppc/wiki/wiki
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@
 */
#define XDP_UMEM_TX_SW_CSUM		(1 << 1)

/* Request to reserve tx_metadata_len bytes of per-chunk metadata.
 */
#define XDP_UMEM_TX_METADATA_LEN	(1 << 2)

struct sockaddr_xdp {
	__u16 sxdp_family;
	__u16 sxdp_flags;
+13 −15
Original line number Diff line number Diff line
@@ -9327,13 +9327,12 @@ static void perf_event_bpf_emit_ksymbols(struct bpf_prog *prog,
	bool unregister = type == PERF_BPF_EVENT_PROG_UNLOAD;
	int i;

	if (prog->aux->func_cnt == 0) {
	perf_event_ksymbol(PERF_RECORD_KSYMBOL_TYPE_BPF,
			   (u64)(unsigned long)prog->bpf_func,
			   prog->jited_len, unregister,
			   prog->aux->ksym.name);
	} else {
		for (i = 0; i < prog->aux->func_cnt; i++) {

	for (i = 1; i < prog->aux->func_cnt; i++) {
		struct bpf_prog *subprog = prog->aux->func[i];

		perf_event_ksymbol(
@@ -9343,7 +9342,6 @@ static void perf_event_bpf_emit_ksymbols(struct bpf_prog *prog,
			subprog->aux->ksym.name);
	}
}
}

void perf_event_bpf_event(struct bpf_prog *prog,
			  enum perf_bpf_event_type type,
Loading