From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Vitaly Mireyno <vmireyno@marvell.com>,
"virtio-comment@lists.oasis-open.org"
<virtio-comment@lists.oasis-open.org>
Subject: [virtio-comment] Re: [EXT] Re: [virtio-comment] [PATCH] virtio-net: Add an optional device control over the receive buffers length
Date: Thu, 23 Jan 2020 18:00:30 +0800 [thread overview]
Message-ID: <36a7addf-50b5-e7df-6be6-ced54cf017e6@redhat.com> (raw)
In-Reply-To: <20200123023750-mutt-send-email-mst@kernel.org>
On 2020/1/23 下午3:46, Michael S. Tsirkin wrote:
>>> So linux can switch between skb and XDP mode. In skb mode buffer size
>>> varies, it works by merging multiple buffers. In XDP a single buffer
>>> is made big enough to hold the whole packet. Length is fixed.
>>>
>>> If we are in XDP mode but buffer was added while in skb mode,
>>> or vice versa, we recover generally by copying data to
>>> the correct buffer. This is a temporary slowdown -
>>> better than dropping packets.
>>>
>>> So let's assume the device ratio is 1.
>>> I guess while in XDP mode, we'll write XDP buffer length into
>>> this field. But in skb mode, we can make the buffer smaller.
>>> This implies driver needs to change the min_rx_buf_len?
>> I'm not sure I get here. The header room should be invisible from device
>> point of view I think.
>>
>> Thanks
>>
> In fact I am confused. We have this comment:
>
> /* This happens when rx buffer size is underestimated
> * or headroom is not enough because of the buffer
> * was refilled before XDP is set. This should only
> * happen for the first several packets, so we don't
> * care much about its performance.
> */
>
> but what does ensure that num_buf == 1 except for the first several
> packets?
We disable GUEST_TSO, GUEST_UFO, for XDP and the minimal packet is 1500.
So it should be fine unless guest MTU is greater than 1500.
If guest MTU is greater than 1500 it could be a problem which needs to
be fixed.
>
> We seem to be calling add_recvbuf_mergeable which in turn uses ewma
> to estimate the packet size, but it seems that XDP never updates ewma so
> the size will be whatever it happened to be, no?
It looks to me we can't use EWMA which may cause packet size under
estimation. Sticking to MTU should be fine.
>
> I guess we need a counter in this slow path so we can notice it
> happening ...
Right, this could be added.
Thanks
This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.
In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.
Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
next prev parent reply other threads:[~2020-01-23 10:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-30 13:59 [virtio-comment] [PATCH] virtio-net: Add an optional device control over the receive buffers length Vitaly Mireyno
2020-01-03 15:22 ` Stefan Hajnoczi
2020-01-05 10:28 ` Michael S. Tsirkin
2020-01-05 10:35 ` [virtio-comment] " Michael S. Tsirkin
2020-01-20 16:24 ` [virtio-comment] " Michael S. Tsirkin
2020-01-22 16:06 ` [virtio-comment] RE: [EXT] " Vitaly Mireyno
2020-01-23 6:55 ` [virtio-comment] " Michael S. Tsirkin
2020-01-23 7:10 ` Jason Wang
2020-01-23 7:46 ` Michael S. Tsirkin
2020-01-23 10:00 ` Jason Wang [this message]
2020-01-23 12:08 ` 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=36a7addf-50b5-e7df-6be6-ced54cf017e6@redhat.com \
--to=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=virtio-comment@lists.oasis-open.org \
--cc=vmireyno@marvell.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