diff mbox

[1/1] net: skip virtio-net config of deleted nic's peers

Message ID 1477951277-6924-1-git-send-email-yuri.benditovich@daynix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yuri Benditovich Oct. 31, 2016, 10:01 p.m. UTC
From: Yuri Benditovich <yuri.benditovich@daynix.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1373816
qemu core dump happens during repetitive unpug-plug
with multiple queues and Windows RSS-capable guest.
If back-end delete requested during virtio-net device
initialization, driver still can try configure the device
for multiple queues. The virtio-net device is expected
to be removed as soon as the initialization is done.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 hw/net/virtio-net.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jason Wang Nov. 2, 2016, 2:58 a.m. UTC | #1
On 2016年11月01日 06:42, Michael S. Tsirkin wrote:
> On Tue, Nov 01, 2016 at 12:01:17AM +0200, yuri.benditovich@daynix.com wrote:
>> From: Yuri Benditovich <yuri.benditovich@daynix.com>
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1373816
>> qemu core dump happens during repetitive unpug-plug
>> with multiple queues and Windows RSS-capable guest.
>> If back-end delete requested during virtio-net device
>> initialization, driver still can try configure the device
>> for multiple queues. The virtio-net device is expected
>> to be removed as soon as the initialization is done.
>>
>> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

Applied to -net, thanks.

>
>> ---
>>   hw/net/virtio-net.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>> index 06bfe4b..77a4fae 100644
>> --- a/hw/net/virtio-net.c
>> +++ b/hw/net/virtio-net.c
>> @@ -508,6 +508,10 @@ static void virtio_net_set_queues(VirtIONet *n)
>>       int i;
>>       int r;
>>   
>> +    if (n->nic->peer_deleted) {
>> +        return;
>> +    }
>> +
>>       for (i = 0; i < n->max_queues; i++) {
>>           if (i < n->curr_queues) {
>>               r = peer_attach(n, i);
>> -- 
>> 1.9.1
diff mbox

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 06bfe4b..77a4fae 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -508,6 +508,10 @@  static void virtio_net_set_queues(VirtIONet *n)
     int i;
     int r;
 
+    if (n->nic->peer_deleted) {
+        return;
+    }
+
     for (i = 0; i < n->max_queues; i++) {
         if (i < n->curr_queues) {
             r = peer_attach(n, i);