Skip to content

Commit 8435b1a

Browse files
authored
Merge branch 'main' into update-github-workflow
2 parents 5b21d29 + 4a0b800 commit 8435b1a

24 files changed

+130
-77
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
os: [ubuntu-22.04, ubuntu-24.04]
24+
os: [ubuntu-22.04]
2525
runs-on: ${{ matrix.os }}
2626
env:
2727
FEATURES: .llvm and .skeletons

BPF-CHECKPOINT-COMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
319fc77f8f45a1b3dba15b0cc1a869778fd222f7
1+
b4432656b36e5cc1d50a1f2dc15357543add530e

CHECKPOINT-COMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
239860828f8660e2be487e2fbdae2640cce3fd67
1+
9325d53fe9adff354b6a93fda5f38c165947da0f

docs/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ INSTALL ?= install
55
RM ?= rm -f
66
RMDIR ?= rmdir --ignore-fail-on-non-empty
77

8-
ifeq ($(V),1)
9-
Q =
10-
else
11-
Q = @
12-
endif
13-
148
prefix ?= /usr/local
159
mandir ?= $(prefix)/man
1610
man8dir = $(mandir)/man8

include/uapi/linux/bpf.h

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

54+
#define BPF_LOAD_ACQ 0x100 /* load-acquire */
55+
#define BPF_STORE_REL 0x110 /* store-release */
56+
5457
enum bpf_cond_pseudo_jmp {
5558
BPF_MAY_GOTO = 0,
5659
};
@@ -1207,6 +1210,7 @@ enum bpf_perf_event_type {
12071210
#define BPF_F_BEFORE (1U << 3)
12081211
#define BPF_F_AFTER (1U << 4)
12091212
#define BPF_F_ID (1U << 5)
1213+
#define BPF_F_PREORDER (1U << 6)
12101214
#define BPF_F_LINK BPF_F_LINK /* 1 << 13 */
12111215

12121216
/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
@@ -1502,7 +1506,7 @@ union bpf_attr {
15021506
__s32 map_token_fd;
15031507
};
15041508

1505-
struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
1509+
struct { /* anonymous struct used by BPF_MAP_*_ELEM and BPF_MAP_FREEZE commands */
15061510
__u32 map_fd;
15071511
__aligned_u64 key;
15081512
union {
@@ -1648,6 +1652,7 @@ union bpf_attr {
16481652
};
16491653
__u32 next_id;
16501654
__u32 open_flags;
1655+
__s32 fd_by_id_token_fd;
16511656
};
16521657

16531658
struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
@@ -1990,11 +1995,15 @@ union bpf_attr {
19901995
* long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
19911996
* Description
19921997
* Store *len* bytes from address *from* into the packet
1993-
* associated to *skb*, at *offset*. *flags* are a combination of
1994-
* **BPF_F_RECOMPUTE_CSUM** (automatically recompute the
1995-
* checksum for the packet after storing the bytes) and
1996-
* **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
1997-
* **->swhash** and *skb*\ **->l4hash** to 0).
1998+
* associated to *skb*, at *offset*. The *flags* are a combination
1999+
* of the following values:
2000+
*
2001+
* **BPF_F_RECOMPUTE_CSUM**
2002+
* Automatically update *skb*\ **->csum** after storing the
2003+
* bytes.
2004+
* **BPF_F_INVALIDATE_HASH**
2005+
* Set *skb*\ **->hash**, *skb*\ **->swhash** and *skb*\
2006+
* **->l4hash** to 0.
19982007
*
19992008
* A call to this helper is susceptible to change the underlying
20002009
* packet buffer. Therefore, at load time, all checks on pointers
@@ -2046,7 +2055,7 @@ union bpf_attr {
20462055
* untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and
20472056
* for updates resulting in a null checksum the value is set to
20482057
* **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates
2049-
* the checksum is to be computed against a pseudo-header.
2058+
* that the modified header field is part of the pseudo-header.
20502059
*
20512060
* This helper works in combination with **bpf_csum_diff**\ (),
20522061
* which does not update the checksum in-place, but offers more
@@ -6715,6 +6724,7 @@ struct bpf_link_info {
67156724
__u32 name_len;
67166725
__u32 offset; /* offset from file_name */
67176726
__u64 cookie;
6727+
__u64 ref_ctr_offset;
67186728
} uprobe; /* BPF_PERF_EVENT_UPROBE, BPF_PERF_EVENT_URETPROBE */
67196729
struct {
67206730
__aligned_u64 func_name; /* in/out */
@@ -6916,6 +6926,12 @@ enum {
69166926
BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
69176927
};
69186928

6929+
enum {
6930+
SK_BPF_CB_TX_TIMESTAMPING = 1<<0,
6931+
SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
6932+
SK_BPF_CB_TX_TIMESTAMPING
6933+
};
6934+
69196935
/* List of known BPF sock_ops operators.
69206936
* New entries can only be added at the end
69216937
*/
@@ -7028,6 +7044,29 @@ enum {
70287044
* by the kernel or the
70297045
* earlier bpf-progs.
70307046
*/
7047+
BPF_SOCK_OPS_TSTAMP_SCHED_CB, /* Called when skb is passing
7048+
* through dev layer when
7049+
* SK_BPF_CB_TX_TIMESTAMPING
7050+
* feature is on.
7051+
*/
7052+
BPF_SOCK_OPS_TSTAMP_SND_SW_CB, /* Called when skb is about to send
7053+
* to the nic when SK_BPF_CB_TX_TIMESTAMPING
7054+
* feature is on.
7055+
*/
7056+
BPF_SOCK_OPS_TSTAMP_SND_HW_CB, /* Called in hardware phase when
7057+
* SK_BPF_CB_TX_TIMESTAMPING feature
7058+
* is on.
7059+
*/
7060+
BPF_SOCK_OPS_TSTAMP_ACK_CB, /* Called when all the skbs in the
7061+
* same sendmsg call are acked
7062+
* when SK_BPF_CB_TX_TIMESTAMPING
7063+
* feature is on.
7064+
*/
7065+
BPF_SOCK_OPS_TSTAMP_SENDMSG_CB, /* Called when every sendmsg syscall
7066+
* is triggered. It's used to correlate
7067+
* sendmsg timestamp with corresponding
7068+
* tskey.
7069+
*/
70317070
};
70327071

70337072
/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
@@ -7094,6 +7133,7 @@ enum {
70947133
TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
70957134
TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
70967135
TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
7136+
SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
70977137
};
70987138

70997139
enum {

include/uapi/linux/const.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Missing asm support
3434
*
3535
* __BIT128() would not work in the asm code, as it shifts an
36-
* 'unsigned __init128' data type as direct representation of
36+
* 'unsigned __int128' data type as direct representation of
3737
* 128 bit constants is not supported in the gcc compiler, as
3838
* they get silently truncated.
3939
*

include/uapi/linux/perf_event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ enum perf_event_read_format {
385385
*
386386
* @sample_max_stack: Max number of frame pointers in a callchain,
387387
* should be < /proc/sys/kernel/perf_event_max_stack
388+
* Max number of entries of branch stack
389+
* should be < hardware limit
388390
*/
389391
struct perf_event_attr {
390392

scripts/sync-kernel-expected-diff.patch

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
libbpf
2222
--- src/Makefile
2323
+++ src/Makefile
24-
@@ -1,10 +1,8 @@
24+
@@ -1,13 +1,11 @@
2525
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2626
-include ../../scripts/Makefile.include
2727
+include Makefile.include
@@ -32,17 +32,12 @@
3232
-srctree := $(patsubst %/,%,$(dir $(srctree)))
3333
endif
3434

35-
ifeq ($(V),1)
36-
@@ -13,7 +11,7 @@
37-
Q = @
38-
endif
39-
4035
-BPF_DIR = $(srctree)/tools/lib/bpf
4136
+BPF_DIR = $(srctree)/libbpf/src
4237

4338
ifneq ($(OUTPUT),)
4439
_OUTPUT := $(OUTPUT)
45-
@@ -43,16 +41,16 @@
40+
@@ -37,16 +35,16 @@
4641
$(QUIET_MKDIR)mkdir -p $@
4742

4843
$(LIBBPF): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_OUTPUT)
@@ -63,7 +58,7 @@
6358
ARCH= CROSS_COMPILE= CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" $@ install_headers
6459

6560
$(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR)
66-
@@ -76,9 +74,9 @@
61+
@@ -75,9 +73,9 @@
6762
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
6863
-I$(or $(OUTPUT),.) \
6964
-I$(LIBBPF_INCLUDE) \
@@ -89,7 +84,7 @@
8984
endif
9085

9186
LIBS = $(LIBBPF) -lelf -lz
92-
@@ -214,7 +208,7 @@
87+
@@ -225,7 +219,7 @@
9388
$(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
9489
$(QUIET_CLANG)$(CLANG) \
9590
-I$(or $(OUTPUT),.) \
@@ -98,7 +93,7 @@
9893
-I$(LIBBPF_BOOTSTRAP_INCLUDE) \
9994
-g -O2 -Wall -fno-stack-protector \
10095
--target=bpf -c $< -o $@
101-
@@ -232,7 +226,7 @@
96+
@@ -243,7 +237,7 @@
10297

10398
CFLAGS += $(if $(BUILD_BPF_SKELS),,-DBPFTOOL_WITHOUT_SKELETONS)
10499

@@ -107,7 +102,7 @@
107102
$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD $< -o $@
108103

109104
$(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF_BOOTSTRAP)
110-
@@ -251,7 +245,7 @@
105+
@@ -262,7 +256,7 @@
111106
$(call QUIET_CLEAN, feature-detect)
112107
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
113108

@@ -116,7 +111,7 @@
116111
$(call QUIET_CLEAN, bpftool)
117112
$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
118113
$(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
119-
@@ -267,7 +261,7 @@
114+
@@ -278,7 +272,7 @@
120115

121116
install: install-bin
122117
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)
@@ -125,7 +120,7 @@
125120

126121
uninstall:
127122
$(call QUIET_UNINST, bpftool)
128-
@@ -275,16 +269,16 @@
123+
@@ -286,16 +280,16 @@
129124
$(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool
130125

131126
doc:

src/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ ifeq ($(srctree),)
55
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
66
endif
77

8-
ifeq ($(V),1)
9-
Q =
10-
else
11-
Q = @
12-
endif
13-
148
BPF_DIR = $(srctree)/libbpf/src
159

1610
ifneq ($(OUTPUT),)
@@ -69,7 +63,12 @@ prefix ?= /usr/local
6963
bash_compdir ?= /usr/share/bash-completion/completions
7064

7165
CFLAGS += -O2
72-
CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
66+
CFLAGS += -W
67+
CFLAGS += -Wall
68+
CFLAGS += -Wextra
69+
CFLAGS += -Wformat-signedness
70+
CFLAGS += -Wno-unused-parameter
71+
CFLAGS += -Wno-missing-field-initializers
7372
CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS))
7473
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
7574
-I$(or $(OUTPUT),.) \

src/Makefile.include

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ EXTRA_WARNINGS := \
4343
-Wundef \
4444
-Wwrite-strings \
4545

46+
ifeq ($(V),1)
47+
Q =
48+
else
49+
Q = @
50+
endif
51+
4652
define descend
4753
mkdir -p $(OUTPUT)$(1) && \
4854
$(MAKE) --no-print-directory -C $(1) $(2)

src/btf.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int dump_btf_type(const struct btf *btf, __u32 id,
253253
if (btf_kflag(t))
254254
printf("\n\t'%s' val=%d", name, v->val);
255255
else
256-
printf("\n\t'%s' val=%u", name, v->val);
256+
printf("\n\t'%s' val=%u", name, (__u32)v->val);
257257
}
258258
}
259259
if (json_output)
@@ -1022,7 +1022,7 @@ static int do_dump(int argc, char **argv)
10221022
for (i = 0; i < root_type_cnt; i++) {
10231023
if (root_type_ids[i] == root_id) {
10241024
err = -EINVAL;
1025-
p_err("duplicate root_id %d supplied", root_id);
1025+
p_err("duplicate root_id %u supplied", root_id);
10261026
goto done;
10271027
}
10281028
}
@@ -1132,7 +1132,7 @@ build_btf_type_table(struct hashmap *tab, enum bpf_obj_type type,
11321132
break;
11331133
default:
11341134
err = -1;
1135-
p_err("unexpected object type: %d", type);
1135+
p_err("unexpected object type: %u", type);
11361136
goto err_free;
11371137
}
11381138
if (err) {
@@ -1155,7 +1155,7 @@ build_btf_type_table(struct hashmap *tab, enum bpf_obj_type type,
11551155
break;
11561156
default:
11571157
err = -1;
1158-
p_err("unexpected object type: %d", type);
1158+
p_err("unexpected object type: %u", type);
11591159
goto err_free;
11601160
}
11611161
if (fd < 0) {
@@ -1188,7 +1188,7 @@ build_btf_type_table(struct hashmap *tab, enum bpf_obj_type type,
11881188
break;
11891189
default:
11901190
err = -1;
1191-
p_err("unexpected object type: %d", type);
1191+
p_err("unexpected object type: %u", type);
11921192
goto err_free;
11931193
}
11941194
if (!btf_id)
@@ -1254,12 +1254,12 @@ show_btf_plain(struct bpf_btf_info *info, int fd,
12541254

12551255
n = 0;
12561256
hashmap__for_each_key_entry(btf_prog_table, entry, info->id) {
1257-
printf("%s%lu", n++ == 0 ? " prog_ids " : ",", entry->value);
1257+
printf("%s%lu", n++ == 0 ? " prog_ids " : ",", (unsigned long)entry->value);
12581258
}
12591259

12601260
n = 0;
12611261
hashmap__for_each_key_entry(btf_map_table, entry, info->id) {
1262-
printf("%s%lu", n++ == 0 ? " map_ids " : ",", entry->value);
1262+
printf("%s%lu", n++ == 0 ? " map_ids " : ",", (unsigned long)entry->value);
12631263
}
12641264

12651265
emit_obj_refs_plain(refs_table, info->id, "\n\tpids ");

src/btf_dumper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ static int __btf_dumper_type_only(const struct btf *btf, __u32 type_id,
653653
case BTF_KIND_ARRAY:
654654
array = (struct btf_array *)(t + 1);
655655
BTF_PRINT_TYPE(array->type);
656-
BTF_PRINT_ARG("[%d]", array->nelems);
656+
BTF_PRINT_ARG("[%u]", array->nelems);
657657
break;
658658
case BTF_KIND_PTR:
659659
BTF_PRINT_TYPE(t->type);

0 commit comments

Comments
 (0)