Skip to contentSkip to conversation

net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies()

PATCH RESEND Applied Thorsten Blum 4 participants 4 messages Feb 21, 2025 – Feb 25, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies()

Use secs_to_jiffies() and simplify the code.

---
Resend with "net-next" in the title as suggested by Jacob and Saeed.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +1 -1
index 3dbd4efa21a2..19dce1ba512d 100644
@@ -220,7 +220,7 @@ static int hws_bwc_queue_poll(struct mlx5hws_context *ctx,
 			      bool drain)
 {
 	unsigned long timeout = jiffies +
-				msecs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT * MSEC_PER_SEC);
+				secs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT);
 	struct mlx5hws_flow_op_result comp[MLX5HWS_BWC_MATCHER_REHASH_BURST_TH];
 	u16 burst_th = hws_bwc_get_burst_th(ctx, queue_id);
 	bool got_comp = *pending_rules >= burst_th;
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Thorsten Blum

Use secs_to_jiffies() and simplify the code.

---
Resend with "net-next" in the title as suggested by Jacob and Saeed.

---
  drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +0 -0
index 3dbd4efa21a2..19dce1ba512d 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c static int hws_bwc_queue_poll(struct mlx5hws_context *ctx, · line 223

Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +1 -1
@@ -220,7 +220,7 @@ static int hws_bwc_queue_poll(struct mlx5hws_context *ctx,
  			      bool drain)
  {
  	unsigned long timeout = jiffies +
-				msecs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT * MSEC_PER_SEC);
+				secs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT);

secs_to_jiffies() is expanded to a significantly simpler code than msecs_to_jiffies().

LGTM.

Quoted 3 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +0 -0
  	struct mlx5hws_flow_op_result comp[MLX5HWS_BWC_MATCHER_REHASH_BURST_TH];
  	u16 burst_th = hws_bwc_get_burst_th(ctx, queue_id);
  	bool got_comp = *pending_rules >= burst_th;
Reviewed-by
#2 lore raw
Quoted 29 lines · Tariq Toukan
Quoted 16 lines · Thorsten Blum

Use secs_to_jiffies() and simplify the code.

---
Resend with "net-next" in the title as suggested by Jacob and Saeed.

---
  drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +0 -0
index 3dbd4efa21a2..19dce1ba512d 100644

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c static int hws_bwc_queue_poll(struct mlx5hws_context *ctx, · line 223

Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +1 -1
@@ -220,7 +220,7 @@ static int hws_bwc_queue_poll(struct mlx5hws_context *ctx,
                            bool drain)
  {
      unsigned long timeout = jiffies +
-                             msecs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT * MSEC_PER_SEC);
+                             secs_to_jiffies(MLX5HWS_BWC_POLLING_TIMEOUT);

secs_to_jiffies() is expanded to a significantly simpler code than msecs_to_jiffies().

Quoted 4 lines

LGTM.

Quoted 6 lines
Quoted 4 lines
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +0 -0
      struct mlx5hws_flow_op_result comp[MLX5HWS_BWC_MATCHER_REHASH_BURST_TH];
      u16 burst_th = hws_bwc_get_burst_th(ctx, queue_id);
      bool got_comp = *pending_rules >= burst_th;
#3 lore raw
In reply to Thorsten Blum
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 21 Feb 2025 09:53:22 +0100 you wrote:

Use secs_to_jiffies() and simplify the code.

---
Resend with "net-next" in the title as suggested by Jacob and Saeed.

[...]

Here is the summary with links:
- [RESEND,net-next] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies()

    https://git.kernel.org/netdev/net-next/c/8f3f4464ff08

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html