Skip to content

Commit 89c482a

Browse files
bpf: Sync with latest libbpf repo (#5156)
The sync'ed top libbpf commit: c5f22aca0f3a ci: remove llvm-17 variant of the workflow Signed-off-by: Yonghong Song <[email protected]>
1 parent 9713b91 commit 89c482a

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

src/cc/compat/linux/virtual_bpf.h

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,11 +1117,15 @@ enum bpf_attach_type {
11171117
BPF_NETKIT_PRIMARY,
11181118
BPF_NETKIT_PEER,
11191119
BPF_TRACE_KPROBE_SESSION,
1120+
BPF_TRACE_UPROBE_SESSION,
11201121
__MAX_BPF_ATTACH_TYPE
11211122
};
11221123

11231124
#define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE
11241125

1126+
/* Add BPF_LINK_TYPE(type, name) in bpf_types.h to keep bpf_link_type_strs[]
1127+
* in sync with the definitions below.
1128+
*/
11251129
enum bpf_link_type {
11261130
BPF_LINK_TYPE_UNSPEC = 0,
11271131
BPF_LINK_TYPE_RAW_TRACEPOINT = 1,
@@ -1426,6 +1430,8 @@ enum {
14261430
#define BPF_F_TEST_RUN_ON_CPU (1U << 0)
14271431
/* If set, XDP frames will be transmitted after processing */
14281432
#define BPF_F_TEST_XDP_LIVE_FRAMES (1U << 1)
1433+
/* If set, apply CHECKSUM_COMPLETE to skb and validate the checksum */
1434+
#define BPF_F_TEST_SKB_CHECKSUM_COMPLETE (1U << 2)
14291435

14301436
/* type for BPF_ENABLE_STATS */
14311437
enum bpf_stats_type {
@@ -1969,6 +1975,8 @@ union bpf_attr {
19691975
* program.
19701976
* Return
19711977
* The SMP id of the processor running the program.
1978+
* Attributes
1979+
* __bpf_fastcall
19721980
*
19731981
* long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
19741982
* Description
@@ -2850,7 +2858,7 @@ union bpf_attr {
28502858
* **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**,
28512859
* **TCP_NODELAY**, **TCP_MAXSEG**, **TCP_WINDOW_CLAMP**,
28522860
* **TCP_THIN_LINEAR_TIMEOUTS**, **TCP_BPF_DELACK_MAX**,
2853-
* **TCP_BPF_RTO_MIN**.
2861+
* **TCP_BPF_RTO_MIN**, **TCP_BPF_SOCK_OPS_CB_FLAGS**.
28542862
* * **IPPROTO_IP**, which supports *optname* **IP_TOS**.
28552863
* * **IPPROTO_IPV6**, which supports the following *optname*\ s:
28562864
* **IPV6_TCLASS**, **IPV6_AUTOFLOWLABEL**.
@@ -3100,10 +3108,6 @@ union bpf_attr {
31003108
* with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration
31013109
* option, and in this case it only works on functions tagged with
31023110
* **ALLOW_ERROR_INJECTION** in the kernel code.
3103-
*
3104-
* Also, the helper is only available for the architectures having
3105-
* the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing,
3106-
* x86 architecture is the only one to support this feature.
31073111
* Return
31083112
* 0
31093113
*
@@ -5368,7 +5372,7 @@ union bpf_attr {
53685372
* Currently, the **flags** must be 0. Currently, nr_loops is
53695373
* limited to 1 << 23 (~8 million) loops.
53705374
*
5371-
* long (\*callback_fn)(u32 index, void \*ctx);
5375+
* long (\*callback_fn)(u64 index, void \*ctx);
53725376
*
53735377
* where **index** is the current index in the loop. The index
53745378
* is zero-indexed.
@@ -5518,11 +5522,12 @@ union bpf_attr {
55185522
* **-EOPNOTSUPP** if the hash calculation failed or **-EINVAL** if
55195523
* invalid arguments are passed.
55205524
*
5521-
* void *bpf_kptr_xchg(void *map_value, void *ptr)
5525+
* void *bpf_kptr_xchg(void *dst, void *ptr)
55225526
* Description
5523-
* Exchange kptr at pointer *map_value* with *ptr*, and return the
5524-
* old value. *ptr* can be NULL, otherwise it must be a referenced
5525-
* pointer which will be released when this helper is called.
5527+
* Exchange kptr at pointer *dst* with *ptr*, and return the old value.
5528+
* *dst* can be map value or local kptr. *ptr* can be NULL, otherwise
5529+
* it must be a referenced pointer which will be released when this helper
5530+
* is called.
55265531
* Return
55275532
* The old value of kptr (which can be NULL). The returned pointer
55285533
* if not NULL, is a reference which must be released using its
@@ -6045,11 +6050,6 @@ enum {
60456050
BPF_F_MARK_ENFORCE = (1ULL << 6),
60466051
};
60476052

6048-
/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
6049-
enum {
6050-
BPF_F_INGRESS = (1ULL << 0),
6051-
};
6052-
60536053
/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
60546054
enum {
60556055
BPF_F_TUNINFO_IPV6 = (1ULL << 0),
@@ -6196,10 +6196,12 @@ enum {
61966196
BPF_F_BPRM_SECUREEXEC = (1ULL << 0),
61976197
};
61986198

6199-
/* Flags for bpf_redirect_map helper */
6199+
/* Flags for bpf_redirect and bpf_redirect_map helpers */
62006200
enum {
6201-
BPF_F_BROADCAST = (1ULL << 3),
6202-
BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
6201+
BPF_F_INGRESS = (1ULL << 0), /* used for skb path */
6202+
BPF_F_BROADCAST = (1ULL << 3), /* used for XDP path */
6203+
BPF_F_EXCLUDE_INGRESS = (1ULL << 4), /* used for XDP path */
6204+
#define BPF_F_REDIRECT_FLAGS (BPF_F_INGRESS | BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS)
62036205
};
62046206

62056207
#define __bpf_md_ptr(type, name) \
@@ -7079,6 +7081,7 @@ enum {
70797081
TCP_BPF_SYN = 1005, /* Copy the TCP header */
70807082
TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70817083
TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
7084+
TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
70827085
};
70837086

70847087
enum {
@@ -7511,5 +7514,14 @@ struct bpf_iter_num {
75117514
__u64 __opaque[1];
75127515
} __attribute__((aligned(8)));
75137516

7517+
/*
7518+
* Flags to control BPF kfunc behaviour.
7519+
* - BPF_F_PAD_ZEROS: Pad destination buffer with zeros. (See the respective
7520+
* helper documentation for details.)
7521+
*/
7522+
enum bpf_kfunc_flags {
7523+
BPF_F_PAD_ZEROS = (1ULL << 0),
7524+
};
7525+
75147526
#endif /* _UAPI__LINUX_BPF_H__ */
75157527
)********"

src/cc/libbpf

Submodule libbpf updated 60 files

0 commit comments

Comments
 (0)