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

Message ID 20180125224757.82325-7-ajit.khaparde@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ajit Khaparde Jan. 25, 2018, 10:47 p.m. UTC
  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@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ferruh Yigit Jan. 26, 2018, 5:08 p.m. UTC | #1
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@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:
>
  
Ajit Khaparde Jan. 26, 2018, 5:31 p.m. UTC | #2
Please apply this patchset.

Ajit Khaparde (6):
  net/bnxt: fix size of tx ring in HW
  net/bnxt: use driver specific dynamic log type
  net/bnxt: register for more async events
  net/bnxt: check if MAC address is all zeros
  net/bnxt: add 100G speed detection
  net/bnxt: fix number of pools for RSS

Somnath Kotur (1):
  net/bnxt: support for rx/tx_queue_start/stop ops

 drivers/net/bnxt/bnxt.h         |   8 ++
 drivers/net/bnxt/bnxt_cpr.c     |  19 ++-
 drivers/net/bnxt/bnxt_ethdev.c  | 282 +++++++++++++++++++++-------------------
 drivers/net/bnxt/bnxt_filter.c  |  44 +++----
 drivers/net/bnxt/bnxt_filter.h  |   1 +
 drivers/net/bnxt/bnxt_hwrm.c    | 182 +++++++++++++++-----------
 drivers/net/bnxt/bnxt_hwrm.h    |  13 ++
 drivers/net/bnxt/bnxt_irq.c     |   4 +-
 drivers/net/bnxt/bnxt_ring.c    |  12 +-
 drivers/net/bnxt/bnxt_rxq.c     |  77 +++++++++--
 drivers/net/bnxt/bnxt_rxq.h     |   6 +-
 drivers/net/bnxt/bnxt_rxr.c     |  23 ++--
 drivers/net/bnxt/bnxt_rxr.h     |   3 +-
 drivers/net/bnxt/bnxt_stats.c   |  16 +--
 drivers/net/bnxt/bnxt_txq.c     |  10 +-
 drivers/net/bnxt/bnxt_txq.h     |   1 -
 drivers/net/bnxt/bnxt_txr.c     |  34 ++++-
 drivers/net/bnxt/bnxt_txr.h     |   2 +
 drivers/net/bnxt/bnxt_vnic.c    |  14 +-
 drivers/net/bnxt/bnxt_vnic.h    |   1 -
 drivers/net/bnxt/rte_pmd_bnxt.c |  48 +++----
 21 files changed, 482 insertions(+), 318 deletions(-)
  
Ajit Khaparde Jan. 26, 2018, 5:33 p.m. UTC | #3
On Fri, Jan 26, 2018 at 9:08 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> 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@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].
>
​No. Its unintentional. I copy pasted those lines from the test setup and
​missed it.

I am sending a fresh set. ​Thanks​


>
> [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:
> >
>
>
  
Ferruh Yigit Jan. 26, 2018, 6 p.m. UTC | #4
On 1/26/2018 5:31 PM, Ajit Khaparde wrote:
> Please apply this patchset.
> 
> Ajit Khaparde (6):
>   net/bnxt: fix size of tx ring in HW
>   net/bnxt: use driver specific dynamic log type
>   net/bnxt: register for more async events
>   net/bnxt: check if MAC address is all zeros
>   net/bnxt: add 100G speed detection
>   net/bnxt: fix number of pools for RSS
> 
> Somnath Kotur (1):
>   net/bnxt: support for rx/tx_queue_start/stop ops

Series applied to dpdk-next-net/master, thanks.
  

Patch

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;
+	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: