netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>, Shay Drory <shayd@nvidia.com>
Subject: [net-next 02/15] net/mlx5: Expose timeout for sync reset unload stage
Date: Fri, 16 Jun 2023 13:11:00 -0700	[thread overview]
Message-ID: <20230616201113.45510-3-saeed@kernel.org> (raw)
In-Reply-To: <20230616201113.45510-1-saeed@kernel.org>

From: Moshe Shemesh <moshe@nvidia.com>

Expose new timoueout in Default Timeouts Register to be used on sync
reset flow running on smart NIC. In this flow the driver should know how
much time to wait from getting unload request till firmware will ask the
PF to continue to next stage of the flow.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c | 4 +++-
 drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h | 1 +
 include/linux/mlx5/mlx5_ifc.h                      | 4 +++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
index 696e45e2bd06..a87d0178ebf3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.c
@@ -24,7 +24,8 @@ static const u32 tout_def_sw_val[MAX_TIMEOUT_TYPES] = {
 	[MLX5_TO_TEARDOWN_MS] = 3000,
 	[MLX5_TO_FSM_REACTIVATE_MS] = 5000,
 	[MLX5_TO_RECLAIM_PAGES_MS] = 5000,
-	[MLX5_TO_RECLAIM_VFS_PAGES_MS] = 120000
+	[MLX5_TO_RECLAIM_VFS_PAGES_MS] = 120000,
+	[MLX5_TO_RESET_UNLOAD_MS] = 300000
 };
 
 static void tout_set(struct mlx5_core_dev *dev, u64 val, enum mlx5_timeouts_types type)
@@ -146,6 +147,7 @@ static int tout_query_dtor(struct mlx5_core_dev *dev)
 	MLX5_TIMEOUT_FILL(fsm_reactivate_to, out, dev, MLX5_TO_FSM_REACTIVATE_MS, 0);
 	MLX5_TIMEOUT_FILL(reclaim_pages_to, out, dev, MLX5_TO_RECLAIM_PAGES_MS, 0);
 	MLX5_TIMEOUT_FILL(reclaim_vfs_pages_to, out, dev, MLX5_TO_RECLAIM_VFS_PAGES_MS, 0);
+	MLX5_TIMEOUT_FILL(reset_unload_to, out, dev, MLX5_TO_RESET_UNLOAD_MS, 0);
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
index bc9e9aeda847..99e0a05526fe 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/tout.h
@@ -26,6 +26,7 @@ enum mlx5_timeouts_types {
 	MLX5_TO_FSM_REACTIVATE_MS,
 	MLX5_TO_RECLAIM_PAGES_MS,
 	MLX5_TO_RECLAIM_VFS_PAGES_MS,
+	MLX5_TO_RESET_UNLOAD_MS,
 
 	MAX_TIMEOUT_TYPES
 };
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 1f4f62cb9f34..14892e795808 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -3117,7 +3117,9 @@ struct mlx5_ifc_dtor_reg_bits {
 
 	struct mlx5_ifc_default_timeout_bits reclaim_vfs_pages_to;
 
-	u8         reserved_at_1c0[0x40];
+	struct mlx5_ifc_default_timeout_bits reset_unload_to;
+
+	u8         reserved_at_1c0[0x20];
 };
 
 enum {
-- 
2.40.1


  parent reply	other threads:[~2023-06-16 20:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 20:10 [pull request][net-next 00/15] mlx5 updates 2023-06-16 Saeed Mahameed
2023-06-16 20:10 ` [net-next 01/15] net/mlx5: Ack on sync_reset_request only if PF can do reset_now Saeed Mahameed
2023-06-18 18:00   ` patchwork-bot+netdevbpf
2023-06-16 20:11 ` Saeed Mahameed [this message]
2023-06-16 20:11 ` [net-next 03/15] net/mlx5: Check DTOR entry value is not zero Saeed Mahameed
2023-06-16 20:11 ` [net-next 04/15] net/mlx5: Handle sync reset unload event Saeed Mahameed
2023-06-16 20:11 ` [net-next 05/15] net/mlx5: Create eswitch debugfs root directory Saeed Mahameed
2023-06-16 20:11 ` [net-next 06/15] net/mlx5: Bridge, pass net device when linking vport to bridge Saeed Mahameed
2023-06-16 20:11 ` [net-next 07/15] net/mlx5: Bridge, expose FDB state via debugfs Saeed Mahameed
2023-06-17  7:48   ` Jakub Kicinski
2023-06-19  8:37     ` Vlad Buslov
2023-06-19 18:28       ` Jakub Kicinski
2023-06-19 18:34         ` Vlad Buslov
2023-06-19 19:05           ` Jakub Kicinski
2023-06-19 19:13             ` Vlad Buslov
2023-06-16 20:11 ` [net-next 08/15] net/mlx5: E-Switch, remove redundant else statements Saeed Mahameed
2023-06-16 20:11 ` [net-next 09/15] net/mlx5e: Remove mlx5e_dbg() and msglvl support Saeed Mahameed
2023-06-16 20:11 ` [net-next 10/15] net/mlx5: Expose bits for local loopback counter Saeed Mahameed
2023-06-16 20:11 ` [net-next 11/15] net/mlx5e: Add local loopback counter to vport stats Saeed Mahameed
2023-06-16 20:11 ` [net-next 12/15] net/mlx5: Fix the macro for accessing EC VF vports Saeed Mahameed
2023-06-16 20:11 ` [net-next 13/15] net/mlx5: DR, update query of HCA caps for EC VFs Saeed Mahameed
2023-06-16 20:11 ` [net-next 14/15] net/mlx5: Add header file for events Saeed Mahameed
2023-06-16 20:11 ` [net-next 15/15] net/mlx5: Remove unused ecpu field from struct mlx5_sf_table Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616201113.45510-3-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).