History

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

Alexei Starovoitov says: ==================== pull-request: bpf-next 2019-02-16 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) numerous libbpf API improvements, from Andrii, Andrey, Yonghong. 2) test all bpf progs in alu32 mode, from Jiong. 3) skb->sk access and bpf_sk_fullsock(), bpf_tcp_sock() helpers, from Martin. 4) support for IP encap in lwt bpf progs, from Peter. 5) remove XDP_QUERY_XSK_UMEM dead code, from Jan. ====================

David S. Miller committed 7 years ago

Commit 885e6312 parents f186a82 5aab39292 files · +2576 −485Browse files

Showing the changes to include/linux (2 of 92 files). Show all

Unified · Split

2 files
  1. include/linux/bpf.h +44 −1
  2. include/linux/netdevice.h +3 −4
include/linux/bpf.h+44−1
@@ -194,6 +194,7 @@ enum bpf_arg_type { · 193 unmodified lines
194194 ARG_ANYTHING, /* any (initialized) argument is ok */
195195 ARG_PTR_TO_SOCKET, /* pointer to bpf_sock */
196196 ARG_PTR_TO_SPIN_LOCK, /* pointer to bpf_spin_lock */
197+ ARG_PTR_TO_SOCK_COMMON, /* pointer to sock_common */
197198 };
198199
199200 /* type of values returned from helper functions */
@@ -203,6 +204,7 @@ enum bpf_return_type { · 3 unmodified lines
203204 RET_PTR_TO_MAP_VALUE, /* returns a pointer to map elem value */
204205 RET_PTR_TO_MAP_VALUE_OR_NULL, /* returns a pointer to map elem value or NULL */
205206 RET_PTR_TO_SOCKET_OR_NULL, /* returns a pointer to a socket or NULL */
207+ RET_PTR_TO_TCP_SOCK_OR_NULL, /* returns a pointer to a tcp_sock or NULL */
206208 };
207209
208210 /* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs
@@ -256,6 +258,10 @@ enum bpf_reg_type { · 47 unmodified lines
256258 PTR_TO_FLOW_KEYS, /* reg points to bpf_flow_keys */
257259 PTR_TO_SOCKET, /* reg points to struct bpf_sock */
258260 PTR_TO_SOCKET_OR_NULL, /* reg points to struct bpf_sock or NULL */
261+ PTR_TO_SOCK_COMMON, /* reg points to sock_common */
262+ PTR_TO_SOCK_COMMON_OR_NULL, /* reg points to sock_common or NULL */
263+ PTR_TO_TCP_SOCK, /* reg points to struct tcp_sock */
264+ PTR_TO_TCP_SOCK_OR_NULL, /* reg points to struct tcp_sock or NULL */
259265 };
260266
261267 /* The information passed from prog-specific *_is_valid_access
@@ -767,8 +773,9 @@ int bpf_map_offload_get_next_key(struct bpf_map *map, · 505 unmodified lines
767773 bool bpf_offload_prog_map_match(struct bpf_prog *prog, struct bpf_map *map);
768774
769775 struct bpf_offload_dev *
770−bpf_offload_dev_create(const struct bpf_prog_offload_ops *ops);
776+bpf_offload_dev_create(const struct bpf_prog_offload_ops *ops, void *priv);
771777 void bpf_offload_dev_destroy(struct bpf_offload_dev *offdev);
778+void *bpf_offload_dev_priv(struct bpf_offload_dev *offdev);
772779 int bpf_offload_dev_netdev_register(struct bpf_offload_dev *offdev,
773780 struct net_device *netdev);
774781 void bpf_offload_dev_netdev_unregister(struct bpf_offload_dev *offdev,
@@ -920,6 +927,9 @@ void bpf_user_rnd_init_once(void); · 145 unmodified lines
920927 u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);
921928
922929 #if defined(CONFIG_NET)
930+bool bpf_sock_common_is_valid_access(int off, int size,
931+ enum bpf_access_type type,
932+ struct bpf_insn_access_aux *info);
923933 bool bpf_sock_is_valid_access(int off, int size, enum bpf_access_type type,
924934 struct bpf_insn_access_aux *info);
925935 u32 bpf_sock_convert_ctx_access(enum bpf_access_type type,
@@ -928,6 +938,12 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, · 2 unmodified lines
928938 struct bpf_prog *prog,
929939 u32 *target_size);
930940 #else
941+static inline bool bpf_sock_common_is_valid_access(int off, int size,
942+ enum bpf_access_type type,
943+ struct bpf_insn_access_aux *info)
944+{
945+ return false;
946+}
931947 static inline bool bpf_sock_is_valid_access(int off, int size,
932948 enum bpf_access_type type,
933949 struct bpf_insn_access_aux *info)
@@ -944,4 +960,31 @@ static inline u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, · 10 unmodified lines
944960 }
945961 #endif
946962
963+#ifdef CONFIG_INET
964+bool bpf_tcp_sock_is_valid_access(int off, int size, enum bpf_access_type type,
965+ struct bpf_insn_access_aux *info);
966+
967+u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type,
968+ const struct bpf_insn *si,
969+ struct bpf_insn *insn_buf,
970+ struct bpf_prog *prog,
971+ u32 *target_size);
972+#else
973+static inline bool bpf_tcp_sock_is_valid_access(int off, int size,
974+ enum bpf_access_type type,
975+ struct bpf_insn_access_aux *info)
976+{
977+ return false;
978+}
979+
980+static inline u32 bpf_tcp_sock_convert_ctx_access(enum bpf_access_type type,
981+ const struct bpf_insn *si,
982+ struct bpf_insn *insn_buf,
983+ struct bpf_prog *prog,
984+ u32 *target_size)
985+{
986+ return 0;
987+}
988+#endif /* CONFIG_INET */
989+
947990 #endif /* _LINUX_BPF_H */
include/linux/netdevice.h+3−4
@@ -868,7 +868,6 @@ enum bpf_netdev_command { · 867 unmodified lines
868868 /* BPF program for offload callbacks, invoked at program load time. */
869869 BPF_OFFLOAD_MAP_ALLOC,
870870 BPF_OFFLOAD_MAP_FREE,
871− XDP_QUERY_XSK_UMEM,
872871 XDP_SETUP_XSK_UMEM,
873872 };
874873
@@ -895,10 +894,10 @@ struct netdev_bpf { · 20 unmodified lines
895894 struct {
896895 struct bpf_offloaded_map *offmap;
897896 };
898− /* XDP_QUERY_XSK_UMEM, XDP_SETUP_XSK_UMEM */
897+ /* XDP_SETUP_XSK_UMEM */
899898 struct {
900− struct xdp_umem *umem; /* out for query*/
901− u16 queue_id; /* in for query */
899+ struct xdp_umem *umem;
900+ u16 queue_id;
902901 } xsk;
903902 };
904903 };

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