Re: [PATCH ipsec-next,v2 3/3] selftests/bpf: add xfrm_info tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 1, 2022 at 10:26 PM Martin KaFai Lau <martin.lau@xxxxxxxxx> wrote:
>
> On 11/30/22 9:34 PM, Eyal Birger wrote:
> >>> +
> >>> +struct {
> >>> +     __uint(type, BPF_MAP_TYPE_ARRAY);
> >>> +     __uint(max_entries, 2);
> >>> +     __type(key, __u32);
> >>> +     __type(value, __u32);
> >>> +} dst_if_id_map SEC(".maps");
> >>
> >> It is easier to use global variables instead of a map.
> >
> > Would these be available for read/write from the test application (as the
> > map is currently populated/read from userspace)?
>
> Yes, through the skel->bss->...
> selftests/bpf/prog_tests/ has examples.

Oh this is very useful! I tested and indeed this works perfectly.
WIll use in v3.

Thanks!
Eyal.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux