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 2/2] virtio-net: fix the XDP truesize calculation for mergeable buffers
Date: Fri, 8 May 2020 09:54:05 +0800 [thread overview]
Message-ID: <0e59287f-8333-c715-da03-91306cef9878@redhat.com> (raw)
In-Reply-To: <20200506075807-mutt-send-email-mst@kernel.org>
On 2020/5/6 下午8:08, Michael S. Tsirkin wrote:
> On Wed, May 06, 2020 at 04:21:15PM +0800, Jason Wang wrote:
>> On 2020/5/6 下午3:37, Michael S. Tsirkin wrote:
>>> On Wed, May 06, 2020 at 02:16:33PM +0800, Jason Wang wrote:
>>>> We should not exclude headroom and tailroom when XDP is set. So this
>>>> patch fixes this by initializing the truesize from PAGE_SIZE when XDP
>>>> is set.
>>>>
>>>> Cc: Jesper Dangaard Brouer<brouer@redhat.com>
>>>> Signed-off-by: Jason Wang<jasowang@redhat.com>
>>> Seems too aggressive, we do not use up the whole page for the size.
>>>
>>>
>>>
>> For XDP yes, we do:
>>
>> static unsigned int get_mergeable_buf_len(struct receive_queue *rq,
>> struct ewma_pkt_len *avg_pkt_len,
>> unsigned int room)
>> {
>> const size_t hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
>> unsigned int len;
>>
>> if (room)
>> return PAGE_SIZE - room;
>>
>> ...
>>
>> Thanks
> Hmm. But that's only for new buffers. Buffers that were outstanding
> before xdp was attached don't use the whole page, do they?
They don't and in either case, we've encoded truesize in the ctx. Any
issue you saw?
>
>
>
>
> Also, with TCP smallqueues blocking the queue like that might be a problem.
> Could you try and check performance impact of this?
I'm not sure I get you, TCP small queue is more about TX I guess. And
since we've invalidated the vnet header, the performance of XDP_PASS
won't be good.
> I looked at what other drivers do and I see they tend to copy the skb
> in XDP_PASS case. ATM we don't normally - but should we?
My understanding is XDP runs before skb, so I don't get here. Or maybe
you can point me the driver you mentioned here? I've checked i40e and
mlx5e, both of them build skb after XDP.
Thanks
>
next prev parent reply other threads:[~2020-05-08 1:54 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 [this message]
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
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=0e59287f-8333-c715-da03-91306cef9878@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®