提交 e247ac26 编写于 作者: N Niklas Schnelle 提交者: Yang Yingliang

net/mlx5: Fix failing fw tracer allocation on s390

stable inclusion
from linux-4.19.120
commit 66c03e4d33e503ee1b975f2cdcb1fbb029d9f648

--------------------------------

commit a019b361 upstream.

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: f53aaa31 ("net/mlx5: FW tracer, implement tracer logic")
Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NLi Aichun <liaichun@huawei.com>
Reviewed-by: Nguodeqing <geffrey.guo@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3782f736
...@@ -796,7 +796,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) ...@@ -796,7 +796,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
return NULL; return NULL;
} }
tracer = kzalloc(sizeof(*tracer), GFP_KERNEL); tracer = kvzalloc(sizeof(*tracer), GFP_KERNEL);
if (!tracer) if (!tracer)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -842,7 +842,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) ...@@ -842,7 +842,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev)
tracer->dev = NULL; tracer->dev = NULL;
destroy_workqueue(tracer->work_queue); destroy_workqueue(tracer->work_queue);
free_tracer: free_tracer:
kfree(tracer); kvfree(tracer);
return ERR_PTR(err); return ERR_PTR(err);
} }
...@@ -919,7 +919,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer) ...@@ -919,7 +919,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer)
mlx5_fw_tracer_destroy_log_buf(tracer); mlx5_fw_tracer_destroy_log_buf(tracer);
flush_workqueue(tracer->work_queue); flush_workqueue(tracer->work_queue);
destroy_workqueue(tracer->work_queue); destroy_workqueue(tracer->work_queue);
kfree(tracer); kvfree(tracer);
} }
void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册