drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c- Extension
.c- Size
- 86330 bytes
- Lines
- 3112
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/sched/clock.hlinux/string_choices.hhclge_debugfs.hhclge_err.hhclge_main.hhclge_regs.hhclge_tm.hhnae3.h
Detected Declarations
function hclge_dbg_get_dfx_bd_numfunction hclge_dbg_cmd_sendfunction hclge_dbg_dump_reg_tqpfunction hclge_dbg_dump_reg_commonfunction hclge_dbg_dump_mac_enable_statusfunction hclge_dbg_dump_mac_frame_sizefunction hclge_dbg_dump_mac_speed_duplexfunction hclge_dbg_dump_macfunction hclge_dbg_dump_dcb_qsetfunction hclge_dbg_dump_dcb_prifunction hclge_dbg_dump_dcb_pgfunction hclge_dbg_dump_dcb_queuefunction hclge_dbg_dump_dcb_portfunction hclge_dbg_dump_dcb_tmfunction hclge_dbg_dump_dcbfunction hclge_dbg_dump_reg_cmdfunction hclge_dbg_dump_bios_reg_cmdfunction hclge_dbg_dump_ssu_reg_cmdfunction hclge_dbg_dump_igu_egu_reg_cmdfunction hclge_dbg_dump_rpu_reg_cmdfunction hclge_dbg_dump_ncsi_reg_cmdfunction hclge_dbg_dump_rtc_reg_cmdfunction hclge_dbg_dump_ppp_reg_cmdfunction hclge_dbg_dump_rcb_reg_cmdfunction hclge_dbg_dump_tqp_reg_cmdfunction hclge_dbg_dump_tcfunction hclge_dbg_fill_shaper_contentfunction hclge_dbg_dump_tm_pgfunction hclge_dbg_dump_tm_portfunction hclge_dbg_dump_tm_bp_qset_mapfunction hclge_dbg_dump_tm_mapfunction hclge_dbg_dump_tm_nodesfunction hclge_dbg_dump_tm_prifunction hclge_dbg_dump_tm_qsetfunction hclge_dbg_dump_qos_pause_cfgfunction hclge_dbg_dump_qos_pri_mapfunction hclge_dbg_dump_qos_dscp_mapfunction hclge_dbg_dump_tx_buf_cfgfunction hclge_dbg_dump_rx_priv_buf_cfgfunction hclge_dbg_dump_rx_common_wl_cfgfunction hclge_dbg_dump_rx_global_pkt_cntfunction hclge_dbg_dump_rx_priv_wl_buf_cfgfunction hclge_dbg_dump_rx_common_threshold_cfgfunction hclge_dbg_dump_qos_buf_cfgfunction hclge_dbg_dump_mng_tablefunction hclge_dbg_fd_tcam_readfunction hclge_dbg_get_rules_locationfunction hclge_dbg_dump_fd_tcam
Annotated Snippet
if (cmd == reg_info->cmd) {
if (cmd == HNAE3_DBG_CMD_REG_TQP)
return hclge_dbg_dump_reg_tqp(hdev,
reg_info, s);
ret = hclge_dbg_dump_reg_common(hdev, reg_info, s);
if (ret)
break;
}
}
return ret;
}
static int hclge_dbg_dump_bios_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_BIOS_COMMON, s);
}
static int hclge_dbg_dump_ssu_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_SSU, s);
}
static int hclge_dbg_dump_igu_egu_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_IGU_EGU, s);
}
static int hclge_dbg_dump_rpu_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_RPU, s);
}
static int hclge_dbg_dump_ncsi_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_NCSI, s);
}
static int hclge_dbg_dump_rtc_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_RTC, s);
}
static int hclge_dbg_dump_ppp_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_PPP, s);
}
static int hclge_dbg_dump_rcb_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_RCB, s);
}
static int hclge_dbg_dump_tqp_reg_cmd(struct seq_file *s, void *data)
{
return hclge_dbg_dump_reg_cmd(HNAE3_DBG_CMD_REG_TQP, s);
}
static int hclge_dbg_dump_tc(struct seq_file *s, void *data)
{
struct hclge_dev *hdev = hclge_seq_file_to_hdev(s);
struct hclge_ets_tc_weight_cmd *ets_weight;
const char *sch_mode_str;
struct hclge_desc desc;
int ret;
u8 i;
if (!hnae3_dev_dcb_supported(hdev)) {
dev_err(&hdev->pdev->dev,
"Only DCB-supported dev supports tc\n");
return -EOPNOTSUPP;
}
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_ETS_TC_WEIGHT, true);
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
if (ret) {
dev_err(&hdev->pdev->dev, "failed to get tc weight, ret = %d\n",
ret);
return ret;
}
ets_weight = (struct hclge_ets_tc_weight_cmd *)desc.data;
seq_printf(s, "enabled tc number: %u\n", hdev->tm_info.num_tc);
seq_printf(s, "weight_offset: %u\n", ets_weight->weight_offset);
seq_puts(s, "TC MODE WEIGHT\n");
for (i = 0; i < HNAE3_MAX_TC; i++) {
sch_mode_str = ets_weight->tc_weight[i] ? "dwrr" : "sp";
Annotation
- Immediate include surface: `linux/device.h`, `linux/sched/clock.h`, `linux/string_choices.h`, `hclge_debugfs.h`, `hclge_err.h`, `hclge_main.h`, `hclge_regs.h`, `hclge_tm.h`.
- Detected declarations: `function hclge_dbg_get_dfx_bd_num`, `function hclge_dbg_cmd_send`, `function hclge_dbg_dump_reg_tqp`, `function hclge_dbg_dump_reg_common`, `function hclge_dbg_dump_mac_enable_status`, `function hclge_dbg_dump_mac_frame_size`, `function hclge_dbg_dump_mac_speed_duplex`, `function hclge_dbg_dump_mac`, `function hclge_dbg_dump_dcb_qset`, `function hclge_dbg_dump_dcb_pri`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.