Thread (36 messages) flat view 36 messages, 4 authors, 2016-01-29

Re: [PATCH v4 09/14] virtio: ethdev: check for vfio interface

From: Yuanhan Liu <hidden>
Date: 2016-01-15 06:34:10

On Thu, Jan 14, 2016 at 06:58:32PM +0530, Santosh Shukla wrote:
Introducing api to check interface type is vfio or not, if interface is vfio
then update struct virtio_vfio_dev {}.

Those two apis are:
- virtio_chk_for_vfio
- virtio_hw_init_by_vfio

Signed-off-by: Santosh Shukla <redacted>
..
+/* Init virtio by vfio-way */
+static int virtio_hw_init_by_vfio(struct virtio_hw *hw,
+				  struct rte_pci_device *pci_dev)
+{
+	struct virtio_vfio_dev *vdev;
+
+	vdev = &hw->dev;
+	if (virtio_chk_for_vfio(pci_dev) < 0) {
+		vdev->is_vfio = false;
+		vdev->pci_dev = NULL;
+		return -1;
+	}
+
+	/* .. So attached interface is vfio */
+	vdev->is_vfio = true;
+	vdev->pci_dev = pci_dev;
Normally, I don't like the way of adding yet another "virtio_hw_init_by_xxx".

As suggested in another reply, would pci_dev->kdrv checking be enough?
If so, do it in simple way.

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