net/hns3: add error code to some logs
authorLijun Ou <oulijun@huawei.com>
Wed, 29 Apr 2020 11:13:24 +0000 (19:13 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:26 +0000 (15:54 +0200)
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
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_fdir.c

index 7dd77dc..02628b6 100644 (file)
@@ -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;
                }
        }
index c314d37..8ff6388 100644 (file)
@@ -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;
index 26c3117..4c5928f 100644 (file)
@@ -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;