netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, kafai@fb.com,
	Daniel Borkmann <daniel@iogearbox.net>,
	alexei.starovoitov@gmail.com, mst@redhat.com
Subject: Re: [PATCH net] virtio_net: reject XDP programs using header adjustment
Date: Fri, 23 Dec 2016 10:44:29 -0800	[thread overview]
Message-ID: <585D708D.6000204@gmail.com> (raw)
In-Reply-To: <CAJpBn1wKkJ83GLznzQ+DCs7JZb-FkQ-zYu3d6i4p1RmfKy0mig@mail.gmail.com>

On 16-12-20 04:30 AM, Jakub Kicinski wrote:
> On Mon, Dec 19, 2016 at 5:50 PM, John Fastabend
> <john.fastabend@gmail.com> wrote:
>> On 16-12-19 07:05 AM, Jakub Kicinski wrote:
>>> commit 17bedab27231 ("bpf: xdp: Allow head adjustment in XDP prog")
>>> added a new XDP helper to prepend and remove data from a frame.
>>> Make virtio_net reject programs making use of this helper until
>>> proper support is added.
>>>
>>> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>>> ---
>>>  drivers/net/virtio_net.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>>> index 08327e005ccc..db761f37783e 100644
>>> --- a/drivers/net/virtio_net.c
>>> +++ b/drivers/net/virtio_net.c
>>> @@ -1677,6 +1677,11 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog)
>>>       u16 xdp_qp = 0, curr_qp;
>>>       int i, err;
>>>
>>> +     if (prog && prog->xdp_adjust_head) {
>>> +             netdev_warn(dev, "Does not support bpf_xdp_adjust_head()\n");
>>> +             return -EOPNOTSUPP;
>>> +     }
>>> +
>>>       if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) ||
>>>           virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6)) {
>>>               netdev_warn(dev, "can't set XDP while host is implementing LRO, disable LRO first\n");
>>>
>>
>> Acked-by: John Fastabend <john.r.fastabend@intel.com>
>>
>> Thanks patch looks good. Alternatively we could push a "bug fix" to
>> support the adjust header feature depending on how DaveM and MST feel
>> about that. I don't have a strong opinion but I have the patch on my
>> queue it just needs some more testing.
> 
> Cool!  I thought to ask you what your plans are but then this patch is so
> trivial I decided to just post it :) I'm perfectly happy with dropping it
> for now and reposting after ~rc5 if needed.
> 

Hi Jakub,

I just posted a RFC take a look if you get a chance. Notice though Jason
fixed up my linearize path a bunch so it will need to be pushed on top
of that series.

Thanks,
John

      reply	other threads:[~2016-12-23 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 15:05 [PATCH net] virtio_net: reject XDP programs using header adjustment Jakub Kicinski
2016-12-19 15:23 ` Mintz, Yuval
2016-12-19 15:42   ` Jakub Kicinski
2016-12-19 17:50 ` John Fastabend
2016-12-19 20:08   ` David Miller
2016-12-20 12:30   ` Jakub Kicinski
2016-12-23 18:44     ` John Fastabend [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=585D708D.6000204@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=kafai@fb.com \
    --cc=mst@redhat.com \
    --cc=netdev@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).