History

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

Daniel Borkmann says: ==================== pull-request: bpf 2020-06-30 The following pull-request contains BPF updates for your *net* tree. We've added 28 non-merge commits during the last 9 day(s) which contain a total of 35 files changed, 486 insertions(+), 232 deletions(-). The main changes are: 1) Fix an incorrect verifier branch elimination for PTR_TO_BTF_ID pointer types, from Yonghong Song. 2) Fix UAPI for sockmap and flow_dissector progs that were ignoring various arguments passed to BPF_PROG_{ATTACH,DETACH}, from Lorenz Bauer & Jakub Sitnicki. 3) Fix broken AF_XDP DMA hacks that are poking into dma-direct and swiotlb internals and integrate it properly into DMA core, from Christoph Hellwig. 4) Fix RCU splat from recent changes to avoid skipping ingress policy when kTLS is enabled, from John Fastabend. 5) Fix BPF ringbuf map to enforce size to be the power of 2 in order for its position masking to work, from Andrii Nakryiko. 6) Fix regression from CAP_BPF work to re-allow CAP_SYS_ADMIN for loading of network programs, from Maciej Żenczykowski. 7) Fix libbpf section name prefix for devmap progs, from Jesper Dangaard Brouer. 8) Fix formatting in UAPI documentation for BPF helpers, from Quentin Monnet. ====================

David S. Miller committed 6 years ago

Commit e708e2b2 parents 0433c93 d92302135 files · +486 −232Browse files

Showing the changes to include/linux (6 of 35 files). Show all

Unified · Split

6 files
  1. include/linux/bpf-netns.h +3 −2
  2. include/linux/bpf.h +11 −2
  3. include/linux/btf.h +5 −0
  4. include/linux/dma-direct.h +1 −0
  5. include/linux/dma-mapping.h +5 −0
  6. include/linux/skmsg.h +13 −0
include/linux/bpf-netns.h+3−2
@@ -33,7 +33,7 @@ int netns_bpf_prog_query(const union bpf_attr *attr, · 32 unmodified lines
3333 union bpf_attr __user *uattr);
3434 int netns_bpf_prog_attach(const union bpf_attr *attr,
3535 struct bpf_prog *prog);
36−int netns_bpf_prog_detach(const union bpf_attr *attr);
36+int netns_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
3737 int netns_bpf_link_create(const union bpf_attr *attr,
3838 struct bpf_prog *prog);
3939 #else
@@ -49,7 +49,8 @@ static inline int netns_bpf_prog_attach(const union bpf_attr *attr, · 9 unmodified lines
4949 return -EOPNOTSUPP;
5050 }
5151
52−static inline int netns_bpf_prog_detach(const union bpf_attr *attr)
52+static inline int netns_bpf_prog_detach(const union bpf_attr *attr,
53+ enum bpf_prog_type ptype)
5354 {
5455 return -EOPNOTSUPP;
5556 }
include/linux/bpf.h+11−2
@@ -1543,13 +1543,16 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map) · 1542 unmodified lines
15431543 #endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */
15441544
15451545 #if defined(CONFIG_BPF_STREAM_PARSER)
1546−int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, u32 which);
1546+int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog,
1547+ struct bpf_prog *old, u32 which);
15471548 int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
1549+int sock_map_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype);
15481550 void sock_map_unhash(struct sock *sk);
15491551 void sock_map_close(struct sock *sk, long timeout);
15501552 #else
15511553 static inline int sock_map_prog_update(struct bpf_map *map,
1552− struct bpf_prog *prog, u32 which)
1554+ struct bpf_prog *prog,
1555+ struct bpf_prog *old, u32 which)
15531556 {
15541557 return -EOPNOTSUPP;
15551558 }
@@ -1559,6 +1562,12 @@ static inline int sock_map_get_from_fd(const union bpf_attr *attr, · 3 unmodified lines
15591562 {
15601563 return -EINVAL;
15611564 }
1565+
1566+static inline int sock_map_prog_detach(const union bpf_attr *attr,
1567+ enum bpf_prog_type ptype)
1568+{
1569+ return -EOPNOTSUPP;
1570+}
15621571 #endif /* CONFIG_BPF_STREAM_PARSER */
15631572
15641573 #if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
include/linux/btf.h+5−0
@@ -82,6 +82,11 @@ static inline bool btf_type_is_int(const struct btf_type *t) · 81 unmodified lines
8282 return BTF_INFO_KIND(t->info) == BTF_KIND_INT;
8383 }
8484
85+static inline bool btf_type_is_small_int(const struct btf_type *t)
86+{
87+ return btf_type_is_int(t) && t->size <= sizeof(u64);
88+}
89+
8590 static inline bool btf_type_is_enum(const struct btf_type *t)
8691 {
8792 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM;
include/linux/dma-direct.h+1−0
@@ -87,4 +87,5 @@ int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma, · 86 unmodified lines
8787 void *cpu_addr, dma_addr_t dma_addr, size_t size,
8888 unsigned long attrs);
8989 int dma_direct_supported(struct device *dev, u64 mask);
90+bool dma_direct_need_sync(struct device *dev, dma_addr_t dma_addr);
9091 #endif /* _LINUX_DMA_DIRECT_H */
include/linux/dma-mapping.h+5−0
@@ -461,6 +461,7 @@ int dma_set_mask(struct device *dev, u64 mask); · 460 unmodified lines
461461 int dma_set_coherent_mask(struct device *dev, u64 mask);
462462 u64 dma_get_required_mask(struct device *dev);
463463 size_t dma_max_mapping_size(struct device *dev);
464+bool dma_need_sync(struct device *dev, dma_addr_t dma_addr);
464465 unsigned long dma_get_merge_boundary(struct device *dev);
465466 #else /* CONFIG_HAS_DMA */
466467 static inline dma_addr_t dma_map_page_attrs(struct device *dev,
@@ -571,6 +572,10 @@ static inline size_t dma_max_mapping_size(struct device *dev) · 104 unmodified lines
571572 {
572573 return 0;
573574 }
575+static inline bool dma_need_sync(struct device *dev, dma_addr_t dma_addr)
576+{
577+ return false;
578+}
574579 static inline unsigned long dma_get_merge_boundary(struct device *dev)
575580 {
576581 return 0;
include/linux/skmsg.h+13−0
@@ -430,6 +430,19 @@ static inline void psock_set_prog(struct bpf_prog **pprog, · 429 unmodified lines
430430 bpf_prog_put(prog);
431431 }
432432
433+static inline int psock_replace_prog(struct bpf_prog **pprog,
434+ struct bpf_prog *prog,
435+ struct bpf_prog *old)
436+{
437+ if (cmpxchg(pprog, old, prog) != old)
438+ return -ENOENT;
439+
440+ if (old)
441+ bpf_prog_put(old);
442+
443+ return 0;
444+}
445+
433446 static inline void psock_progs_drop(struct sk_psock_progs *progs)
434447 {
435448 psock_set_prog(&progs->msg_parser, NULL);

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