From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09792A00BE; Wed, 29 Apr 2020 13:14:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7887F1DA4C; Wed, 29 Apr 2020 13:13:57 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id E5BFC1DA29 for ; Wed, 29 Apr 2020 13:13:53 +0200 (CEST) Received: from localhost.localdomain (114.119.4.74) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Wed, 29 Apr 2020 19:13:38 +0800 From: "Wei Hu (Xavier)" To: Date: Wed, 29 Apr 2020 19:13:24 +0800 Message-ID: <20200429111328.64952-3-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200429111328.64952-1-huwei013@chinasoftinc.com> References: <20200429111328.64952-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [114.119.4.74] Subject: [dpdk-dev] [PATCH 2/6] net/hns3: print the detail ret value 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Lijun Ou Here adds some prints for return value when the relative function fails and enter the exception branch. Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_dcb.c | 7 +++++-- drivers/net/hns3/hns3_ethdev.c | 4 ++-- drivers/net/hns3/hns3_fdir.c | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c index 7dd77dc61..02628b6b6 100644 --- a/drivers/net/hns3/hns3_dcb.c +++ b/drivers/net/hns3/hns3_dcb.c @@ -768,13 +768,16 @@ hns3_dcb_pri_tc_base_dwrr_cfg(struct hns3_hw *hw) ret = hns3_dcb_pri_weight_cfg(hw, i, dwrr); if (ret) { - hns3_err(hw, "fail to send priority weight cmd: %d", i); + hns3_err(hw, + "fail to send priority weight cmd: %d, ret = %d", + i, ret); return ret; } ret = hns3_dcb_qs_weight_cfg(hw, i, BW_MAX_PERCENT); if (ret) { - hns3_err(hw, "fail to send qs_weight cmd: %d", i); + hns3_err(hw, "fail to send qs_weight cmd: %d, ret = %d", + i, ret); return ret; } } diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index c314d3711..8ff638850 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2064,8 +2064,8 @@ hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del) err = ret; rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, addr); - hns3_dbg(hw, "%s mc mac addr: %s failed", - del ? "Remove" : "Restore", mac_str); + hns3_dbg(hw, "%s mc mac addr: %s failed for pf: ret = %d", + del ? "Remove" : "Restore", mac_str, ret); } } return err; diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 26c311758..4c5928ffc 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -945,12 +945,12 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, false); if (ret) hns3_err(hw, "Failed to delete fdir: %d src_ip:%x " - "dst_ip:%x src_port:%d dst_port:%d", + "dst_ip:%x src_port:%d dst_port:%d ret = %d", rule->location, rule->key_conf.spec.src_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.dst_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.src_port, - rule->key_conf.spec.dst_port); + rule->key_conf.spec.dst_port, ret); else hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf); @@ -986,12 +986,12 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, rte_spinlock_unlock(&fdir_info->flows_lock); if (ret) { hns3_err(hw, "Failed to config fdir: %d src_ip:%x dst_ip:%x " - "src_port:%d dst_port:%d", + "src_port:%d dst_port:%d ret = %d", rule->location, rule->key_conf.spec.src_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.dst_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.src_port, - rule->key_conf.spec.dst_port); + rule->key_conf.spec.dst_port, ret); (void)hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf); } @@ -1023,7 +1023,7 @@ int hns3_clear_all_fdir_filter(struct hns3_adapter *hns) } if (ret) { - hns3_err(hw, "Fail to delete FDIR filter!"); + hns3_err(hw, "Fail to delete FDIR filter, ret = %d", ret); ret = -EIO; } return ret; @@ -1050,7 +1050,7 @@ int hns3_restore_all_fdir_filter(struct hns3_adapter *hns) } if (err) { - hns3_err(hw, "Fail to restore FDIR filter!"); + hns3_err(hw, "Fail to restore FDIR filter, ret = %d", ret); return -EIO; } return 0; -- 2.23.0