DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shai Brandes <shaibran@amazon.com>
To: <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Shai Brandes <shaibran@amazon.com>,
	Amit Bernstein <amitbern@amazon.com>
Subject: [PATCH 16/21] net/ena/base: improve admin logging
Date: Wed, 15 Oct 2025 10:15:44 +0300	[thread overview]
Message-ID: <20251015071544.1041-1-shaibran@amazon.com> (raw)

Added command ID to admin command failure log.

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Yosef Raisman <yraisman@amazon.com>
---
 drivers/net/ena/base/ena_com.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index aba52cabae..7ce80bde37 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -544,14 +544,15 @@ static void ena_com_handle_admin_completion(struct ena_com_admin_queue *admin_qu
 	ATOMIC32_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;
-- 
2.17.1


                 reply	other threads:[~2025-10-15  7:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251015071544.1041-1-shaibran@amazon.com \
    --to=shaibran@amazon.com \
    --cc=amitbern@amazon.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).