On Wed, 7 Sep 2022 17:02:48 -0700 Joanne Koong <joannelkoong@xxxxxxxxx> wrote: > Add two new helper functions: bpf_dynptr_trim and bpf_dynptr_advance. > > bpf_dynptr_trim decreases the size of a dynptr by the specified > number of bytes (offset remains the same). bpf_dynptr_advance advances > the offset of the dynptr by the specified number of bytes (size > decreases correspondingly). > > One example where trimming / advancing the dynptr may useful is for > hashing. If the dynptr points to a larger struct, it is possible to hash > an individual field within the struct through dynptrs by using > bpf_dynptr_advance+trim. > > Signed-off-by: Joanne Koong <joannelkoong@xxxxxxxxx> Reviewed-by: Shmulik Ladkani <shmulik.ladkani@xxxxxxxxx>