[dpdk-dev] [PATCH 2/2] ethdev: allow unknown link speed
Jerin Jacob
jerinjacobk at gmail.com
Wed Apr 8 07:39:33 CEST 2020
On Wed, Apr 8, 2020 at 3:57 AM Thomas Monjalon <thomas at monjalon.net> wrote:
>
> When querying the link informations, the link status is
> a mandatory major information.
> Other boolean values are supposed to be accurate:
> - duplex mode (half/full)
> - negotiation (auto/fixed)
>
> This API update is making explicit that the link speed information
> is optional.
> The value ETH_SPEED_NUM_NONE (0) was already part of the API.
> The value ETH_SPEED_NUM_UNKNOWN (infinite) is added to cover
> two different cases:
> - speed is not known by the driver
> - device is virtual
LGTM.
>
> Suggested-by: Morten Brørup <mb at smartsharesystems.com>
> Suggested-by: Benoit Ganne <bganne at cisco.com>
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> ---
> lib/librte_ethdev/rte_ethdev.h | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index d1a593ad11..2d51fd3444 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -300,6 +300,7 @@ struct rte_eth_stats {
> #define ETH_SPEED_NUM_50G 50000 /**< 50 Gbps */
> #define ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */
> #define ETH_SPEED_NUM_100G 100000 /**< 100 Gbps */
> +#define ETH_SPEED_NUM_UNKNOWN UINT32_MAX /**< Unknown */
IMO, It is better to add the following information in the same or
other words under @note in Doxygen comment
for the release documentation perspective.
The value ETH_SPEED_NUM_UNKNOWN (infinite) is added to cover
two different cases:
- speed is not known by the driver
- device is virtual
More information about the dev
mailing list