net/ena/base: improve admin logging
PATCH 16/21 net/ena/base: improve admin logging
Added command ID to admin command failure log.
Signed-off-by Shai Brandes <[email protected]>
Signed-off-by Amit Bernstein <[email protected]>
Reviewed-by Yosef Raisman <[email protected]>
--- drivers/net/ena/base/ena_com.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/ena/base/ena_com.c +8 -7
@@ -544,14 +544,15 @@ static void ena_com_handle_admin_completion(struct ena_com_admin_queue *admin_quATOMIC32_SET_RELEASE (&admin_queue->polling_for_completions,0 ); } -static int ena_com_comp_status_to_errno (struct ena_com_admin_queue *admin_queue, -u8 comp_status) +static int ena_com_admin_status_to_errno (struct ena_com_admin_queue *admin_queue, +struct ena_comp_ctx *comp_ctx) { -if (unlikely (comp_status !=0 )) +if (unlikely (comp_ctx->comp_status !=0 ))ena_trc_err (admin_queue->ena_dev, -"Admin command failed[%u]\n" , comp_status); +"Admin command %u failed (%u)\n" , + comp_ctx->cmd_opcode, comp_ctx->comp_status); -switch (comp_status) { +switch (comp_ctx->comp_status) {case ENA_ADMIN_SUCCESS :return ENA_COM_OK ;case ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE :
@@ -622,7 +623,7 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c goto err; } - ret =ena_com_comp_status_to_errno (admin_queue, comp_ctx->comp_status); + ret =ena_com_admin_status_to_errno (admin_queue, comp_ctx); err:comp_ctxt_release (admin_queue, comp_ctx);return ret;
@@ -849,7 +850,7 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com goto err; } - ret =ena_com_comp_status_to_errno (admin_queue, comp_ctx->comp_status); + ret =ena_com_admin_status_to_errno (admin_queue, comp_ctx);comp_ctxt_release (admin_queue, comp_ctx);return ret;
Signature · 1 line
2.17.1