History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Daniel Borkmann says: ==================== The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Add the ability to use unaligned chunks in the AF_XDP umem. By relaxing where the chunks can be placed, it allows to use an arbitrary buffer size and place whenever there is a free address in the umem. Helps more seamless DPDK AF_XDP driver integration. Support for i40e, ixgbe and mlx5e, from Kevin and Maxim. 2) Addition of a wakeup flag for AF_XDP tx and fill rings so the application can wake up the kernel for rx/tx processing which avoids busy-spinning of the latter, useful when app and driver is located on the same core. Support for i40e, ixgbe and mlx5e, from Magnus and Maxim. 3) bpftool fixes for printf()-like functions so compiler can actually enforce checks, bpftool build system improvements for custom output directories, and addition of 'bpftool map freeze' command, from Quentin. 4) Support attaching/detaching XDP programs from 'bpftool net' command, from Daniel. 5) Automatic xskmap cleanup when AF_XDP socket is released, and several barrier/{read,write}_once fixes in AF_XDP code, from Björn. 6) Relicense of bpf_helpers.h/bpf_endian.h for future libbpf inclusion as well as libbpf versioning improvements, from Andrii. 7) Several new BPF kselftests for verifier precision tracking, from Alexei. 8) Several BPF kselftest fixes wrt endianess to run on s390x, from Ilya. 9) And more BPF kselftest improvements all over the place, from Stanislav. 10) Add simple BPF map op cache for nfp driver to batch dumps, from Jakub. 11) AF_XDP socket umem mapping improvements for 32bit archs, from Ivan. 12) Add BPF-to-BPF call and BTF line info support for s390x JIT, from Yauheni. 13) Small optimization in arm64 JIT to spare 1 insns for BPF_MOD, from Jerin. 14) Fix an error check in bpf_tcp_gen_syncookie() helper, from Petar. 15) Various minor fixes and cleanups, from Nathan, Masahiro, Masanari, Peter, Wei, Yue. ====================

David S. Miller committed 7 years ago

Commit 1e46c092 parents f9bcfe2 593f191124 files · +3489 −698Browse files

Showing the changes to include/linux (4 of 124 files). Show all

Unified · Split

4 files
  1. include/linux/bpf.h +5 −0
  2. include/linux/bpf_verifier.h +1 −0
  3. include/linux/netdevice.h +12 −2
  4. include/linux/tnum.h +6 −0
include/linux/bpf.h+5−0
@@ -24,6 +24,9 @@ struct seq_file; · 23 unmodified lines
2424 struct btf;
2525 struct btf_type;
2626
27+extern struct idr btf_idr;
28+extern spinlock_t btf_idr_lock;
29+
2730 /* map is generic key/value storage optionally accesible by eBPF programs */
2831 struct bpf_map_ops {
2932 /* funcs callable from userspace (via syscall) */
@@ -647,6 +650,8 @@ void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock); · 617 unmodified lines
647650 struct bpf_map *bpf_map_get_with_uref(u32 ufd);
648651 struct bpf_map *__bpf_map_get(struct fd f);
649652 struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref);
653+struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map,
654+ bool uref);
650655 void bpf_map_put_with_uref(struct bpf_map *map);
651656 void bpf_map_put(struct bpf_map *map);
652657 int bpf_map_charge_memlock(struct bpf_map *map, u32 pages);
include/linux/bpf_verifier.h+1−0
@@ -355,6 +355,7 @@ struct bpf_verifier_env { · 354 unmodified lines
355355 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */
356356 int stack_size; /* number of states to be processed */
357357 bool strict_alignment; /* perform strict pointer alignment checks */
358+ bool test_state_freq; /* test verifier with different pruning frequency */
358359 struct bpf_verifier_state *cur_state; /* current verifier state */
359360 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */
360361 struct bpf_verifier_state_list *free_list;
include/linux/netdevice.h+12−2
@@ -901,6 +901,10 @@ struct netdev_bpf { · 900 unmodified lines
901901 };
902902 };
903903
904+/* Flags for ndo_xsk_wakeup. */
905+#define XDP_WAKEUP_RX (1 << 0)
906+#define XDP_WAKEUP_TX (1 << 1)
907+
904908 #ifdef CONFIG_XFRM_OFFLOAD
905909 struct xfrmdev_ops {
906910 int (*xdo_dev_state_add) (struct xfrm_state *x);
@@ -1227,6 +1231,12 @@ struct tlsdev_ops; · 320 unmodified lines
12271231 * that got dropped are freed/returned via xdp_return_frame().
12281232 * Returns negative number, means general error invoking ndo, meaning
12291233 * no frames were xmit'ed and core-caller will free all frames.
1234+ * int (*ndo_xsk_wakeup)(struct net_device *dev, u32 queue_id, u32 flags);
1235+ * This function is used to wake up the softirq, ksoftirqd or kthread
1236+ * responsible for sending and/or receiving packets on a specific
1237+ * queue id bound to an AF_XDP socket. The flags field specifies if
1238+ * only RX, only Tx, or both should be woken up using the flags
1239+ * XDP_WAKEUP_RX and XDP_WAKEUP_TX.
12301240 * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
12311241 * Get devlink port instance associated with a given netdev.
12321242 * Called with a reference on the netdevice and devlink locks only,
@@ -1426,8 +1436,8 @@ struct net_device_ops { · 193 unmodified lines
14261436 int (*ndo_xdp_xmit)(struct net_device *dev, int n,
14271437 struct xdp_frame **xdp,
14281438 u32 flags);
1429− int (*ndo_xsk_async_xmit)(struct net_device *dev,
1430− u32 queue_id);
1439+ int (*ndo_xsk_wakeup)(struct net_device *dev,
1440+ u32 queue_id, u32 flags);
14311441 struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
14321442 };
14331443
include/linux/tnum.h+6−0
@@ -5,6 +5,10 @@ · 4 unmodified lines
55 * propagate the unknown bits such that the tnum result represents all the
66 * possible results for possible values of the operands.
77 */
8+
9+#ifndef _LINUX_TNUM_H
10+#define _LINUX_TNUM_H
11+
812 #include <linux/types.h>
913
1014 struct tnum {
@@ -81,3 +85,5 @@ bool tnum_in(struct tnum a, struct tnum b); · 70 unmodified lines
8185 int tnum_strn(char *str, size_t size, struct tnum a);
8286 /* Format a tnum as tristate binary expansion */
8387 int tnum_sbin(char *str, size_t size, struct tnum a);
88+
89+#endif /* _LINUX_TNUM_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t