consuming pre-created tap - with multiqueue

Miguel Duarte de Mora Barroso mdbarroso at redhat.com
Tue Sep 22 11:48:08 UTC 2020


Hello,

On KubeVirt, we are trying to pre-create a tap device, then instruct
libvirt to consume it (via the type=ethernet , managed='no'
attributes).

It works as expected, **unless** when we create a multi-queue tap device.

The difference when creating the tap device is that we set the
multi-queue flag; libvirt throws the following error when consuming
it:

```
LibvirtError(Code=38, Domain=0, Message='Unable to create tap device
tap0: Invalid argument')
```

After digging a bit on the libvirt code (we're using libvirt 6.0.0), I
see this on the logs (immediately before the error):
{"component":"virt-launcher","level":"info","msg":"Enabling
IFF_VNET_HDR","pos":"virNetDevProbeVnetHdr:190","subcomponent":"libvirt","thread":"33"
,"timestamp":"2020-09-22T10:34:29.335000Z"}

I do not understand how it can try to set the VNET_HDR flag, since I
have not set it when I created it, which, as per [0] should only
happen when requested. Here's the tap device I'm creating: (output of
`ip tuntap show`)
  - tap0: tap persist0x100 user 107 group 107

I'm confused by this, since on [1] it says that only one flag can be
used (persist *or* vnet_hdr). Also, from my limited understanding, in
order to open a pre-created tap device, it must be set to persistent.

Am I right (in the sense that these flags cannot co-exist) ? If so,
why would libvirt be setting the VNET_HDR flag on the tap device ?

[0] - https://github.com/libvirt/libvirt/blob/v6.0.0/src/util/virnetdevtap.c#L261
[1] - https://github.com/libvirt/libvirt/blob/v6.0.0/src/util/virnetdevtap.c#L209




More information about the libvirt-users mailing list