Re: Profiling XDP programs for performance issues

Magnus Karlsson <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAJ8uoz2tsbpD1OvLLThC=a8O1KNMhHqwWGG9QOUJ0MMKHnzkSg@mail.gmail.com>
On Fri, Apr 9, 2021 at 1:06 AM Neal Shukla <[email protected]> wrote:
>
> Using perf, we've confirmed that the line mentioned has a 25.58% cache miss
> rate.

Do these hit in the LLC or in DRAM? In any case, your best bet is
likely to prefetch this into your L1/L2. In my experience, the best
way to do this is not to use an explicit prefetch instruction but to
touch/fetch the cache lines you need in the beginning of your
computation and let the fetch latency and the usage of the first cache
line hide the latencies of fetching the others. In your case, touch
both metadata and packet at the same time. Work with the metadata and
other things then come back to the packet data and hopefully the
relevant part will reside in the cache or registers by now. If that
does not work, touch packet number N+1 just before starting with
packet N.

Very general recommendations but hope it helps anyway. How exactly to
do this efficiently is very application dependent.

/Magnus

> On Thu, Apr 8, 2021 at 2:38 PM Zvi Effron <[email protected]> wrote:
> >
> > Apologies for the spam to anyone who received my first response, but
> > it was accidentally sent as HTML and rejected by the mailing list.
> >
> > On Thu, Apr 8, 2021 at 11:20 AM Neal Shukla <[email protected]> wrote:
> > >
> > > System Info:
> > > CPU: Intel(R) Xeon(R) Gold 6150 CPU @ 2.70GHz
> > > Network Adapter/NIC: Intel X710
> > > Driver: i40e
> > > Kernel version: 5.8.15
> > > OS: Fedora 33
> > >
> >
> > Slight correction, we're actually on the 5.10.10 kernel.
> >
> > --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.