All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Eric Leblond <eric@regit.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Cc: xdp-newbies@vger.kernel.org, pavel.odintsov@gmail.com
Subject: Re: What library to use ?
Date: Wed, 30 Aug 2017 01:37:18 +0200	[thread overview]
Message-ID: <59A5FAAE.1050507@iogearbox.net> (raw)
In-Reply-To: <1503686114.19844.5.camel@regit.org>

On 08/25/2017 08:35 PM, Eric Leblond wrote:
[...]
> OK, this looks like what we were already doing in Suricata so it should
> be ok. If I get correctly the design, we will have a per CPU load
> balancing. The CPU reading the packet will send data to his own ring
> buffer via the bpf_perf_event_output that don't take any CPU related
> parameters. As we are really early in the processing, this means that

Yeah, if you look at __bpf_perf_event_output(), it's basically
the event->oncpu != cpu which would otherwise let it bail out,
but needed iiuc to ensure the RB can be written w/o having to
take locks. The CPU related 'parameter' is basically set up by
the 'orchestrator'. You have the perf event map, and given at
which index you place the corresponding perf fd, you can either
use BPF_F_CURRENT_CPU if the mapping is 1:1 (cpu -> perf fd set
up for this cpu) or a custom index if you have a use case where
you need to demux to one of multiple perf RBs for that CPU.

> the per-CPU load balancing will be done by the card.

Right given you need to have the replies steered into the same
perf RB 'channel' for further processing.

      reply	other threads:[~2017-08-29 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20 13:03 What library to use ? Eric Leblond
2017-08-20 22:48 ` Daniel Borkmann
2017-08-21  8:16   ` Jesper Dangaard Brouer
2017-08-21 21:57     ` Daniel Borkmann
2017-08-25 18:35       ` Eric Leblond
2017-08-29 23:37         ` Daniel Borkmann [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=59A5FAAE.1050507@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=brouer@redhat.com \
    --cc=eric@regit.org \
    --cc=pavel.odintsov@gmail.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 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.