CANN驱动HCCS网络状态查询

dcmi_get_hccsping_mesh_state

【免费下载链接】driver 本项目是CANN提供的驱动模块,实现基础驱动和资源管理及调度等功能,使能昇腾芯片。 【免费下载链接】driver 项目地址: https://gitcode.com/cann/driver

Prototype

int dcmi_get_hccsping_mesh_state (int card_id, int device_id, int port_id, unsigned int task_id, unsigned int *state)

Description

Queries the status of a resident pingmesh task.

Parameter Description

Parameter

Input/Output

Type

Description

card_id

Input

int

Device ID. The supported IDs can be obtained by calling dcmi_get_card_list.

device_id

Input

int

Chip ID, which can be obtained by calling dcmi_get_device_id_in_card. Value range:

NPU: [0, device_id_max – 1]

NOTE:

The value of device_id_max is 2. A device_id of 0 or 1 indicates an NPU. A device_id of 2 indicates an MCU.

port_id

Input

int

(Reserved) Network port number of the NPU device. Currently, the value can only be set to 0.

task_id

Input

unsigned int

task_id: task ID. The value range is [0, 1], which is specified by dcmi_start_hccsping_mesh.

state

Output

unsigned int*

Status of a resident pingmesh task.

0: The resident task is stopped.

1: The resident task is running.

Return Value

Type

Description

int

Results:

  • Success: The value 0 is returned.
  • Failure: For details about the return codes, see Return Codes.

Exception Handling

None

Restrictions

The specified device and the destination device must use the same NPU driver version.

This API can be used in the PM + privileged container scenario.

Table 1 Support in different deployment scenarios

Product Model

PM (Bare Metal)

PM + Unprivileged Container

Root User

Running User Group (Non-root User)

Root User

Atlas 900 A3 SuperPoD

Y

N

N

Atlas 9000 A3 SuperPoD Cluster Computing System

Y

N

N

Atlas 800T A3 SuperPoD

Y

N

N

Atlas 800I A3 SuperPoD

Y

N

N

A200T A3 Box8 SuperPoD server

Y

N

N

Note: Y indicates that the function is supported, N indicates that the function is not supported, and NA indicates that the function is not involved and planned currently.

Example

...
int ret = 0;
int card_id = 0;
int device_id = 0;
int port_id = 0;
unsigned int task_id = 0;
unsigned int state;
ret = dcmi_get_hccsping_mesh_state (card_id, device_id, port_id, task_id, &state);
if (ret != 0){
    // todo: Record logs.
    return ret;
}
...

【免费下载链接】driver 本项目是CANN提供的驱动模块,实现基础驱动和资源管理及调度等功能,使能昇腾芯片。 【免费下载链接】driver 项目地址: https://gitcode.com/cann/driver

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值