Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Fix typos and grammar in test sources

Fix spelling typos and grammar errors in BPF selftests source code.

Signed-off-by: Shubham Sharma <slopixelz@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250826125746.17983-1-slopixelz@gmail.com

authored by

Shubham Sharma and committed by
Andrii Nakryiko
d3abefe8 2660b9d4

+36 -36
+1 -1
tools/testing/selftests/bpf/Makefile
··· 398 398 DESTDIR=$(HOST_SCRATCH_DIR)/ prefix= all install_headers 399 399 endif 400 400 401 - # vmlinux.h is first dumped to a temprorary file and then compared to 401 + # vmlinux.h is first dumped to a temporary file and then compared to 402 402 # the previous version. This helps to avoid unnecessary re-builds of 403 403 # $(TRUNNER_BPF_OBJS) 404 404 $(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)
+1 -1
tools/testing/selftests/bpf/bench.c
··· 499 499 extern const struct bench bench_rename_fentry; 500 500 extern const struct bench bench_rename_fexit; 501 501 502 - /* pure counting benchmarks to establish theoretical lmits */ 502 + /* pure counting benchmarks to establish theoretical limits */ 503 503 extern const struct bench bench_trig_usermode_count; 504 504 extern const struct bench bench_trig_syscall_count; 505 505 extern const struct bench bench_trig_kernel_count;
+1 -1
tools/testing/selftests/bpf/prog_tests/btf_dump.c
··· 63 63 64 64 /* tests with t->known_ptr_sz have no "long" or "unsigned long" type, 65 65 * so it's impossible to determine correct pointer size; but if they 66 - * do, it should be 8 regardless of host architecture, becaues BPF 66 + * do, it should be 8 regardless of host architecture, because BPF 67 67 * target is always 64-bit 68 68 */ 69 69 if (!t->known_ptr_sz) {
+1 -1
tools/testing/selftests/bpf/prog_tests/fd_array.c
··· 293 293 * 1) Create a new btf, it's referenced only by a file descriptor, so refcnt=1 294 294 * 2) Load a BPF prog with fd_array[0] = btf_fd; now btf's refcnt=2 295 295 * 3) Close the btf_fd, now refcnt=1 296 - * Wait and check that BTF stil exists. 296 + * Wait and check that BTF still exists. 297 297 */ 298 298 static void check_fd_array_cnt__referenced_btfs(void) 299 299 {
+1 -1
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
··· 463 463 return false; 464 464 } 465 465 466 - /* Do comparision by ignoring '.llvm.<hash>' suffixes. */ 466 + /* Do comparison by ignoring '.llvm.<hash>' suffixes. */ 467 467 static int compare_name(const char *name1, const char *name2) 468 468 { 469 469 const char *res1, *res2;
+1 -1
tools/testing/selftests/bpf/prog_tests/module_attach.c
··· 90 90 91 91 test_module_attach__detach(skel); 92 92 93 - /* attach fentry/fexit and make sure it get's module reference */ 93 + /* attach fentry/fexit and make sure it gets module reference */ 94 94 link = bpf_program__attach(skel->progs.handle_fentry); 95 95 if (!ASSERT_OK_PTR(link, "attach_fentry")) 96 96 goto cleanup;
+2 -2
tools/testing/selftests/bpf/prog_tests/reg_bounds.c
··· 623 623 *newx = range(t, x.a, x.b); 624 624 *newy = range(t, y.a + 1, y.b); 625 625 } else if (x.a == x.b && x.b == y.b) { 626 - /* X is a constant matching rigth side of Y */ 626 + /* X is a constant matching right side of Y */ 627 627 *newx = range(t, x.a, x.b); 628 628 *newy = range(t, y.a, y.b - 1); 629 629 } else if (y.a == y.b && x.a == y.a) { ··· 631 631 *newx = range(t, x.a + 1, x.b); 632 632 *newy = range(t, y.a, y.b); 633 633 } else if (y.a == y.b && x.b == y.b) { 634 - /* Y is a constant matching rigth side of X */ 634 + /* Y is a constant matching right side of X */ 635 635 *newx = range(t, x.a, x.b - 1); 636 636 *newy = range(t, y.a, y.b); 637 637 } else {
+1 -1
tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c
··· 39 39 bpf_map_update_elem(control_map_fd, &key, &val, 0); 40 40 41 41 /* for every element in stackid_hmap, we can find a corresponding one 42 - * in stackmap, and vise versa. 42 + * in stackmap, and vice versa. 43 43 */ 44 44 err = compare_map_keys(stackid_hmap_fd, stackmap_fd); 45 45 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
+1 -1
tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
··· 66 66 bpf_map_update_elem(control_map_fd, &key, &val, 0); 67 67 68 68 /* for every element in stackid_hmap, we can find a corresponding one 69 - * in stackmap, and vise versa. 69 + * in stackmap, and vice versa. 70 70 */ 71 71 err = compare_map_keys(stackid_hmap_fd, stackmap_fd); 72 72 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
+1 -1
tools/testing/selftests/bpf/prog_tests/stacktrace_map.c
··· 50 50 bpf_map_update_elem(control_map_fd, &key, &val, 0); 51 51 52 52 /* for every element in stackid_hmap, we can find a corresponding one 53 - * in stackmap, and vise versa. 53 + * in stackmap, and vice versa. 54 54 */ 55 55 err = compare_map_keys(stackid_hmap_fd, stackmap_fd); 56 56 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
+1 -1
tools/testing/selftests/bpf/prog_tests/stacktrace_map_raw_tp.c
··· 46 46 bpf_map_update_elem(control_map_fd, &key, &val, 0); 47 47 48 48 /* for every element in stackid_hmap, we can find a corresponding one 49 - * in stackmap, and vise versa. 49 + * in stackmap, and vice versa. 50 50 */ 51 51 err = compare_map_keys(stackid_hmap_fd, stackmap_fd); 52 52 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap",
+1 -1
tools/testing/selftests/bpf/prog_tests/stacktrace_map_skip.c
··· 40 40 skel->bss->control = 1; 41 41 42 42 /* for every element in stackid_hmap, we can find a corresponding one 43 - * in stackmap, and vise versa. 43 + * in stackmap, and vice versa. 44 44 */ 45 45 err = compare_map_keys(stackid_hmap_fd, stackmap_fd); 46 46 if (!ASSERT_OK(err, "compare_map_keys stackid_hmap vs. stackmap"))
+1 -1
tools/testing/selftests/bpf/progs/bpf_cc_cubic.c
··· 101 101 tp->snd_cwnd = pkts_in_flight + sndcnt; 102 102 } 103 103 104 - /* Decide wheather to run the increase function of congestion control. */ 104 + /* Decide whether to run the increase function of congestion control. */ 105 105 static bool tcp_may_raise_cwnd(const struct sock *sk, const int flag) 106 106 { 107 107 if (tcp_sk(sk)->reordering > TCP_REORDERING)
+1 -1
tools/testing/selftests/bpf/progs/bpf_dctcp.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2019 Facebook */ 3 3 4 - /* WARNING: This implemenation is not necessarily the same 4 + /* WARNING: This implementation is not necessarily the same 5 5 * as the tcp_dctcp.c. The purpose is mainly for testing 6 6 * the kernel BPF logic. 7 7 */
+1 -1
tools/testing/selftests/bpf/progs/freplace_connect_v4_prog.c
··· 12 12 SEC("freplace/connect_v4_prog") 13 13 int new_connect_v4_prog(struct bpf_sock_addr *ctx) 14 14 { 15 - // return value thats in invalid range 15 + // return value that's in invalid range 16 16 return 255; 17 17 } 18 18
+1 -1
tools/testing/selftests/bpf/progs/iters_state_safety.c
··· 345 345 "r3 = 1000;" 346 346 "call %[bpf_iter_num_new];" 347 347 348 - /* attemp to leak bpf_iter_num state */ 348 + /* attempt to leak bpf_iter_num state */ 349 349 "r7 = *(u64 *)(r6 + 0);" 350 350 "r8 = *(u64 *)(r6 + 8);" 351 351
+1 -1
tools/testing/selftests/bpf/progs/rbtree_search.c
··· 183 183 } 184 184 185 185 /* 186 - * Use a spearate MSG macro instead of passing to TEST_XXX(..., MSG) 186 + * Use a separate MSG macro instead of passing to TEST_XXX(..., MSG) 187 187 * to ensure the message itself is not in the bpf prog lineinfo 188 188 * which the verifier includes in its log. 189 189 * Otherwise, the test_loader will incorrectly match the prog lineinfo
+1 -1
tools/testing/selftests/bpf/progs/struct_ops_kptr_return.c
··· 9 9 10 10 /* This test struct_ops BPF programs returning referenced kptr. The verifier should 11 11 * allow a referenced kptr or a NULL pointer to be returned. A referenced kptr to task 12 - * here is acquried automatically as the task argument is tagged with "__ref". 12 + * here is acquired automatically as the task argument is tagged with "__ref". 13 13 */ 14 14 SEC("struct_ops/test_return_ref_kptr") 15 15 struct task_struct *BPF_PROG(kptr_return, int dummy,
+1 -1
tools/testing/selftests/bpf/progs/struct_ops_refcounted.c
··· 9 9 10 10 /* This is a test BPF program that uses struct_ops to access a referenced 11 11 * kptr argument. This is a test for the verifier to ensure that it 12 - * 1) recongnizes the task as a referenced object (i.e., ref_obj_id > 0), and 12 + * 1) recognizes the task as a referenced object (i.e., ref_obj_id > 0), and 13 13 * 2) the same reference can be acquired from multiple paths as long as it 14 14 * has not been released. 15 15 */
+1 -1
tools/testing/selftests/bpf/progs/test_cls_redirect.c
··· 129 129 typedef struct buf { 130 130 struct __sk_buff *skb; 131 131 net_ptr head; 132 - /* NB: tail musn't have alignment other than 1, otherwise 132 + /* NB: tail mustn't have alignment other than 1, otherwise 133 133 * LLVM will go and eliminate code, e.g. when checking packet lengths. 134 134 */ 135 135 uint8_t *const tail;
+1 -1
tools/testing/selftests/bpf/progs/test_cls_redirect_dynptr.c
··· 494 494 495 495 *offset += sizeof(*next_hop); 496 496 497 - /* Skip the remainig next hops (may be zero). */ 497 + /* Skip the remaining next hops (may be zero). */ 498 498 return skip_next_hops(offset, encap->unigue.hop_count - encap->unigue.next_hop - 1); 499 499 } 500 500
+2 -2
tools/testing/selftests/bpf/progs/uretprobe_stack.c
··· 26 26 SEC("uprobe//proc/self/exe:target_1") 27 27 int BPF_UPROBE(uprobe_1) 28 28 { 29 - /* target_1 is recursive wit depth of 2, so we capture two separate 30 - * stack traces, depending on which occurence it is 29 + /* target_1 is recursive with depth of 2, so we capture two separate 30 + * stack traces, depending on which occurrence it is 31 31 */ 32 32 static bool recur = false; 33 33
+1 -1
tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
··· 349 349 SEC("socket") 350 350 __success __log_level(2) 351 351 __flag(BPF_F_TEST_STATE_FREQ) 352 - /* check thar r0 and r6 have different IDs after 'if', 352 + /* check that r0 and r6 have different IDs after 'if', 353 353 * collect_linked_regs() can't tie more than 6 registers for a single insn. 354 354 */ 355 355 __msg("8: (25) if r0 > 0x7 goto pc+0 ; R0=scalar(id=1")
+3 -3
tools/testing/selftests/bpf/progs/verifier_var_off.c
··· 114 114 } 115 115 116 116 /* Similar to the previous test, but this time also perform a read from the 117 - * address written to with a variable offset. The read is allowed, showing that, 118 - * after a variable-offset write, a priviledged program can read the slots that 117 + * address written to with a variable offet. The read is allowed, showing that, 118 + * after a variable-offset write, a privileged program can read the slots that 119 119 * were in the range of that write (even if the verifier doesn't actually know if 120 120 * the slot being read was really written to or not. 121 121 * ··· 157 157 SEC("socket") 158 158 __description("variable-offset stack write clobbers spilled regs") 159 159 __failure 160 - /* In the priviledged case, dereferencing a spilled-and-then-filled 160 + /* In the privileged case, dereferencing a spilled-and-then-filled 161 161 * register is rejected because the previous variable offset stack 162 162 * write might have overwritten the spilled pointer (i.e. we lose track 163 163 * of the spilled register when we analyze the write).
+1 -1
tools/testing/selftests/bpf/test_sockmap.c
··· 1372 1372 } else 1373 1373 fprintf(stderr, "unknown test\n"); 1374 1374 out: 1375 - /* Detatch and zero all the maps */ 1375 + /* Detach and zero all the maps */ 1376 1376 bpf_prog_detach2(bpf_program__fd(progs[3]), cg_fd, BPF_CGROUP_SOCK_OPS); 1377 1377 1378 1378 for (i = 0; i < ARRAY_SIZE(links); i++) {
+4 -4
tools/testing/selftests/bpf/verifier/calls.c
··· 1375 1375 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1), 1376 1376 /* write into map value */ 1377 1377 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), 1378 - /* fetch secound map_value_ptr from the stack */ 1378 + /* fetch second map_value_ptr from the stack */ 1379 1379 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_10, -16), 1380 1380 BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 1), 1381 1381 /* write into map value */ ··· 1439 1439 /* second time with fp-16 */ 1440 1440 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4), 1441 1441 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 1, 2), 1442 - /* fetch secound map_value_ptr from the stack */ 1442 + /* fetch second map_value_ptr from the stack */ 1443 1443 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_7, 0), 1444 1444 /* write into map value */ 1445 1445 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), ··· 1493 1493 /* second time with fp-16 */ 1494 1494 BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 1, 0, 4), 1495 1495 BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2), 1496 - /* fetch secound map_value_ptr from the stack */ 1496 + /* fetch second map_value_ptr from the stack */ 1497 1497 BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_7, 0), 1498 1498 /* write into map value */ 1499 1499 BPF_ST_MEM(BPF_DW, BPF_REG_0, 0, 0), ··· 2380 2380 */ 2381 2381 BPF_JMP_REG(BPF_JGT, BPF_REG_6, BPF_REG_7, 1), 2382 2382 BPF_MOV64_REG(BPF_REG_9, BPF_REG_8), 2383 - /* r9 = *r9 ; verifier get's to this point via two paths: 2383 + /* r9 = *r9 ; verifier gets to this point via two paths: 2384 2384 * ; (I) one including r9 = r8, verified first; 2385 2385 * ; (II) one excluding r9 = r8, verified next. 2386 2386 * ; After load of *r9 to r9 the frame[0].fp[-24].id == r9.id.
+1 -1
tools/testing/selftests/bpf/xdping.c
··· 155 155 } 156 156 157 157 if (!server) { 158 - /* Only supports IPv4; see hints initiailization above. */ 158 + /* Only supports IPv4; see hints initialization above. */ 159 159 if (getaddrinfo(argv[optind], NULL, &hints, &a) || !a) { 160 160 fprintf(stderr, "Could not resolve %s\n", argv[optind]); 161 161 return 1;
+2 -2
tools/testing/selftests/bpf/xsk.h
··· 93 93 /* Refresh the local tail pointer. 94 94 * cached_cons is r->size bigger than the real consumer pointer so 95 95 * that this addition can be avoided in the more frequently 96 - * executed code that computs free_entries in the beginning of 97 - * this function. Without this optimization it whould have been 96 + * executed code that computes free_entries in the beginning of 97 + * this function. Without this optimization it would have been 98 98 * free_entries = r->cached_prod - r->cached_cons + r->size. 99 99 */ 100 100 r->cached_cons = __atomic_load_n(r->consumer, __ATOMIC_ACQUIRE);