Skip to contentSkip to conversation

vhost: Problem RESET_OWNER processing

DISCUSSION Jan Kiszka 2 participants 3 messages Aug 7, 2015 – Aug 8, 2015

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi,

I was wondering if I'm alone with this: the vhost-switch example crashes on client disconnects if the client send a RESET_OWNER message. That's at least the case for QEMU and vhost-user mode (I suppose vhost-cuse is legacy now). And it really ruins the party when playing with this because every VM shutdown or guest reboot triggers.

I was looking deeper in the librte_vhost, and I found that reset_owner() is doing cleanup_device and then init_device - but without letting the user know. So vhost-switch crashed in its main loop over continuing to use the device, namely calling rte_vhost_dequeue_burst (with dev->virtqueue[]->avail == NULL).

Do we simply need another hook in the vhost API, similar to the destruction notification?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jan Kiszka
Sent: Friday, August 7, 2015 10:04 PM
To: [email protected]; Xie, Huawei
Subject: [dpdk-dev] vhost: Problem RESET_OWNER processing

Quoted 5 lines

Hi,

I was wondering if I'm alone with this: the vhost-switch example crashes on client disconnects if the client send a RESET_OWNER message. That's at least the case for QEMU and vhost-user mode (I suppose vhost-cuse is legacy

What's your qemu version?

Quoted 17 lines

now). And it really ruins the party when playing with this because every VM shutdown or guest reboot triggers.

I was looking deeper in the librte_vhost, and I found that reset_owner() is doing cleanup_device and then init_device - but without letting the user know. So vhost-switch crashed in its main loop over continuing to use the device, namely calling rte_vhost_dequeue_burst (with dev->virtqueue[]->avail == NULL).

Do we simply need another hook in the vhost API, similar to the destruction notification?

Jan

--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux

author
#2 lore raw
Quoted 8 lines · Changchun
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Jan Kiszka
Sent: Friday, August 7, 2015 10:04 PM
To: [email protected]; Xie, Huawei
Subject: [dpdk-dev] vhost: Problem RESET_OWNER processing

Quoted 7 lines
Quoted 5 lines

Hi,

I was wondering if I'm alone with this: the vhost-switch example crashes on client disconnects if the client send a RESET_OWNER message. That's at least the case for QEMU and vhost-user mode (I suppose vhost-cuse is legacy

What's your qemu version?

git head, which includes 2.4-rc2.

VHOST_USER_RESET_OWNER dates back to QEMU commit 294ce717e, and that is after 2.3. Before that commit, QEMU was happily allowing its vhost servers to corrupt guest memory on reboot or while a virtio device was otherwise deactivated.

Jan

Quoted 18 lines
Quoted 18 lines

now). And it really ruins the party when playing with this because every VM shutdown or guest reboot triggers.

I was looking deeper in the librte_vhost, and I found that reset_owner() is doing cleanup_device and then init_device - but without letting the user know. So vhost-switch crashed in its main loop over continuing to use the device, namely calling rte_vhost_dequeue_burst (with dev->virtqueue[]->avail == NULL).

Do we simply need another hook in the vhost API, similar to the destruction notification?

Jan

--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux

Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux