DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/thunderx: add device speed capability info
@ 2017-08-30 11:30 Jerin Jacob
  2017-08-30 13:31 ` Ferruh Yigit
  2017-09-04 15:10 ` [dpdk-dev] [PATCH v2] " Jerin Jacob
  0 siblings, 2 replies; 5+ messages in thread
From: Jerin Jacob @ 2017-08-30 11:30 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Jerin Jacob

updated nicvf feature file to mark support.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 doc/guides/nics/features/thunderx.ini | 1 +
 drivers/net/thunderx/nicvf_ethdev.c   | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/doc/guides/nics/features/thunderx.ini b/doc/guides/nics/features/thunderx.ini
index b9720be6b..626858971 100644
--- a/doc/guides/nics/features/thunderx.ini
+++ b/doc/guides/nics/features/thunderx.ini
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index edc17f1d4..bfad07933 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1380,6 +1380,15 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 
 	dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 
+	/* Autonegotiation may be disabled */
+	dev_info->speed_capa = ETH_LINK_SPEED_FIXED;
+	dev_info->speed_capa |= ETH_LINK_SPEED_10M;
+	dev_info->speed_capa |= ETH_LINK_SPEED_100M;
+	dev_info->speed_capa |= ETH_LINK_SPEED_1G;
+	dev_info->speed_capa |= ETH_LINK_SPEED_10G;
+	if (nicvf_hw_version(nic) != PCI_SUB_DEVICE_ID_CN81XX_NICVF)
+		dev_info->speed_capa |= ETH_LINK_SPEED_40G;
+
 	dev_info->min_rx_bufsize = ETHER_MIN_MTU;
 	dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
 	dev_info->max_rx_queues =
-- 
2.14.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/thunderx: add device speed capability info
  2017-08-30 11:30 [dpdk-dev] [PATCH] net/thunderx: add device speed capability info Jerin Jacob
@ 2017-08-30 13:31 ` Ferruh Yigit
  2017-09-04  6:12   ` Jerin Jacob
  2017-09-04 15:10 ` [dpdk-dev] [PATCH v2] " Jerin Jacob
  1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2017-08-30 13:31 UTC (permalink / raw)
  To: Jerin Jacob, dev

On 8/30/2017 12:30 PM, Jerin Jacob wrote:
> updated nicvf feature file to mark support.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  doc/guides/nics/features/thunderx.ini | 1 +
>  drivers/net/thunderx/nicvf_ethdev.c   | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/doc/guides/nics/features/thunderx.ini b/doc/guides/nics/features/thunderx.ini
> index b9720be6b..626858971 100644
> --- a/doc/guides/nics/features/thunderx.ini
> +++ b/doc/guides/nics/features/thunderx.ini
> @@ -4,6 +4,7 @@
>  ; Refer to default.ini for the full list of available PMD features.
>  ;
>  [Features]
> +Speed capabilities   = Y
>  Link status          = Y
>  Link status event    = Y
>  Queue start/stop     = Y
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index edc17f1d4..bfad07933 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -1380,6 +1380,15 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>  
>  	dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
>  
> +	/* Autonegotiation may be disabled */
> +	dev_info->speed_capa = ETH_LINK_SPEED_FIXED;
> +	dev_info->speed_capa |= ETH_LINK_SPEED_10M;
> +	dev_info->speed_capa |= ETH_LINK_SPEED_100M;
> +	dev_info->speed_capa |= ETH_LINK_SPEED_1G;
> +	dev_info->speed_capa |= ETH_LINK_SPEED_10G;

Why not just "|" them, same result with less code ...

> +	if (nicvf_hw_version(nic) != PCI_SUB_DEVICE_ID_CN81XX_NICVF)
> +		dev_info->speed_capa |= ETH_LINK_SPEED_40G;
> +
>  	dev_info->min_rx_bufsize = ETHER_MIN_MTU;
>  	dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
>  	dev_info->max_rx_queues =
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/thunderx: add device speed capability info
  2017-08-30 13:31 ` Ferruh Yigit
@ 2017-09-04  6:12   ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2017-09-04  6:12 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

