[dpdk-dev] [PATCH v11 1/6] net/virtio: replace default virtio speed

Maxime Coquelin maxime.coquelin at redhat.com
Thu Apr 16 13:58:43 CEST 2020



On 4/16/20 1:55 PM, Morten Brørup wrote:
>> From: Ivan Dyukov [mailto:i.dyukov at samsung.com]
>> Sent: Thursday, April 16, 2020 7:53 AM
>>
>> This patch set speed to unknown
>>
>> Signed-off-by: Ivan Dyukov <i.dyukov at samsung.com>
>> ---
>>  drivers/net/virtio/virtio_ethdev.c |  4 ++--
>>  lib/librte_ethdev/rte_ethdev.h     | 27 ++++++++++++++-------------
>>  2 files changed, 16 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_ethdev.c
>> b/drivers/net/virtio/virtio_ethdev.c
>> index f9d0ea70d..e98a76ea2 100644
>> --- a/drivers/net/virtio/virtio_ethdev.c
>> +++ b/drivers/net/virtio/virtio_ethdev.c
>> @@ -2371,7 +2371,7 @@ virtio_dev_link_update(struct rte_eth_dev *dev,
>> __rte_unused int wait_to_complet
>>
>>  	memset(&link, 0, sizeof(link));
>>  	link.link_duplex = ETH_LINK_FULL_DUPLEX;
>> -	link.link_speed  = ETH_SPEED_NUM_10G;
>> +	link.link_speed  = ETH_SPEED_NUM_UNKNOWN;
>>  	link.link_autoneg = ETH_LINK_FIXED;
>>
>>  	if (!hw->started) {
>> @@ -2427,7 +2427,7 @@ 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->speed_capa = ETH_LINK_SPEED_AUTONEG; /* fake value */
> 
> If you indicate that the NIC supports Auto Negotiation here,
> then I suggest that you also change the link status as follows:
> - link.link_autoneg = ETH_LINK_FIXED;
> + link.link_autoneg = ETH_LINK_AUTONEG;
> 
> I considered the opposite change, but if we define that the underlying environment determines the actual speed, then Auto Negotiation seems more correct than Fixed speed.

That's a valid point.
Thank you Morten for spotting this!

Ivan, I can do the change while applying if you are fine with it.

Thanks,
Maxime

> Med venlig hilsen / kind regards
> - Morten Brørup
> 
> 
> 



More information about the dev mailing list