Message ID | 20230301154953.641654-1-joannelkoong@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Add skb + xdp dynptrs | expand |
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <ast@kernel.org>: On Wed, 1 Mar 2023 07:49:43 -0800 you wrote: > This patchset is the 2nd in the dynptr series. The 1st can be found here [0]. > > This patchset adds skb and xdp type dynptrs, which have two main benefits for > packet parsing: > * allowing operations on sizes that are not statically known at > compile-time (eg variable-sized accesses). > * more ergonomic and less brittle iteration through data (eg does not need > manual if checking for being within bounds of data_end) > > [...] Here is the summary with links: - [v13,bpf-next,01/10] bpf: Support "sk_buff" and "xdp_buff" as valid kfunc arg types https://git.kernel.org/bpf/bpf-next/c/2f4643934670 - [v13,bpf-next,02/10] bpf: Refactor process_dynptr_func https://git.kernel.org/bpf/bpf-next/c/7e0dac2807e6 - [v13,bpf-next,03/10] bpf: Allow initializing dynptrs in kfuncs https://git.kernel.org/bpf/bpf-next/c/1d18feb2c915 - [v13,bpf-next,04/10] bpf: Define no-ops for externally called bpf dynptr functions https://git.kernel.org/bpf/bpf-next/c/8357b366cbb0 - [v13,bpf-next,05/10] bpf: Refactor verifier dynptr into get_dynptr_arg_reg https://git.kernel.org/bpf/bpf-next/c/485ec51ef976 - [v13,bpf-next,06/10] bpf: Add __uninit kfunc annotation https://git.kernel.org/bpf/bpf-next/c/d96d937d7c5c - [v13,bpf-next,07/10] bpf: Add skb dynptrs https://git.kernel.org/bpf/bpf-next/c/b5964b968ac6 - [v13,bpf-next,08/10] bpf: Add xdp dynptrs https://git.kernel.org/bpf/bpf-next/c/05421aecd4ed - [v13,bpf-next,09/10] bpf: Add bpf_dynptr_slice and bpf_dynptr_slice_rdwr https://git.kernel.org/bpf/bpf-next/c/66e3a13e7c2c - [v13,bpf-next,10/10] selftests/bpf: tests for using dynptrs to parse skb and xdp buffers https://git.kernel.org/bpf/bpf-next/c/cfa7b011894d You are awesome, thank you!
On Wed, 1 Mar 2023 07:49:43 -0800 Joanne Koong wrote: > This patchset is the 2nd in the dynptr series. The 1st can be found here [0]. > > This patchset adds skb and xdp type dynptrs, which have two main benefits for > packet parsing: > * allowing operations on sizes that are not statically known at > compile-time (eg variable-sized accesses). > * more ergonomic and less brittle iteration through data (eg does not need > manual if checking for being within bounds of data_end) > > When comparing the differences in runtime for packet parsing without dynptrs > vs. with dynptrs, there is no noticeable difference. Patch 9 contains more > details as well as examples of how to use skb and xdp dynptrs. Oddly I see an error trying to build net-next with clang 15.0.7, but I'm 90% sure that it built yesterday, has anyone seen: ../kernel/bpf/verifier.c:10298:24: error: array index 16 is past the end of the array (which contains 16 elements) [-Werror,-Warray-bounds] meta.func_id == special_kfunc_list[KF_bpf_dynptr_slice_rdwr]) { ^ ~~~~~~~~~~~~~~~~~~~~~~~~ ../kernel/bpf/verifier.c:9150:1: note: array 'special_kfunc_list' declared here BTF_ID_LIST(special_kfunc_list) ^ ../include/linux/btf_ids.h:207:27: note: expanded from macro 'BTF_ID_LIST' #define BTF_ID_LIST(name) static u32 __maybe_unused name[16]; ^ 1 error generated.
On Wed, Mar 8, 2023 at 12:16 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Wed, 1 Mar 2023 07:49:43 -0800 Joanne Koong wrote: > > This patchset is the 2nd in the dynptr series. The 1st can be found here [0]. > > > > This patchset adds skb and xdp type dynptrs, which have two main benefits for > > packet parsing: > > * allowing operations on sizes that are not statically known at > > compile-time (eg variable-sized accesses). > > * more ergonomic and less brittle iteration through data (eg does not need > > manual if checking for being within bounds of data_end) > > > > When comparing the differences in runtime for packet parsing without dynptrs > > vs. with dynptrs, there is no noticeable difference. Patch 9 contains more > > details as well as examples of how to use skb and xdp dynptrs. > > Oddly I see an error trying to build net-next with clang 15.0.7, > but I'm 90% sure that it built yesterday, has anyone seen: yep, it was fixed in bpf-next: 2d5bcdcda879 ("bpf: Increase size of BTF_ID_LIST without CONFIG_DEBUG_INFO_BTF again") > > ../kernel/bpf/verifier.c:10298:24: error: array index 16 is past the end of the array (which contains 16 elements) [-Werror,-Warray-bounds] > meta.func_id == special_kfunc_list[KF_bpf_dynptr_slice_rdwr]) { > ^ ~~~~~~~~~~~~~~~~~~~~~~~~ > ../kernel/bpf/verifier.c:9150:1: note: array 'special_kfunc_list' declared here > BTF_ID_LIST(special_kfunc_list) > ^ > ../include/linux/btf_ids.h:207:27: note: expanded from macro 'BTF_ID_LIST' > #define BTF_ID_LIST(name) static u32 __maybe_unused name[16]; > ^ > 1 error generated.
On Wed, 8 Mar 2023 09:08:09 -0800 Andrii Nakryiko wrote: > On Wed, Mar 8, 2023 at 12:16 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Wed, 1 Mar 2023 07:49:43 -0800 Joanne Koong wrote: > > > This patchset is the 2nd in the dynptr series. The 1st can be found here [0]. > > > > > > This patchset adds skb and xdp type dynptrs, which have two main benefits for > > > packet parsing: > > > * allowing operations on sizes that are not statically known at > > > compile-time (eg variable-sized accesses). > > > * more ergonomic and less brittle iteration through data (eg does not need > > > manual if checking for being within bounds of data_end) > > > > > > When comparing the differences in runtime for packet parsing without dynptrs > > > vs. with dynptrs, there is no noticeable difference. Patch 9 contains more > > > details as well as examples of how to use skb and xdp dynptrs. > > > > Oddly I see an error trying to build net-next with clang 15.0.7, > > but I'm 90% sure that it built yesterday, has anyone seen: > > yep, it was fixed in bpf-next: > > 2d5bcdcda879 ("bpf: Increase size of BTF_ID_LIST without > CONFIG_DEBUG_INFO_BTF again") Perfect, thanks! Could you get that to us ASAP, please?
On Wed, Mar 8, 2023 at 9:28 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Wed, 8 Mar 2023 09:08:09 -0800 Andrii Nakryiko wrote: > > On Wed, Mar 8, 2023 at 12:16 AM Jakub Kicinski <kuba@kernel.org> wrote: > > > On Wed, 1 Mar 2023 07:49:43 -0800 Joanne Koong wrote: > > > > This patchset is the 2nd in the dynptr series. The 1st can be found here [0]. > > > > > > > > This patchset adds skb and xdp type dynptrs, which have two main benefits for > > > > packet parsing: > > > > * allowing operations on sizes that are not statically known at > > > > compile-time (eg variable-sized accesses). > > > > * more ergonomic and less brittle iteration through data (eg does not need > > > > manual if checking for being within bounds of data_end) > > > > > > > > When comparing the differences in runtime for packet parsing without dynptrs > > > > vs. with dynptrs, there is no noticeable difference. Patch 9 contains more > > > > details as well as examples of how to use skb and xdp dynptrs. > > > > > > Oddly I see an error trying to build net-next with clang 15.0.7, > > > but I'm 90% sure that it built yesterday, has anyone seen: > > > > yep, it was fixed in bpf-next: > > > > 2d5bcdcda879 ("bpf: Increase size of BTF_ID_LIST without > > CONFIG_DEBUG_INFO_BTF again") > > Perfect, thanks! Could you get that to us ASAP, please? yep, will send PR soon