[dpdk-dev] Fill speed_capa for virtio

Message ID 329CA03F-B2B1-4187-945D-59973EEDF368@cisco.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/Intel compilation success Compilation OK

Commit Message

Ido Barnea (ibarnea) Feb. 2, 2017, 12:05 p.m. UTC
  From: Ido Barnea <ibarnea@cisco.com>


Signed-off-by: Ido Barnea <ibarnea@cisco.com>

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

Comments

Thomas Monjalon Feb. 9, 2017, 4:19 p.m. UTC | #1
2017-02-02 12:05, Ido Barnea:
> From: Ido Barnea <ibarnea@cisco.com>
> 
> Signed-off-by: Ido Barnea <ibarnea@cisco.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index d1ff234..1d572b5 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -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?
  
Ido Barnea (ibarnea) Feb. 10, 2017, 7:49 a.m. UTC | #2
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




On 09/02/2017, 6:19 PM, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote:

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

>> From: Ido Barnea <ibarnea@cisco.com>

>> 

>> Signed-off-by: Ido Barnea <ibarnea@cisco.com>

>> ---

>>  drivers/net/virtio/virtio_ethdev.c | 1 +

>>  1 file changed, 1 insertion(+)

>> 

>> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c

>> index d1ff234..1d572b5 100644

>> --- a/drivers/net/virtio/virtio_ethdev.c

>> +++ b/drivers/net/virtio/virtio_ethdev.c

>> @@ -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?
  
Thomas Monjalon Feb. 10, 2017, 8:41 a.m. UTC | #3
2017-02-10 07:49, Ido Barnea:
> On 09/02/2017, 6:19 PM, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote:
> >2017-02-02 12:05, Ido Barnea:
> >> From: Ido Barnea <ibarnea@cisco.com>
> >> 
> >> Signed-off-by: Ido Barnea <ibarnea@cisco.com>
> >> ---
> >>  drivers/net/virtio/virtio_ethdev.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> >> index d1ff234..1d572b5 100644
> >> --- a/drivers/net/virtio/virtio_ethdev.c
> >> +++ b/drivers/net/virtio/virtio_ethdev.c
> >> @@ -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?
> 
> 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.
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index d1ff234..1d572b5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -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;
 }/*
-- 
2.8.3