drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c- Extension
.c- Size
- 3115 bytes
- Lines
- 116
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hhnae3.hhclge_comm_cmd.hhclge_comm_tqp_stats.h
Detected Declarations
function hclge_comm_tqps_get_sset_countfunction hclge_comm_tqps_get_stringsfunction hclge_comm_tqps_update_statsfunction hclge_comm_reset_tqp_statsexport hclge_comm_tqps_get_statsexport hclge_comm_tqps_get_sset_countexport hclge_comm_tqps_get_stringsexport hclge_comm_tqps_update_statsexport hclge_comm_reset_tqp_stats
Annotated Snippet
if (ret) {
dev_err(&hw->cmq.csq.pdev->dev,
"failed to get tqp stat, ret = %d, rx = %u.\n",
ret, i);
return ret;
}
tqp->tqp_stats.rcb_rx_ring_pktnum_rcd +=
le32_to_cpu(desc.data[1]);
hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS,
true);
desc.data[0] = cpu_to_le32(tqp->index);
ret = hclge_comm_cmd_send(hw, &desc, 1);
if (ret) {
dev_err(&hw->cmq.csq.pdev->dev,
"failed to get tqp stat, ret = %d, tx = %u.\n",
ret, i);
return ret;
}
tqp->tqp_stats.rcb_tx_ring_pktnum_rcd +=
le32_to_cpu(desc.data[1]);
}
return 0;
}
EXPORT_SYMBOL_GPL(hclge_comm_tqps_update_stats);
void hclge_comm_reset_tqp_stats(struct hnae3_handle *handle)
{
struct hnae3_knic_private_info *kinfo = &handle->kinfo;
struct hclge_comm_tqp *tqp;
struct hnae3_queue *queue;
u16 i;
for (i = 0; i < kinfo->num_tqps; i++) {
queue = kinfo->tqp[i];
tqp = container_of(queue, struct hclge_comm_tqp, q);
memset(&tqp->tqp_stats, 0, sizeof(tqp->tqp_stats));
}
}
EXPORT_SYMBOL_GPL(hclge_comm_reset_tqp_stats);
Annotation
- Immediate include surface: `linux/err.h`, `hnae3.h`, `hclge_comm_cmd.h`, `hclge_comm_tqp_stats.h`.
- Detected declarations: `function hclge_comm_tqps_get_sset_count`, `function hclge_comm_tqps_get_strings`, `function hclge_comm_tqps_update_stats`, `function hclge_comm_reset_tqp_stats`, `export hclge_comm_tqps_get_stats`, `export hclge_comm_tqps_get_sset_count`, `export hclge_comm_tqps_get_strings`, `export hclge_comm_tqps_update_stats`, `export hclge_comm_reset_tqp_stats`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
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.