DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Cc: mtetsuyah@gmail.com, yliu@fridaylinux.org,
	maxime.coquelin@redhat.com,
	Robert Shearman <robert.shearman@att.com>,
	stable@dpdk.org, Chas Williams <chas3@att.com>
Subject: [dpdk-dev] [PATCH 1/2] net/vhost: set the vq consistently
Date: Thu, 29 Mar 2018 12:05:06 -0400	[thread overview]
Message-ID: <20180329160507.25081-1-3chas3@gmail.com> (raw)

From: Robert Shearman <robert.shearman@att.com>

The vid and port of the vq were only set on queues created during initial
device setup.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org

Signed-off-by: Robert Shearman <robert.shearman@att.com>
Signed-off-by: Chas Williams <chas3@att.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 3aae01c39..453d9bee1 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -118,6 +118,7 @@ struct pmd_internal {
 	char *iface_name;
 	uint16_t max_queues;
 	rte_atomic32_t started;
+	int vid;
 };
 
 struct internal_list {
@@ -573,6 +574,7 @@ new_device(int vid)
 
 	eth_dev = list->eth_dev;
 	internal = eth_dev->data->dev_private;
+	internal->vid = vid;
 
 #ifdef RTE_LIBRTE_VHOST_NUMA
 	newnode = rte_vhost_get_numa_node(vid);
@@ -633,6 +635,7 @@ destroy_device(int vid)
 	}
 	eth_dev = list->eth_dev;
 	internal = eth_dev->data->dev_private;
+	internal->vid = -1;
 
 	rte_atomic32_set(&internal->dev_attached, 0);
 	update_queuing_status(eth_dev);
@@ -834,6 +837,9 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 		   struct rte_mempool *mb_pool)
 {
 	struct vhost_queue *vq;
+	struct pmd_internal *internal;
+
+	internal = dev->data->dev_private;
 
 	vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue),
 			RTE_CACHE_LINE_SIZE, socket_id);
@@ -844,6 +850,9 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 
 	vq->mb_pool = mb_pool;
 	vq->virtqueue_id = rx_queue_id * VIRTIO_QNUM + VIRTIO_TXQ;
+	vq->internal = internal;
+	vq->vid = internal->vid;
+	vq->port = dev->data->port_id;
 	dev->data->rx_queues[rx_queue_id] = vq;
 
 	return 0;
@@ -856,6 +865,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 		   const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct vhost_queue *vq;
+	struct pmd_internal *internal;
+
+	internal = dev->data->dev_private;
 
 	vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue),
 			RTE_CACHE_LINE_SIZE, socket_id);
@@ -865,6 +877,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 	}
 
 	vq->virtqueue_id = tx_queue_id * VIRTIO_QNUM + VIRTIO_RXQ;
+	vq->internal = internal;
+	vq->vid = internal->vid;
+	vq->port = dev->data->port_id;
 	dev->data->tx_queues[tx_queue_id] = vq;
 
 	return 0;
-- 
2.13.6

             reply	other threads:[~2018-03-29 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 16:05 Chas Williams [this message]
2018-03-29 16:05 ` [dpdk-dev] [PATCH 2/2] net/vhost: insert/strip VLAN header in software Chas Williams
2018-04-11 14:52   ` Maxime Coquelin
2018-04-12  7:14   ` Maxime Coquelin
2018-05-08  1:31   ` Yao, Lei A
2018-04-11 14:46 ` [dpdk-dev] [PATCH 1/2] net/vhost: set the vq consistently Maxime Coquelin
2018-04-11 15:02   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180329160507.25081-1-3chas3@gmail.com \
    --to=3chas3@gmail.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=mtetsuyah@gmail.com \
    --cc=robert.shearman@att.com \
    --cc=stable@dpdk.org \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).