DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1
@ 2018-05-03 13:17 Ciara Loftus
  2018-05-04 13:09 ` Maxime Coquelin
  2018-05-04 15:09 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Ciara Loftus @ 2018-05-03 13:17 UTC (permalink / raw)
  To: dev

rte_eth_vhost_get_vid_from_port_id returns a value of 0 if called before
the first call to the new_device callback. A vid value >=0 suggests the
device is active which is not the case in this instance. Initialise vid
to a negative value to prevent this.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Fixes: ee584e9710b9 vhost: add driver on top of the library
Cc: stable@dpdk.org
---
 drivers/net/vhost/rte_eth_vhost.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index ff5424a..bd42eee 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -94,7 +94,7 @@ struct pmd_internal {
 	char *dev_name;
 	char *iface_name;
 	uint16_t max_queues;
-	uint16_t vid;
+	int vid;
 	rte_atomic32_t started;
 	uint8_t vlan_strip;
 };
@@ -1259,6 +1259,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
 	data->nb_rx_queues = queues;
 	data->nb_tx_queues = queues;
 	internal->max_queues = queues;
+	internal->vid = -1;
 	data->dev_link = pmd_link;
 	data->mac_addrs = eth_addr;
 	data->dev_flags = RTE_ETH_DEV_INTR_LSC;
-- 
2.7.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1
  2018-05-03 13:17 [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1 Ciara Loftus
@ 2018-05-04 13:09 ` Maxime Coquelin
  2018-05-04 15:09 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-05-04 13:09 UTC (permalink / raw)
  To: Ciara Loftus, dev



On 05/03/2018 03:17 PM, Ciara Loftus wrote:
> rte_eth_vhost_get_vid_from_port_id returns a value of 0 if called before
> the first call to the new_device callback. A vid value >=0 suggests the
> device is active which is not the case in this instance. Initialise vid
> to a negative value to prevent this.
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> Fixes: ee584e9710b9 vhost: add driver on top of the library
> Cc: stable@dpdk.org
> ---

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1
  2018-05-03 13:17 [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1 Ciara Loftus
  2018-05-04 13:09 ` Maxime Coquelin
@ 2018-05-04 15:09 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2018-05-04 15:09 UTC (permalink / raw)
  To: Ciara Loftus, dev



On 05/03/2018 03:17 PM, Ciara Loftus wrote:
> rte_eth_vhost_get_vid_from_port_id returns a value of 0 if called before
> the first call to the new_device callback. A vid value >=0 suggests the
> device is active which is not the case in this instance. Initialise vid
> to a negative value to prevent this.
> 
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> Fixes: ee584e9710b9 vhost: add driver on top of the library
> Cc: stable@dpdk.org
> ---
>   drivers/net/vhost/rte_eth_vhost.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-04 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 13:17 [dpdk-dev] [PATCH v2] net/vhost: Initialise vid to -1 Ciara Loftus
2018-05-04 13:09 ` Maxime Coquelin
2018-05-04 15:09 ` 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).