* [dpdk-stable] [PATCH 1/2] net/vhost: set the vq consistently
@ 2018-03-29 16:05 Chas Williams
2018-04-11 14:46 ` Maxime Coquelin
0 siblings, 1 reply; 3+ messages in thread
From: Chas Williams @ 2018-03-29 16:05 UTC (permalink / raw)
To: dev
Cc: mtetsuyah, yliu, maxime.coquelin, Robert Shearman, stable, Chas Williams
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH 1/2] net/vhost: set the vq consistently
2018-03-29 16:05 [dpdk-stable] [PATCH 1/2] net/vhost: set the vq consistently Chas Williams
@ 2018-04-11 14:46 ` Maxime Coquelin
2018-04-11 15:02 ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
0 siblings, 1 reply; 3+ messages in thread
From: Maxime Coquelin @ 2018-04-11 14:46 UTC (permalink / raw)
To: Chas Williams, dev
Cc: mtetsuyah, yliu, Robert Shearman, stable, Chas Williams
On 03/29/2018 06:05 PM, Chas Williams wrote:
> 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(+)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH 1/2] net/vhost: set the vq consistently
2018-04-11 14:46 ` Maxime Coquelin
@ 2018-04-11 15:02 ` Maxime Coquelin
0 siblings, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-04-11 15:02 UTC (permalink / raw)
To: Chas Williams, dev
Cc: mtetsuyah, yliu, Robert Shearman, stable, Chas Williams
On 04/11/2018 04:46 PM, Maxime Coquelin wrote:
>
>
> On 03/29/2018 06:05 PM, Chas Williams wrote:
>> 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(+)
>>
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
It does not apply because a patch from Junjie seems to address the same
problem:
net/vhost: fix crash when creating vdev dynamically
Can you check dpdk-next-virtio/master and confirm this patch is no more
required?
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-11 15:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 16:05 [dpdk-stable] [PATCH 1/2] net/vhost: set the vq consistently Chas Williams
2018-04-11 14:46 ` Maxime Coquelin
2018-04-11 15:02 ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
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).