Commit 1f25c9bb authored by David S. Miller's avatar David S. Miller
Browse files


Alexei Starovoitov says:

====================
pull-request: bpf 2020-09-29

The following pull-request contains BPF updates for your *net* tree.

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

The main changes are:

1) fix xdp loading regression in libbpf for old kernels, from Andrii.

2) Do not discard packet when NETDEV_TX_BUSY, from Magnus.

3) Fix corner cases in libbpf related to endianness and kconfig, from Tony.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2b3e981a 9cf51446
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -475,7 +475,6 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
		case BPF_JMP | BPF_JSET | BPF_K:
		case BPF_JMP | BPF_JSET | BPF_X:
			true_cond = COND_NE;
			fallthrough;
		cond_branch:
			/* same targets, can avoid doing the test :) */
			if (filter[i].jt == filter[i].jf) {
+1 −1
Original line number Diff line number Diff line
@@ -661,7 +661,7 @@
#define BTF								\
	.BTF : AT(ADDR(.BTF) - LOAD_OFFSET) {				\
		__start_BTF = .;					\
		*(.BTF)							\
		KEEP(*(.BTF))						\
		__stop_BTF = .;						\
	}								\
	. = ALIGN(4);							\
+3 −3
Original line number Diff line number Diff line
@@ -30,15 +30,15 @@ static struct kobject *btf_kobj;

static int __init btf_vmlinux_init(void)
{
	if (!__start_BTF)
	bin_attr_btf_vmlinux.size = __stop_BTF - __start_BTF;

	if (!__start_BTF || bin_attr_btf_vmlinux.size == 0)
		return 0;

	btf_kobj = kobject_create_and_add("btf", kernel_kobj);
	if (!btf_kobj)
		return -ENOMEM;

	bin_attr_btf_vmlinux.size = __stop_BTF - __start_BTF;

	return sysfs_create_bin_file(btf_kobj, &bin_attr_btf_vmlinux);
}

+16 −1
Original line number Diff line number Diff line
@@ -377,15 +377,30 @@ static int xsk_generic_xmit(struct sock *sk)
		skb_shinfo(skb)->destructor_arg = (void *)(long)desc.addr;
		skb->destructor = xsk_destruct_skb;

		/* Hinder dev_direct_xmit from freeing the packet and
		 * therefore completing it in the destructor
		 */
		refcount_inc(&skb->users);
		err = dev_direct_xmit(skb, xs->queue_id);
		if  (err == NETDEV_TX_BUSY) {
			/* Tell user-space to retry the send */
			skb->destructor = sock_wfree;
			/* Free skb without triggering the perf drop trace */
			consume_skb(skb);
			err = -EAGAIN;
			goto out;
		}

		xskq_cons_release(xs->tx);
		/* Ignore NET_XMIT_CN as packet might have been sent */
		if (err == NET_XMIT_DROP || err == NETDEV_TX_BUSY) {
		if (err == NET_XMIT_DROP) {
			/* SKB completed but not sent */
			kfree_skb(skb);
			err = -EBUSY;
			goto out;
		}

		consume_skb(skb);
		sent_frame = true;
	}

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ endif

LIBBPF = $(LIBBPF_PATH)libbpf.a

BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
BPFTOOL_VERSION ?= $(shell make -rR --no-print-directory -sC ../../.. kernelversion)

$(LIBBPF): FORCE
	$(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
Loading