lkml.org 
[lkml]   [2020]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.6 052/106] net/mlx5: Fix failing fw tracer allocation on s390
    Date
    From: Niklas Schnelle <schnelle@linux.ibm.com>

    commit a019b36123aec9700b21ae0724710f62928a8bc1 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: f53aaa31cce7 ("net/mlx5: FW tracer, implement tracer logic")
    Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
    +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
    @@ -935,7 +935,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_cr
    return NULL;
    }

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

    @@ -982,7 +982,7 @@ destroy_workqueue:
    tracer->dev = NULL;
    destroy_workqueue(tracer->work_queue);
    free_tracer:
    - kfree(tracer);
    + kvfree(tracer);
    return ERR_PTR(err);
    }

    @@ -1061,7 +1061,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_
    mlx5_fw_tracer_destroy_log_buf(tracer);
    flush_workqueue(tracer->work_queue);
    destroy_workqueue(tracer->work_queue);
    - kfree(tracer);
    + kvfree(tracer);
    }

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

    \
     
     \ /
      Last update: 2020-05-01 15:44    [W:4.243 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site