Thread (21 messages) flat view 21 messages, 3 authors, 2017-01-11

Re: [net PATCH] net: virtio: cap mtu when XDP programs are running

From: John Fastabend <john.fastabend@gmail.com>
Date: 2017-01-04 18:58:04

[...]
On 2017年01月04日 00:48, John Fastabend wrote:
quoted
On 17-01-02 10:14 PM, Jason Wang wrote:
quoted
On 2017年01月03日 06:30, John Fastabend wrote:
quoted
XDP programs can not consume multiple pages so we cap the MTU to
avoid this case. Virtio-net however only checks the MTU at XDP
program load and does not block MTU changes after the program
has loaded.

This patch sets/clears the max_mtu value at XDP load/unload time.

Signed-off-by: John Fastabend <redacted>
---
[...]
quoted
OK so this logic is a bit too simply. When it resets the max_mtu I guess it
needs to read the mtu via

    virtio_cread16(vdev, ...)

or we may break the negotiated mtu.
Yes, this is a problem (even use ETH_MAX_MTU). We may need a method to notify
the device about the mtu in this case which is not supported by virtio now.
Note this is not really a XDP specific problem. The guest can change the MTU
after init time even without XDP which I assume should ideally result in a
notification if the MTU is negotiated.
quoted
As for capping it at GOOD_PACKET_LEN this has the nice benefit of avoiding any
underestimates in EWMA predictions because it appears min estimates are capped
at GOOD_PACKET_LEN via get_mergeable_buf_len().
This seems something misunderstanding here, I meant only use GOOD_PACKET_LEN for
small buffer (which does not use EWMA).
Yep I think its all cleared up now.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help