[dpdk-dev] [PATCH v13 5/8] ethdev: add speed capabilities

2016-03-30 Thread Marc
On 29 March 2016 at 15:31, Alejandro Lucero 
wrote:

> For nfp.c, speed_capa should be ETH_LINK_SPEED_40G instead of 
> ETH_LINK_SPEED_50G.
> By the way, the change in patch 4 sets the right link speed using the new
> constants.
>
> Regards
>

Noted for v14, thanks

Marc


>
> On Sat, Mar 26, 2016 at 1:27 AM, Marc Sune  wrote:
>
>> The speed capabilities of a device can be retrieved with
>> rte_eth_dev_info_get().
>>
>> The new field speed_capa is initialized in the drivers without
>> taking care of device characteristics in this patch.
>> When the capabilities of a driver are accurate, the table in
>> overview.rst must be filled.
>>
>> Signed-off-by: Marc Sune 
>> ---
>>  doc/guides/nics/overview.rst   |  1 +
>>  doc/guides/rel_notes/release_16_04.rst |  8 
>>  drivers/net/bnx2x/bnx2x_ethdev.c   |  1 +
>>  drivers/net/cxgbe/cxgbe_ethdev.c   |  1 +
>>  drivers/net/e1000/em_ethdev.c  |  4 
>>  drivers/net/e1000/igb_ethdev.c |  4 
>>  drivers/net/ena/ena_ethdev.c   |  9 +
>>  drivers/net/fm10k/fm10k_ethdev.c   |  4 
>>  drivers/net/i40e/i40e_ethdev.c |  8 
>>  drivers/net/ixgbe/ixgbe_ethdev.c   |  8 
>>  drivers/net/mlx4/mlx4.c|  6 ++
>>  drivers/net/mlx5/mlx5_ethdev.c |  8 
>>  drivers/net/nfp/nfp_net.c  |  2 ++
>>  lib/librte_ether/rte_ethdev.h  | 21 +
>>  14 files changed, 85 insertions(+)
>>
>> diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
>> index 542479a..62f1868 100644
>> --- a/doc/guides/nics/overview.rst
>> +++ b/doc/guides/nics/overview.rst
>> @@ -86,6 +86,7 @@ Most of these differences are summarized below.
>>e   e   e   e   e
>>e
>>c   c   c   c   c
>>c
>>  = = = = = = = = = = = = = = = = = = = = = = = =
>> = = = = = = = = =
>> +   speed capabilities
>> link status  X   X X
>>  X X
>> link status eventX X
>>X
>> queue status event
>>X
>> diff --git a/doc/guides/rel_notes/release_16_04.rst
>> b/doc/guides/rel_notes/release_16_04.rst
>> index 79d76e1..9e7b0b7 100644
>> --- a/doc/guides/rel_notes/release_16_04.rst
>> +++ b/doc/guides/rel_notes/release_16_04.rst
>> @@ -47,6 +47,11 @@ This section should contain new features added in this
>> release. Sample format:
>>A new function ``rte_pktmbuf_alloc_bulk()`` has been added to allow
>> the user
>>to allocate a bulk of mbufs.
>>
>> +* **Added device link speed capabilities.**
>> +
>> +  The structure ``rte_eth_dev_info`` has now a ``speed_capa`` bitmap,
>> which
>> +  allows the application to know the supported speeds of each device.
>> +
>>  * **Added new poll-mode driver for Amazon Elastic Network Adapters
>> (ENA).**
>>
>>The driver operates variety of ENA adapters through feature negotiation
>> @@ -456,6 +461,9 @@ This section should contain API changes. Sample
>> format:
>>All drivers are now counting the missed packets only once, i.e.
>> drivers will
>>not increment ierrors anymore for missed packets.
>>
>> +* The ethdev structure ``rte_eth_dev_info`` was changed to support device
>> +  speed capabilities.
>> +
>>  * The functions ``rte_eth_dev_udp_tunnel_add`` and
>> ``rte_eth_dev_udp_tunnel_delete``
>>have been renamed into ``rte_eth_dev_udp_tunnel_port_add`` and
>>``rte_eth_dev_udp_tunnel_port_delete``.
>> diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c
>> b/drivers/net/bnx2x/bnx2x_ethdev.c
>> index a3c6c01..897081f 100644
>> --- a/drivers/net/bnx2x/bnx2x_ethdev.c
>> +++ b/drivers/net/bnx2x/bnx2x_ethdev.c
>> @@ -327,6 +327,7 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev,
>> __rte_unused struct rte_eth_dev_inf
>> dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE;
>> dev_info->max_rx_pktlen  = BNX2X_MAX_RX_PKT_LEN;
>> dev_info->max_mac_addrs  = BNX2X_MAX_MAC_ADDRS;
>> +   dev_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G;
>>  }
>>
>>  static void
>> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c
>> b/drivers/net/cxgbe/cxgbe_ethdev.c
>> index 8845c76..bb134e5 100644
>> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
>> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
>> @@ -171,6 +171,7 @@ static void cxgbe_dev_info_get(struct rte_eth_dev
>> *eth_dev,
>>
>> device_info->rx_desc_lim = cxgbe_desc_lim;
>> device_info->tx_desc_lim = cxgbe_desc_lim;
>> +   device_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G;
>>  }
>>
>>  static void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
>> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
>> index 473d77f..d5f8c7f 100644
>> --- a/drivers/net/e1000/em_ethdev.c
>> +++ b/drivers/net/e1000/em_ethdev.c
>> @@ -1054,6 +1054,10 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct
>> 

