From: Jerome Jutteau Date: Mon, 19 Oct 2015 09:44:26 +0000 (+0200) Subject: vhost: keep device identifier after reset owner X-Git-Tag: spdx-start~8376 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2c95f4de6a7ec59c5793c64588066b6b2b8e6142;p=dpdk.git vhost: keep device identifier after reset owner virtio-net clean and init device after a VHOST_USER_RESET_OWNER. This reset device identifier to 0 and break ll_root listing logic. This patch keep the old device identifier and re-write it on the cleaned device. Signed-off-by: Jerome Jutteau Acked-by: Yuanhan Liu --- diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index d0f1764ed9..955a29d79b 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -399,11 +399,14 @@ static int reset_owner(struct vhost_device_ctx ctx) { struct virtio_net_config_ll *ll_dev; + uint64_t device_fh; ll_dev = get_config_ll_entry(ctx); + device_fh = ll_dev->dev.device_fh; cleanup_device(&ll_dev->dev); init_device(&ll_dev->dev); + ll_dev->dev.device_fh = device_fh; return 0; }