net/virtio-user: fix multiqueue with vhost kernel
authorTiwei Bie <tiwei.bie@intel.com>
Tue, 12 Mar 2019 07:13:07 +0000 (15:13 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Mar 2019 17:15:42 +0000 (18:15 +0100)
commitbad78b4b8b23412f6007efd034de04b35c663a6f
tree367b40b85bc0eee51ae791443542b0c4b5a916a6
parent11d5253a3e93a38be14da65328dd19960fd8cb14
net/virtio-user: fix multiqueue with vhost kernel

The multiqueue support in virtio-user with vhost kernel backend
is broken when tap name isn't specified by users explicitly,
because the tap name returned by ioctl(TUNSETIFF) isn't saved
properly, and multiple tap interfaces will be created in this
case. Fix this by saving the dynamically allocated tap name
first before reusing the ifr structure. Besides, also make it
possible to support the format string in tap name (e.g. foo%d)
specified by users explicitly.

Fixes: 791b43e08842 ("net/virtio-user: specify MAC of the tap")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/virtio/virtio_user/vhost_kernel_tap.c