diff mbox series

drivers/net: remove useless autoneg capability

Message ID 20210329072854.450188-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series drivers/net: remove useless autoneg capability | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/checkpatch success coding style OK

Commit Message

Thomas Monjalon March 29, 2021, 7:28 a.m. UTC
The flag ETH_LINK_SPEED_AUTONEG is 0,
so it cannot be used in a capability bitmap.

Having 0 in speed capability means all speeds are accepted.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/bnxt/bnxt_ethdev.c          | 2 --
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ----
 2 files changed, 6 deletions(-)

Comments

Ajit Khaparde March 29, 2021, 2:12 p.m. UTC | #1
On Mon, Mar 29, 2021 at 12:29 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The flag ETH_LINK_SPEED_AUTONEG is 0,
> so it cannot be used in a capability bitmap.
>
> Having 0 in speed capability means all speeds are accepted.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c          | 2 --
For bnxt
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

>  drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ----
>  2 files changed, 6 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index f1dd40591f..a2debdbb64 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -889,8 +889,6 @@ uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
>         if (bp->link_info->auto_mode ==
>             HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE)
>                 speed_capa |= ETH_LINK_SPEED_FIXED;
> -       else
> -               speed_capa |= ETH_LINK_SPEED_AUTONEG;
>
>         return speed_capa;
>  }
> diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
> index 0e8de9439e..58d56913ae 100644
> --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
> +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
> @@ -409,8 +409,6 @@ mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev,
>         else
>                 dev_link.link_speed = link_speed;
>         priv->link_speed_capa = 0;
> -       if (edata.supported & SUPPORTED_Autoneg)
> -               priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
>         if (edata.supported & (SUPPORTED_1000baseT_Full |
>                                SUPPORTED_1000baseKX_Full))
>                 priv->link_speed_capa |= ETH_LINK_SPEED_1G;
> @@ -517,8 +515,6 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
>         sc = ecmd->link_mode_masks[0] |
>                 ((uint64_t)ecmd->link_mode_masks[1] << 32);
>         priv->link_speed_capa = 0;
> -       if (sc & MLX5_BITSHIFT(ETHTOOL_LINK_MODE_Autoneg_BIT))
> -               priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
>         if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseT_Full_BIT) |
>                   MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT)))
>                 priv->link_speed_capa |= ETH_LINK_SPEED_1G;
> --
> 2.30.1
>
Ferruh Yigit April 1, 2021, 1:26 p.m. UTC | #2
On 3/29/2021 3:12 PM, Ajit Khaparde wrote:
> On Mon, Mar 29, 2021 at 12:29 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>> The flag ETH_LINK_SPEED_AUTONEG is 0,
>> so it cannot be used in a capability bitmap.
>>
>> Having 0 in speed capability means all speeds are accepted.
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>> ---
>>   drivers/net/bnxt/bnxt_ethdev.c          | 2 --
> For bnxt
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> 

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f1dd40591f..a2debdbb64 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -889,8 +889,6 @@  uint32_t bnxt_get_speed_capabilities(struct bnxt *bp)
 	if (bp->link_info->auto_mode ==
 	    HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_MODE_NONE)
 		speed_capa |= ETH_LINK_SPEED_FIXED;
-	else
-		speed_capa |= ETH_LINK_SPEED_AUTONEG;
 
 	return speed_capa;
 }
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 0e8de9439e..58d56913ae 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -409,8 +409,6 @@  mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev,
 	else
 		dev_link.link_speed = link_speed;
 	priv->link_speed_capa = 0;
-	if (edata.supported & SUPPORTED_Autoneg)
-		priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
 	if (edata.supported & (SUPPORTED_1000baseT_Full |
 			       SUPPORTED_1000baseKX_Full))
 		priv->link_speed_capa |= ETH_LINK_SPEED_1G;
@@ -517,8 +515,6 @@  mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
 	sc = ecmd->link_mode_masks[0] |
 		((uint64_t)ecmd->link_mode_masks[1] << 32);
 	priv->link_speed_capa = 0;
-	if (sc & MLX5_BITSHIFT(ETHTOOL_LINK_MODE_Autoneg_BIT))
-		priv->link_speed_capa |= ETH_LINK_SPEED_AUTONEG;
 	if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseT_Full_BIT) |
 		  MLX5_BITSHIFT(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT)))
 		priv->link_speed_capa |= ETH_LINK_SPEED_1G;