From: Lijun Ou Date: Wed, 29 Apr 2020 11:13:24 +0000 (+0800) Subject: net/hns3: add error code to some logs X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8eed8acc812e3a11270e9b30c2a7b429a3c865e6;p=dpdk.git net/hns3: add error code to some logs 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) --- diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c index 7dd77dc611..02628b6b69 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 c314d3711f..8ff6388505 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 26c3117580..4c5928ffcc 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;