DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Stephen Hurd <stephen.hurd@broadcom.com>
Subject: [dpdk-dev] [PATCH 03/28] bnxt: add additonal HWRM debug info to error messages
Date: Mon, 27 Mar 2017 22:48:38 -0500	[thread overview]
Message-ID: <20170328034903.41482-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20170328034903.41482-1-ajit.khaparde@broadcom.com>

Add the cmd_err and opaque_0 and opaque_1 fields to HWRM error
messages.  These allow better debugging of some classes of HWRM
errors.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c           | 17 +++++++++++++++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 36 ++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 2a24610..cb974d5 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -140,7 +140,22 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, uint32_t msg_len)
 		} \
 		if (resp->error_code) { \
 			rc = rte_le_to_cpu_16(resp->error_code); \
-			RTE_LOG(ERR, PMD, "%s error %d\n", __func__, rc); \
+			if (resp->resp_len >= 16) { \
+				struct hwrm_err_output *tmp_hwrm_err_op = \
+							(void *)resp; \
+				RTE_LOG(ERR, PMD, \
+					"%s error %d:%d:%08x:%04x\n", \
+					__func__, \
+					rc, tmp_hwrm_err_op->cmd_err, \
+					rte_le_to_cpu_32(\
+						tmp_hwrm_err_op->opaque_0), \
+					rte_le_to_cpu_16(\
+						tmp_hwrm_err_op->opaque_1)); \
+			} \
+			else { \
+				RTE_LOG(ERR, PMD, \
+					"%s error %d\n", __func__, rc); \
+			} \
 			return rc; \
 		} \
 	}
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 0635dd2..9cb3f76 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -1319,6 +1319,42 @@ struct output {
 	 */
 } __attribute__((packed));
 
+/* Output (16 bytes) */
+struct hwrm_err_output {
+	uint16_t error_code;
+	/*
+	 * Pass/Fail or error type Note: receiver to verify the in parameters,
+	 * and fail the call with an error when appropriate
+	 */
+	uint16_t req_type;
+	/* This field returns the type of original request. */
+	uint16_t seq_id;
+	/* This field provides original sequence number of the command. */
+	uint16_t resp_len;
+	/*
+	 * This field is the length of the response in bytes. The last byte of
+	 * the response is a valid flag that will read as '1' when the command
+	 * has been completely written to memory.
+	 */
+	uint32_t opaque_0;
+	/* debug info for this error response. */
+	uint16_t opaque_1;
+	/* debug info for this error response. */
+	uint8_t cmd_err;
+	/*
+	 * In the case of an error response, command specific error code is
+	 * returned in this field.
+	 */
+	uint8_t valid;
+	/*
+	 * This field is used in Output records to indicate that the output is
+	 * completely written to RAM. This field should be read as '1' to
+	 * indicate that the output has been completely written. When writing a
+	 * command completion or response to an internal processor, the order of
+	 * writes has to be such that this field is written last.
+	 */
+} __attribute__((packed));
+
 /* hwrm_ver_get */
 /*
  * Description: This function is called by a driver to determine the HWRM
-- 
2.10.1 (Apple Git-78)

  parent reply	other threads:[~2017-03-28  3:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28  3:48 [dpdk-dev] [PATCH 00/28] bnxt: new features, bug fixes and more Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 01/28] bnxt: add hwrm_func_cfg_input/output structures Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 02/28] bnxt: add code to support PF, VF configuration Ajit Khaparde
2017-03-28  3:48 ` Ajit Khaparde [this message]
2017-03-28  3:48 ` [dpdk-dev] [PATCH 04/28] bnxt: add new HWRM commands Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 05/28] bnxt: add support for PF/VF communications Ajit Khaparde
2017-05-11 17:00   ` Ferruh Yigit
2017-05-11 17:07     ` Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 06/28] bnxt: add new HWRM commands to query VNIC info Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 07/28] bnxt: add functions for tx_loopback and queues_drop_en Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 08/28] bnxt: support setting VF mac address Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 09/28] bnxt: add code to support VF QOS configuration Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 10/28] bnxt: support for VF VLAN filtering Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 11/28] bnxt: set the VMDQ pool size correctly Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 12/28] bnxt: improve some of the log messages Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 13/28] bnxt: fix interrupt handler Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 14/28] bnxt: Add support for udp_tunnel_port_add/del dev_ops Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 15/28] bnxt: Update tx offload capabilities Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 16/28] bnxt: add support for set VF MAC anti spoof Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 17/28] bnxt: implement VF VLAN stripq functionality Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 18/28] bnxt: support lack of huge pages Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 19/28] bnxt: add code to configure a default VF VLAN Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 20/28] bnxt: Add support to set VF rxmode Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 21/28] bnxt: Add VF stats get/reset functions Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 22/28] bnxt: Add newlines to all RTE_LOG() format strings Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 23/28] bnxt: Add support for VLAN filter and strip dev_ops Ajit Khaparde
2017-03-28  3:48 ` [dpdk-dev] [PATCH 24/28] bnxt: Add support for mac_addr_set dev_op Ajit Khaparde
2017-03-28  3:49 ` [dpdk-dev] [PATCH 25/28] bnxt: add support for xstats Ajit Khaparde
2017-03-28  3:49 ` [dpdk-dev] [PATCH 26/28] bnxt: use only long BDs in Tx path Ajit Khaparde
2017-03-28  3:49 ` [dpdk-dev] [PATCH 27/28] bnxt: add support for set_mc_addr_list dev_op Ajit Khaparde
2017-03-28  3:49 ` [dpdk-dev] [PATCH 28/28] bnxt: update to HWRM version 1.7.4 Ajit Khaparde
2017-03-29 12:14 ` [dpdk-dev] [PATCH 00/28] bnxt: new features, bug fixes and more Ferruh Yigit
2017-03-29 15:45   ` Ferruh Yigit
2017-03-29 19:31   ` Ajit Khaparde

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=20170328034903.41482-4-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=stephen.hurd@broadcom.com \
    /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).