From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Jesper Dangaard Brouer <brouer@redhat.com>
Cc: netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Saeed Mahameed <saeedm@mellanox.com>,
Daniel Borkmann <borkmann@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Tariq Toukan <tariqt@mellanox.com>
Subject: Re: [net PATCH 1/4] virtio_net: disable XDP_REDIRECT in receive_mergeable() case
Date: Tue, 27 Feb 2018 10:28:58 +0800 [thread overview]
Message-ID: <71fc11a2-ea95-766c-0d7a-2433abd9dcbc@redhat.com> (raw)
In-Reply-To: <86ea9887-0ea2-1f58-7710-26d4d126a76d@redhat.com>
On 2018年02月27日 10:25, Jason Wang wrote:
>
>
> On 2018年02月27日 08:40, Michael S. Tsirkin wrote:
>>> IMHO we should consider NOT supporting XDP in receive_mergeable() at
>>> all, because the principles behind XDP are to gain speed by (1) code
>>> simplicity, (2) sacrificing memory and (3) where possible moving
>>> runtime checks to setup time. These principles are clearly being
>>> violated in receive_mergeable(), that e.g. runtime track average
>>> buffer size to save memory consumption.
>>>
>>> In the longer run, we should consider introducing a separate receive
>>> function when attaching an XDP program, and also change the memory
>>> model to be compatible with XDP when attaching an XDP prog.
>> I agree with a separate function approach.
>>
>> So each buffer is tagged as xdp/non xdp, we check that
>> and handle appropriately - where non xdp could be handled
>> by the generic path.
>
> If we want to have separated function, should we do it for all XDP
> capable drivers instead of virtio-net only?
>
> Thanks
>
What's more, since we don't stop device during XDP set. Even if a buffer
is tagged as xdp/non xdp during refill, we still can't make sure whether
or not XDP was used at receive function. So we can not handle them
separately.
Thanks
next prev parent reply other threads:[~2018-02-27 2:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 13:31 [net PATCH 0/4] virtio_net: several bugs in XDP code for driver virtio_net Jesper Dangaard Brouer
2018-02-20 13:32 ` [net PATCH 1/4] virtio_net: disable XDP_REDIRECT in receive_mergeable() case Jesper Dangaard Brouer
2018-02-20 16:56 ` John Fastabend
2018-02-27 0:40 ` Michael S. Tsirkin
2018-02-27 2:25 ` Jason Wang
2018-02-27 2:28 ` Jason Wang [this message]
2018-02-20 13:32 ` [net PATCH 2/4] virtio_net: fix XDP code path in receive_small() Jesper Dangaard Brouer
2018-02-20 16:57 ` John Fastabend
2018-02-20 13:32 ` [net PATCH 3/4] virtio_net: fix memory leak in XDP_REDIRECT Jesper Dangaard Brouer
2018-02-20 16:59 ` John Fastabend
2018-02-20 13:32 ` [net PATCH 4/4] virtio_net: fix ndo_xdp_xmit crash towards dev not ready for XDP Jesper Dangaard Brouer
2018-02-20 17:01 ` John Fastabend
2018-02-21 20:09 ` [net PATCH 0/4] virtio_net: several bugs in XDP code for driver virtio_net David Miller
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=71fc11a2-ea95-766c-0d7a-2433abd9dcbc@redhat.com \
--to=jasowang@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=borkmann@iogearbox.net \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=tariqt@mellanox.com \
/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).