[dpdk-dev,v2] net/virtio: add speed capability

Message ID 1486724725-17410-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Thomas Monjalon Feb. 10, 2017, 11:05 a.m. UTC
  From: Ido Barnea <ibarnea@cisco.com>

The chosen fake capability (10G) is consistent with the reported
link speed in virtio_dev_link_update():
	link.link_speed = SPEED_10G;

The feature is not marked in doc/guides/nics/features/virtio.ini
as it is only a fake value.

Signed-off-by: Ido Barnea <ibarnea@cisco.com>
[Thomas: comments added]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Thomas Monjalon Feb. 10, 2017, 11:06 a.m. UTC | #1
2017-02-10 12:05, Thomas Monjalon:
> From: Ido Barnea <ibarnea@cisco.com>
> 
> The chosen fake capability (10G) is consistent with the reported
> link speed in virtio_dev_link_update():
> 	link.link_speed = SPEED_10G;
> 
> The feature is not marked in doc/guides/nics/features/virtio.ini
> as it is only a fake value.
> 
> Signed-off-by: Ido Barnea <ibarnea@cisco.com>
> [Thomas: comments added]
> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index d1ff234..4dc03b9 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1835,6 +1835,8 @@  virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	uint64_t tso_mask, host_features;
 	struct virtio_hw *hw = dev->data->dev_private;
 
+	dev_info->speed_capa = ETH_LINK_SPEED_10G; /* fake value */
+
 	dev_info->pci_dev = dev->device ? RTE_DEV_TO_PCI(dev->device) : NULL;
 	dev_info->max_rx_queues =
 		RTE_MIN(hw->max_queue_pairs, VIRTIO_MAX_RX_QUEUES);