]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: Add sync reset drop mode support
authorMoshe Shemesh <moshe@nvidia.com>
Wed, 16 Oct 2024 17:36:14 +0000 (20:36 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 21 Oct 2024 11:26:17 +0000 (13:26 +0200)
On sync reset flow, firmware may request a PF, which already
acknowledged the unload event, to move to drop mode. Drop mode means
that this PF will reduce polling frequency, as this PF is not going to
have another active part in the reset, but only reload back after the
reset.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

index 4f55e55ecb5513591236a942056202678e5d66fd..566710d34a7b2e7aba40fc4d2eabd63d5ec89dc4 100644 (file)
@@ -35,6 +35,7 @@ struct mlx5_fw_reset {
 enum {
        MLX5_FW_RST_STATE_IDLE = 0,
        MLX5_FW_RST_STATE_TOGGLE_REQ = 4,
+       MLX5_FW_RST_STATE_DROP_MODE = 5,
 };
 
 enum {
@@ -616,6 +617,7 @@ static void mlx5_sync_reset_unload_event(struct work_struct *work)
        struct mlx5_fw_reset *fw_reset;
        struct mlx5_core_dev *dev;
        unsigned long timeout;
+       int poll_freq = 20;
        bool reset_action;
        u8 rst_state;
        int err;
@@ -651,7 +653,12 @@ static void mlx5_sync_reset_unload_event(struct work_struct *work)
                        reset_action = true;
                        break;
                }
-               msleep(20);
+               if (rst_state == MLX5_FW_RST_STATE_DROP_MODE) {
+                       mlx5_core_info(dev, "Sync Reset Drop mode ack\n");
+                       mlx5_set_fw_rst_ack(dev);
+                       poll_freq = 1000;
+               }
+               msleep(poll_freq);
        } while (!time_after(jiffies, timeout));
 
        if (!reset_action) {