xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Y Song <ys114321@gmail.com>
To: Shwetha Vittal <cs19resch01001@iith.ac.in>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	Xdp <xdp-newbies@vger.kernel.org>
Subject: Re: Query on eBPF Map iterator in Kernel space
Date: Tue, 2 Mar 2021 17:33:09 -0800	[thread overview]
Message-ID: <CAH3MdRVpX2Npern-s+ZnR9YW-7BRNm_cmv6xAoHMY2w2Tctx5w@mail.gmail.com> (raw)
In-Reply-To: <CADutbzWo9KO9TBcR4HpmuBBB1DFLSAGte3d_wASFFJpTWFitmQ@mail.gmail.com>

On Tue, Mar 2, 2021 at 4:55 PM Shwetha Vittal <cs19resch01001@iith.ac.in> wrote:
>
> 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.

Great. Let us know if you hit any issues or have any suggestions. Thanks!

>
> Thanks
> Shwetha
>
> On Tue, Mar 2, 2021 at 11:55 AM Y Song <ys114321@gmail.com> wrote:
> >
> > On Mon, Mar 1, 2021 at 6:44 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> > >
> > > Shwetha Vittal <cs19resch01001@iith.ac.in> 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/20210226204920.3884074-1-yhs@fb.com/
> >
> > 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.

      reply	other threads:[~2021-03-03  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 11:27 Query on eBPF Map iterator in Kernel space Shwetha Vittal
2021-03-01 14:40 ` Toke Høiland-Jørgensen
2021-03-02  6:24   ` Y Song
2021-03-03  0:54     ` Shwetha Vittal
2021-03-03  1:33       ` Y Song [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH3MdRVpX2Npern-s+ZnR9YW-7BRNm_cmv6xAoHMY2w2Tctx5w@mail.gmail.com \
    --to=ys114321@gmail.com \
    --cc=cs19resch01001@iith.ac.in \
    --cc=toke@redhat.com \
    --cc=xdp-newbies@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).