[dpdk-dev] [PATCH v2 6/7] net/bnxt: add 100G speed detection

Ferruh Yigit ferruh.yigit at intel.com
Fri Jan 26 18:08:39 CET 2018


On 1/25/2018 10:47 PM, Ajit Khaparde wrote:
> When the driver is loaded on a 100G NIC, the port speed is not
> displayed correctly. Parse the 100G speed before displaying it.
> 
> Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_hwrm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 8fac05251..d412e51fc 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -2139,6 +2139,8 @@ static uint32_t bnxt_parse_hw_link_speed(uint16_t hw_link_speed)
>  		break;
>  	case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB:
>  		eth_link_speed = ETH_SPEED_NUM_50G;

This case doesn't have a "break" statement, which looks like unintentional, but
if it is intentional please put /* Fallthrough */ comment to prevent build error
[1].


[1]
...dpdk/drivers/net/bnxt/bnxt_hwrm.c: In function ‘bnxt_parse_hw_link_speed’:
...dpdk/drivers/net/bnxt/bnxt_hwrm.c:2141:18: error: this statement may fall
through [-Werror=implicit-fallthrough=]
   eth_link_speed = ETH_SPEED_NUM_50G;
...dpdk/drivers/net/bnxt/bnxt_hwrm.c:2142:2: note: here
  case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB:
  ^~~~

> +	case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB:
> +		eth_link_speed = ETH_SPEED_NUM_100G;
>  		break;
>  	case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2GB:
>  	default:
> 



More information about the dev mailing list