All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, Jesper Dangaard Brouer <brouer@redhat.com>
Subject: Re: [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
Date: Fri, 8 May 2020 09:56:37 +0800	[thread overview]
Message-ID: <c1df2cdf-eaff-f146-1804-f0a6cad6bb2d@redhat.com> (raw)
In-Reply-To: <20200506055436-mutt-send-email-mst@kernel.org>


On 2020/5/6 下午5:54, Michael S. Tsirkin wrote:
> On Wed, May 06, 2020 at 04:19:40PM +0800, Jason Wang wrote:
>> On 2020/5/6 下午3:53, Michael S. Tsirkin wrote:
>>> On Wed, May 06, 2020 at 02:16:32PM +0800, Jason Wang wrote:
>>>> We tried to reserve space for vnet header before
>>>> xdp.data_hard_start. But this is useless since the packet could be
>>>> modified by XDP which may invalidate the information stored in the
>>>> header and there's no way for XDP to know the existence of the vnet
>>>> header currently.
>>> What do you mean? Doesn't XDP_PASS use the header in the buffer?
>> We don't, see 436c9453a1ac0 ("virtio-net: keep vnet header zeroed after
>> processing XDP")
>>
>> If there's other place, it should be a bug.
>>
>>
>>>> So let's just not reserve space for vnet header in this case.
>>> In any case, we can find out XDP does head adjustments
>>> if we need to.
>> But XDP program can modify the packets without adjusting headers.
>>
>> Thanks
> Then what's the problem?


Then we can't do anything more than just invalidating vnet header since 
we don't know whether or not the packet has been modified or not.

Technically, XDP can give the driver some hint about whether or not the 
packet has been modified, but AFAIK we haven't implemented this yet.

Thanks


>


  reply	other threads:[~2020-05-08  1:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06  6:16 [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP Jason Wang
2020-05-06  6:16 ` [PATCH net-next 2/2] virtio-net: fix the XDP truesize calculation for mergeable buffers Jason Wang
2020-05-06  7:37   ` Michael S. Tsirkin
2020-05-06  8:21     ` Jason Wang
2020-05-06 12:08       ` Michael S. Tsirkin
2020-05-08  1:54         ` Jason Wang
2020-05-06  7:53 ` [PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP Michael S. Tsirkin
2020-05-06  8:19   ` Jason Wang
2020-05-06  9:54     ` Michael S. Tsirkin
2020-05-08  1:56       ` Jason Wang [this message]
2020-05-06  8:21 ` Jesper Dangaard Brouer
2020-05-06  8:34   ` Jason Wang
2020-05-06  9:46     ` Michael S. Tsirkin
2020-05-08  1:59       ` Jason Wang

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=c1df2cdf-eaff-f146-1804-f0a6cad6bb2d@redhat.com \
    --to=jasowang@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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.