[dpdk-dev] [PATCH v13 5/8] ethdev: add speed capabilities

2016-03-29 Thread Alejandro Lucero
For nfp.c, speed_capa should be ETH_LINK_SPEED_40G instead of
ETH_LINK_SPEED_50G.
By the way, the change in patch 4 sets the right link speed using the new
constants.

Regards

On Sat, Mar 26, 2016 at 1:27 AM, Marc Sune  wrote:

> The speed capabilities of a device can be retrieved with
> rte_eth_dev_info_get().
>
> The new field speed_capa is initialized in the drivers without
> taking care of device characteristics in this patch.
> When the capabilities of a driver are accurate, the table in
> overview.rst must be filled.
>
> Signed-off-by: Marc Sune 
> ---
>  doc/guides/nics/overview.rst   |  1 +
>  doc/guides/rel_notes/release_16_04.rst |  8 
>  drivers/net/bnx2x/bnx2x_ethdev.c   |  1 +
>  drivers/net/cxgbe/cxgbe_ethdev.c   |  1 +
>  drivers/net/e1000/em_ethdev.c  |  4 
>  drivers/net/e1000/igb_ethdev.c |  4 
>  drivers/net/ena/ena_ethdev.c   |  9 +
>  drivers/net/fm10k/fm10k_ethdev.c   |  4 
>  drivers/net/i40e/i40e_ethdev.c |  8 
>  drivers/net/ixgbe/ixgbe_ethdev.c   |  8 
>  drivers/net/mlx4/mlx4.c|  6 ++
>  drivers/net/mlx5/mlx5_ethdev.c |  8 
>  drivers/net/nfp/nfp_net.c  |  2 ++
>  lib/librte_ether/rte_ethdev.h  | 21 +
>  14 files changed, 85 insertions(+)
>
> diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
> index 542479a..62f1868 100644
> --- a/doc/guides/nics/overview.rst
> +++ b/doc/guides/nics/overview.rst
> @@ -86,6 +86,7 @@ Most of these differences are summarized below.
>e   e   e   e   e
>e
>c   c   c   c   c
>c
>  = = = = = = = = = = = = = = = = = = = = = = = = =
> = = = = = = = =
> +   speed capabilities
> link status  X   X X
>  X X
> link status eventX X
>X
> queue status event
>X
> diff --git a/doc/guides/rel_notes/release_16_04.rst
> b/doc/guides/rel_notes/release_16_04.rst
> index 79d76e1..9e7b0b7 100644
> --- a/doc/guides/rel_notes/release_16_04.rst
> +++ b/doc/guides/rel_notes/release_16_04.rst
> @@ -47,6 +47,11 @@ This section should contain new features added in this
> release. Sample format:
>A new function ``rte_pktmbuf_alloc_bulk()`` has been added to allow the
> user
>to allocate a bulk of mbufs.
>
> +* **Added device link speed capabilities.**
> +
> +  The structure ``rte_eth_dev_info`` has now a ``speed_capa`` bitmap,
> which
> +  allows the application to know the supported speeds of each device.
> +
>  * **Added new poll-mode driver for Amazon Elastic Network Adapters
> (ENA).**
>
>The driver operates variety of ENA adapters through feature negotiation
> @@ -456,6 +461,9 @@ This section should contain API changes. Sample format:
>All drivers are now counting the missed packets only once, i.e. drivers
> will
>not increment ierrors anymore for missed packets.
>
> +* The ethdev structure ``rte_eth_dev_info`` was changed to support device
> +  speed capabilities.
> +
>  * The functions ``rte_eth_dev_udp_tunnel_add`` and
> ``rte_eth_dev_udp_tunnel_delete``
>have been renamed into ``rte_eth_dev_udp_tunnel_port_add`` and
>``rte_eth_dev_udp_tunnel_port_delete``.
> diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c
> b/drivers/net/bnx2x/bnx2x_ethdev.c
> index a3c6c01..897081f 100644
> --- a/drivers/net/bnx2x/bnx2x_ethdev.c
> +++ b/drivers/net/bnx2x/bnx2x_ethdev.c
> @@ -327,6 +327,7 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev,
> __rte_unused struct rte_eth_dev_inf
> dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE;
> dev_info->max_rx_pktlen  = BNX2X_MAX_RX_PKT_LEN;
> dev_info->max_mac_addrs  = BNX2X_MAX_MAC_ADDRS;
> +   dev_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G;
>  }
>
>  static void
> diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c
> b/drivers/net/cxgbe/cxgbe_ethdev.c
> index 8845c76..bb134e5 100644
> --- a/drivers/net/cxgbe/cxgbe_ethdev.c
> +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
> @@ -171,6 +171,7 @@ static void cxgbe_dev_info_get(struct rte_eth_dev
> *eth_dev,
>
> device_info->rx_desc_lim = cxgbe_desc_lim;
> device_info->tx_desc_lim = cxgbe_desc_lim;
> +   device_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G;
>  }
>
>  static void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 473d77f..d5f8c7f 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -1054,6 +1054,10 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct
> rte_eth_dev_info *dev_info)
> .nb_min = E1000_MIN_RING_DESC,
> .nb_align = EM_TXD_ALIGN,
> };
> +
> +   dev_info->speed_capa = ETH_LINK_SPEED_10M_HD | ETH_LINK_SPEED_10M |
> +

