Re: Query on eBPF Map iterator in Kernel space

Shwetha Vittal <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CADutbzWo9KO9TBcR4HpmuBBB1DFLSAGte3d_wASFFJpTWFitmQ@mail.gmail.com>
Sure thanks. I have created a hashmap. I will try with the new
proposed API  long bpf_for_each_map_elem(struct bpf_map *map, void
*callback_fn, void *callback_ctx, u64 flags) from bpf-next repository.

Thanks
Shwetha

On Tue, Mar 2, 2021 at 11:55 AM Y Song <[email protected]> wrote:
>
> On Mon, Mar 1, 2021 at 6:44 AM Toke Høiland-Jørgensen <[email protected]> wrote:
> >
> > Shwetha Vittal <[email protected]> writes:
> >
> > > Hi,
> > >
> > > Is there any way to iterate through eBPF Map elements in kernel space.
> > > I know that there is one at user space bpf_map_get_next_key(). But it
> > > doesn't work when tried in kernel space. I have a requirement to find
> > > the record in the eBPF map which has the least value in kernel space
> > > and pick it for further packet processing and therefore need to
> > > iterate through eBF Map .
> >
> > There will be soon:
> > https://lore.kernel.org/bpf/[email protected]/
>
> What kind of maps are you trying to iterate? The above patch set
> supports hash and array maps. Also, the above patch set has been
> merged into bpf-next repo. Feel free to experiment with it!
>
> >
> > -Toke
> >

-- 


Disclaimer:- This footer text is to convey that this email is sent by one 
of the users of IITH. So, do not mark it as SPAM.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.