[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220921224430.20395-1-vfedorenko@novek.ru>
Date: Thu, 22 Sep 2022 01:44:30 +0300
From: Vadim Fedorenko <vfedorenko@...ek.ru>
To: Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>,
netdev@...r.kernel.org
Cc: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Vadim Fedorenko <vfedorenko@...ek.ru>,
Richard Cochran <richardcochran@...il.com>
Subject: [PATCH net v2] bnxt_en: replace reset with config timestamps
Any change to the hardware timestamps configuration triggers nic restart,
which breaks transmition and reception of network packets for a while.
But there is no need to fully restart the device because while configuring
hardware timestamps. The code for changing configuration runs after all
of the initialisation, when the NIC is actually up and running. This patch
changes the code that ioctl will only update configuration registers and
will not trigger carrier status change, but in case of timestamps for
all rx packetes it fallbacks to close()/open() sequnce because of
synchronization issues in the hardware. Tested on BCM57504.
Fixes: 11862689e8f1 ("bnxt_en: Configure ptp filters during bnxt open")
Cc: Richard Cochran <richardcochran@...il.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@...ek.ru>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index 8e316367f6ce..8c8492ee406a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -505,9 +505,12 @@ static int bnxt_hwrm_ptp_cfg(struct bnxt *bp)
ptp->tstamp_filters = flags;
if (netif_running(bp->dev)) {
- rc = bnxt_close_nic(bp, false, false);
- if (!rc)
- rc = bnxt_open_nic(bp, false, false);
+ if (ptp->rx_filter == PORT_MAC_CFG_REQ_FLAGS_ALL_RX_TS_CAPTURE_ENABLE) {
+ rc = bnxt_close_nic(bp, false, false);
+ if (!rc)
+ rc = bnxt_open_nic(bp, false, false);
+ } else
+ bnxt_ptp_cfg_tstamp_filters(bp);
if (!rc && !ptp->tstamp_filters)
rc = -EIO;
}
--
2.27.0
Powered by blists - more mailing lists