netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Daniel Borkmann" <borkmann@iogearbox.net>,
	"Andy Gospodarek" <andy@greyhouse.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Paweł Staszewski" <pstaszewski@itcare.pl>,
	brouer@redhat.com
Subject: Re: XDP redirect measurements, gotchas and tracepoints
Date: Tue, 22 Aug 2017 08:37:10 +0200	[thread overview]
Message-ID: <20170822083710.47a182a2@redhat.com> (raw)
In-Reply-To: <20170821223540.atktdricmks26c27@ast-mbp>

On Mon, 21 Aug 2017 15:35:42 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:

> On Mon, Aug 21, 2017 at 09:25:06PM +0200, Jesper Dangaard Brouer wrote:
> > 
> > Third gotcha(3): You got this far, loaded xdp on both interfaces, and
> > notice now that (with default setup) you can RX with 14Mpps but only
> > TX with 6.9Mpps (and might have 5% idle cycles).  I debugged this via
> > perf tracepoint event xdp:xdp_redirect, and found this was due to
> > overrunning the xdp TX ring-queue size.  
> 
> we should probably fix this somehow.

Gotcha-3 (quoted above) is an interesting problem.  At first it looks
like a driver tuning problem. But it is actually an inherent property
of XDP, as there is no-queue or push-back flow control with XDP, there
is no way to handle TX queue overrun.
 My proposed solution: I want to provide a facility for userspace to
load another eBPF program (at the tracepoint xdp_redirect), which can
"see" the issue occurring.  This allows a XDP/BPF developer to
implement their own reaction/mitigation flow-control (e.g. via a map
shared with the XDP program).


> Once tx-ing netdev added to devmap we can enable xdp on it automatically?

I think you are referring to Gotcha-2 here:

  Second gotcha(2): you cannot TX out a device, unless it also have a
  xdp bpf program attached. (This is an implicit dependency, as the
  driver code need to setup XDP resources before it can ndo_xdp_xmit).

Yes, we should work on improving this situation.  Auto enabling XDP
when a netdev is added to a devmap is a good solution.  Currently this
is tied to loading an XDP bpf_prog.  Do you propose loading a dummy
bpf_prog on the netdev? (then we need to handle 1. not replacing
existing bpf_prog, 2. on take-down don't remove "later" loaded
bpf_prog).

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2017-08-22  6:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 19:25 XDP redirect measurements, gotchas and tracepoints Jesper Dangaard Brouer
2017-08-21 22:35 ` Alexei Starovoitov
2017-08-22  6:37   ` Jesper Dangaard Brouer [this message]
2017-08-22 17:09     ` Alexei Starovoitov
2017-08-22 17:17       ` John Fastabend
2017-08-23  8:56         ` Jesper Dangaard Brouer
2017-08-22 18:02 ` Michael Chan
2017-08-22 18:17   ` John Fastabend
2017-08-22 18:30     ` Duyck, Alexander H
2017-08-22 20:04       ` Michael Chan
2017-08-23  1:06         ` Alexander Duyck
2017-08-23  6:59           ` Michael Chan
2017-08-23  8:29             ` Jesper Dangaard Brouer
2017-08-25  3:36               ` Michael Chan
2017-08-25 12:45                 ` Jesper Dangaard Brouer
2017-08-25 15:10                   ` John Fastabend
2017-08-25 15:28                     ` Michael Chan
2017-08-28 16:02                       ` Andy Gospodarek
2017-08-28 16:11                         ` Alexander Duyck
2017-08-29 13:26                           ` Jesper Dangaard Brouer
2017-08-29 16:23                             ` Alexander Duyck
2017-08-29 19:02                               ` Andy Gospodarek
2017-08-29 19:52                                 ` Alexander Duyck
2017-08-28 16:14                         ` John Fastabend
2017-08-28 19:39                           ` Andy Gospodarek
2017-08-23 14:51             ` Alexander Duyck

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=20170822083710.47a182a2@redhat.com \
    --to=brouer@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=borkmann@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pstaszewski@itcare.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).