mbox series

[net,0/9] bnxt_en: Bug fixes

Message ID 1626636993-31926-1-git-send-email-michael.chan@broadcom.com
Headers show
Series bnxt_en: Bug fixes | expand

Message

Michael Chan July 18, 2021, 7:36 p.m. UTC
Most of the fixes in this series have to do with error recovery.  They
include error path handling when the error recovery has to abort, and
the rediscovery of capabilities (PTP and RoCE) after firmware reset
that may result in capability changes.

Two other fixes are to reject invalid ETS settings and to validate
VLAN protocol in the RX path.

Edwin Peer (1):
  bnxt_en: reject ETS settings that will starve a TC

Kalesh AP (1):
  bnxt_en: don't disable an already disabled PCI device

Michael Chan (5):
  bnxt_en: Refresh RoCE capabilities in bnxt_ulp_probe()
  bnxt_en: Add missing check for BNXT_STATE_ABORT_ERR in
    bnxt_fw_rset_task()
  bnxt_en: Validate vlan protocol ID on RX packets
  bnxt_en: Move bnxt_ptp_init() to bnxt_open()
  bnxt_en: Fix PTP capability discovery

Somnath Kotur (2):
  bnxt_en: fix error path of FW reset
  bnxt_en: Check abort error state in bnxt_half_open_nic()

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 85 ++++++++++++++-----
 drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 10 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 24 ++----
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h |  1 -
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c |  9 +-
 5 files changed, 83 insertions(+), 46 deletions(-)

Comments

Jakub Kicinski July 19, 2021, 10:43 a.m. UTC | #1
On Sun, 18 Jul 2021 15:36:32 -0400, Michael Chan wrote:
> The device needs to be in ifup state for PTP to function, so move

> bnxt_ptp_init() to bnxt_open().  This means that the PHC will be

> registered during bnxt_open().


I think it's an anti-pattern to have the clock registered only when
the device is up. Right, Richard?

IIRC Intel parts did it in the past because they had the clock hooked
up to the MAC/PHY so the clock was not actually ticking. But seems like
a wrong trade off to unreg PTP for SW convenience. Or maybe I'm
biased against the live FW reset :) Let's see if Richard agrees.

> This also makes firmware reset work correctly.  PTP configurations

> may change after firmware upgrade or downgrade.  bnxt_open() will

> be called after firmware reset, so it will work properly.

> 

> bnxt_ptp_start() is now incorporated into bnxt_ptp_init().  We now

> also need to call bnxt_ptp_clear() in bnxt_close().
patchwork-bot+netdevbpf@kernel.org July 19, 2021, 4 p.m. UTC | #2
Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Sun, 18 Jul 2021 15:36:24 -0400 you wrote:
> Most of the fixes in this series have to do with error recovery.  They

> include error path handling when the error recovery has to abort, and

> the rediscovery of capabilities (PTP and RoCE) after firmware reset

> that may result in capability changes.

> 

> Two other fixes are to reject invalid ETS settings and to validate

> VLAN protocol in the RX path.

> 

> [...]


Here is the summary with links:
  - [net,1/9] bnxt_en: don't disable an already disabled PCI device
    https://git.kernel.org/netdev/net/c/c81cfb6256d9
  - [net,2/9] bnxt_en: reject ETS settings that will starve a TC
    https://git.kernel.org/netdev/net/c/c08c59653415
  - [net,3/9] bnxt_en: Refresh RoCE capabilities in bnxt_ulp_probe()
    https://git.kernel.org/netdev/net/c/2c9f046bc377
  - [net,4/9] bnxt_en: Add missing check for BNXT_STATE_ABORT_ERR in bnxt_fw_rset_task()
    https://git.kernel.org/netdev/net/c/6cd657cb3ee6
  - [net,5/9] bnxt_en: fix error path of FW reset
    https://git.kernel.org/netdev/net/c/3958b1da725a
  - [net,6/9] bnxt_en: Validate vlan protocol ID on RX packets
    https://git.kernel.org/netdev/net/c/96bdd4b9ea7e
  - [net,7/9] bnxt_en: Check abort error state in bnxt_half_open_nic()
    https://git.kernel.org/netdev/net/c/11a39259ff79
  - [net,8/9] bnxt_en: Move bnxt_ptp_init() to bnxt_open()
    https://git.kernel.org/netdev/net/c/d7859afb6880
  - [net,9/9] bnxt_en: Fix PTP capability discovery
    https://git.kernel.org/netdev/net/c/de5bf19414fe

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Richard Cochran July 19, 2021, 5:07 p.m. UTC | #3
On Mon, Jul 19, 2021 at 12:43:23PM +0200, Jakub Kicinski wrote:
> On Sun, 18 Jul 2021 15:36:32 -0400, Michael Chan wrote:

> > The device needs to be in ifup state for PTP to function, so move

> > bnxt_ptp_init() to bnxt_open().  This means that the PHC will be

> > registered during bnxt_open().

> 

> I think it's an anti-pattern to have the clock registered only when

> the device is up. Right, Richard?


Yes, indeed.

> IIRC Intel parts did it in the past because they had the clock hooked

> up to the MAC/PHY so the clock was not actually ticking. But seems like

> a wrong trade off to unreg PTP for SW convenience. Or maybe I'm

> biased against the live FW reset :) Let's see if Richard agrees.


Totally agree!

Ideally the PHC appears as soon as the driver instantiates for a HW
device.  Telling time from the clock is independent from the network
interface being up or down.

Some drivers are lazy and fail to decouple these two orthogonal
issues.  In some (all?) cases, there is no HW limitation involved,
just sloppy driver work.

Thanks,
Richard
Michael Chan July 20, 2021, 5:29 a.m. UTC | #4
On Mon, Jul 19, 2021 at 10:07 AM Richard Cochran
<richardcochran@gmail.com> wrote:

> Ideally the PHC appears as soon as the driver instantiates for a HW

> device.  Telling time from the clock is independent from the network

> interface being up or down.

>

OK.  Will improve this in follow on patches to keep the PHC registered
unless the firmware after reset no longer supports PTP.  Thanks.