Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

4 messages, 2 authors, 2012-12-04 · open the first message on its own page

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

From: Jason Wang <hidden>
Date: 2012-12-03 10:31:14

On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote:
On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote:
quoted
quoted
-	if (!try_fill_recv(&vi->rq, GFP_KERNEL))
-		schedule_delayed_work(&vi->rq.refill, 0);
+	for (i = 0; i < vi->max_queue_pairs; i++)
+		if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
+			schedule_delayed_work(&vi->rq[i].refill, 0);
 
 	mutex_lock(&vi->config_lock);
 	vi->config_enable = true;
 	mutex_unlock(&vi->config_lock);
 
+	BUG_ON(virtnet_set_queues(vi));
+
 	return 0;
 }
 #endif
Also crashing on device nack of command is also not nice.
In this case it seems we can just switch to
single-queue mode which should always be safe.
Not sure it's safe. It depends on the reason why this call fails. If we
left a state that the driver only use single queue but the device use
multi queues, we may still lost the network.

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2012-12-03 10:58:01

On Mon, Dec 03, 2012 at 06:30:49PM +0800, Jason Wang wrote:
On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote:
quoted
On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote:
quoted
quoted
-	if (!try_fill_recv(&vi->rq, GFP_KERNEL))
-		schedule_delayed_work(&vi->rq.refill, 0);
+	for (i = 0; i < vi->max_queue_pairs; i++)
+		if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
+			schedule_delayed_work(&vi->rq[i].refill, 0);
 
 	mutex_lock(&vi->config_lock);
 	vi->config_enable = true;
 	mutex_unlock(&vi->config_lock);
 
+	BUG_ON(virtnet_set_queues(vi));
+
 	return 0;
 }
 #endif
Also crashing on device nack of command is also not nice.
In this case it seems we can just switch to
single-queue mode which should always be safe.
Not sure it's safe. It depends on the reason why this call fails. If we
left a state that the driver only use single queue but the device use
multi queues, we may still lost the network.
Not the way driver is currently written - you'll happily
process incoming packets from all queues so no problem?

-- 
MST

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2012-12-04 07:32:29

On Mon, Dec 03, 2012 at 06:30:49PM +0800, Jason Wang wrote:
On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote:
quoted
On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote:
quoted
quoted
-	if (!try_fill_recv(&vi->rq, GFP_KERNEL))
-		schedule_delayed_work(&vi->rq.refill, 0);
+	for (i = 0; i < vi->max_queue_pairs; i++)
+		if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
+			schedule_delayed_work(&vi->rq[i].refill, 0);
 
 	mutex_lock(&vi->config_lock);
 	vi->config_enable = true;
 	mutex_unlock(&vi->config_lock);
 
+	BUG_ON(virtnet_set_queues(vi));
+
 	return 0;
 }
 #endif
Also crashing on device nack of command is also not nice.
In this case it seems we can just switch to
single-queue mode which should always be safe.
Not sure it's safe. It depends on the reason why this call fails. If we
left a state that the driver only use single queue but the device use
multi queues, we may still lost the network.
Looks like we won't: napi will stay enabled on all queues
so we will process incoming packets.

-- 
MST

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

From: Jason Wang <hidden>
Date: 2012-12-04 09:27:52

On Tuesday, December 04, 2012 09:35:03 AM Michael S. Tsirkin wrote:
On Mon, Dec 03, 2012 at 06:30:49PM +0800, Jason Wang wrote:
quoted
On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote:
quoted
On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote:
quoted
quoted
-	if (!try_fill_recv(&vi->rq, GFP_KERNEL))
-		schedule_delayed_work(&vi->rq.refill, 0);
+	for (i = 0; i < vi->max_queue_pairs; i++)
+		if (!try_fill_recv(&vi->rq[i], GFP_KERNEL))
+			schedule_delayed_work(&vi->rq[i].refill, 0);

 	mutex_lock(&vi->config_lock);
 	vi->config_enable = true;
 	mutex_unlock(&vi->config_lock);

+	BUG_ON(virtnet_set_queues(vi));
+

 	return 0;
 
 }
 #endif
Also crashing on device nack of command is also not nice.
In this case it seems we can just switch to
single-queue mode which should always be safe.
Not sure it's safe. It depends on the reason why this call fails. If we
left a state that the driver only use single queue but the device use
multi queues, we may still lost the network.
Looks like we won't: napi will stay enabled on all queues
so we will process incoming packets.
True, consider there's no bug in qemu. Will leave a just leave a warning in 
next version.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help