All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3] bnxt_en: replace reset with config timestamps
@ 2022-09-22 19:10 Vadim Fedorenko
  2022-09-22 20:04 ` Michael Chan
  2022-09-23  0:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Vadim Fedorenko @ 2022-09-22 19:10 UTC (permalink / raw)
  To: Michael Chan, Pavan Chebbi, netdev
  Cc: Jakub Kicinski, David S. Miller, Vadim Fedorenko, Richard Cochran

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.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index 7f3c0875b6f5..bd86919799ad 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -505,9 +505,13 @@ 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 == HWTSTAMP_FILTER_ALL) {
+			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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] bnxt_en: replace reset with config timestamps
  2022-09-22 19:10 [PATCH net-next v3] bnxt_en: replace reset with config timestamps Vadim Fedorenko
@ 2022-09-22 20:04 ` Michael Chan
  2022-09-23  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2022-09-22 20:04 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Pavan Chebbi, Netdev, Jakub Kicinski, David S. Miller, Richard Cochran

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On Thu, Sep 22, 2022 at 12:11 PM Vadim Fedorenko <vfedorenko@novek.ru> wrote:
>
> 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.
>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>

Thanks.
Reviewed-by: Michael Chan <michael.chan@broadcom.com>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] bnxt_en: replace reset with config timestamps
  2022-09-22 19:10 [PATCH net-next v3] bnxt_en: replace reset with config timestamps Vadim Fedorenko
  2022-09-22 20:04 ` Michael Chan
@ 2022-09-23  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-23  0:40 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: michael.chan, pavan.chebbi, netdev, kuba, davem, richardcochran

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 22 Sep 2022 22:10:38 +0300 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,v3] bnxt_en: replace reset with config timestamps
    https://git.kernel.org/netdev/net-next/c/8db3d514e967

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-23  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 19:10 [PATCH net-next v3] bnxt_en: replace reset with config timestamps Vadim Fedorenko
2022-09-22 20:04 ` Michael Chan
2022-09-23  0:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.