[dpdk-dev] [PATCH v3 0/3] add multi queue support for virtio-user

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Jun 15 11:54:27 CEST 2016


Applied to dpdk-next-virtio, with following small changes, for
addressing a build error and some checkpatch warnings.

Thanks.

	--yliu

---
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 026b8a1..ea7a48e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -307,9 +307,9 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	const struct rte_memzone *mz = NULL, *hdr_mz = NULL;
 	unsigned int vq_size, size;
 	struct virtio_hw *hw = dev->data->dev_private;
-	struct virtnet_rx *rxvq;
-	struct virtnet_tx *txvq;
-	struct virtnet_ctl *cvq;
+	struct virtnet_rx *rxvq = NULL;
+	struct virtnet_tx *txvq = NULL;
+	struct virtnet_ctl *cvq = NULL;
 	struct virtqueue *vq;
 	const char *queue_names[] = {"rvq", "txq", "cvq"};
 	size_t sz_vq, sz_q = 0, sz_hdr_mz = 0;
diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h
index 8d1e505..897042f 100644
--- a/drivers/net/virtio/virtio_user/vhost.h
+++ b/drivers/net/virtio/virtio_user/vhost.h
@@ -141,6 +141,6 @@ struct vhost_user_msg {
 
 int vhost_user_sock(int vhostfd, uint64_t req, void *arg);
 int vhost_user_setup(const char *path);
-int vhost_user_enable_queue_pair(int vhostfd, unsigned pair_idx, int enable);
+int vhost_user_enable_queue_pair(int vhostfd, uint16_t pair_idx, int enable);
 
 #endif
diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 98d98b6..95e80f8 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -100,8 +100,9 @@ vhost_user_read(int fd, struct vhost_user_msg *msg)
 	if (sz_payload) {
 		ret = recv(fd, (void *)((char *)msg + sz_hdr), sz_payload, 0);
 		if (ret < sz_payload) {
-			PMD_DRV_LOG(ERR, "Failed to recv msg payload: %d instead of %d.",
-				    ret, msg->size);
+			PMD_DRV_LOG(ERR,
+				"Failed to recv msg payload: %d instead of %d.",
+				ret, msg->size);
 			goto fail;
 		}
 	}
@@ -406,7 +407,7 @@ vhost_user_setup(const char *path)
 }
 
 int
-vhost_user_enable_queue_pair(int vhostfd, unsigned pair_idx, int enable)
+vhost_user_enable_queue_pair(int vhostfd, uint16_t pair_idx, int enable)
 {
 	int i;
 
@@ -422,5 +423,4 @@ vhost_user_enable_queue_pair(int vhostfd, unsigned pair_idx, int enable)
 	}
 
 	return 0;
-
 }
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 4c9279e..9216182 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -46,7 +46,7 @@
 #include "virtio_user/virtio_user_dev.h"
 
 #define virtio_user_get_dev(hw) \
-	((struct virtio_user_dev *)(hw)->virtio_user_dev);
+	((struct virtio_user_dev *)(hw)->virtio_user_dev)
 
 static void
 virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset,


More information about the dev mailing list