/linux/tools/testing/selftests/bpf/progs/ |
H A D | bpf_compiler.h | 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | loop4.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_xdp_loop.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_lwt_seg6local.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_seg6_loop.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_xdp.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_sysctl_loop2.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | xdping_kern.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_sysctl_loop1.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_sysctl_prog.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_tc_tunnel.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_skb_ctx.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_cls_redirect.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | xdp_synproxy_kern.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | pyperf.h | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | test_xdp_noinline.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | iters.c | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | strobemeta.h | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|
H A D | profiler.inc.h | diff 52dbd67dff5d050e99301100e2cac578eef9b2e9 Thu Feb 08 21:36:12 CET 2024 Jose E. Marchesi <jose.marchesi@oracle.com> bpf: Abstract loop unrolling pragmas in BPF selftests
[Changes from V1: - Avoid conflict by rebasing with latest master.]
Some BPF tests use loop unrolling compiler pragmas that are clang specific and not supported by GCC. These pragmas, along with their GCC equivalences are:
#pragma clang loop unroll_count(N) #pragma GCC unroll N
#pragma clang loop unroll(full) #pragma GCC unroll 65534
#pragma clang loop unroll(disable) #pragma GCC unroll 1
#pragma unroll [aka #pragma clang loop unroll(enable)] There is no GCC equivalence to this pragma. It enables unrolling on loops that the compiler would not ordinarily unroll even with -O2|-funroll-loops, but it is not equivalent to full unrolling either.
This patch adds a new header progs/bpf_compiler.h that defines the following macros, which correspond to each pair of compiler-specific pragmas above:
__pragma_loop_unroll_count(N) __pragma_loop_unroll_full __pragma_loop_no_unroll __pragma_loop_unroll
The selftests using loop unrolling pragmas are then changed to include the header and use these macros in place of the explicit pragmas.
Tested in bpf-next master. No regressions.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/bpf/20240208203612.29611-1-jose.marchesi@oracle.com
|