From patchwork Wed Feb 19 21:36:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13983035 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E6282580DC; Wed, 19 Feb 2025 21:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740001006; cv=none; b=s9PtbOI1giCCE0Nmvk6SsSGzMjhPVF1v/GpXqVt2vo1sBwOjMPm8JzA0zcr+L1NWdjB0fgm+tAXnDNMM/f02BlhqYZ5qnLACE7IKyM+lfxUSJyqsAbF6DrVqHvTFFwPKJWZcYu+bEiq4cs6NLzxiPIA5VTHg/IEIqL+IbWP8Qhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740001006; c=relaxed/simple; bh=DIcU1uig5I4dPitBVIdvL40b2CK1pCK/SuKGFIo/NHU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cZZFRPaThHoynMnJRsGsww/FdHQiiQqSu3BKO+KjdvUx+hxLlszEJkyMri13tvjm0cm9F2EhUPpE6NOxQF53Q+FAkDbTtotIp0O7+Tl9zAzAtubRSNyTREP9k0sk1pKGQo/qc4f17q8QMULncEOf4v9e62uXROoi7/mupEpiNqI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=sKzajk2P; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="sKzajk2P" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 1E62D2043DEC; Wed, 19 Feb 2025 13:36:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1E62D2043DEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740001005; bh=Q75Z4qe0KB1DGcu4mQDnDhnSTzwOml5U+Zz4/sYRLuc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sKzajk2PsVNTIubnGc6W9a5mBNhQBgJc/6XhKcHKZFGds606jBJaICbaHAluVa7NY PgE/o5gB+Vmvo2ZpHKtruV+Q58LCadPbPTeLhDiLA5BLXTVg5GQWgbxeqT/Rx3zURj 3ViTYuJUGsyAb40nssY7NEQfGkiT7zzNxFHaCSVk= From: Easwar Hariharan Date: Wed, 19 Feb 2025 21:36:39 +0000 Subject: [PATCH 1/2] RDMA/mlx4: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-rdma-secs-to-jiffies-v1-1-b506746561a9@linux.microsoft.com> References: <20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com> In-Reply-To: <20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com> To: Yishai Hadas , Jason Gunthorpe , Leon Romanovsky Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 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: @depends on patch@ expression E; @@ -msecs_to_jiffies(E * 1000) +secs_to_jiffies(E) -msecs_to_jiffies(E * MSEC_PER_SEC) +secs_to_jiffies(E) Signed-off-by: Easwar Hariharan --- drivers/infiniband/hw/mlx4/alias_GUID.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index d7327735b8d0d4dd57d44ab1c71554ebf11ce6ce..527f52e41577af3dee60e695f25741f824762fd3 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c @@ -437,7 +437,7 @@ static void aliasguid_query_handler(int status, queue_delayed_work(dev->sriov.alias_guid.ports_guid[port_index].wq, &dev->sriov.alias_guid.ports_guid[port_index]. alias_guid_work, - msecs_to_jiffies(resched_delay_sec * 1000)); + secs_to_jiffies(resched_delay_sec)); } if (cb_ctx->sa_query) { list_del(&cb_ctx->list); From patchwork Wed Feb 19 21:36:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13983037 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD0192580E0; Wed, 19 Feb 2025 21:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740001007; cv=none; b=jdoc+iPQ7iK7ZoNmZ5aynUnGsu7LvKvTj7qV78TJRUTgkXoqTQ6lUf2Aj085U6yZhO+HLfvJAoZcygJQG/AGcLwGQaPHAv2z/RCHJ2vD4KjK5mEnPbO91Rrul2xdrSPc/V42QSPvLPhJ0jpd7vJ9sCUEYoMsUg5avh7t6R9eQbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740001007; c=relaxed/simple; bh=0bKLppM5g/3A1DAJuexX2Tb/L9vo5gPF2AnLV4uW634=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qEAOK23KDJIpKTgSP1/op/CTuZ9UAUAet45SEoIT0xzxsKYm9DdVFXMYMT8ZaepwCcp1G4RBzBgCZkAGtpTGUAYiNKjFBXL0zTS4Z7SuwxzNXvz6If83kIvkBx+f4tvlrgdtVTWwxrQAdKaW2QUwzpXCX6WviLfA8yAvDDyDwJM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=dDi/8++H; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="dDi/8++H" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 360E42043DED; Wed, 19 Feb 2025 13:36:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 360E42043DED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740001005; bh=wr9ApNX1qIWKUdAkzKTxRstIniwQDx0WUWV75DUrwv8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dDi/8++HD20SSQWYe8yngpHJdPVVzo/2/oxSkFIQLk5ERTp7eUnX201jVb4wdlAf0 AiRhgn+vC/za09yXOSG/X62qlQ5YUNd2cLb9ooPtSKL6jbG6fEaMNXLW1gISl25D/+ zNtc3fbLOPBYMniMhxmeYpWHn0lXRDvUJuL5JgVs= From: Easwar Hariharan Date: Wed, 19 Feb 2025 21:36:40 +0000 Subject: [PATCH 2/2] RDMA/mlx5: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-rdma-secs-to-jiffies-v1-2-b506746561a9@linux.microsoft.com> References: <20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com> In-Reply-To: <20250219-rdma-secs-to-jiffies-v1-0-b506746561a9@linux.microsoft.com> To: Yishai Hadas , Jason Gunthorpe , Leon Romanovsky Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 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: @depends on patch@ expression E; @@ -msecs_to_jiffies(E * 1000) +secs_to_jiffies(E) -msecs_to_jiffies(E * MSEC_PER_SEC) +secs_to_jiffies(E) Signed-off-by: Easwar Hariharan --- drivers/infiniband/hw/mlx5/mr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 753faa9ad06a8876d4f7c848823825d55df9a43d..86c925489e8179fa2c311ff9ce38c9d51f200649 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -525,7 +525,7 @@ static void queue_adjust_cache_locked(struct mlx5_cache_ent *ent) ent->fill_to_high_water = false; if (ent->pending) queue_delayed_work(ent->dev->cache.wq, &ent->dwork, - msecs_to_jiffies(1000)); + secs_to_jiffies(1)); else mod_delayed_work(ent->dev->cache.wq, &ent->dwork, 0); } @@ -576,7 +576,7 @@ static void __cache_work_func(struct mlx5_cache_ent *ent) "add keys command failed, err %d\n", err); queue_delayed_work(cache->wq, &ent->dwork, - msecs_to_jiffies(1000)); + secs_to_jiffies(1)); } } } else if (ent->mkeys_queue.ci > 2 * ent->limit) { @@ -2039,7 +2039,7 @@ static int mlx5_revoke_mr(struct mlx5_ib_mr *mr) spin_lock_irq(&ent->mkeys_queue.lock); if (ent->is_tmp && !ent->tmp_cleanup_scheduled) { mod_delayed_work(ent->dev->cache.wq, &ent->dwork, - msecs_to_jiffies(30 * 1000)); + secs_to_jiffies(30)); ent->tmp_cleanup_scheduled = true; } spin_unlock_irq(&ent->mkeys_queue.lock);