vhost: fix queue pair reallocation
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 10 Mar 2016 04:20:01 +0000 (12:20 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 11 Mar 2016 15:49:20 +0000 (16:49 +0100)
commitfd2fca6f6b5abb12a19c6338a77bff2e2780e49d
treefdfbd8b5a54548a4449907f0d22283bbe6dd0c79
parent78ffdaff06811587bb0ae9a10c1cd60111d3f031
vhost: fix queue pair reallocation

vq is allocated on pairs, hence we should do pair reallocation
at numa_realloc() as well, otherwise an error like following
occurs while do numa reallocation:

    VHOST_CONFIG: reallocate vq from 0 to 1 node
    PANIC in rte_free():
    Fatal error: Invalid memory

The reason we don't catch it is because numa_realloc() will
not take effect when RTE_LIBRTE_VHOST_NUMA is not enabled,
which is the default case.

Fixes: e049ca6d10e0 ("vhost-user: prepare multiple queue setup")

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
lib/librte_vhost/virtio-net.c