All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: "MD I. Islam" <tamim@csebuet.org>
Cc: xdp-newbies@vger.kernel.org, brouer@redhat.com
Subject: Re: XDP on many-core NPU
Date: Tue, 28 Nov 2017 12:02:29 +0100	[thread overview]
Message-ID: <20171128120229.16c0009c@redhat.com> (raw)
In-Reply-To: <CAM7NYTgW1AnJ0C4H2YiXOegp0p3BHCtU5bB7WfbcDTvaYzHJmw@mail.gmail.com>


On Mon, 27 Nov 2017 18:33:10 -0500 "MD I. Islam" <tamim@csebuet.org> wrote:

> I was wondering if XDP can scale to many-core NPU (such as NPS-400
> which has 256 cores)? I need to develop a XCP/RCP like application
> that can achieve bare-metal performance on each core. The application
> will run in a run-to-completion model. I see, DPDK can run userspace
> application on each core. I'm wondering if XDP has anything like that?
> Please let me know any suggestion.

Hi Tamim,

I think you are mixing up things a bit here...

You mention a specific NIC (NPS-400) which have many cores inside the
NIC.  You need to understand XDP is a software solution, where the
programming language is eBPF.  XDP does NOT run inside the NIC, instead
XDP runs as the earliest possible step in the Linux kernel network stack.

The only NIC that does hardware offloading of XDP is Netronome[1], see
their white papers[2].

[1] https://www.netronome.com/
[2] https://open-nfp.org/dataplanes-ebpf/technical-papers/

Regarding scaling: XDP scales perfect for each added CPU core.  XDP is
currently (footnote-1) loaded on for entire NIC, but the XDP/eBPF
program is executed separate/independent on each NIC RX-ring queue
(processing up-to 64 frames per NAPI poll cycle).

The XDP scaling depend on how well the NIC RSS distribute traffic
across RX-ring queues, which is also true for the normal kernel network
stack.  To address bad RSS distribution, I recently implement cpumap[3]
to allow XDP to scale delivery to the normal kernel network
stack.  See sample code[4][5] on how to use it.

[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/cpumap.c
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/samples/bpf/xdp_redirect_cpu_kern.c
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/samples/bpf/xdp_redirect_cpu_user.c


(footnote-1: there are debates regarding loading XDP/eBPF progs on
specific RX-queue numbers, so this might change.)
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2017-11-28 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 23:33 XDP on many-core NPU MD I. Islam
2017-11-28 11:02 ` Jesper Dangaard Brouer [this message]
2017-11-28 20:00   ` MD I. Islam
2017-11-28 20:38     ` Jesper Dangaard Brouer
2017-11-28 21:38       ` Andy Gospodarek
     [not found]       ` <CAHashqBku3=+mNAMQvKf_9k_gU74O0mUaHXt+5bVRCcThnXwdw@mail.gmail.com>
2017-11-28 22:50         ` MD I. Islam
2017-11-29  5:38       ` Gilad Ben-Yossef
     [not found]       ` <CAOtvUMet3z4qFubyO7iDunGeD1fi_mRdOKeih0qM0bzKqcTpGA@mail.gmail.com>
2017-11-29  8:02         ` MD I. Islam

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=20171128120229.16c0009c@redhat.com \
    --to=brouer@redhat.com \
    --cc=tamim@csebuet.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.