Netdev Archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask
@ 2023-04-07 18:45 Brett Creeley
  2023-04-08 13:32 ` Simon Horman
  2023-04-12  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Brett Creeley @ 2023-04-07 18:45 UTC (permalink / raw
  To: davem, netdev, kuba; +Cc: drivers, shannon.nelson, brett.creeley, allen.hubbe

The driver was incorrectly overwriting the cyclecounter bitmask,
which was truncating it and not aligning to the hardware mask value.
This isn't causing any issues, but it's wrong. Fix this by not
constraining the cyclecounter/hardware mask.

Luckily, this seems to cause no issues, which is why this change
doesn't have a fixes tag and isn't being sent to net. However, if
any transformations from time->cycles are needed in the future,
this change will be needed.

Suggested-by: Allen Hubbe <allen.hubbe@amd.com>
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
index eac2f0e3576e..7505efdff8e9 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c
@@ -579,11 +579,10 @@ void ionic_lif_alloc_phc(struct ionic_lif *lif)
 	diff |= diff >> 16;
 	diff |= diff >> 32;
 
-	/* constrain to the hardware bitmask, and use this as the bitmask */
+	/* constrain to the hardware bitmask */
 	diff &= phc->cc.mask;
-	phc->cc.mask = diff;
 
-	/* the wrap period is now defined by diff (or phc->cc.mask)
+	/* the wrap period is now defined by diff
 	 *
 	 * we will update the time basis at about 1/4 the wrap period, so
 	 * should not see a difference of more than +/- diff/4.
-- 
2.17.1


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

* Re: [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask
  2023-04-07 18:45 [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask Brett Creeley
@ 2023-04-08 13:32 ` Simon Horman
  2023-04-12  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-04-08 13:32 UTC (permalink / raw
  To: Brett Creeley; +Cc: davem, netdev, kuba, drivers, shannon.nelson, allen.hubbe

On Fri, Apr 07, 2023 at 11:45:39AM -0700, Brett Creeley wrote:
> The driver was incorrectly overwriting the cyclecounter bitmask,
> which was truncating it and not aligning to the hardware mask value.
> This isn't causing any issues, but it's wrong. Fix this by not
> constraining the cyclecounter/hardware mask.
> 
> Luckily, this seems to cause no issues, which is why this change
> doesn't have a fixes tag and isn't being sent to net. However, if
> any transformations from time->cycles are needed in the future,
> this change will be needed.
> 
> Suggested-by: Allen Hubbe <allen.hubbe@amd.com>
> Signed-off-by: Brett Creeley <brett.creeley@amd.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>


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

* Re: [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask
  2023-04-07 18:45 [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask Brett Creeley
  2023-04-08 13:32 ` Simon Horman
@ 2023-04-12  8:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-12  8:40 UTC (permalink / raw
  To: Brett Creeley; +Cc: davem, netdev, kuba, drivers, shannon.nelson, allen.hubbe

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 7 Apr 2023 11:45:39 -0700 you wrote:
> The driver was incorrectly overwriting the cyclecounter bitmask,
> which was truncating it and not aligning to the hardware mask value.
> This isn't causing any issues, but it's wrong. Fix this by not
> constraining the cyclecounter/hardware mask.
> 
> Luckily, this seems to cause no issues, which is why this change
> doesn't have a fixes tag and isn't being sent to net. However, if
> any transformations from time->cycles are needed in the future,
> this change will be needed.
> 
> [...]

Here is the summary with links:
  - [net-next] ionic: Don't overwrite the cyclecounter bitmask
    https://git.kernel.org/netdev/net-next/c/be690daa224e

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:[~2023-04-12  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 18:45 [PATCH net-next] ionic: Don't overwrite the cyclecounter bitmask Brett Creeley
2023-04-08 13:32 ` Simon Horman
2023-04-12  8:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).