From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rnd-relay.smtp.broadcom.com (lpdvrndsmtp01.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id F0CC47CC4 for ; Thu, 1 Jun 2017 19:07:41 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.224.233]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 8528730C003; Thu, 1 Jun 2017 10:07:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 8528730C003 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1496336860; bh=Nq1NZOgUd2bu5W/9GxrRRP7HGasDlZpb722jmteVvJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KWVUS8xOIYDWfdgssuaMsclkh0A1l2lYqkRRcb5Mvjc/GWngjScKXA4wcECX5n+Cu 4EY4BpTyiaxGBVKXjr+NDuh1Ca6f4xj40jTgw+Ke+DSQ98FmePpCTYiKyovrJYypVg juGnGW2F0kGo/rkSQDrbpi4HQUxBC+nE+Mh4SFx4= Received: from C02PT1RBG8WP.wifi.broadcom.net (c02pt1rbg8wp.wifi.broadcom.net [10.45.51.51]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 06B5681EB5; Thu, 1 Jun 2017 10:07:39 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Stephen Hurd Date: Thu, 1 Jun 2017 12:07:02 -0500 Message-Id: <20170601170723.48709-6-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170601170723.48709-1-ajit.khaparde@broadcom.com> References: <20170601030232.38677-1-ajit.khaparde@broadcom.com> <20170601170723.48709-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH v4 05/26] net/bnxt: add additonal HWRM debug info to error messages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 17:07:42 -0000 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 Signed-off-by: Ajit Khaparde -- v1->v2: regroup related patches and incorporate other review comments v2->v3: - rebasing to next-net tree - Use net/bnxt instead of just bnxt in patch subject --- drivers/net/bnxt/bnxt_hwrm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index d2a8d8f..3c2f148 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -139,7 +139,7 @@ static int bnxt_hwrm_send_message_locked(struct bnxt *bp, void *msg, } if (i >= HWRM_CMD_TIMEOUT) { - RTE_LOG(ERR, PMD, "Error sending msg %x\n", + RTE_LOG(ERR, PMD, "Error sending msg 0x%04x\n", req->req_type); goto err_ret; } @@ -176,7 +176,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; \ } \ } -- 2.10.1 (Apple Git-78)