Lines Matching refs:hdev

136 static int hclge_dbg_get_dfx_bd_num(struct hclge_dev *hdev, int offset,  in hclge_dbg_get_dfx_bd_num()  argument
144 ret = hclge_query_bd_num_cmd_send(hdev, desc); in hclge_dbg_get_dfx_bd_num()
146 dev_err(&hdev->pdev->dev, in hclge_dbg_get_dfx_bd_num()
157 dev_err(&hdev->pdev->dev, "The value of dfx bd_num is 0!\n"); in hclge_dbg_get_dfx_bd_num()
164 static int hclge_dbg_cmd_send(struct hclge_dev *hdev, in hclge_dbg_cmd_send() argument
181 ret = hclge_cmd_send(&hdev->hw, desc_src, bd_num); in hclge_dbg_cmd_send()
183 dev_err(&hdev->pdev->dev, in hclge_dbg_cmd_send()
189 hclge_dbg_dump_reg_tqp(struct hclge_dev *hdev, in hclge_dbg_dump_reg_tqp() argument
200 ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num); in hclge_dbg_dump_reg_tqp()
219 for (index = 0; index < hdev->vport[0].alloc_tqps; index++) { in hclge_dbg_dump_reg_tqp()
222 ret = hclge_dbg_cmd_send(hdev, desc, index, bd_num, in hclge_dbg_dump_reg_tqp()
243 hclge_dbg_dump_reg_common(struct hclge_dev *hdev, in hclge_dbg_dump_reg_common() argument
254 ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num); in hclge_dbg_dump_reg_common()
264 ret = hclge_dbg_cmd_send(hdev, desc, 0, bd_num, reg_msg->cmd); in hclge_dbg_dump_reg_common()
305 static int hclge_dbg_dump_mac_enable_status(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_mac_enable_status() argument
315 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_mac_enable_status()
317 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_mac_enable_status()
335 static int hclge_dbg_dump_mac_frame_size(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_mac_frame_size() argument
344 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_mac_frame_size()
346 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_mac_frame_size()
361 static int hclge_dbg_dump_mac_speed_duplex(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_mac_speed_duplex() argument
374 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_mac_speed_duplex()
376 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_mac_speed_duplex()
392 static int hclge_dbg_dump_mac(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_mac() argument
397 ret = hclge_dbg_dump_mac_enable_status(hdev, buf, len, &pos); in hclge_dbg_dump_mac()
401 ret = hclge_dbg_dump_mac_frame_size(hdev, buf, len, &pos); in hclge_dbg_dump_mac()
405 return hclge_dbg_dump_mac_speed_duplex(hdev, buf, len, &pos); in hclge_dbg_dump_mac()
408 static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_qset() argument
416 ret = hclge_tm_get_qset_num(hdev, &qset_num); in hclge_dbg_dump_dcb_qset()
423 ret = hclge_dbg_cmd_send(hdev, &desc, qset_id, 1, in hclge_dbg_dump_dcb_qset()
439 static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_pri() argument
447 ret = hclge_tm_get_pri_num(hdev, &pri_num); in hclge_dbg_dump_dcb_pri()
454 ret = hclge_dbg_cmd_send(hdev, &desc, pri_id, 1, in hclge_dbg_dump_dcb_pri()
469 static int hclge_dbg_dump_dcb_pg(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_pg() argument
479 for (pg_id = 0; pg_id < hdev->tm_info.num_pg; pg_id++) { in hclge_dbg_dump_dcb_pg()
480 ret = hclge_dbg_cmd_send(hdev, &desc, pg_id, 1, in hclge_dbg_dump_dcb_pg()
495 static int hclge_dbg_dump_dcb_queue(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_queue() argument
504 for (nq_id = 0; nq_id < hdev->num_tqps; nq_id++) { in hclge_dbg_dump_dcb_queue()
505 ret = hclge_dbg_cmd_send(hdev, &desc, nq_id, 1, in hclge_dbg_dump_dcb_queue()
513 ret = hclge_dbg_cmd_send(hdev, &desc, nq_id, 1, in hclge_dbg_dump_dcb_queue()
526 static int hclge_dbg_dump_dcb_port(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_port() argument
534 ret = hclge_dbg_cmd_send(hdev, &desc, port_id, 1, in hclge_dbg_dump_dcb_port()
549 static int hclge_dbg_dump_dcb_tm(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_dcb_tm() argument
556 ret = hclge_dbg_cmd_send(hdev, desc, port_id, 1, in hclge_dbg_dump_dcb_tm()
566 ret = hclge_dbg_cmd_send(hdev, desc, port_id, 2, in hclge_dbg_dump_dcb_tm()
588 if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) in hclge_dbg_dump_dcb_tm()
591 ret = hclge_dbg_cmd_send(hdev, desc, port_id, 1, in hclge_dbg_dump_dcb_tm()
611 static int hclge_dbg_dump_dcb(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_dcb() argument
616 ret = hclge_dbg_dump_dcb_qset(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
620 ret = hclge_dbg_dump_dcb_pri(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
624 ret = hclge_dbg_dump_dcb_pg(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
628 ret = hclge_dbg_dump_dcb_queue(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
632 ret = hclge_dbg_dump_dcb_port(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
636 return hclge_dbg_dump_dcb_tm(hdev, buf, len, &pos); in hclge_dbg_dump_dcb()
639 static int hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev, in hclge_dbg_dump_reg_cmd() argument
650 return hclge_dbg_dump_reg_tqp(hdev, reg_info, in hclge_dbg_dump_reg_cmd()
653 ret = hclge_dbg_dump_reg_common(hdev, reg_info, buf, in hclge_dbg_dump_reg_cmd()
663 static int hclge_dbg_dump_tc(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tc() argument
672 if (!hnae3_dev_dcb_supported(hdev)) { in hclge_dbg_dump_tc()
673 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_tc()
679 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_tc()
681 dev_err(&hdev->pdev->dev, "failed to get tc weight, ret = %d\n", in hclge_dbg_dump_tc()
689 hdev->tm_info.num_tc); in hclge_dbg_dump_tc()
736 static int __hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *data_str, in __hclge_dbg_dump_tm_pg() argument
755 for (pg_id = 0; pg_id < hdev->tm_info.num_pg; pg_id++) { in __hclge_dbg_dump_tm_pg()
756 ret = hclge_tm_get_pg_to_pri_map(hdev, pg_id, &pri_bit_map); in __hclge_dbg_dump_tm_pg()
760 ret = hclge_tm_get_pg_sch_mode(hdev, pg_id, &sch_mode); in __hclge_dbg_dump_tm_pg()
764 ret = hclge_tm_get_pg_weight(hdev, pg_id, &weight); in __hclge_dbg_dump_tm_pg()
768 ret = hclge_tm_get_pg_shaper(hdev, pg_id, in __hclge_dbg_dump_tm_pg()
774 ret = hclge_tm_get_pg_shaper(hdev, pg_id, in __hclge_dbg_dump_tm_pg()
800 static int hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_pg() argument
810 ret = __hclge_dbg_dump_tm_pg(hdev, data_str, buf, len); in hclge_dbg_dump_tm_pg()
817 static int hclge_dbg_dump_tm_port(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_port() argument
823 ret = hclge_tm_get_port_shaper(hdev, &shaper_para); in hclge_dbg_dump_tm_port()
838 static int hclge_dbg_dump_tm_bp_qset_map(struct hclge_dev *hdev, u8 tc_id, in hclge_dbg_dump_tm_bp_qset_map() argument
850 grp_num = hdev->num_tqps <= HCLGE_TQP_MAX_SIZE_DEV_V2 ? in hclge_dbg_dump_tm_bp_qset_map()
859 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_tm_bp_qset_map()
861 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_tm_bp_qset_map()
885 static int hclge_dbg_dump_tm_map(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_map() argument
895 for (queue_id = 0; queue_id < hdev->num_tqps; queue_id++) { in hclge_dbg_dump_tm_map()
896 ret = hclge_tm_get_q_to_qs_map(hdev, queue_id, &qset_id); in hclge_dbg_dump_tm_map()
900 ret = hclge_tm_get_qset_map_pri(hdev, qset_id, &pri_id, in hclge_dbg_dump_tm_map()
905 ret = hclge_tm_get_q_to_tc(hdev, queue_id, &tc_id); in hclge_dbg_dump_tm_map()
915 if (!hnae3_dev_dcb_supported(hdev)) in hclge_dbg_dump_tm_map()
918 ret = hclge_dbg_dump_tm_bp_qset_map(hdev, tc_id, buf + pos, in hclge_dbg_dump_tm_map()
930 static int hclge_dbg_dump_tm_nodes(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_nodes() argument
938 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_tm_nodes()
940 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_tm_nodes()
982 static int hclge_dbg_dump_tm_pri(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_pri() argument
991 ret = hclge_tm_get_pri_num(hdev, &pri_num); in hclge_dbg_dump_tm_pri()
1003 ret = hclge_tm_get_pri_sch_mode(hdev, i, &sch_mode); in hclge_dbg_dump_tm_pri()
1007 ret = hclge_tm_get_pri_weight(hdev, i, &weight); in hclge_dbg_dump_tm_pri()
1011 ret = hclge_tm_get_pri_shaper(hdev, i, in hclge_dbg_dump_tm_pri()
1017 ret = hclge_tm_get_pri_shaper(hdev, i, in hclge_dbg_dump_tm_pri()
1056 static int hclge_dbg_dump_tm_qset(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tm_qset() argument
1067 ret = hclge_tm_get_qset_num(hdev, &qset_num); in hclge_dbg_dump_tm_qset()
1079 ret = hclge_tm_get_qset_map_pri(hdev, i, &priority, &link_vld); in hclge_dbg_dump_tm_qset()
1083 ret = hclge_tm_get_qset_sch_mode(hdev, i, &sch_mode); in hclge_dbg_dump_tm_qset()
1087 ret = hclge_tm_get_qset_weight(hdev, i, &weight); in hclge_dbg_dump_tm_qset()
1091 ret = hclge_tm_get_qset_shaper(hdev, i, &shaper_para); in hclge_dbg_dump_tm_qset()
1115 static int hclge_dbg_dump_qos_pause_cfg(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_qos_pause_cfg() argument
1124 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_qos_pause_cfg()
1126 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_qos_pause_cfg()
1142 static int hclge_dbg_dump_qos_pri_map(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_qos_pri_map() argument
1155 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_qos_pri_map()
1157 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_qos_pri_map()
1178 static int hclge_dbg_dump_qos_dscp_map(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_qos_dscp_map() argument
1181 struct hnae3_knic_private_info *kinfo = &hdev->vport[0].nic.kinfo; in hclge_dbg_dump_qos_dscp_map()
1198 ret = hclge_cmd_send(&hdev->hw, desc, HCLGE_DSCP_MAP_TC_BD_NUM); in hclge_dbg_dump_qos_dscp_map()
1200 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_qos_dscp_map()
1230 static int hclge_dbg_dump_tx_buf_cfg(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_tx_buf_cfg() argument
1238 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_tx_buf_cfg()
1240 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_tx_buf_cfg()
1254 static int hclge_dbg_dump_rx_priv_buf_cfg(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_rx_priv_buf_cfg() argument
1263 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_rx_priv_buf_cfg()
1265 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_rx_priv_buf_cfg()
1284 static int hclge_dbg_dump_rx_common_wl_cfg(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_rx_common_wl_cfg() argument
1293 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_rx_common_wl_cfg()
1295 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_rx_common_wl_cfg()
1310 static int hclge_dbg_dump_rx_global_pkt_cnt(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_rx_global_pkt_cnt() argument
1319 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_rx_global_pkt_cnt()
1321 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_rx_global_pkt_cnt()
1335 static int hclge_dbg_dump_rx_priv_wl_buf_cfg(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_rx_priv_wl_buf_cfg() argument
1346 ret = hclge_cmd_send(&hdev->hw, desc, 2); in hclge_dbg_dump_rx_priv_wl_buf_cfg()
1348 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_rx_priv_wl_buf_cfg()
1371 static int hclge_dbg_dump_rx_common_threshold_cfg(struct hclge_dev *hdev, in hclge_dbg_dump_rx_common_threshold_cfg() argument
1382 ret = hclge_cmd_send(&hdev->hw, desc, 2); in hclge_dbg_dump_rx_common_threshold_cfg()
1384 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_rx_common_threshold_cfg()
1408 static int hclge_dbg_dump_qos_buf_cfg(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_qos_buf_cfg() argument
1414 ret = hclge_dbg_dump_tx_buf_cfg(hdev, buf + pos, len - pos); in hclge_dbg_dump_qos_buf_cfg()
1419 ret = hclge_dbg_dump_rx_priv_buf_cfg(hdev, buf + pos, len - pos); in hclge_dbg_dump_qos_buf_cfg()
1424 ret = hclge_dbg_dump_rx_common_wl_cfg(hdev, buf + pos, len - pos); in hclge_dbg_dump_qos_buf_cfg()
1429 ret = hclge_dbg_dump_rx_global_pkt_cnt(hdev, buf + pos, len - pos); in hclge_dbg_dump_qos_buf_cfg()
1435 if (!hnae3_dev_dcb_supported(hdev)) in hclge_dbg_dump_qos_buf_cfg()
1438 ret = hclge_dbg_dump_rx_priv_wl_buf_cfg(hdev, buf + pos, len - pos); in hclge_dbg_dump_qos_buf_cfg()
1443 ret = hclge_dbg_dump_rx_common_threshold_cfg(hdev, buf + pos, in hclge_dbg_dump_qos_buf_cfg()
1451 static int hclge_dbg_dump_mng_table(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_mng_table() argument
1471 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_mng_table()
1473 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_mng_table()
1512 static int hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, bool sel_x, in hclge_dbg_fd_tcam_read() argument
1538 ret = hclge_cmd_send(&hdev->hw, desc, 3); in hclge_dbg_fd_tcam_read()
1567 static int hclge_dbg_get_rules_location(struct hclge_dev *hdev, u16 *rule_locs) in hclge_dbg_get_rules_location() argument
1573 spin_lock_bh(&hdev->fd_rule_lock); in hclge_dbg_get_rules_location()
1574 hlist_for_each_entry_safe(rule, node, &hdev->fd_rule_list, rule_node) { in hclge_dbg_get_rules_location()
1578 spin_unlock_bh(&hdev->fd_rule_lock); in hclge_dbg_get_rules_location()
1580 if (cnt != hdev->hclge_fd_rule_num || cnt == 0) in hclge_dbg_get_rules_location()
1586 static int hclge_dbg_dump_fd_tcam(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_fd_tcam() argument
1588 u32 rule_num = hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]; in hclge_dbg_dump_fd_tcam()
1595 if (!hnae3_ae_dev_fd_supported(hdev->ae_dev)) { in hclge_dbg_dump_fd_tcam()
1596 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_fd_tcam()
1601 if (!hdev->hclge_fd_rule_num || !rule_num) in hclge_dbg_dump_fd_tcam()
1614 rule_cnt = hclge_dbg_get_rules_location(hdev, rule_locs); in hclge_dbg_dump_fd_tcam()
1617 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_fd_tcam()
1627 ret = hclge_dbg_fd_tcam_read(hdev, true, tcam_buf, tcam_msg); in hclge_dbg_dump_fd_tcam()
1629 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_fd_tcam()
1636 ret = hclge_dbg_fd_tcam_read(hdev, false, tcam_buf, tcam_msg); in hclge_dbg_dump_fd_tcam()
1638 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_fd_tcam()
1652 static int hclge_dbg_dump_fd_counter(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_fd_counter() argument
1654 u8 func_num = pci_num_vf(hdev->pdev) + 1; /* pf and enabled vf num */ in hclge_dbg_dump_fd_counter()
1663 if (!hnae3_ae_dev_fd_supported(hdev->ae_dev)) in hclge_dbg_dump_fd_counter()
1673 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_fd_counter()
1675 dev_err(&hdev->pdev->dev, "failed to get fd counter, ret = %d\n", in hclge_dbg_dump_fd_counter()
1698 int hclge_dbg_dump_rst_info(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_rst_info() argument
1704 hdev->rst_stats.pf_rst_cnt); in hclge_dbg_dump_rst_info()
1706 hdev->rst_stats.flr_rst_cnt); in hclge_dbg_dump_rst_info()
1708 hdev->rst_stats.global_rst_cnt); in hclge_dbg_dump_rst_info()
1710 hdev->rst_stats.imp_rst_cnt); in hclge_dbg_dump_rst_info()
1712 hdev->rst_stats.reset_done_cnt); in hclge_dbg_dump_rst_info()
1714 hdev->rst_stats.hw_reset_done_cnt); in hclge_dbg_dump_rst_info()
1716 hdev->rst_stats.reset_cnt); in hclge_dbg_dump_rst_info()
1718 hdev->rst_stats.reset_fail_cnt); in hclge_dbg_dump_rst_info()
1724 hclge_read_dev(&hdev->hw, offset)); in hclge_dbg_dump_rst_info()
1728 hdev->state); in hclge_dbg_dump_rst_info()
1733 static int hclge_dbg_dump_serv_info(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_serv_info() argument
1745 jiffies_to_msecs(jiffies - hdev->last_serv_processed)); in hclge_dbg_dump_serv_info()
1748 hdev->last_serv_processed); in hclge_dbg_dump_serv_info()
1750 hdev->serv_processed_cnt); in hclge_dbg_dump_serv_info()
1755 static int hclge_dbg_dump_interrupt(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_interrupt() argument
1760 hdev->num_nic_msi); in hclge_dbg_dump_interrupt()
1762 hdev->num_roce_msi); in hclge_dbg_dump_interrupt()
1764 hdev->num_msi_used); in hclge_dbg_dump_interrupt()
1766 hdev->num_msi_left); in hclge_dbg_dump_interrupt()
1799 hclge_dbg_get_imp_stats_info(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_get_imp_stats_info() argument
1810 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_get_imp_stats_info()
1812 dev_err(&hdev->pdev->dev, in hclge_dbg_get_imp_stats_info()
1820 dev_err(&hdev->pdev->dev, "imp statistics bd number is 0!\n"); in hclge_dbg_get_imp_stats_info()
1828 ret = hclge_dbg_cmd_send(hdev, desc_src, 0, bd_num, in hclge_dbg_get_imp_stats_info()
1832 dev_err(&hdev->pdev->dev, in hclge_dbg_get_imp_stats_info()
1874 hclge_dbg_dump_ncl_config(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_ncl_config() argument
1893 ret = hclge_dbg_cmd_send(hdev, desc, data0, bd_num, in hclge_dbg_dump_ncl_config()
1904 static int hclge_dbg_dump_loopback(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_loopback() argument
1906 struct phy_device *phydev = hdev->hw.mac.phydev; in hclge_dbg_dump_loopback()
1918 hdev->hw.mac.mac_id); in hclge_dbg_dump_loopback()
1921 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_loopback()
1923 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_loopback()
1934 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_dbg_dump_loopback()
1936 dev_err(&hdev->pdev->dev, in hclge_dbg_dump_loopback()
1955 } else if (hnae3_dev_phy_imp_supported(hdev)) { in hclge_dbg_dump_loopback()
1969 hclge_dbg_dump_mac_tnl_status(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_mac_tnl_status() argument
1978 while (kfifo_get(&hdev->mac_tnl_log, &stats)) { in hclge_dbg_dump_mac_tnl_status()
1997 static void hclge_dbg_dump_mac_list(struct hclge_dev *hdev, char *buf, int len, in hclge_dbg_dump_mac_list() argument
2019 for (func_id = 0; func_id < hdev->num_alloc_vport; func_id++) { in hclge_dbg_dump_mac_list()
2020 vport = &hdev->vport[func_id]; in hclge_dbg_dump_mac_list()
2040 static int hclge_dbg_dump_umv_info(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_umv_info() argument
2042 u8 func_num = pci_num_vf(hdev->pdev) + 1; in hclge_dbg_dump_umv_info()
2048 hdev->num_alloc_vport); in hclge_dbg_dump_umv_info()
2050 hdev->max_umv_size); in hclge_dbg_dump_umv_info()
2052 hdev->wanted_umv_size); in hclge_dbg_dump_umv_info()
2054 hdev->priv_umv_size); in hclge_dbg_dump_umv_info()
2056 mutex_lock(&hdev->vport_lock); in hclge_dbg_dump_umv_info()
2058 hdev->share_umv_size); in hclge_dbg_dump_umv_info()
2060 vport = &hdev->vport[i]; in hclge_dbg_dump_umv_info()
2065 mutex_unlock(&hdev->vport_lock); in hclge_dbg_dump_umv_info()
2068 hdev->used_mc_mac_num); in hclge_dbg_dump_umv_info()
2073 static int hclge_get_vlan_rx_offload_cfg(struct hclge_dev *hdev, u8 vf_id, in hclge_get_vlan_rx_offload_cfg() argument
2089 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_get_vlan_rx_offload_cfg()
2091 dev_err(&hdev->pdev->dev, in hclge_get_vlan_rx_offload_cfg()
2108 static int hclge_get_vlan_tx_offload_cfg(struct hclge_dev *hdev, u8 vf_id, in hclge_get_vlan_tx_offload_cfg() argument
2123 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_get_vlan_tx_offload_cfg()
2125 dev_err(&hdev->pdev->dev, in hclge_get_vlan_tx_offload_cfg()
2145 static int hclge_get_vlan_filter_config_cmd(struct hclge_dev *hdev, in hclge_get_vlan_filter_config_cmd() argument
2157 ret = hclge_cmd_send(&hdev->hw, desc, 1); in hclge_get_vlan_filter_config_cmd()
2159 dev_err(&hdev->pdev->dev, in hclge_get_vlan_filter_config_cmd()
2166 static int hclge_get_vlan_filter_state(struct hclge_dev *hdev, u8 vlan_type, in hclge_get_vlan_filter_state() argument
2173 ret = hclge_get_vlan_filter_config_cmd(hdev, vlan_type, vf_id, &desc); in hclge_get_vlan_filter_state()
2183 static int hclge_get_port_vlan_filter_bypass_state(struct hclge_dev *hdev, in hclge_get_port_vlan_filter_bypass_state() argument
2190 if (!test_bit(HNAE3_DEV_SUPPORT_PORT_VLAN_BYPASS_B, hdev->ae_dev->caps)) in hclge_get_port_vlan_filter_bypass_state()
2197 ret = hclge_cmd_send(&hdev->hw, &desc, 1); in hclge_get_port_vlan_filter_bypass_state()
2199 dev_err(&hdev->pdev->dev, in hclge_get_port_vlan_filter_bypass_state()
2235 static int hclge_dbg_dump_vlan_filter_config(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_vlan_filter_config() argument
2241 u8 func_num = pci_num_vf(hdev->pdev) + 1; /* pf and enabled vf num */ in hclge_dbg_dump_vlan_filter_config()
2244 ret = hclge_get_vlan_filter_state(hdev, HCLGE_FILTER_TYPE_PORT, 0, in hclge_dbg_dump_vlan_filter_config()
2261 ret = hclge_get_vlan_filter_state(hdev, HCLGE_FILTER_TYPE_VF, i, in hclge_dbg_dump_vlan_filter_config()
2268 ret = hclge_get_port_vlan_filter_bypass_state(hdev, i, &bypass); in hclge_dbg_dump_vlan_filter_config()
2277 hdev->ae_dev->caps) ? state_str[bypass] : "NA"; in hclge_dbg_dump_vlan_filter_config()
2288 static int hclge_dbg_dump_vlan_offload_config(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_vlan_offload_config() argument
2294 u8 func_num = pci_num_vf(hdev->pdev) + 1; /* pf and enabled vf num */ in hclge_dbg_dump_vlan_offload_config()
2304 ret = hclge_get_vlan_tx_offload_cfg(hdev, i, &vlan_cfg); in hclge_dbg_dump_vlan_offload_config()
2308 ret = hclge_get_vlan_rx_offload_cfg(hdev, i, &vlan_cfg); in hclge_dbg_dump_vlan_offload_config()
2339 static int hclge_dbg_dump_vlan_config(struct hclge_dev *hdev, char *buf, in hclge_dbg_dump_vlan_config() argument
2345 ret = hclge_dbg_dump_vlan_filter_config(hdev, buf, len, &pos); in hclge_dbg_dump_vlan_config()
2349 return hclge_dbg_dump_vlan_offload_config(hdev, buf, len, &pos); in hclge_dbg_dump_vlan_config()
2352 static int hclge_dbg_dump_ptp_info(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_ptp_info() argument
2354 struct hclge_ptp *ptp = hdev->ptp; in hclge_dbg_dump_ptp_info()
2390 ret = hclge_ptp_cfg_qry(hdev, &hw_cfg); in hclge_dbg_dump_ptp_info()
2403 static int hclge_dbg_dump_mac_uc(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_mac_uc() argument
2405 hclge_dbg_dump_mac_list(hdev, buf, len, true); in hclge_dbg_dump_mac_uc()
2410 static int hclge_dbg_dump_mac_mc(struct hclge_dev *hdev, char *buf, int len) in hclge_dbg_dump_mac_mc() argument
2412 hclge_dbg_dump_mac_list(hdev, buf, len, false); in hclge_dbg_dump_mac_mc()
2573 struct hclge_dev *hdev = vport->back; in hclge_dbg_read_cmd() local
2580 return cmd_func->dbg_dump(hdev, buf, len); in hclge_dbg_read_cmd()
2582 return cmd_func->dbg_dump_reg(hdev, cmd, buf, in hclge_dbg_read_cmd()
2587 dev_err(&hdev->pdev->dev, "invalid command(%d)\n", cmd); in hclge_dbg_read_cmd()