From: Alexei Starovoitov <alexei.starovoitov@gmail•com>
To: "Michael S. Tsirkin" <mst@redhat•com>
Cc: John Fastabend <john.fastabend@gmail•com>,
kubakici@wp•pl, jasowang@redhat•com, ast@fb•com,
john.r.fastabend@intel•com, netdev@vger•kernel.org
Subject: Re: [net-next PATCH 5/5] virtio_net: XDP support for adjust_head
Date: Thu, 2 Feb 2017 20:02:55 -0800 [thread overview]
Message-ID: <20170203040252.GA70530@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <20170203043342-mutt-send-email-mst@kernel.org>
On Fri, Feb 03, 2017 at 05:42:54AM +0200, Michael S. Tsirkin wrote:
> On Thu, Feb 02, 2017 at 03:21:57PM -0800, John Fastabend wrote:
> > Add support for XDP adjust head by allocating a 256B header region
> > that XDP programs can grow into. This is only enabled when a XDP
> > program is loaded.
> >
> > In order to ensure that we do not have to unwind queue headroom push
> > queue setup below bpf_prog_add. It reads better to do a prog ref
> > unwind vs another queue setup call.
> >
> > At the moment this code must do a full reset to ensure old buffers
> > without headroom on program add or with headroom on program removal
> > are not used incorrectly in the datapath. Ideally we would only
> > have to disable/enable the RX queues being updated but there is no
> > API to do this at the moment in virtio so use the big hammer. In
> > practice it is likely not that big of a problem as this will only
> > happen when XDP is enabled/disabled changing programs does not
> > require the reset. There is some risk that the driver may either
> > have an allocation failure or for some reason fail to correctly
> > negotiate with the underlying backend in this case the driver will
> > be left uninitialized. I have not seen this ever happen on my test
> > systems and for what its worth this same failure case can occur
> > from probe and other contexts in virtio framework.
> >
> > Signed-off-by: John Fastabend <john.r.fastabend@intel•com>
>
> So I am currently testing what I consider a cleaner way to do this:
>
> MERGEABLE_BUFFER_MIN_ALIGN_SHIFT by 1:
> -#define MERGEABLE_BUFFER_MIN_ALIGN_SHIFT ((PAGE_SHIFT + 1) / 2)
> +#define MERGEABLE_BUFFER_MIN_ALIGN_SHIFT (PAGE_SHIFT / 2 + 1)
>
> and then we do not need a reset as we get a free bit to store presence
> of XDP buffer.
That does indeed sounds cleaner. Do you have an ETA for this?
Do you mind if John's set get applied for 4.11 while you're working
on a better version?
adjust_head support is a blocker for virtio+xdp adoption.
I think we need a compromise for 4.11.
next prev parent reply other threads:[~2017-02-03 4:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 23:20 [net-next PATCH 0/5] XDP adjust head support for virtio John Fastabend
2017-02-02 23:20 ` [net-next PATCH 1/5] virtio_net: wrap rtnl_lock in test for calling with lock already held John Fastabend
2017-02-02 23:20 ` [net-next PATCH 2/5] virtio_net: factor out xdp handler for readability John Fastabend
2017-02-03 1:05 ` Jakub Kicinski
2017-02-03 2:52 ` John Fastabend
2017-02-03 4:23 ` Michael S. Tsirkin
2017-02-02 23:21 ` [net-next PATCH 3/5] virtio_net: remove duplicate queue pair binding in XDP John Fastabend
2017-02-03 4:23 ` Michael S. Tsirkin
2017-02-02 23:21 ` [net-next PATCH 4/5] virtio_net: refactor freeze/restore logic into virtnet reset logic John Fastabend
2017-02-02 23:21 ` [net-next PATCH 5/5] virtio_net: XDP support for adjust_head John Fastabend
2017-02-03 3:42 ` Michael S. Tsirkin
2017-02-03 4:02 ` Alexei Starovoitov [this message]
2017-02-03 4:21 ` Michael S. Tsirkin
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=20170203040252.GA70530@ast-mbp.thefacebook.com \
--to=alexei.starovoitov@gmail$(echo .)com \
--cc=ast@fb$(echo .)com \
--cc=jasowang@redhat$(echo .)com \
--cc=john.fastabend@gmail$(echo .)com \
--cc=john.r.fastabend@intel$(echo .)com \
--cc=kubakici@wp$(echo .)pl \
--cc=mst@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/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