Skip to content

Commit a0fe2bc

Browse files
committed
Sync with latest libbpf repo
Sync with latest libbpf repo. The top libbpf repo commit is: 1e479aec4f8d ci: don't run test_maps in libbpf CI Signed-off-by: Yonghong Song <[email protected]>
1 parent f08e686 commit a0fe2bc

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

Diff for: docs/kernel-versions.md

+2
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ Helper | Kernel version | License | Commit |
251251
`BPF_FUNC_bind()` | 4.17 | | [`d74bad4e74ee`](https://github.com/torvalds/linux/commit/d74bad4e74ee373787a9ae24197c17b7cdc428d5) |
252252
`BPF_FUNC_bprm_opts_set()` | 5.11 | | [`3f6719c7b62f`](https://github.com/torvalds/linux/commit/3f6719c7b62f0327c9091e26d0da10e65668229e)
253253
`BPF_FUNC_btf_find_by_name_kind()` | 5.14 | | [`3d78417b60fb`](https://github.com/torvalds/linux/commit/3d78417b60fba249cc555468cb72d96f5cde2964)
254+
`BPF_FUNC_cgrp_storage_delete()` | 6.2 | | [`c4bcfb38a95e`](https://github.com/torvalds/linux/commit/c4bcfb38a95edb1021a53f2d0356a78120ecfbe4)
255+
`BPF_FUNC_cgrp_storage_get()` | 6.2 | | [`c4bcfb38a95e`](https://github.com/torvalds/linux/commit/c4bcfb38a95edb1021a53f2d0356a78120ecfbe4)
254256
`BPF_FUNC_check_mtu()` | 5.12 | | [`34b2021cc616`](https://github.com/torvalds/linux/commit/34b2021cc61642d61c3cf943d9e71925b827941b)
255257
`BPF_FUNC_clone_redirect()` | 4.2 | | [`3896d655f4d4`](https://github.com/torvalds/linux/commit/3896d655f4d491c67d669a15f275a39f713410f8)
256258
`BPF_FUNC_copy_from_user()` | 5.10 | | [`07be4c4a3e7a`](https://github.com/torvalds/linux/commit/07be4c4a3e7a0db148e44b16c5190e753d1c8569)

Diff for: src/cc/compat/linux/virtual_bpf.h

+23-10
Original file line numberDiff line numberDiff line change
@@ -2585,14 +2585,19 @@ union bpf_attr {
25852585
* * **SOL_SOCKET**, which supports the following *optname*\ s:
25862586
* **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**,
25872587
* **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**,
2588-
* **SO_BINDTODEVICE**, **SO_KEEPALIVE**.
2588+
* **SO_BINDTODEVICE**, **SO_KEEPALIVE**, **SO_REUSEADDR**,
2589+
* **SO_REUSEPORT**, **SO_BINDTOIFINDEX**, **SO_TXREHASH**.
25892590
* * **IPPROTO_TCP**, which supports the following *optname*\ s:
25902591
* **TCP_CONGESTION**, **TCP_BPF_IW**,
25912592
* **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**,
25922593
* **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**,
2593-
* **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**.
2594+
* **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
2595+
* **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
2596+
* **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
2597+
* **TCP_BPF_RTO_MIN**.
25942598
* * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2595-
* * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
2599+
* * **IPPROTO_IPV6**, which supports the following *optname*\ s:
2600+
* **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
25962601
* Return
25972602
* 0 on success, or a negative error in case of failure.
25982603
*
@@ -2648,7 +2653,7 @@ union bpf_attr {
26482653
* Return
26492654
* 0 on success, or a negative error in case of failure.
26502655
*
2651-
* long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
2656+
* long bpf_redirect_map(struct bpf_map *map, u64 key, u64 flags)
26522657
* Description
26532658
* Redirect the packet to the endpoint referenced by *map* at
26542659
* index *key*. Depending on its type, this *map* can contain
@@ -2809,12 +2814,10 @@ union bpf_attr {
28092814
* and **BPF_CGROUP_INET6_CONNECT**.
28102815
*
28112816
* This helper actually implements a subset of **getsockopt()**.
2812-
* It supports the following *level*\ s:
2813-
*
2814-
* * **IPPROTO_TCP**, which supports *optname*
2815-
* **TCP_CONGESTION**.
2816-
* * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
2817-
* * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**.
2817+
* It supports the same set of *optname*\ s that is supported by
2818+
* the **bpf_setsockopt**\ () helper. The exceptions are
2819+
* **TCP_BPF_*** is **bpf_setsockopt**\ () only and
2820+
* **TCP_SAVED_SYN** is **bpf_getsockopt**\ () only.
28182821
* Return
28192822
* 0 on success, or a negative error in case of failure.
28202823
*
@@ -6889,6 +6892,16 @@ struct bpf_dynptr {
68896892
__u64 :64;
68906893
} __attribute__((aligned(8)));
68916894

6895+
struct bpf_list_head {
6896+
__u64 :64;
6897+
__u64 :64;
6898+
} __attribute__((aligned(8)));
6899+
6900+
struct bpf_list_node {
6901+
__u64 :64;
6902+
__u64 :64;
6903+
} __attribute__((aligned(8)));
6904+
68926905
struct bpf_sysctl {
68936906
__u32 write; /* Sysctl is being read (= 0) or written (= 1).
68946907
* Allows 1,2,4-byte read, but no write.

Diff for: src/cc/export/helpers.h

+6
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,12 @@ static __u64 (*bpf_ktime_get_tai_ns)(void) = (void *)BPF_FUNC_ktime_get_tai_ns;
10291029
static long (*bpf_user_ringbuf_drain)(void *map, void *callback_fn, void *ctx, __u64 flags) =
10301030
(void *)BPF_FUNC_user_ringbuf_drain;
10311031

1032+
struct cgroup;
1033+
static void *(*bpf_cgrp_storage_get)(void *map, struct cgroup *cgroup, void *value, __u64 flags) =
1034+
(void *)BPF_FUNC_cgrp_storage_get;
1035+
static long (*bpf_cgrp_storage_delete)(void *map, struct cgroup *cgroup) =
1036+
(void *)BPF_FUNC_cgrp_storage_delete;
1037+
10321038
/* llvm builtin functions that eBPF C program may use to
10331039
* emit BPF_LD_ABS and BPF_LD_IND instructions
10341040
*/

Diff for: src/cc/libbpf.c

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ static struct bpf_helper helpers[] = {
314314
{"tcp_raw_check_syncookie_ipv6", "6.0"},
315315
{"ktime_get_tai_ns", "6.1"},
316316
{"user_ringbuf_drain", "6.1"},
317+
{"cgrp_storage_get", "6.2"},
318+
{"cgrp_storage_delete", "6.2"},
317319
};
318320

319321
static uint64_t ptr_to_u64(void *ptr)

0 commit comments

Comments
 (0)