Skip to contentSkip to conversation

Fill speed_capa for virtio

PATCH In review Ido Barnea (ibarnea) 2 participants 6 messages Feb 2, 2017 – Feb 10, 2017 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Fill speed_capa for virtio

From: Ido Barnea <[email protected]>

---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/virtio/virtio_ethdev.c +1 -0
index d1ff234..1d572b5 100644
@@ -1869,6 +1869,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		(1ULL << VIRTIO_NET_F_HOST_TSO6);
 	if ((hw->guest_features & tso_mask) == tso_mask)
 		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
+	dev_info->speed_capa = ETH_LINK_SPEED_10G;
 }/*
Signature · 1 line
2.8.3
#2 lore raw

2017-02-02 12:05, Ido Barnea:

Quoted 12 lines

From: Ido Barnea <[email protected]>

---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/virtio/virtio_ethdev.c +0 -0
index d1ff234..1d572b5 100644

drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 1872

Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +1 -0
@@ -1869,6 +1869,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		(1ULL << VIRTIO_NET_F_HOST_TSO6);
 	if ((hw->guest_features & tso_mask) == tso_mask)
 		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
+	dev_info->speed_capa = ETH_LINK_SPEED_10G;

Why 10G ?
Yuanhan, any opinion?

#3 lore raw

Just wanted this to be consistent with below (From virtio_dev_link_update):
link.link_speed = SPEED_10G;

Need to put some value in speed_capa.

Ido

Quoted 20 lines · Thomas Monjalon

2017-02-02 12:05, Ido Barnea:

Quoted 12 lines

From: Ido Barnea <[email protected]>

---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/virtio/virtio_ethdev.c +0 -0
index d1ff234..1d572b5 100644

drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 1872

Quoted 4 lines
drivers/net/virtio/virtio_ethdev.c +1 -0
@@ -1869,6 +1869,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		(1ULL << VIRTIO_NET_F_HOST_TSO6);
 	if ((hw->guest_features & tso_mask) == tso_mask)
 		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
+	dev_info->speed_capa = ETH_LINK_SPEED_10G;

Why 10G ?
Yuanhan, any opinion?

#4 lore raw

2017-02-10 07:49, Ido Barnea:

Quoted 22 lines · Thomas Monjalon
Quoted 8 lines

2017-02-02 12:05, Ido Barnea:

Quoted 7 lines

From: Ido Barnea <[email protected]>

---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 1872

Quoted 9 lines
drivers/net/virtio/virtio_ethdev.c +1 -0
index d1ff234..1d572b5 100644
@@ -1869,6 +1869,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 		(1ULL << VIRTIO_NET_F_HOST_TSO6);
 	if ((hw->guest_features & tso_mask) == tso_mask)
 		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;
+	dev_info->speed_capa = ETH_LINK_SPEED_10G;

Why 10G ?
Yuanhan, any opinion?

Quoted 2 lines

Just wanted this to be consistent with below (From virtio_dev_link_update):
link.link_speed = SPEED_10G;

OK, that's the kind of justification which are good to have in the commit message.

#5 lore raw

PATCH v2 1/1 net/virtio: add speed capability

From: Ido Barnea <[email protected]>

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.

[Thomas: comments added]
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/virtio/virtio_ethdev.c +2 -0
index d1ff234..4dc03b9 100644
@@ -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);
Signature · 1 line
2.7.0
#6 lore raw

Re: [PATCH v2] net/virtio: add speed capability

2017-02-10 12:05, Thomas Monjalon:

Quoted 4 lines

From: Ido Barnea <[email protected]>

The chosen fake capability (10G) is consistent with the reported link speed in virtio_dev_link_update():

Quoted 8 lines
	link.link_speed = SPEED_10G;

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

[Thomas: comments added]

Applied, thanks