Bagas Sanjaya <bagasdotme@xxxxxxxxx> writes: > On 10/4/22 23:19, Donald Hunter wrote: >> +Examples >> +======== >> + >> +Please see the ``tools/testing/selftests/bpf`` directory for functional >> +examples. The sample code below demonstrates API usage. >> + > > Since you have many code snippets, better say "The code samples below". Good catch. >> +BPF_MAP_TYPE_ARRAY >> +~~~~~~~~~~~~~~~~~~ >> + >> +This example shows array creation, initialisation and lookup from userspace. >> + > > "Initialize the array, set elements, and perform lookup". > > ... > >> +BPF_MAP_TYPE_PERCPU_ARRAY >> +~~~~~~~~~~~~~~~~~~~~~~~~~ >> + >> +This example shows per CPU array usage. >> + > > What is the purpose of above snippet? Give more detailed explanation. > > Thanks. I will rework both examples into separate snippets for create, init and lookup. Thanks!