mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-13 11:07:46 +10:00
net/mlx5: Nack sync reset when SFs are present
[ Upstream commit26e42ec771
] If PF (Physical Function) has SFs (Sub-Functions), since the SFs are not taking part in the synchronization flow, sync reset can lead to fatal error on the SFs, as the function will be closed unexpectedly from the SF point of view. Add a check to prevent sync reset when there are SFs on a PF device which is not ECPF, as ECPF is teardowned gracefully before reset. Fixes:92501fa6e4
("net/mlx5: Ack on sync_reset_request only if PF can do reset_now") Signed-off-by: Moshe Shemesh <moshe@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/20250825143435.598584-8-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a623e80aaa
commit
3e07c623fb
@ -6,6 +6,7 @@
|
||||
#include "fw_reset.h"
|
||||
#include "diag/fw_tracer.h"
|
||||
#include "lib/tout.h"
|
||||
#include "sf/sf.h"
|
||||
|
||||
enum {
|
||||
MLX5_FW_RESET_FLAGS_RESET_REQUESTED,
|
||||
@ -397,6 +398,11 @@ static bool mlx5_is_reset_now_capable(struct mlx5_core_dev *dev)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mlx5_core_is_ecpf(dev) && !mlx5_sf_table_empty(dev)) {
|
||||
mlx5_core_warn(dev, "SFs should be removed before reset\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)
|
||||
err = mlx5_check_hotplug_interrupt(dev);
|
||||
if (err)
|
||||
|
@ -541,3 +541,13 @@ void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev)
|
||||
WARN_ON(!xa_empty(&table->function_ids));
|
||||
kfree(table);
|
||||
}
|
||||
|
||||
bool mlx5_sf_table_empty(const struct mlx5_core_dev *dev)
|
||||
{
|
||||
struct mlx5_sf_table *table = dev->priv.sf_table;
|
||||
|
||||
if (!table)
|
||||
return true;
|
||||
|
||||
return xa_empty(&table->function_ids);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev);
|
||||
|
||||
int mlx5_sf_table_init(struct mlx5_core_dev *dev);
|
||||
void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev);
|
||||
bool mlx5_sf_table_empty(const struct mlx5_core_dev *dev);
|
||||
|
||||
int mlx5_devlink_sf_port_new(struct devlink *devlink,
|
||||
const struct devlink_port_new_attrs *add_attr,
|
||||
@ -61,6 +62,11 @@ static inline void mlx5_sf_table_cleanup(struct mlx5_core_dev *dev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline bool mlx5_sf_table_empty(const struct mlx5_core_dev *dev)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user