Skip to content

Commit 5043759

Browse files
Amaindexchenhengqi
authored andcommitted
Sync with latest libbpf repo
The top libbpf commit is: 4659eaafa480 sync: latest libbpf changes from kernel Signed-off-by: Lance Yang <[email protected]> Signed-off-by: Amaindex <[email protected]>
1 parent 1dcfcec commit 5043759

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

src/cc/compat/linux/virtual_bpf.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ R"********(
5252
#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
5353
#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
5454

55+
#define BPF_LOAD_ACQ 0x100 /* load-acquire */
56+
#define BPF_STORE_REL 0x110 /* store-release */
57+
5558
enum bpf_cond_pseudo_jmp {
5659
BPF_MAY_GOTO = 0,
5760
};
@@ -1208,6 +1211,7 @@ enum bpf_perf_event_type {
12081211
#define BPF_F_BEFORE (1U << 3)
12091212
#define BPF_F_AFTER (1U << 4)
12101213
#define BPF_F_ID (1U << 5)
1214+
#define BPF_F_PREORDER (1U << 6)
12111215
#define BPF_F_LINK BPF_F_LINK /* 1 << 13 */
12121216

12131217
/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
@@ -1574,6 +1578,16 @@ union bpf_attr {
15741578
* If provided, prog_flags should have BPF_F_TOKEN_FD flag set.
15751579
*/
15761580
__s32 prog_token_fd;
1581+
/* The fd_array_cnt can be used to pass the length of the
1582+
* fd_array array. In this case all the [map] file descriptors
1583+
* passed in this array will be bound to the program, even if
1584+
* the maps are not referenced directly. The functionality is
1585+
* similar to the BPF_PROG_BIND_MAP syscall, but maps can be
1586+
* used by the verifier during the program load. If provided,
1587+
* then the fd_array[0,...,fd_array_cnt-1] is expected to be
1588+
* continuous.
1589+
*/
1590+
__u32 fd_array_cnt;
15771591
};
15781592

15791593
struct { /* anonymous struct used by BPF_OBJ_* commands */
@@ -1639,6 +1653,7 @@ union bpf_attr {
16391653
};
16401654
__u32 next_id;
16411655
__u32 open_flags;
1656+
__s32 fd_by_id_token_fd;
16421657
};
16431658

16441659
struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
@@ -6904,6 +6919,12 @@ enum {
69046919
BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
69056920
};
69066921

6922+
enum {
6923+
SK_BPF_CB_TX_TIMESTAMPING = 1<<0,
6924+
SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
6925+
SK_BPF_CB_TX_TIMESTAMPING
6926+
};
6927+
69076928
/* List of known BPF sock_ops operators.
69086929
* New entries can only be added at the end
69096930
*/
@@ -7016,6 +7037,29 @@ enum {
70167037
* by the kernel or the
70177038
* earlier bpf-progs.
70187039
*/
7040+
BPF_SOCK_OPS_TSTAMP_SCHED_CB, /* Called when skb is passing
7041+
* through dev layer when
7042+
* SK_BPF_CB_TX_TIMESTAMPING
7043+
* feature is on.
7044+
*/
7045+
BPF_SOCK_OPS_TSTAMP_SND_SW_CB, /* Called when skb is about to send
7046+
* to the nic when SK_BPF_CB_TX_TIMESTAMPING
7047+
* feature is on.
7048+
*/
7049+
BPF_SOCK_OPS_TSTAMP_SND_HW_CB, /* Called in hardware phase when
7050+
* SK_BPF_CB_TX_TIMESTAMPING feature
7051+
* is on.
7052+
*/
7053+
BPF_SOCK_OPS_TSTAMP_ACK_CB, /* Called when all the skbs in the
7054+
* same sendmsg call are acked
7055+
* when SK_BPF_CB_TX_TIMESTAMPING
7056+
* feature is on.
7057+
*/
7058+
BPF_SOCK_OPS_TSTAMP_SENDMSG_CB, /* Called when every sendmsg syscall
7059+
* is triggered. It's used to correlate
7060+
* sendmsg timestamp with corresponding
7061+
* tskey.
7062+
*/
70197063
};
70207064

70217065
/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
@@ -7082,6 +7126,7 @@ enum {
70827126
TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70837127
TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
70847128
TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7129+
SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
70857130
};
70867131

70877132
enum {

0 commit comments

Comments
 (0)