[dpdk-dev] [PATCH v13 5/8] ethdev: add speed capabilities

2016-03-26 Thread Marc Sune
The speed capabilities of a device can be retrieved with
rte_eth_dev_info_get().

The new field speed_capa is initialized in the drivers without
taking care of device characteristics in this patch.
When the capabilities of a driver are accurate, the table in
overview.rst must be filled.

Signed-off-by: Marc Sune 
---
 doc/guides/nics/overview.rst   |  1 +
 doc/guides/rel_notes/release_16_04.rst |  8 
 drivers/net/bnx2x/bnx2x_ethdev.c   |  1 +
 drivers/net/cxgbe/cxgbe_ethdev.c   |  1 +
 drivers/net/e1000/em_ethdev.c  |  4 
 drivers/net/e1000/igb_ethdev.c |  4 
 drivers/net/ena/ena_ethdev.c   |  9 +
 drivers/net/fm10k/fm10k_ethdev.c   |  4 
 drivers/net/i40e/i40e_ethdev.c |  8 
 drivers/net/ixgbe/ixgbe_ethdev.c   |  8 
 drivers/net/mlx4/mlx4.c|  6 ++
 drivers/net/mlx5/mlx5_ethdev.c |  8 
 drivers/net/nfp/nfp_net.c  |  2 ++
 lib/librte_ether/rte_ethdev.h  | 21 +
 14 files changed, 85 insertions(+)

