From patchwork Fri Jan 26 22:36:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13533426 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFDF951000 for ; Fri, 26 Jan 2024 22:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308621; cv=none; b=N13qRF9wg7AwTE1gDje5fxJkEgEPeI3m62SbdgizbVbAsx1HabEA6Kq+oC/AOSfg+VfO3H9ctMnpeHRUpyxNXAvfx5dq3y9ppLjYUgEEji8cemnI9Y5rfUg5BXpCepHMkXBLK/ARLCAiJ+bQM5q+PidRouQRR9MHNHe2DF8hA+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308621; c=relaxed/simple; bh=6G3rLaio//bwVROcPEZtoatiQXH7RJSuVehvjzcAqdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rEmdhhpvObRCboREMVVQnU2WNZpzbCymATx+k45zoVX1JOX6rZdqnpkd/yOEcMrvD4bjtGufnVOA4hn+Wle2ToKPNyGHXeySTu6btCkmzg8ojHSfEe8kOfDvivMXwlvLMoJMQEIRhiHtKR+q/hMSFgjE5EsM2hZ0jKU06w3+87M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ji9gQKDV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ji9gQKDV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D503C433F1; Fri, 26 Jan 2024 22:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706308620; bh=6G3rLaio//bwVROcPEZtoatiQXH7RJSuVehvjzcAqdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ji9gQKDVkEB6Pq7jDRYh6hjVG5WxlBwViuG84Zw+jrT4RTQBzZOVIuwm+1tJNO57I J+eynRl4u/S50izdsSTY0z7rgot0oDF/Iz5icyJgolT3sCD5auLdDZWV7z4NjmQNgF hRcl0vOyHOP3MZLvQdp930pUIw+aI9jicKcPc6B6wj7+b9Y0PKb3aW8qKMGCBPiSmb QrMfSm8zaaFGuGmo5StjHrGBgnWf63i2zSGLNC3py306UJUxCKr92Edb+k3KslLKUi IKJjRlh62lpvQziIc/9fXxNmoIVItnPh9CfFnMYwzvQb58ZK40ju0wg3LvtxWCAsx/ 4z6IQCEukwuDg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Gal Pressman , Leon Romanovsky , Moshe Shemesh , Aya Levin Subject: [net-next 09/15] net/mlx5: SF, Stop waiting for FW as teardown was called Date: Fri, 26 Jan 2024 14:36:10 -0800 Message-ID: <20240126223616.98696-10-saeed@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126223616.98696-1-saeed@kernel.org> References: <20240126223616.98696-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Moshe Shemesh When PF/VF teardown is called the driver sets the flag MLX5_BREAK_FW_WAIT to stop waiting for FW loading and initializing. Same should be applied to SF driver teardown to cut waiting time. On mlx5_sf_dev_remove() set the flag before draining health WQ as recovery flow may also wait for FW reloading while it is not relevant anymore. Signed-off-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/sf/dev/driver.c | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c index 169c2c68ed5c..bc863e1f062e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c @@ -95,24 +95,29 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia static void mlx5_sf_dev_remove(struct auxiliary_device *adev) { struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev); - struct devlink *devlink = priv_to_devlink(sf_dev->mdev); + struct mlx5_core_dev *mdev = sf_dev->mdev; + struct devlink *devlink; - mlx5_drain_health_wq(sf_dev->mdev); + devlink = priv_to_devlink(mdev); + set_bit(MLX5_BREAK_FW_WAIT, &mdev->intf_state); + mlx5_drain_health_wq(mdev); devlink_unregister(devlink); - if (mlx5_dev_is_lightweight(sf_dev->mdev)) - mlx5_uninit_one_light(sf_dev->mdev); + if (mlx5_dev_is_lightweight(mdev)) + mlx5_uninit_one_light(mdev); else - mlx5_uninit_one(sf_dev->mdev); - iounmap(sf_dev->mdev->iseg); - mlx5_mdev_uninit(sf_dev->mdev); + mlx5_uninit_one(mdev); + iounmap(mdev->iseg); + mlx5_mdev_uninit(mdev); mlx5_devlink_free(devlink); } static void mlx5_sf_dev_shutdown(struct auxiliary_device *adev) { struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev); + struct mlx5_core_dev *mdev = sf_dev->mdev; - mlx5_unload_one(sf_dev->mdev, false); + set_bit(MLX5_BREAK_FW_WAIT, &mdev->intf_state); + mlx5_unload_one(mdev, false); } static const struct auxiliary_device_id mlx5_sf_dev_id_table[] = {