-----Original Message-----
> Date: Wed, 30 Aug 2017 14:31:07 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/thunderx: add device speed capability
>  info
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.3.0
> 
> On 8/30/2017 12:30 PM, Jerin Jacob wrote:
> > updated nicvf feature file to mark support.
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> >  doc/guides/nics/features/thunderx.ini | 1 +
> >  drivers/net/thunderx/nicvf_ethdev.c   | 9 +++++++++
> >  2 files changed, 10 insertions(+)
> > 
> > diff --git a/doc/guides/nics/features/thunderx.ini b/doc/guides/nics/features/thunderx.ini
> > index b9720be6b..626858971 100644
> > --- a/doc/guides/nics/features/thunderx.ini
> > +++ b/doc/guides/nics/features/thunderx.ini
> > @@ -4,6 +4,7 @@
> >  ; Refer to default.ini for the full list of available PMD features.
> >  ;
> >  [Features]
> > +Speed capabilities   = Y
> >  Link status          = Y
> >  Link status event    = Y
> >  Queue start/stop     = Y
> > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> > index edc17f1d4..bfad07933 100644
> > --- a/drivers/net/thunderx/nicvf_ethdev.c
> > +++ b/drivers/net/thunderx/nicvf_ethdev.c
> > @@ -1380,6 +1380,15 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> >  
> >  	dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
> >  
> > +	/* Autonegotiation may be disabled */
> > +	dev_info->speed_capa = ETH_LINK_SPEED_FIXED;
> > +	dev_info->speed_capa |= ETH_LINK_SPEED_10M;
> > +	dev_info->speed_capa |= ETH_LINK_SPEED_100M;
> > +	dev_info->speed_capa |= ETH_LINK_SPEED_1G;
> > +	dev_info->speed_capa |= ETH_LINK_SPEED_10G;
> 
> Why not just "|" them, same result with less code ...

I thought it will give better readability. No strong opinion here, I
will respin v2 with your suggestion.

> 
> > +	if (nicvf_hw_version(nic) != PCI_SUB_DEVICE_ID_CN81XX_NICVF)
> > +		dev_info->speed_capa |= ETH_LINK_SPEED_40G;
> > +
> >  	dev_info->min_rx_bufsize = ETHER_MIN_MTU;
> >  	dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
> >  	dev_info->max_rx_queues =
> > 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/thunderx: add device speed capability info
  2017-08-30 11:30 [dpdk-dev] [PATCH] net/thunderx: add device speed capability info Jerin Jacob
  2017-08-30 13:31 ` Ferruh Yigit
@ 2017-09-04 15:10 ` Jerin Jacob
  2017-09-11 13:42   ` Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2017-09-04 15:10 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Jerin Jacob

updated nicvf feature file to mark support.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2:
* Rearranged ETH_LINK_SPEED_10M, ETH_LINK_SPEED_100M, ETH_LINK_SPEED_1G,
ETH_LINK_SPEED_10G to single line
---
 doc/guides/nics/features/thunderx.ini | 1 +
 drivers/net/thunderx/nicvf_ethdev.c   | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/doc/guides/nics/features/thunderx.ini b/doc/guides/nics/features/thunderx.ini
index b9720be6b..626858971 100644
--- a/doc/guides/nics/features/thunderx.ini
+++ b/doc/guides/nics/features/thunderx.ini
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index edc17f1d4..4654a4ced 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -1380,6 +1380,13 @@ nicvf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 
 	dev_info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 
+	/* Autonegotiation may be disabled */
+	dev_info->speed_capa = ETH_LINK_SPEED_FIXED;
+	dev_info->speed_capa |= ETH_LINK_SPEED_10M | ETH_LINK_SPEED_100M |
+				 ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G;
+	if (nicvf_hw_version(nic) != PCI_SUB_DEVICE_ID_CN81XX_NICVF)
+		dev_info->speed_capa |= ETH_LINK_SPEED_40G;
+
 	dev_info->min_rx_bufsize = ETHER_MIN_MTU;
 	dev_info->max_rx_pktlen = NIC_HW_MAX_FRS;
 	dev_info->max_rx_queues =
-- 
2.14.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/thunderx: add device speed capability info
  2017-09-04 15:10 ` [dpdk-dev] [PATCH v2] " Jerin Jacob
@ 2017-09-11 13:42   ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-09-11 13:42 UTC (permalink / raw)
  To: Jerin Jacob, dev

On 9/4/2017 4:10 PM, Jerin Jacob wrote:
> updated nicvf feature file to mark support.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-11 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 11:30 [dpdk-dev] [PATCH] net/thunderx: add device speed capability info Jerin Jacob
2017-08-30 13:31 ` Ferruh Yigit
2017-09-04  6:12   ` Jerin Jacob
2017-09-04 15:10 ` [dpdk-dev] [PATCH v2] " Jerin Jacob
2017-09-11 13:42   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).