diff --git a/doc/guides/nics/overview.rst b/doc/guides/nics/overview.rst
index 542479a..62f1868 100644
--- a/doc/guides/nics/overview.rst
+++ b/doc/guides/nics/overview.rst
@@ -86,6 +86,7 @@ Most of these differences are summarized below.
   e   e   e   e   e
 e
   c   c   c   c   c
 c
 = = = = = = = = = = = = = = = = = = = = = = = = = = = 
= = = = = =
+   speed capabilities
link status  X   X X   
X X
link status eventX X
 X
queue status event  
 X
diff --git a/doc/guides/rel_notes/release_16_04.rst 
b/doc/guides/rel_notes/release_16_04.rst
index 79d76e1..9e7b0b7 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -47,6 +47,11 @@ This section should contain new features added in this 
release. Sample format:
   A new function ``rte_pktmbuf_alloc_bulk()`` has been added to allow the user
   to allocate a bulk of mbufs.

+* **Added device link speed capabilities.**
+
+  The structure ``rte_eth_dev_info`` has now a ``speed_capa`` bitmap, which
+  allows the application to know the supported speeds of each device.
+
 * **Added new poll-mode driver for Amazon Elastic Network Adapters (ENA).**

   The driver operates variety of ENA adapters through feature negotiation
@@ -456,6 +461,9 @@ This section should contain API changes. Sample format:
   All drivers are now counting the missed packets only once, i.e. drivers will
   not increment ierrors anymore for missed packets.

+* The ethdev structure ``rte_eth_dev_info`` was changed to support device
+  speed capabilities.
+
 * The functions ``rte_eth_dev_udp_tunnel_add`` and 
``rte_eth_dev_udp_tunnel_delete``
   have been renamed into ``rte_eth_dev_udp_tunnel_port_add`` and
   ``rte_eth_dev_udp_tunnel_port_delete``.
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index a3c6c01..897081f 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -327,6 +327,7 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, __rte_unused 
struct rte_eth_dev_inf
dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE;
dev_info->max_rx_pktlen  = BNX2X_MAX_RX_PKT_LEN;
dev_info->max_mac_addrs  = BNX2X_MAX_MAC_ADDRS;
+   dev_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G;
 }

 static void
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 8845c76..bb134e5 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -171,6 +171,7 @@ static void cxgbe_dev_info_get(struct rte_eth_dev *eth_dev,

device_info->rx_desc_lim = cxgbe_desc_lim;
device_info->tx_desc_lim = cxgbe_desc_lim;
+   device_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_40G;
 }

 static void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 473d77f..d5f8c7f 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1054,6 +1054,10 @@ eth_em_infos_get(struct rte_eth_dev *dev, struct 
rte_eth_dev_info *dev_info)
.nb_min = E1000_MIN_RING_DESC,
.nb_align = EM_TXD_ALIGN,
};
+
+   dev_info->speed_capa = ETH_LINK_SPEED_10M_HD | ETH_LINK_SPEED_10M |
+   ETH_LINK_SPEED_100M_HD | ETH_LINK_SPEED_100M |
+   ETH_LINK_SPEED_1G;
 }

 /* return 0 means link status changed, -1 means not changed */
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 86f25f6..95d1711 100644
---