From: Jamal Hadi Salim <jhs@mojatatu•com>
To: Brenden Blanco <bblanco@plumgrid•com>, davem@davemloft•net
Cc: netdev@vger•kernel.org, tom@herbertland•com,
alexei.starovoitov@gmail•com, ogerlitz@mellanox•com,
daniel@iogearbox•net, brouer@redhat•com, eric.dumazet@gmail•com,
ecree@solarflare•com, john.fastabend@gmail•com, tgraf@suug•ch,
johannes@sipsolutions•net, eranlinuxmellanox@gmail•com,
lorenzo@google•com
Subject: Re: [RFC PATCH v2 0/5] Add driver bpf hook for early packet drop
Date: Sat, 9 Apr 2016 10:37:51 -0400 [thread overview]
Message-ID: <570913BF.1010007@mojatatu.com> (raw)
In-Reply-To: <1460090874-10497-1-git-send-email-bblanco@plumgrid.com>
On 16-04-08 12:47 AM, Brenden Blanco wrote:
> This patch set introduces new infrastructure for programmatically
> processing packets in the earliest stages of rx, as part of an effort
> others are calling Express Data Path (XDP) [1]. Start this effort by
> introducing a new bpf program type for early packet filtering, before even
> an skb has been allocated.
>
> With this, hope to enable line rate filtering, with this initial
> implementation providing drop/allow action only.
>
> Patch 1 introduces the new prog type and helpers for validating the bpf
> program. A new userspace struct is defined containing only len as a field,
> with others to follow in the future.
> In patch 2, create a new ndo to pass the fd to support drivers.
> In patch 3, expose a new rtnl option to userspace.
> In patch 4, enable support in mlx4 driver. No skb allocation is required,
> instead a static percpu skb is kept in the driver and minimally initialized
> for each driver frag.
> In patch 5, create a sample drop and count program. With single core,
> achieved ~20 Mpps drop rate on a 40G mlx4. This includes packet data
> access, bpf array lookup, and increment.
Hrm. This doesnt sound very high (less than 50%?).
Is the driver the main overhead?
I'd be curious, for comparison, if you just dropped everything
without bpf and alternatively with tc + bpf of the same program
on the one cpu.
Numbers we had for the NUC with tc on single core were a bit higher
than 20Mpps but there was no driver overhead - so i expected
to see much higher numbers if you did it at the driver...
Note back in the day Alexey(not Alexei;->) had a built-in driver
level forwarder;
however the advantage there was derived out of packets being DMAed
from ingress to egress port after some simple lookup.
cheers,
jamal
prev parent reply other threads:[~2016-04-09 14:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-08 4:47 [RFC PATCH v2 0/5] Add driver bpf hook for early packet drop Brenden Blanco
2016-04-09 14:37 ` Jamal Hadi Salim [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=570913BF.1010007@mojatatu.com \
--to=jhs@mojatatu$(echo .)com \
--cc=alexei.starovoitov@gmail$(echo .)com \
--cc=bblanco@plumgrid$(echo .)com \
--cc=brouer@redhat$(echo .)com \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=ecree@solarflare$(echo .)com \
--cc=eranlinuxmellanox@gmail$(echo .)com \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=johannes@sipsolutions$(echo .)net \
--cc=john.fastabend@gmail$(echo .)com \
--cc=lorenzo@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=ogerlitz@mellanox$(echo .)com \
--cc=tgraf@suug$(echo .)ch \
--cc=tom@herbertland$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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