lkml.org 
[lkml]   [2023]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: vhost-net
From
Hi Jason,

Thanks for your feedback.

On 17/01/2023 05:26, Jason Wang wrote:
> On Mon, Jan 16, 2023 at 4:59 PM Jonas Bonn <jonas@norrbonn.se> wrote:
>>
>> For an IFF_TUN device, should vhost-net not be adding an implicit
>> ethernet header in _build_xdp()?
>
> Probably.
>
> Actually, this makes me think that we should disable XDP for TUN?

After playing around with this for a week, I agree. It appears that as
soon as the XDP paths come into play there are requirements on having
valid ethernet headers in place; the TUN interface doesn't even have a
MAC address to validate against so packets in the TCP paths get dropped.
UDP packet validation apparently only cares about the ethernet "proto"
field so these can be made to go through with less rigorous ethernet
addressing.

That said, when the XDP path is bypassed, the TUN device works fine with
vhost-net.

>
>> Can this be done without backward
>> compatibility implications?
>>
>
> The path is used by vhost-net only, so I think we are fine.
>
> Patch is more than welcomed.

I'll try to put something together.

/Jonas

\
 
 \ /
  Last update: 2023-03-26 23:47    [W:0.033 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site