Skip to content

Commit d62292e

Browse files
Mohamad Haj Yahiadavem330
authored andcommitted
net/mlx5: Skip waiting for vf pages in internal error
In case of device in internal error state there is no need to wait for vf pages since they will be reclaimed manually later in the unload flow. Signed-off-by: Mohamad Haj Yahia <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 48b4e51 commit d62292e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ static int reclaim_pages_cmd(struct mlx5_core_dev *dev,
326326
{
327327
struct fw_page *fwp;
328328
struct rb_node *p;
329+
u32 func_id;
329330
u32 npages;
330331
u32 i = 0;
331332

@@ -334,12 +335,16 @@ static int reclaim_pages_cmd(struct mlx5_core_dev *dev,
334335

335336
/* No hard feelings, we want our pages back! */
336337
npages = MLX5_GET(manage_pages_in, in, input_num_entries);
338+
func_id = MLX5_GET(manage_pages_in, in, function_id);
337339

338340
p = rb_first(&dev->priv.page_root);
339341
while (p && i < npages) {
340342
fwp = rb_entry(p, struct fw_page, rb_node);
341-
MLX5_SET64(manage_pages_out, out, pas[i], fwp->addr);
342343
p = rb_next(p);
344+
if (fwp->func_id != func_id)
345+
continue;
346+
347+
MLX5_SET64(manage_pages_out, out, pas[i], fwp->addr);
343348
i++;
344349
}
345350

@@ -540,6 +545,12 @@ int mlx5_wait_for_vf_pages(struct mlx5_core_dev *dev)
540545
unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_VFS_PAGES_TIME_MSECS);
541546
int prev_vfs_pages = dev->priv.vfs_pages;
542547

548+
/* In case of internal error we will free the pages manually later */
549+
if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
550+
mlx5_core_warn(dev, "Skipping wait for vf pages stage");
551+
return 0;
552+
}
553+
543554
mlx5_core_dbg(dev, "Waiting for %d pages from %s\n", prev_vfs_pages,
544555
dev->priv.name);
545556
while (dev->priv.vfs_pages) {

0 commit comments

Comments
 (0)