DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 2/6] net/hns3: print the detail ret value
Date: Wed, 29 Apr 2020 19:13:24 +0800	[thread overview]
Message-ID: <20200429111328.64952-3-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200429111328.64952-1-huwei013@chinasoftinc.com>

From: Lijun Ou <oulijun@huawei.com>

Here adds some prints for return value when the relative function fails
and enter the exception branch.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 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


  parent reply	other threads:[~2020-04-29 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 11:13 [dpdk-dev] [PATCH 0/6] misc updates and bugfixes for hns3 PMD driver Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 1/6] net/hns3: get Tx abnormal errors in extend device statistics Wei Hu (Xavier)
2020-04-29 11:13 ` Wei Hu (Xavier) [this message]
2020-04-29 11:13 ` [dpdk-dev] [PATCH 3/6] net/hns3: get PCI revision id Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 4/6] net/hns3: fix VLAN pvid when configuring device Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 5/6] net/hns3: fix MSI-x interrupt number during initialization Wei Hu (Xavier)
2020-04-29 11:13 ` [dpdk-dev] [PATCH 6/6] net/hns3: fix return value when clearing statistics fails Wei Hu (Xavier)
2020-05-05  9:12 ` [dpdk-dev] [PATCH 0/6] misc updates and bugfixes for hns3 PMD driver Ferruh Yigit

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=20200429111328.64952-3-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.com \
    --cc=dev@dpdk.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).