netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev
@ 2024-12-12 17:33 Easwar Hariharan
  2024-12-12 17:33 ` [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Easwar Hariharan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Easwar Hariharan @ 2024-12-12 17:33 UTC (permalink / raw)
  To: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson
  Cc: Easwar Hariharan, netdev, linux-kernel, linux-wireless, ath11k,
	Jeff Johnson

These patches are pulled out from v2 [1] and v3 [2] of my series to be sent
through netdev. The series converts users of msecs_to_jiffies() that need
seconds-denominated timeouts to the new secs_to_jiffies() API in
include/linux/jiffies.h to avoid the multiplication with 1000 or MSEC_PER_SEC.

[1]: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
[2]: https://lore.kernel.org/r/20241210-converge-secs-to-jiffies-v3-0-ddfefd7e9f2a@linux.microsoft.com

Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
Easwar Hariharan (2):
      gve: Convert timeouts to secs_to_jiffies()
      wifi: ath11k: Convert timeouts to secs_to_jiffies()

 drivers/net/ethernet/google/gve/gve_tx_dqo.c | 6 ++----
 drivers/net/wireless/ath/ath11k/debugfs.c    | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)
---
base-commit: 91e71d606356e50f238d7a87aacdee4abc427f07
change-id: 20241211-netdev-converge-secs-to-jiffies-f18b18c775c1

Best regards,
-- 
Easwar Hariharan <eahariha@linux.microsoft.com>


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

* [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies()
  2024-12-12 17:33 [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev Easwar Hariharan
@ 2024-12-12 17:33 ` Easwar Hariharan
  2024-12-12 17:38   ` Praveen Kaligineedi
  2024-12-12 17:33 ` [PATCH net-next v4 2/2] wifi: ath11k: " Easwar Hariharan
  2024-12-15 22:20 ` [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev patchwork-bot+netdevbpf
  2 siblings, 1 reply; 9+ messages in thread
From: Easwar Hariharan @ 2024-12-12 17:33 UTC (permalink / raw)
  To: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson
  Cc: Easwar Hariharan, netdev, linux-kernel, linux-wireless, ath11k

Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies(). As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)

@@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)

Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
 drivers/net/ethernet/google/gve/gve_tx_dqo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
index f879426cb5523a7e150f363b5e57b9d472b5817c..394debc62268aadf2579f9b516e045cb48287e7c 100644
--- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
@@ -1146,8 +1146,7 @@ static void gve_handle_miss_completion(struct gve_priv *priv,
 	/* jiffies can wraparound but time comparisons can handle overflows. */
 	pending_packet->timeout_jiffies =
 			jiffies +
-			msecs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT *
-					 MSEC_PER_SEC);
+			secs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT);
 	add_to_list(tx, &tx->dqo_compl.miss_completions, pending_packet);
 
 	*bytes += pending_packet->skb->len;
@@ -1191,8 +1190,7 @@ static void remove_miss_completions(struct gve_priv *priv,
 		pending_packet->state = GVE_PACKET_STATE_TIMED_OUT_COMPL;
 		pending_packet->timeout_jiffies =
 				jiffies +
-				msecs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT *
-						 MSEC_PER_SEC);
+				secs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT);
 		/* Maintain pending packet in another list so the packet can be
 		 * unallocated at a later time.
 		 */

-- 
2.43.0


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

* [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
  2024-12-12 17:33 [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev Easwar Hariharan
  2024-12-12 17:33 ` [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Easwar Hariharan
@ 2024-12-12 17:33 ` Easwar Hariharan
  2024-12-12 17:51   ` Jeff Johnson
  2024-12-15 22:20 ` [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev patchwork-bot+netdevbpf
  2 siblings, 1 reply; 9+ messages in thread
From: Easwar Hariharan @ 2024-12-12 17:33 UTC (permalink / raw)
  To: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson
  Cc: Easwar Hariharan, netdev, linux-kernel, linux-wireless, ath11k,
	Jeff Johnson

Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies(). As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@@ constant C; @@

- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)

@@ constant C; @@

- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)

Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
---
 drivers/net/wireless/ath/ath11k/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c
index 57281a135dd7fa6b8610636f47873c8bba21053c..bf192529e3fe26a91e72105a77b4c6f849b905ec 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
@@ -178,7 +178,7 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar,
 	 * received 'update stats' event, we keep a 3 seconds timeout in case,
 	 * fw_stats_done is not marked yet
 	 */
-	timeout = jiffies + msecs_to_jiffies(3 * 1000);
+	timeout = jiffies + secs_to_jiffies(3);
 
 	ath11k_debugfs_fw_stats_reset(ar);
 

-- 
2.43.0


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

* Re: [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies()
  2024-12-12 17:33 ` [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Easwar Hariharan
@ 2024-12-12 17:38   ` Praveen Kaligineedi
  0 siblings, 0 replies; 9+ messages in thread
From: Praveen Kaligineedi @ 2024-12-12 17:38 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: Jeroen de Borst, Shailend Chand, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Kalle Valo,
	Jeff Johnson, netdev, linux-kernel, linux-wireless, ath11k

On Thu, Dec 12, 2024 at 9:33 AM Easwar Hariharan
<eahariha@linux.microsoft.com> wrote:
>
> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
> secs_to_jiffies(). As the value here is a multiple of 1000, use
> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
>
> This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
> the following Coccinelle rules:
>
> @@ constant C; @@
>
> - msecs_to_jiffies(C * 1000)
> + secs_to_jiffies(C)
>
> @@ constant C; @@
>
> - msecs_to_jiffies(C * MSEC_PER_SEC)
> + secs_to_jiffies(C)
>
> Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>

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

* Re: [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
  2024-12-12 17:33 ` [PATCH net-next v4 2/2] wifi: ath11k: " Easwar Hariharan
@ 2024-12-12 17:51   ` Jeff Johnson
  2024-12-12 19:17     ` Easwar Hariharan
  0 siblings, 1 reply; 9+ messages in thread
From: Jeff Johnson @ 2024-12-12 17:51 UTC (permalink / raw)
  To: Easwar Hariharan, Jeroen de Borst, Praveen Kaligineedi,
	Shailend Chand, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Kalle Valo, Jeff Johnson
  Cc: netdev, linux-kernel, linux-wireless, ath11k

On 12/12/2024 9:33 AM, Easwar Hariharan wrote:
> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
> 
> secs_to_jiffies(). As the value here is a multiple of 1000, use
> 
> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
> 
> 
> 

something is wrong with your patch since it introduces a blank line after each
line.

Also if you want the ath11k patch to be taken separately, it goes through the
ath tree, not the net tree.

/jeff



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

* Re: [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
  2024-12-12 17:51   ` Jeff Johnson
@ 2024-12-12 19:17     ` Easwar Hariharan
  2024-12-12 19:48       ` Jeff Johnson
  2024-12-12 20:12       ` Jeff Johnson
  0 siblings, 2 replies; 9+ messages in thread
From: Easwar Hariharan @ 2024-12-12 19:17 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson, eahariha, netdev, linux-kernel,
	linux-wireless, ath11k

On 12/12/2024 9:51 AM, Jeff Johnson wrote:
> On 12/12/2024 9:33 AM, Easwar Hariharan wrote:
>> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
>>
>> secs_to_jiffies(). As the value here is a multiple of 1000, use
>>
>> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
>>
>>
>>
> 
> something is wrong with your patch since it introduces a blank line after each
> line.
>

This is some sort of weird interaction between b4 and git send-email. I
used git send-email to send the patches after writing them out with b4
send so as to edit "net-next" into the subject line. It's good to know
to not mix the tools in the future.

I can resend from the branch with git send-email directly to avoid this
if preferred.

> Also if you want the ath11k patch to be taken separately, it goes through the
> ath tree, not the net tree.
> 
> /jeff
> 

I don't have a preference on being taken separately, whatever approach
works best is good with me.

Thanks,
Easwar

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

* Re: [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
  2024-12-12 19:17     ` Easwar Hariharan
@ 2024-12-12 19:48       ` Jeff Johnson
  2024-12-12 20:12       ` Jeff Johnson
  1 sibling, 0 replies; 9+ messages in thread
From: Jeff Johnson @ 2024-12-12 19:48 UTC (permalink / raw)
  To: Easwar Hariharan, Andrew Morton
  Cc: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson, netdev, linux-kernel, linux-wireless,
	ath11k

On 12/12/2024 11:17 AM, Easwar Hariharan wrote:
> On 12/12/2024 9:51 AM, Jeff Johnson wrote:
>> On 12/12/2024 9:33 AM, Easwar Hariharan wrote:
>>> Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
>>>
>>> secs_to_jiffies(). As the value here is a multiple of 1000, use
>>>
>>> secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
>>>
>>>
>>>
>>
>> something is wrong with your patch since it introduces a blank line after each
>> line.
>>
> 
> This is some sort of weird interaction between b4 and git send-email. I
> used git send-email to send the patches after writing them out with b4
> send so as to edit "net-next" into the subject line. It's good to know
> to not mix the tools in the future.
> 
> I can resend from the branch with git send-email directly to avoid this
> if preferred.
> 
>> Also if you want the ath11k patch to be taken separately, it goes through the
>> ath tree, not the net tree.
>>
>> /jeff
>>
> 
> I don't have a preference on being taken separately, whatever approach
> works best is good with me.

Andrew has this in his mm tree, so let's just have it come from there:
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?h=mm-everything&id=b3b550379dd1f0b65fac207c9c4d0eb5ed84775e


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

* Re: [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
  2024-12-12 19:17     ` Easwar Hariharan
  2024-12-12 19:48       ` Jeff Johnson
@ 2024-12-12 20:12       ` Jeff Johnson
  1 sibling, 0 replies; 9+ messages in thread
From: Jeff Johnson @ 2024-12-12 20:12 UTC (permalink / raw)
  To: Easwar Hariharan, Jeff Johnson
  Cc: Jeroen de Borst, Praveen Kaligineedi, Shailend Chand, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kalle Valo, Jeff Johnson, netdev, linux-kernel, linux-wireless,
	ath11k

On 12/12/2024 11:17 AM, Easwar Hariharan wrote:
> This is some sort of weird interaction between b4 and git send-email. I
> used git send-email to send the patches after writing them out with b4
> send so as to edit "net-next" into the subject line. It's good to know
> to not mix the tools in the future.
> 
> I can resend from the branch with git send-email directly to avoid this
> if preferred.
Note that if you have a recent version, b4 prep --set-prefixes can add the
tags to the subject (and keep track of them in the cover letter metadata)


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

* Re: [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev
  2024-12-12 17:33 [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev Easwar Hariharan
  2024-12-12 17:33 ` [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Easwar Hariharan
  2024-12-12 17:33 ` [PATCH net-next v4 2/2] wifi: ath11k: " Easwar Hariharan
@ 2024-12-15 22:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-15 22:20 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: jeroendb, pkaligineedi, shailend, andrew+netdev, davem, edumazet,
	kuba, pabeni, kvalo, jjohnson, netdev, linux-kernel,
	linux-wireless, ath11k, quic_jjohnson

Hello:

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

On Thu, 12 Dec 2024 17:33:00 +0000 you wrote:
> These patches are pulled out from v2 [1] and v3 [2] of my series to be sent
> through netdev. The series converts users of msecs_to_jiffies() that need
> seconds-denominated timeouts to the new secs_to_jiffies() API in
> include/linux/jiffies.h to avoid the multiplication with 1000 or MSEC_PER_SEC.
> 
> [1]: https://lore.kernel.org/r/20241115-converge-secs-to-jiffies-v2-0-911fb7595e79@linux.microsoft.com
> [2]: https://lore.kernel.org/r/20241210-converge-secs-to-jiffies-v3-0-ddfefd7e9f2a@linux.microsoft.com
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/2] gve: Convert timeouts to secs_to_jiffies()
    https://git.kernel.org/netdev/net-next/c/734ff310d38c
  - [net-next,v4,2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies()
    (no matching commit)

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] 9+ messages in thread

end of thread, other threads:[~2024-12-15 22:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 17:33 [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev Easwar Hariharan
2024-12-12 17:33 ` [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Easwar Hariharan
2024-12-12 17:38   ` Praveen Kaligineedi
2024-12-12 17:33 ` [PATCH net-next v4 2/2] wifi: ath11k: " Easwar Hariharan
2024-12-12 17:51   ` Jeff Johnson
2024-12-12 19:17     ` Easwar Hariharan
2024-12-12 19:48       ` Jeff Johnson
2024-12-12 20:12       ` Jeff Johnson
2024-12-15 22:20 ` [PATCH net-next v4 0/2] Converge on using secs_to_jiffies() in netdev 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 NNTP newsgroup(s).