From d343d228e5bcf1c90005a17d39f7775233ba3a96 Mon Sep 17 00:00:00 2001 From: Arthur Shau Date: Fri, 8 Sep 2023 16:04:58 -0700 Subject: [PATCH] Remove legacy_file_names param from bpf_object() buck rule Summary: We are getting rid of the legacy_file_names parameter from the bpf_object() rule in buck, which means all bpf sources must end with '.bpf.c' now, and cannot merely end in '.c'. We are thus renaming any usages in fbcode that still rely on '.c' srcs. I also made some changes in an attempt to follow our other naming conventions where I could, such as getting rid of the '_kern' suffix, but unfortunately katran has a LOT of files and buck rules with that (some of which is directly referenced in code as well), which makes it more effort than it's worth in this diff. Reviewed By: avasylev, anakryiko Differential Revision: D49080409 fbshipit-source-id: a178a5832eecce87d7e63c7bcad3d19b259e1546 --- katran/decap/bpf/{decap_kern.c => decap.bpf.c} | 0 katran/decap/tc_bpf/{tc_decap_kern.c => tc_decap.bpf.c} | 0 katran/lib/bpf/{balancer_kern.c => balancer.bpf.c} | 0 .../lib/bpf/{healthchecking_kern.c => healthchecking.bpf.c} | 0 katran/lib/linux_includes/bpf.h | 2 +- katran/tpr/CMakeLists.txt | 2 +- katran/tpr/TcpPktRouter.h | 4 ++-- .../tpr/bpf/{tcp_pkt_router_kern.c => tcp_pkt_router.bpf.c} | 0 8 files changed, 4 insertions(+), 4 deletions(-) rename katran/decap/bpf/{decap_kern.c => decap.bpf.c} (100%) rename katran/decap/tc_bpf/{tc_decap_kern.c => tc_decap.bpf.c} (100%) rename katran/lib/bpf/{balancer_kern.c => balancer.bpf.c} (100%) rename katran/lib/bpf/{healthchecking_kern.c => healthchecking.bpf.c} (100%) rename katran/tpr/bpf/{tcp_pkt_router_kern.c => tcp_pkt_router.bpf.c} (100%) diff --git a/katran/decap/bpf/decap_kern.c b/katran/decap/bpf/decap.bpf.c similarity index 100% rename from katran/decap/bpf/decap_kern.c rename to katran/decap/bpf/decap.bpf.c diff --git a/katran/decap/tc_bpf/tc_decap_kern.c b/katran/decap/tc_bpf/tc_decap.bpf.c similarity index 100% rename from katran/decap/tc_bpf/tc_decap_kern.c rename to katran/decap/tc_bpf/tc_decap.bpf.c diff --git a/katran/lib/bpf/balancer_kern.c b/katran/lib/bpf/balancer.bpf.c similarity index 100% rename from katran/lib/bpf/balancer_kern.c rename to katran/lib/bpf/balancer.bpf.c diff --git a/katran/lib/bpf/healthchecking_kern.c b/katran/lib/bpf/healthchecking.bpf.c similarity index 100% rename from katran/lib/bpf/healthchecking_kern.c rename to katran/lib/bpf/healthchecking.bpf.c diff --git a/katran/lib/linux_includes/bpf.h b/katran/lib/linux_includes/bpf.h index 9983a70c0..11720a752 100644 --- a/katran/lib/linux_includes/bpf.h +++ b/katran/lib/linux_includes/bpf.h @@ -1053,7 +1053,7 @@ union bpf_attr { * into it. An example is available in file * *samples/bpf/trace_output_user.c* in the Linux kernel source * tree (the eBPF program counterpart is in - * *samples/bpf/trace_output_kern.c*). + * *samples/bpf/trace_output.bpf.c*). * * **bpf_perf_event_output**\ () achieves better performance * than **bpf_trace_printk**\ () for sharing data with user diff --git a/katran/tpr/CMakeLists.txt b/katran/tpr/CMakeLists.txt index a80784e5b..6721be549 100644 --- a/katran/tpr/CMakeLists.txt +++ b/katran/tpr/CMakeLists.txt @@ -15,7 +15,7 @@ set(BPFOBJECT_EXTRA_DEFINES "-DKATRAN_CMAKE_BUILD") find_package(BpfObject REQUIRED) bpf_object(tpr_bpf - bpf/tcp_pkt_router_kern.c + bpf/tcp_pkt_router.bpf.c ) diff --git a/katran/tpr/TcpPktRouter.h b/katran/tpr/TcpPktRouter.h index 9a7f5522e..ce9ed30a8 100644 --- a/katran/tpr/TcpPktRouter.h +++ b/katran/tpr/TcpPktRouter.h @@ -13,9 +13,9 @@ #include #ifdef KATRAN_CMAKE_BUILD -#include "tpr_bpf.skel.h" // @manual +#include "tpr.skel.h" // @manual #else -#include +#include #endif namespace katran_tpr { diff --git a/katran/tpr/bpf/tcp_pkt_router_kern.c b/katran/tpr/bpf/tcp_pkt_router.bpf.c similarity index 100% rename from katran/tpr/bpf/tcp_pkt_router_kern.c rename to katran/tpr/bpf/tcp_pkt_router.bpf.c