net/virtio: add link speed tuning
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): CGME20191213144450eucas1p189850559438d6f9d5ead48b645e27a79@eucas1p1.samsung.com
PATCH v2 1/1 net/virtio: add link speed tuning
Some applications like pktgen use link_speed to calculate transmit rate. It limits outcome traffic to hardcoded 10G.
This patch makes link_speed configurable at compile time.
--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)
config/common_base +1 -0
@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=n
config/meson.build +1 -0
@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []
drivers/net/vhost/rte_eth_vhost.c +1 -1
@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };
drivers/net/virtio/virtio_ethdev.c +16 -4
@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {
@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =
Signature · 1 line
2.17.1
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;
drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =
I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same value
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
Thanks,
Maxime
Quoted 100 lines · On Fri, 13 Dec 2019 15:59:23 +0100 Maxime Coquelin…
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same value
Quoted 6 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
Thanks,
Maxime
Why does link speed matter at all?
If some code is looking at link speed to compute values like QoS then it will be broken based on how virtualized NIC's work (bytes are free).
It all seems just like a workaround for broke legacy code or advertising.
Quoted 110 lines · Stephen Hemminger
Quoted 100 lines · On Fri, 13 Dec 2019 15:59:23 +0100 Maxime Coquelin…
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same valueQuoted 6 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
Thanks,
Maxime
Quoted 7 lines
Why does link speed matter at all?
If some code is looking at link speed to compute values like QoS then it will be broken based on how virtualized NIC's work (bytes are free).It all seems just like a workaround for broke legacy code or advertising.
In Ivan's case, I agree it should not matter, we could just default to the maximum.
I was thinking about vDPA devices, where I think it could make sense to report the HW link speed.
Hi Maxime,
Thank you for comments.
13.12.2019 17:59, Maxime Coquelin пишет:
Quoted 86 lines
Hi Ivan,
Quoted 83 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +14
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else
Quoted 8 lines
drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 6 lines
drivers/net/virtio/virtio_ethdev.c +2
-0+ dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
I agree. It will be more flexible solution, but it will require another effort. I'll evalutate virtio spec and check if it's suitable for such changes.
Quoted 3 lines
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same value
Current implementation is same. Nothing is broken here. :)
Quoted 2 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
For my case, compile time configuration is ok. Let me prepare solution with devarg then we can choose the better one.
Quoted 2 lines
Thanks,
Maxime
Best regards,
Ivan.
Quoted 99 lines · Ivan Dyukov
Hi Maxime,
Thank you for comments.13.12.2019 17:59, Maxime Coquelin пишет:
Quoted 86 lines
Hi Ivan,
Quoted 83 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +14
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else Quoted 8 lines
drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 6 lines
drivers/net/virtio/virtio_ethdev.c +2
-0+ dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Quoted 3 lines
I agree. It will be more flexible solution, but it will require another effort. I'll evalutate virtio spec and check if it's suitable for such changes.
FYI: https://lists.oasis-open.org/archives/virtio-comment/201911/msg00058.html
Quoted 15 lines
Quoted 3 lines
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same valueCurrent implementation is same. Nothing is broken here. :)
Quoted 2 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
For my case, compile time configuration is ok. Let me prepare solution with devarg then we can choose the better one.
Quoted 2 lines
Thanks,
MaximeBest regards,
Ivan.
Quoted 100 lines · Tiwei Bie
Quoted 99 lines · Ivan Dyukov
Hi Maxime,
Thank you for comments.13.12.2019 17:59, Maxime Coquelin пишет:
Quoted 94 lines
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Quoted 5 lines
Quoted 3 lines
I agree. It will be more flexible solution, but it will require another effort. I'll evalutate virtio spec and check if it's suitable for such changes.
FYI: https://lists.oasis-open.org/archives/virtio-comment/201911/msg00058.html
Great, thanks Tiwei for the pointer!
Quoted 17 lines
Quoted 16 lines
Quoted 4 lines
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same valueCurrent implementation is same. Nothing is broken here. :)
Quoted 2 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
For my case, compile time configuration is ok. Let me prepare solution with devarg then we can choose the better one.
Quoted 2 lines
Thanks,
MaximeBest regards,
Ivan.
Maxime Coquelin
Reviewed-by Michael S. TsirkinHi Ivan,
Quoted 103 lines · Maxime Coquelin
Quoted 100 lines · Tiwei Bie
Quoted 99 lines · Ivan Dyukov
Hi Maxime,
Thank you for comments.13.12.2019 17:59, Maxime Coquelin пишет:
Quoted 94 lines
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I agree. It will be more flexible solution, but it will require another effort. I'll evalutate virtio spec and check if it's suitable for such changes.
FYI: https://lists.oasis-open.org/archives/virtio-comment/201911/msg00058.html
Great, thanks Tiwei for the pointer!
The above spec patch is implemented in Qemu since v2.12:
commit 9473939ed7addcaaeb8fde5c093918fb7fa0919c
Author: Jason Baron <[email protected]> Date: Wed Mar 7 22:25:41 2018 -0500
virtio-net: add linkspeed and duplex settings to virtio-net
Although linkspeed and duplex can be set in a linux guest via
'ethtool -s',
this requires custom ethtool commands for virtio-net by default.
Introduce a new feature flag, VIRTIO_NET_F_SPEED_DUPLEX, which allows the hypervisor to export a linkspeed and duplex setting. The user can subsequently overwrite it later if desired via: 'ethtool -s'.
Linkspeed and duplex settings can be set as:
'-device virtio-net,speed=10000,duplex=full'
where speed is [0...INT_MAX], and duplex is ["half"|"full"].
I think the right way would be to implement it directly in Virtio-net PMD.
Are you willing to do it?
Thanks,
Maxime
Quoted 19 lines
Quoted 18 lines
Quoted 17 lines
Quoted 5 lines
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same valueCurrent implementation is same. Nothing is broken here. :)
Quoted 2 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
For my case, compile time configuration is ok. Let me prepare solution with devarg then we can choose the better one.
Quoted 2 lines
Thanks,
MaximeBest regards,
Ivan.
Hi Maxime,
14.01.2020 12:47, Maxime Coquelin пишет:
Quoted 138 lines
Hi Ivan,
Quoted 102 lines · Maxime Coquelin
Quoted 100 lines · Tiwei Bie
Quoted 99 lines · Ivan Dyukov
Hi Maxime,
Thank you for comments.13.12.2019 17:59, Maxime Coquelin пишет:
Quoted 94 lines
Hi Ivan,
Quoted 79 lines · Ivan Dyukov
Some applications like pktgen use
link_speedto calculate transmit rate. It limits outcome traffic to hardcoded 10G.This patch makes
link_speedconfigurable at compile time.Signed-off-by Ivan Dyukov <[email protected]>--- config/common_base | 1 + config/meson.build | 1 + drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 20 ++++++++++++++++---- 4 files changed, 19 insertions(+), 5 deletions(-)config/common_base +1
-0@@ -433,6 +433,7 @@ CONFIG_RTE_LIBRTE_AVP_DEBUG_BUFFERS=n # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y +CONFIG_RTE_LIBRTE_VIRTIO_LINK_SPEED=10000 CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_RX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX=n CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP=nconfig/meson.build +1
-0@@ -202,6 +202,7 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +dpdk_conf.set('RTE_LIBRTE_VIRTIO_LINK_SPEED', 10000) compile_time_cpuflags = []drivers/net/vhost/rte_eth_vhost.c +1
-1@@ -115,7 +115,7 @@ static struct internal_list_head internal_list =static pthread_mutex_t internal_list_lock =PTHREAD_MUTEX_INITIALIZER ;static struct rte_eth_link pmd_link = { - .link_speed =10000 , + .link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED , .link_duplex =ETH_LINK_FULL_DUPLEX , .link_status =ETH_LINK_DOWN };drivers/net/virtio/virtio_ethdev.c +9
-4@@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_completmemset (&link,0 ,sizeof (link)); link.link_duplex =ETH_LINK_FULL_DUPLEX ; - link.link_speed =ETH_SPEED_NUM_10G ; + link.link_speed =RTE_LIBRTE_VIRTIO_LINK_SPEED ; link.link_autoneg =ETH_LINK_FIXED ;if (!hw->started) {@@ -2426,9 +2426,21 @@ 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 */ - +#if RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_LINK_SPEED_20G + dev_info->speed_capa =ETH_LINK_SPEED_20G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_25G + dev_info->speed_capa =ETH_LINK_SPEED_25G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_40G + dev_info->speed_capa =ETH_LINK_SPEED_40G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_50G + dev_info->speed_capa =ETH_LINK_SPEED_50G ;drivers/net/virtio/virtio_ethdev.c virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) · line 2446
Quoted 10 lines
drivers/net/virtio/virtio_ethdev.c +7
-0+#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_56G + dev_info->speed_capa =ETH_LINK_SPEED_56G ; +#elif RTE_LIBRTE_VIRTIO_LINK_SPEED ==ETH_SPEED_NUM_100G + dev_info->speed_capa =ETH_LINK_SPEED_100G ; +#else + dev_info->speed_capa =ETH_LINK_SPEED_10G ; +#endif dev_info->max_rx_queues =RTE_MIN (hw->max_queue_pairs,VIRTIO_MAX_RX_QUEUES ); dev_info->max_tx_queues =I think we may need toi extend the Virtio specification so that the device can advertise the link speed.
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
I agree. It will be more flexible solution, but it will require another effort. I'll evalutate virtio spec and check if it's suitable for such changes.
Great, thanks Tiwei for the pointer!
The above spec patch is implemented in Qemu since v2.12:
commit
9473939ed7addcaaeb8fde5c093918fb7fa0919cAuthor: Jason Baron <[email protected]> Date: Wed Mar 7 22:25:41 2018 -0500virtio-net: add linkspeed and duplex settings to virtio-net
Although linkspeed and duplex can be set in a linux guest via
'ethtool -s',
this requires custom ethtool commands for virtio-net by default.Introduce a new feature flag,
VIRTIO_NET_F_SPEED_DUPLEX, which allows the hypervisor to export a linkspeed and duplex setting. The user can subsequently overwrite it later if desired via: 'ethtool -s'.Linkspeed and duplex settings can be set as:
'-device virtio-net,speed=10000,duplex=full'where speed is [0...INT_MAX], and duplex is ["half"|"full"].
Signed-off-by Jason Baron <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Jason Wang <[email protected]>Reviewed-by Michael S. Tsirkin <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 4 lines
I think the right way would be to implement it directly in Virtio-net PMD.
Are you willing to do it?
Sorry for delay, I missed this email. I need to reconfigure my emails filters.
Ok I'll take care about it, but I can't promise any dates for it. May be this winter or spring.
Best regards,
Ivan.
Quoted 19 lines
Thanks,
MaximeQuoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 3 lines
Problem with your proposal is that it is build time only, so:
1. It won't be configurable when using distros DPDK package.
2. All the Virtio devices on a system will have the same valueCurrent implementation is same. Nothing is broken here. :)
Quoted 2 lines
While any Virtio spec update introduce link speed support, wouldn't it be preferable to have this as a devarg?
For my case, compile time configuration is ok. Let me prepare solution with devarg then we can choose the better one.
Quoted 2 lines
Thanks,
MaximeBest regards,
Ivan.