* [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() @ 2025-02-19 20:49 Thorsten Blum 2025-02-19 23:45 ` Jacob Keller 0 siblings, 1 reply; 6+ messages in thread From: Thorsten Blum @ 2025-02-19 20:49 UTC (permalink / raw) To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan Cc: Thorsten Blum, netdev, linux-rdma, linux-kernel Use secs_to_jiffies() and simplify the code. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> --- drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c index 3dbd4efa21a2..19dce1ba512d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c @@ -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; -- 2.48.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() 2025-02-19 20:49 [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum @ 2025-02-19 23:45 ` Jacob Keller 2025-02-20 7:13 ` Leon Romanovsky 0 siblings, 1 reply; 6+ messages in thread From: Jacob Keller @ 2025-02-19 23:45 UTC (permalink / raw) To: Thorsten Blum, Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan Cc: netdev, linux-rdma, linux-kernel On 2/19/2025 12:49 PM, Thorsten Blum wrote: > Use secs_to_jiffies() and simplify the code. > > Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> nit: this is a cleanup which should have the net-next prefix applied, since this doesn't fix any user visible behavior. Otherwise, seems like an ok change. > --- > drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c > index 3dbd4efa21a2..19dce1ba512d 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c > @@ -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]; This looks like it violates RCT ordering now though. Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Thanks, Jake > u16 burst_th = hws_bwc_get_burst_th(ctx, queue_id); > bool got_comp = *pending_rules >= burst_th; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() 2025-02-19 23:45 ` Jacob Keller @ 2025-02-20 7:13 ` Leon Romanovsky 2025-02-20 11:08 ` Thorsten Blum 0 siblings, 1 reply; 6+ messages in thread From: Leon Romanovsky @ 2025-02-20 7:13 UTC (permalink / raw) To: Jacob Keller Cc: Thorsten Blum, Saeed Mahameed, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan, netdev, linux-rdma, linux-kernel On Wed, Feb 19, 2025 at 03:45:02PM -0800, Jacob Keller wrote: > > > On 2/19/2025 12:49 PM, Thorsten Blum wrote: > > Use secs_to_jiffies() and simplify the code. > > > > Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> > > nit: this is a cleanup which should have the net-next prefix applied, > since this doesn't fix any user visible behavior. > > Otherwise, seems like an ok change. IMHO, completely useless change for old code. I can see a value in new secs_to_jiffies() function for new code, but not for old code. I want to believe that people who write kernel patches aware that 1000 msec equal to 1 sec. Thanks ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() 2025-02-20 7:13 ` Leon Romanovsky @ 2025-02-20 11:08 ` Thorsten Blum 2025-02-20 12:07 ` Leon Romanovsky 0 siblings, 1 reply; 6+ messages in thread From: Thorsten Blum @ 2025-02-20 11:08 UTC (permalink / raw) To: Leon Romanovsky Cc: Jacob Keller, Saeed Mahameed, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan, netdev, linux-rdma, linux-kernel On 20. Feb 2025, at 08:13, Leon Romanovsky wrote: > On Wed, Feb 19, 2025 at 03:45:02PM -0800, Jacob Keller wrote: >> On 2/19/2025 12:49 PM, Thorsten Blum wrote: >>> Use secs_to_jiffies() and simplify the code. >>> >>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> >> >> nit: this is a cleanup which should have the net-next prefix applied, >> since this doesn't fix any user visible behavior. >> >> Otherwise, seems like an ok change. > > IMHO, completely useless change for old code. I can see a value in new > secs_to_jiffies() function for new code, but not for old code. I want > to believe that people who write kernel patches aware that 1000 msec > equal to 1 sec. Using secs_to_jiffies() is shorter and requires less cognitive load to read imo. Plus, it now fits within the preferred 80 columns limit. This "old code" was added in d74ee6e197a2c ("net/mlx5: HWS, set timeout on polling for completion") in January 2025. Thanks, Thorsten ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() 2025-02-20 11:08 ` Thorsten Blum @ 2025-02-20 12:07 ` Leon Romanovsky 2025-02-20 21:56 ` Saeed Mahameed 0 siblings, 1 reply; 6+ messages in thread From: Leon Romanovsky @ 2025-02-20 12:07 UTC (permalink / raw) To: Thorsten Blum Cc: Jacob Keller, Saeed Mahameed, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan, netdev, linux-rdma, linux-kernel On Thu, Feb 20, 2025 at 12:08:07PM +0100, Thorsten Blum wrote: > On 20. Feb 2025, at 08:13, Leon Romanovsky wrote: > > On Wed, Feb 19, 2025 at 03:45:02PM -0800, Jacob Keller wrote: > >> On 2/19/2025 12:49 PM, Thorsten Blum wrote: > >>> Use secs_to_jiffies() and simplify the code. > >>> > >>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> > >> > >> nit: this is a cleanup which should have the net-next prefix applied, > >> since this doesn't fix any user visible behavior. > >> > >> Otherwise, seems like an ok change. > > > > IMHO, completely useless change for old code. I can see a value in new > > secs_to_jiffies() function for new code, but not for old code. I want > > to believe that people who write kernel patches aware that 1000 msec > > equal to 1 sec. > > Using secs_to_jiffies() is shorter and requires less cognitive load to > read imo. Plus, it now fits within the preferred 80 columns limit. Unfortunately, I see this change as a churn and not an improvement. > > This "old code" was added in d74ee6e197a2c ("net/mlx5: HWS, set timeout > on polling for completion") in January 2025. I got same conversion patches for RDMA. https://lore.kernel.org/all/20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com Thanks > > Thanks, > Thorsten > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() 2025-02-20 12:07 ` Leon Romanovsky @ 2025-02-20 21:56 ` Saeed Mahameed 0 siblings, 0 replies; 6+ messages in thread From: Saeed Mahameed @ 2025-02-20 21:56 UTC (permalink / raw) To: Leon Romanovsky Cc: Thorsten Blum, Jacob Keller, Saeed Mahameed, Tariq Toukan, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Yevgeny Kliteynik, Mark Bloch, Itamar Gozlan, netdev, linux-rdma, linux-kernel On 20 Feb 14:07, Leon Romanovsky wrote: >On Thu, Feb 20, 2025 at 12:08:07PM +0100, Thorsten Blum wrote: >> On 20. Feb 2025, at 08:13, Leon Romanovsky wrote: >> > On Wed, Feb 19, 2025 at 03:45:02PM -0800, Jacob Keller wrote: >> >> On 2/19/2025 12:49 PM, Thorsten Blum wrote: >> >>> Use secs_to_jiffies() and simplify the code. >> >>> >> >>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> >> >> >> >> nit: this is a cleanup which should have the net-next prefix applied, >> >> since this doesn't fix any user visible behavior. >> >> >> >> Otherwise, seems like an ok change. >> > >> > IMHO, completely useless change for old code. I can see a value in new >> > secs_to_jiffies() function for new code, but not for old code. I want >> > to believe that people who write kernel patches aware that 1000 msec >> > equal to 1 sec. >> >> Using secs_to_jiffies() is shorter and requires less cognitive load to >> read imo. Plus, it now fits within the preferred 80 columns limit. >Unfortunately, I see this change as a churn and not an improvement. All patches with any justified improvement are welcome, as long as they are not automated or bot generated spam. This patch is reasonable, you need to add [PATCH net-next] prefix in the title for this patch to get into the pipeline. Feel free to add: Reviewed-by: <saeed@kernel.org> > >> >> This "old code" was added in d74ee6e197a2c ("net/mlx5: HWS, set timeout >> on polling for completion") in January 2025. > >I got same conversion patches for RDMA. >https://lore.kernel.org/all/20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com > >Thanks > >> >> Thanks, >> Thorsten >> > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-02-20 21:56 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-02-19 20:49 [PATCH] net/mlx5: Use secs_to_jiffies() instead of msecs_to_jiffies() Thorsten Blum 2025-02-19 23:45 ` Jacob Keller 2025-02-20 7:13 ` Leon Romanovsky 2025-02-20 11:08 ` Thorsten Blum 2025-02-20 12:07 ` Leon Romanovsky 2025-02-20 21:56 ` Saeed Mahameed
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).