Skip to content

Commit a019b36

Browse files
niklas88Saeed Mahameed
authored andcommitted
net/mlx5: Fix failing fw tracer allocation on s390
On s390 FORCE_MAX_ZONEORDER is 9 instead of 11, thus a larger kzalloc() allocation as done for the firmware tracer will always fail. Looking at mlx5_fw_tracer_save_trace(), it is actually the driver itself that copies the debug data into the trace array and there is no need for the allocation to be contiguous in physical memory. We can therefor use kvzalloc() instead of kzalloc() and get rid of the large contiguous allcoation. Fixes: f53aaa3 ("net/mlx5: FW tracer, implement tracer logic") Signed-off-by: Niklas Schnelle <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 1c30fbc commit a019b36

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/diag

1 file changed

+3
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
935935
return NULL;
936936
}
937937

938-
tracer = kzalloc(sizeof(*tracer), GFP_KERNEL);
938+
tracer = kvzalloc(sizeof(*tracer), GFP_KERNEL);
939939
if (!tracer)
940940
return ERR_PTR(-ENOMEM);
941941

@@ -982,7 +982,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
982982
tracer->dev = NULL;
983983
destroy_workqueue(tracer->work_queue);
984984
free_tracer:
985-
kfree(tracer);
985+
kvfree(tracer);
986986
return ERR_PTR(err);
987987
}
988988

@@ -1061,7 +1061,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
10611061
mlx5_fw_tracer_destroy_log_buf(tracer);
10621062
flush_workqueue(tracer->work_queue);
10631063
destroy_workqueue(tracer->work_queue);
1064-
kfree(tracer);
1064+
kvfree(tracer);
10651065
}
10661066

10671067
static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void *data)

0 commit comments

Comments
 (0)