Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangpengpeng8 的贡献)变更摘要
本 PR 是一次纯重构:将 NpuDriver 的 17 个 Mbuf 相关成员函数实现从 npu_driver_queue.cc 原样迁移到新增的 npu_driver_mbuf.cc,并同步更新 arch5162.cmake、cmodel.cmake、runtime.cmake、tiny.cmake、v200.cmake 等构建配置,使新文件加入原本编译 npu_driver_queue.cc 的 Runtime 与 UT target。本次改动只调整源码归属,不修改接口、调用路径和平台能力,arch5162 在本步骤仍编译完整的 Mbuf 实现。
主要改动
- 新增 Mbuf 实现源文件: 新增
src/runtime/driver/npu_driver_mbuf.cc,集中承载MbufInit、MbufAlloc、MbufAllocEx、MbufFree、MbufBuild、MbufUnBuild、MbufGet、MbufPut、MbufSetDataLen、MbufGetDataLen、MbufGetBuffSize、MbufGetBuffAddr、MbufGetPrivInfo、MbufCopyBufRef、MbufChainAppend、MbufChainGetMbuf、MbufChainGetMbufNum共 17 个成员函数的实现,逻辑与迁移前一致。 - 从队列实现中移除 Mbuf 代码: 在
src/runtime/driver/npu_driver_queue.cc中删除上述 17 个 Mbuf 函数及Subcategory: MBuf注释块,仅保留原有的队列与内存组等相关实现。 - 更新多套 CMake 构建配置: 在
arch5162.cmake、cmodel.cmake、runtime.cmake、tiny.cmake、v200.cmake中将npu_driver_mbuf.cc加入对应的 Runtime 库目标,覆盖 v100、v200、v201、cmodel 及 arch5162 等构建。 - 保持外部行为与平台能力不变: 迁移不改变函数签名、调用路径和平台能力,arch5162 在本步骤仍编译完整 Mbuf 实现,因此可独立合入和独立回退。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
For more, you also can visit HICANN
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| src/runtime | ✅ yanmingxiang, 王涛, turing_yhy, wangluyao17, WangHuiH (5/2) | ✅ yanmingxiang, 王涛 (2/1) |
| src/runtime/cmake/runtime.cmake | ✅ 王涛, yanmingxiang (2/2) | ✅ 王涛 (1/1) |
| tests/ut/runtime | ✅ yanmingxiang, 王涛, wangluyao17, WangHuiH, turing_yhy (5/2) | ✅ yanmingxiang, 王涛 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhangpengpeng8, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [100c43cebaf543e69974b46b93d3ef89][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_part1 | ✅ SUCCESS | ||
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS | >>>>> |
[2026-08-15 12:10:35] CI执行结束


流水线任务触发成功
任务链接 [53ab4edc841e470e8cfe32211474f372][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-08-15 12:02:05] CI执行结束


compile


流水线任务触发成功
任务链接 [2d413c122a1b4b76b6cebbf01e5414eb][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_part1 | ✅ SUCCESS | ||
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS | >>>>> |
[2026-08-17 09:44:36] CI执行结束


流水线任务触发成功
任务链接 [5610aa4249cd4724a9e5772713be0c61][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-08-17 09:38:24] CI执行结束


/lgtm
/approve


Pull Request
描述
将
NpuDriver的 17 个 Mbuf 成员函数实现从npu_driver_queue.cc原样移动到独立的npu_driver_mbuf.cc,并把新文件加入所有原本编译npu_driver_queue.cc的 Runtime 与 UT target。本 PR 是 arch5162 隔离 Mbuf 组件的第 1 步,只调整源码归属,不修改接口、调用路径和平台能力。arch5162 在本步骤中仍然编译完整 Mbuf 实现,因此可以独立合入和独立回退。
变更类型
关联的Issue
无。
如何测试
runtime、runtime_v200、runtime_utest_api_others编译通过。runtime、runtime_utest_arch5162编译通过。ApiTest.rtMbuf*,16/16 通过。libruntime.so、libruntime_v200.so和 arch5162libruntime.so执行ldd -r,无未定义符号。核对清单
其他信息
npu_driver_queue.cc,不会影响后续步骤之外的逻辑。