Pass a map to a global BPF function

Zvi Effron <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAC1LvL0670CWq183g54w3HGsByjcBaBL2rrTP1PyTbbYfm76iw@mail.gmail.com>
Hi all,

We have some map-of-arrays that we use for tracking labeled metrics in
our XDP code. The inner map tracks the metrics for a given label,
which is the key in the outer map.

Our XDP code calls several global BPF functions (freplaced, so can't
be inlined). Currently, each global function has to make a lookup to
get the inner map to record its metrics. Now that non-context pointers
can be passed to global BPF functions, is it possible to pass maps to
these global functions?

That would allow the primary function to do the lookup once, and the
helpers would be able to skip their lookup saving considerable time.
Using this map-of-maps approach for labeled metrics has produced a
noticeable performance degradation that profiling indicates is because
of the extra lookups, which is why we're interested in reducing the
number of lookups.

Thanks!
--Zvi
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.