DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] vhost: Problem RESET_OWNER processing
@ 2015-08-07 14:04 Jan Kiszka
  2015-08-08  0:04 ` Ouyang, Changchun
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2015-08-07 14:04 UTC (permalink / raw)
  To: dev, Xie, Huawei

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] vhost: Problem RESET_OWNER processing
  2015-08-07 14:04 [dpdk-dev] vhost: Problem RESET_OWNER processing Jan Kiszka
@ 2015-08-08  0:04 ` Ouyang, Changchun
  2015-08-08  6:37   ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Ouyang, Changchun @ 2015-08-08  0:04 UTC (permalink / raw)
  To: Jan Kiszka, dev, Xie,  Huawei



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Kiszka
> Sent: Friday, August 7, 2015 10:04 PM
> To: dev@dpdk.org; Xie, Huawei
> Subject: [dpdk-dev] vhost: Problem RESET_OWNER processing
> 
> 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?

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] vhost: Problem RESET_OWNER processing
  2015-08-08  0:04 ` Ouyang, Changchun
@ 2015-08-08  6:37   ` Jan Kiszka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2015-08-08  6:37 UTC (permalink / raw)
  To: Ouyang, Changchun, dev, Xie, Huawei

On 2015-08-08 02:04, Ouyang, Changchun wrote:
> 
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Kiszka
>> Sent: Friday, August 7, 2015 10:04 PM
>> To: dev@dpdk.org; Xie, Huawei
>> Subject: [dpdk-dev] vhost: Problem RESET_OWNER processing
>>
>> 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

> 
>> 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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-08  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-07 14:04 [dpdk-dev] vhost: Problem RESET_OWNER processing Jan Kiszka
2015-08-08  0:04 ` Ouyang, Changchun
2015-08-08  6:37   ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).