lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 08 Sep 2010 12:59:05 +0530
From:	Krishna Kumar <krkumar2@...ibm.com>
To:	rusty@...tcorp.com.au, davem@...emloft.net
Cc:	netdev@...r.kernel.org, Krishna Kumar <krkumar2@...ibm.com>,
	anthony@...emonkey.ws, kvm@...r.kernel.org, mst@...hat.com
Subject: [RFC PATCH 1/4] Add a new API to virtio-pci

Add virtio_get_queue_index() to get the queue index of a
vq.  This is needed by the cb handler to locate the queue
that should be processed.

Signed-off-by: Krishna Kumar <krkumar2@...ibm.com>
---
 drivers/virtio/virtio_pci.c |    9 +++++++++
 include/linux/virtio.h      |    3 +++
 2 files changed, 12 insertions(+)

diff -ruNp org/include/linux/virtio.h tx_only/include/linux/virtio.h
--- org/include/linux/virtio.h	2010-09-03 16:33:51.000000000 +0530
+++ tx_only/include/linux/virtio.h	2010-09-08 10:23:36.000000000 +0530
@@ -136,4 +136,7 @@ struct virtio_driver {
 
 int register_virtio_driver(struct virtio_driver *drv);
 void unregister_virtio_driver(struct virtio_driver *drv);
+
+/* return the internal queue index associated with the virtqueue */
+extern int virtio_get_queue_index(struct virtqueue *vq);
 #endif /* _LINUX_VIRTIO_H */
diff -ruNp org/drivers/virtio/virtio_pci.c tx_only/drivers/virtio/virtio_pci.c
--- org/drivers/virtio/virtio_pci.c	2010-09-03 16:33:51.000000000 +0530
+++ tx_only/drivers/virtio/virtio_pci.c	2010-09-08 10:23:16.000000000 +0530
@@ -359,6 +359,15 @@ static int vp_request_intx(struct virtio
 	return err;
 }
 
+/* Return the internal queue index associated with the virtqueue */
+int virtio_get_queue_index(struct virtqueue *vq)
+{
+	struct virtio_pci_vq_info *info = vq->priv;
+
+	return info->queue_index;
+}
+EXPORT_SYMBOL(virtio_get_queue_index);
+
 static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index,
 				  void (*callback)(struct virtqueue *vq),
 				  const char *name,
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