virtio: add names to virtqueue struct, mapping from devices to queues.

Add a linked list of all virtqueues for a virtio device: this helps for
debugging and is also needed for upcoming interface change.

Also, add a "name" field for clearer debug messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2009-06-12 22:16:35 -06:00
parent ef688e151c
commit 9499f5e7ed
14 changed files with 56 additions and 31 deletions

View File

@@ -906,20 +906,20 @@ static int virtnet_probe(struct virtio_device *vdev)
vi->mergeable_rx_bufs = true;
/* We expect two virtqueues, receive then send. */
vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done, "input");
if (IS_ERR(vi->rvq)) {
err = PTR_ERR(vi->rvq);
goto free;
}
vi->svq = vdev->config->find_vq(vdev, 1, skb_xmit_done);
vi->svq = vdev->config->find_vq(vdev, 1, skb_xmit_done, "output");
if (IS_ERR(vi->svq)) {
err = PTR_ERR(vi->svq);
goto free_recv;
}
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) {
vi->cvq = vdev->config->find_vq(vdev, 2, NULL);
vi->cvq = vdev->config->find_vq(vdev, 2, NULL, "control");
if (IS_ERR(vi->cvq)) {
err = PTR_ERR(vi->svq);
goto free_send;