| @@ -284,7 +284,7 @@ typedef struct HcclCommConfigDef { | |||
| 284 | 284 | ||
| 285 | - **hcclSymWinMaxMemSizePerRank**:Atlas A3 训练系列产品/Atlas A3 推理系列产品的HCCS场景下,为当前通信域中每个rank预留的对称内存大小,单位GB,取值范围:\[1, 当前环境中允许分配的物理内存最大值\],默认值16。该参数仅在Atlas A3 训练系列产品/Atlas A3 推理系列产品的HCCS场景下生效。Ascend 950PR/Ascend 950DT的URMA场景使用已申请的Device内存注册对称内存窗口,不依赖该参数配置预留的对称内存大小。 | 285 | - **hcclSymWinMaxMemSizePerRank**:Atlas A3 训练系列产品/Atlas A3 推理系列产品的HCCS场景下,为当前通信域中每个rank预留的对称内存大小,单位GB,取值范围:\[1, 当前环境中允许分配的物理内存最大值\],默认值16。该参数仅在Atlas A3 训练系列产品/Atlas A3 推理系列产品的HCCS场景下生效。Ascend 950PR/Ascend 950DT的URMA场景使用已申请的Device内存注册对称内存窗口,不依赖该参数配置预留的对称内存大小。 |
| 286 | 286 | ||
| 287 | -- **hcclChannelSqDepth**:用于配置通信发送队列(SQ)深度,目前仅在A5场景下支持,且仅在AIV展开模式和UBC TP、UBC CTP、UBG协议下可配置。配置值会向上调整为最近的2的整数次幂,调整后的有效取值范围为[16, 设备的max_jfs_depth]。其余场景下保持为无效值。 | 287 | +- **hcclChannelSqDepth**:用于配置通信发送队列(SQ)深度,目前仅在A5场景下支持,且仅在AIV展开模式和UB_CTP、UB_RTP协议下可配置。配置值会向上调整为最近的2的整数次幂,调整后的有效取值范围为[16, 设备的max_jfs_depth]。其余场景下保持为无效值。 |
| 288 | 288 | ||
| 289 | 289 | ||
| 290 | ## 配置优先级说明 | 290 | ## 配置优先级说明 |
| @@ -58,16 +58,13 @@ HcommResult:接口成功返回0,其他失败。 | |||
| 58 | 58 | ||
| 59 | - COMM_ENGINE_CPU | 59 | - COMM_ENGINE_CPU |
| 60 | - COMM_PROTOCOL_ROCE | 60 | - COMM_PROTOCOL_ROCE |
| 61 | - - COMM_PROTOCOL_UBC_CTP | 61 | + - COMM_PROTOCOL_UB_CTP |
| 62 | - - COMM_PROTOCOL_UBC_TP | ||
| 63 | - COMM_ENGINE_AICPU_TS | 62 | - COMM_ENGINE_AICPU_TS |
| 64 | - COMM_PROTOCOL_UBOE | 63 | - COMM_PROTOCOL_UBOE |
| 65 | - - COMM_PROTOCOL_UBC_CTP | 64 | + - COMM_PROTOCOL_UB_CTP |
| 66 | - - COMM_PROTOCOL_UBC_TP | ||
| 67 | - COMM_PROTOCOL_ROCE | 65 | - COMM_PROTOCOL_ROCE |
| 68 | - COMM_ENGINE_AIV | 66 | - COMM_ENGINE_AIV |
| 69 | - - COMM_PROTOCOL_UBC_CTP | 67 | + - COMM_PROTOCOL_UB_CTP |
| 70 | - - COMM_PROTOCOL_UBC_TP | ||
| 71 | - COMM_PROTOCOL_ROCE | 68 | - COMM_PROTOCOL_ROCE |
| 72 | <!-- end id6 --> | 69 | <!-- end id6 --> |
| 73 | 70 | ||
| @@ -59,7 +59,7 @@ HcommResult:接口成功返回0,其他失败。 | |||
| 59 | 2. 当config为nullptr时,行为与[HcommChannelCreate](HcommChannelCreate.md)完全等价。 | 59 | 2. 当config为nullptr时,行为与[HcommChannelCreate](HcommChannelCreate.md)完全等价。 |
| 60 | 60 | ||
| 61 | 3. 当IS_SHARED_QUEUE=true时,有以下额外约束: | 61 | 3. 当IS_SHARED_QUEUE=true时,有以下额外约束: |
| 62 | - - 仅支持UB网络语义协议(COMM_PROTOCOL_UBC_CTP、COMM_PROTOCOL_UBC_TP),不支持UBMem/RoCE/UBOE/UBG。 | 62 | + - 仅支持UB网络语义协议(COMM_PROTOCOL_UB_CTP),不支持UBMem/RoCE/UBOE/UB_RTP。 |
| 63 | - 使用相同endpointHandle多次调用本接口创建的Channel共享同一个Jetty。 | 63 | - 使用相同endpointHandle多次调用本接口创建的Channel共享同一个Jetty。 |
| 64 | - 使用不同endpointHandle调用创建的Channel不共享Jetty。 | 64 | - 使用不同endpointHandle调用创建的Channel不共享Jetty。 |
| 65 | - 共享Jetty的不同Channel不支持并发使用,需由调用者按业务顺序串行调用。 | 65 | - 共享Jetty的不同Channel不支持并发使用,需由调用者按业务顺序串行调用。 |
| @@ -74,16 +74,13 @@ HcommResult:接口成功返回0,其他失败。 | |||
| 74 | 74 | ||
| 75 | - COMM_ENGINE_CPU | 75 | - COMM_ENGINE_CPU |
| 76 | - COMM_PROTOCOL_ROCE | 76 | - COMM_PROTOCOL_ROCE |
| 77 | - - COMM_PROTOCOL_UBC_CTP | 77 | + - COMM_PROTOCOL_UB_CTP |
| 78 | - - COMM_PROTOCOL_UBC_TP | ||
| 79 | - COMM_ENGINE_AICPU_TS | 78 | - COMM_ENGINE_AICPU_TS |
| 80 | - COMM_PROTOCOL_UBOE | 79 | - COMM_PROTOCOL_UBOE |
| 81 | - - COMM_PROTOCOL_UBC_CTP | 80 | + - COMM_PROTOCOL_UB_CTP |
| 82 | - - COMM_PROTOCOL_UBC_TP | ||
| 83 | - COMM_PROTOCOL_ROCE | 81 | - COMM_PROTOCOL_ROCE |
| 84 | - COMM_ENGINE_AIV | 82 | - COMM_ENGINE_AIV |
| 85 | - - COMM_PROTOCOL_UBC_CTP | 83 | + - COMM_PROTOCOL_UB_CTP |
| 86 | - - COMM_PROTOCOL_UBC_TP | ||
| 87 | - COMM_PROTOCOL_ROCE | 84 | - COMM_PROTOCOL_ROCE |
| 88 | <!-- end id6 --> | 85 | <!-- end id6 --> |
| 89 | 86 | ||
| @@ -106,7 +103,7 @@ HcommChannelDesc channelDescs[CHANNEL_NUM] = {0}; | |||
| 106 | ChannelHandle channels[CHANNEL_NUM] = {0}; | 103 | ChannelHandle channels[CHANNEL_NUM] = {0}; |
| 107 | for (uint32_t i = 0; i < CHANNEL_NUM; i++) { | 104 | for (uint32_t i = 0; i < CHANNEL_NUM; i++) { |
| 108 | HcommChannelDescInit(&channelDescs[i]); | 105 | HcommChannelDescInit(&channelDescs[i]); |
| 109 | - channelDescs[i].remoteEndpoint.protocol = COMM_PROTOCOL_UBC_TP; | 106 | + channelDescs[i].remoteEndpoint.protocol = COMM_PROTOCOL_UB_CTP; |
| 110 | // 填充localEndpoint / remoteEndpoint ... | 107 | // 填充localEndpoint / remoteEndpoint ... |
| 111 | } | 108 | } |
| 112 | 109 | ||
| @@ -41,8 +41,8 @@ HcommResult:接口返回0表示成功,其他失败。 | |||
| 41 | 41 | ||
| 42 | ## 约束说明 | 42 | ## 约束说明 |
| 43 | 43 | ||
| 44 | - - 当Endpoint位于HOST侧时,支持的protocol为RoCE、UBC_TP、UBC_CTP。 | 44 | + - 当Endpoint位于HOST侧时,支持的protocol为RoCE、UB_CTP。 |
| 45 | - - 当Endpoint位于DEVICE侧时,支持的protocol为RoCE、UBC_TP、UBC_CTP、UB_MEM、PCIe、UBoE、HCCS、UBG。其中UBG仅Ascend 950PR/Ascend 950DT支持。 | 45 | + - 当Endpoint位于DEVICE侧时,支持的protocol为RoCE、UB_CTP、UB_MEM、PCIe、UBoE、HCCS、UB_RTP。其中UB_RTP仅Ascend 950PR/Ascend 950DT支持。 |
| 46 | 46 | ||
| 47 | ## 调用示例 | 47 | ## 调用示例 |
| 48 | 48 | ||
| @@ -50,7 +50,7 @@ HcommResult:接口返回0表示成功,其他失败。 | |||
| 50 | struct in_addr ipAddr; | 50 | struct in_addr ipAddr; |
| 51 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); | 51 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); |
| 52 | const EndpointDesc endpointDesc = { | 52 | const EndpointDesc endpointDesc = { |
| 53 | - .protocol = COMM_PROTOCOL_UBC_TP, | 53 | + .protocol = COMM_PROTOCOL_UB_RTP, |
| 54 | .commAddr = { | 54 | .commAddr = { |
| 55 | .type = COMM_ADDR_TYPE_IP_V4, | 55 | .type = COMM_ADDR_TYPE_IP_V4, |
| 56 | .addr = ipAddr | 56 | .addr = ipAddr |
| @@ -48,7 +48,7 @@ HcommResult:接口成功返回0,其他失败。 | |||
| 48 | struct in_addr ipAddr; | 48 | struct in_addr ipAddr; |
| 49 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); | 49 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); |
| 50 | const EndpointDesc endpointDesc = { | 50 | const EndpointDesc endpointDesc = { |
| 51 | - .protocol = COMM_PROTOCOL_UBC_TP, | 51 | + .protocol = COMM_PROTOCOL_UB_RTP, |
| 52 | .commAddr = { | 52 | .commAddr = { |
| 53 | .type = COMM_ADDR_TYPE_IP_V4, | 53 | .type = COMM_ADDR_TYPE_IP_V4, |
| 54 | .addr = ipAddr | 54 | .addr = ipAddr |
| @@ -50,7 +50,7 @@ HcommResult:接口成功返回0,其他失败。 | |||
| 50 | struct in_addr ipAddr; | 50 | struct in_addr ipAddr; |
| 51 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); | 51 | inet_pton(AF_INET, "192.168.1.100", &ipAddr); |
| 52 | const EndpointDesc endpointDesc = { | 52 | const EndpointDesc endpointDesc = { |
| 53 | - .protocol = COMM_PROTOCOL_UBC_TP, | 53 | + .protocol = COMM_PROTOCOL_UB_RTP, |
| 54 | .commAddr = { | 54 | .commAddr = { |
| 55 | .type = COMM_ADDR_TYPE_IP_V4, | 55 | .type = COMM_ADDR_TYPE_IP_V4, |
| 56 | .addr = ipAddr | 56 | .addr = ipAddr |
| @@ -59,17 +59,14 @@ HcclResult HcclChannelAcquire(HcclComm comm, CommEngine engine, const HcclChanne | |||
| 59 | - COMM_PROTOCOL_ROCE | 59 | - COMM_PROTOCOL_ROCE |
| 60 | - COMM_ENGINE_AICPU_TS | 60 | - COMM_ENGINE_AICPU_TS |
| 61 | - COMM_PROTOCOL_UBOE | 61 | - COMM_PROTOCOL_UBOE |
| 62 | - - COMM_PROTOCOL_UBC_CTP | 62 | + - COMM_PROTOCOL_UB_CTP |
| 63 | - - COMM_PROTOCOL_UBC_TP | ||
| 64 | - COMM_PROTOCOL_ROCE | 63 | - COMM_PROTOCOL_ROCE |
| 65 | - COMM_ENGINE_AIV | 64 | - COMM_ENGINE_AIV |
| 66 | - - COMM_PROTOCOL_UBC_CTP | 65 | + - COMM_PROTOCOL_UB_CTP |
| 67 | - - COMM_PROTOCOL_UBC_TP | ||
| 68 | - COMM_PROTOCOL_UB_MEM | 66 | - COMM_PROTOCOL_UB_MEM |
| 69 | - COMM_PROTOCOL_ROCE | 67 | - COMM_PROTOCOL_ROCE |
| 70 | - COMM_ENGINE_CCU | 68 | - COMM_ENGINE_CCU |
| 71 | - - COMM_PROTOCOL_UBC_CTP | 69 | + - COMM_PROTOCOL_UB_CTP |
| 72 | - - COMM_PROTOCOL_UBC_TP | ||
| 73 | <!-- end id6 --> | 70 | <!-- end id6 --> |
| 74 | 71 | ||
| 75 | <!-- npu="A3" id7 --> | 72 | <!-- npu="A3" id7 --> |
| @@ -58,7 +58,7 @@ HcclResult HcclChannelAcquireWithConfig(HcclComm comm, CommEngine engine, | |||
| 58 | 58 | ||
| 59 | 3. 当IS_SHARED_QUEUE=true时,有以下额外约束: | 59 | 3. 当IS_SHARED_QUEUE=true时,有以下额外约束: |
| 60 | - 仅支持AIV引擎。 | 60 | - 仅支持AIV引擎。 |
| 61 | - - 仅支持UB网络语义协议(COMM_PROTOCOL_UBC_CTP、COMM_PROTOCOL_UBC_TP),不支持UBMem/RoCE/UBOE/UBG。 | 61 | + - 仅支持UB网络语义协议(COMM_PROTOCOL_UB_CTP),不支持UBMem/RoCE/UBOE/UB_RTP。 |
| 62 | - 必须设置SHARED_QUEUE_TAG(非空字符串)。 | 62 | - 必须设置SHARED_QUEUE_TAG(非空字符串)。 |
| 63 | - channelDescs中所有元素的localEndpoint必须相同(复用的Jetty只能关联一个endpoint)。 | 63 | - channelDescs中所有元素的localEndpoint必须相同(复用的Jetty只能关联一个endpoint)。 |
| 64 | - 仅支持V2通信器(需通过HcclCommInitClusterInfoConfig等V2接口创建通信域)。 | 64 | - 仅支持V2通信器(需通过HcclCommInitClusterInfoConfig等V2接口创建通信域)。 |
| @@ -87,7 +87,7 @@ ChannelHandle channels[CHANNEL_NUM] = {0}; | |||
| 87 | for (uint32_t i = 0; i < CHANNEL_NUM; i++) { | 87 | for (uint32_t i = 0; i < CHANNEL_NUM; i++) { |
| 88 | HcclChannelDescInit(&channelDescs[i], 1); | 88 | HcclChannelDescInit(&channelDescs[i], 1); |
| 89 | channelDescs[i].remoteRank = remoteRanks[i]; | 89 | channelDescs[i].remoteRank = remoteRanks[i]; |
| 90 | - channelDescs[i].channelProtocol = COMM_PROTOCOL_UBC_TP; | 90 | + channelDescs[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 91 | // 填充localEndpoint / remoteEndpoint ... | 91 | // 填充localEndpoint / remoteEndpoint ... |
| 92 | } | 92 | } |
| 93 | 93 | ||
| @@ -42,7 +42,7 @@ int32_t:接口成功返回0,其他失败。 | |||
| 42 | 42 | ||
| 43 | <!-- npu="950" id6 --> | 43 | <!-- npu="950" id6 --> |
| 44 | - 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用,不支持在AICPU侧调用。 | 44 | - 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用,不支持在AICPU侧调用。 |
| 45 | -- 调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`、`COMM_PROTOCOL_UBC_TP`或`COMM_PROTOCOL_UBC_CTP`。 | 45 | +- 调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`或`COMM_PROTOCOL_UB_CTP`。 |
| 46 | <!-- end id6 --> | 46 | <!-- end id6 --> |
| 47 | 47 | ||
| 48 | ## 调用示例 | 48 | ## 调用示例 |
| @@ -44,8 +44,8 @@ int32_t:接口成功返回0,其他失败。 | |||
| 44 | <!-- npu="950" id6 --> | 44 | <!-- npu="950" id6 --> |
| 45 | 针对Ascend 950PR/Ascend 950DT,支持AICPU侧和Host CPU侧调用。 | 45 | 针对Ascend 950PR/Ascend 950DT,支持AICPU侧和Host CPU侧调用。 |
| 46 | 46 | ||
| 47 | -- AICPU侧调用时,通信引擎为AICPU_TS,支持通信协议UBC_TP、UBC_CTP、UBoE。 | 47 | +- AICPU侧调用时,通信引擎为AICPU_TS,支持通信协议UB_CTP、UBoE。 |
| 48 | -- Host CPU侧调用时,调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`、`COMM_PROTOCOL_UBC_TP`或`COMM_PROTOCOL_UBC_CTP`。 | 48 | +- Host CPU侧调用时,调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`或`COMM_PROTOCOL_UB_CTP`。 |
| 49 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 | 49 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 |
| 50 | <!-- end id6 --> | 50 | <!-- end id6 --> |
| 51 | 51 | ||
| @@ -45,7 +45,7 @@ int32_t:接口成功返回0,其他失败。 | |||
| 45 | ## 约束说明 | 45 | ## 约束说明 |
| 46 | 46 | ||
| 47 | <!-- npu="950" id6 --> | 47 | <!-- npu="950" id6 --> |
| 48 | -- 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用。调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`、`COMM_PROTOCOL_UBC_TP`或`COMM_PROTOCOL_UBC_CTP`。其中,NBI读接口(HcommReadNbiOnThread)和NBI写接口(HcommWriteNbiOnThread)仅支持RoCE协议(需配置DPU/1825网卡),不支持UBC_CTP和UBC_TP协议。 | 48 | +- 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用。调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`或`COMM_PROTOCOL_UB_CTP`。其中,NBI读接口(HcommReadNbiOnThread)和NBI写接口(HcommWriteNbiOnThread)仅支持RoCE协议(需配置DPU/1825网卡),不支持UB_CTP协议。 |
| 49 | <!-- end id6 --> | 49 | <!-- end id6 --> |
| 50 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 | 50 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 |
| 51 | - `[dst, dst + len)`必须落在本端已注册或获取的内存范围内,`[src, src + len)`必须落在对端已导入或获取的内存范围内。 | 51 | - `[dst, dst + len)`必须落在本端已注册或获取的内存范围内,`[src, src + len)`必须落在对端已导入或获取的内存范围内。 |
| @@ -45,7 +45,7 @@ int32_t:接口成功返回0,其他失败。 | |||
| 45 | <!-- npu="950" id6 --> | 45 | <!-- npu="950" id6 --> |
| 46 | ## 约束说明 | 46 | ## 约束说明 |
| 47 | 47 | ||
| 48 | -针对Ascend 950PR/Ascend 950DT,仅支持通信协议UBC_TP、UBC_CTP、UBoE。 | 48 | +针对Ascend 950PR/Ascend 950DT,仅支持通信协议UB_CTP、UBoE。 |
| 49 | <!-- end id6 --> | 49 | <!-- end id6 --> |
| 50 | 50 | ||
| 51 | ## 调用示例 | 51 | ## 调用示例 |
| @@ -45,7 +45,7 @@ int32_t:接口成功返回0,其他失败。 | |||
| 45 | ## 约束说明 | 45 | ## 约束说明 |
| 46 | 46 | ||
| 47 | <!-- npu="950" id6 --> | 47 | <!-- npu="950" id6 --> |
| 48 | -- 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用。调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`、`COMM_PROTOCOL_UBC_TP`或`COMM_PROTOCOL_UBC_CTP`。其中,NBI读接口(HcommReadNbiOnThread)和NBI写接口(HcommWriteNbiOnThread)仅支持RoCE协议(需配置DPU/1825网卡),不支持UBC_CTP和UBC_TP协议。 | 48 | +- 针对Ascend 950PR/Ascend 950DT,本接口仅支持在Host CPU上调用。调用[HcommChannelCreate](../../../control_plane_api/basic_resource_mgmt/HcommChannelCreate.md)或[HcclChannelAcquire](../../../control_plane_api/comms_domain_resource_mgmt/HcclChannelAcquire.md)申请入参channel时,需传入`engine = COMM_ENGINE_CPU`,且`channelDesc.remoteEndpoint.protocol`需为`COMM_PROTOCOL_ROCE`或`COMM_PROTOCOL_UB_CTP`。其中,NBI读接口(HcommReadNbiOnThread)和NBI写接口(HcommWriteNbiOnThread)仅支持RoCE协议(需配置DPU/1825网卡),不支持UB_CTP协议。 |
| 49 | <!-- end id6 --> | 49 | <!-- end id6 --> |
| 50 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 | 50 | - Host CPU侧调用时,`thread`参数无作用,可传入0。 |
| 51 | - `[src, src + len)`必须落在本端已注册或获取的内存范围内,`[dst, dst + len)`必须落在对端已导入或获取的内存范围内。 | 51 | - `[src, src + len)`必须落在本端已注册或获取的内存范围内,`[dst, dst + len)`必须落在对端已导入或获取的内存范围内。 |
| @@ -45,7 +45,7 @@ int32_t:接口成功返回0,其他失败。 | |||
| 45 | <!-- npu="950" id6 --> | 45 | <!-- npu="950" id6 --> |
| 46 | ## 约束说明 | 46 | ## 约束说明 |
| 47 | 47 | ||
| 48 | -针对Ascend 950PR/Ascend 950DT,仅支持通信协议UBC_TP、UBC_CTP、UBoE。 | 48 | +针对Ascend 950PR/Ascend 950DT,仅支持通信协议UB_CTP、UBoE。 |
| 49 | <!-- end id6 --> | 49 | <!-- end id6 --> |
| 50 | 50 | ||
| 51 | ## 调用示例 | 51 | ## 调用示例 |
| @@ -13,12 +13,14 @@ typedef enum { | |||
| 13 | COMM_PROTOCOL_ROCE = 1, /* RDMA over Converged Ethernet */ | 13 | COMM_PROTOCOL_ROCE = 1, /* RDMA over Converged Ethernet */ |
| 14 | COMM_PROTOCOL_PCIE = 2, /* PCIE协议 */ | 14 | COMM_PROTOCOL_PCIE = 2, /* PCIE协议 */ |
| 15 | COMM_PROTOCOL_SIO = 3, /* SIO协议 */ | 15 | COMM_PROTOCOL_SIO = 3, /* SIO协议 */ |
| 16 | - COMM_PROTOCOL_UBC_CTP = 4, /* 华为统一总线UBC_CTP */ | 16 | + COMM_PROTOCOL_UB_CTP = 4, /* 华为统一总线UB_CTP */ |
| 17 | - COMM_PROTOCOL_UBC_TP = 5, /* 华为统一总线UBC_TP */ | 17 | + COMM_PROTOCOL_UBC_CTP = COMM_PROTOCOL_UB_CTP, /* 兼容旧协议名UBC_CTP */ |
| 18 | + COMM_PROTOCOL_UBC_TP = 5, /* 历史兼容协议UBC_TP,不建议新开发使用 */ | ||
| 18 | COMM_PROTOCOL_UB_MEM = 6, /* UB_MEM */ | 19 | COMM_PROTOCOL_UB_MEM = 6, /* UB_MEM */ |
| 19 | COMM_PROTOCOL_UBOE = 7, /* UBoE */ | 20 | COMM_PROTOCOL_UBOE = 7, /* UBoE */ |
| 20 | COMM_PROTOCOL_HCCS_ONLY = 8, /* 一卡双DIE使用HCCS */ | 21 | COMM_PROTOCOL_HCCS_ONLY = 8, /* 一卡双DIE使用HCCS */ |
| 21 | - COMM_PROTOCOL_UBG = 9, /* UBG */ | 22 | + COMM_PROTOCOL_UB_RTP = 9, /* UB_RTP */ |
| 23 | + COMM_PROTOCOL_UBG = COMM_PROTOCOL_UB_RTP, /* 兼容旧协议名UBG */ | ||
| 22 | } CommProtocol; | 24 | } CommProtocol; |
| 23 | ``` | 25 | ``` |
| 24 | 26 | ||
| @@ -29,22 +31,18 @@ typedef enum { | |||
| 29 | 31 | ||
| 30 | - COMM_ENGINE_CPU | 32 | - COMM_ENGINE_CPU |
| 31 | - COMM_PROTOCOL_ROCE | 33 | - COMM_PROTOCOL_ROCE |
| 32 | - - COMM_PROTOCOL_UBC_CTP | 34 | + - COMM_PROTOCOL_UB_CTP |
| 33 | - - COMM_PROTOCOL_UBC_TP | ||
| 34 | - COMM_ENGINE_AICPU_TS | 35 | - COMM_ENGINE_AICPU_TS |
| 35 | - COMM_PROTOCOL_UBOE | 36 | - COMM_PROTOCOL_UBOE |
| 36 | - - COMM_PROTOCOL_UBC_CTP | 37 | + - COMM_PROTOCOL_UB_CTP |
| 37 | - - COMM_PROTOCOL_UBC_TP | ||
| 38 | - COMM_PROTOCOL_UB_MEM | 38 | - COMM_PROTOCOL_UB_MEM |
| 39 | - - COMM_PROTOCOL_UBG | 39 | + - COMM_PROTOCOL_UB_RTP |
| 40 | - COMM_ENGINE_AIV | 40 | - COMM_ENGINE_AIV |
| 41 | - - COMM_PROTOCOL_UBC_CTP | 41 | + - COMM_PROTOCOL_UB_CTP |
| 42 | - - COMM_PROTOCOL_UBC_TP | ||
| 43 | - COMM_PROTOCOL_UB_MEM | 42 | - COMM_PROTOCOL_UB_MEM |
| 44 | - COMM_PROTOCOL_ROCE | 43 | - COMM_PROTOCOL_ROCE |
| 45 | - COMM_ENGINE_CCU | 44 | - COMM_ENGINE_CCU |
| 46 | - - COMM_PROTOCOL_UBC_CTP | 45 | + - COMM_PROTOCOL_UB_CTP |
| 47 | - - COMM_PROTOCOL_UBC_TP | ||
| 48 | <!-- end id1 --> | 46 | <!-- end id1 --> |
| 49 | 47 | ||
| 50 | <!-- npu="A3" id2 --> | 48 | <!-- npu="A3" id2 --> |
| @@ -19,5 +19,5 @@ typedef enum { | |||
| 19 | | 枚举值 | 值 | 描述 | 适用接口 | | 19 | | 枚举值 | 值 | 描述 | 适用接口 | |
| 20 | | --- | --- | --- | --- | | 20 | | --- | --- | --- | --- | |
| 21 | | HCCL_CHANNEL_CONFIG_TYPE_INVALID | -1 | 无效值,用于初始化校验。 | - | | 21 | | HCCL_CHANNEL_CONFIG_TYPE_INVALID | -1 | 无效值,用于初始化校验。 | - | |
| 22 | -| HCCL_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE | 0 | 是否启用共享队列模式(bool/int,默认0=false)。<br>设为true时,创建的多个Channel共享一个Jetty。<br>仅支持AIV引擎的UB网络语义协议(UBC_CTP/UBC_TP)。 | [HcclChannelConfigSetInt](../control_plane_api/comms_domain_resource_mgmt/HcclChannelConfigSetInt.md) | | 22 | +| HCCL_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE | 0 | 是否启用共享队列模式(bool/int,默认0=false)。<br>设为true时,创建的多个Channel共享一个Jetty。<br>仅支持AIV引擎的UB网络语义协议(UB_CTP)。 | [HcclChannelConfigSetInt](../control_plane_api/comms_domain_resource_mgmt/HcclChannelConfigSetInt.md) | |
| 23 | | HCCL_CHANNEL_CONFIG_TYPE_SHARED_QUEUE_TAG | 1 | 共享队列的tag标识(string)。<br>仅IS_SHARED_QUEUE=true时有效,指定创建Channel的tag。<br>重复调用时,使用相同tag创建出的Channel共享一个Jetty。 | [HcclChannelConfigSetStr](../control_plane_api/comms_domain_resource_mgmt/HcclChannelConfigSetStr.md) | | 23 | | HCCL_CHANNEL_CONFIG_TYPE_SHARED_QUEUE_TAG | 1 | 共享队列的tag标识(string)。<br>仅IS_SHARED_QUEUE=true时有效,指定创建Channel的tag。<br>重复调用时,使用相同tag创建出的Channel共享一个Jetty。 | [HcclChannelConfigSetStr](../control_plane_api/comms_domain_resource_mgmt/HcclChannelConfigSetStr.md) | |
| @@ -11,7 +11,7 @@ typedef struct { | |||
| 11 | CommAbiHeader header; | 11 | CommAbiHeader header; |
| 12 | CommEngine engine; /* COMM_ENGINE_AICPU_TS / CCU 等 */ | 12 | CommEngine engine; /* COMM_ENGINE_AICPU_TS / CCU 等 */ |
| 13 | uint32_t notifyNum; /* channel所需的notify数量 */ | 13 | uint32_t notifyNum; /* channel所需的notify数量 */ |
| 14 | - CommProtocol protocol; /* 例如 COMM_PROTOCOL_HCCS / UBC_TP / UBOE */ | 14 | + CommProtocol protocol; /* 例如 COMM_PROTOCOL_HCCS / COMM_PROTOCOL_UB_RTP / COMM_PROTOCOL_UBOE */ |
| 15 | uint32_t channelCnt; /* 用户可以自行指定channel个数 */ | 15 | uint32_t channelCnt; /* 用户可以自行指定channel个数 */ |
| 16 | 16 | ||
| 17 | uint32_t reserved[4]; | 17 | uint32_t reserved[4]; |
| @@ -25,6 +25,6 @@ typedef struct { | |||
| 25 | | header | ABI头部,由[HcclTeamCreateChannelsDescInit](../control_plane_api/comms_domain_resource_mgmt/HcclTeamCreateChannelsDescInit.md)初始化。CommAbiHeader类型的定义可参见[CommAbiHeader](CommAbiHeader.md)。 | | 25 | | header | ABI头部,由[HcclTeamCreateChannelsDescInit](../control_plane_api/comms_domain_resource_mgmt/HcclTeamCreateChannelsDescInit.md)初始化。CommAbiHeader类型的定义可参见[CommAbiHeader](CommAbiHeader.md)。 | |
| 26 | | engine | 通信引擎类型,例如COMM_ENGINE_AICPU_TS、COMM_ENGINE_CCU。CommEngine类型的定义可参见[CommEngine](CommEngine.md)。 | | 26 | | engine | 通信引擎类型,例如COMM_ENGINE_AICPU_TS、COMM_ENGINE_CCU。CommEngine类型的定义可参见[CommEngine](CommEngine.md)。 | |
| 27 | | notifyNum | 每个channel所需的notify数量。 | | 27 | | notifyNum | 每个channel所需的notify数量。 | |
| 28 | -| protocol | 通信协议,例如COMM_PROTOCOL_HCCS、COMM_PROTOCOL_UBC_TP、COMM_PROTOCOL_UBOE。CommProtocol类型的定义可参见[CommProtocol](CommProtocol.md)。 | | 28 | +| protocol | 通信协议,例如COMM_PROTOCOL_HCCS、COMM_PROTOCOL_UB_RTP、COMM_PROTOCOL_UBOE。CommProtocol类型的定义可参见[CommProtocol](CommProtocol.md)。 | |
| 29 | | channelCnt | 每个对端成员的channel个数,不可为0。 | | 29 | | channelCnt | 每个对端成员的channel个数,不可为0。 | |
| 30 | | reserved[4] | 预留字段。 | | 30 | | reserved[4] | 预留字段。 | |
| @@ -18,4 +18,4 @@ typedef enum { | |||
| 18 | | 枚举值 | 值 | 描述 | 适用接口 | | 18 | | 枚举值 | 值 | 描述 | 适用接口 | |
| 19 | | --- | --- | --- | --- | | 19 | | --- | --- | --- | --- | |
| 20 | | HCOMM_CHANNEL_CONFIG_TYPE_INVALID | -1 | 无效值,用于初始化校验。 | - | | 20 | | HCOMM_CHANNEL_CONFIG_TYPE_INVALID | -1 | 无效值,用于初始化校验。 | - | |
| 21 | -| HCOMM_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE | 0 | 是否启用共享队列模式(bool/int,默认0=false)。<br>设为true时,使用[HcommChannelCreateWithConfig](../control_plane_api/basic_resource_mgmt/HcommChannelCreateWithConfig.md)创建的多个Channel共享一个Jetty。<br>仅支持UB网络语义协议(UBC_CTP/UBC_TP)。 | [HcommChannelConfigSetInt](../control_plane_api/basic_resource_mgmt/HcommChannelConfigSetInt.md) | | 21 | +| HCOMM_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE | 0 | 是否启用共享队列模式(bool/int,默认0=false)。<br>设为true时,使用[HcommChannelCreateWithConfig](../control_plane_api/basic_resource_mgmt/HcommChannelCreateWithConfig.md)创建的多个Channel共享一个Jetty。<br>仅支持UB网络语义协议(UB_CTP)。 | [HcommChannelConfigSetInt](../control_plane_api/basic_resource_mgmt/HcommChannelConfigSetInt.md) | |
| @@ -24,7 +24,7 @@ flowchart LR | |||
| 24 | |------|------| | 24 | |------|------| |
| 25 | | **集合通信原语** | AllReduce、Broadcast、AllGather、ReduceScatter、AlltoAllv、Send、Receive、... | | 25 | | **集合通信原语** | AllReduce、Broadcast、AllGather、ReduceScatter、AlltoAllv、Send、Receive、... | |
| 26 | | **通信算法** | Ring、Mesh、RHD(Halving-Doubling)、Star + 自研算法 | | 26 | | **通信算法** | Ring、Mesh、RHD(Halving-Doubling)、Star + 自研算法 | |
| 27 | -| **通信协议** | UBC、UBG、UBoE、RoCE(v2)、HCCS、UB_MEM | | 27 | +| **通信协议** | UBC、UB_RTP、UBoE、RoCE(v2)、HCCS、UB_MEM | |
| 28 | | **执行模式** | 单算子模式 + 图模式 | | 28 | | **执行模式** | 单算子模式 + 图模式 | |
| 29 | | **扩展能力** | 通信算子自定义开发 | | 29 | | **扩展能力** | 通信算子自定义开发 | |
| 30 | | **应用场景** | 大模型训练(数据/模型/专家并行)与推理(TP/PP/EP)的集合通信 | | 30 | | **应用场景** | 大模型训练(数据/模型/专家并行)与推理(TP/PP/EP)的集合通信 | |
| @@ -62,7 +62,7 @@ for(uint32_t remoteRank = 0; remoteRank < rankSize; remoteRank++) { | |||
| 62 | CommLink *linkList = nullptr; | 62 | CommLink *linkList = nullptr; |
| 63 | CHK_RET(HcclRankGraphGetLinks(comm, netLayer, myRank, remoteRank, &linkList, &listSize)); // 获取srcRank和dstRank间link信息 | 63 | CHK_RET(HcclRankGraphGetLinks(comm, netLayer, myRank, remoteRank, &linkList, &listSize)); // 获取srcRank和dstRank间link信息 |
| 64 | HcclChannelDesc desc; | 64 | HcclChannelDesc desc; |
| 65 | - CommProtocol protocol = CommProtocol::COMM_PROTOCOL_UBC_CTP; | 65 | + CommProtocol protocol = CommProtocol::COMM_PROTOCOL_UB_CTP; |
| 66 | bool protocolExists = false; | 66 | bool protocolExists = false; |
| 67 | for (uint32_t idx = 0; idx < listSize; idx++) { | 67 | for (uint32_t idx = 0; idx < listSize; idx++) { |
| 68 | CommLink link = linkList[idx]; | 68 | CommLink link = linkList[idx]; |
| @@ -106,7 +106,7 @@ rankId: 1, output: [ 0 1 ] | |||
| 106 | 106 | ||
| 107 | HcclChannelDesc desc; | 107 | HcclChannelDesc desc; |
| 108 | CHK_RET(HcclChannelDescInit(&desc, 1)); | 108 | CHK_RET(HcclChannelDescInit(&desc, 1)); |
| 109 | - CommProtocol protocol = CommProtocol::COMM_PROTOCOL_UBC_CTP; | 109 | + CommProtocol protocol = CommProtocol::COMM_PROTOCOL_UB_CTP; |
| 110 | bool protocolExists = false; | 110 | bool protocolExists = false; |
| 111 | for (uint32_t idx = 0; idx < listSize; idx++) { | 111 | for (uint32_t idx = 0; idx < listSize; idx++) { |
| 112 | CommLink link = linkList[idx]; | 112 | CommLink link = linkList[idx]; |
| @@ -9,7 +9,7 @@ HCOMM Experimental NIC Plugin 用于在通用服务器场景下扩展 host 侧 | |||
| 9 | | 插件 | 产物 | 注册协议 | | 9 | | 插件 | 产物 | 注册协议 | |
| 10 | | --- | --- | --- | | 10 | | --- | --- | --- | |
| 11 | | HOST RoCE 插件 | `libhcomm_cpu_roce_plugin.so` | `COMM_PROTOCOL_ROCE` | | 11 | | HOST RoCE 插件 | `libhcomm_cpu_roce_plugin.so` | `COMM_PROTOCOL_ROCE` | |
| 12 | -| HOST UB 插件 | `libhcomm_cpu_ub_plugin.so` | `COMM_PROTOCOL_UBC_TP`、`COMM_PROTOCOL_UBC_CTP` | | 12 | +| HOST UB 插件 | `libhcomm_cpu_ub_plugin.so` | `COMM_PROTOCOL_UB_CTP` | |
| 13 | 13 | ||
| 14 | ## 编译打包 | 14 | ## 编译打包 |
| 15 | 15 | ||
| @@ -9,7 +9,7 @@ This directory provides two example plugins: | |||
| 9 | | Plugin | Artifact | Registered Protocol | | 9 | | Plugin | Artifact | Registered Protocol | |
| 10 | | --- | --- | --- | | 10 | | --- | --- | --- | |
| 11 | | HOST RoCE plugin | `libhcomm_cpu_roce_plugin.so` | `COMM_PROTOCOL_ROCE` | | 11 | | HOST RoCE plugin | `libhcomm_cpu_roce_plugin.so` | `COMM_PROTOCOL_ROCE` | |
| 12 | -| HOST UB plugin | `libhcomm_cpu_ub_plugin.so` | `COMM_PROTOCOL_UBC_TP`, `COMM_PROTOCOL_UBC_CTP` | | 12 | +| HOST UB plugin | `libhcomm_cpu_ub_plugin.so` | `COMM_PROTOCOL_UB_CTP` | |
| 13 | 13 | ||
| 14 | ## Building and Packaging | 14 | ## Building and Packaging |
| 15 | 15 | ||
| @@ -36,7 +36,7 @@ const HcommNicPluginInfo kPluginInfo | |||
| 36 | "hcomm_cpu_ub", | 36 | "hcomm_cpu_ub", |
| 37 | 2U, | 37 | 2U, |
| 38 | // Only the first protocolCount entries are valid. Keep unused slots explicit to avoid HCCS zero-init. | 38 | // Only the first protocolCount entries are valid. Keep unused slots explicit to avoid HCCS zero-init. |
| 39 | - {COMM_PROTOCOL_UBC_TP, COMM_PROTOCOL_UBC_CTP, COMM_PROTOCOL_RESERVED, COMM_PROTOCOL_RESERVED}, | 39 | + {COMM_PROTOCOL_UBC_TP, COMM_PROTOCOL_UB_CTP, COMM_PROTOCOL_RESERVED, COMM_PROTOCOL_RESERVED}, |
| 40 | {}}; | 40 | {}}; |
| 41 | 41 | ||
| 42 | HcommNicEndpointOps kEndpointOps = PluginOps::EndpointOps(); | 42 | HcommNicEndpointOps kEndpointOps = PluginOps::EndpointOps(); |
| @@ -138,7 +138,7 @@ typedef void* HcclChannelConfig; | |||
| 138 | typedef enum { | 138 | typedef enum { |
| 139 | HCCL_CHANNEL_CONFIG_TYPE_INVALID = -1, | 139 | HCCL_CHANNEL_CONFIG_TYPE_INVALID = -1, |
| 140 | /** 0: IS_SHARED_QUEUE (bool/int, 默认 0=false)。 | 140 | /** 0: IS_SHARED_QUEUE (bool/int, 默认 0=false)。 |
| 141 | - * 仅支持 AIV 引擎的 UB 网络语义协议(UBC_CTP/UBC_TP,不支持 UBMem/RoCE/UBOE/UBG)。 | 141 | + * 仅支持 AIV 引擎的 UB 网络语义协议(UB_CTP/UBC_TP,不支持 UBMem/RoCE/UBOE/UB_RTP)。 |
| 142 | * 设为 true 时,创建的多个 Channel 共享一个 Jetty。 */ | 142 | * 设为 true 时,创建的多个 Channel 共享一个 Jetty。 */ |
| 143 | HCCL_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE = 0, | 143 | HCCL_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE = 0, |
| 144 | /** 1: SHARED_QUEUE_TAG (string)。 | 144 | /** 1: SHARED_QUEUE_TAG (string)。 |
| @@ -189,7 +189,7 @@ extern HcclResult HcclChannelConfigSetStr(HcclChannelConfig config, HcclChannelC | |||
| 189 | * @param[out] channels 创建的通道句柄列表 | 189 | * @param[out] channels 创建的通道句柄列表 |
| 190 | * @return HcclResult 执行结果状态码 | 190 | * @return HcclResult 执行结果状态码 |
| 191 | * @note 当 config 中 IS_SHARED_QUEUE=true 时: | 191 | * @note 当 config 中 IS_SHARED_QUEUE=true 时: |
| 192 | - * - 仅支持 AIV 引擎的 UB 网络语义协议(UBC_CTP/UBC_TP),不支持 UBMem/RoCE/UBOE/UBG。 | 192 | + * - 仅支持 AIV 引擎的 UB 网络语义协议(UB_CTP/UBC_TP),不支持 UBMem/RoCE/UBOE/UB_RTP。 |
| 193 | * - channelDescs 中的源 localEndpoint 必须相同(复用的 jetty 只能关联一个 endpoint)。 | 193 | * - channelDescs 中的源 localEndpoint 必须相同(复用的 jetty 只能关联一个 endpoint)。 |
| 194 | * - 通信域基于 SHARED_QUEUE_TAG 指定的 tag 管理 channel 复用。 | 194 | * - 通信域基于 SHARED_QUEUE_TAG 指定的 tag 管理 channel 复用。 |
| 195 | * - tag 之下,使用源目的 endpointPair 索引一组 channel。 | 195 | * - tag 之下,使用源目的 endpointPair 索引一组 channel。 |
| @@ -124,7 +124,7 @@ typedef void* HcommChannelConfig; | |||
| 124 | typedef enum { | 124 | typedef enum { |
| 125 | HCOMM_CHANNEL_CONFIG_TYPE_INVALID = -1, | 125 | HCOMM_CHANNEL_CONFIG_TYPE_INVALID = -1, |
| 126 | /** 0: IS_SHARED_QUEUE (bool/int, 默认 0=false)。 | 126 | /** 0: IS_SHARED_QUEUE (bool/int, 默认 0=false)。 |
| 127 | - * 仅支持 AIV 引擎的 UB 网络语义协议(UBC_CTP/UBC_TP,不支持 UBMem/RoCE/UBOE/UBG)。 | 127 | + * 仅支持 AIV 引擎的 UB 网络语义协议(UB_CTP/UBC_TP,不支持 UBMem/RoCE/UBOE/UB_RTP)。 |
| 128 | * 设为 true 时,使用 HcommChannelCreateWithConfig 创建的多个 Channel 共享一个 Jetty。 */ | 128 | * 设为 true 时,使用 HcommChannelCreateWithConfig 创建的多个 Channel 共享一个 Jetty。 */ |
| 129 | HCOMM_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE = 0, | 129 | HCOMM_CHANNEL_CONFIG_TYPE_IS_SHARED_QUEUE = 0, |
| 130 | } HcommChannelConfigType; | 130 | } HcommChannelConfigType; |
| @@ -168,7 +168,7 @@ extern HcommResult HcommChannelConfigSetInt(HcommChannelConfig config, HcommChan | |||
| 168 | * @param[out] channels 输出的通道句柄数组 | 168 | * @param[out] channels 输出的通道句柄数组 |
| 169 | * @return HcommResult 执行结果状态码 | 169 | * @return HcommResult 执行结果状态码 |
| 170 | * @note 当 config 中 IS_SHARED_QUEUE=true 时: | 170 | * @note 当 config 中 IS_SHARED_QUEUE=true 时: |
| 171 | - * - 仅支持 UB 网络语义协议(UBC_CTP/UBC_TP),不支持 UBMem/RoCE/UBOE/UBG。 | 171 | + * - 仅支持 UB 网络语义协议(UB_CTP/UBC_TP),不支持 UBMem/RoCE/UBOE/UB_RTP。 |
| 172 | * - 使用相同 endpointHandle 多次调用本接口创建的 Channel 共享同一个 Jetty。 | 172 | * - 使用相同 endpointHandle 多次调用本接口创建的 Channel 共享同一个 Jetty。 |
| 173 | * - 使用不同 endpointHandle 调用创建的 Channel 不共享 Jetty。 | 173 | * - 使用不同 endpointHandle 调用创建的 Channel 不共享 Jetty。 |
| 174 | * - 共享 Jetty 的不同 Channel 不支持并发使用,需由调用者按业务顺序串行调用。 | 174 | * - 共享 Jetty 的不同 Channel 不支持并发使用,需由调用者按业务顺序串行调用。 |
| @@ -117,17 +117,19 @@ typedef enum { | |||
| 117 | * @brief 通信协议类型枚举 | 117 | * @brief 通信协议类型枚举 |
| 118 | */ | 118 | */ |
| 119 | typedef enum { | 119 | typedef enum { |
| 120 | - COMM_PROTOCOL_RESERVED = -1, ///< 保留协议类型 | 120 | + COMM_PROTOCOL_RESERVED = -1, ///< 保留协议类型 |
| 121 | - COMM_PROTOCOL_HCCS = 0, ///< HCCS协议 | 121 | + COMM_PROTOCOL_HCCS = 0, ///< HCCS协议 |
| 122 | - COMM_PROTOCOL_ROCE = 1, ///< RDMA over Converged Ethernet | 122 | + COMM_PROTOCOL_ROCE = 1, ///< RDMA over Converged Ethernet |
| 123 | - COMM_PROTOCOL_PCIE = 2, ///< PCIE协议 | 123 | + COMM_PROTOCOL_PCIE = 2, ///< PCIE协议 |
| 124 | - COMM_PROTOCOL_SIO = 3, ///< SIO协议 | 124 | + COMM_PROTOCOL_SIO = 3, ///< SIO协议 |
| 125 | - COMM_PROTOCOL_UBC_CTP = 4, ///< 华为统一总线UBC_CTP | 125 | + COMM_PROTOCOL_UB_CTP = 4, ///< 华为统一总线UB_CTP |
| 126 | - COMM_PROTOCOL_UBC_TP = 5, ///< 华为统一总线UBC_TP | 126 | + COMM_PROTOCOL_UBC_CTP = COMM_PROTOCOL_UB_CTP, ///< 兼容旧协议名UBC_CTP |
| 127 | - COMM_PROTOCOL_UB_MEM = 6, ///< UB_MEM | 127 | + COMM_PROTOCOL_UBC_TP = 5, ///< 华为统一总线UBC_TP |
| 128 | - COMM_PROTOCOL_UBOE = 7, ///< UBoE | 128 | + COMM_PROTOCOL_UB_MEM = 6, ///< UB_MEM |
| 129 | - COMM_PROTOCOL_HCCS_ONLY = 8, ///< 一卡双DIE使用HCCS | 129 | + COMM_PROTOCOL_UBOE = 7, ///< UBoE |
| 130 | - COMM_PROTOCOL_UBG = 9, ///< UBG | 130 | + COMM_PROTOCOL_HCCS_ONLY = 8, ///< 一卡双DIE使用HCCS |
| 131 | + COMM_PROTOCOL_UB_RTP = 9, ///< UB_RTP | ||
| 132 | + COMM_PROTOCOL_UBG = COMM_PROTOCOL_UB_RTP, ///< 兼容旧协议名UBG | ||
| 131 | } CommProtocol; | 133 | } CommProtocol; |
| 132 | 134 | ||
| 133 | /** | 135 | /** |
| @@ -96,7 +96,7 @@ HcclResult IpAddressToCommAddr(const Hccl::IpAddress& ipAddr, CommAddr& commAddr | |||
| 96 | HcclResult CommProtocolToLinkProtocol(CommProtocol commProtocol, Hccl::LinkProtocol& linkProtocol) | 96 | HcclResult CommProtocolToLinkProtocol(CommProtocol commProtocol, Hccl::LinkProtocol& linkProtocol) |
| 97 | { | 97 | { |
| 98 | switch (commProtocol) { | 98 | switch (commProtocol) { |
| 99 | - case COMM_PROTOCOL_UBC_CTP: | 99 | + case COMM_PROTOCOL_UB_CTP: |
| 100 | linkProtocol = Hccl::LinkProtocol::UB_CTP; | 100 | linkProtocol = Hccl::LinkProtocol::UB_CTP; |
| 101 | break; | 101 | break; |
| 102 | case COMM_PROTOCOL_UBC_TP: | 102 | case COMM_PROTOCOL_UBC_TP: |
| @@ -117,8 +117,8 @@ HcclResult CommProtocolToLinkProtocol(CommProtocol commProtocol, Hccl::LinkProto | |||
| 117 | case COMM_PROTOCOL_UBOE: | 117 | case COMM_PROTOCOL_UBOE: |
| 118 | linkProtocol = Hccl::LinkProtocol::UBOE; | 118 | linkProtocol = Hccl::LinkProtocol::UBOE; |
| 119 | break; | 119 | break; |
| 120 | - case COMM_PROTOCOL_UBG: | 120 | + case COMM_PROTOCOL_UB_RTP: |
| 121 | - linkProtocol = Hccl::LinkProtocol::UBG; | 121 | + linkProtocol = Hccl::LinkProtocol::UB_RTP; |
| 122 | break; | 122 | break; |
| 123 | default: | 123 | default: |
| 124 | HCCL_ERROR("[%s] Invalid CommProtocol[%u]", __func__, commProtocol); | 124 | HCCL_ERROR("[%s] Invalid CommProtocol[%u]", __func__, commProtocol); |
| @@ -20,9 +20,9 @@ inline const std::unordered_map<CommProtocol, std::string>& GetCommProtocolStrMa | |||
| 20 | { | 20 | { |
| 21 | static const std::unordered_map<CommProtocol, std::string> COMM_PROTOCOL_STR_MAP{ | 21 | static const std::unordered_map<CommProtocol, std::string> COMM_PROTOCOL_STR_MAP{ |
| 22 | {COMM_PROTOCOL_RESERVED, "RESERVED"}, {COMM_PROTOCOL_HCCS, "HCCS"}, {COMM_PROTOCOL_ROCE, "ROCE"}, | 22 | {COMM_PROTOCOL_RESERVED, "RESERVED"}, {COMM_PROTOCOL_HCCS, "HCCS"}, {COMM_PROTOCOL_ROCE, "ROCE"}, |
| 23 | - {COMM_PROTOCOL_PCIE, "PCIE"}, {COMM_PROTOCOL_SIO, "SIO"}, {COMM_PROTOCOL_UBC_CTP, "UBC_CTP"}, | 23 | + {COMM_PROTOCOL_PCIE, "PCIE"}, {COMM_PROTOCOL_SIO, "SIO"}, {COMM_PROTOCOL_UB_CTP, "UB_CTP"}, |
| 24 | {COMM_PROTOCOL_UBC_TP, "UBC_TP"}, {COMM_PROTOCOL_UB_MEM, "UB_MEM"}, {COMM_PROTOCOL_UBOE, "UBOE"}, | 24 | {COMM_PROTOCOL_UBC_TP, "UBC_TP"}, {COMM_PROTOCOL_UB_MEM, "UB_MEM"}, {COMM_PROTOCOL_UBOE, "UBOE"}, |
| 25 | - {COMM_PROTOCOL_HCCS_ONLY, "HCCS_ONLY"}, {COMM_PROTOCOL_UBG, "UBG"}}; | 25 | + {COMM_PROTOCOL_HCCS_ONLY, "HCCS_ONLY"}, {COMM_PROTOCOL_UB_RTP, "UB_RTP"}}; |
| 26 | return COMM_PROTOCOL_STR_MAP; | 26 | return COMM_PROTOCOL_STR_MAP; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| @@ -689,7 +689,7 @@ static uint8_t FindMinTaHwValue(uint32_t tpTotalTimeoutMs) | |||
| 689 | 689 | ||
| 690 | uint8_t TpMgr::CalcTaTimeout(const TpAttrInfo& tpAttrInfo) | 690 | uint8_t TpMgr::CalcTaTimeout(const TpAttrInfo& tpAttrInfo) |
| 691 | { | 691 | { |
| 692 | - constexpr uint8_t UB_TIMEOUT_DEFAULT = 8; // 默认 UBC_CTP 和 UBC_TP 超时配置为8 | 692 | + constexpr uint8_t UB_TIMEOUT_DEFAULT = 8; // 默认 UB_CTP 和 UBC_TP 超时配置为8 |
| 693 | uint8_t envValue = static_cast<uint8_t>(Hccl::EnvConfig::GetInstance().GetRdmaConfig().GetUbTimeOut()); | 693 | uint8_t envValue = static_cast<uint8_t>(Hccl::EnvConfig::GetInstance().GetRdmaConfig().GetUbTimeOut()); |
| 694 | uint32_t envTimeoutMs = TaHwValueToMs(envValue); | 694 | uint32_t envTimeoutMs = TaHwValueToMs(envValue); |
| 695 | 695 | ||
| @@ -115,8 +115,8 @@ HcommResult CheckUbAttr(HcommChannelDesc& channelDesc, CommEngine engine) | |||
| 115 | { | 115 | { |
| 116 | if (channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBC_TP | 116 | if (channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBC_TP |
| 117 | && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBOE | 117 | && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBOE |
| 118 | - && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBG | 118 | + && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UB_RTP |
| 119 | - && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UBC_CTP) { | 119 | + && channelDesc.remoteEndpoint.protocol != COMM_PROTOCOL_UB_CTP) { |
| 120 | return HCCL_SUCCESS; | 120 | return HCCL_SUCCESS; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| @@ -499,7 +499,7 @@ HcommResult HcommChannelConfigSetInt(HcommChannelConfig config, HcommChannelConf | |||
| 499 | 499 | ||
| 500 | static bool IsUbProtocol(CommProtocol protocol) | 500 | static bool IsUbProtocol(CommProtocol protocol) |
| 501 | { | 501 | { |
| 502 | - return protocol == COMM_PROTOCOL_UBC_CTP || protocol == COMM_PROTOCOL_UBC_TP; | 502 | + return protocol == COMM_PROTOCOL_UB_CTP || protocol == COMM_PROTOCOL_UBC_TP; |
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | static HcclResult ValidateSharedQueueConfig(const std::vector<HcommChannelDesc>& channelDescs) | 505 | static HcclResult ValidateSharedQueueConfig(const std::vector<HcommChannelDesc>& channelDescs) |
| @@ -508,7 +508,7 @@ static HcclResult ValidateSharedQueueConfig(const std::vector<HcommChannelDesc>& | |||
| 508 | CommProtocol protocol = channelDescs[i].remoteEndpoint.protocol; | 508 | CommProtocol protocol = channelDescs[i].remoteEndpoint.protocol; |
| 509 | if (!IsUbProtocol(protocol)) { | 509 | if (!IsUbProtocol(protocol)) { |
| 510 | HCCL_ERROR( | 510 | HCCL_ERROR( |
| 511 | - "[%s] IS_SHARED_QUEUE only supports UB protocols (UBC_CTP/UBC_TP), " | 511 | + "[%s] IS_SHARED_QUEUE only supports UB protocols (UB_CTP/UBC_TP), " |
| 512 | "channelDesc[%u] protocol[%d].", | 512 | "channelDesc[%u] protocol[%d].", |
| 513 | __func__, i, protocol); | 513 | __func__, i, protocol); |
| 514 | return HCCL_E_NOT_SUPPORT; | 514 | return HCCL_E_NOT_SUPPORT; |
| @@ -113,7 +113,7 @@ HcclResult ValidateEndpointDesc(const EndpointDesc* endpoint, EndpointHandle* en | |||
| 113 | HcclResult RegisterDeviceEndpointMonitorIfNeeded(const EndpointDesc* endpoint, EndpointHandle handle) | 113 | HcclResult RegisterDeviceEndpointMonitorIfNeeded(const EndpointDesc* endpoint, EndpointHandle handle) |
| 114 | { | 114 | { |
| 115 | if ((endpoint->loc.locType != ENDPOINT_LOC_TYPE_DEVICE) | 115 | if ((endpoint->loc.locType != ENDPOINT_LOC_TYPE_DEVICE) |
| 116 | - || ((endpoint->protocol != COMM_PROTOCOL_UBC_CTP) && (endpoint->protocol != COMM_PROTOCOL_UBC_TP))) { | 116 | + || ((endpoint->protocol != COMM_PROTOCOL_UB_CTP) && (endpoint->protocol != COMM_PROTOCOL_UBC_TP))) { |
| 117 | return HCCL_SUCCESS; | 117 | return HCCL_SUCCESS; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| @@ -24,7 +24,7 @@ constexpr char FINISH_MSG[FINISH_MSG_SIZE] = "Transport exchange data ready!"; | |||
| 24 | HcclResult BuildCcuConnection( | 24 | HcclResult BuildCcuConnection( |
| 25 | const CcuTransport::CcuConnectionInfo& ccuConnectionInfo, std::unique_ptr<CcuConnection>& ccuConnection) | 25 | const CcuTransport::CcuConnectionInfo& ccuConnectionInfo, std::unique_ptr<CcuConnection>& ccuConnection) |
| 26 | { | 26 | { |
| 27 | - if (ccuConnectionInfo.type == CcuTransport::CcuConnectionType::UBC_CTP) { | 27 | + if (ccuConnectionInfo.type == CcuTransport::CcuConnectionType::UB_CTP) { |
| 28 | ccuConnection.reset(new (std::nothrow) CcuCtpConnection( | 28 | ccuConnection.reset(new (std::nothrow) CcuCtpConnection( |
| 29 | ccuConnectionInfo.locAddr, ccuConnectionInfo.rmtAddr, ccuConnectionInfo.channelInfo, | 29 | ccuConnectionInfo.locAddr, ccuConnectionInfo.rmtAddr, ccuConnectionInfo.channelInfo, |
| 30 | ccuConnectionInfo.ccuJettys, ccuConnectionInfo.qos)); | 30 | ccuConnectionInfo.ccuJettys, ccuConnectionInfo.qos)); |
| @@ -82,7 +82,7 @@ public: | |||
| 82 | } | 82 | } |
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | - MAKE_ENUM(CcuConnectionType, UBC_TP, UBC_CTP); | 85 | + MAKE_ENUM(CcuConnectionType, UBC_TP, UB_CTP, UBC_CTP = UB_CTP); |
| 86 | struct CcuConnectionInfo { | 86 | struct CcuConnectionInfo { |
| 87 | CcuConnectionType type{CcuConnectionType::UBC_TP}; | 87 | CcuConnectionType type{CcuConnectionType::UBC_TP}; |
| 88 | CommAddr locAddr{}; | 88 | CommAddr locAddr{}; |
| @@ -11,9 +11,9 @@ | |||
| 11 | set(src_list | 11 | set(src_list |
| 12 | aicpu_ts_urma_channel.cc | 12 | aicpu_ts_urma_channel.cc |
| 13 | aicpu_ts_p2p_channel.cc | 13 | aicpu_ts_p2p_channel.cc |
| 14 | - aicpu_ts_uboe_ubg_channel_helper.cc | 14 | + aicpu_ts_uboe_ub_rtp_channel_helper.cc |
| 15 | aicpu_ts_uboe_channel.cc | 15 | aicpu_ts_uboe_channel.cc |
| 16 | - aicpu_ts_ubg_channel.cc | 16 | + aicpu_ts_ub_rtp_channel.cc |
| 17 | aicpu_ts_roce_channel.cc | 17 | aicpu_ts_roce_channel.cc |
| 18 | aicpu_ts_hccs_channel.cc | 18 | aicpu_ts_hccs_channel.cc |
| 19 | aicpu_ts_roce_channel_v2.cc | 19 | aicpu_ts_roce_channel_v2.cc |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "aicpu_ts_ubg_channel.h" | 11 | +#include "aicpu_ts_ub_rtp_channel.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -17,18 +17,18 @@ | |||
| 17 | 17 | ||
| 18 | namespace hcomm { | 18 | namespace hcomm { |
| 19 | 19 | ||
| 20 | -HcclResult AicpuTsUbgChannel::Init() | 20 | +HcclResult AicpuTsUbRtpChannel::Init() |
| 21 | { | 21 | { |
| 22 | s32 devLogicId; | 22 | s32 devLogicId; |
| 23 | CHK_RET(hrtGetDevice(&devLogicId)); | 23 | CHK_RET(hrtGetDevice(&devLogicId)); |
| 24 | CHK_RET(hrtGetDevicePhyIdByIndex(static_cast<u32>(devLogicId), devicePhyId_)); | 24 | CHK_RET(hrtGetDevicePhyIdByIndex(static_cast<u32>(devLogicId), devicePhyId_)); |
| 25 | CHK_RET(ParseInputParam()); | 25 | CHK_RET(ParseInputParam()); |
| 26 | 26 | ||
| 27 | - // UBG 直接从 EID type CommAddr 获取地址,不做 IP→EID 转换 | 27 | + // UB_RTP 直接从 EID type CommAddr 获取地址,不做 IP→EID 转换 |
| 28 | CHK_RET(CommAddrToIpAddress(localEp_.commAddr, locAddr_)); | 28 | CHK_RET(CommAddrToIpAddress(localEp_.commAddr, locAddr_)); |
| 29 | CHK_RET(CommAddrToIpAddress(remoteEp_.commAddr, rmtAddr_)); | 29 | CHK_RET(CommAddrToIpAddress(remoteEp_.commAddr, rmtAddr_)); |
| 30 | HCCL_INFO( | 30 | HCCL_INFO( |
| 31 | - "[AicpuTsUbgChannel][%s] locAddr_[%s], rmtAddr_[%s]", __func__, locAddr_.Describe().c_str(), | 31 | + "[AicpuTsUbRtpChannel][%s] locAddr_[%s], rmtAddr_[%s]", __func__, locAddr_.Describe().c_str(), |
| 32 | rmtAddr_.Describe().c_str()); | 32 | rmtAddr_.Describe().c_str()); |
| 33 | 33 | ||
| 34 | CHK_RET(BuildSocket()); | 34 | CHK_RET(BuildSocket()); |
| @@ -37,42 +37,42 @@ HcclResult AicpuTsUbgChannel::Init() | |||
| 37 | HccpRaGetDevBaseAttr | 37 | HccpRaGetDevBaseAttr |
| 38 | 获取urma read/write 单个wr的最大传输数据大小 | 38 | 获取urma read/write 单个wr的最大传输数据大小 |
| 39 | 调用前,rdmaHandle_要在ParseInputParam中被赋值好,之后BuildConnection会使用获取的属性 | 39 | 调用前,rdmaHandle_要在ParseInputParam中被赋值好,之后BuildConnection会使用获取的属性 |
| 40 | - ubg的BuildConnection不再Init里面执行,Init之后会有单独流程建链 | 40 | + ub_rtp的BuildConnection不再Init里面执行,Init之后会有单独流程建链 |
| 41 | */ | 41 | */ |
| 42 | CHK_RET(HccpRaGetDevBaseAttr(rdmaHandle_, &devBaseAttr_)); | 42 | CHK_RET(HccpRaGetDevBaseAttr(rdmaHandle_, &devBaseAttr_)); |
| 43 | 43 | ||
| 44 | return HCCL_SUCCESS; | 44 | return HCCL_SUCCESS; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | -HcclResult AicpuTsUbgChannel::BuildConnection() | 47 | +HcclResult AicpuTsUbRtpChannel::BuildConnection() |
| 48 | { | 48 | { |
| 49 | UbConnBuildContext ctx; | 49 | UbConnBuildContext ctx; |
| 50 | CHK_RET(PrepareUbConnBuildContext(localEp_, remoteEp_, channelDesc_, ctx)); | 50 | CHK_RET(PrepareUbConnBuildContext(localEp_, remoteEp_, channelDesc_, ctx)); |
| 51 | 51 | ||
| 52 | Hccl::OpMode opMode = Hccl::OpMode::OPBASE; | 52 | Hccl::OpMode opMode = Hccl::OpMode::OPBASE; |
| 53 | bool devUsed = true; // aicpu 为 true | 53 | bool devUsed = true; // aicpu 为 true |
| 54 | - // UBG 的 locAddr_/rmtAddr_ 已经是 EID-based IpAddress,无需额外转换 | 54 | + // UB_RTP 的 locAddr_/rmtAddr_ 已经是 EID-based IpAddress,无需额外转换 |
| 55 | HCCL_INFO( | 55 | HCCL_INFO( |
| 56 | - "[AicpuTsUbgChannel][%s] LinkProtocol[%s], locAddr_[%s], rmtAddr_[%s], qos[%u]", __func__, | 56 | + "[AicpuTsUbRtpChannel][%s] LinkProtocol[%s], locAddr_[%s], rmtAddr_[%s], qos[%u]", __func__, |
| 57 | ctx.protocol.Describe().c_str(), locAddr_.Describe().c_str(), rmtAddr_.Describe().c_str(), | 57 | ctx.protocol.Describe().c_str(), locAddr_.Describe().c_str(), rmtAddr_.Describe().c_str(), |
| 58 | static_cast<unsigned int>(ctx.qosPre)); | 58 | static_cast<unsigned int>(ctx.qosPre)); |
| 59 | 59 | ||
| 60 | - // UBG 使用 DevUbUbgConnection,locAddr_/rmtAddr_ 作为 EID 地址;qos 与 UBOE 一致来自 channelDesc_ | 60 | + // UB_RTP 使用 DevUbRtpConnection,locAddr_/rmtAddr_ 作为 EID 地址;qos 与 UBOE 一致来自 channelDesc_ |
| 61 | - std::unique_ptr<Hccl::DevUbConnection> ubConn = std::make_unique<Hccl::DevUbUbgConnection>( | 61 | + std::unique_ptr<Hccl::DevUbConnection> ubConn = std::make_unique<Hccl::DevUbRtpConnection>( |
| 62 | rdmaHandle_, locAddr_, rmtAddr_, opMode, devUsed, Hccl::HrtUbJfcMode::STARS_POLL, locAddr_, rmtAddr_, | 62 | rdmaHandle_, locAddr_, rmtAddr_, opMode, devUsed, Hccl::HrtUbJfcMode::STARS_POLL, locAddr_, rmtAddr_, |
| 63 | ctx.qosPre); | 63 | ctx.qosPre); |
| 64 | CHK_SMART_PTR_NULL(ubConn); | 64 | CHK_SMART_PTR_NULL(ubConn); |
| 65 | 65 | ||
| 66 | if (devBaseAttr_.maxReadSize == 0 || devBaseAttr_.maxWriteSize == 0) { | 66 | if (devBaseAttr_.maxReadSize == 0 || devBaseAttr_.maxWriteSize == 0) { |
| 67 | HCCL_ERROR( | 67 | HCCL_ERROR( |
| 68 | - "[AicpuTsUbgChannel][%s] maxReadSize[%u] or maxWriteSize[%u] must not be zero", __func__, | 68 | + "[AicpuTsUbRtpChannel][%s] maxReadSize[%u] or maxWriteSize[%u] must not be zero", __func__, |
| 69 | devBaseAttr_.maxReadSize, devBaseAttr_.maxWriteSize); | 69 | devBaseAttr_.maxReadSize, devBaseAttr_.maxWriteSize); |
| 70 | return HCCL_E_PARA; | 70 | return HCCL_E_PARA; |
| 71 | } | 71 | } |
| 72 | ubConn->SetMaxReadSize(devBaseAttr_.maxReadSize); | 72 | ubConn->SetMaxReadSize(devBaseAttr_.maxReadSize); |
| 73 | ubConn->SetMaxWriteSize(devBaseAttr_.maxWriteSize); | 73 | ubConn->SetMaxWriteSize(devBaseAttr_.maxWriteSize); |
| 74 | HCCL_INFO( | 74 | HCCL_INFO( |
| 75 | - "[AicpuTsUbgChannel][%s] maxReadSize[%u], maxWriteSize[%u]", __func__, devBaseAttr_.maxReadSize, | 75 | + "[AicpuTsUbRtpChannel][%s] maxReadSize[%u], maxWriteSize[%u]", __func__, devBaseAttr_.maxReadSize, |
| 76 | devBaseAttr_.maxWriteSize); | 76 | devBaseAttr_.maxWriteSize); |
| 77 | 77 | ||
| 78 | commonRes_.connVec.clear(); | 78 | commonRes_.connVec.clear(); |
| @@ -82,99 +82,113 @@ HcclResult AicpuTsUbgChannel::BuildConnection() | |||
| 82 | return HCCL_SUCCESS; | 82 | return HCCL_SUCCESS; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | -void AicpuTsUbgChannel::SendFinish() | 85 | +void AicpuTsUbRtpChannel::SendFinish() |
| 86 | { | 86 | { |
| 87 | - HCCL_INFO("start send Finish Msg [%s]", UBG_FINISH_MSG); | 87 | + HCCL_INFO("start send Finish Msg [%s]", UB_RTP_FINISH_MSG); |
| 88 | - sendFinishMsg_ = std::vector<char>(UBG_FINISH_MSG, UBG_FINISH_MSG + FINISH_MSG_SIZE); | 88 | + sendFinishMsg_ = std::vector<char>(UB_RTP_FINISH_MSG, UB_RTP_FINISH_MSG + FINISH_MSG_SIZE); |
| 89 | socket_->SendAsync(sendFinishMsg_.data(), FINISH_MSG_SIZE); | 89 | socket_->SendAsync(sendFinishMsg_.data(), FINISH_MSG_SIZE); |
| 90 | - HCCL_INFO("end send Finish Msg [%s]", UBG_FINISH_MSG); | 90 | + HCCL_INFO("end send Finish Msg [%s]", UB_RTP_FINISH_MSG); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | -void AicpuTsUbgChannel::RecvFinish() | 93 | +void AicpuTsUbRtpChannel::RecvFinish() |
| 94 | { | 94 | { |
| 95 | recvFinishMsg_.resize(FINISH_MSG_SIZE); | 95 | recvFinishMsg_.resize(FINISH_MSG_SIZE); |
| 96 | - HCCL_INFO("start recv Finish Msg [%s]", UBG_FINISH_MSG); | 96 | + HCCL_INFO("start recv Finish Msg [%s]", UB_RTP_FINISH_MSG); |
| 97 | socket_->RecvAsync(reinterpret_cast<u8*>(recvFinishMsg_.data()), FINISH_MSG_SIZE); | 97 | socket_->RecvAsync(reinterpret_cast<u8*>(recvFinishMsg_.data()), FINISH_MSG_SIZE); |
| 98 | - HCCL_INFO("end recv Finish Msg [%s]", UBG_FINISH_MSG); | 98 | + HCCL_INFO("end recv Finish Msg [%s]", UB_RTP_FINISH_MSG); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | -void AicpuTsUbgChannel::ProcessUbgState() | 101 | +void AicpuTsUbRtpChannel::ProcessUbRtpState() |
| 102 | { | 102 | { |
| 103 | - auto SetState = [&](UbgStatus next, ChannelStatus ch) { | 103 | + auto SetState = [&](UbRtpStatus next, ChannelStatus ch) { |
| 104 | - ubgStatus = next; | 104 | + ubRtpStatus = next; |
| 105 | channelStatus = ch; | 105 | channelStatus = ch; |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | - switch (ubgStatus) { | 108 | + switch (ubRtpStatus) { |
| 109 | - case UbgStatus::INIT: | 109 | + case UbRtpStatus::INIT: |
| 110 | - SetState(UbgStatus::BUILD_CONN, channelStatus); | 110 | + SetState(UbRtpStatus::BUILD_CONN, channelStatus); |
| 111 | break; | 111 | break; |
| 112 | - case UbgStatus::BUILD_CONN: | 112 | + case UbRtpStatus::BUILD_CONN: |
| 113 | BuildConn(); | 113 | BuildConn(); |
| 114 | - SetState(UbgStatus::SEND_SIZE, channelStatus); | 114 | + SetState(UbRtpStatus::SEND_SIZE, channelStatus); |
| 115 | break; | 115 | break; |
| 116 | - case UbgStatus::SEND_SIZE: | 116 | + case UbRtpStatus::SEND_SIZE: |
| 117 | if (IsResReady()) { | 117 | if (IsResReady()) { |
| 118 | SendDataSize(); | 118 | SendDataSize(); |
| 119 | - SetState(UbgStatus::RECV_SIZE, channelStatus); | 119 | + SetState(UbRtpStatus::RECV_SIZE, channelStatus); |
| 120 | } | 120 | } |
| 121 | break; | 121 | break; |
| 122 | - case UbgStatus::RECV_SIZE: | 122 | + case UbRtpStatus::RECV_SIZE: |
| 123 | - RecvDataSize(); | 123 | + case UbRtpStatus::SEND_DATA: |
| 124 | - SetState(isRecvFirst_ ? UbgStatus::RECV_DATA : UbgStatus::SEND_DATA, channelStatus); | 124 | + case UbRtpStatus::RECV_DATA: |
| 125 | + case UbRtpStatus::PROCESS_DATA: | ||
| 126 | + ProcessUbRtpDataState(); | ||
| 125 | break; | 127 | break; |
| 126 | - case UbgStatus::SEND_DATA: | 128 | + case UbRtpStatus::SEND_FIN: |
| 127 | - SendExchangeData(); | ||
| 128 | - SetState(isRecvFirst_ ? UbgStatus::PROCESS_DATA : UbgStatus::RECV_DATA, channelStatus); | ||
| 129 | - break; | ||
| 130 | - case UbgStatus::RECV_DATA: | ||
| 131 | - RecvExchangeData(); | ||
| 132 | - SetState(isRecvFirst_ ? UbgStatus::SEND_DATA : UbgStatus::PROCESS_DATA, channelStatus); | ||
| 133 | - break; | ||
| 134 | - case UbgStatus::PROCESS_DATA: | ||
| 135 | - if (RecvDataProcess()) { | ||
| 136 | - ubgStatus = UbgStatus::SEND_FIN; | ||
| 137 | - } else { | ||
| 138 | - channelStatus = ChannelStatus::READY; | ||
| 139 | - ubgStatus = UbgStatus::READY; | ||
| 140 | - } | ||
| 141 | - break; | ||
| 142 | - case UbgStatus::SEND_FIN: | ||
| 143 | if (IsConnsReady()) { | 129 | if (IsConnsReady()) { |
| 144 | SendFinish(); | 130 | SendFinish(); |
| 145 | - SetState(UbgStatus::RECV_FIN, channelStatus); | 131 | + SetState(UbRtpStatus::RECV_FIN, channelStatus); |
| 146 | } | 132 | } |
| 147 | break; | 133 | break; |
| 148 | - case UbgStatus::RECV_FIN: | 134 | + case UbRtpStatus::RECV_FIN: |
| 149 | RecvFinish(); | 135 | RecvFinish(); |
| 150 | - SetState(UbgStatus::SET_READY, channelStatus); | 136 | + SetState(UbRtpStatus::SET_READY, channelStatus); |
| 151 | break; | 137 | break; |
| 152 | - case UbgStatus::SET_READY: | 138 | + case UbRtpStatus::SET_READY: |
| 153 | channelStatus = ChannelStatus::READY; | 139 | channelStatus = ChannelStatus::READY; |
| 154 | - SetState(UbgStatus::READY, ChannelStatus::READY); | 140 | + SetState(UbRtpStatus::READY, ChannelStatus::READY); |
| 155 | break; | 141 | break; |
| 156 | default: | 142 | default: |
| 157 | break; | 143 | break; |
| 158 | } | 144 | } |
| 159 | } | 145 | } |
| 160 | 146 | ||
| 161 | -ChannelStatus AicpuTsUbgChannel::GetStatus() | 147 | +void AicpuTsUbRtpChannel::ProcessUbRtpDataState() |
| 148 | +{ | ||
| 149 | + switch (ubRtpStatus) { | ||
| 150 | + case UbRtpStatus::RECV_SIZE: | ||
| 151 | + RecvDataSize(); | ||
| 152 | + ubRtpStatus = isRecvFirst_ ? UbRtpStatus::RECV_DATA : UbRtpStatus::SEND_DATA; | ||
| 153 | + break; | ||
| 154 | + case UbRtpStatus::SEND_DATA: | ||
| 155 | + SendExchangeData(); | ||
| 156 | + ubRtpStatus = isRecvFirst_ ? UbRtpStatus::PROCESS_DATA : UbRtpStatus::RECV_DATA; | ||
| 157 | + break; | ||
| 158 | + case UbRtpStatus::RECV_DATA: | ||
| 159 | + RecvExchangeData(); | ||
| 160 | + ubRtpStatus = isRecvFirst_ ? UbRtpStatus::SEND_DATA : UbRtpStatus::PROCESS_DATA; | ||
| 161 | + break; | ||
| 162 | + case UbRtpStatus::PROCESS_DATA: | ||
| 163 | + if (RecvDataProcess()) { | ||
| 164 | + ubRtpStatus = UbRtpStatus::SEND_FIN; | ||
| 165 | + } else { | ||
| 166 | + channelStatus = ChannelStatus::READY; | ||
| 167 | + ubRtpStatus = UbRtpStatus::READY; | ||
| 168 | + } | ||
| 169 | + break; | ||
| 170 | + default: | ||
| 171 | + break; | ||
| 172 | + } | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +ChannelStatus AicpuTsUbRtpChannel::GetStatus() | ||
| 162 | { | 176 | { |
| 163 | if (channelStatus == ChannelStatus::READY) { | 177 | if (channelStatus == ChannelStatus::READY) { |
| 164 | return channelStatus; | 178 | return channelStatus; |
| 165 | } | 179 | } |
| 166 | if (channelStatus == ChannelStatus::INIT) | 180 | if (channelStatus == ChannelStatus::INIT) |
| 167 | - ubgStatus = UbgStatus::INIT; | 181 | + ubRtpStatus = UbRtpStatus::INIT; |
| 168 | 182 | ||
| 169 | if (!IsSocketReady()) | 183 | if (!IsSocketReady()) |
| 170 | return channelStatus; | 184 | return channelStatus; |
| 171 | 185 | ||
| 172 | - ProcessUbgState(); | 186 | + ProcessUbRtpState(); |
| 173 | 187 | ||
| 174 | return channelStatus; | 188 | return channelStatus; |
| 175 | } | 189 | } |
| 176 | 190 | ||
| 177 | -HcclResult AicpuTsUbgChannel::Clean() | 191 | +HcclResult AicpuTsUbRtpChannel::Clean() |
| 178 | { | 192 | { |
| 179 | commonRes_.connVec.clear(); | 193 | commonRes_.connVec.clear(); |
| 180 | connections_.clear(); | 194 | connections_.clear(); |
| @@ -201,15 +215,15 @@ HcclResult AicpuTsUbgChannel::Clean() | |||
| 201 | } | 215 | } |
| 202 | 216 | ||
| 203 | channelStatus = ChannelStatus::INIT; | 217 | channelStatus = ChannelStatus::INIT; |
| 204 | - ubgStatus = UbgStatus::INIT; | 218 | + ubRtpStatus = UbRtpStatus::INIT; |
| 205 | 219 | ||
| 206 | return HCCL_SUCCESS; | 220 | return HCCL_SUCCESS; |
| 207 | } | 221 | } |
| 208 | 222 | ||
| 209 | -HcclResult AicpuTsUbgChannel::Resume() | 223 | +HcclResult AicpuTsUbRtpChannel::Resume() |
| 210 | { | 224 | { |
| 211 | channelStatus = ChannelStatus::INIT; | 225 | channelStatus = ChannelStatus::INIT; |
| 212 | - ubgStatus = UbgStatus::INIT; | 226 | + ubRtpStatus = UbRtpStatus::INIT; |
| 213 | return HCCL_SUCCESS; | 227 | return HCCL_SUCCESS; |
| 214 | } | 228 | } |
| 215 | 229 | ||
| @@ -7,25 +7,24 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 11 | + | ||
| 10 | 12 | ||
| 11 | -#ifndef AICPU_TS_UBG_CHANNEL_H | 13 | +#include "aicpu_ts_uboe_ub_rtp_channel_helper.h" |
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | 14 | ||
| 16 | namespace hcomm { | 15 | namespace hcomm { |
| 17 | 16 | ||
| 18 | -constexpr char_t UBG_FINISH_MSG[FINISH_MSG_SIZE] = "Ubg Comm Pipe ready!"; | 17 | +constexpr char_t UB_RTP_FINISH_MSG[FINISH_MSG_SIZE] = "UbRtp Comm Pipe ready!"; |
[MEDIUM] 通信握手消息字符串从 Ubg 变为 UbRtp 第 17 行: 建议修复: 确认该 finish message 是否参与对端内容匹配(对比 recv 内容还是仅作占位符发送)。若参与匹配,需保持字符串不变或提供版本协商机制;若仅作占位符(recv 方不校验内容只校验长度),则可安全改名。建议在 PR 描述中说明此变更的影响评估。 ![]() ![]() | |||
| 19 | 18 | ||
| 20 | -class AicpuTsUbgChannel : public AicpuTsUboeUbgChannelHelper { | 19 | +class AicpuTsUbRtpChannel : public AicpuTsUboeUbRtpChannelHelper { |
| 21 | public: | 20 | public: |
| 22 | - AicpuTsUbgChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) | 21 | + AicpuTsUbRtpChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) |
| 23 | - : AicpuTsUboeUbgChannelHelper(endpointHandle, channelDesc) | 22 | + : AicpuTsUboeUbRtpChannelHelper(endpointHandle, channelDesc) |
| 24 | {} | 23 | {} |
| 25 | 24 | ||
| 26 | - ~AicpuTsUbgChannel() = default; | 25 | + ~AicpuTsUbRtpChannel() = default; |
| 27 | 26 | ||
| 28 | - HcommChannelKind GetChannelKind() const override { return HcommChannelKind::AICPU_TS_UBG; } | 27 | + HcommChannelKind GetChannelKind() const override { return HcommChannelKind::AICPU_TS_UB_RTP; } |
| 29 | 28 | ||
| 30 | HcclResult Init() override; | 29 | HcclResult Init() override; |
| 31 | ChannelStatus GetStatus() override; | 30 | ChannelStatus GetStatus() override; |
| @@ -38,14 +37,15 @@ protected: | |||
| 38 | void RecvFinish() override; | 37 | void RecvFinish() override; |
| 39 | 38 | ||
| 40 | private: | 39 | private: |
| 41 | - void ProcessUbgState(); | 40 | + void ProcessUbRtpState(); |
| 41 | + void ProcessUbRtpDataState(); | ||
| 42 | 42 | ||
| 43 | MAKE_ENUM( | 43 | MAKE_ENUM( |
| 44 | - UbgStatus, INIT, BUILD_CONN, SEND_SIZE, RECV_SIZE, SEND_DATA, RECV_DATA, SEND_FIN, RECV_FIN, PROCESS_DATA, | 44 | + UbRtpStatus, INIT, BUILD_CONN, SEND_SIZE, RECV_SIZE, SEND_DATA, RECV_DATA, SEND_FIN, RECV_FIN, PROCESS_DATA, |
| 45 | SET_READY, READY) | 45 | SET_READY, READY) |
| 46 | - UbgStatus ubgStatus{UbgStatus::INIT}; | 46 | + UbRtpStatus ubRtpStatus{UbRtpStatus::INIT}; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | } // namespace hcomm | 49 | } // namespace hcomm |
| 50 | 50 | ||
| 51 | -#endif // AICPU_TS_UBG_CHANNEL_H | 51 | +#endif // AICPU_TS_UB_RTP_CHANNEL_H |
| @@ -22,7 +22,7 @@ | |||
| 22 | namespace hcomm { | 22 | namespace hcomm { |
| 23 | 23 | ||
| 24 | AicpuTsUboeChannel::AicpuTsUboeChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) | 24 | AicpuTsUboeChannel::AicpuTsUboeChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) |
| 25 | - : AicpuTsUboeUbgChannelHelper(endpointHandle, channelDesc) | 25 | + : AicpuTsUboeUbRtpChannelHelper(endpointHandle, channelDesc) |
| 26 | {} | 26 | {} |
| 27 | 27 | ||
| 28 | AicpuTsUboeChannel::~AicpuTsUboeChannel() = default; | 28 | AicpuTsUboeChannel::~AicpuTsUboeChannel() = default; |
| @@ -11,11 +11,11 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "aicpu_ts_uboe_ubg_channel_helper.h" | 14 | +#include "aicpu_ts_uboe_ub_rtp_channel_helper.h" |
| 15 | 15 | ||
| 16 | namespace hcomm { | 16 | namespace hcomm { |
| 17 | 17 | ||
| 18 | -class AicpuTsUboeChannel : public AicpuTsUboeUbgChannelHelper { | 18 | +class AicpuTsUboeChannel : public AicpuTsUboeUbRtpChannelHelper { |
| 19 | public: | 19 | public: |
| 20 | AicpuTsUboeChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc); | 20 | AicpuTsUboeChannel(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc); |
| 21 | ~AicpuTsUboeChannel() override; | 21 | ~AicpuTsUboeChannel() override; |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "aicpu_ts_uboe_ubg_channel_helper.h" | 11 | +#include "aicpu_ts_uboe_ub_rtp_channel_helper.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -26,13 +26,13 @@ namespace hcomm { | |||
| 26 | 26 | ||
| 27 | constexpr u32 SERVER_LISTEN_PORT = 60001; | 27 | constexpr u32 SERVER_LISTEN_PORT = 60001; |
| 28 | 28 | ||
| 29 | -AicpuTsUboeUbgChannelHelper::AicpuTsUboeUbgChannelHelper( | 29 | +AicpuTsUboeUbRtpChannelHelper::AicpuTsUboeUbRtpChannelHelper( |
| 30 | EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) | 30 | EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc) |
| 31 | : endpointHandle_(endpointHandle), | 31 | : endpointHandle_(endpointHandle), |
| 32 | channelDesc_(channelDesc) | 32 | channelDesc_(channelDesc) |
| 33 | {} | 33 | {} |
| 34 | 34 | ||
| 35 | -AicpuTsUboeUbgChannelHelper::~AicpuTsUboeUbgChannelHelper() | 35 | +AicpuTsUboeUbRtpChannelHelper::~AicpuTsUboeUbRtpChannelHelper() |
| 36 | { | 36 | { |
| 37 | if (channelDesc_.socket == nullptr && socket_ != nullptr) { | 37 | if (channelDesc_.socket == nullptr && socket_ != nullptr) { |
| 38 | SocketMgr::GetInstance(devicePhyId_).PutSocket(socketConfig_, socket_); | 38 | SocketMgr::GetInstance(devicePhyId_).PutSocket(socketConfig_, socket_); |
| @@ -40,7 +40,7 @@ AicpuTsUboeUbgChannelHelper::~AicpuTsUboeUbgChannelHelper() | |||
| 40 | } | 40 | } |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | -HcclResult AicpuTsUboeUbgChannelHelper::ParseInputParam() | 43 | +HcclResult AicpuTsUboeUbRtpChannelHelper::ParseInputParam() |
| 44 | { | 44 | { |
| 45 | // 1. 从 endpointHandle_,获得 localEp_ 和 rdmaHandle_ | 45 | // 1. 从 endpointHandle_,获得 localEp_ 和 rdmaHandle_ |
| 46 | Endpoint* localEpPtr = reinterpret_cast<Endpoint*>(endpointHandle_); | 46 | Endpoint* localEpPtr = reinterpret_cast<Endpoint*>(endpointHandle_); |
| @@ -48,7 +48,7 @@ HcclResult AicpuTsUboeUbgChannelHelper::ParseInputParam() | |||
| 48 | localEp_ = localEpPtr->GetEndpointDesc(); | 48 | localEp_ = localEpPtr->GetEndpointDesc(); |
| 49 | rdmaHandle_ = localEpPtr->GetRdmaHandle(); | 49 | rdmaHandle_ = localEpPtr->GetRdmaHandle(); |
| 50 | 50 | ||
| 51 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] localProtocol[%d]", __func__, localEp_.protocol); | 51 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper][%s] localProtocol[%d]", __func__, localEp_.protocol); |
| 52 | 52 | ||
| 53 | // 2. 从 channelDesc_,获得 remoteEp_, socket_ 和 notifyNum | 53 | // 2. 从 channelDesc_,获得 remoteEp_, socket_ 和 notifyNum |
| 54 | remoteEp_ = channelDesc_.remoteEndpoint; | 54 | remoteEp_ = channelDesc_.remoteEndpoint; |
| @@ -58,19 +58,20 @@ HcclResult AicpuTsUboeUbgChannelHelper::ParseInputParam() | |||
| 58 | 58 | ||
| 59 | if (channelDesc_.exchangeAllMems) { | 59 | if (channelDesc_.exchangeAllMems) { |
| 60 | // 3. Get memHandles from endpoint | 60 | // 3. Get memHandles from endpoint |
| 61 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] exchangeAllMems == True. Get memHandles from endpoint.", __func__); | 61 | + HCCL_INFO( |
| 62 | + "[AicpuTsUboeUbRtpChannelHelper][%s] exchangeAllMems == True. Get memHandles from endpoint.", __func__); | ||
| 62 | std::shared_ptr<Hccl::LocalUbRmaBuffer>* memHandles = nullptr; | 63 | std::shared_ptr<Hccl::LocalUbRmaBuffer>* memHandles = nullptr; |
| 63 | uint32_t memHandleNum = 0; | 64 | uint32_t memHandleNum = 0; |
| 64 | CHK_RET(static_cast<HcclResult>( | 65 | CHK_RET(static_cast<HcclResult>( |
| 65 | HcommMemGetAllMemHandles(endpointHandle_, reinterpret_cast<void**>(&memHandles), &memHandleNum))); | 66 | HcommMemGetAllMemHandles(endpointHandle_, reinterpret_cast<void**>(&memHandles), &memHandleNum))); |
| 66 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] Got memHandleNum[%u].", __func__, memHandleNum); | 67 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper][%s] Got memHandleNum[%u].", __func__, memHandleNum); |
| 67 | for (uint32_t i = 0; i < memHandleNum; ++i) { | 68 | for (uint32_t i = 0; i < memHandleNum; ++i) { |
| 68 | std::shared_ptr<Hccl::LocalUbRmaBuffer>& localUbRmaBuffer = memHandles[i]; | 69 | std::shared_ptr<Hccl::LocalUbRmaBuffer>& localUbRmaBuffer = memHandles[i]; |
| 69 | CHK_SMART_PTR_NULL(localUbRmaBuffer); | 70 | CHK_SMART_PTR_NULL(localUbRmaBuffer); |
| 70 | Hccl::Buffer* buf = localUbRmaBuffer->GetBuf(); | 71 | Hccl::Buffer* buf = localUbRmaBuffer->GetBuf(); |
| 71 | CHK_PTR_NULL(buf); | 72 | CHK_PTR_NULL(buf); |
| 72 | HCCL_INFO( | 73 | HCCL_INFO( |
| 73 | - "[AicpuTsUboeUbgChannelHelper][%s] Got memHandle No.%u: addr[0x%llx], size[0x%llx], " | 74 | + "[AicpuTsUboeUbRtpChannelHelper][%s] Got memHandle No.%u: addr[0x%llx], size[0x%llx], " |
| 74 | "memType[%d], memInfo[%s].", | 75 | "memType[%d], memInfo[%s].", |
| 75 | __func__, i, static_cast<unsigned long long>(localUbRmaBuffer->GetAddr()), | 76 | __func__, i, static_cast<unsigned long long>(localUbRmaBuffer->GetAddr()), |
| 76 | static_cast<unsigned long long>(localUbRmaBuffer->GetSize()), static_cast<int>(buf->GetMemType()), | 77 | static_cast<unsigned long long>(localUbRmaBuffer->GetSize()), static_cast<int>(buf->GetMemType()), |
| @@ -80,22 +81,22 @@ HcclResult AicpuTsUboeUbgChannelHelper::ParseInputParam() | |||
| 80 | } else { | 81 | } else { |
| 81 | // 3. 从 channelDesc 的 memHandle 填充 commonRes_.bufferVec | 82 | // 3. 从 channelDesc 的 memHandle 填充 commonRes_.bufferVec |
| 82 | HCCL_INFO( | 83 | HCCL_INFO( |
| 83 | - "[AicpuTsUboeUbgChannelHelper][%s] exchangeAllMems == false. Get memHandles from channelDesc.", __func__); | 84 | + "[AicpuTsUboeUbRtpChannelHelper][%s] exchangeAllMems == false. Get memHandles from channelDesc.", __func__); |
| 84 | CHK_RET(MakeRmaBufferVecFromMemHandles( | 85 | CHK_RET(MakeRmaBufferVecFromMemHandles( |
| 85 | - channelDesc_.memHandles, channelDesc_.memHandleNum, commonRes_.bufferVec, "AicpuTsUboeUbgChannelHelper")); | 86 | + channelDesc_.memHandles, channelDesc_.memHandleNum, commonRes_.bufferVec, "AicpuTsUboeUbRtpChannelHelper")); |
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | return HCCL_SUCCESS; | 89 | return HCCL_SUCCESS; |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | -void AicpuTsUboeUbgChannelHelper::BuildConn() | 92 | +void AicpuTsUboeUbRtpChannelHelper::BuildConn() |
| 92 | { | 93 | { |
| 93 | if (BuildConnection() != HCCL_SUCCESS) { | 94 | if (BuildConnection() != HCCL_SUCCESS) { |
| 94 | - HCCL_ERROR("[AicpuTsUboeUbgChannelHelper::%s] BuildConnection failed", __func__); | 95 | + HCCL_ERROR("[AicpuTsUboeUbRtpChannelHelper::%s] BuildConnection failed", __func__); |
| 95 | } | 96 | } |
| 96 | } | 97 | } |
| 97 | 98 | ||
| 98 | -HcclResult AicpuTsUboeUbgChannelHelper::BuildNotify() | 99 | +HcclResult AicpuTsUboeUbRtpChannelHelper::BuildNotify() |
| 99 | { | 100 | { |
| 100 | localNotifies_.clear(); | 101 | localNotifies_.clear(); |
| 101 | commonRes_.notifyVec.clear(); | 102 | commonRes_.notifyVec.clear(); |
| @@ -109,13 +110,14 @@ HcclResult AicpuTsUboeUbgChannelHelper::BuildNotify() | |||
| 109 | return HCCL_SUCCESS; | 110 | return HCCL_SUCCESS; |
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | -HcclResult AicpuTsUboeUbgChannelHelper::BuildDrainResource() | 113 | +HcclResult AicpuTsUboeUbRtpChannelHelper::BuildDrainResource() |
| 113 | { | 114 | { |
| 114 | // 申请创建channel drain阻塞等待的相关资源 | 115 | // 申请创建channel drain阻塞等待的相关资源 |
| 115 | // 申请notify作为read的落点 | 116 | // 申请notify作为read的落点 |
| 116 | bool devUsed = true; | 117 | bool devUsed = true; |
| 117 | EXCEPTION_CATCH(drainNotify_ = std::make_unique<Hccl::UbLocalNotify>(rdmaHandle_, devUsed), return HCCL_E_PTR); | 118 | EXCEPTION_CATCH(drainNotify_ = std::make_unique<Hccl::UbLocalNotify>(rdmaHandle_, devUsed), return HCCL_E_PTR); |
| 118 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] drainNotify created: %s", __func__, drainNotify_->Describe().c_str()); | 119 | + HCCL_INFO( |
| 120 | + "[AicpuTsUboeUbRtpChannelHelper][%s] drainNotify created: %s", __func__, drainNotify_->Describe().c_str()); | ||
| 119 | 121 | ||
| 120 | // 常量1内存供远端读取 | 122 | // 常量1内存供远端读取 |
| 121 | u32 notifySize = Hccl::DevCapability::GetInstance().GetNotifySize(); | 123 | u32 notifySize = Hccl::DevCapability::GetInstance().GetNotifySize(); |
| @@ -129,18 +131,18 @@ HcclResult AicpuTsUboeUbgChannelHelper::BuildDrainResource() | |||
| 129 | 131 | ||
| 130 | EXCEPTION_CATCH(drainBuffer_ = std::make_unique<Hccl::LocalUbRmaBuffer>(constMem, rdmaHandle_), return HCCL_E_PTR); | 132 | EXCEPTION_CATCH(drainBuffer_ = std::make_unique<Hccl::LocalUbRmaBuffer>(constMem, rdmaHandle_), return HCCL_E_PTR); |
| 131 | HCCL_INFO( | 133 | HCCL_INFO( |
| 132 | - "[AicpuTsUboeUbgChannelHelper][%s] drain buffer created: addr[0x%llx], size[%zu]", __func__, | 134 | + "[AicpuTsUboeUbRtpChannelHelper][%s] drain buffer created: addr[0x%llx], size[%zu]", __func__, |
| 133 | static_cast<unsigned long long>(drainBuffer_->GetAddr()), drainBuffer_->GetSize()); | 135 | static_cast<unsigned long long>(drainBuffer_->GetAddr()), drainBuffer_->GetSize()); |
| 134 | 136 | ||
| 135 | return HCCL_SUCCESS; | 137 | return HCCL_SUCCESS; |
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | -HcclResult AicpuTsUboeUbgChannelHelper::BuildSocket() | 140 | +HcclResult AicpuTsUboeUbRtpChannelHelper::BuildSocket() |
| 139 | { | 141 | { |
| 140 | if (socket_ != nullptr) { | 142 | if (socket_ != nullptr) { |
| 141 | return HCCL_SUCCESS; | 143 | return HCCL_SUCCESS; |
| 142 | } | 144 | } |
| 143 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] socket ptr is NULL, rebuildSocket", __func__); | 145 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper][%s] socket ptr is NULL, rebuildSocket", __func__); |
| 144 | 146 | ||
| 145 | Hccl::IpAddress ipaddr{}; | 147 | Hccl::IpAddress ipaddr{}; |
| 146 | CHK_RET(CommAddrToIpAddress(localEp_.commAddr, ipaddr)); | 148 | CHK_RET(CommAddrToIpAddress(localEp_.commAddr, ipaddr)); |
| @@ -153,12 +155,13 @@ HcclResult AicpuTsUboeUbgChannelHelper::BuildSocket() | |||
| 153 | socketHandle, ipaddr, SERVER_LISTEN_PORT, ipaddr, "server", Hccl::SocketRole::SERVER, | 155 | socketHandle, ipaddr, SERVER_LISTEN_PORT, ipaddr, "server", Hccl::SocketRole::SERVER, |
| 154 | Hccl::NicType::DEVICE_NIC_TYPE), | 156 | Hccl::NicType::DEVICE_NIC_TYPE), |
| 155 | return HCCL_E_PARA); | 157 | return HCCL_E_PARA); |
| 156 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] listen_socket_info[%s]", __func__, serverSocket_->Describe().c_str()); | 158 | + HCCL_INFO( |
| 159 | + "[AicpuTsUboeUbRtpChannelHelper][%s] listen_socket_info[%s]", __func__, serverSocket_->Describe().c_str()); | ||
| 157 | EXCEPTION_CATCH(serverSocket_->Listen(), return HCCL_E_INTERNAL); | 160 | EXCEPTION_CATCH(serverSocket_->Listen(), return HCCL_E_INTERNAL); |
| 158 | 161 | ||
| 159 | Hccl::LinkData linkData = BuildDefaultLinkData(); | 162 | Hccl::LinkData linkData = BuildDefaultLinkData(); |
| 160 | CHK_RET(EndpointDescPairToLinkData(localEp_, remoteEp_, linkData)); | 163 | CHK_RET(EndpointDescPairToLinkData(localEp_, remoteEp_, linkData)); |
| 161 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper][%s] built linkData: %s", __func__, linkData.Describe().c_str()); | 164 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper][%s] built linkData: %s", __func__, linkData.Describe().c_str()); |
| 162 | std::string socketTag | 165 | std::string socketTag |
| 163 | = (channelDesc_.channelName != nullptr) ? std::string(channelDesc_.channelName) : "AUTOMATIC_SOCKET_TAG"; | 166 | = (channelDesc_.channelName != nullptr) ? std::string(channelDesc_.channelName) : "AUTOMATIC_SOCKET_TAG"; |
| 164 | bool noRankId = true; | 167 | bool noRankId = true; |
| @@ -169,13 +172,13 @@ HcclResult AicpuTsUboeUbgChannelHelper::BuildSocket() | |||
| 169 | return HCCL_SUCCESS; | 172 | return HCCL_SUCCESS; |
| 170 | } | 173 | } |
| 171 | 174 | ||
| 172 | -HcclResult AicpuTsUboeUbgChannelHelper::GetNotifyNum(uint32_t* notifyNum) const | 175 | +HcclResult AicpuTsUboeUbRtpChannelHelper::GetNotifyNum(uint32_t* notifyNum) const |
| 173 | { | 176 | { |
| 174 | *notifyNum = this->notifyNum_; | 177 | *notifyNum = this->notifyNum_; |
| 175 | return HCCL_SUCCESS; | 178 | return HCCL_SUCCESS; |
| 176 | } | 179 | } |
| 177 | 180 | ||
| 178 | -HcclResult AicpuTsUboeUbgChannelHelper::GetRemoteMems(uint32_t* memNum, CommMem** remoteMem, char*** memInfos) | 181 | +HcclResult AicpuTsUboeUbRtpChannelHelper::GetRemoteMems(uint32_t* memNum, CommMem** remoteMem, char*** memInfos) |
| 179 | { | 182 | { |
| 180 | std::lock_guard<std::mutex> lock(remoteMemsMutex_); | 183 | std::lock_guard<std::mutex> lock(remoteMemsMutex_); |
| 181 | Hccl::RemoteMemCtx<std::unique_ptr<Hccl::RemoteUbRmaBuffer>> remoteMemCtx{ | 184 | Hccl::RemoteMemCtx<std::unique_ptr<Hccl::RemoteUbRmaBuffer>> remoteMemCtx{ |
| @@ -184,7 +187,7 @@ HcclResult AicpuTsUboeUbgChannelHelper::GetRemoteMems(uint32_t* memNum, CommMem* | |||
| 184 | return HCCL_SUCCESS; | 187 | return HCCL_SUCCESS; |
| 185 | } | 188 | } |
| 186 | 189 | ||
| 187 | -bool AicpuTsUboeUbgChannelHelper::IsSocketReady() | 190 | +bool AicpuTsUboeUbRtpChannelHelper::IsSocketReady() |
| 188 | { | 191 | { |
| 189 | if (socket_ == nullptr) { | 192 | if (socket_ == nullptr) { |
| 190 | HCCL_ERROR("[%s] socket is nullptr, please check", __func__); | 193 | HCCL_ERROR("[%s] socket is nullptr, please check", __func__); |
| @@ -204,17 +207,17 @@ bool AicpuTsUboeUbgChannelHelper::IsSocketReady() | |||
| 204 | return false; | 207 | return false; |
| 205 | } | 208 | } |
| 206 | 209 | ||
| 207 | -bool AicpuTsUboeUbgChannelHelper::IsResReady() | 210 | +bool AicpuTsUboeUbRtpChannelHelper::IsResReady() |
| 208 | { | 211 | { |
| 209 | for (auto& it : commonRes_.connVec) { | 212 | for (auto& it : commonRes_.connVec) { |
| 210 | if (it == nullptr) { | 213 | if (it == nullptr) { |
| 211 | Hccl::THROW<Hccl::InternalException>( | 214 | Hccl::THROW<Hccl::InternalException>( |
| 212 | - "[AicpuTsUboeUbgChannelHelper::%s] failed, connection pointer is nullptr", __func__); | 215 | + "[AicpuTsUboeUbRtpChannelHelper::%s] failed, connection pointer is nullptr", __func__); |
| 213 | } | 216 | } |
| 214 | Hccl::RmaConnType connType = it->GetRmaConnType(); | 217 | Hccl::RmaConnType connType = it->GetRmaConnType(); |
| 215 | if (connType != Hccl::RmaConnType::UB) { | 218 | if (connType != Hccl::RmaConnType::UB) { |
| 216 | Hccl::THROW<Hccl::InternalException>( | 219 | Hccl::THROW<Hccl::InternalException>( |
| 217 | - "[AicpuTsUboeUbgChannelHelper::%s] connection type[%s] is not ub", __func__, | 220 | + "[AicpuTsUboeUbRtpChannelHelper::%s] connection type[%s] is not ub", __func__, |
| 218 | connType.Describe().c_str()); | 221 | connType.Describe().c_str()); |
| 219 | } | 222 | } |
| 220 | 223 | ||
| @@ -223,93 +226,95 @@ bool AicpuTsUboeUbgChannelHelper::IsResReady() | |||
| 223 | return false; | 226 | return false; |
| 224 | } | 227 | } |
| 225 | } | 228 | } |
| 226 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] all resources ready.", __func__); | 229 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] all resources ready.", __func__); |
| 227 | return true; | 230 | return true; |
| 228 | } | 231 | } |
| 229 | 232 | ||
| 230 | -bool AicpuTsUboeUbgChannelHelper::IsConnsReady() | 233 | +bool AicpuTsUboeUbRtpChannelHelper::IsConnsReady() |
| 231 | { | 234 | { |
| 232 | for (u32 i = 0; i < connNum_; i++) { | 235 | for (u32 i = 0; i < connNum_; i++) { |
| 233 | if (commonRes_.connVec[i]->GetStatus() != Hccl::RmaConnStatus::READY) { | 236 | if (commonRes_.connVec[i]->GetStatus() != Hccl::RmaConnStatus::READY) { |
| 234 | return false; | 237 | return false; |
| 235 | } | 238 | } |
| 236 | } | 239 | } |
| 237 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] conns are ready.", __func__); | 240 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] conns are ready.", __func__); |
| 238 | return true; | 241 | return true; |
| 239 | } | 242 | } |
| 240 | 243 | ||
| 241 | -void AicpuTsUboeUbgChannelHelper::NotifyVecPack(Hccl::BinaryStream& binaryStream) | 244 | +void AicpuTsUboeUbRtpChannelHelper::NotifyVecPack(Hccl::BinaryStream& binaryStream) |
| 242 | { | 245 | { |
| 243 | binaryStream << notifyNum_; | 246 | binaryStream << notifyNum_; |
| 244 | u32 pos = 0; | 247 | u32 pos = 0; |
| 245 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] pack notify size[%d]", __func__, commonRes_.notifyVec.size()); | 248 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] pack notify size[%d]", __func__, commonRes_.notifyVec.size()); |
| 246 | for (auto& it : commonRes_.notifyVec) { | 249 | for (auto& it : commonRes_.notifyVec) { |
| 247 | binaryStream << pos; | 250 | binaryStream << pos; |
| 248 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); | 251 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); |
| 249 | dto->Serialize(binaryStream); | 252 | dto->Serialize(binaryStream); |
| 250 | HCCL_INFO( | 253 | HCCL_INFO( |
| 251 | - "[AicpuTsUboeUbgChannelHelper::%s] pack notify pos=%u, dto %s", __func__, pos, dto->Describe().c_str()); | 254 | + "[AicpuTsUboeUbRtpChannelHelper::%s] pack notify pos=%u, dto %s", __func__, pos, dto->Describe().c_str()); |
| 252 | pos++; | 255 | pos++; |
| 253 | } | 256 | } |
| 254 | } | 257 | } |
| 255 | 258 | ||
| 256 | -void AicpuTsUboeUbgChannelHelper::BufferVecPack( | 259 | +void AicpuTsUboeUbRtpChannelHelper::BufferVecPack( |
| 257 | Hccl::BinaryStream& binaryStream, std::vector<Hccl::LocalRmaBuffer*>& bufferVec) | 260 | Hccl::BinaryStream& binaryStream, std::vector<Hccl::LocalRmaBuffer*>& bufferVec) |
| 258 | { | 261 | { |
| 259 | binaryStream << static_cast<u32>(bufferVec.size()); | 262 | binaryStream << static_cast<u32>(bufferVec.size()); |
| 260 | u32 pos = 0; | 263 | u32 pos = 0; |
| 261 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] pack buffer size[%d]", __func__, bufferVec.size()); | 264 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] pack buffer size[%d]", __func__, bufferVec.size()); |
| 262 | for (auto& it : bufferVec) { | 265 | for (auto& it : bufferVec) { |
| 263 | binaryStream << pos; | 266 | binaryStream << pos; |
| 264 | if (it != nullptr) { | 267 | if (it != nullptr) { |
| 265 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); | 268 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); |
| 266 | dto->Serialize(binaryStream); | 269 | dto->Serialize(binaryStream); |
| 267 | HCCL_INFO( | 270 | HCCL_INFO( |
| 268 | - "[AicpuTsUboeUbgChannelHelper::%s] pack buffer pos=%u dto %s", __func__, pos, dto->Describe().c_str()); | 271 | + "[AicpuTsUboeUbRtpChannelHelper::%s] pack buffer pos=%u dto %s", __func__, pos, |
| 272 | + dto->Describe().c_str()); | ||
| 269 | } else { | 273 | } else { |
| 270 | Hccl::ExchangeUbBufferDto exchangeDto; | 274 | Hccl::ExchangeUbBufferDto exchangeDto; |
| 271 | exchangeDto.Serialize(binaryStream); | 275 | exchangeDto.Serialize(binaryStream); |
| 272 | HCCL_INFO( | 276 | HCCL_INFO( |
| 273 | - "[AicpuTsUboeUbgChannelHelper::%s] pack buffer pos=%u, dto is null %s", __func__, pos, | 277 | + "[AicpuTsUboeUbRtpChannelHelper::%s] pack buffer pos=%u, dto is null %s", __func__, pos, |
| 274 | exchangeDto.Describe().c_str()); | 278 | exchangeDto.Describe().c_str()); |
| 275 | } | 279 | } |
| 276 | pos++; | 280 | pos++; |
| 277 | } | 281 | } |
| 278 | } | 282 | } |
| 279 | 283 | ||
| 280 | -void AicpuTsUboeUbgChannelHelper::DrainBufferPack(Hccl::BinaryStream& binaryStream) | 284 | +void AicpuTsUboeUbRtpChannelHelper::DrainBufferPack(Hccl::BinaryStream& binaryStream) |
| 281 | { | 285 | { |
| 282 | // 只需交换常量buffer信息供对端读 | 286 | // 只需交换常量buffer信息供对端读 |
| 283 | HCCL_INFO("start pack drain buffer"); | 287 | HCCL_INFO("start pack drain buffer"); |
| 284 | if (drainBuffer_ != nullptr) { // 非空的buffer,从buffer中获取 dto | 288 | if (drainBuffer_ != nullptr) { // 非空的buffer,从buffer中获取 dto |
| 285 | std::unique_ptr<Hccl::Serializable> dto = drainBuffer_->GetExchangeDto(); | 289 | std::unique_ptr<Hccl::Serializable> dto = drainBuffer_->GetExchangeDto(); |
| 286 | dto->Serialize(binaryStream); | 290 | dto->Serialize(binaryStream); |
| 287 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] pack drain buffer dto %s", __func__, dto->Describe().c_str()); | 291 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] pack drain buffer dto %s", __func__, dto->Describe().c_str()); |
| 288 | } else { // 空的buffer,dto所有字段为0(size=0) | 292 | } else { // 空的buffer,dto所有字段为0(size=0) |
| 289 | Hccl::ExchangeUbBufferDto exchangeDto; | 293 | Hccl::ExchangeUbBufferDto exchangeDto; |
| 290 | exchangeDto.Serialize(binaryStream); | 294 | exchangeDto.Serialize(binaryStream); |
| 291 | HCCL_INFO( | 295 | HCCL_INFO( |
| 292 | - "[AicpuTsUboeUbgChannelHelper::%s] pack drain buffer dto is null %s", __func__, | 296 | + "[AicpuTsUboeUbRtpChannelHelper::%s] pack drain buffer dto is null %s", __func__, |
| 293 | exchangeDto.Describe().c_str()); | 297 | exchangeDto.Describe().c_str()); |
| 294 | } | 298 | } |
| 295 | } | 299 | } |
| 296 | 300 | ||
| 297 | -void AicpuTsUboeUbgChannelHelper::ConnVecPack(Hccl::BinaryStream& binaryStream) | 301 | +void AicpuTsUboeUbRtpChannelHelper::ConnVecPack(Hccl::BinaryStream& binaryStream) |
| 298 | { | 302 | { |
| 299 | binaryStream << connNum_; | 303 | binaryStream << connNum_; |
| 300 | u32 pos = 0; | 304 | u32 pos = 0; |
| 301 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] pack conn size[%d]", __func__, commonRes_.connVec.size()); | 305 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] pack conn size[%d]", __func__, commonRes_.connVec.size()); |
| 302 | for (auto& it : commonRes_.connVec) { | 306 | for (auto& it : commonRes_.connVec) { |
| 303 | binaryStream << pos; | 307 | binaryStream << pos; |
| 304 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); | 308 | std::unique_ptr<Hccl::Serializable> dto = it->GetExchangeDto(); |
| 305 | dto->Serialize(binaryStream); | 309 | dto->Serialize(binaryStream); |
| 306 | HCCL_INFO( | 310 | HCCL_INFO( |
| 307 | - "[AicpuTsUboeUbgChannelHelper::%s] pack connection pos=%u, dto %s", __func__, pos, dto->Describe().c_str()); | 311 | + "[AicpuTsUboeUbRtpChannelHelper::%s] pack connection pos=%u, dto %s", __func__, pos, |
| 312 | + dto->Describe().c_str()); | ||
| 308 | pos++; | 313 | pos++; |
| 309 | } | 314 | } |
| 310 | } | 315 | } |
| 311 | 316 | ||
| 312 | -void AicpuTsUboeUbgChannelHelper::SendDataSize() | 317 | +void AicpuTsUboeUbRtpChannelHelper::SendDataSize() |
| 313 | { | 318 | { |
| 314 | sendData_.clear(); | 319 | sendData_.clear(); |
| 315 | bufferNum_ = commonRes_.bufferVec.size(); | 320 | bufferNum_ = commonRes_.bufferVec.size(); |
| @@ -329,31 +334,31 @@ void AicpuTsUboeUbgChannelHelper::SendDataSize() | |||
| 329 | // 发送数据包尺寸 | 334 | // 发送数据包尺寸 |
| 330 | socket_->SendAsync(&sendSize, sizeof(sendSize)); | 335 | socket_->SendAsync(&sendSize, sizeof(sendSize)); |
| 331 | HCCL_INFO( | 336 | HCCL_INFO( |
| 332 | - "[AicpuTsUboeUbgChannelHelper::%s] Send size[%u] of data success. [%zu] bytes sent.", __func__, sendSize, | 337 | + "[AicpuTsUboeUbRtpChannelHelper::%s] Send size[%u] of data success. [%zu] bytes sent.", __func__, sendSize, |
| 333 | sizeof(sendSize)); | 338 | sizeof(sendSize)); |
| 334 | } | 339 | } |
| 335 | 340 | ||
| 336 | -void AicpuTsUboeUbgChannelHelper::RecvDataSize() | 341 | +void AicpuTsUboeUbRtpChannelHelper::RecvDataSize() |
| 337 | { | 342 | { |
| 338 | // 接收数据包尺寸 | 343 | // 接收数据包尺寸 |
| 339 | socket_->RecvAsync(reinterpret_cast<u8*>(&recvDataSize_), sizeof(recvDataSize_)); | 344 | socket_->RecvAsync(reinterpret_cast<u8*>(&recvDataSize_), sizeof(recvDataSize_)); |
| 340 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] Receive Data Size", __func__); | 345 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] Receive Data Size", __func__); |
| 341 | } | 346 | } |
| 342 | 347 | ||
| 343 | -void AicpuTsUboeUbgChannelHelper::SendExchangeData() | 348 | +void AicpuTsUboeUbRtpChannelHelper::SendExchangeData() |
| 344 | { | 349 | { |
| 345 | socket_->SendAsync(sendData_.data(), sendData_.size()); | 350 | socket_->SendAsync(sendData_.data(), sendData_.size()); |
| 346 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] send data, size=%llu", __func__, sendData_.size()); | 351 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] send data, size=%llu", __func__, sendData_.size()); |
| 347 | } | 352 | } |
| 348 | 353 | ||
| 349 | -void AicpuTsUboeUbgChannelHelper::RecvExchangeData() | 354 | +void AicpuTsUboeUbRtpChannelHelper::RecvExchangeData() |
| 350 | { | 355 | { |
| 351 | recvData_.resize(recvDataSize_); | 356 | recvData_.resize(recvDataSize_); |
| 352 | socket_->RecvAsync(reinterpret_cast<u8*>(recvData_.data()), recvData_.size()); | 357 | socket_->RecvAsync(reinterpret_cast<u8*>(recvData_.data()), recvData_.size()); |
| 353 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] recv data", __func__); | 358 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] recv data", __func__); |
| 354 | } | 359 | } |
| 355 | 360 | ||
| 356 | -bool AicpuTsUboeUbgChannelHelper::RecvDataProcess() | 361 | +bool AicpuTsUboeUbRtpChannelHelper::RecvDataProcess() |
| 357 | { | 362 | { |
| 358 | HCCL_INFO("RecvDataProcess: size=%llu, recvDataSize=%u", recvData_.size(), recvDataSize_); | 363 | HCCL_INFO("RecvDataProcess: size=%llu, recvDataSize=%u", recvData_.size(), recvDataSize_); |
| 359 | Hccl::BinaryStream binaryStream(recvData_); | 364 | Hccl::BinaryStream binaryStream(recvData_); |
| @@ -363,7 +368,7 @@ bool AicpuTsUboeUbgChannelHelper::RecvDataProcess() | |||
| 363 | return ConnVecUnpackProc(binaryStream); | 368 | return ConnVecUnpackProc(binaryStream); |
| 364 | } | 369 | } |
| 365 | 370 | ||
| 366 | -void AicpuTsUboeUbgChannelHelper::RmtBufferVecUnpackProc( | 371 | +void AicpuTsUboeUbRtpChannelHelper::RmtBufferVecUnpackProc( |
| 367 | u32 locNum, Hccl::BinaryStream& binaryStream, RemoteBufferVec& bufferVec, UboeRmtBufType type) | 372 | u32 locNum, Hccl::BinaryStream& binaryStream, RemoteBufferVec& bufferVec, UboeRmtBufType type) |
| 368 | { | 373 | { |
| 369 | u32 rmtNum; | 374 | u32 rmtNum; |
| @@ -372,7 +377,7 @@ void AicpuTsUboeUbgChannelHelper::RmtBufferVecUnpackProc( | |||
| 372 | MACRO_THROW( | 377 | MACRO_THROW( |
| 373 | Hccl::InvalidParamsException, | 378 | Hccl::InvalidParamsException, |
| 374 | Hccl::StringFormat( | 379 | Hccl::StringFormat( |
| 375 | - "[AicpuTsUboeUbgChannelHelper][RmtBufferVecUnpackProc] rmtNum[%u] exceeds limit[%u]", rmtNum, | 380 | + "[AicpuTsUboeUbRtpChannelHelper][RmtBufferVecUnpackProc] rmtNum[%u] exceeds limit[%u]", rmtNum, |
| 376 | MAX_BUFFER_NUM)); | 381 | MAX_BUFFER_NUM)); |
| 377 | } | 382 | } |
| 378 | 383 | ||
| @@ -397,24 +402,24 @@ void AicpuTsUboeUbgChannelHelper::RmtBufferVecUnpackProc( | |||
| 397 | } | 402 | } |
| 398 | } | 403 | } |
| 399 | 404 | ||
| 400 | -void AicpuTsUboeUbgChannelHelper::RmtDrainBufferUnpackProc(Hccl::BinaryStream& binaryStream) | 405 | +void AicpuTsUboeUbRtpChannelHelper::RmtDrainBufferUnpackProc(Hccl::BinaryStream& binaryStream) |
| 401 | { | 406 | { |
| 402 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] start unpack drain buffer", __func__); | 407 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] start unpack drain buffer", __func__); |
| 403 | Hccl::ExchangeUbBufferDto dto; | 408 | Hccl::ExchangeUbBufferDto dto; |
| 404 | dto.Deserialize(binaryStream); | 409 | dto.Deserialize(binaryStream); |
| 405 | 410 | ||
| 406 | if (dto.size == 0) { | 411 | if (dto.size == 0) { |
| 407 | rmtDrainBuffer_ = nullptr; | 412 | rmtDrainBuffer_ = nullptr; |
| 408 | - HCCL_WARNING("[AicpuTsUboeUbgChannelHelper::%s] unpack drain buffer dto is null", __func__); | 413 | + HCCL_WARNING("[AicpuTsUboeUbRtpChannelHelper::%s] unpack drain buffer dto is null", __func__); |
| 409 | } else { | 414 | } else { |
| 410 | rmtDrainBuffer_ = std::make_unique<Hccl::RemoteUbRmaBuffer>(rdmaHandle_, dto); | 415 | rmtDrainBuffer_ = std::make_unique<Hccl::RemoteUbRmaBuffer>(rdmaHandle_, dto); |
| 411 | HCCL_INFO( | 416 | HCCL_INFO( |
| 412 | - "[AicpuTsUboeUbgChannelHelper::%s] unpack drain buffer rmtDrainBuffer=%s", __func__, | 417 | + "[AicpuTsUboeUbRtpChannelHelper::%s] unpack drain buffer rmtDrainBuffer=%s", __func__, |
| 413 | rmtDrainBuffer_->Describe().c_str()); | 418 | rmtDrainBuffer_->Describe().c_str()); |
| 414 | } | 419 | } |
| 415 | } | 420 | } |
| 416 | 421 | ||
| 417 | -bool AicpuTsUboeUbgChannelHelper::ConnVecUnpackProc(Hccl::BinaryStream& binaryStream) | 422 | +bool AicpuTsUboeUbRtpChannelHelper::ConnVecUnpackProc(Hccl::BinaryStream& binaryStream) |
| 418 | { | 423 | { |
| 419 | u32 rmtConnNum; | 424 | u32 rmtConnNum; |
| 420 | binaryStream >> rmtConnNum; | 425 | binaryStream >> rmtConnNum; |
| @@ -453,19 +458,19 @@ static HcclResult SetUboeModuleDataName(Hccl::ModuleData& module, const std::str | |||
| 453 | return HCCL_SUCCESS; | 458 | return HCCL_SUCCESS; |
| 454 | } | 459 | } |
| 455 | 460 | ||
| 456 | -std::vector<char> AicpuTsUboeUbgChannelHelper::GetNotifyUniqueIds() | 461 | +std::vector<char> AicpuTsUboeUbRtpChannelHelper::GetNotifyUniqueIds() |
| 457 | { | 462 | { |
| 458 | HCCL_INFO("start packing all notify uniqueIds"); | 463 | HCCL_INFO("start packing all notify uniqueIds"); |
| 459 | std::vector<char> result(0); | 464 | std::vector<char> result(0); |
| 460 | for (auto& it : commonRes_.notifyVec) { | 465 | for (auto& it : commonRes_.notifyVec) { |
| 461 | - HCCL_INFO("AicpuTsUboeUbgChannelHelper Notify %s", it->Describe().c_str()); | 466 | + HCCL_INFO("AicpuTsUboeUbRtpChannelHelper Notify %s", it->Describe().c_str()); |
| 462 | auto uniqueId = it->GetUniqueId(); | 467 | auto uniqueId = it->GetUniqueId(); |
| 463 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); | 468 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); |
| 464 | } | 469 | } |
| 465 | return result; | 470 | return result; |
| 466 | } | 471 | } |
| 467 | 472 | ||
| 468 | -std::vector<char> AicpuTsUboeUbgChannelHelper::GetSingleRmtBufferUniqueId( | 473 | +std::vector<char> AicpuTsUboeUbRtpChannelHelper::GetSingleRmtBufferUniqueId( |
| 469 | u64 addr, u64 size, u32 tokenId, u32 tokenValue, u32 notifyId) const | 474 | u64 addr, u64 size, u32 tokenId, u32 tokenValue, u32 notifyId) const |
| 470 | { | 475 | { |
| 471 | Hccl::BinaryStream binaryStream; | 476 | Hccl::BinaryStream binaryStream; |
| @@ -474,14 +479,14 @@ std::vector<char> AicpuTsUboeUbgChannelHelper::GetSingleRmtBufferUniqueId( | |||
| 474 | binaryStream << tokenId; | 479 | binaryStream << tokenId; |
| 475 | binaryStream << tokenValue; | 480 | binaryStream << tokenValue; |
| 476 | binaryStream << notifyId; | 481 | binaryStream << notifyId; |
| 477 | - HCCL_INFO("AicpuTsUboeUbgChannelHelper RmtBuffer[addr=0x%llx, size=0x%llx, notifyId=%u]", addr, size, notifyId); | 482 | + HCCL_INFO("AicpuTsUboeUbRtpChannelHelper RmtBuffer[addr=0x%llx, size=0x%llx, notifyId=%u]", addr, size, notifyId); |
| 478 | std::vector<char> result; | 483 | std::vector<char> result; |
| 479 | binaryStream.Dump(result); | 484 | binaryStream.Dump(result); |
| 480 | return result; | 485 | return result; |
| 481 | } | 486 | } |
| 482 | 487 | ||
| 483 | std::vector<char> | 488 | std::vector<char> |
| 484 | -AicpuTsUboeUbgChannelHelper::GetRmtBufferUniqueIds(RemoteBufferVec& bufferVec, UboeRmtBufType type) const | 489 | +AicpuTsUboeUbRtpChannelHelper::GetRmtBufferUniqueIds(RemoteBufferVec& bufferVec, UboeRmtBufType type) const |
| 485 | { | 490 | { |
| 486 | HCCL_INFO("start packing all remote buffer %s uniqueIds", type.Describe().c_str()); | 491 | HCCL_INFO("start packing all remote buffer %s uniqueIds", type.Describe().c_str()); |
| 487 | std::vector<char> result(0); | 492 | std::vector<char> result(0); |
| @@ -490,10 +495,10 @@ AicpuTsUboeUbgChannelHelper::GetRmtBufferUniqueIds(RemoteBufferVec& bufferVec, U | |||
| 490 | if (it != nullptr) { | 495 | if (it != nullptr) { |
| 491 | uniqueId = GetSingleRmtBufferUniqueId( | 496 | uniqueId = GetSingleRmtBufferUniqueId( |
| 492 | it->GetAddr(), it->GetSize(), it->GetTokenId(), it->GetTokenValue(), it->GetNotifyId()); | 497 | it->GetAddr(), it->GetSize(), it->GetTokenId(), it->GetTokenValue(), it->GetNotifyId()); |
| 493 | - HCCL_INFO("AicpuTsUboeUbgChannelHelper::GetRmtBufferUniqueIds, %s", it->Describe().c_str()); | 498 | + HCCL_INFO("AicpuTsUboeUbRtpChannelHelper::GetRmtBufferUniqueIds, %s", it->Describe().c_str()); |
| 494 | } else { | 499 | } else { |
| 495 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); | 500 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); |
| 496 | - HCCL_INFO("AicpuTsUboeUbgChannelHelper::GetRmtBufferUniqueIds, null buffer"); | 501 | + HCCL_INFO("AicpuTsUboeUbRtpChannelHelper::GetRmtBufferUniqueIds, null buffer"); |
| 497 | } | 502 | } |
| 498 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); | 503 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); |
| 499 | } | 504 | } |
| @@ -501,7 +506,7 @@ AicpuTsUboeUbgChannelHelper::GetRmtBufferUniqueIds(RemoteBufferVec& bufferVec, U | |||
| 501 | } | 506 | } |
| 502 | 507 | ||
| 503 | std::vector<char> | 508 | std::vector<char> |
| 504 | -AicpuTsUboeUbgChannelHelper::GetLocBufferUniqueIds(LocalBufferVec& bufferVec, UboeRmtBufType type) const | 509 | +AicpuTsUboeUbRtpChannelHelper::GetLocBufferUniqueIds(LocalBufferVec& bufferVec, UboeRmtBufType type) const |
| 505 | { | 510 | { |
| 506 | HCCL_INFO("start packing all local buffer %s uniqueIds", type.Describe().c_str()); | 511 | HCCL_INFO("start packing all local buffer %s uniqueIds", type.Describe().c_str()); |
| 507 | std::vector<char> result(0); | 512 | std::vector<char> result(0); |
| @@ -520,9 +525,9 @@ AicpuTsUboeUbgChannelHelper::GetLocBufferUniqueIds(LocalBufferVec& bufferVec, Ub | |||
| 520 | return result; | 525 | return result; |
| 521 | } | 526 | } |
| 522 | 527 | ||
| 523 | -std::vector<char> AicpuTsUboeUbgChannelHelper::GetDrainUniqueIds() const | 528 | +std::vector<char> AicpuTsUboeUbRtpChannelHelper::GetDrainUniqueIds() const |
| 524 | { | 529 | { |
| 525 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] start get drain resource uniqueIds", __func__); | 530 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] start get drain resource uniqueIds", __func__); |
| 526 | std::vector<char> result(0); | 531 | std::vector<char> result(0); |
| 527 | std::vector<char> uniqueId; | 532 | std::vector<char> uniqueId; |
| 528 | 533 | ||
| @@ -532,10 +537,10 @@ std::vector<char> AicpuTsUboeUbgChannelHelper::GetDrainUniqueIds() const | |||
| 532 | Hccl::ExchangeUbBufferDto* rawDto = static_cast<Hccl::ExchangeUbBufferDto*>(dto.get()); | 537 | Hccl::ExchangeUbBufferDto* rawDto = static_cast<Hccl::ExchangeUbBufferDto*>(dto.get()); |
| 533 | uniqueId = GetSingleRmtBufferUniqueId( | 538 | uniqueId = GetSingleRmtBufferUniqueId( |
| 534 | rawDto->addr, rawDto->size, rawDto->tokenId, rawDto->tokenValue, rawDto->notifyId); | 539 | rawDto->addr, rawDto->size, rawDto->tokenId, rawDto->tokenValue, rawDto->notifyId); |
| 535 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] %s", __func__, drainNotify_->Describe().c_str()); | 540 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] %s", __func__, drainNotify_->Describe().c_str()); |
| 536 | } else { | 541 | } else { |
| 537 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); // 填充一个空的buffer | 542 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); // 填充一个空的buffer |
| 538 | - HCCL_WARNING("[AicpuTsUboeUbgChannelHelper::%s] drainNotify_ null buffer", __func__); | 543 | + HCCL_WARNING("[AicpuTsUboeUbRtpChannelHelper::%s] drainNotify_ null buffer", __func__); |
| 539 | } | 544 | } |
| 540 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); | 545 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); |
| 541 | 546 | ||
| @@ -544,29 +549,29 @@ std::vector<char> AicpuTsUboeUbgChannelHelper::GetDrainUniqueIds() const | |||
| 544 | uniqueId = GetSingleRmtBufferUniqueId( | 549 | uniqueId = GetSingleRmtBufferUniqueId( |
| 545 | rmtDrainBuffer_->GetAddr(), rmtDrainBuffer_->GetSize(), rmtDrainBuffer_->GetTokenId(), | 550 | rmtDrainBuffer_->GetAddr(), rmtDrainBuffer_->GetSize(), rmtDrainBuffer_->GetTokenId(), |
| 546 | rmtDrainBuffer_->GetTokenValue(), rmtDrainBuffer_->GetNotifyId()); | 551 | rmtDrainBuffer_->GetTokenValue(), rmtDrainBuffer_->GetNotifyId()); |
| 547 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] %s", __func__, rmtDrainBuffer_->Describe().c_str()); | 552 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] %s", __func__, rmtDrainBuffer_->Describe().c_str()); |
| 548 | } else { | 553 | } else { |
| 549 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); // 填充一个空的buffer | 554 | uniqueId = GetSingleRmtBufferUniqueId(0, 0, 0, 0, UINT32_MAX); // 填充一个空的buffer |
| 550 | - HCCL_WARNING("[AicpuTsUboeUbgChannelHelper::%s] rmtDrainBuffer_ null buffer", __func__); | 555 | + HCCL_WARNING("[AicpuTsUboeUbRtpChannelHelper::%s] rmtDrainBuffer_ null buffer", __func__); |
| 551 | } | 556 | } |
| 552 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); | 557 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); |
| 553 | 558 | ||
| 554 | return result; | 559 | return result; |
| 555 | } | 560 | } |
| 556 | 561 | ||
| 557 | -std::vector<char> AicpuTsUboeUbgChannelHelper::GetConnUniqueIds() | 562 | +std::vector<char> AicpuTsUboeUbRtpChannelHelper::GetConnUniqueIds() |
| 558 | { | 563 | { |
| 559 | HCCL_INFO("start packing all conn uniqueIds"); | 564 | HCCL_INFO("start packing all conn uniqueIds"); |
| 560 | std::vector<char> result(0); | 565 | std::vector<char> result(0); |
| 561 | for (auto& it : commonRes_.connVec) { | 566 | for (auto& it : commonRes_.connVec) { |
| 562 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] conn[%s]", __func__, it->Describe().c_str()); | 567 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] conn[%s]", __func__, it->Describe().c_str()); |
| 563 | auto uniqueId = it->GetUniqueId(); | 568 | auto uniqueId = it->GetUniqueId(); |
| 564 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); | 569 | result.insert(result.end(), uniqueId.begin(), uniqueId.end()); |
| 565 | } | 570 | } |
| 566 | return result; | 571 | return result; |
| 567 | } | 572 | } |
| 568 | 573 | ||
| 569 | -std::vector<char> AicpuTsUboeUbgChannelHelper::GetUniqueIdV2() | 574 | +std::vector<char> AicpuTsUboeUbRtpChannelHelper::GetUniqueIdV2() |
| 570 | { | 575 | { |
| 571 | if (channelStatus != ChannelStatus::READY) { | 576 | if (channelStatus != ChannelStatus::READY) { |
| 572 | MACRO_THROW( | 577 | MACRO_THROW( |
| @@ -609,13 +614,13 @@ std::vector<char> AicpuTsUboeUbgChannelHelper::GetUniqueIdV2() | |||
| 609 | return result; | 614 | return result; |
| 610 | } | 615 | } |
| 611 | 616 | ||
| 612 | -HcclResult AicpuTsUboeUbgChannelHelper::H2DResPack(std::vector<char>& buffer) | 617 | +HcclResult AicpuTsUboeUbRtpChannelHelper::H2DResPack(std::vector<char>& buffer) |
| 613 | { | 618 | { |
| 614 | std::vector<Hccl::ModuleData> dataVec; | 619 | std::vector<Hccl::ModuleData> dataVec; |
| 615 | dataVec.resize(Hccl::AicpuResMgrType::__COUNT__); | 620 | dataVec.resize(Hccl::AicpuResMgrType::__COUNT__); |
| 616 | 621 | ||
| 617 | Hccl::AicpuResMgrType resType = Hccl::AicpuResMgrType::STREAM; | 622 | Hccl::AicpuResMgrType resType = Hccl::AicpuResMgrType::STREAM; |
| 618 | - CHK_RET(SetUboeModuleDataName(dataVec[resType], "AicpuTsUboeUbgChannelHelper")); | 623 | + CHK_RET(SetUboeModuleDataName(dataVec[resType], "AicpuTsUboeUbRtpChannelHelper")); |
| 619 | 624 | ||
| 620 | std::vector<char> result; | 625 | std::vector<char> result; |
| 621 | Hccl::BinaryStream binaryStream; | 626 | Hccl::BinaryStream binaryStream; |
| @@ -628,57 +633,57 @@ HcclResult AicpuTsUboeUbgChannelHelper::H2DResPack(std::vector<char>& buffer) | |||
| 628 | Hccl::AicpuResPackageHelper helper; | 633 | Hccl::AicpuResPackageHelper helper; |
| 629 | buffer = helper.GetPackedData(dataVec); | 634 | buffer = helper.GetPackedData(dataVec); |
| 630 | HCCL_INFO( | 635 | HCCL_INFO( |
| 631 | - "[AicpuTsUboeUbgChannelHelper][%s] Pack Buffer data[%p], Pack Buffer size[%zu].", __func__, buffer.data(), | 636 | + "[AicpuTsUboeUbRtpChannelHelper][%s] Pack Buffer data[%p], Pack Buffer size[%zu].", __func__, buffer.data(), |
| 632 | buffer.size()); | 637 | buffer.size()); |
| 633 | return HCCL_SUCCESS; | 638 | return HCCL_SUCCESS; |
| 634 | } | 639 | } |
| 635 | 640 | ||
| 636 | -HcclResult AicpuTsUboeUbgChannelHelper::Clean() | 641 | +HcclResult AicpuTsUboeUbRtpChannelHelper::Clean() |
| 637 | { | 642 | { |
| 638 | // 该模式当前不支持N秒快恢 | 643 | // 该模式当前不支持N秒快恢 |
| 639 | return HCCL_SUCCESS; | 644 | return HCCL_SUCCESS; |
| 640 | } | 645 | } |
| 641 | 646 | ||
| 642 | -HcclResult AicpuTsUboeUbgChannelHelper::Resume() | 647 | +HcclResult AicpuTsUboeUbRtpChannelHelper::Resume() |
| 643 | { | 648 | { |
| 644 | // 该模式当前不支持N秒快恢 | 649 | // 该模式当前不支持N秒快恢 |
| 645 | return HCCL_SUCCESS; | 650 | return HCCL_SUCCESS; |
| 646 | } | 651 | } |
| 647 | 652 | ||
| 648 | -HcclResult AicpuTsUboeUbgChannelHelper::NotifyRecord(const uint32_t remoteNotifyIdx) | 653 | +HcclResult AicpuTsUboeUbRtpChannelHelper::NotifyRecord(const uint32_t remoteNotifyIdx) |
| 649 | { | 654 | { |
| 650 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 655 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 651 | return HCCL_E_NOT_SUPPORT; | 656 | return HCCL_E_NOT_SUPPORT; |
| 652 | } | 657 | } |
| 653 | 658 | ||
| 654 | -HcclResult AicpuTsUboeUbgChannelHelper::NotifyWait(const uint32_t localNotifyIdx, const uint32_t timeout) | 659 | +HcclResult AicpuTsUboeUbRtpChannelHelper::NotifyWait(const uint32_t localNotifyIdx, const uint32_t timeout) |
| 655 | { | 660 | { |
| 656 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 661 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 657 | return HCCL_E_NOT_SUPPORT; | 662 | return HCCL_E_NOT_SUPPORT; |
| 658 | } | 663 | } |
| 659 | 664 | ||
| 660 | HcclResult | 665 | HcclResult |
| 661 | -AicpuTsUboeUbgChannelHelper::WriteWithNotify(void* dst, const void* src, const uint64_t len, uint32_t remoteNotifyIdx) | 666 | +AicpuTsUboeUbRtpChannelHelper::WriteWithNotify(void* dst, const void* src, const uint64_t len, uint32_t remoteNotifyIdx) |
| 662 | { | 667 | { |
| 663 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 668 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 664 | return HCCL_E_NOT_SUPPORT; | 669 | return HCCL_E_NOT_SUPPORT; |
| 665 | } | 670 | } |
| 666 | 671 | ||
| 667 | -HcclResult AicpuTsUboeUbgChannelHelper::Write(void* dst, const void* src, uint64_t len) | 672 | +HcclResult AicpuTsUboeUbRtpChannelHelper::Write(void* dst, const void* src, uint64_t len) |
| 668 | { | 673 | { |
| 669 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 674 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 670 | return HCCL_E_NOT_SUPPORT; | 675 | return HCCL_E_NOT_SUPPORT; |
| 671 | } | 676 | } |
| 672 | 677 | ||
| 673 | -HcclResult AicpuTsUboeUbgChannelHelper::Read(void* dst, const void* src, uint64_t len) | 678 | +HcclResult AicpuTsUboeUbRtpChannelHelper::Read(void* dst, const void* src, uint64_t len) |
| 674 | { | 679 | { |
| 675 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 680 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 676 | return HCCL_E_NOT_SUPPORT; | 681 | return HCCL_E_NOT_SUPPORT; |
| 677 | } | 682 | } |
| 678 | 683 | ||
| 679 | -HcclResult AicpuTsUboeUbgChannelHelper::ChannelFence() | 684 | +HcclResult AicpuTsUboeUbRtpChannelHelper::ChannelFence() |
| 680 | { | 685 | { |
| 681 | - HCCL_INFO("[AicpuTsUboeUbgChannelHelper::%s] not supported yet.", __func__); | 686 | + HCCL_INFO("[AicpuTsUboeUbRtpChannelHelper::%s] not supported yet.", __func__); |
| 682 | return HCCL_E_NOT_SUPPORT; | 687 | return HCCL_E_NOT_SUPPORT; |
| 683 | } | 688 | } |
| 684 | 689 | ||
| @@ -7,9 +7,8 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | - | 10 | +#ifndef AICPU_TS_UBOE_UB_RTP_CHANNEL_HELPER_H |
| 11 | -#ifndef AICPU_TS_UBOE_UBG_CHANNEL_HELPER_H | 11 | +#define AICPU_TS_UBOE_UB_RTP_CHANNEL_HELPER_H |
| 12 | - | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | ||
| @@ -34,10 +33,10 @@ namespace hcomm { | |||
| 34 | constexpr u32 FINISH_MSG_SIZE = 128; | 33 | constexpr u32 FINISH_MSG_SIZE = 128; |
| 35 | constexpr char_t FINISH_MSG[FINISH_MSG_SIZE] = "Uboe Comm Pipe ready!"; | 34 | constexpr char_t FINISH_MSG[FINISH_MSG_SIZE] = "Uboe Comm Pipe ready!"; |
| 36 | 35 | ||
| 37 | -class AicpuTsUboeUbgChannelHelper : public Channel { | 36 | +class AicpuTsUboeUbRtpChannelHelper : public Channel { |
| 38 | public: | 37 | public: |
| 39 | - AicpuTsUboeUbgChannelHelper(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc); | 38 | + AicpuTsUboeUbRtpChannelHelper(EndpointHandle endpointHandle, const HcommChannelDesc& channelDesc); |
| 40 | - virtual ~AicpuTsUboeUbgChannelHelper(); | 39 | + virtual ~AicpuTsUboeUbRtpChannelHelper(); |
| 41 | 40 | ||
| 42 | HcclResult GetNotifyNum(uint32_t* notifyNum) const override; | 41 | HcclResult GetNotifyNum(uint32_t* notifyNum) const override; |
| 43 | HcclResult GetRemoteMems(uint32_t* memNum, CommMem** remoteMem, char*** memInfos) override; | 42 | HcclResult GetRemoteMems(uint32_t* memNum, CommMem** remoteMem, char*** memInfos) override; |
| @@ -155,4 +154,4 @@ private: | |||
| 155 | 154 | ||
| 156 | } // namespace hcomm | 155 | } // namespace hcomm |
| 157 | 156 | ||
| 158 | -#endif // AICPU_TS_UBOE_UBG_CHANNEL_HELPER_H | 157 | +#endif // AICPU_TS_UBOE_UB_RTP_CHANNEL_HELPER_H |
| @@ -43,7 +43,7 @@ HcclResult AivChannelHelper::FillDevEntities( | |||
| 43 | CHK_RET(roceChannel->FillDevChannelEntity()); | 43 | CHK_RET(roceChannel->FillDevChannelEntity()); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - if (protocol == COMM_PROTOCOL_UBC_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UBG) { | 46 | + if (protocol == COMM_PROTOCOL_UB_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UB_RTP) { |
| 47 | auto* aivChannel = static_cast<AivUrmaChannel*>(channelPtr); | 47 | auto* aivChannel = static_cast<AivUrmaChannel*>(channelPtr); |
| 48 | CHK_RET(aivChannel->FillChannelEntityToDevice()); | 48 | CHK_RET(aivChannel->FillChannelEntityToDevice()); |
| 49 | } | 49 | } |
| @@ -90,7 +90,7 @@ HcclResult AivChannelHelper::PreAllocChannels( | |||
| 90 | "[%s] channel[%u] pre-alloc dev entity success, devEntityPtr[%p]", __func__, i, | 90 | "[%s] channel[%u] pre-alloc dev entity success, devEntityPtr[%p]", __func__, i, |
| 91 | reinterpret_cast<void*>(static_cast<uintptr_t>(userChannels[i]))); | 91 | reinterpret_cast<void*>(static_cast<uintptr_t>(userChannels[i]))); |
| 92 | } else if ( | 92 | } else if ( |
| 93 | - protocol == COMM_PROTOCOL_UBC_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UBG) { | 93 | + protocol == COMM_PROTOCOL_UB_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UB_RTP) { |
| 94 | needD2HMap = true; | 94 | needD2HMap = true; |
| 95 | auto* channel = reinterpret_cast<AivUrmaChannel*>(targetChannels[i]); | 95 | auto* channel = reinterpret_cast<AivUrmaChannel*>(targetChannels[i]); |
| 96 | CHK_PTR_NULL(channel); | 96 | CHK_PTR_NULL(channel); |
| @@ -423,9 +423,9 @@ HcclResult AivUrmaChannel::CreateUbConnectionByProtocol( | |||
| 423 | Hccl::IpAddress(), ctx.qosPre, COMM_ENGINE_AIV, ctx.sqDepth), | 423 | Hccl::IpAddress(), ctx.qosPre, COMM_ENGINE_AIV, ctx.sqDepth), |
| 424 | return HCCL_E_PTR); | 424 | return HCCL_E_PTR); |
| 425 | break; | 425 | break; |
| 426 | - case Hccl::LinkProtocol::UBG: | 426 | + case Hccl::LinkProtocol::UB_RTP: |
| 427 | EXCEPTION_CATCH( | 427 | EXCEPTION_CATCH( |
| 428 | - ubConn = std::make_unique<Hccl::DevUbUbgConnection>( | 428 | + ubConn = std::make_unique<Hccl::DevUbRtpConnection>( |
| 429 | rdmaHandle_, ctx.locAddr, ctx.rmtAddr, opMode, devUsed, jfcMode, ctx.locAddr, ctx.rmtAddr, | 429 | rdmaHandle_, ctx.locAddr, ctx.rmtAddr, opMode, devUsed, jfcMode, ctx.locAddr, ctx.rmtAddr, |
| 430 | ctx.qosPre, COMM_ENGINE_AIV, ctx.sqDepth), | 430 | ctx.qosPre, COMM_ENGINE_AIV, ctx.sqDepth), |
| 431 | return HCCL_E_PTR); | 431 | return HCCL_E_PTR); |
| @@ -444,7 +444,7 @@ AivUrmaChannel::AcquireSharedJettyInBuildConnection(const UbConnBuildContext& ct | |||
| 444 | Endpoint* endpoint = reinterpret_cast<Endpoint*>(endpointHandle_); | 444 | Endpoint* endpoint = reinterpret_cast<Endpoint*>(endpointHandle_); |
| 445 | auto tempFactory = [rdmaHandle = rdmaHandle_, &ctxLoc = ctx.locAddr, &ctxRmt = ctx.rmtAddr, qosPre = ctx.qosPre, | 445 | auto tempFactory = [rdmaHandle = rdmaHandle_, &ctxLoc = ctx.locAddr, &ctxRmt = ctx.rmtAddr, qosPre = ctx.qosPre, |
| 446 | protocol = ctx.protocol, sqDepth = ctx.sqDepth]() -> std::unique_ptr<Hccl::DevUbConnection> { | 446 | protocol = ctx.protocol, sqDepth = ctx.sqDepth]() -> std::unique_ptr<Hccl::DevUbConnection> { |
| 447 | - // 与主 switch 保持对称的协议判断,避免 UBG/未知协议误降级为 CTP | 447 | + // 与主 switch 保持对称的协议判断,避免 UB_RTP/未知协议误降级为 CTP |
| 448 | switch (protocol) { | 448 | switch (protocol) { |
| 449 | case Hccl::LinkProtocol::UB_TP: | 449 | case Hccl::LinkProtocol::UB_TP: |
| 450 | return std::make_unique<Hccl::DevUbTpConnection>( | 450 | return std::make_unique<Hccl::DevUbTpConnection>( |
| @@ -90,7 +90,7 @@ static HcclResult CreateCcuTransport( | |||
| 90 | CHK_RET(IpAddressToCommAddr(rmtAddr_, rmtAddr)); | 90 | CHK_RET(IpAddressToCommAddr(rmtAddr_, rmtAddr)); |
| 91 | 91 | ||
| 92 | CcuTransport::CcuConnectionType type_ = linkData.GetLinkProtocol() == Hccl::LinkProtocol::UB_CTP ? | 92 | CcuTransport::CcuConnectionType type_ = linkData.GetLinkProtocol() == Hccl::LinkProtocol::UB_CTP ? |
| 93 | - CcuTransport::CcuConnectionType::UBC_CTP : | 93 | + CcuTransport::CcuConnectionType::UB_CTP : |
| 94 | CcuTransport::CcuConnectionType::UBC_TP; | 94 | CcuTransport::CcuConnectionType::UBC_TP; |
| 95 | 95 | ||
| 96 | CcuTransport::CcuConnectionInfo connectionInfo{type_, locAddr, rmtAddr, channelInfo, ccuJettys, qos}; | 96 | CcuTransport::CcuConnectionInfo connectionInfo{type_, locAddr, rmtAddr, channelInfo, ccuJettys, qos}; |
| @@ -121,7 +121,7 @@ static HcclResult CheckEndpointDesc(const EndpointDesc& locDesc, const EndpointD | |||
| 121 | return HcclResult::HCCL_E_PARA; | 121 | return HcclResult::HCCL_E_PARA; |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | - if (locDesc.protocol != COMM_PROTOCOL_UBC_CTP && locDesc.protocol != COMM_PROTOCOL_UBC_TP) { | 124 | + if (locDesc.protocol != COMM_PROTOCOL_UB_CTP && locDesc.protocol != COMM_PROTOCOL_UBC_TP) { |
| 125 | HCCL_ERROR("[CcuUrmaChannel][%s] failed, protocol[%d] are not supported in ccu.", __func__, locDesc.protocol); | 125 | HCCL_ERROR("[CcuUrmaChannel][%s] failed, protocol[%d] are not supported in ccu.", __func__, locDesc.protocol); |
| 126 | return HcclResult::HCCL_E_PARA; | 126 | return HcclResult::HCCL_E_PARA; |
| 127 | } | 127 | } |
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "./aicpu/aicpu_ts_ubg_channel.h" | 22 | +#include "./aicpu/aicpu_ts_ub_rtp_channel.h" |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| @@ -47,7 +47,7 @@ HcclResult Channel::CreateChannel( | |||
| 47 | return HCCL_E_PARA); | 47 | return HCCL_E_PARA); |
| 48 | break; | 48 | break; |
| 49 | } | 49 | } |
| 50 | - if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_CTP | 50 | + if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_CTP |
| 51 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP) { | 51 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP) { |
| 52 | EXCEPTION_CATCH( | 52 | EXCEPTION_CATCH( |
| 53 | uniqueChannelPtr = std::make_unique<HostCpuUrmaChannel>(endpointHandle, channelDesc), | 53 | uniqueChannelPtr = std::make_unique<HostCpuUrmaChannel>(endpointHandle, channelDesc), |
| @@ -65,14 +65,14 @@ HcclResult Channel::CreateChannel( | |||
| 65 | case COMM_ENGINE_AICPU_TS: | 65 | case COMM_ENGINE_AICPU_TS: |
| 66 | if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBOE) { | 66 | if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBOE) { |
| 67 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUboeChannel(endpointHandle, channelDesc)); | 67 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUboeChannel(endpointHandle, channelDesc)); |
| 68 | - } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBG) { | 68 | + } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_RTP) { |
| 69 | if (deviceType != DevType::DEV_TYPE_950 && deviceType != DevType::DEV_TYPE_960) { | 69 | if (deviceType != DevType::DEV_TYPE_950 && deviceType != DevType::DEV_TYPE_960) { |
| 70 | HCCL_ERROR( | 70 | HCCL_ERROR( |
| 71 | - "[Channel][%s] UBG protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, | 71 | + "[Channel][%s] UB_RTP protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, |
| 72 | static_cast<int>(deviceType)); | 72 | static_cast<int>(deviceType)); |
| 73 | return HCCL_E_NOT_SUPPORT; | 73 | return HCCL_E_NOT_SUPPORT; |
| 74 | } | 74 | } |
| 75 | - uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUbgChannel(endpointHandle, channelDesc)); | 75 | + uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUbRtpChannel(endpointHandle, channelDesc)); |
| 76 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_PCIE) { | 76 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_PCIE) { |
| 77 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsP2pChannel(endpointHandle, channelDesc)); | 77 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsP2pChannel(endpointHandle, channelDesc)); |
| 78 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_ROCE) { | 78 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_ROCE) { |
| @@ -82,7 +82,7 @@ HcclResult Channel::CreateChannel( | |||
| 82 | uniqueChannelPtr = std::make_unique<AicpuTsRoceChannel>(endpointHandle, channelDesc); | 82 | uniqueChannelPtr = std::make_unique<AicpuTsRoceChannel>(endpointHandle, channelDesc); |
| 83 | } | 83 | } |
| 84 | } else if ( | 84 | } else if ( |
| 85 | - channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_CTP | 85 | + channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_CTP |
| 86 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP) { | 86 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP) { |
| 87 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUrmaChannel(endpointHandle, channelDesc)); | 87 | uniqueChannelPtr.reset(new (std::nothrow) AicpuTsUrmaChannel(endpointHandle, channelDesc)); |
| 88 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_HCCS) { | 88 | } else if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_HCCS) { |
| @@ -100,13 +100,13 @@ HcclResult Channel::CreateChannel( | |||
| 100 | && (deviceType == DevType::DEV_TYPE_950 || deviceType == DevType::DEV_TYPE_960)) { | 100 | && (deviceType == DevType::DEV_TYPE_950 || deviceType == DevType::DEV_TYPE_960)) { |
| 101 | uniqueChannelPtr = std::make_unique<AicpuTsRoceChannelV2>(endpointHandle, channelDesc, engine); | 101 | uniqueChannelPtr = std::make_unique<AicpuTsRoceChannelV2>(endpointHandle, channelDesc, engine); |
| 102 | } else if ( | 102 | } else if ( |
| 103 | - channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_CTP | 103 | + channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_CTP |
| 104 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP | 104 | || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBC_TP |
| 105 | - || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBG) { | 105 | + || channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_RTP) { |
| 106 | - if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UBG && deviceType != DevType::DEV_TYPE_950 | 106 | + if (channelDesc.remoteEndpoint.protocol == COMM_PROTOCOL_UB_RTP && deviceType != DevType::DEV_TYPE_950 |
| 107 | && deviceType != DevType::DEV_TYPE_960) { | 107 | && deviceType != DevType::DEV_TYPE_960) { |
| 108 | HCCL_ERROR( | 108 | HCCL_ERROR( |
| 109 | - "[Channel][%s] UBG protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, | 109 | + "[Channel][%s] UB_RTP protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, |
| 110 | static_cast<int>(deviceType)); | 110 | static_cast<int>(deviceType)); |
| 111 | return HCCL_E_NOT_SUPPORT; | 111 | return HCCL_E_NOT_SUPPORT; |
| 112 | } | 112 | } |
| @@ -52,7 +52,7 @@ enum class HcommChannelKind : uint32_t { | |||
| 52 | AICPU_TS_UBOE = 6U, | 52 | AICPU_TS_UBOE = 6U, |
| 53 | AICPU_TS_ROCE_V2 = 7U, | 53 | AICPU_TS_ROCE_V2 = 7U, |
| 54 | AIV_URMA = 8U, | 54 | AIV_URMA = 8U, |
| 55 | - AICPU_TS_UBG = 9U, | 55 | + AICPU_TS_UB_RTP = 9U, |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | inline const char* HcommChannelKindToString(HcommChannelKind kind) | 58 | inline const char* HcommChannelKindToString(HcommChannelKind kind) |
| @@ -76,8 +76,8 @@ inline const char* HcommChannelKindToString(HcommChannelKind kind) | |||
| 76 | return "AICPU_TS_ROCE_V2"; | 76 | return "AICPU_TS_ROCE_V2"; |
| 77 | case HcommChannelKind::AIV_URMA: | 77 | case HcommChannelKind::AIV_URMA: |
| 78 | return "AIV_URMA"; | 78 | return "AIV_URMA"; |
| 79 | - case HcommChannelKind::AICPU_TS_UBG: | 79 | + case HcommChannelKind::AICPU_TS_UB_RTP: |
| 80 | - return "AICPU_TS_UBG"; | 80 | + return "AICPU_TS_UB_RTP"; |
| 81 | default: | 81 | default: |
| 82 | return "UNKNOWN"; | 82 | return "UNKNOWN"; |
| 83 | } | 83 | } |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "aicpu_ts_ubg_channel.h" | 23 | +#include "aicpu_ts_ub_rtp_channel.h" |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -482,8 +482,8 @@ static HcclResult PackAicpuTsChannelH2DRes(ChannelHandle hostChannelHandle, std: | |||
| 482 | return reinterpret_cast<AicpuTsUrmaChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); | 482 | return reinterpret_cast<AicpuTsUrmaChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); |
| 483 | case HcommChannelKind::AICPU_TS_UBOE: | 483 | case HcommChannelKind::AICPU_TS_UBOE: |
| 484 | return reinterpret_cast<AicpuTsUboeChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); | 484 | return reinterpret_cast<AicpuTsUboeChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); |
| 485 | - case HcommChannelKind::AICPU_TS_UBG: | 485 | + case HcommChannelKind::AICPU_TS_UB_RTP: |
| 486 | - return reinterpret_cast<AicpuTsUbgChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); | 486 | + return reinterpret_cast<AicpuTsUbRtpChannel*>(hostChannelHandle)->H2DResPack(hostPackBuffer); |
| 487 | case HcommChannelKind::AICPU_TS_ROCE_V2: | 487 | case HcommChannelKind::AICPU_TS_ROCE_V2: |
| 488 | return reinterpret_cast<AicpuTsRoceChannelV2*>(hostChannelHandle)->H2DResPack(hostPackBuffer); | 488 | return reinterpret_cast<AicpuTsRoceChannelV2*>(hostChannelHandle)->H2DResPack(hostPackBuffer); |
| 489 | default: | 489 | default: |
| @@ -568,9 +568,9 @@ HcclResult ChannelProcess::LaunchChannelKernelCommon( | |||
| 568 | } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_UBOE) { | 568 | } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_UBOE) { |
| 569 | auto aicpuTsUboeChannel = reinterpret_cast<AicpuTsUboeChannel*>(hostChannelHandles[index]); | 569 | auto aicpuTsUboeChannel = reinterpret_cast<AicpuTsUboeChannel*>(hostChannelHandles[index]); |
| 570 | CHK_PRT(aicpuTsUboeChannel->H2DResPack(hostPackBuffers[index])); | 570 | CHK_PRT(aicpuTsUboeChannel->H2DResPack(hostPackBuffers[index])); |
| 571 | - } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_UBG) { | 571 | + } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_UB_RTP) { |
| 572 | - auto aicpuTsUbgChannel = reinterpret_cast<AicpuTsUbgChannel*>(hostChannelHandles[index]); | 572 | + auto aicpuTsUbRtpChannel = reinterpret_cast<AicpuTsUbRtpChannel*>(hostChannelHandles[index]); |
| 573 | - CHK_PRT(aicpuTsUbgChannel->H2DResPack(hostPackBuffers[index])); | 573 | + CHK_PRT(aicpuTsUbRtpChannel->H2DResPack(hostPackBuffers[index])); |
| 574 | } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_ROCE) { | 574 | } else if (hcommDesc[index].remoteEndpoint.protocol == CommProtocol::COMM_PROTOCOL_ROCE) { |
| 575 | auto aicpuTsRoceChannelV2 = reinterpret_cast<AicpuTsRoceChannelV2*>(hostChannelHandles[index]); | 575 | auto aicpuTsRoceChannelV2 = reinterpret_cast<AicpuTsRoceChannelV2*>(hostChannelHandles[index]); |
| 576 | CHK_PRT(aicpuTsRoceChannelV2->H2DResPack(hostPackBuffers[index])); | 576 | CHK_PRT(aicpuTsRoceChannelV2->H2DResPack(hostPackBuffers[index])); |
| @@ -775,7 +775,7 @@ HcclResult ChannelProcess::LaunchChannelKernel( | |||
| 775 | CHK_PTR_NULL(ch); | 775 | CHK_PTR_NULL(ch); |
| 776 | if (ch->GetChannelKind() == HcommChannelKind::AICPU_TS_URMA | 776 | if (ch->GetChannelKind() == HcommChannelKind::AICPU_TS_URMA |
| 777 | || ch->GetChannelKind() == HcommChannelKind::AICPU_TS_UBOE | 777 | || ch->GetChannelKind() == HcommChannelKind::AICPU_TS_UBOE |
| 778 | - || ch->GetChannelKind() == HcommChannelKind::AICPU_TS_UBG) { | 778 | + || ch->GetChannelKind() == HcommChannelKind::AICPU_TS_UB_RTP) { |
| 779 | return ChannelKernelLaunchForBase(channelHandles, hostChannelHandles, hcommDesc, listNum, binHandle); | 779 | return ChannelKernelLaunchForBase(channelHandles, hostChannelHandles, hcommDesc, listNum, binHandle); |
| 780 | } | 780 | } |
| 781 | return LaunchCommonChannelKernel(channelHandles, hostChannelHandles, listNum, ch->GetChannelKind(), binHandle); | 781 | return LaunchCommonChannelKernel(channelHandles, hostChannelHandles, listNum, ch->GetChannelKind(), binHandle); |
| @@ -16,9 +16,9 @@ set(src_list | |||
| 16 | aicpu_ts_roce_endpoint.cc | 16 | aicpu_ts_roce_endpoint.cc |
| 17 | aicputs_hccs_endpoint.cc | 17 | aicputs_hccs_endpoint.cc |
| 18 | endpoint.cc | 18 | endpoint.cc |
| 19 | - uboe_ubg_endpoint_helper.cc | 19 | + uboe_ub_rtp_endpoint_helper.cc |
| 20 | uboe_endpoint.cc | 20 | uboe_endpoint.cc |
| 21 | - ubg_endpoint.cc | 21 | + ub_rtp_endpoint.cc |
| 22 | ) | 22 | ) |
| 23 | 23 | ||
| 24 | if(TARGET hcomm) | 24 | if(TARGET hcomm) |
| @@ -59,7 +59,7 @@ HcclResult CpuUrmaEndpoint::Init() | |||
| 59 | "CpuUrmaEndpoint::%s success, devPhyId[%u], ipAddr[%s], ctxHandle[%p]", __func__, devPhyId, | 59 | "CpuUrmaEndpoint::%s success, devPhyId[%u], ipAddr[%s], ctxHandle[%p]", __func__, devPhyId, |
| 60 | ipAddr.Describe().c_str(), ctxHandle_); | 60 | ipAddr.Describe().c_str(), ctxHandle_); |
| 61 | 61 | ||
| 62 | - cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UBC_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; | 62 | + cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UB_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; |
| 63 | auto& cache = ProcRegedMemMgrCache::GetInstance(); | 63 | auto& cache = ProcRegedMemMgrCache::GetInstance(); |
| 64 | EXCEPTION_CATCH( | 64 | EXCEPTION_CATCH( |
| 65 | regedMemMgr_ = cache.GetOrCreate( | 65 | regedMemMgr_ = cache.GetOrCreate( |
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | -#include "ubg_endpoint.h" | 20 | +#include "ub_rtp_endpoint.h" |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| @@ -32,11 +32,11 @@ static bool IsSupported(const EndpointDesc& endpointDesc) | |||
| 32 | switch (endpointDesc.protocol) { | 32 | switch (endpointDesc.protocol) { |
| 33 | case COMM_PROTOCOL_ROCE: | 33 | case COMM_PROTOCOL_ROCE: |
| 34 | case COMM_PROTOCOL_UBC_TP: | 34 | case COMM_PROTOCOL_UBC_TP: |
| 35 | - case COMM_PROTOCOL_UBC_CTP: | 35 | + case COMM_PROTOCOL_UB_CTP: |
| 36 | case COMM_PROTOCOL_UB_MEM: | 36 | case COMM_PROTOCOL_UB_MEM: |
| 37 | case COMM_PROTOCOL_PCIE: | 37 | case COMM_PROTOCOL_PCIE: |
| 38 | case COMM_PROTOCOL_UBOE: | 38 | case COMM_PROTOCOL_UBOE: |
| 39 | - case COMM_PROTOCOL_UBG: | 39 | + case COMM_PROTOCOL_UB_RTP: |
| 40 | case COMM_PROTOCOL_HCCS: | 40 | case COMM_PROTOCOL_HCCS: |
| 41 | protocolSupported = true; | 41 | protocolSupported = true; |
| 42 | break; | 42 | break; |
| @@ -235,7 +235,7 @@ HcclResult Endpoint::CreateEndpointBase(const EndpointDesc& endpointDesc, std::u | |||
| 235 | [](const EndpointDesc& d) { | 235 | [](const EndpointDesc& d) { |
| 236 | return std::make_unique<CpuUrmaEndpoint>(d); | 236 | return std::make_unique<CpuUrmaEndpoint>(d); |
| 237 | }}, | 237 | }}, |
| 238 | - {COMM_PROTOCOL_UBC_CTP, ENDPOINT_LOC_TYPE_HOST, | 238 | + {COMM_PROTOCOL_UB_CTP, ENDPOINT_LOC_TYPE_HOST, |
| 239 | [](const EndpointDesc& d) { | 239 | [](const EndpointDesc& d) { |
| 240 | return std::make_unique<CpuUrmaEndpoint>(d); | 240 | return std::make_unique<CpuUrmaEndpoint>(d); |
| 241 | }}, | 241 | }}, |
| @@ -243,7 +243,7 @@ HcclResult Endpoint::CreateEndpointBase(const EndpointDesc& endpointDesc, std::u | |||
| 243 | [](const EndpointDesc& d) { | 243 | [](const EndpointDesc& d) { |
| 244 | return std::make_unique<UrmaEndpoint>(d); | 244 | return std::make_unique<UrmaEndpoint>(d); |
| 245 | }}, | 245 | }}, |
| 246 | - {COMM_PROTOCOL_UBC_CTP, ENDPOINT_LOC_TYPE_DEVICE, | 246 | + {COMM_PROTOCOL_UB_CTP, ENDPOINT_LOC_TYPE_DEVICE, |
| 247 | [](const EndpointDesc& d) { | 247 | [](const EndpointDesc& d) { |
| 248 | return std::make_unique<UrmaEndpoint>(d); | 248 | return std::make_unique<UrmaEndpoint>(d); |
| 249 | }}, | 249 | }}, |
| @@ -259,9 +259,9 @@ HcclResult Endpoint::CreateEndpointBase(const EndpointDesc& endpointDesc, std::u | |||
| 259 | [](const EndpointDesc& d) { | 259 | [](const EndpointDesc& d) { |
| 260 | return std::make_unique<UboeEndpoint>(d); | 260 | return std::make_unique<UboeEndpoint>(d); |
| 261 | }}, | 261 | }}, |
| 262 | - {COMM_PROTOCOL_UBG, ENDPOINT_LOC_TYPE_DEVICE, | 262 | + {COMM_PROTOCOL_UB_RTP, ENDPOINT_LOC_TYPE_DEVICE, |
| 263 | [](const EndpointDesc& d) { | 263 | [](const EndpointDesc& d) { |
| 264 | - return std::make_unique<UbgEndpoint>(d); | 264 | + return std::make_unique<UbRtpEndpoint>(d); |
| 265 | }}, | 265 | }}, |
| 266 | {COMM_PROTOCOL_ROCE, ENDPOINT_LOC_TYPE_DEVICE, | 266 | {COMM_PROTOCOL_ROCE, ENDPOINT_LOC_TYPE_DEVICE, |
| 267 | [](const EndpointDesc& d) { | 267 | [](const EndpointDesc& d) { |
| @@ -8,7 +8,7 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "ubg_endpoint.h" | 11 | +#include "ub_rtp_endpoint.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -17,9 +17,9 @@ | |||
| 17 | 17 | ||
| 18 | namespace hcomm { | 18 | namespace hcomm { |
| 19 | 19 | ||
| 20 | -UbgEndpoint::UbgEndpoint(const EndpointDesc& endpointDesc) : UboeUbgEndpointHelper(endpointDesc) {} | 20 | +UbRtpEndpoint::UbRtpEndpoint(const EndpointDesc& endpointDesc) : UboeUbRtpEndpointHelper(endpointDesc) {} |
| 21 | 21 | ||
| 22 | -HcclResult UbgEndpoint::Init() | 22 | +HcclResult UbRtpEndpoint::Init() |
| 23 | { | 23 | { |
| 24 | HCCL_INFO("[%s] localEndpoint protocol[%d]", __func__, endpointDesc_.protocol); | 24 | HCCL_INFO("[%s] localEndpoint protocol[%d]", __func__, endpointDesc_.protocol); |
| 25 | 25 | ||
| @@ -27,12 +27,12 @@ HcclResult UbgEndpoint::Init() | |||
| 27 | CHK_RET(hrtGetDeviceType(deviceType)); | 27 | CHK_RET(hrtGetDeviceType(deviceType)); |
| 28 | if (deviceType != DevType::DEV_TYPE_950 && deviceType != DevType::DEV_TYPE_960) { | 28 | if (deviceType != DevType::DEV_TYPE_950 && deviceType != DevType::DEV_TYPE_960) { |
| 29 | HCCL_ERROR( | 29 | HCCL_ERROR( |
| 30 | - "[%s] UBG protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, | 30 | + "[%s] UB_RTP protocol only support DEV_TYPE_950/960, current deviceType=%d", __func__, |
| 31 | static_cast<int>(deviceType)); | 31 | static_cast<int>(deviceType)); |
| 32 | return HCCL_E_NOT_SUPPORT; | 32 | return HCCL_E_NOT_SUPPORT; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | - // UBG 直接从 EID type CommAddr 获取地址,不做 IP→EID 转换 | 35 | + // UB_RTP 直接从 EID type CommAddr 获取地址,不做 IP→EID 转换 |
| 36 | Hccl::IpAddress eidAddr{}; | 36 | Hccl::IpAddress eidAddr{}; |
| 37 | CHK_RET(CommAddrToIpAddress(endpointDesc_.commAddr, eidAddr)); | 37 | CHK_RET(CommAddrToIpAddress(endpointDesc_.commAddr, eidAddr)); |
| 38 | 38 | ||
| @@ -43,7 +43,7 @@ HcclResult UbgEndpoint::Init() | |||
| 43 | endpointDesc_.loc.device.devPhyId = devPhyId; | 43 | endpointDesc_.loc.device.devPhyId = devPhyId; |
| 44 | 44 | ||
| 45 | Hccl::HccpHdcManager::GetInstance().Init(deviceLogicId); | 45 | Hccl::HccpHdcManager::GetInstance().Init(deviceLogicId); |
| 46 | - // UBG 直接用 EID 地址获取 rdmaHandle,不做 IP→EID 查询 | 46 | + // UB_RTP 直接用 EID 地址获取 rdmaHandle,不做 IP→EID 查询 |
| 47 | auto& rdmaHandleMgr = Hccl::RdmaHandleManager::GetInstance(); | 47 | auto& rdmaHandleMgr = Hccl::RdmaHandleManager::GetInstance(); |
| 48 | EXCEPTION_CATCH( | 48 | EXCEPTION_CATCH( |
| 49 | ctxHandle_ = static_cast<void*>(rdmaHandleMgr.GetByIp(endpointDesc_.loc.device.devPhyId, eidAddr)), | 49 | ctxHandle_ = static_cast<void*>(rdmaHandleMgr.GetByIp(endpointDesc_.loc.device.devPhyId, eidAddr)), |
| @@ -7,25 +7,24 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | + | ||
| 11 | + | ||
| 10 | 12 | ||
| 11 | -#ifndef UBG_ENDPOINT_H | 13 | +#include "uboe_ub_rtp_endpoint_helper.h" |
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | 14 | ||
| 16 | namespace hcomm { | 15 | namespace hcomm { |
| 17 | /** | 16 | /** |
| 18 | - * @note 职责:AICPU通信引擎+UBG协议的通信设备Endpoint,管理通信设备上下文,以及设备上的注册内存。 | 17 | + * @note 职责:AICPU通信引擎+UB_RTP协议的通信设备Endpoint,管理通信设备上下文,以及设备上的注册内存。 |
| 19 | - * UBG的Init直接使用EID地址(不做IP→EID转换),rdmaHandle通过EID直接获取。 | 18 | + * UB_RTP的Init直接使用EID地址(不做IP→EID转换),rdmaHandle通过EID直接获取。 |
| 20 | */ | 19 | */ |
| 21 | -class UbgEndpoint : public UboeUbgEndpointHelper { | 20 | +class UbRtpEndpoint : public UboeUbRtpEndpointHelper { |
| 22 | public: | 21 | public: |
| 23 | - explicit UbgEndpoint(const EndpointDesc& endpointDesc); | 22 | + explicit UbRtpEndpoint(const EndpointDesc& endpointDesc); |
| 24 | - ~UbgEndpoint() = default; | 23 | + ~UbRtpEndpoint() = default; |
| 25 | 24 | ||
| 26 | HcclResult Init() override; | 25 | HcclResult Init() override; |
| 27 | }; | 26 | }; |
| 28 | 27 | ||
| 29 | } // namespace hcomm | 28 | } // namespace hcomm |
| 30 | 29 | ||
| 31 | -#endif // UBG_ENDPOINT_H | 30 | +#endif // UB_RTP_ENDPOINT_H |
| @@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | namespace hcomm { | 19 | namespace hcomm { |
| 20 | 20 | ||
| 21 | -UboeEndpoint::UboeEndpoint(const EndpointDesc& endpointDesc) : UboeUbgEndpointHelper(endpointDesc) {} | 21 | +UboeEndpoint::UboeEndpoint(const EndpointDesc& endpointDesc) : UboeUbRtpEndpointHelper(endpointDesc) {} |
| 22 | 22 | ||
| 23 | UboeEndpoint::~UboeEndpoint() noexcept { ProcRegedMemMgrCache::GetInstance().Release(cacheKey_); } | 23 | UboeEndpoint::~UboeEndpoint() noexcept { ProcRegedMemMgrCache::GetInstance().Release(cacheKey_); } |
| 24 | 24 | ||
| @@ -47,7 +47,7 @@ HcclResult UboeEndpoint::Init() | |||
| 47 | "%s success, devPhyId[%u], eidAddress[%s], ctxHandle[%p]", __func__, devPhyId, eidAddress.Describe().c_str(), | 47 | "%s success, devPhyId[%u], eidAddress[%s], ctxHandle[%p]", __func__, devPhyId, eidAddress.Describe().c_str(), |
| 48 | ctxHandle_); | 48 | ctxHandle_); |
| 49 | 49 | ||
| 50 | - cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UBC_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; | 50 | + cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UB_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; |
| 51 | auto& cache = ProcRegedMemMgrCache::GetInstance(); | 51 | auto& cache = ProcRegedMemMgrCache::GetInstance(); |
| 52 | EXCEPTION_CATCH( | 52 | EXCEPTION_CATCH( |
| 53 | regedMemMgr_ = cache.GetOrCreate( | 53 | regedMemMgr_ = cache.GetOrCreate( |
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | -#include "uboe_ubg_endpoint_helper.h" | 14 | +#include "uboe_ub_rtp_endpoint_helper.h" |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | namespace hcomm { | 17 | namespace hcomm { |
| @@ -19,7 +19,7 @@ namespace hcomm { | |||
| 19 | * @note 职责:AICPU通信引擎+UBOE协议的通信设备Endpoint,管理通信设备上下文,以及设备上的注册内存。 | 19 | * @note 职责:AICPU通信引擎+UBOE协议的通信设备Endpoint,管理通信设备上下文,以及设备上的注册内存。 |
| 20 | * UBOE的Init需要做IP→EID转换。 | 20 | * UBOE的Init需要做IP→EID转换。 |
| 21 | */ | 21 | */ |
| 22 | -class UboeEndpoint : public UboeUbgEndpointHelper { | 22 | +class UboeEndpoint : public UboeUbRtpEndpointHelper { |
| 23 | public: | 23 | public: |
| 24 | explicit UboeEndpoint(const EndpointDesc& endpointDesc); | 24 | explicit UboeEndpoint(const EndpointDesc& endpointDesc); |
| 25 | ~UboeEndpoint() noexcept override; | 25 | ~UboeEndpoint() noexcept override; |
| @@ -8,57 +8,57 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#include "uboe_ubg_endpoint_helper.h" | 11 | +#include "uboe_ub_rtp_endpoint_helper.h" |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | namespace hcomm { | 15 | namespace hcomm { |
| 16 | 16 | ||
| 17 | -UboeUbgEndpointHelper::UboeUbgEndpointHelper(const EndpointDesc& endpointDesc) : Endpoint(endpointDesc) {} | 17 | +UboeUbRtpEndpointHelper::UboeUbRtpEndpointHelper(const EndpointDesc& endpointDesc) : Endpoint(endpointDesc) {} |
| 18 | 18 | ||
| 19 | -HcclResult UboeUbgEndpointHelper::ServerSocketListen(const uint32_t port) | 19 | +HcclResult UboeUbRtpEndpointHelper::ServerSocketListen(const uint32_t port) |
| 20 | { | 20 | { |
| 21 | HCCL_INFO("%s is not supported", __func__); | 21 | HCCL_INFO("%s is not supported", __func__); |
| 22 | return HCCL_SUCCESS; | 22 | return HCCL_SUCCESS; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | -HcclResult UboeUbgEndpointHelper::ServerSocketStopListen(const uint32_t port) | 25 | +HcclResult UboeUbRtpEndpointHelper::ServerSocketStopListen(const uint32_t port) |
| 26 | { | 26 | { |
| 27 | HCCL_INFO("%s is not supported", __func__); | 27 | HCCL_INFO("%s is not supported", __func__); |
| 28 | return HCCL_SUCCESS; | 28 | return HCCL_SUCCESS; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | -HcclResult UboeUbgEndpointHelper::RegisterMemory(HcommMem mem, const char* memTag, void** memHandle) | 31 | +HcclResult UboeUbRtpEndpointHelper::RegisterMemory(HcommMem mem, const char* memTag, void** memHandle) |
| 32 | { | 32 | { |
| 33 | CHK_RET(regedMemMgr_->RegisterMemory(mem, memTag, memHandle)); | 33 | CHK_RET(regedMemMgr_->RegisterMemory(mem, memTag, memHandle)); |
| 34 | return HCCL_SUCCESS; | 34 | return HCCL_SUCCESS; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | -HcclResult UboeUbgEndpointHelper::UnregisterMemory(void* memHandle) | 37 | +HcclResult UboeUbRtpEndpointHelper::UnregisterMemory(void* memHandle) |
| 38 | { | 38 | { |
| 39 | CHK_RET(regedMemMgr_->UnregisterMemory(memHandle)); | 39 | CHK_RET(regedMemMgr_->UnregisterMemory(memHandle)); |
| 40 | return HCCL_SUCCESS; | 40 | return HCCL_SUCCESS; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | -HcclResult UboeUbgEndpointHelper::MemoryExport(void* memHandle, void** memDesc, uint32_t* memDescLen) | 43 | +HcclResult UboeUbRtpEndpointHelper::MemoryExport(void* memHandle, void** memDesc, uint32_t* memDescLen) |
| 44 | { | 44 | { |
| 45 | CHK_RET(regedMemMgr_->MemoryExport(endpointDesc_, memHandle, memDesc, memDescLen)); | 45 | CHK_RET(regedMemMgr_->MemoryExport(endpointDesc_, memHandle, memDesc, memDescLen)); |
| 46 | return HCCL_SUCCESS; | 46 | return HCCL_SUCCESS; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | -HcclResult UboeUbgEndpointHelper::MemoryImport(const void* memDesc, uint32_t descLen, HcommMem* outMem) | 49 | +HcclResult UboeUbRtpEndpointHelper::MemoryImport(const void* memDesc, uint32_t descLen, HcommMem* outMem) |
| 50 | { | 50 | { |
| 51 | CHK_RET(regedMemMgr_->MemoryImport(memDesc, descLen, outMem)); | 51 | CHK_RET(regedMemMgr_->MemoryImport(memDesc, descLen, outMem)); |
| 52 | return HCCL_SUCCESS; | 52 | return HCCL_SUCCESS; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | -HcclResult UboeUbgEndpointHelper::MemoryUnimport(const void* memDesc, uint32_t descLen) | 55 | +HcclResult UboeUbRtpEndpointHelper::MemoryUnimport(const void* memDesc, uint32_t descLen) |
| 56 | { | 56 | { |
| 57 | CHK_RET(regedMemMgr_->MemoryUnimport(memDesc, descLen)); | 57 | CHK_RET(regedMemMgr_->MemoryUnimport(memDesc, descLen)); |
| 58 | return HCCL_SUCCESS; | 58 | return HCCL_SUCCESS; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | -HcclResult UboeUbgEndpointHelper::GetAllMemHandles(void** memHandles, uint32_t* memHandleNum) | 61 | +HcclResult UboeUbRtpEndpointHelper::GetAllMemHandles(void** memHandles, uint32_t* memHandleNum) |
| 62 | { | 62 | { |
| 63 | CHK_RET(regedMemMgr_->GetAllMemHandles(memHandles, memHandleNum)); | 63 | CHK_RET(regedMemMgr_->GetAllMemHandles(memHandles, memHandleNum)); |
| 64 | return HCCL_SUCCESS; | 64 | return HCCL_SUCCESS; |
| @@ -7,9 +7,8 @@ | |||
| 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. | 7 | * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | - | 10 | +#ifndef UBOE_UB_RTP_ENDPOINT_HELPER_H |
| 11 | -#ifndef UBOE_UBG_ENDPOINT_HELPER_H | 11 | +#define UBOE_UB_RTP_ENDPOINT_HELPER_H |
| 12 | - | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | ||
| @@ -18,13 +17,13 @@ | |||
| 18 | 17 | ||
| 19 | namespace hcomm { | 18 | namespace hcomm { |
| 20 | /** | 19 | /** |
| 21 | - * @note 职责:UBOE/UBG协议Endpoint的公共基类,提供内存管理和Socket监听等公共实现。 | 20 | + * @note 职责:UBOE/UB_RTP协议Endpoint的公共基类,提供内存管理和Socket监听等公共实现。 |
| 22 | - * 子类只需实现 Init() 完成各自的地址获取(UBOE做IP→EID转换,UBG直接使用EID)。 | 21 | + * 子类只需实现 Init() 完成各自的地址获取(UBOE做IP→EID转换,UB_RTP直接使用EID)。 |
| 23 | */ | 22 | */ |
| 24 | -class UboeUbgEndpointHelper : public Endpoint { | 23 | +class UboeUbRtpEndpointHelper : public Endpoint { |
| 25 | public: | 24 | public: |
| 26 | - explicit UboeUbgEndpointHelper(const EndpointDesc& endpointDesc); | 25 | + explicit UboeUbRtpEndpointHelper(const EndpointDesc& endpointDesc); |
| 27 | - ~UboeUbgEndpointHelper() = default; | 26 | + ~UboeUbRtpEndpointHelper() = default; |
| 28 | 27 | ||
| 29 | HcclResult ServerSocketListen(const uint32_t port) override; | 28 | HcclResult ServerSocketListen(const uint32_t port) override; |
| 30 | HcclResult ServerSocketStopListen(const uint32_t port) override; | 29 | HcclResult ServerSocketStopListen(const uint32_t port) override; |
| @@ -41,4 +40,4 @@ public: | |||
| 41 | 40 | ||
| 42 | } // namespace hcomm | 41 | } // namespace hcomm |
| 43 | 42 | ||
| 44 | -#endif // UBOE_UBG_ENDPOINT_HELPER_H | 43 | +#endif // UBOE_UB_RTP_ENDPOINT_HELPER_H |
| @@ -82,7 +82,7 @@ HcclResult UrmaEndpoint::Init() | |||
| 82 | "%s success, devPhyId[%u], ipAddr[%s], ctxHandle[%p]", __func__, devPhyId, ipAddr.Describe().c_str(), | 82 | "%s success, devPhyId[%u], ipAddr[%s], ctxHandle[%p]", __func__, devPhyId, ipAddr.Describe().c_str(), |
| 83 | ctxHandle_); | 83 | ctxHandle_); |
| 84 | 84 | ||
| 85 | - cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UBC_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; | 85 | + cacheKey_ = MemMgrCacheKey{devPhyId, COMM_PROTOCOL_UB_CTP, ipAddr, LocTypeToPortType(endpointDesc_.loc.locType)}; |
| 86 | auto& cache = ProcRegedMemMgrCache::GetInstance(); | 86 | auto& cache = ProcRegedMemMgrCache::GetInstance(); |
| 87 | EXCEPTION_CATCH( | 87 | EXCEPTION_CATCH( |
| 88 | this->regedMemMgr_ = cache.GetOrCreate( | 88 | this->regedMemMgr_ = cache.GetOrCreate( |
| @@ -233,10 +233,10 @@ HcclResult ProcessUbChannelDesc( | |||
| 233 | (void)channelDescFinal; | 233 | (void)channelDescFinal; |
| 234 | (void)hcclComm; | 234 | (void)hcclComm; |
| 235 | 235 | ||
| 236 | - if (channelDesc.channelProtocol != COMM_PROTOCOL_UBC_CTP && channelDesc.channelProtocol != COMM_PROTOCOL_UBC_TP | 236 | + if (channelDesc.channelProtocol != COMM_PROTOCOL_UB_CTP && channelDesc.channelProtocol != COMM_PROTOCOL_UBC_TP |
| 237 | - && channelDesc.channelProtocol != COMM_PROTOCOL_UBOE && channelDesc.channelProtocol != COMM_PROTOCOL_UBG) { | 237 | + && channelDesc.channelProtocol != COMM_PROTOCOL_UBOE && channelDesc.channelProtocol != COMM_PROTOCOL_UB_RTP) { |
| 238 | HCCL_ERROR( | 238 | HCCL_ERROR( |
| 239 | - "[%s] unexpected channelProtocol[%d], expect UBC_CTP/UBC_TP/UBOE/UBG", __func__, | 239 | + "[%s] unexpected channelProtocol[%d], expect UB_CTP/UBC_TP/UBOE/UB_RTP", __func__, |
| 240 | static_cast<int>(channelDesc.channelProtocol)); | 240 | static_cast<int>(channelDesc.channelProtocol)); |
| 241 | return HCCL_E_PARA; | 241 | return HCCL_E_PARA; |
| 242 | } | 242 | } |
| @@ -269,10 +269,10 @@ ProcessHcclChannelDesc(const HcclChannelDesc& channelDesc, HcclChannelDesc& chan | |||
| 269 | channelDescFinal.ubMemAttr.pathMode = channelDesc.ubMemAttr.pathMode; | 269 | channelDescFinal.ubMemAttr.pathMode = channelDesc.ubMemAttr.pathMode; |
| 270 | HCCL_INFO("[%s] ubMemAttr.pathMode[%u]", __func__, channelDescFinal.ubMemAttr.pathMode); | 270 | HCCL_INFO("[%s] ubMemAttr.pathMode[%u]", __func__, channelDescFinal.ubMemAttr.pathMode); |
| 271 | break; | 271 | break; |
| 272 | - case COMM_PROTOCOL_UBC_CTP: | 272 | + case COMM_PROTOCOL_UB_CTP: |
| 273 | case COMM_PROTOCOL_UBC_TP: | 273 | case COMM_PROTOCOL_UBC_TP: |
| 274 | case COMM_PROTOCOL_UBOE: | 274 | case COMM_PROTOCOL_UBOE: |
| 275 | - case COMM_PROTOCOL_UBG: | 275 | + case COMM_PROTOCOL_UB_RTP: |
| 276 | return ProcessUbChannelDesc(channelDesc, channelDescFinal, hcclComm); | 276 | return ProcessUbChannelDesc(channelDesc, channelDescFinal, hcclComm); |
| 277 | case COMM_PROTOCOL_ROCE: | 277 | case COMM_PROTOCOL_ROCE: |
| 278 | return ProcessRoceChannelDesc(channelDesc, channelDescFinal, hcclComm); | 278 | return ProcessRoceChannelDesc(channelDesc, channelDescFinal, hcclComm); |
| @@ -285,8 +285,8 @@ ProcessHcclChannelDesc(const HcclChannelDesc& channelDesc, HcclChannelDesc& chan | |||
| 285 | return "COMM_PROTOCOL_PCIE"; | 285 | return "COMM_PROTOCOL_PCIE"; |
| 286 | case COMM_PROTOCOL_SIO: | 286 | case COMM_PROTOCOL_SIO: |
| 287 | return "COMM_PROTOCOL_SIO"; | 287 | return "COMM_PROTOCOL_SIO"; |
| 288 | - case COMM_PROTOCOL_UBC_CTP: | 288 | + case COMM_PROTOCOL_UB_CTP: |
| 289 | - return "COMM_PROTOCOL_UBC_CTP"; | 289 | + return "COMM_PROTOCOL_UB_CTP"; |
| 290 | case COMM_PROTOCOL_UB_MEM: | 290 | case COMM_PROTOCOL_UB_MEM: |
| 291 | return "COMM_PROTOCOL_UB_MEM"; | 291 | return "COMM_PROTOCOL_UB_MEM"; |
| 292 | case COMM_PROTOCOL_ROCE: | 292 | case COMM_PROTOCOL_ROCE: |
| @@ -295,8 +295,8 @@ ProcessHcclChannelDesc(const HcclChannelDesc& channelDesc, HcclChannelDesc& chan | |||
| 295 | return "COMM_PROTOCOL_UBC_TP"; | 295 | return "COMM_PROTOCOL_UBC_TP"; |
| 296 | case COMM_PROTOCOL_UBOE: | 296 | case COMM_PROTOCOL_UBOE: |
| 297 | return "COMM_PROTOCOL_UBOE"; | 297 | return "COMM_PROTOCOL_UBOE"; |
| 298 | - case COMM_PROTOCOL_UBG: | 298 | + case COMM_PROTOCOL_UB_RTP: |
| 299 | - return "COMM_PROTOCOL_UBG"; | 299 | + return "COMM_PROTOCOL_UB_RTP"; |
| 300 | case COMM_PROTOCOL_HCCS_ONLY: | 300 | case COMM_PROTOCOL_HCCS_ONLY: |
| 301 | return "COMM_PROTOCOL_HCCS_ONLY"; | 301 | return "COMM_PROTOCOL_HCCS_ONLY"; |
| 302 | default: | 302 | default: |
| @@ -381,8 +381,8 @@ BuildAivDeviceChannelEntity(const HcclChannelDesc& channelDesc, ChannelHandle ho | |||
| 381 | return HCCL_SUCCESS; | 381 | return HCCL_SUCCESS; |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | - if (channelDesc.channelProtocol == COMM_PROTOCOL_UBC_CTP || channelDesc.channelProtocol == COMM_PROTOCOL_UBC_TP | 384 | + if (channelDesc.channelProtocol == COMM_PROTOCOL_UB_CTP || channelDesc.channelProtocol == COMM_PROTOCOL_UBC_TP |
| 385 | - || channelDesc.channelProtocol == COMM_PROTOCOL_UBG) { | 385 | + || channelDesc.channelProtocol == COMM_PROTOCOL_UB_RTP) { |
| 386 | auto* aivUrmaChannel = dynamic_cast<hcomm::AivUrmaChannel*>(baseChannel); | 386 | auto* aivUrmaChannel = dynamic_cast<hcomm::AivUrmaChannel*>(baseChannel); |
| 387 | CHK_PTR_NULL(aivUrmaChannel); | 387 | CHK_PTR_NULL(aivUrmaChannel); |
| 388 | HCCL_INFO( | 388 | HCCL_INFO( |
| @@ -413,9 +413,9 @@ static HcclResult ConvertAivChannelHandlesToDevicePtrs( | |||
| 413 | std::vector<ChannelHandle> mappedHostChannels; | 413 | std::vector<ChannelHandle> mappedHostChannels; |
| 414 | for (uint32_t idx = 0; idx < channelNum; ++idx) { | 414 | for (uint32_t idx = 0; idx < channelNum; ++idx) { |
| 415 | if (channelDescs[idx].channelProtocol != COMM_PROTOCOL_ROCE | 415 | if (channelDescs[idx].channelProtocol != COMM_PROTOCOL_ROCE |
| 416 | - && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UBC_CTP | 416 | + && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UB_CTP |
| 417 | && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UBC_TP | 417 | && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UBC_TP |
| 418 | - && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UBG) { | 418 | + && channelDescs[idx].channelProtocol != COMM_PROTOCOL_UB_RTP) { |
| 419 | continue; | 419 | continue; |
| 420 | } | 420 | } |
| 421 | CHK_RET(BuildAivDeviceChannelEntity(channelDescs[idx], hostChannels[idx], deviceChannels[idx])); | 421 | CHK_RET(BuildAivDeviceChannelEntity(channelDescs[idx], hostChannels[idx], deviceChannels[idx])); |
| @@ -440,8 +440,8 @@ static HcclResult ConvertAivChannelHandlesToDevicePtrs( | |||
| 440 | } | 440 | } |
| 441 | static bool IsUbUrmaChannelProtocol(CommProtocol protocol) | 441 | static bool IsUbUrmaChannelProtocol(CommProtocol protocol) |
| 442 | { | 442 | { |
| 443 | - return protocol == COMM_PROTOCOL_UBC_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UBOE | 443 | + return protocol == COMM_PROTOCOL_UB_CTP || protocol == COMM_PROTOCOL_UBC_TP || protocol == COMM_PROTOCOL_UBOE |
| 444 | - || protocol == COMM_PROTOCOL_UBG; | 444 | + || protocol == COMM_PROTOCOL_UB_RTP; |
| 445 | } | 445 | } |
| 446 | 446 | ||
| 447 | static bool HasUbUrmaChannel(const std::vector<HcclChannelDesc>& channelDescFinals) | 447 | static bool HasUbUrmaChannel(const std::vector<HcclChannelDesc>& channelDescFinals) |
| @@ -513,7 +513,7 @@ static HcclResult AppendSymmetricMemHandles( | |||
| 513 | } | 513 | } |
| 514 | HCCL_INFO( | 514 | HCCL_INFO( |
| 515 | "[AppendSymmetricMemHandles] append symmetric memHandles success, channelNum[%zu], symMemHandleNum[%zu], " | 515 | "[AppendSymmetricMemHandles] append symmetric memHandles success, channelNum[%zu], symMemHandleNum[%zu], " |
| 516 | - "protocols[UBC_CTP/UBC_TP/UBOE].", | 516 | + "protocols[UB_CTP/UBC_TP/UBOE].", |
| 517 | channelDescFinals.size(), symmetricMemHandles.size()); | 517 | channelDescFinals.size(), symmetricMemHandles.size()); |
| 518 | return HCCL_SUCCESS; | 518 | return HCCL_SUCCESS; |
| 519 | } | 519 | } |
| @@ -814,7 +814,7 @@ HcclResult HcclGroupStatusGet(bool* isGroupEnabled) | |||
| 814 | 814 | ||
| 815 | static bool IsSharedQueueUbProtocol(CommProtocol protocol) | 815 | static bool IsSharedQueueUbProtocol(CommProtocol protocol) |
| 816 | { | 816 | { |
| 817 | - return protocol == COMM_PROTOCOL_UBC_CTP || protocol == COMM_PROTOCOL_UBC_TP; | 817 | + return protocol == COMM_PROTOCOL_UB_CTP || protocol == COMM_PROTOCOL_UBC_TP; |
| 818 | } | 818 | } |
| 819 | 819 | ||
| 820 | static bool IsSameLocalEndpoint(const EndpointDesc& a, const EndpointDesc& b) | 820 | static bool IsSameLocalEndpoint(const EndpointDesc& a, const EndpointDesc& b) |
| @@ -829,7 +829,7 @@ static HcclResult ValidateSharedQueueDescs(const std::vector<HcclChannelDesc>& c | |||
| 829 | for (uint32_t i = 0; i < channelDescs.size(); ++i) { | 829 | for (uint32_t i = 0; i < channelDescs.size(); ++i) { |
| 830 | if (!IsSharedQueueUbProtocol(channelDescs[i].channelProtocol)) { | 830 | if (!IsSharedQueueUbProtocol(channelDescs[i].channelProtocol)) { |
| 831 | HCCL_ERROR( | 831 | HCCL_ERROR( |
| 832 | - "[%s] IS_SHARED_QUEUE only supports UB protocols (UBC_CTP/UBC_TP), " | 832 | + "[%s] IS_SHARED_QUEUE only supports UB protocols (UB_CTP/UBC_TP), " |
| 833 | "channelDesc[%u] protocol[%d].", | 833 | "channelDesc[%u] protocol[%d].", |
| 834 | __func__, i, channelDescs[i].channelProtocol); | 834 | __func__, i, channelDescs[i].channelProtocol); |
| 835 | return HCCL_E_NOT_SUPPORT; | 835 | return HCCL_E_NOT_SUPPORT; |
| @@ -28,7 +28,7 @@ using PlaneId = std::string; | |||
| 28 | using FabricId = u32; | 28 | using FabricId = u32; |
| 29 | 29 | ||
| 30 | MAKE_ENUM(LinkDirection, BOTH, SEND_ONLY, RECV_ONLY) | 30 | MAKE_ENUM(LinkDirection, BOTH, SEND_ONLY, RECV_ONLY) |
| 31 | -MAKE_ENUM(LinkProtocol, UB_CTP, UB_TP, ROCE, HCCS, TCP, UB_MEM, PCIE, UBOE, UBG) | 31 | +MAKE_ENUM(LinkProtocol, UB_CTP, UB_TP, ROCE, HCCS, TCP, UB_MEM, PCIE, UBOE, UB_RTP) |
| 32 | MAKE_ENUM(LinkPortType, PEER, BACKUP_PLANE, NET_PLANE) | 32 | MAKE_ENUM(LinkPortType, PEER, BACKUP_PLANE, NET_PLANE) |
| 33 | MAKE_ENUM(LinkType, PEER2PEER, PEER2NET, PEER2BACKUP) | 33 | MAKE_ENUM(LinkType, PEER2PEER, PEER2NET, PEER2BACKUP) |
| 34 | MAKE_ENUM(AddrPosition, HOST, DEVICE) | 34 | MAKE_ENUM(AddrPosition, HOST, DEVICE) |
| @@ -928,10 +928,10 @@ void RankGraph::Dump() const | |||
| 928 | CommProtocol LinkProtocolToCommProtocol(const LinkProtocol& linkProtocol) | 928 | CommProtocol LinkProtocolToCommProtocol(const LinkProtocol& linkProtocol) |
| 929 | { | 929 | { |
| 930 | constexpr std::pair<LinkProtocol, CommProtocol> protocolPairs[] | 930 | constexpr std::pair<LinkProtocol, CommProtocol> protocolPairs[] |
| 931 | - = {{LinkProtocol::UB_CTP, COMM_PROTOCOL_UBC_CTP}, {LinkProtocol::UB_TP, COMM_PROTOCOL_UBC_TP}, | 931 | + = {{LinkProtocol::UB_CTP, COMM_PROTOCOL_UB_CTP}, {LinkProtocol::UB_TP, COMM_PROTOCOL_UBC_TP}, |
| 932 | - {LinkProtocol::ROCE, COMM_PROTOCOL_ROCE}, {LinkProtocol::HCCS, COMM_PROTOCOL_HCCS}, | 932 | + {LinkProtocol::ROCE, COMM_PROTOCOL_ROCE}, {LinkProtocol::HCCS, COMM_PROTOCOL_HCCS}, |
| 933 | - {LinkProtocol::PCIE, COMM_PROTOCOL_PCIE}, {LinkProtocol::UB_MEM, COMM_PROTOCOL_UB_MEM}, | 933 | + {LinkProtocol::PCIE, COMM_PROTOCOL_PCIE}, {LinkProtocol::UB_MEM, COMM_PROTOCOL_UB_MEM}, |
| 934 | - {LinkProtocol::UBOE, COMM_PROTOCOL_UBOE}, {LinkProtocol::UBG, COMM_PROTOCOL_UBG}}; | 934 | + {LinkProtocol::UBOE, COMM_PROTOCOL_UBOE}, {LinkProtocol::UB_RTP, COMM_PROTOCOL_UB_RTP}}; |
| 935 | 935 | ||
| 936 | for (const auto& p : protocolPairs) { | 936 | for (const auto& p : protocolPairs) { |
| 937 | if (p.first == linkProtocol) { | 937 | if (p.first == linkProtocol) { |
| @@ -24,7 +24,8 @@ const unordered_map<string, LinkProtocol> EdgeInfo::strToLinkProtocol = (unorder | |||
| 24 | {"TCP", LinkProtocol::TCP}, | 24 | {"TCP", LinkProtocol::TCP}, |
| 25 | {"UB_MEM", LinkProtocol::UB_MEM}, | 25 | {"UB_MEM", LinkProtocol::UB_MEM}, |
| 26 | {"UBOE", LinkProtocol::UBOE}, | 26 | {"UBOE", LinkProtocol::UBOE}, |
| 27 | - {"UBG", LinkProtocol::UBG}}); | 27 | + {"UB_RTP", LinkProtocol::UB_RTP}, |
[LOW] 字符串映射表新增 UB_RTP 同时保留 UBG 第 27-28 行: 建议修复: 检查是否存在 LinkProtocolToStr 反向映射函数。若存在,确认输出的是新名 UB_RTP 还是旧名 UBG。若输出 UB_RTP,则旧版本读取新版本生成的配置文件时可能无法识别——需评估配置文件跨版本兼容性。此条作为提示,非必须修复。 ![]() ![]() | |||
| 28 | + {"UBG", LinkProtocol::UB_RTP}}); | ||
| 28 | 29 | ||
| 29 | const unordered_map<std::string, TopoType> EdgeInfo::strToTopoType = (unordered_map<string, TopoType>{ | 30 | const unordered_map<std::string, TopoType> EdgeInfo::strToTopoType = (unordered_map<string, TopoType>{ |
| 30 | {"CLOS", TopoType::CLOS}, | 31 | {"CLOS", TopoType::CLOS}, |
| @@ -62,8 +62,8 @@ HcommChannelDesc ChannelDescHccl2Hcomm(const HcclChannelDesc& hcclDesc, const hc | |||
| 62 | hcommDesc.roceAttr.tc = hcclDesc.roceAttr.tc; | 62 | hcommDesc.roceAttr.tc = hcclDesc.roceAttr.tc; |
| 63 | return hcommDesc; | 63 | return hcommDesc; |
| 64 | } | 64 | } |
| 65 | - if (hcclDesc.channelProtocol == COMM_PROTOCOL_UBC_CTP || hcclDesc.channelProtocol == COMM_PROTOCOL_UBC_TP | 65 | + if (hcclDesc.channelProtocol == COMM_PROTOCOL_UB_CTP || hcclDesc.channelProtocol == COMM_PROTOCOL_UBC_TP |
| 66 | - || hcclDesc.channelProtocol == COMM_PROTOCOL_UBOE || hcclDesc.channelProtocol == COMM_PROTOCOL_UBG) { | 66 | + || hcclDesc.channelProtocol == COMM_PROTOCOL_UBOE || hcclDesc.channelProtocol == COMM_PROTOCOL_UB_RTP) { |
| 67 | hcommDesc.qos = ResolveUbCommDomainQos(commConfig); | 67 | hcommDesc.qos = ResolveUbCommDomainQos(commConfig); |
| 68 | return hcommDesc; | 68 | return hcommDesc; |
| 69 | } | 69 | } |
| @@ -75,11 +75,10 @@ HcommChannelDesc ChannelDescHccl2Hcomm(const HcclChannelDesc& hcclDesc, const hc | |||
| 75 | 75 | ||
| 76 | /* 公共模块函数返回值定义,跟业务层同步 */ | 76 | /* 公共模块函数返回值定义,跟业务层同步 */ |
| 77 | const std::unordered_map<CommProtocol, std::string> HCOM_COMM_PROTOCOL_STR_MAP | 77 | const std::unordered_map<CommProtocol, std::string> HCOM_COMM_PROTOCOL_STR_MAP |
| 78 | - = {{COMM_PROTOCOL_RESERVED, "RESERVED"}, {COMM_PROTOCOL_HCCS, "HCCS"}, | 78 | + = {{COMM_PROTOCOL_RESERVED, "RESERVED"}, {COMM_PROTOCOL_HCCS, "HCCS"}, {COMM_PROTOCOL_ROCE, "ROCE"}, |
| 79 | - {COMM_PROTOCOL_ROCE, "ROCE"}, {COMM_PROTOCOL_PCIE, "PCIE"}, | 79 | + {COMM_PROTOCOL_PCIE, "PCIE"}, {COMM_PROTOCOL_SIO, "SIO"}, {COMM_PROTOCOL_UB_CTP, "UB_CTP"}, |
| 80 | - {COMM_PROTOCOL_SIO, "SIO"}, {COMM_PROTOCOL_UBC_CTP, "UBC_CTP"}, | 80 | + {COMM_PROTOCOL_UBC_TP, "UBC_TP"}, {COMM_PROTOCOL_UB_MEM, "UB_MEM"}, {COMM_PROTOCOL_UBOE, "UBOE"}, |
| 81 | - {COMM_PROTOCOL_UBC_TP, "UBC_TP"}, {COMM_PROTOCOL_UB_MEM, "UB_MEM"}, | 81 | + {COMM_PROTOCOL_UB_RTP, "UB_RTP"}}; |
| 82 | - {COMM_PROTOCOL_UBOE, "UBOE"}, {COMM_PROTOCOL_UBG, "UBG"}}; | ||
| 83 | 82 | ||
| 84 | inline std::string GetCommProtocolEnumStr(CommProtocol protocol) | 83 | inline std::string GetCommProtocolEnumStr(CommProtocol protocol) |
| 85 | { | 84 | { |
| @@ -32,13 +32,15 @@ typedef enum { | |||
| 32 | * @brief 网络传输协议类型枚举 | 32 | * @brief 网络传输协议类型枚举 |
| 33 | */ | 33 | */ |
| 34 | typedef enum { | 34 | typedef enum { |
| 35 | - HCCL_PROTO_TYPE_RESERVED = -1, ///< 保留协议类型 | 35 | + HCCL_PROTO_TYPE_RESERVED = -1, ///< 保留协议类型 |
| 36 | - HCCL_PROTO_TYPE_BUS = 0, ///< 设备间总线直连协议 | 36 | + HCCL_PROTO_TYPE_BUS = 0, ///< 设备间总线直连协议 |
| 37 | - HCCL_PROTO_TYPE_TCP = 1, ///< 标准TCP协议 | 37 | + HCCL_PROTO_TYPE_TCP = 1, ///< 标准TCP协议 |
| 38 | - HCCL_PROTO_TYPE_ROCE = 2, ///< RDMA over Converged Ethernet | 38 | + HCCL_PROTO_TYPE_ROCE = 2, ///< RDMA over Converged Ethernet |
| 39 | - HCCL_PROTO_TYPE_UBC_CTP = 3, ///< 华为统一总线UBC_CTP | 39 | + HCCL_PROTO_TYPE_UB_CTP = 3, ///< 华为统一总线UB_CTP |
| 40 | - HCCL_PROTO_TYPE_UBC_TP = 4, ///< 华为统一总线UBC_TP | 40 | + HCCL_PROTO_TYPE_UBC_CTP = HCCL_PROTO_TYPE_UB_CTP, ///< 兼容旧协议名UBC_CTP |
| 41 | - HCCL_PROTO_TYPE_UBG_TP = 5 ///< 华为统一总线UBG_TP | 41 | + HCCL_PROTO_TYPE_UBC_TP = 4, ///< 华为统一总线UBC_TP |
| 42 | + HCCL_PROTO_TYPE_UB_RTP = 5, ///< 华为统一总线UB_RTP | ||
| 43 | + HCCL_PROTO_TYPE_UBG_TP = HCCL_PROTO_TYPE_UB_RTP ///< 兼容旧协议名UBG_TP | ||
| 42 | } HcclProtoType; | 44 | } HcclProtoType; |
| 43 | 45 | ||
| 44 | /** | 46 | /** |
| @@ -122,7 +122,7 @@ HcclResult CcuTransportMgr::CreateTransportByLink(const LinkData& link, CcuTrans | |||
| 122 | const auto& locAddr = link.GetLocalAddr(); | 122 | const auto& locAddr = link.GetLocalAddr(); |
| 123 | const auto& rmtAddr = link.GetRemoteAddr(); | 123 | const auto& rmtAddr = link.GetRemoteAddr(); |
| 124 | CcuTransport::CcuConnectionType type = link.GetLinkProtocol() == LinkProtocol::UB_CTP ? | 124 | CcuTransport::CcuConnectionType type = link.GetLinkProtocol() == LinkProtocol::UB_CTP ? |
| 125 | - CcuTransport::CcuConnectionType::UBC_CTP : | 125 | + CcuTransport::CcuConnectionType::UB_CTP : |
| 126 | CcuTransport::CcuConnectionType::UBC_TP; | 126 | CcuTransport::CcuConnectionType::UBC_TP; |
| 127 | CcuTransport::CcuConnectionInfo connectionInfo{type, locAddr, rmtAddr, channelInfo, ccuJettys}; | 127 | CcuTransport::CcuConnectionInfo connectionInfo{type, locAddr, rmtAddr, channelInfo, ccuJettys}; |
| 128 | 128 | ||
| @@ -73,7 +73,7 @@ unique_ptr<RmaConnection> RmaConnManager::CreateUbConn( | |||
| 73 | HCCL_INFO( | 73 | HCCL_INFO( |
| 74 | "[RmaConnManager][%s] LinkProtocol[%s], locAddr[%s], rmtAddr[%s]", __func__, | 74 | "[RmaConnManager][%s] LinkProtocol[%s], locAddr[%s], rmtAddr[%s]", __func__, |
| 75 | linkData.GetLinkProtocol().Describe().c_str(), locAddr.Describe().c_str(), rmtAddr.Describe().c_str()); | 75 | linkData.GetLinkProtocol().Describe().c_str(), locAddr.Describe().c_str(), rmtAddr.Describe().c_str()); |
| 76 | - if (linkData.GetLinkProtocol() == LinkProtocol::UBOE || linkData.GetLinkProtocol() == LinkProtocol::UBG) { | 76 | + if (linkData.GetLinkProtocol() == LinkProtocol::UBOE || linkData.GetLinkProtocol() == LinkProtocol::UB_RTP) { |
| 77 | // socket建链状态ok,并交换数据 | 77 | // socket建链状态ok,并交换数据 |
| 78 | WaitUboeSocketReady(socket, linkData); | 78 | WaitUboeSocketReady(socket, linkData); |
| 79 | } | 79 | } |
| @@ -84,9 +84,9 @@ unique_ptr<RmaConnection> RmaConnManager::CreateUbConn( | |||
| 84 | } else if (linkData.GetLinkProtocol() == LinkProtocol::UBOE) { | 84 | } else if (linkData.GetLinkProtocol() == LinkProtocol::UBOE) { |
| 85 | ubConn = make_unique<DevUbUboeConnection>( | 85 | ubConn = make_unique<DevUbUboeConnection>( |
| 86 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locIpv4Addr, rmtIpv4Addr); | 86 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locIpv4Addr, rmtIpv4Addr); |
| 87 | - } else if (linkData.GetLinkProtocol() == LinkProtocol::UBG) { | 87 | + } else if (linkData.GetLinkProtocol() == LinkProtocol::UB_RTP) { |
| 88 | ubConn | 88 | ubConn |
| 89 | - = make_unique<DevUbUbgConnection>(rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddr, rmtAddr); | 89 | + = make_unique<DevUbRtpConnection>(rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddr, rmtAddr); |
| 90 | } else { | 90 | } else { |
| 91 | ubConn = make_unique<DevUbCtpConnection>(rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode); | 91 | ubConn = make_unique<DevUbCtpConnection>(rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode); |
| 92 | } | 92 | } |
| @@ -119,7 +119,7 @@ RmaConnection* RmaConnManager::Create(const std::string& tag, const LinkData& li | |||
| 119 | rmaConn = CreateRdmaConn(socket, tag, linkData); | 119 | rmaConn = CreateRdmaConn(socket, tag, linkData); |
| 120 | } else if ( | 120 | } else if ( |
| 121 | linkProtocol == LinkProtocol::UB_TP || linkProtocol == LinkProtocol::UB_CTP | 121 | linkProtocol == LinkProtocol::UB_TP || linkProtocol == LinkProtocol::UB_CTP |
| 122 | - || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UBG) { | 122 | + || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UB_RTP) { |
| 123 | rmaConn = CreateUbConn(socket, tag, linkData, jfcMode); | 123 | rmaConn = CreateUbConn(socket, tag, linkData, jfcMode); |
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| @@ -57,7 +57,7 @@ void ConnLocalNotifyManager::ApplyFor(RankId remoteRankId, const LinkData& linkD | |||
| 57 | continue; | 57 | continue; |
| 58 | } else if ( | 58 | } else if ( |
| 59 | linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP | 59 | linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP |
| 60 | - || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UBG) { | 60 | + || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UB_RTP) { |
| 61 | RdmaHandle rdmaHandle = RdmaHandleManager::GetInstance().Get( | 61 | RdmaHandle rdmaHandle = RdmaHandleManager::GetInstance().Get( |
| 62 | comm->GetDevicePhyId(), linkData.GetLocalPort(), linkProtocol); | 62 | comm->GetDevicePhyId(), linkData.GetLocalPort(), linkProtocol); |
| 63 | notifyPool[remoteRankId][linkData][i] | 63 | notifyPool[remoteRankId][linkData][i] |
| @@ -127,7 +127,7 @@ BaseMemTransport* MemTransportManager::CreateOpbasedMemTransport(const LinkData& | |||
| 127 | } else if (linkData.GetType() == PortDeploymentType::DEV_NET) { | 127 | } else if (linkData.GetType() == PortDeploymentType::DEV_NET) { |
| 128 | auto linkProtocol = linkData.GetLinkProtocol(); | 128 | auto linkProtocol = linkData.GetLinkProtocol(); |
| 129 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP | 129 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP |
| 130 | - || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UBG) { | 130 | + || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UB_RTP) { |
| 131 | CreateOpbasedUbMemTransport(locRes, attr, linkData, *socket); | 131 | CreateOpbasedUbMemTransport(locRes, attr, linkData, *socket); |
| 132 | } else { | 132 | } else { |
| 133 | THROW<NullPtrException>(StringFormat("linkData=%s is error", linkData.Describe().c_str())); | 133 | THROW<NullPtrException>(StringFormat("linkData=%s is error", linkData.Describe().c_str())); |
| @@ -184,7 +184,7 @@ BaseMemTransport* MemTransportManager::CreateOffloadMemTransport(const std::stri | |||
| 184 | } else if (linkData.GetType() == PortDeploymentType::DEV_NET) { | 184 | } else if (linkData.GetType() == PortDeploymentType::DEV_NET) { |
| 185 | auto linkProtocol = linkData.GetLinkProtocol(); | 185 | auto linkProtocol = linkData.GetLinkProtocol(); |
| 186 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP | 186 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP |
| 187 | - || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UBG) { | 187 | + || linkProtocol == LinkProtocol::UBOE || linkProtocol == LinkProtocol::UB_RTP) { |
| 188 | CreateOffloadUbMemTransport(opTag, locRes, attr, linkData, *socket); | 188 | CreateOffloadUbMemTransport(opTag, locRes, attr, linkData, *socket); |
| 189 | } else { | 189 | } else { |
| 190 | THROW<NullPtrException>(StringFormat("linkData=%s is error", linkData.Describe().c_str())); | 190 | THROW<NullPtrException>(StringFormat("linkData=%s is error", linkData.Describe().c_str())); |
| @@ -28,7 +28,7 @@ using PlaneId = std::string; | |||
| 28 | using FabricId = u32; | 28 | using FabricId = u32; |
| 29 | 29 | ||
| 30 | MAKE_ENUM(LinkDirection, BOTH, SEND_ONLY, RECV_ONLY) | 30 | MAKE_ENUM(LinkDirection, BOTH, SEND_ONLY, RECV_ONLY) |
| 31 | -MAKE_ENUM(LinkProtocol, UB_CTP, UB_TP, ROCE, HCCS, TCP, UB_MEM, PCIE, UBOE, UBG) | 31 | +MAKE_ENUM(LinkProtocol, UB_CTP, UB_TP, ROCE, HCCS, TCP, UB_MEM, PCIE, UBOE, UB_RTP) |
| 32 | MAKE_ENUM(LinkPortType, PEER, BACKUP_PLANE, NET_PLANE) | 32 | MAKE_ENUM(LinkPortType, PEER, BACKUP_PLANE, NET_PLANE) |
| 33 | MAKE_ENUM(LinkType, PEER2PEER, PEER2NET, PEER2BACKUP) | 33 | MAKE_ENUM(LinkType, PEER2PEER, PEER2NET, PEER2BACKUP) |
| 34 | MAKE_ENUM(AddrPosition, HOST, DEVICE) | 34 | MAKE_ENUM(AddrPosition, HOST, DEVICE) |
| @@ -28,7 +28,7 @@ using namespace std; | |||
| 28 | 28 | ||
| 29 | MAKE_ENUM(PortDeploymentType, P2P, DEV_NET, HOST_NET) | 29 | MAKE_ENUM(PortDeploymentType, P2P, DEV_NET, HOST_NET) |
| 30 | 30 | ||
| 31 | -MAKE_ENUM(ConnectProtoType, HCCS, PCIE, TCP, RDMA, UB, UBOE, UBG) | 31 | +MAKE_ENUM(ConnectProtoType, HCCS, PCIE, TCP, RDMA, UB, UBOE, UB_RTP) |
| 32 | 32 | ||
| 33 | MAKE_ENUM(LinkProtoType, HCCS_PCIE, TCP, RDMA, UB) | 33 | MAKE_ENUM(LinkProtoType, HCCS_PCIE, TCP, RDMA, UB) |
| 34 | 34 | ||
| @@ -55,7 +55,7 @@ inline LinkProtoType LinkProtocol2LinkProtoType(LinkProtocol linkProtocol) | |||
| 55 | LinkProtoType linkType{}; | 55 | LinkProtoType linkType{}; |
| 56 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP | 56 | if (linkProtocol == LinkProtocol::UB_CTP || linkProtocol == LinkProtocol::UB_TP |
| 57 | || linkProtocol == LinkProtocol::UB_MEM || linkProtocol == LinkProtocol::UBOE | 57 | || linkProtocol == LinkProtocol::UB_MEM || linkProtocol == LinkProtocol::UBOE |
| 58 | - || linkProtocol == LinkProtocol::UBG) { | 58 | + || linkProtocol == LinkProtocol::UB_RTP) { |
| 59 | linkType = LinkProtoType::UB; | 59 | linkType = LinkProtoType::UB; |
| 60 | } else if (linkProtocol == LinkProtocol::ROCE) { | 60 | } else if (linkProtocol == LinkProtocol::ROCE) { |
| 61 | linkType = LinkProtoType::RDMA; | 61 | linkType = LinkProtoType::RDMA; |
| @@ -78,7 +78,8 @@ inline LinkProtoType ConnProto2LinkProto(ConnectProtoType connType) | |||
| 78 | } else if (connType == ConnectProtoType::RDMA) { | 78 | } else if (connType == ConnectProtoType::RDMA) { |
| 79 | linkType = LinkProtoType::RDMA; | 79 | linkType = LinkProtoType::RDMA; |
| 80 | } else if ( | 80 | } else if ( |
| 81 | - connType == ConnectProtoType::UB || connType == ConnectProtoType::UBOE || connType == ConnectProtoType::UBG) { | 81 | + connType == ConnectProtoType::UB || connType == ConnectProtoType::UBOE |
| 82 | + || connType == ConnectProtoType::UB_RTP) { | ||
| 82 | linkType = LinkProtoType::UB; | 83 | linkType = LinkProtoType::UB; |
| 83 | } | 84 | } |
| 84 | HCCL_INFO("[ConnProto2LinkProto] linkType is[%s]", linkType.Describe().c_str()); | 85 | HCCL_INFO("[ConnProto2LinkProto] linkType is[%s]", linkType.Describe().c_str()); |
| @@ -99,8 +100,8 @@ inline LinkProtocol ConnProto2LinkProtocol(ConnectProtoType connType) | |||
| 99 | linkProto = LinkProtocol::UB_CTP; | 100 | linkProto = LinkProtocol::UB_CTP; |
| 100 | } else if (connType == ConnectProtoType::UBOE) { | 101 | } else if (connType == ConnectProtoType::UBOE) { |
| 101 | linkProto = LinkProtocol::UBOE; | 102 | linkProto = LinkProtocol::UBOE; |
| 102 | - } else if (connType == ConnectProtoType::UBG) { | 103 | + } else if (connType == ConnectProtoType::UB_RTP) { |
| 103 | - linkProto = LinkProtocol::UBG; | 104 | + linkProto = LinkProtocol::UB_RTP; |
| 104 | } | 105 | } |
| 105 | HCCL_INFO("[ConnProto2LinkProtocol] linkProto is[%s]", linkProto.Describe().c_str()); | 106 | HCCL_INFO("[ConnProto2LinkProtocol] linkProto is[%s]", linkProto.Describe().c_str()); |
| 106 | return linkProto; | 107 | return linkProto; |
| @@ -149,7 +149,7 @@ int UrmaEidIsPortGroup(const dcmi_urma_eid_t* eid) | |||
| 149 | int UrmaEidIsUBOE(const dcmi_urma_eid_t* eid) | 149 | int UrmaEidIsUBOE(const dcmi_urma_eid_t* eid) |
| 150 | { | 150 | { |
| 151 | const int uboeMask = 0xc0; | 151 | const int uboeMask = 0xc0; |
| 152 | - const int flagPos = 7; // UBOE和UBG标志位的位置 | 152 | + const int flagPos = 7; // UBOE和UB_RTP标志位的位置 |
| 153 | unsigned char flag = eid->raw[flagPos]; | 153 | unsigned char flag = eid->raw[flagPos]; |
| 154 | if ((uboeMask & flag) == uboeMask) { | 154 | if ((uboeMask & flag) == uboeMask) { |
| 155 | return 1; | 155 | return 1; |
| @@ -158,18 +158,18 @@ int UrmaEidIsUBOE(const dcmi_urma_eid_t* eid) | |||
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | /** | 160 | /** |
| 161 | - * 判断是否是UBG, 判断原理见UrmaEidIsUBOE | 161 | + * 判断是否是UB_RTP, 判断原理见UrmaEidIsUBOE |
| 162 | * @param eid URMA eid结构体指针 | 162 | * @param eid URMA eid结构体指针 |
| 163 | - * @return int 1为UBG,0为不是UBG | 163 | + * @return int 1为UB_RTP,0为不是UB_RTP |
| 164 | */ | 164 | */ |
| 165 | -int UrmaEidIsUBG(const dcmi_urma_eid_t* eid) | 165 | +int UrmaEidIsUbRtp(const dcmi_urma_eid_t* eid) |
| 166 | { | 166 | { |
| 167 | const unsigned char bitMask = 0xc0; | 167 | const unsigned char bitMask = 0xc0; |
| 168 | - const unsigned char ubgFlag = 0x80; // UBG的flag | 168 | + const unsigned char ubRtpFlag = 0x80; // UB_RTP的flag |
| 169 | - const int flagPos = 7; // UBOE和UBG标志位的位置 | 169 | + const int flagPos = 7; // UBOE和UB_RTP标志位的位置 |
| 170 | unsigned char flag = eid->raw[flagPos]; | 170 | unsigned char flag = eid->raw[flagPos]; |
| 171 | int bit = (flag & bitMask); // | 171 | int bit = (flag & bitMask); // |
| 172 | - if (bit == ubgFlag) { | 172 | + if (bit == ubRtpFlag) { |
| 173 | return 1; | 173 | return 1; |
| 174 | } | 174 | } |
| 175 | return 0; | 175 | return 0; |
| @@ -52,7 +52,7 @@ int UrmaEidIsPortGroup(const dcmi_urma_eid_t* eid); | |||
| 52 | 52 | ||
| 53 | int UrmaEidIsUBOE(const dcmi_urma_eid_t* eid); | 53 | int UrmaEidIsUBOE(const dcmi_urma_eid_t* eid); |
| 54 | 54 | ||
| 55 | -int UrmaEidIsUBG(const dcmi_urma_eid_t* eid); | 55 | +int UrmaEidIsUbRtp(const dcmi_urma_eid_t* eid); |
| 56 | /** | 56 | /** |
| 57 | * 从EID中解析出CNA地址, | 57 | * 从EID中解析出CNA地址, |
| 58 | * @param eid URMA eid结构体指针 | 58 | * @param eid URMA eid结构体指针 |
| @@ -32,7 +32,7 @@ int PodGetRootinfoLen(size_t* len) | |||
| 32 | 32 | ||
| 33 | typedef struct rule { | 33 | typedef struct rule { |
| 34 | unsigned int mainboardId; | 34 | unsigned int mainboardId; |
| 35 | - int level; // 网络层级 0 mesh, 1 scaleup, 2 UBOE/UBG, 3 ROCE | 35 | + int level; // 网络层级 0 mesh, 1 scaleup, 2 UBOE/UB_RTP, 3 ROCE |
| 36 | int dieId; // io die id NPU有两个iodie, 0和1 | 36 | int dieId; // io die id NPU有两个iodie, 0和1 |
| 37 | int ueId; // UBEntity ID, 用于定义UB实体的功能 | 37 | int ueId; // UBEntity ID, 用于定义UB实体的功能 |
| 38 | int ports[MAX_PORT_NUM]; | 38 | int ports[MAX_PORT_NUM]; |
| @@ -33,7 +33,7 @@ enum UbEntityType { | |||
| 33 | UE_TYPE_MESH = 0, | 33 | UE_TYPE_MESH = 0, |
| 34 | UE_TYPE_CLOS = 1, | 34 | UE_TYPE_CLOS = 1, |
| 35 | UE_TYPE_UBOE = 2, | 35 | UE_TYPE_UBOE = 2, |
| 36 | - UE_TYPE_UBG = 3, | 36 | + UE_TYPE_UB_RTP = 3, |
| 37 | UE_TYPE_CLOS_PORTS = 4, | 37 | UE_TYPE_CLOS_PORTS = 4, |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| @@ -385,9 +385,9 @@ static const UBEntity* GetUBEntityByFilter(const UEList* ueList, int dieId, int | |||
| 385 | } | 385 | } |
| 386 | return NULL; | 386 | return NULL; |
| 387 | } | 387 | } |
| 388 | - if (type == UE_TYPE_UBG) { | 388 | + if (type == UE_TYPE_UB_RTP) { |
| 389 | for (unsigned int i = 0; i < ueList->ueNum; i++) { | 389 | for (unsigned int i = 0; i < ueList->ueNum; i++) { |
| 390 | - if (UrmaEidIsUBG(&ueList->ueList[i].eidList[0].eid)) { | 390 | + if (UrmaEidIsUbRtp(&ueList->ueList[i].eidList[0].eid)) { |
| 391 | return &ueList->ueList[i]; | 391 | return &ueList->ueList[i]; |
| 392 | } | 392 | } |
| 393 | } | 393 | } |
| @@ -57,7 +57,7 @@ inline void CheckLinkIsValid(const LinkData& link, const string& desc) | |||
| 57 | HCCL_INFO("[CheckLinkIsValid] linkProtocol is[%s]", linkProtocol.Describe().c_str()); | 57 | HCCL_INFO("[CheckLinkIsValid] linkProtocol is[%s]", linkProtocol.Describe().c_str()); |
| 58 | if (linkProtocol == LinkProtocol::ROCE || linkProtocol == LinkProtocol::UB_CTP | 58 | if (linkProtocol == LinkProtocol::ROCE || linkProtocol == LinkProtocol::UB_CTP |
| 59 | || linkProtocol == LinkProtocol::UB_TP || linkProtocol == LinkProtocol::UBOE | 59 | || linkProtocol == LinkProtocol::UB_TP || linkProtocol == LinkProtocol::UBOE |
| 60 | - || linkProtocol == LinkProtocol::UBG) { | 60 | + || linkProtocol == LinkProtocol::UB_RTP) { |
| 61 | return; | 61 | return; |
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| @@ -141,7 +141,7 @@ namespace { | |||
| 141 | static uint32_t BuildGetTpAttrBitmapForSlPolicy(TpProtocol tpProtocol) | 141 | static uint32_t BuildGetTpAttrBitmapForSlPolicy(TpProtocol tpProtocol) |
| 142 | { | 142 | { |
| 143 | uint32_t bitmap = (1U << kTpAttrSlAvailableBit) | kTpAttrBitmapSl; | 143 | uint32_t bitmap = (1U << kTpAttrSlAvailableBit) | kTpAttrBitmapSl; |
| 144 | - if (tpProtocol == TpProtocol::UBOE || tpProtocol == TpProtocol::UBG) { | 144 | + if (tpProtocol == TpProtocol::UBOE || tpProtocol == TpProtocol::UB_RTP) { |
| 145 | bitmap |= kTpAttrBitmapDscp | (1U << kTpAttrDscpConfigModeBit); | 145 | bitmap |= kTpAttrBitmapDscp | (1U << kTpAttrDscpConfigModeBit); |
| 146 | } | 146 | } |
| 147 | return bitmap; | 147 | return bitmap; |
| @@ -260,7 +260,7 @@ namespace { | |||
| 260 | isSync, ctxHandle, tpHandle, kTpAttrBitmapUboeNetWithDscp, netAttr, "CommitUboeNetAttrsToTpAttr"); | 260 | isSync, ctxHandle, tpHandle, kTpAttrBitmapUboeNetWithDscp, netAttr, "CommitUboeNetAttrsToTpAttr"); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | - static HcclResult CommitUbgDscpToTpAttr(const bool isSync, RdmaHandle ctxHandle, uint64_t tpHandle, uint8_t dscp) | 263 | + static HcclResult CommitUbRtpDscpToTpAttr(const bool isSync, RdmaHandle ctxHandle, uint64_t tpHandle, uint8_t dscp) |
| 264 | { | 264 | { |
| 265 | if (tpHandle == 0U || !ctxHandle) { | 265 | if (tpHandle == 0U || !ctxHandle) { |
| 266 | return HcclResult::HCCL_E_INTERNAL; | 266 | return HcclResult::HCCL_E_INTERNAL; |
| @@ -271,7 +271,7 @@ namespace { | |||
| 271 | HCCL_INFO( | 271 | HCCL_INFO( |
| 272 | "[TpManager][%s] tpHandle[%llu] dscp[%u] attrBitmap[0x%x].", __func__, tpHandle, | 272 | "[TpManager][%s] tpHandle[%llu] dscp[%u] attrBitmap[0x%x].", __func__, tpHandle, |
| 273 | static_cast<unsigned>(dscpAttr.dscp), kTpAttrBitmapDscp); | 273 | static_cast<unsigned>(dscpAttr.dscp), kTpAttrBitmapDscp); |
| 274 | - return SetTpAttrByPath(isSync, ctxHandle, tpHandle, kTpAttrBitmapDscp, dscpAttr, "CommitUbgDscpToTpAttr"); | 274 | + return SetTpAttrByPath(isSync, ctxHandle, tpHandle, kTpAttrBitmapDscp, dscpAttr, "CommitUbRtpDscpToTpAttr"); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | static HcclResult CommitTpAttrsAfterSlMapping( | 277 | static HcclResult CommitTpAttrsAfterSlMapping( |
| @@ -294,25 +294,25 @@ namespace { | |||
| 294 | static_cast<int>(isSync), param.locAddr.Describe().c_str()); | 294 | static_cast<int>(isSync), param.locAddr.Describe().c_str()); |
| 295 | return HcclResult::HCCL_E_INTERNAL; | 295 | return HcclResult::HCCL_E_INTERNAL; |
| 296 | } | 296 | } |
| 297 | - // TP / UBOE / UBG:将 TP QoS/SL 策略得到的 mapped SL 写回 TP;CTP 不向 TP 写 SL(与 Next TpMgr 一致) | 297 | + // TP / UBOE / UB_RTP:将 TP QoS/SL 策略得到的 mapped SL 写回 TP;CTP 不向 TP 写 SL(与 Next TpMgr 一致) |
| 298 | if (param.tpProtocol == TpProtocol::TP || param.tpProtocol == TpProtocol::UBOE | 298 | if (param.tpProtocol == TpProtocol::TP || param.tpProtocol == TpProtocol::UBOE |
| 299 | - || param.tpProtocol == TpProtocol::UBG) { | 299 | + || param.tpProtocol == TpProtocol::UB_RTP) { |
| 300 | CHK_RET(CommitMappedSlToTpAttr(isSync, ctxHandle, tpHandle, mappedSl)); | 300 | CHK_RET(CommitMappedSlToTpAttr(isSync, ctxHandle, tpHandle, mappedSl)); |
| 301 | } | 301 | } |
| 302 | - if (param.tpProtocol != TpProtocol::UBOE && param.tpProtocol != TpProtocol::UBG) { | 302 | + if (param.tpProtocol != TpProtocol::UBOE && param.tpProtocol != TpProtocol::UB_RTP) { |
| 303 | return HcclResult::HCCL_SUCCESS; | 303 | return HcclResult::HCCL_SUCCESS; |
| 304 | } | 304 | } |
| 305 | - if (param.tpProtocol == TpProtocol::UBG) { | 305 | + if (param.tpProtocol == TpProtocol::UB_RTP) { |
| 306 | - // UBG:仅当 dscp mode == 0 时下发 DSCP。 | 306 | + // UB_RTP:仅当 dscp mode == 0 时下发 DSCP。 |
| 307 | if (tpAttr.dscpConfigMode != 0) { | 307 | if (tpAttr.dscpConfigMode != 0) { |
| 308 | return HcclResult::HCCL_SUCCESS; | 308 | return HcclResult::HCCL_SUCCESS; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | uint8_t dscp = kUboeDefaultDscp; | 311 | uint8_t dscp = kUboeDefaultDscp; |
| 312 | (void)TpQosGetDscpByQosFromHccnCfg(devPhyId, param.qos, dscp); | 312 | (void)TpQosGetDscpByQosFromHccnCfg(devPhyId, param.qos, dscp); |
| 313 | - CHK_RET(CommitUbgDscpToTpAttr(isSync, ctxHandle, tpHandle, dscp)); | 313 | + CHK_RET(CommitUbRtpDscpToTpAttr(isSync, ctxHandle, tpHandle, dscp)); |
| 314 | HCCL_INFO( | 314 | HCCL_INFO( |
| 315 | - "[TpManager][%s] UBG dscp committed: tpHandle[%llu] dscpAfter[%u].", __func__, tpHandle, | 315 | + "[TpManager][%s] UB_RTP dscp committed: tpHandle[%llu] dscpAfter[%u].", __func__, tpHandle, |
| 316 | static_cast<unsigned>(dscp)); | 316 | static_cast<unsigned>(dscp)); |
| 317 | return HcclResult::HCCL_SUCCESS; | 317 | return HcclResult::HCCL_SUCCESS; |
| 318 | } | 318 | } |
| @@ -382,7 +382,7 @@ bool TpManager::CheckRequestResult(RequestHandle& reqHandle) const | |||
| 382 | HcclResult CheckTpProtocol(const TpProtocol tpProtocol) | 382 | HcclResult CheckTpProtocol(const TpProtocol tpProtocol) |
| 383 | { | 383 | { |
| 384 | if (tpProtocol != TpProtocol::CTP && tpProtocol != TpProtocol::TP && tpProtocol != TpProtocol::UBOE | 384 | if (tpProtocol != TpProtocol::CTP && tpProtocol != TpProtocol::TP && tpProtocol != TpProtocol::UBOE |
| 385 | - && tpProtocol != TpProtocol::UBG) { | 385 | + && tpProtocol != TpProtocol::UB_RTP) { |
| 386 | HCCL_WARNING("[TpManager][%s] failed, tpProtocol[%d] is not supported.", __func__, tpProtocol); | 386 | HCCL_WARNING("[TpManager][%s] failed, tpProtocol[%d] is not supported.", __func__, tpProtocol); |
| 387 | return HcclResult::HCCL_E_NOT_SUPPORT; | 387 | return HcclResult::HCCL_E_NOT_SUPPORT; |
| 388 | } | 388 | } |
| @@ -978,8 +978,8 @@ TpManager::InfoCtxMap& TpManager::GetInfoCtxMap(const TpProtocol tpProtocol) | |||
| 978 | return tpInfoMap; | 978 | return tpInfoMap; |
| 979 | case TpProtocol::UBOE: | 979 | case TpProtocol::UBOE: |
| 980 | return uboeInfoMap; | 980 | return uboeInfoMap; |
| 981 | - case TpProtocol::UBG: | 981 | + case TpProtocol::UB_RTP: |
| 982 | - return ubgInfoMap; | 982 | + return ubRtpInfoMap; |
| 983 | default: | 983 | default: |
| 984 | return tpInfoMap; | 984 | return tpInfoMap; |
| 985 | } | 985 | } |
| @@ -994,8 +994,8 @@ TpManager::ReqCtxMap& TpManager::GetReqCtxMap(const TpProtocol tpProtocol) | |||
| 994 | return tpReqMap; | 994 | return tpReqMap; |
| 995 | case TpProtocol::UBOE: | 995 | case TpProtocol::UBOE: |
| 996 | return uboeReqMap; | 996 | return uboeReqMap; |
| 997 | - case TpProtocol::UBG: | 997 | + case TpProtocol::UB_RTP: |
| 998 | - return ubgReqMap; | 998 | + return ubRtpReqMap; |
| 999 | default: | 999 | default: |
| 1000 | return tpReqMap; | 1000 | return tpReqMap; |
| 1001 | } | 1001 | } |
| @@ -1010,8 +1010,8 @@ std::mutex& TpManager::GetInfoCtxMutex(const TpProtocol tpProtocol) | |||
| 1010 | return tpInfoMutex; | 1010 | return tpInfoMutex; |
| 1011 | case TpProtocol::UBOE: | 1011 | case TpProtocol::UBOE: |
| 1012 | return uboeInfoMutex; | 1012 | return uboeInfoMutex; |
| 1013 | - case TpProtocol::UBG: | 1013 | + case TpProtocol::UB_RTP: |
| 1014 | - return ubgInfoMutex; | 1014 | + return ubRtpInfoMutex; |
| 1015 | default: | 1015 | default: |
| 1016 | return tpInfoMutex; | 1016 | return tpInfoMutex; |
| 1017 | } | 1017 | } |
| @@ -1026,8 +1026,8 @@ std::mutex& TpManager::GetReqCtxMutex(const TpProtocol tpProtocol) | |||
| 1026 | return tpReqMutex; | 1026 | return tpReqMutex; |
| 1027 | case TpProtocol::UBOE: | 1027 | case TpProtocol::UBOE: |
| 1028 | return uboeReqMutex; | 1028 | return uboeReqMutex; |
| 1029 | - case TpProtocol::UBG: | 1029 | + case TpProtocol::UB_RTP: |
| 1030 | - return ubgReqMutex; | 1030 | + return ubRtpReqMutex; |
| 1031 | default: | 1031 | default: |
| 1032 | return tpReqMutex; | 1032 | return tpReqMutex; |
| 1033 | } | 1033 | } |
| @@ -160,8 +160,8 @@ private: | |||
| 160 | InfoCtxMap uboeInfoMap; | 160 | InfoCtxMap uboeInfoMap; |
| 161 | ReqCtxMap uboeReqMap; | 161 | ReqCtxMap uboeReqMap; |
| 162 | 162 | ||
| 163 | - InfoCtxMap ubgInfoMap; | 163 | + InfoCtxMap ubRtpInfoMap; |
| 164 | - ReqCtxMap ubgReqMap; | 164 | + ReqCtxMap ubRtpReqMap; |
| 165 | 165 | ||
| 166 | TpAttrCtxMap tpAttrCtxMap; | 166 | TpAttrCtxMap tpAttrCtxMap; |
| 167 | TpAttrReqCtxMap tpAttrReqCtxMap; | 167 | TpAttrReqCtxMap tpAttrReqCtxMap; |
| @@ -175,8 +175,8 @@ private: | |||
| 175 | std::mutex uboeInfoMutex; | 175 | std::mutex uboeInfoMutex; |
| 176 | std::mutex uboeReqMutex; | 176 | std::mutex uboeReqMutex; |
| 177 | 177 | ||
| 178 | - std::mutex ubgInfoMutex; | 178 | + std::mutex ubRtpInfoMutex; |
| 179 | - std::mutex ubgReqMutex; | 179 | + std::mutex ubRtpReqMutex; |
| 180 | 180 | ||
| 181 | std::mutex tpAttrCtxMutex; | 181 | std::mutex tpAttrCtxMutex; |
| 182 | std::mutex tpAttrReqMutex; | 182 | std::mutex tpAttrReqMutex; |
| @@ -1834,7 +1834,7 @@ static HrtRaUbJettyImportedOutParam ImportJetty( | |||
| 1834 | info.in.ub.expImportCfg = cfg; | 1834 | info.in.ub.expImportCfg = cfg; |
| 1835 | 1835 | ||
| 1836 | if (protocol != TpProtocol::TP && protocol != TpProtocol::CTP && protocol != TpProtocol::UBOE | 1836 | if (protocol != TpProtocol::TP && protocol != TpProtocol::CTP && protocol != TpProtocol::UBOE |
| 1837 | - && protocol != TpProtocol::UBG) { | 1837 | + && protocol != TpProtocol::UB_RTP) { |
| 1838 | MACRO_THROW( | 1838 | MACRO_THROW( |
| 1839 | NetworkApiException, | 1839 | NetworkApiException, |
| 1840 | StringFormat("[%s] failed, tp protocol[%s] is not expected.", __func__, protocol.Describe().c_str())); | 1840 | StringFormat("[%s] failed, tp protocol[%s] is not expected.", __func__, protocol.Describe().c_str())); |
| @@ -2505,8 +2505,8 @@ RaUbGetTpInfoAsync(const RdmaHandle rdmaHandle, const RaUbGetTpInfoParam& param, | |||
| 2505 | const auto& tpProtocol = param.tpProtocol; | 2505 | const auto& tpProtocol = param.tpProtocol; |
| 2506 | 2506 | ||
| 2507 | struct GetTpCfg cfg {}; | 2507 | struct GetTpCfg cfg {}; |
| 2508 | - // UBG与TP同属RTP传输,需使能rtp位;UBOE走独立uboe位 | 2508 | + // UB_RTP与TP同属RTP传输,需使能rtp位;UBOE走独立uboe位 |
| 2509 | - cfg.flag.bs.rtp = (tpProtocol == TpProtocol::TP || tpProtocol == TpProtocol::UBG) ? 1 : 0; | 2509 | + cfg.flag.bs.rtp = (tpProtocol == TpProtocol::TP || tpProtocol == TpProtocol::UB_RTP) ? 1 : 0; |
| 2510 | cfg.flag.bs.ctp = tpProtocol == TpProtocol::CTP ? 1 : 0; | 2510 | cfg.flag.bs.ctp = tpProtocol == TpProtocol::CTP ? 1 : 0; |
| 2511 | cfg.flag.bs.uboe = (tpProtocol == TpProtocol::UBOE) ? 1 : 0; | 2511 | cfg.flag.bs.uboe = (tpProtocol == TpProtocol::UBOE) ? 1 : 0; |
| 2512 | cfg.transMode = TransportModeT::CONN_RM; // 当前只使用RM Jetty | 2512 | cfg.transMode = TransportModeT::CONN_RM; // 当前只使用RM Jetty |
| @@ -2546,8 +2546,8 @@ void RaUbGetTpInfo(const RdmaHandle rdmaHandle, const RaUbGetTpInfoParam& param, | |||
| 2546 | const auto& tpProtocol = param.tpProtocol; | 2546 | const auto& tpProtocol = param.tpProtocol; |
| 2547 | 2547 | ||
| 2548 | struct GetTpCfg cfg {}; | 2548 | struct GetTpCfg cfg {}; |
| 2549 | - // UBG与TP同属RTP传输,需使能rtp位;UBOE走独立uboe位 | 2549 | + // UB_RTP与TP同属RTP传输,需使能rtp位;UBOE走独立uboe位 |
| 2550 | - cfg.flag.bs.rtp = (tpProtocol == TpProtocol::TP || tpProtocol == TpProtocol::UBG) ? 1 : 0; | 2550 | + cfg.flag.bs.rtp = (tpProtocol == TpProtocol::TP || tpProtocol == TpProtocol::UB_RTP) ? 1 : 0; |
| 2551 | cfg.flag.bs.ctp = tpProtocol == TpProtocol::CTP ? 1 : 0; | 2551 | cfg.flag.bs.ctp = tpProtocol == TpProtocol::CTP ? 1 : 0; |
| 2552 | cfg.transMode = TransportModeT::CONN_RM; // 当前只使用RM Jetty | 2552 | cfg.transMode = TransportModeT::CONN_RM; // 当前只使用RM Jetty |
| 2553 | cfg.localEid = IpAddressToHccpEid(locAddr); | 2553 | cfg.localEid = IpAddressToHccpEid(locAddr); |
| @@ -2605,7 +2605,7 @@ static RequestHandle ImportJettyAsync( | |||
| 2605 | info->in.ub.expImportCfg = cfg; | 2605 | info->in.ub.expImportCfg = cfg; |
| 2606 | 2606 | ||
| 2607 | if (protocol != TpProtocol::TP && protocol != TpProtocol::CTP && protocol != TpProtocol::UBOE | 2607 | if (protocol != TpProtocol::TP && protocol != TpProtocol::CTP && protocol != TpProtocol::UBOE |
| 2608 | - && protocol != TpProtocol::UBG) { | 2608 | + && protocol != TpProtocol::UB_RTP) { |
| 2609 | MACRO_THROW( | 2609 | MACRO_THROW( |
| 2610 | NetworkApiException, | 2610 | NetworkApiException, |
| 2611 | StringFormat("[%s] failed, tp protocol[%s] is not expected, %s.", __func__, protocol.Describe().c_str())); | 2611 | StringFormat("[%s] failed, tp protocol[%s] is not expected, %s.", __func__, protocol.Describe().c_str())); |
| @@ -457,7 +457,7 @@ JfcHandle HrtRaUbCreateJfcUserCtl(RdmaHandle handle, CqCreateInfo& cqInfo); | |||
| 457 | void HrtRaUbDestroyJfc(RdmaHandle handle, JfcHandle jfcHandle); | 457 | void HrtRaUbDestroyJfc(RdmaHandle handle, JfcHandle jfcHandle); |
| 458 | 458 | ||
| 459 | MAKE_ENUM(HrtTransportMode, RM); | 459 | MAKE_ENUM(HrtTransportMode, RM); |
| 460 | -MAKE_ENUM(TpProtocol, CTP, TP, UBOE, UBG); | 460 | +MAKE_ENUM(TpProtocol, CTP, TP, UBOE, UB_RTP); |
| 461 | 461 | ||
| 462 | // STANDARD: URMA标准CreateJetty | 462 | // STANDARD: URMA标准CreateJetty |
| 463 | // HOST_OFFLOAD: HOST侧展开下沉算子,需要指定sqeBbNum | 463 | // HOST_OFFLOAD: HOST侧展开下沉算子,需要指定sqeBbNum |
| @@ -58,7 +58,7 @@ public: | |||
| 58 | } | 58 | } |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | - MAKE_ENUM(CcuConnectionType, UBC_TP, UBC_CTP); | 61 | + MAKE_ENUM(CcuConnectionType, UBC_TP, UB_CTP, UBC_CTP = UB_CTP); |
| 62 | struct CcuConnectionInfo { | 62 | struct CcuConnectionInfo { |
| 63 | CcuConnectionType type{CcuConnectionType::UBC_TP}; | 63 | CcuConnectionType type{CcuConnectionType::UBC_TP}; |
| 64 | IpAddress locAddr{}; | 64 | IpAddress locAddr{}; |
| @@ -30,7 +30,7 @@ HcclResult CcuCreateTransport( | |||
| 30 | ccuConnectionInfo.channelInfo.dieId, cclBufferInfo.addr, cclBufferInfo.size); | 30 | ccuConnectionInfo.channelInfo.dieId, cclBufferInfo.addr, cclBufferInfo.size); |
| 31 | TRY_CATCH_RETURN( | 31 | TRY_CATCH_RETURN( |
| 32 | std::unique_ptr<CcuConnection> ccuConnection; | 32 | std::unique_ptr<CcuConnection> ccuConnection; |
| 33 | - if (ccuConnectionInfo.type == CcuTransport::CcuConnectionType::UBC_CTP) { | 33 | + if (ccuConnectionInfo.type == CcuTransport::CcuConnectionType::UB_CTP) { |
| 34 | ccuConnection = std::make_unique<CcuCtpConnection>( | 34 | ccuConnection = std::make_unique<CcuCtpConnection>( |
| 35 | ccuConnectionInfo.locAddr, ccuConnectionInfo.rmtAddr, ccuConnectionInfo.channelInfo, | 35 | ccuConnectionInfo.locAddr, ccuConnectionInfo.rmtAddr, ccuConnectionInfo.channelInfo, |
| 36 | ccuConnectionInfo.ccuJettys); | 36 | ccuConnectionInfo.ccuJettys); |
| @@ -117,15 +117,15 @@ DevUbUboeConnection::DevUbUboeConnection( | |||
| 117 | jettyTimeOut = 16; // UBOE Jetty异步创建超时16秒 | 117 | jettyTimeOut = 16; // UBOE Jetty异步创建超时16秒 |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | -DevUbUbgConnection::DevUbUbgConnection( | 120 | +DevUbRtpConnection::DevUbRtpConnection( |
| 121 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, | 121 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, |
| 122 | const bool devUsed, const HrtUbJfcMode jfcMode, const IpAddress& locAddrEid, const IpAddress& rmtAddrEid, u8 qos, | 122 | const bool devUsed, const HrtUbJfcMode jfcMode, const IpAddress& locAddrEid, const IpAddress& rmtAddrEid, u8 qos, |
| 123 | CommEngine engine, u32 sqDepth) | 123 | CommEngine engine, u32 sqDepth) |
| 124 | : DevUbConnection( | 124 | : DevUbConnection( |
| 125 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddrEid, rmtAddrEid, qos, engine, sqDepth) | 125 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddrEid, rmtAddrEid, qos, engine, sqDepth) |
| 126 | { | 126 | { |
| 127 | - tpProtocol = TpProtocol::UBG; | 127 | + tpProtocol = TpProtocol::UB_RTP; |
| 128 | - // UBG与UBOE同属UB传输,Jetty异步创建超时一致,均为16秒 | 128 | + // UB_RTP与UBOE同属UB传输,Jetty异步创建超时一致,均为16秒 |
| 129 | jettyTimeOut = 16; | 129 | jettyTimeOut = 16; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| @@ -238,10 +238,10 @@ void DevUbConnection::GetTimeOut() // 直接基于环境变量控制 | |||
| 238 | return; | 238 | return; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | - if (tpProtocol == TpProtocol::UBOE || tpProtocol == TpProtocol::UBG) { | 241 | + if (tpProtocol == TpProtocol::UBOE || tpProtocol == TpProtocol::UB_RTP) { |
| 242 | envValue = static_cast<uint8_t>(EnvConfig::GetInstance().GetRdmaConfig().GetUboeTimeOut()); | 242 | envValue = static_cast<uint8_t>(EnvConfig::GetInstance().GetRdmaConfig().GetUboeTimeOut()); |
| 243 | envTimeOut = TpManager::TaHwValueToMs(envValue); | 243 | envTimeOut = TpManager::TaHwValueToMs(envValue); |
| 244 | - const char* tag = (tpProtocol == TpProtocol::UBG) ? "[UBG]" : "[UBoE]"; | 244 | + const char* tag = (tpProtocol == TpProtocol::UB_RTP) ? "[UB_RTP]" : "[UBoE]"; |
| 245 | HCCL_INFO("%s %s Env Value [%u] (%ums).", __func__, tag, envValue, envTimeOut); | 245 | HCCL_INFO("%s %s Env Value [%u] (%ums).", __func__, tag, envValue, envTimeOut); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| @@ -615,7 +615,7 @@ void DevUbConnection::ImportJetty() | |||
| 615 | in.jettyImportCfg.protocol = tpProtocol; | 615 | in.jettyImportCfg.protocol = tpProtocol; |
| 616 | 616 | ||
| 617 | if (tpProtocol != TpProtocol::CTP && tpProtocol != TpProtocol::TP && tpProtocol != TpProtocol::UBOE | 617 | if (tpProtocol != TpProtocol::CTP && tpProtocol != TpProtocol::TP && tpProtocol != TpProtocol::UBOE |
| 618 | - && tpProtocol != TpProtocol::UBG) { | 618 | + && tpProtocol != TpProtocol::UB_RTP) { |
| 619 | HCCL_ERROR( | 619 | HCCL_ERROR( |
| 620 | "[DevUbConnection][%s] failed, tp protocol[%s] is not expected, %s.", __func__, | 620 | "[DevUbConnection][%s] failed, tp protocol[%s] is not expected, %s.", __func__, |
| 621 | tpProtocol.Describe().c_str(), Describe().c_str()); | 621 | tpProtocol.Describe().c_str(), Describe().c_str()); |
| @@ -280,9 +280,9 @@ public: | |||
| 280 | u8 qos = static_cast<u8>(UB_QOS_DEFAULT), CommEngine engine = COMM_ENGINE_RESERVED); | 280 | u8 qos = static_cast<u8>(UB_QOS_DEFAULT), CommEngine engine = COMM_ENGINE_RESERVED); |
| 281 | }; | 281 | }; |
| 282 | 282 | ||
| 283 | -class DevUbUbgConnection : public DevUbConnection { | 283 | +class DevUbRtpConnection : public DevUbConnection { |
| 284 | public: | 284 | public: |
| 285 | - DevUbUbgConnection( | 285 | + DevUbRtpConnection( |
| 286 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, | 286 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, |
| 287 | const bool devUsed = false, const HrtUbJfcMode jfcMode = HrtUbJfcMode::STARS_POLL, | 287 | const bool devUsed = false, const HrtUbJfcMode jfcMode = HrtUbJfcMode::STARS_POLL, |
| 288 | const IpAddress& locAddrEid = IpAddress(), const IpAddress& rmtAddrEid = IpAddress(), | 288 | const IpAddress& locAddrEid = IpAddress(), const IpAddress& rmtAddrEid = IpAddress(), |
| @@ -33,9 +33,9 @@ static Hccl::LinkProtoType ConvertHcclProtoToLinkProto(HcclProtoType hcclProto) | |||
| 33 | case HCCL_PROTO_TYPE_ROCE: | 33 | case HCCL_PROTO_TYPE_ROCE: |
| 34 | // RoCE(基于RDMA的以太网协议)-> RDMA | 34 | // RoCE(基于RDMA的以太网协议)-> RDMA |
| 35 | return Hccl::LinkProtoType::RDMA; | 35 | return Hccl::LinkProtoType::RDMA; |
| 36 | - case HCCL_PROTO_TYPE_UBC_CTP: | 36 | + case HCCL_PROTO_TYPE_UB_CTP: |
| 37 | case HCCL_PROTO_TYPE_UBC_TP: | 37 | case HCCL_PROTO_TYPE_UBC_TP: |
| 38 | - case HCCL_PROTO_TYPE_UBG_TP: | 38 | + case HCCL_PROTO_TYPE_UB_RTP: |
| 39 | // 华为统一总线系列协议 -> UB | 39 | // 华为统一总线系列协议 -> UB |
| 40 | return Hccl::LinkProtoType::UB; | 40 | return Hccl::LinkProtoType::UB; |
| 41 | case HCCL_PROTO_TYPE_RESERVED: | 41 | case HCCL_PROTO_TYPE_RESERVED: |
| @@ -328,8 +328,8 @@ struct FileHeader { | |||
| 328 | | 1 | ROCE | RDMA over Converged Ethernet | | 328 | | 1 | ROCE | RDMA over Converged Ethernet | |
| 329 | | 2 | PCIE | PCIe 通信 | | 329 | | 2 | PCIE | PCIe 通信 | |
| 330 | | 3 | SIO | Socket I/O | | 330 | | 3 | SIO | Socket I/O | |
| 331 | -| 4 | UBC_CTP | UBC CTP 协议 | | 331 | +| 4 | UB_CTP | UB CTP 协议 | |
| 332 | -| 5 | UBC_TP | UBC TP 协议 | | 332 | +| 5 | UBC_TP | UBC TP 协议(历史兼容值,不建议新开发使用) | |
| 333 | | 6 | UB_MEM | UB 内存协议 | | 333 | | 6 | UB_MEM | UB 内存协议 | |
| 334 | 334 | ||
| 335 | ### 6.3 缓冲区类型 (BufferType) | 335 | ### 6.3 缓冲区类型 (BufferType) |
| @@ -67,7 +67,7 @@ enum ProtocolType { | |||
| 67 | SIM_PROTOCOL_ROCE = 1, | 67 | SIM_PROTOCOL_ROCE = 1, |
| 68 | SIM_PROTOCOL_PCIE = 2, | 68 | SIM_PROTOCOL_PCIE = 2, |
| 69 | SIM_PROTOCOL_SIO = 3, | 69 | SIM_PROTOCOL_SIO = 3, |
| 70 | - SIM_PROTOCOL_UBC_CTP = 4, | 70 | + SIM_PROTOCOL_UB_CTP = 4, |
| 71 | SIM_PROTOCOL_UBC_TP = 5, | 71 | SIM_PROTOCOL_UBC_TP = 5, |
| 72 | SIM_PROTOCOL_UB_MEM = 6 | 72 | SIM_PROTOCOL_UB_MEM = 6 |
| 73 | }; | 73 | }; |
| @@ -58,7 +58,7 @@ public: | |||
| 58 | } | 58 | } |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | - MAKE_ENUM(CcuConnectionType, UBC_TP, UBC_CTP); | 61 | + MAKE_ENUM(CcuConnectionType, UBC_TP, UB_CTP, UBC_CTP = UB_CTP); |
| 62 | struct CcuConnectionInfo { | 62 | struct CcuConnectionInfo { |
| 63 | CcuConnectionType type{CcuConnectionType::UBC_TP}; | 63 | CcuConnectionType type{CcuConnectionType::UBC_TP}; |
| 64 | IpAddress locAddr{}; | 64 | IpAddress locAddr{}; |
| @@ -54,7 +54,7 @@ HcclResult CcuTransportMgr::PrepareCreate(const LinkData& link, CcuTransport*& t | |||
| 54 | const auto& locAddr = link.GetLocalAddr(); | 54 | const auto& locAddr = link.GetLocalAddr(); |
| 55 | const auto& rmtAddr = link.GetRemoteAddr(); | 55 | const auto& rmtAddr = link.GetRemoteAddr(); |
| 56 | CcuTransport::CcuConnectionType type = link.GetLinkProtocol() == LinkProtocol::UB_CTP ? | 56 | CcuTransport::CcuConnectionType type = link.GetLinkProtocol() == LinkProtocol::UB_CTP ? |
| 57 | - CcuTransport::CcuConnectionType::UBC_CTP : | 57 | + CcuTransport::CcuConnectionType::UB_CTP : |
| 58 | CcuTransport::CcuConnectionType::UBC_TP; | 58 | CcuTransport::CcuConnectionType::UBC_TP; |
| 59 | CcuTransport::CcuConnectionInfo connectionInfo{type, locAddr, rmtAddr, channelInfo, ccuJettys}; | 59 | CcuTransport::CcuConnectionInfo connectionInfo{type, locAddr, rmtAddr, channelInfo, ccuJettys}; |
| 60 | 60 | ||
| @@ -56,7 +56,7 @@ TEST(EID, test_eid_decode) | |||
| 56 | EXPECT_EQ(die2, 3); | 56 | EXPECT_EQ(die2, 3); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | -TEST(EID, test_uboe_ubg) | 59 | +TEST(EID, test_uboe_ub_rtp) |
| 60 | { | 60 | { |
| 61 | dcmi_urma_eid_t eid1; | 61 | dcmi_urma_eid_t eid1; |
| 62 | dcmi_urma_eid_t eid2; | 62 | dcmi_urma_eid_t eid2; |
| @@ -66,11 +66,11 @@ TEST(EID, test_uboe_ubg) | |||
| 66 | hex32_to_bin16("0000000000ff0ac0001000000a140200", eid2.raw); | 66 | hex32_to_bin16("0000000000ff0ac0001000000a140200", eid2.raw); |
| 67 | hex32_to_bin16("0000000000ff0a80001000000a140200", eid3.raw); | 67 | hex32_to_bin16("0000000000ff0a80001000000a140200", eid3.raw); |
| 68 | EXPECT_EQ(UrmaEidIsUBOE(&eid1), 0); | 68 | EXPECT_EQ(UrmaEidIsUBOE(&eid1), 0); |
| 69 | - EXPECT_EQ(UrmaEidIsUBG(&eid1), 0); | 69 | + EXPECT_EQ(UrmaEidIsUbRtp(&eid1), 0); |
| 70 | EXPECT_EQ(UrmaEidIsUBOE(&eid2), 1); | 70 | EXPECT_EQ(UrmaEidIsUBOE(&eid2), 1); |
| 71 | - EXPECT_EQ(UrmaEidIsUBG(&eid2), 0); | 71 | + EXPECT_EQ(UrmaEidIsUbRtp(&eid2), 0); |
| 72 | EXPECT_EQ(UrmaEidIsUBOE(&eid3), 0); | 72 | EXPECT_EQ(UrmaEidIsUBOE(&eid3), 0); |
| 73 | - EXPECT_EQ(UrmaEidIsUBG(&eid3), 1); | 73 | + EXPECT_EQ(UrmaEidIsUbRtp(&eid3), 1); |
| 74 | 74 | ||
| 75 | UrmaEid2CNA(&eid2, ipaddr, sizeof(ipaddr)); | 75 | UrmaEid2CNA(&eid2, ipaddr, sizeof(ipaddr)); |
| 76 | EXPECT_STREQ(ipaddr, "10.10.20.2"); | 76 | EXPECT_STREQ(ipaddr, "10.10.20.2"); |
| @@ -993,7 +993,7 @@ TEST_F(DevUbConnectionTest, Ut_ImportRmtDto) | |||
| 993 | GlobalMockObject::verify(); | 993 | GlobalMockObject::verify(); |
| 994 | } | 994 | } |
| 995 | 995 | ||
| 996 | -TEST_F(DevUbConnectionTest, Ut_UbgConnection_Constructor_SetsTpProtocolAndQos) | 996 | +TEST_F(DevUbConnectionTest, Ut_UbRtpConnection_Constructor_SetsTpProtocolAndQos) |
| 997 | { | 997 | { |
| 998 | constexpr u32 expectedSqDepth = 512U; | 998 | constexpr u32 expectedSqDepth = 512U; |
| 999 | RdmaHandle rdmaHandle = (void*)0x1000000; | 999 | RdmaHandle rdmaHandle = (void*)0x1000000; |
| @@ -1003,14 +1003,14 @@ TEST_F(DevUbConnectionTest, Ut_UbgConnection_Constructor_SetsTpProtocolAndQos) | |||
| 1003 | Hccl::IpAddress rmtIpv4Addr("10.0.0.2"); | 1003 | Hccl::IpAddress rmtIpv4Addr("10.0.0.2"); |
| 1004 | constexpr u8 qos = 6U; | 1004 | constexpr u8 qos = 6U; |
| 1005 | 1005 | ||
| 1006 | - DevUbUbgConnection ubgConn( | 1006 | + DevUbRtpConnection ubRtpConn( |
| 1007 | rdmaHandle, linkData.GetLocalAddr(), linkData.GetRemoteAddr(), OpMode::OPBASE, true, HrtUbJfcMode::STARS_POLL, | 1007 | rdmaHandle, linkData.GetLocalAddr(), linkData.GetRemoteAddr(), OpMode::OPBASE, true, HrtUbJfcMode::STARS_POLL, |
| 1008 | locIpv4Addr, rmtIpv4Addr, qos, COMM_ENGINE_RESERVED, expectedSqDepth); | 1008 | locIpv4Addr, rmtIpv4Addr, qos, COMM_ENGINE_RESERVED, expectedSqDepth); |
| 1009 | 1009 | ||
| 1010 | - EXPECT_EQ(ubgConn.tpProtocol, TpProtocol::UBG); | 1010 | + EXPECT_EQ(ubRtpConn.tpProtocol, TpProtocol::UB_RTP); |
| 1011 | - EXPECT_EQ(ubgConn.jettyTimeOut, 16); | 1011 | + EXPECT_EQ(ubRtpConn.jettyTimeOut, 16); |
| 1012 | - EXPECT_EQ(ubgConn.qos_, qos); | 1012 | + EXPECT_EQ(ubRtpConn.qos_, qos); |
| 1013 | - EXPECT_EQ(ubgConn.GetSqDepth(), expectedSqDepth); | 1013 | + EXPECT_EQ(ubRtpConn.GetSqDepth(), expectedSqDepth); |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | static HcclResult StubGetTpInfoWithMappedQos(TpManager*, const RaUbGetTpInfoParam&, TpInfo& tpInfo, bool) | 1016 | static HcclResult StubGetTpInfoWithMappedQos(TpManager*, const RaUbGetTpInfoParam&, TpInfo& tpInfo, bool) |
| @@ -104,7 +104,7 @@ TEST(ExperimentalNicPluginContract, PluginInfoUsesCpuNamesAndExpectedProtocols) | |||
| 104 | ExpectContains(ubPlugin, "\"hcomm_cpu_ub\""); | 104 | ExpectContains(ubPlugin, "\"hcomm_cpu_ub\""); |
| 105 | ExpectContains(ubPlugin, "2U"); | 105 | ExpectContains(ubPlugin, "2U"); |
| 106 | ExpectContains( | 106 | ExpectContains( |
| 107 | - ubPlugin, "{COMM_PROTOCOL_UBC_TP, COMM_PROTOCOL_UBC_CTP, COMM_PROTOCOL_RESERVED, COMM_PROTOCOL_RESERVED}"); | 107 | + ubPlugin, "{COMM_PROTOCOL_UBC_TP, COMM_PROTOCOL_UB_CTP, COMM_PROTOCOL_RESERVED, COMM_PROTOCOL_RESERVED}"); |
| 108 | ExpectNotContains(ubPlugin, std::string("\"") + RetiredHostName("ub") + "\""); | 108 | ExpectNotContains(ubPlugin, std::string("\"") + RetiredHostName("ub") + "\""); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| @@ -38,7 +38,7 @@ set(src_to_test_list | |||
| 38 | comms/api_c_adpt/ut_hcomm_res_mgr_test.cc | 38 | comms/api_c_adpt/ut_hcomm_res_mgr_test.cc |
| 39 | comms/api_c_adpt/ut_hcomm_endpoint_test.cc | 39 | comms/api_c_adpt/ut_hcomm_endpoint_test.cc |
| 40 | comms/api_c_adpt/ut_hcomm_endpoint_uboe_test.cc | 40 | comms/api_c_adpt/ut_hcomm_endpoint_uboe_test.cc |
| 41 | - comms/api_c_adpt/ut_hcomm_endpoint_ubg_test.cc | 41 | + comms/api_c_adpt/ut_hcomm_endpoint_ub_rtp_test.cc |
| 42 | comms/api_c_adpt/ut_hcomm_mem_test.cc | 42 | comms/api_c_adpt/ut_hcomm_mem_test.cc |
| 43 | comms/api_c_adpt/ut_hcomm_channel_test.cc | 43 | comms/api_c_adpt/ut_hcomm_channel_test.cc |
| 44 | comms/api_c_adpt/ut_hcomm_engine_ctx_test.cc | 44 | comms/api_c_adpt/ut_hcomm_engine_ctx_test.cc |
| @@ -72,7 +72,7 @@ set(src_to_test_list | |||
| 72 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_urma_channel.cc | 72 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_urma_channel.cc |
| 73 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_p2p_channel.cc | 73 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_p2p_channel.cc |
| 74 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_uboe_channel.cc | 74 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_uboe_channel.cc |
| 75 | - comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_ubg_channel.cc | 75 | + comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_ub_rtp_channel.cc |
| 76 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_roce_channel.cc | 76 | comms/endpoint_pairs/channels/aicpu/ut_aicpu_ts_roce_channel.cc |
| 77 | comms/endpoint_pairs/channels/aicpu/device/ut_aicpu_channel_process.cc | 77 | comms/endpoint_pairs/channels/aicpu/device/ut_aicpu_channel_process.cc |
| 78 | comms/endpoints/ut_urma_endpoint.cc | 78 | comms/endpoints/ut_urma_endpoint.cc |
| @@ -365,7 +365,7 @@ TEST_F(HcclChannelDescTest, Ut_ProcessUbChannelDesc_When_UbcCtp_QosUnset_UsesCom | |||
| 365 | HcclChannelDesc out{}; | 365 | HcclChannelDesc out{}; |
| 366 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); | 366 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); |
| 367 | ASSERT_EQ(HcclChannelDescInit(&out, 1), HCCL_SUCCESS); | 367 | ASSERT_EQ(HcclChannelDescInit(&out, 1), HCCL_SUCCESS); |
| 368 | - in.channelProtocol = COMM_PROTOCOL_UBC_CTP; | 368 | + in.channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 369 | ret = ProcessUbChannelDesc(in, out, hcclCommPtr.get()); | 369 | ret = ProcessUbChannelDesc(in, out, hcclCommPtr.get()); |
| 370 | EXPECT_EQ(ret, HCCL_SUCCESS); | 370 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 371 | } | 371 | } |
| @@ -393,7 +393,7 @@ TEST_F(HcclChannelDescTest, Ut_ProcessUbChannelDesc_When_UbcCtp_Valid_Expect_Suc | |||
| 393 | HcclChannelDesc out{}; | 393 | HcclChannelDesc out{}; |
| 394 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); | 394 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); |
| 395 | ASSERT_EQ(HcclChannelDescInit(&out, 1), HCCL_SUCCESS); | 395 | ASSERT_EQ(HcclChannelDescInit(&out, 1), HCCL_SUCCESS); |
| 396 | - in.channelProtocol = COMM_PROTOCOL_UBC_CTP; | 396 | + in.channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 397 | ret = ProcessUbChannelDesc(in, out, hcclCommPtr.get()); | 397 | ret = ProcessUbChannelDesc(in, out, hcclCommPtr.get()); |
| 398 | EXPECT_EQ(ret, HCCL_SUCCESS); | 398 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 399 | } | 399 | } |
| @@ -501,12 +501,12 @@ TEST_F(HcclChannelDescTest, Ut_HcclChannelAcquire_When_CpuUrma_NotAppendSymmetri | |||
| 501 | EXPECT_EQ(ret, HCCL_SUCCESS); | 501 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 502 | } | 502 | } |
| 503 | 503 | ||
| 504 | -TEST_F(HcclChannelDescTest, Ut_HcclChannelAcquire_When_AivUbg_ConvertsHostHandleToDeviceEntity) | 504 | +TEST_F(HcclChannelDescTest, Ut_HcclChannelAcquire_When_AivUbRtp_ConvertsHostHandleToDeviceEntity) |
| 505 | { | 505 | { |
| 506 | HcclChannelDesc channelDesc{}; | 506 | HcclChannelDesc channelDesc{}; |
| 507 | ASSERT_EQ(HcclChannelDescInit(&channelDesc, 1), HCCL_SUCCESS); | 507 | ASSERT_EQ(HcclChannelDescInit(&channelDesc, 1), HCCL_SUCCESS); |
| 508 | channelDesc.remoteRank = 2; | 508 | channelDesc.remoteRank = 2; |
| 509 | - channelDesc.channelProtocol = COMM_PROTOCOL_UBG; | 509 | + channelDesc.channelProtocol = COMM_PROTOCOL_UB_RTP; |
| 510 | 510 | ||
| 511 | hcomm::AivUrmaChannel channel(reinterpret_cast<EndpointHandle>(0x1), HcommChannelDesc{}); | 511 | hcomm::AivUrmaChannel channel(reinterpret_cast<EndpointHandle>(0x1), HcommChannelDesc{}); |
| 512 | g_testChannel = reinterpret_cast<ChannelHandle>(&channel); | 512 | g_testChannel = reinterpret_cast<ChannelHandle>(&channel); |
| @@ -401,22 +401,22 @@ TEST_F(MyRankTest, St_BatchCreateChannels_When_Resource_fallback_Expect_Return_H | |||
| 401 | EXPECT_EQ(myRank->Init(cclBuffer, 5, 2), HCCL_SUCCESS); | 401 | EXPECT_EQ(myRank->Init(cclBuffer, 5, 2), HCCL_SUCCESS); |
| 402 | 402 | ||
| 403 | EndpointDesc localEp; | 403 | EndpointDesc localEp; |
| 404 | - CreateEndpointDesc(localEp, COMM_PROTOCOL_UBC_CTP, "1.0.0.0"); | 404 | + CreateEndpointDesc(localEp, COMM_PROTOCOL_UB_CTP, "1.0.0.0"); |
| 405 | EndpointDesc rmtEp1; | 405 | EndpointDesc rmtEp1; |
| 406 | - CreateEndpointDesc(rmtEp1, COMM_PROTOCOL_UBC_CTP, "2.0.0.0"); | 406 | + CreateEndpointDesc(rmtEp1, COMM_PROTOCOL_UB_CTP, "2.0.0.0"); |
| 407 | EndpointDesc rmtEp2; | 407 | EndpointDesc rmtEp2; |
| 408 | - CreateEndpointDesc(rmtEp2, COMM_PROTOCOL_UBC_CTP, "3.0.0.0"); | 408 | + CreateEndpointDesc(rmtEp2, COMM_PROTOCOL_UB_CTP, "3.0.0.0"); |
| 409 | 409 | ||
| 410 | HcclChannelDesc channelDesc[5]{}; | 410 | HcclChannelDesc channelDesc[5]{}; |
| 411 | for (int i = 0; i < 2; i++) { | 411 | for (int i = 0; i < 2; i++) { |
| 412 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 412 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 413 | channelDesc[i].remoteRank = 1; | 413 | channelDesc[i].remoteRank = 1; |
| 414 | channelDesc[i].notifyNum = 2; | 414 | channelDesc[i].notifyNum = 2; |
| 415 | channelDesc[i].localEndpoint = localEp; | 415 | channelDesc[i].localEndpoint = localEp; |
| 416 | channelDesc[i].remoteEndpoint = rmtEp1; | 416 | channelDesc[i].remoteEndpoint = rmtEp1; |
| 417 | } | 417 | } |
| 418 | for (int i = 2; i < 5; i++) { | 418 | for (int i = 2; i < 5; i++) { |
| 419 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 419 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 420 | channelDesc[i].remoteRank = 2; | 420 | channelDesc[i].remoteRank = 2; |
| 421 | channelDesc[i].notifyNum = 2; | 421 | channelDesc[i].notifyNum = 2; |
| 422 | channelDesc[i].localEndpoint = localEp; | 422 | channelDesc[i].localEndpoint = localEp; |
| @@ -486,22 +486,22 @@ TEST_F(MyRankTest, St_BatchCreateChannels_Multi_Times_When_fallback_Expect_Retur | |||
| 486 | EXPECT_EQ(myRank->Init(cclBuffer, 5, 2), HCCL_SUCCESS); | 486 | EXPECT_EQ(myRank->Init(cclBuffer, 5, 2), HCCL_SUCCESS); |
| 487 | 487 | ||
| 488 | EndpointDesc localEp; | 488 | EndpointDesc localEp; |
| 489 | - CreateEndpointDesc(localEp, COMM_PROTOCOL_UBC_CTP, "1.0.0.0"); | 489 | + CreateEndpointDesc(localEp, COMM_PROTOCOL_UB_CTP, "1.0.0.0"); |
| 490 | EndpointDesc rmtEp1; | 490 | EndpointDesc rmtEp1; |
| 491 | - CreateEndpointDesc(rmtEp1, COMM_PROTOCOL_UBC_CTP, "2.0.0.0"); | 491 | + CreateEndpointDesc(rmtEp1, COMM_PROTOCOL_UB_CTP, "2.0.0.0"); |
| 492 | EndpointDesc rmtEp2; | 492 | EndpointDesc rmtEp2; |
| 493 | - CreateEndpointDesc(rmtEp2, COMM_PROTOCOL_UBC_CTP, "3.0.0.0"); | 493 | + CreateEndpointDesc(rmtEp2, COMM_PROTOCOL_UB_CTP, "3.0.0.0"); |
| 494 | 494 | ||
| 495 | HcclChannelDesc channelDesc[5]{}; | 495 | HcclChannelDesc channelDesc[5]{}; |
| 496 | for (int i = 0; i < 2; i++) { | 496 | for (int i = 0; i < 2; i++) { |
| 497 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 497 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 498 | channelDesc[i].remoteRank = 1; | 498 | channelDesc[i].remoteRank = 1; |
| 499 | channelDesc[i].notifyNum = 2; | 499 | channelDesc[i].notifyNum = 2; |
| 500 | channelDesc[i].localEndpoint = localEp; | 500 | channelDesc[i].localEndpoint = localEp; |
| 501 | channelDesc[i].remoteEndpoint = rmtEp1; | 501 | channelDesc[i].remoteEndpoint = rmtEp1; |
| 502 | } | 502 | } |
| 503 | for (int i = 2; i < 5; i++) { | 503 | for (int i = 2; i < 5; i++) { |
| 504 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 504 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 505 | channelDesc[i].remoteRank = 2; | 505 | channelDesc[i].remoteRank = 2; |
| 506 | channelDesc[i].notifyNum = 2; | 506 | channelDesc[i].notifyNum = 2; |
| 507 | channelDesc[i].localEndpoint = localEp; | 507 | channelDesc[i].localEndpoint = localEp; |
| @@ -695,7 +695,7 @@ TEST_F(MyRankTest, Ut_ChannelDescHccl2Hcomm_When_UbcCtp_Sets_CommDomainQos_FromC | |||
| 695 | ASSERT_EQ(commConfig.SetConfigHcclQos(5u), HCCL_SUCCESS); | 695 | ASSERT_EQ(commConfig.SetConfigHcclQos(5u), HCCL_SUCCESS); |
| 696 | HcclChannelDesc in{}; | 696 | HcclChannelDesc in{}; |
| 697 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); | 697 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); |
| 698 | - in.channelProtocol = COMM_PROTOCOL_UBC_CTP; | 698 | + in.channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 699 | HcommChannelDesc out = MyRankUtils::ChannelDescHccl2Hcomm(in, commConfig); | 699 | HcommChannelDesc out = MyRankUtils::ChannelDescHccl2Hcomm(in, commConfig); |
| 700 | EXPECT_EQ(out.qos, 5u); | 700 | EXPECT_EQ(out.qos, 5u); |
| 701 | } | 701 | } |
| @@ -780,7 +780,7 @@ TEST_F(MyRankTest, Ut_ChannelDescHccl2Hcomm_When_UbcCtp_DoesNotSetPathMode) | |||
| 780 | ASSERT_EQ(commConfig.SetConfigHcclQos(5u), HCCL_SUCCESS); | 780 | ASSERT_EQ(commConfig.SetConfigHcclQos(5u), HCCL_SUCCESS); |
| 781 | HcclChannelDesc in{}; | 781 | HcclChannelDesc in{}; |
| 782 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); | 782 | ASSERT_EQ(HcclChannelDescInit(&in, 1), HCCL_SUCCESS); |
| 783 | - in.channelProtocol = COMM_PROTOCOL_UBC_CTP; | 783 | + in.channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 784 | in.ubMemAttr.pathMode = 2u; | 784 | in.ubMemAttr.pathMode = 2u; |
| 785 | HcommChannelDesc out = MyRankUtils::ChannelDescHccl2Hcomm(in, commConfig); | 785 | HcommChannelDesc out = MyRankUtils::ChannelDescHccl2Hcomm(in, commConfig); |
| 786 | EXPECT_EQ(out.qos, 5u); | 786 | EXPECT_EQ(out.qos, 5u); |
| @@ -819,8 +819,8 @@ TEST_F(MyRankTest, Ut_ConfigSqDepthByExpansionMode_When_EngineAndProtocolVary_Ex | |||
| 819 | 819 | ||
| 820 | const TestCase testCases[] = { | 820 | const TestCase testCases[] = { |
| 821 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBC_TP, 128U, 64U, 128U}, | 821 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBC_TP, 128U, 64U, 128U}, |
| 822 | - {COMM_ENGINE_AIV, COMM_PROTOCOL_UBC_CTP, 128U, 64U, 128U}, | 822 | + {COMM_ENGINE_AIV, COMM_PROTOCOL_UB_CTP, 128U, 64U, 128U}, |
| 823 | - {COMM_ENGINE_AIV, COMM_PROTOCOL_UBG, 128U, 64U, 128U}, | 823 | + {COMM_ENGINE_AIV, COMM_PROTOCOL_UB_RTP, 128U, 64U, 128U}, |
| 824 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBC_TP, HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET, HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET, | 824 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBC_TP, HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET, HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET, |
| 825 | HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET}, | 825 | HCCL_COMM_SQ_DEPTH_CONFIG_NOT_SET}, |
| 826 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBOE, 128U, 64U, 64U}, | 826 | {COMM_ENGINE_AIV, COMM_PROTOCOL_UBOE, 128U, 64U, 64U}, |
| @@ -1031,14 +1031,14 @@ TEST_F(MyRankTest, Ut_BatchCreateChannels_HcommDescsEquivalence) | |||
| 1031 | 1031 | ||
| 1032 | HcclChannelDesc channelDesc[4]{}; | 1032 | HcclChannelDesc channelDesc[4]{}; |
| 1033 | for (int i = 0; i < 2; i++) { | 1033 | for (int i = 0; i < 2; i++) { |
| 1034 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 1034 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 1035 | channelDesc[i].remoteRank = 1; | 1035 | channelDesc[i].remoteRank = 1; |
| 1036 | channelDesc[i].notifyNum = 2; | 1036 | channelDesc[i].notifyNum = 2; |
| 1037 | channelDesc[i].localEndpoint = epA; | 1037 | channelDesc[i].localEndpoint = epA; |
| 1038 | channelDesc[i].remoteEndpoint = rmtEp; | 1038 | channelDesc[i].remoteEndpoint = rmtEp; |
| 1039 | } | 1039 | } |
| 1040 | for (int i = 2; i < 4; i++) { | 1040 | for (int i = 2; i < 4; i++) { |
| 1041 | - channelDesc[i].channelProtocol = COMM_PROTOCOL_UBC_CTP; | 1041 | + channelDesc[i].channelProtocol = COMM_PROTOCOL_UB_CTP; |
| 1042 | channelDesc[i].remoteRank = 2; | 1042 | channelDesc[i].remoteRank = 2; |
| 1043 | channelDesc[i].notifyNum = 2; | 1043 | channelDesc[i].notifyNum = 2; |
| 1044 | channelDesc[i].localEndpoint = epB; | 1044 | channelDesc[i].localEndpoint = epB; |
| @@ -71,6 +71,14 @@ TEST_F(EdgeParserTest, Ut_Deserialize_When_Normal_Expect_Success) | |||
| 71 | EXPECT_EQ(edgeInfo.Describe(), edge0.Describe()); | 71 | EXPECT_EQ(edgeInfo.Describe(), edge0.Describe()); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | +// UB_RTP新名称与UBG旧名称兼容 | ||
| 75 | +TEST_F(EdgeParserTest, Ut_GetLinkProtocol_When_NewAndLegacyProtocol_Expect_UbRtp) | ||
| 76 | +{ | ||
| 77 | + EdgeInfo edgeInfo; | ||
| 78 | + EXPECT_EQ(edgeInfo.GetLinkProtocol("UBG"), LinkProtocol::UB_RTP); | ||
| 79 | + EXPECT_EQ(edgeInfo.GetLinkProtocol("UB_RTP"), LinkProtocol::UB_RTP); | ||
| 80 | +} | ||
| 81 | + | ||
| 74 | // 功能用例,缺省 | 82 | // 功能用例,缺省 |
| 75 | TEST_F(EdgeParserTest, Ut_Deserialize_When_OptionalFieldsMissing_Expect_Success) | 83 | TEST_F(EdgeParserTest, Ut_Deserialize_When_OptionalFieldsMissing_Expect_Success) |
| 76 | { | 84 | { |
| @@ -226,7 +226,7 @@ HcclResult StubRankGraphGetLinks( | |||
| 226 | g_fakeLink.header.magicWord = 0x0f0e0f0f; | 226 | g_fakeLink.header.magicWord = 0x0f0e0f0f; |
| 227 | g_fakeLink.header.size = sizeof(CommLink); | 227 | g_fakeLink.header.size = sizeof(CommLink); |
| 228 | g_fakeLink.header.reserved = 0; | 228 | g_fakeLink.header.reserved = 0; |
| 229 | - g_fakeLink.linkAttr.linkProtocol = COMM_PROTOCOL_UBC_CTP; | 229 | + g_fakeLink.linkAttr.linkProtocol = COMM_PROTOCOL_UB_CTP; |
| 230 | g_fakeLink.linkAttr.hop = 1; | 230 | g_fakeLink.linkAttr.hop = 1; |
| 231 | *links = &g_fakeLink; | 231 | *links = &g_fakeLink; |
| 232 | *linkNum = 1; | 232 | *linkNum = 1; |
| @@ -329,7 +329,7 @@ void BuildTeamCreateDesc( | |||
| 329 | desc.rankNum = rankNum; | 329 | desc.rankNum = rankNum; |
| 330 | desc.selfRankId = selfRankId; | 330 | desc.selfRankId = selfRankId; |
| 331 | desc.netLayer = netLayer; | 331 | desc.netLayer = netLayer; |
| 332 | - desc.protocol = COMM_PROTOCOL_UBC_CTP; | 332 | + desc.protocol = COMM_PROTOCOL_UB_CTP; |
| 333 | // 源码 HcclWorldTeamCreate/HcclSubTeamCreate 校验:signalCount/counterCount 必须为 0,barrierCount 必须 >= 1。 | 333 | // 源码 HcclWorldTeamCreate/HcclSubTeamCreate 校验:signalCount/counterCount 必须为 0,barrierCount 必须 >= 1。 |
| 334 | desc.requirement.signalCount = 0; | 334 | desc.requirement.signalCount = 0; |
| 335 | desc.requirement.counterCount = 0; | 335 | desc.requirement.counterCount = 0; |
| @@ -341,7 +341,7 @@ void BuildChannelDesc(HcclTeamCreateChannelsDesc& desc, CommEngine engine, uint3 | |||
| 341 | (void)HcclTeamCreateChannelsDescInit(&desc); | 341 | (void)HcclTeamCreateChannelsDescInit(&desc); |
| 342 | desc.engine = engine; | 342 | desc.engine = engine; |
| 343 | desc.notifyNum = notifyNum; | 343 | desc.notifyNum = notifyNum; |
| 344 | - desc.protocol = COMM_PROTOCOL_UBC_CTP; | 344 | + desc.protocol = COMM_PROTOCOL_UB_CTP; |
| 345 | desc.channelCnt = channelCnt; | 345 | desc.channelCnt = channelCnt; |
| 346 | } | 346 | } |
| 347 | } // namespace | 347 | } // namespace |
| @@ -59,7 +59,7 @@ TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs256_Expect_ReturnHCCL_SUCCE | |||
| 59 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs15_Expect_ReturnHCCL_SUCCESS_And_AdjustTo16) | 59 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs15_Expect_ReturnHCCL_SUCCESS_And_AdjustTo16) |
| 60 | { | 60 | { |
| 61 | HcommChannelDesc channelDesc{}; | 61 | HcommChannelDesc channelDesc{}; |
| 62 | - channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UBC_CTP; // 设置为UB协议以触发sqDepth检查 | 62 | + channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UB_CTP; // 设置为UB协议以触发sqDepth检查 |
| 63 | channelDesc.ubAttr.sqDepth = 15; | 63 | channelDesc.ubAttr.sqDepth = 15; |
| 64 | 64 | ||
| 65 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); | 65 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); |
| @@ -70,7 +70,7 @@ TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs15_Expect_ReturnHCCL_SUCCES | |||
| 70 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs300_Expect_ReturnHCCL_SUCCESS_And_AdjustTo512) | 70 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs300_Expect_ReturnHCCL_SUCCESS_And_AdjustTo512) |
| 71 | { | 71 | { |
| 72 | HcommChannelDesc channelDesc{}; | 72 | HcommChannelDesc channelDesc{}; |
| 73 | - channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UBC_CTP; // 设置为UB协议以触发sqDepth检查 | 73 | + channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UB_CTP; // 设置为UB协议以触发sqDepth检查 |
| 74 | channelDesc.ubAttr.sqDepth = 300; | 74 | channelDesc.ubAttr.sqDepth = 300; |
| 75 | 75 | ||
| 76 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); | 76 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); |
| @@ -81,7 +81,7 @@ TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs300_Expect_ReturnHCCL_SUCCE | |||
| 81 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs17_Expect_ReturnHCCL_SUCCESS_And_AdjustTo32) | 81 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs17_Expect_ReturnHCCL_SUCCESS_And_AdjustTo32) |
| 82 | { | 82 | { |
| 83 | HcommChannelDesc channelDesc{}; | 83 | HcommChannelDesc channelDesc{}; |
| 84 | - channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UBC_CTP; // 设置为UB协议以触发sqDepth检查 | 84 | + channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UB_CTP; // 设置为UB协议以触发sqDepth检查 |
| 85 | channelDesc.ubAttr.sqDepth = 17; | 85 | channelDesc.ubAttr.sqDepth = 17; |
| 86 | 86 | ||
| 87 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); | 87 | HcommResult ret = CheckUbAttr(channelDesc, COMM_ENGINE_AICPU); |
| @@ -92,7 +92,7 @@ TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs17_Expect_ReturnHCCL_SUCCES | |||
| 92 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs100_Expect_ReturnHCCL_SUCCESS_And_AdjustTo128) | 92 | TEST_F(CheckUbAttrTest, Ut_CheckUbAttr_When_SqDepthIs100_Expect_ReturnHCCL_SUCCESS_And_AdjustTo128) |
| 93 | { | 93 | { |
| 94 | HcommChannelDesc channelDesc{}; | 94 | HcommChannelDesc channelDesc{}; |
| 95 | - channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UBC_CTP; // 设置为UB协议以触发sqDepth检查 | 95 | + channelDesc.remoteEndpoint.protocol = COMM_PROTOCOL_UB_CTP; // 设置为UB协议以触发sqDepth检查 |
| 96 | 96 | ||
| 97 | channelDesc.ubAttr.sqDepth = 100; | 97 | channelDesc.ubAttr.sqDepth = 100; |
| 98 | 98 | ||
| @@ -21,24 +21,24 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -class AicpuUbgEndpointTest : public testing::Test { | 24 | +class AicpuUbRtpEndpointTest : public testing::Test { |
| 25 | protected: | 25 | protected: |
| 26 | - static void SetUpTestCase() { std::cout << "AicpuUbgEndpointTest tests set up." << std::endl; } | 26 | + static void SetUpTestCase() { std::cout << "AicpuUbRtpEndpointTest tests set up." << std::endl; } |
| 27 | 27 | ||
| 28 | - static void TearDownTestCase() { std::cout << "AicpuUbgEndpointTest tests tear down." << std::endl; } | 28 | + static void TearDownTestCase() { std::cout << "AicpuUbRtpEndpointTest tests tear down." << std::endl; } |
| 29 | 29 | ||
| 30 | - virtual void SetUp() { std::cout << "A Test case in AicpuUbgEndpointTest SetUP" << std::endl; } | 30 | + virtual void SetUp() { std::cout << "A Test case in AicpuUbRtpEndpointTest SetUP" << std::endl; } |
| 31 | 31 | ||
| 32 | virtual void TearDown() | 32 | virtual void TearDown() |
| 33 | { | 33 | { |
| 34 | GlobalMockObject::verify(); | 34 | GlobalMockObject::verify(); |
| 35 | - std::cout << "A Test case in AicpuUbgEndpointTest TearDown" << std::endl; | 35 | + std::cout << "A Test case in AicpuUbRtpEndpointTest TearDown" << std::endl; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | void CreateEndpointDesc(EndpointDesc& endpointDesc, const std::string& ip = "1.0.0.0") | 38 | void CreateEndpointDesc(EndpointDesc& endpointDesc, const std::string& ip = "1.0.0.0") |
| 39 | { | 39 | { |
| 40 | Hccl::IpAddress localIp(ip); | 40 | Hccl::IpAddress localIp(ip); |
| 41 | - endpointDesc.protocol = COMM_PROTOCOL_UBG; | 41 | + endpointDesc.protocol = COMM_PROTOCOL_UB_RTP; |
| 42 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 42 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 43 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 43 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 44 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 44 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| @@ -67,7 +67,7 @@ static HcclResult stub_hrtGetDeviceType_950(DevType& devType) | |||
| 67 | return HCCL_SUCCESS; | 67 | return HCCL_SUCCESS; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | -TEST_F(AicpuUbgEndpointTest, Ut_HcommEndpointCreate_When_Ubg_Device_Expect_Return_SUCCESS) | 70 | +TEST_F(AicpuUbRtpEndpointTest, Ut_HcommEndpointCreate_When_UbRtp_Device_Expect_Return_SUCCESS) |
| 71 | { | 71 | { |
| 72 | MOCKER(hrtGetDeviceType).stubs().will(invoke(stub_hrtGetDeviceType_950)); | 72 | MOCKER(hrtGetDeviceType).stubs().will(invoke(stub_hrtGetDeviceType_950)); |
| 73 | 73 | ||
| @@ -79,7 +79,7 @@ TEST_F(AicpuUbgEndpointTest, Ut_HcommEndpointCreate_When_Ubg_Device_Expect_Retur | |||
| 79 | EXPECT_EQ(ret, HCCL_SUCCESS); | 79 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | -TEST_F(AicpuUbgEndpointTest, Ut_HcommEndpointCreate_When_Ubg_Host_Expect_Return_ERROR) | 82 | +TEST_F(AicpuUbRtpEndpointTest, Ut_HcommEndpointCreate_When_UbRtp_Host_Expect_Return_ERROR) |
| 83 | { | 83 | { |
| 84 | EndpointDesc endpointDesc; | 84 | EndpointDesc endpointDesc; |
| 85 | CreateEndpointDesc(endpointDesc); | 85 | CreateEndpointDesc(endpointDesc); |
| @@ -90,7 +90,7 @@ TEST_F(AicpuUbgEndpointTest, Ut_HcommEndpointCreate_When_Ubg_Host_Expect_Return_ | |||
| 90 | EXPECT_EQ(ret, HCCL_E_PARA); | 90 | EXPECT_EQ(ret, HCCL_E_PARA); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | -TEST_F(AicpuUbgEndpointTest, Ut_When_Register_Memory_NORMAL_Expect_Return_SUCCESS) | 93 | +TEST_F(AicpuUbRtpEndpointTest, Ut_When_Register_Memory_NORMAL_Expect_Return_SUCCESS) |
| 94 | { | 94 | { |
| 95 | MOCKER(hrtGetDeviceType).stubs().will(invoke(stub_hrtGetDeviceType_950)); | 95 | MOCKER(hrtGetDeviceType).stubs().will(invoke(stub_hrtGetDeviceType_950)); |
| 96 | 96 | ||
| @@ -41,7 +41,7 @@ EndpointDesc MockEndpointDesc(const CommAddr& commAddr, uint32_t devPhyId) | |||
| 41 | 41 | ||
| 42 | (void)EndpointDescInit(&epDesc, 1); | 42 | (void)EndpointDescInit(&epDesc, 1); |
| 43 | 43 | ||
| 44 | - epDesc.protocol = CommProtocol::COMM_PROTOCOL_UBC_CTP; | 44 | + epDesc.protocol = CommProtocol::COMM_PROTOCOL_UB_CTP; |
| 45 | epDesc.commAddr = commAddr; | 45 | epDesc.commAddr = commAddr; |
| 46 | epDesc.loc.locType = EndpointLocType::ENDPOINT_LOC_TYPE_DEVICE; | 46 | epDesc.loc.locType = EndpointLocType::ENDPOINT_LOC_TYPE_DEVICE; |
| 47 | epDesc.loc.device.devPhyId = devPhyId; | 47 | epDesc.loc.device.devPhyId = devPhyId; |
| @@ -229,7 +229,7 @@ TEST_F(CcuTransportTest, ut_CcuTransport_BufferInfoUnpack_When_Normal_Expect_Ret | |||
| 229 | TEST_F(CcuTransportTest, ut_BuildCcuConnection_When_CtpAndRtp_Expect_QosPropagated) | 229 | TEST_F(CcuTransportTest, ut_BuildCcuConnection_When_CtpAndRtp_Expect_QosPropagated) |
| 230 | { | 230 | { |
| 231 | hcomm::CcuTransport::CcuConnectionInfo ctpInfo{}; | 231 | hcomm::CcuTransport::CcuConnectionInfo ctpInfo{}; |
| 232 | - ctpInfo.type = hcomm::CcuTransport::CcuConnectionType::UBC_CTP; | 232 | + ctpInfo.type = hcomm::CcuTransport::CcuConnectionType::UB_CTP; |
| 233 | ctpInfo.qos = 6U; | 233 | ctpInfo.qos = 6U; |
| 234 | ctpInfo.locAddr.type = COMM_ADDR_TYPE_IP_V4; | 234 | ctpInfo.locAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 235 | ctpInfo.rmtAddr.type = COMM_ADDR_TYPE_IP_V4; | 235 | ctpInfo.rmtAddr.type = COMM_ADDR_TYPE_IP_V4; |
| @@ -82,9 +82,9 @@ TEST(UtOrionAdptUtils, CommProtocolToLinkProtocol_AllSupported_And_Invalid) | |||
| 82 | CommProtocol p; | 82 | CommProtocol p; |
| 83 | Hccl::LinkProtocol expect; | 83 | Hccl::LinkProtocol expect; |
| 84 | } cases[] = { | 84 | } cases[] = { |
| 85 | - {COMM_PROTOCOL_UBC_CTP, Hccl::LinkProtocol::UB_CTP}, {COMM_PROTOCOL_UBC_TP, Hccl::LinkProtocol::UB_TP}, | 85 | + {COMM_PROTOCOL_UB_CTP, Hccl::LinkProtocol::UB_CTP}, {COMM_PROTOCOL_UBC_TP, Hccl::LinkProtocol::UB_TP}, |
| 86 | - {COMM_PROTOCOL_ROCE, Hccl::LinkProtocol::ROCE}, {COMM_PROTOCOL_HCCS, Hccl::LinkProtocol::HCCS}, | 86 | + {COMM_PROTOCOL_ROCE, Hccl::LinkProtocol::ROCE}, {COMM_PROTOCOL_HCCS, Hccl::LinkProtocol::HCCS}, |
| 87 | - {COMM_PROTOCOL_UB_MEM, Hccl::LinkProtocol::UB_MEM}, | 87 | + {COMM_PROTOCOL_UB_MEM, Hccl::LinkProtocol::UB_MEM}, {COMM_PROTOCOL_UB_RTP, Hccl::LinkProtocol::UB_RTP}, |
| 88 | }; | 88 | }; |
| 89 | for (const auto& c : cases) { | 89 | for (const auto& c : cases) { |
| 90 | Hccl::LinkProtocol lp = Hccl::LinkProtocol::INVALID; | 90 | Hccl::LinkProtocol lp = Hccl::LinkProtocol::INVALID; |
| @@ -95,6 +95,12 @@ TEST(UtOrionAdptUtils, CommProtocolToLinkProtocol_AllSupported_And_Invalid) | |||
| 95 | EXPECT_EQ(CommProtocolToLinkProtocol(static_cast<CommProtocol>(99999), bad), HCCL_E_PARA); | 95 | EXPECT_EQ(CommProtocolToLinkProtocol(static_cast<CommProtocol>(99999), bad), HCCL_E_PARA); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | +TEST(UtOrionAdptUtils, CommProtocolLegacyNamesKeepCompatibleValues) | ||
| 99 | +{ | ||
| 100 | + EXPECT_EQ(COMM_PROTOCOL_UBC_CTP, COMM_PROTOCOL_UB_CTP); | ||
| 101 | + EXPECT_EQ(COMM_PROTOCOL_UBG, COMM_PROTOCOL_UB_RTP); | ||
| 102 | +} | ||
| 103 | + | ||
| 98 | TEST(UtOrionAdptUtils, BuildDefaultLinkData_Returns_RoceHostNet) | 104 | TEST(UtOrionAdptUtils, BuildDefaultLinkData_Returns_RoceHostNet) |
| 99 | { | 105 | { |
| 100 | Hccl::LinkData ld = BuildDefaultLinkData(); | 106 | Hccl::LinkData ld = BuildDefaultLinkData(); |
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | -#include "aicpu/aicpu_ts_ubg_channel.h" | 16 | +#include "aicpu/aicpu_ts_ub_rtp_channel.h" |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | using namespace hcomm; | 23 | using namespace hcomm; |
| 24 | 24 | ||
| 25 | -class AicpuTsUbgChannelTest : public testing::Test { | 25 | +class AicpuTsUbRtpChannelTest : public testing::Test { |
| 26 | protected: | 26 | protected: |
| 27 | static void SetUpTestCase() {} | 27 | static void SetUpTestCase() {} |
| 28 | static void TearDownTestCase() {} | 28 | static void TearDownTestCase() {} |
| @@ -53,11 +53,11 @@ private: | |||
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | namespace { | 55 | namespace { |
| 56 | -EndpointDesc MakeUbgEndpointDesc() | 56 | +EndpointDesc MakeUbRtpEndpointDesc() |
| 57 | { | 57 | { |
| 58 | EndpointDesc desc{}; | 58 | EndpointDesc desc{}; |
| 59 | Hccl::IpAddress localIp("127.0.0.1"); | 59 | Hccl::IpAddress localIp("127.0.0.1"); |
| 60 | - desc.protocol = COMM_PROTOCOL_UBG; | 60 | + desc.protocol = COMM_PROTOCOL_UB_RTP; |
| 61 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 61 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 62 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; | 62 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 63 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 63 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| @@ -66,7 +66,7 @@ EndpointDesc MakeUbgEndpointDesc() | |||
| 66 | 66 | ||
| 67 | class FakeParseEndpoint : public Endpoint { | 67 | class FakeParseEndpoint : public Endpoint { |
| 68 | public: | 68 | public: |
| 69 | - FakeParseEndpoint() : Endpoint(MakeUbgEndpointDesc()) { ctxHandle_ = reinterpret_cast<void*>(0xDEADBEEF); } | 69 | + FakeParseEndpoint() : Endpoint(MakeUbRtpEndpointDesc()) { ctxHandle_ = reinterpret_cast<void*>(0xDEADBEEF); } |
| 70 | 70 | ||
| 71 | HcclResult Init() override { return HCCL_SUCCESS; } | 71 | HcclResult Init() override { return HCCL_SUCCESS; } |
| 72 | HcclResult ServerSocketListen(const uint32_t) override { return HCCL_SUCCESS; } | 72 | HcclResult ServerSocketListen(const uint32_t) override { return HCCL_SUCCESS; } |
| @@ -78,15 +78,15 @@ public: | |||
| 78 | HcclResult GetAllMemHandles(void**, uint32_t*) override { return HCCL_SUCCESS; } | 78 | HcclResult GetAllMemHandles(void**, uint32_t*) override { return HCCL_SUCCESS; } |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | -std::shared_ptr<Hccl::LocalUbRmaBuffer> MakeUbgLocalBuffer(uintptr_t addr, u64 size, const char* tag) | 81 | +std::shared_ptr<Hccl::LocalUbRmaBuffer> MakeUbRtpLocalBuffer(uintptr_t addr, u64 size, const char* tag) |
| 82 | { | 82 | { |
| 83 | auto buffer = std::make_shared<Hccl::Buffer>(addr, size, HCCL_MEM_TYPE_DEVICE, tag); | 83 | auto buffer = std::make_shared<Hccl::Buffer>(addr, size, HCCL_MEM_TYPE_DEVICE, tag); |
| 84 | return std::make_shared<Hccl::LocalUbRmaBuffer>(buffer); | 84 | return std::make_shared<Hccl::LocalUbRmaBuffer>(buffer); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | -HcommResult StubUbgGetAllMemHandlesOne(EndpointHandle, void** memHandles, uint32_t* memHandleNum) | 87 | +HcommResult StubUbRtpGetAllMemHandlesOne(EndpointHandle, void** memHandles, uint32_t* memHandleNum) |
| 88 | { | 88 | { |
| 89 | - static std::shared_ptr<Hccl::LocalUbRmaBuffer> localBuffer = MakeUbgLocalBuffer(0x620000U, 0x1000U, "ubg_all"); | 89 | + static std::shared_ptr<Hccl::LocalUbRmaBuffer> localBuffer = MakeUbRtpLocalBuffer(0x620000U, 0x1000U, "ub_rtp_all"); |
| 90 | static std::shared_ptr<Hccl::LocalUbRmaBuffer> localBuffers[1] = {localBuffer}; | 90 | static std::shared_ptr<Hccl::LocalUbRmaBuffer> localBuffers[1] = {localBuffer}; |
| 91 | *memHandles = localBuffers; | 91 | *memHandles = localBuffers; |
| 92 | *memHandleNum = 1; | 92 | *memHandleNum = 1; |
| @@ -101,7 +101,7 @@ struct FakeEndpoint { | |||
| 101 | { | 101 | { |
| 102 | memset(&desc, 0, sizeof(desc)); | 102 | memset(&desc, 0, sizeof(desc)); |
| 103 | Hccl::IpAddress localIp("127.0.0.1"); | 103 | Hccl::IpAddress localIp("127.0.0.1"); |
| 104 | - desc.protocol = COMM_PROTOCOL_UBG; | 104 | + desc.protocol = COMM_PROTOCOL_UB_RTP; |
| 105 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 105 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 106 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; | 106 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 107 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 107 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| @@ -168,44 +168,44 @@ static HcommChannelDesc MakeFakeChannelDesc(FakeSocket* sock) | |||
| 168 | return d; | 168 | return d; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | -TEST_F(AicpuTsUbgChannelTest, Ut_GetChannelKind_Returns_AICPU_TS_UBG) | 171 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_GetChannelKind_Returns_AICPU_TS_UB_RTP) |
| 172 | { | 172 | { |
| 173 | HcommChannelDesc desc{}; | 173 | HcommChannelDesc desc{}; |
| 174 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 174 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 175 | - AicpuTsUbgChannel ch(ep, desc); | 175 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 176 | - EXPECT_EQ(ch.GetChannelKind(), HcommChannelKind::AICPU_TS_UBG); | 176 | + EXPECT_EQ(ch.GetChannelKind(), HcommChannelKind::AICPU_TS_UB_RTP); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | -TEST_F(AicpuTsUbgChannelTest, UT_ParseInputParam_When_ExchangeAllMemsFalse_Expect_FillCommonRes) | 179 | +TEST_F(AicpuTsUbRtpChannelTest, UT_ParseInputParam_When_ExchangeAllMemsFalse_Expect_FillCommonRes) |
| 180 | { | 180 | { |
| 181 | FakeParseEndpoint endpoint; | 181 | FakeParseEndpoint endpoint; |
| 182 | - auto localBuffer = MakeUbgLocalBuffer(0x610000U, 0x1000U, "ubg_desc"); | 182 | + auto localBuffer = MakeUbRtpLocalBuffer(0x610000U, 0x1000U, "ub_rtp_desc"); |
| 183 | HcommMemHandle memHandles[1] = {reinterpret_cast<HcommMemHandle>(localBuffer.get())}; | 183 | HcommMemHandle memHandles[1] = {reinterpret_cast<HcommMemHandle>(localBuffer.get())}; |
| 184 | HcommChannelDesc desc{}; | 184 | HcommChannelDesc desc{}; |
| 185 | desc.exchangeAllMems = false; | 185 | desc.exchangeAllMems = false; |
| 186 | desc.memHandles = memHandles; | 186 | desc.memHandles = memHandles; |
| 187 | desc.memHandleNum = 1; | 187 | desc.memHandleNum = 1; |
| 188 | - AicpuTsUbgChannel channel(reinterpret_cast<EndpointHandle>(&endpoint), desc); | 188 | + AicpuTsUbRtpChannel channel(reinterpret_cast<EndpointHandle>(&endpoint), desc); |
| 189 | 189 | ||
| 190 | ASSERT_EQ(channel.ParseInputParam(), HCCL_SUCCESS); | 190 | ASSERT_EQ(channel.ParseInputParam(), HCCL_SUCCESS); |
| 191 | ASSERT_EQ(channel.commonRes_.bufferVec.size(), 1U); | 191 | ASSERT_EQ(channel.commonRes_.bufferVec.size(), 1U); |
| 192 | EXPECT_EQ(channel.commonRes_.bufferVec[0], localBuffer.get()); | 192 | EXPECT_EQ(channel.commonRes_.bufferVec[0], localBuffer.get()); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | -TEST_F(AicpuTsUbgChannelTest, UT_ParseInputParam_When_ExchangeAllMemsTrue_Expect_FillCommonRes) | 195 | +TEST_F(AicpuTsUbRtpChannelTest, UT_ParseInputParam_When_ExchangeAllMemsTrue_Expect_FillCommonRes) |
| 196 | { | 196 | { |
| 197 | FakeParseEndpoint endpoint; | 197 | FakeParseEndpoint endpoint; |
| 198 | HcommChannelDesc desc{}; | 198 | HcommChannelDesc desc{}; |
| 199 | desc.exchangeAllMems = true; | 199 | desc.exchangeAllMems = true; |
| 200 | - AicpuTsUbgChannel channel(reinterpret_cast<EndpointHandle>(&endpoint), desc); | 200 | + AicpuTsUbRtpChannel channel(reinterpret_cast<EndpointHandle>(&endpoint), desc); |
| 201 | - MOCKER(HcommMemGetAllMemHandles).stubs().will(invoke(StubUbgGetAllMemHandlesOne)); | 201 | + MOCKER(HcommMemGetAllMemHandles).stubs().will(invoke(StubUbRtpGetAllMemHandlesOne)); |
| 202 | 202 | ||
| 203 | ASSERT_EQ(channel.ParseInputParam(), HCCL_SUCCESS); | 203 | ASSERT_EQ(channel.ParseInputParam(), HCCL_SUCCESS); |
| 204 | ASSERT_EQ(channel.commonRes_.bufferVec.size(), 1U); | 204 | ASSERT_EQ(channel.commonRes_.bufferVec.size(), 1U); |
| 205 | EXPECT_EQ(channel.commonRes_.bufferVec[0]->GetAddr(), 0x620000U); | 205 | EXPECT_EQ(channel.commonRes_.bufferVec[0]->GetAddr(), 0x620000U); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | -TEST_F(AicpuTsUbgChannelTest, Ut_BuildConnection_Creates_UbgConn) | 208 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_BuildConnection_Creates_UbRtpConn) |
| 209 | { | 209 | { |
| 210 | FakeEndpoint fe; | 210 | FakeEndpoint fe; |
| 211 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); | 211 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); |
| @@ -213,7 +213,7 @@ TEST_F(AicpuTsUbgChannelTest, Ut_BuildConnection_Creates_UbgConn) | |||
| 213 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); | 213 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); |
| 214 | desc.qos = 3U; | 214 | desc.qos = 3U; |
| 215 | 215 | ||
| 216 | - AicpuTsUbgChannel ch(ep, desc); | 216 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 217 | ch.localEp_ = fe.GetEndpointDesc(); | 217 | ch.localEp_ = fe.GetEndpointDesc(); |
| 218 | ch.remoteEp_ = fe.GetEndpointDesc(); | 218 | ch.remoteEp_ = fe.GetEndpointDesc(); |
| 219 | ch.rdmaHandle_ = fe.GetRdmaHandle(); | 219 | ch.rdmaHandle_ = fe.GetRdmaHandle(); |
| @@ -231,7 +231,7 @@ TEST_F(AicpuTsUbgChannelTest, Ut_BuildConnection_Creates_UbgConn) | |||
| 231 | EXPECT_EQ(ret, HCCL_SUCCESS); | 231 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 232 | 232 | ||
| 233 | ASSERT_EQ(ch.commonRes_.connVec.size(), 1u); | 233 | ASSERT_EQ(ch.commonRes_.connVec.size(), 1u); |
| 234 | - auto* conn = dynamic_cast<Hccl::DevUbUbgConnection*>(ch.commonRes_.connVec[0]); | 234 | + auto* conn = dynamic_cast<Hccl::DevUbRtpConnection*>(ch.commonRes_.connVec[0]); |
| 235 | ASSERT_NE(conn, nullptr); | 235 | ASSERT_NE(conn, nullptr); |
| 236 | EXPECT_EQ(conn->qos_, static_cast<u8>(3)); | 236 | EXPECT_EQ(conn->qos_, static_cast<u8>(3)); |
| 237 | } | 237 | } |
| @@ -265,7 +265,7 @@ static void stub_Socket_RecvAsync(Hccl::Socket* self, u8* recvBuf, u32 size) | |||
| 265 | std::memset(recvBuf, 0, size); | 265 | std::memset(recvBuf, 0, size); |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | -TEST_F(AicpuTsUbgChannelTest, Ut_ProcessUbgState_AllStates_Transitions) | 268 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_ProcessUbRtpState_AllStates_Transitions) |
| 269 | { | 269 | { |
| 270 | FakeEndpoint fe; | 270 | FakeEndpoint fe; |
| 271 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); | 271 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); |
| @@ -282,7 +282,7 @@ TEST_F(AicpuTsUbgChannelTest, Ut_ProcessUbgState_AllStates_Transitions) | |||
| 282 | 282 | ||
| 283 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); | 283 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); |
| 284 | 284 | ||
| 285 | - AicpuTsUbgChannel ch(ep, desc); | 285 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 286 | 286 | ||
| 287 | FakeEndpoint localEp; | 287 | FakeEndpoint localEp; |
| 288 | FakeEndpoint remoteEp; | 288 | FakeEndpoint remoteEp; |
| @@ -300,7 +300,7 @@ TEST_F(AicpuTsUbgChannelTest, Ut_ProcessUbgState_AllStates_Transitions) | |||
| 300 | ch.bufferNum_ = 0; | 300 | ch.bufferNum_ = 0; |
| 301 | 301 | ||
| 302 | ch.channelStatus = ChannelStatus::SOCKET_OK; | 302 | ch.channelStatus = ChannelStatus::SOCKET_OK; |
| 303 | - ch.ubgStatus = AicpuTsUbgChannel::UbgStatus::SEND_SIZE; | 303 | + ch.ubRtpStatus = AicpuTsUbRtpChannel::UbRtpStatus::SEND_SIZE; |
| 304 | 304 | ||
| 305 | int iter = 0; | 305 | int iter = 0; |
| 306 | while (ch.channelStatus != ChannelStatus::READY && iter < 200) { | 306 | while (ch.channelStatus != ChannelStatus::READY && iter < 200) { |
| @@ -309,18 +309,19 @@ TEST_F(AicpuTsUbgChannelTest, Ut_ProcessUbgState_AllStates_Transitions) | |||
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | EXPECT_EQ(ch.channelStatus, ChannelStatus::READY); | 311 | EXPECT_EQ(ch.channelStatus, ChannelStatus::READY); |
| 312 | + EXPECT_EQ(ch.ubRtpStatus, AicpuTsUbRtpChannel::UbRtpStatus::READY); | ||
| 312 | } | 313 | } |
| 313 | 314 | ||
| 314 | -TEST_F(AicpuTsUbgChannelTest, Ut_GetStatus_WhenReady_ReturnsReady) | 315 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_GetStatus_WhenReady_ReturnsReady) |
| 315 | { | 316 | { |
| 316 | HcommChannelDesc desc{}; | 317 | HcommChannelDesc desc{}; |
| 317 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 318 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 318 | - AicpuTsUbgChannel ch(ep, desc); | 319 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 319 | ch.channelStatus = ChannelStatus::READY; | 320 | ch.channelStatus = ChannelStatus::READY; |
| 320 | EXPECT_EQ(ch.GetStatus(), ChannelStatus::READY); | 321 | EXPECT_EQ(ch.GetStatus(), ChannelStatus::READY); |
| 321 | } | 322 | } |
| 322 | 323 | ||
| 323 | -TEST_F(AicpuTsUbgChannelTest, Ut_SendFinish_RecvFinish_NoCrash) | 324 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_SendFinish_RecvFinish_NoCrash) |
| 324 | { | 325 | { |
| 325 | FakeEndpoint fe; | 326 | FakeEndpoint fe; |
| 326 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); | 327 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); |
| @@ -336,7 +337,7 @@ TEST_F(AicpuTsUbgChannelTest, Ut_SendFinish_RecvFinish_NoCrash) | |||
| 336 | .with(any(), any()) | 337 | .with(any(), any()) |
| 337 | .will(invoke(stub_Socket_RecvAsync)); | 338 | .will(invoke(stub_Socket_RecvAsync)); |
| 338 | 339 | ||
| 339 | - AicpuTsUbgChannel ch(ep, desc); | 340 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 340 | ch.socket_ = reinterpret_cast<Hccl::Socket*>(fakeSock.get()); | 341 | ch.socket_ = reinterpret_cast<Hccl::Socket*>(fakeSock.get()); |
| 341 | 342 | ||
| 342 | ch.SendFinish(); | 343 | ch.SendFinish(); |
| @@ -344,14 +345,14 @@ TEST_F(AicpuTsUbgChannelTest, Ut_SendFinish_RecvFinish_NoCrash) | |||
| 344 | SUCCEED(); | 345 | SUCCEED(); |
| 345 | } | 346 | } |
| 346 | 347 | ||
| 347 | -TEST_F(AicpuTsUbgChannelTest, Ut_H2DResPack_Packs_Data) | 348 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_H2DResPack_Packs_Data) |
| 348 | { | 349 | { |
| 349 | FakeEndpoint fe; | 350 | FakeEndpoint fe; |
| 350 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); | 351 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(&fe); |
| 351 | auto fakeSock = std::make_unique<FakeSocket>(); | 352 | auto fakeSock = std::make_unique<FakeSocket>(); |
| 352 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); | 353 | HcommChannelDesc desc = MakeFakeChannelDesc(fakeSock.get()); |
| 353 | 354 | ||
| 354 | - AicpuTsUbgChannel ch(ep, desc); | 355 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 355 | 356 | ||
| 356 | ch.channelStatus = ChannelStatus::READY; | 357 | ch.channelStatus = ChannelStatus::READY; |
| 357 | ch.notifyNum_ = 1; | 358 | ch.notifyNum_ = 1; |
| @@ -376,21 +377,21 @@ TEST_F(AicpuTsUbgChannelTest, Ut_H2DResPack_Packs_Data) | |||
| 376 | ch.rmtBufferVec_.push_back(std::move(rmtBufPtr)); | 377 | ch.rmtBufferVec_.push_back(std::move(rmtBufPtr)); |
| 377 | 378 | ||
| 378 | Hccl::IpAddress ipAddress("127.0.0.1"); | 379 | Hccl::IpAddress ipAddress("127.0.0.1"); |
| 379 | - Hccl::DevUbUbgConnection ubgConn( | 380 | + Hccl::DevUbRtpConnection ubRtpConn( |
| 380 | fe.GetRdmaHandle(), ipAddress, ipAddress, Hccl::OpMode::OPBASE, true, Hccl::HrtUbJfcMode::STARS_POLL, ipAddress, | 381 | fe.GetRdmaHandle(), ipAddress, ipAddress, Hccl::OpMode::OPBASE, true, Hccl::HrtUbJfcMode::STARS_POLL, ipAddress, |
| 381 | ipAddress); | 382 | ipAddress); |
| 382 | - ch.commonRes_.connVec.push_back(&ubgConn); | 383 | + ch.commonRes_.connVec.push_back(&ubRtpConn); |
| 383 | 384 | ||
| 384 | std::vector<char> out{}; | 385 | std::vector<char> out{}; |
| 385 | HcclResult ret = ch.H2DResPack(out); | 386 | HcclResult ret = ch.H2DResPack(out); |
| 386 | EXPECT_EQ(ret, HCCL_SUCCESS); | 387 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 387 | } | 388 | } |
| 388 | 389 | ||
| 389 | -TEST_F(AicpuTsUbgChannelTest, Ut_DataPlaneInterfaces_ReturnNotSupport) | 390 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_DataPlaneInterfaces_ReturnNotSupport) |
| 390 | { | 391 | { |
| 391 | HcommChannelDesc desc{}; | 392 | HcommChannelDesc desc{}; |
| 392 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 393 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 393 | - AicpuTsUbgChannel ch(ep, desc); | 394 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 394 | 395 | ||
| 395 | EXPECT_EQ(ch.NotifyRecord(0), HCCL_E_NOT_SUPPORT); | 396 | EXPECT_EQ(ch.NotifyRecord(0), HCCL_E_NOT_SUPPORT); |
| 396 | EXPECT_EQ(ch.NotifyWait(0, 1000), HCCL_E_NOT_SUPPORT); | 397 | EXPECT_EQ(ch.NotifyWait(0, 1000), HCCL_E_NOT_SUPPORT); |
| @@ -400,21 +401,21 @@ TEST_F(AicpuTsUbgChannelTest, Ut_DataPlaneInterfaces_ReturnNotSupport) | |||
| 400 | EXPECT_EQ(ch.ChannelFence(), HCCL_E_NOT_SUPPORT); | 401 | EXPECT_EQ(ch.ChannelFence(), HCCL_E_NOT_SUPPORT); |
| 401 | } | 402 | } |
| 402 | 403 | ||
| 403 | -TEST_F(AicpuTsUbgChannelTest, Ut_Clean_Resume_ReturnSuccess) | 404 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_Clean_Resume_ReturnSuccess) |
| 404 | { | 405 | { |
| 405 | HcommChannelDesc desc{}; | 406 | HcommChannelDesc desc{}; |
| 406 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 407 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 407 | - AicpuTsUbgChannel ch(ep, desc); | 408 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 408 | 409 | ||
| 409 | EXPECT_EQ(ch.Clean(), HCCL_SUCCESS); | 410 | EXPECT_EQ(ch.Clean(), HCCL_SUCCESS); |
| 410 | EXPECT_EQ(ch.Resume(), HCCL_SUCCESS); | 411 | EXPECT_EQ(ch.Resume(), HCCL_SUCCESS); |
| 411 | } | 412 | } |
| 412 | 413 | ||
| 413 | -TEST_F(AicpuTsUbgChannelTest, Ut_GetNotifyNum_ReturnsValue) | 414 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_GetNotifyNum_ReturnsValue) |
| 414 | { | 415 | { |
| 415 | HcommChannelDesc desc{}; | 416 | HcommChannelDesc desc{}; |
| 416 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 417 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 417 | - AicpuTsUbgChannel ch(ep, desc); | 418 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 418 | ch.notifyNum_ = 5; | 419 | ch.notifyNum_ = 5; |
| 419 | 420 | ||
| 420 | uint32_t num = 0; | 421 | uint32_t num = 0; |
| @@ -422,42 +423,42 @@ TEST_F(AicpuTsUbgChannelTest, Ut_GetNotifyNum_ReturnsValue) | |||
| 422 | EXPECT_EQ(num, 5u); | 423 | EXPECT_EQ(num, 5u); |
| 423 | } | 424 | } |
| 424 | 425 | ||
| 425 | -TEST_F(AicpuTsUbgChannelTest, Ut_IsSocketReady_NullptrSocket_ReturnsFalse) | 426 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_IsSocketReady_NullptrSocket_ReturnsFalse) |
| 426 | { | 427 | { |
| 427 | HcommChannelDesc desc{}; | 428 | HcommChannelDesc desc{}; |
| 428 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 429 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 429 | - AicpuTsUbgChannel ch(ep, desc); | 430 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 430 | ch.socket_ = nullptr; | 431 | ch.socket_ = nullptr; |
| 431 | 432 | ||
| 432 | EXPECT_FALSE(ch.IsSocketReady()); | 433 | EXPECT_FALSE(ch.IsSocketReady()); |
| 433 | EXPECT_EQ(ch.channelStatus, ChannelStatus::INVALID); | 434 | EXPECT_EQ(ch.channelStatus, ChannelStatus::INVALID); |
| 434 | } | 435 | } |
| 435 | 436 | ||
| 436 | -TEST_F(AicpuTsUbgChannelTest, Ut_IsResReady_EmptyConnVec_ReturnsTrue) | 437 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_IsResReady_EmptyConnVec_ReturnsTrue) |
| 437 | { | 438 | { |
| 438 | HcommChannelDesc desc{}; | 439 | HcommChannelDesc desc{}; |
| 439 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 440 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 440 | - AicpuTsUbgChannel ch(ep, desc); | 441 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 441 | ch.commonRes_.connVec = {}; | 442 | ch.commonRes_.connVec = {}; |
| 442 | 443 | ||
| 443 | EXPECT_TRUE(ch.IsResReady()); | 444 | EXPECT_TRUE(ch.IsResReady()); |
| 444 | } | 445 | } |
| 445 | 446 | ||
| 446 | -TEST_F(AicpuTsUbgChannelTest, Ut_IsConnsReady_ZeroConnNum_ReturnsTrue) | 447 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_IsConnsReady_ZeroConnNum_ReturnsTrue) |
| 447 | { | 448 | { |
| 448 | HcommChannelDesc desc{}; | 449 | HcommChannelDesc desc{}; |
| 449 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 450 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 450 | - AicpuTsUbgChannel ch(ep, desc); | 451 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 451 | ch.connNum_ = 0; | 452 | ch.connNum_ = 0; |
| 452 | 453 | ||
| 453 | EXPECT_TRUE(ch.IsConnsReady()); | 454 | EXPECT_TRUE(ch.IsConnsReady()); |
| 454 | } | 455 | } |
| 455 | 456 | ||
| 456 | -TEST_F(AicpuTsUbgChannelTest, Ut_PackingHelpers_EmptyVecs_NoCrash) | 457 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_PackingHelpers_EmptyVecs_NoCrash) |
| 457 | { | 458 | { |
| 458 | HcommChannelDesc desc{}; | 459 | HcommChannelDesc desc{}; |
| 459 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 460 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 460 | - AicpuTsUbgChannel ch(ep, desc); | 461 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 461 | ch.notifyNum_ = 0; | 462 | ch.notifyNum_ = 0; |
| 462 | ch.connNum_ = 0; | 463 | ch.connNum_ = 0; |
| 463 | ch.bufferNum_ = 0; | 464 | ch.bufferNum_ = 0; |
| @@ -474,11 +475,11 @@ TEST_F(AicpuTsUbgChannelTest, Ut_PackingHelpers_EmptyVecs_NoCrash) | |||
| 474 | SUCCEED(); | 475 | SUCCEED(); |
| 475 | } | 476 | } |
| 476 | 477 | ||
| 477 | -TEST_F(AicpuTsUbgChannelTest, Ut_GetUniqueIdV2_NotReady_Throws) | 478 | +TEST_F(AicpuTsUbRtpChannelTest, Ut_GetUniqueIdV2_NotReady_Throws) |
| 478 | { | 479 | { |
| 479 | HcommChannelDesc desc{}; | 480 | HcommChannelDesc desc{}; |
| 480 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); | 481 | EndpointHandle ep = reinterpret_cast<EndpointHandle>(0x1); |
| 481 | - AicpuTsUbgChannel ch(ep, desc); | 482 | + AicpuTsUbRtpChannel ch(ep, desc); |
| 482 | ch.channelStatus = ChannelStatus::INIT; | 483 | ch.channelStatus = ChannelStatus::INIT; |
| 483 | 484 | ||
| 484 | EXPECT_ANY_THROW(ch.GetUniqueIdV2()); | 485 | EXPECT_ANY_THROW(ch.GetUniqueIdV2()); |
| @@ -40,7 +40,7 @@ private: | |||
| 40 | { | 40 | { |
| 41 | EndpointDesc desc{}; | 41 | EndpointDesc desc{}; |
| 42 | Hccl::IpAddress localIp("127.0.0.1"); | 42 | Hccl::IpAddress localIp("127.0.0.1"); |
| 43 | - desc.protocol = COMM_PROTOCOL_UBC_CTP; | 43 | + desc.protocol = COMM_PROTOCOL_UB_CTP; |
| 44 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 44 | desc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 45 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; | 45 | desc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 46 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 46 | desc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| @@ -280,7 +280,7 @@ TEST_F(AivUrmaChannelTest, Ut_BuildConnection_When_UbProtocol_Expect_RetainsConf | |||
| 280 | EXPECT_NE(dynamic_cast<DevUbCtpConnection*>(ch.connections_[0].get()), nullptr); | 280 | EXPECT_NE(dynamic_cast<DevUbCtpConnection*>(ch.connections_[0].get()), nullptr); |
| 281 | break; | 281 | break; |
| 282 | case ConnectionType::UBG: | 282 | case ConnectionType::UBG: |
| 283 | - EXPECT_NE(dynamic_cast<DevUbUbgConnection*>(ch.connections_[0].get()), nullptr); | 283 | + EXPECT_NE(dynamic_cast<DevUbRtpConnection*>(ch.connections_[0].get()), nullptr); |
| 284 | break; | 284 | break; |
| 285 | } | 285 | } |
| 286 | } | 286 | } |
| @@ -194,10 +194,10 @@ TEST_F(UtChannelRoceFactory, CreateChannel_AivUbMem_MockInit_Returns_SUCCESS) | |||
| 194 | ASSERT_NE(ch.get(), nullptr); | 194 | ASSERT_NE(ch.get(), nullptr); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | -TEST_F(UtChannelRoceFactory, CreateChannel_AivUbg_On950_ReturnsAivUrmaChannel) | 197 | +TEST_F(UtChannelRoceFactory, CreateChannel_AivUbRtp_On950_ReturnsAivUrmaChannel) |
| 198 | { | 198 | { |
| 199 | EndpointDesc ep{}; | 199 | EndpointDesc ep{}; |
| 200 | - ep.protocol = COMM_PROTOCOL_UBG; | 200 | + ep.protocol = COMM_PROTOCOL_UB_RTP; |
| 201 | ep.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 201 | ep.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| 202 | ep.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 202 | ep.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 203 | ASSERT_EQ(inet_pton(AF_INET, "10.20.30.43", &ep.commAddr.addr), 1); | 203 | ASSERT_EQ(inet_pton(AF_INET, "10.20.30.43", &ep.commAddr.addr), 1); |
| @@ -84,13 +84,13 @@ TEST_F(TestEndpointPair, Ut_DestroyChannel_When_Channel_Not_Exist_Expect_SUCCESS | |||
| 84 | MOCKER(HcommChannelDestroy).stubs().will(returnValue(static_cast<int>(HCCL_SUCCESS))); | 84 | MOCKER(HcommChannelDestroy).stubs().will(returnValue(static_cast<int>(HCCL_SUCCESS))); |
| 85 | 85 | ||
| 86 | EndpointDesc localEndpointDesc{}; | 86 | EndpointDesc localEndpointDesc{}; |
| 87 | - localEndpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 87 | + localEndpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 88 | localEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 88 | localEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 89 | Hccl::IpAddress localIp("192.168.100.100"); | 89 | Hccl::IpAddress localIp("192.168.100.100"); |
| 90 | localEndpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 90 | localEndpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 91 | localEndpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 91 | localEndpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| 92 | EndpointDesc remoteEndpointDesc{}; | 92 | EndpointDesc remoteEndpointDesc{}; |
| 93 | - remoteEndpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 93 | + remoteEndpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 94 | remoteEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 94 | remoteEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 95 | Hccl::IpAddress remoteIp("192.168.100.101"); | 95 | Hccl::IpAddress remoteIp("192.168.100.101"); |
| 96 | remoteEndpointDesc.commAddr.addr = remoteIp.GetBinaryAddress().addr; | 96 | remoteEndpointDesc.commAddr.addr = remoteIp.GetBinaryAddress().addr; |
| @@ -381,13 +381,13 @@ TEST_F(TestEndpointPair, Ut_DestroyChannel_When_Channel_Exist_Expect_SUCCESS) | |||
| 381 | MOCKER(HcommChannelDestroy).stubs().will(returnValue(static_cast<int>(HCCL_SUCCESS))); | 381 | MOCKER(HcommChannelDestroy).stubs().will(returnValue(static_cast<int>(HCCL_SUCCESS))); |
| 382 | 382 | ||
| 383 | EndpointDesc localEndpointDesc{}; | 383 | EndpointDesc localEndpointDesc{}; |
| 384 | - localEndpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 384 | + localEndpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 385 | localEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 385 | localEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 386 | Hccl::IpAddress localIp("192.168.100.100"); | 386 | Hccl::IpAddress localIp("192.168.100.100"); |
| 387 | localEndpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 387 | localEndpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 388 | localEndpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 388 | localEndpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| 389 | EndpointDesc remoteEndpointDesc{}; | 389 | EndpointDesc remoteEndpointDesc{}; |
| 390 | - remoteEndpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 390 | + remoteEndpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 391 | remoteEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 391 | remoteEndpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 392 | Hccl::IpAddress remoteIp("192.168.100.101"); | 392 | Hccl::IpAddress remoteIp("192.168.100.101"); |
| 393 | remoteEndpointDesc.commAddr.addr = remoteIp.GetBinaryAddress().addr; | 393 | remoteEndpointDesc.commAddr.addr = remoteIp.GetBinaryAddress().addr; |
| @@ -85,7 +85,7 @@ TEST_F(CpuRoceEndpointTest, Ut_When_wrongIp_EXPECT_Return_128003) | |||
| 85 | { | 85 | { |
| 86 | Hccl::IpAddress localIp("223.0.0.1"); | 86 | Hccl::IpAddress localIp("223.0.0.1"); |
| 87 | EndpointDesc endpointDesc; | 87 | EndpointDesc endpointDesc; |
| 88 | - endpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 88 | + endpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 89 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 89 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 90 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 90 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 91 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; | 91 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_DEVICE; |
| @@ -53,7 +53,7 @@ protected: | |||
| 53 | { | 53 | { |
| 54 | std::cout << "A Test case in CpuUrmaEndpointTest SetUP" << std::endl; | 54 | std::cout << "A Test case in CpuUrmaEndpointTest SetUP" << std::endl; |
| 55 | Hccl::IpAddress localIp("1.0.0.0"); | 55 | Hccl::IpAddress localIp("1.0.0.0"); |
| 56 | - endpointDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 56 | + endpointDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 57 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 57 | endpointDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 58 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 58 | endpointDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 59 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_HOST; | 59 | endpointDesc.loc.locType = ENDPOINT_LOC_TYPE_HOST; |
| @@ -78,7 +78,7 @@ protected: | |||
| 78 | MOCKER(RaSocketSetWhiteListStatus).stubs().will(returnValue(0)); | 78 | MOCKER(RaSocketSetWhiteListStatus).stubs().will(returnValue(0)); |
| 79 | 79 | ||
| 80 | EndpointDesc epDesc{}; | 80 | EndpointDesc epDesc{}; |
| 81 | - epDesc.protocol = COMM_PROTOCOL_UBC_CTP; | 81 | + epDesc.protocol = COMM_PROTOCOL_UB_CTP; |
| 82 | epDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; | 82 | epDesc.commAddr.type = COMM_ADDR_TYPE_IP_V4; |
| 83 | epDesc.commAddr.addr = localIp.GetBinaryAddress().addr; | 83 | epDesc.commAddr.addr = localIp.GetBinaryAddress().addr; |
| 84 | epDesc.loc.locType = ENDPOINT_LOC_TYPE_HOST; | 84 | epDesc.loc.locType = ENDPOINT_LOC_TYPE_HOST; |
| @@ -390,7 +390,7 @@ TEST_F(HcclRankGraphTest, Ut_HcclRankGraphGetEndpointInfo_When_ValidParam_Expect | |||
| 390 | ret = HcclRankGraphGetEndpointDesc(comm, netLayer, topoInstId, &num, endpointDesc.get()); | 390 | ret = HcclRankGraphGetEndpointDesc(comm, netLayer, topoInstId, &num, endpointDesc.get()); |
| 391 | EXPECT_EQ(ret, HCCL_SUCCESS); | 391 | EXPECT_EQ(ret, HCCL_SUCCESS); |
| 392 | for (uint32_t i = 0; i < num; i++) { | 392 | for (uint32_t i = 0; i < num; i++) { |
| 393 | - EXPECT_EQ(endpointDesc[i].protocol, COMM_PROTOCOL_UBC_CTP); | 393 | + EXPECT_EQ(endpointDesc[i].protocol, COMM_PROTOCOL_UB_CTP); |
| 394 | uint32_t infoLen = sizeof(EndpointAttrBwCoeff); | 394 | uint32_t infoLen = sizeof(EndpointAttrBwCoeff); |
| 395 | EndpointAttrBwCoeff bwCoeff{}; | 395 | EndpointAttrBwCoeff bwCoeff{}; |
| 396 | ret = HcclRankGraphGetEndpointInfo(comm, 0, &endpointDesc[i], ENDPOINT_ATTR_BW_COEFF, infoLen, &bwCoeff); | 396 | ret = HcclRankGraphGetEndpointInfo(comm, 0, &endpointDesc[i], ENDPOINT_ATTR_BW_COEFF, infoLen, &bwCoeff); |
| @@ -464,14 +464,14 @@ DevUbUboeConnection::DevUbUboeConnection( | |||
| 464 | tpProtocol = TpProtocol::UBOE; | 464 | tpProtocol = TpProtocol::UBOE; |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | -DevUbUbgConnection::DevUbUbgConnection( | 467 | +DevUbRtpConnection::DevUbRtpConnection( |
| 468 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, | 468 | const RdmaHandle rdmaHandle, const IpAddress& locAddr, const IpAddress& rmtAddr, const OpMode opMode, |
| 469 | const bool devUsed, const HrtUbJfcMode jfcMode, const IpAddress& locAddrEid, const IpAddress& rmtAddrEid, | 469 | const bool devUsed, const HrtUbJfcMode jfcMode, const IpAddress& locAddrEid, const IpAddress& rmtAddrEid, |
| 470 | const u8 qos, CommEngine engine, u32 sqDepth) | 470 | const u8 qos, CommEngine engine, u32 sqDepth) |
| 471 | : DevUbConnection( | 471 | : DevUbConnection( |
| 472 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddrEid, rmtAddrEid, qos, engine, sqDepth) | 472 | rdmaHandle, locAddr, rmtAddr, opMode, devUsed, jfcMode, locAddrEid, rmtAddrEid, qos, engine, sqDepth) |
| 473 | { | 473 | { |
| 474 | - tpProtocol = TpProtocol::UBG; | 474 | + tpProtocol = TpProtocol::UB_RTP; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | std::vector<char> DevUbConnection::GetUniqueId() const | 477 | std::vector<char> DevUbConnection::GetUniqueId() const |


#1 [建议] UB协议枚举重命名不完整,UBC_TP未同步重命名
include/hcomm_res_defs.h:127COMM_PROTOCOL_UBC_TP未被重命名。PR标题为"rename UB protocol enums",已将UBC_CTP→UB_CTP、UBG→UB_RTP,但同组的UBC_TP(=5)未重命名为UB_TP。无法确认这是有意保留(UBC与UB可能代表不同语义)还是遗漏,需人工确认命名意图。问题代码:
COMM_PROTOCOL_UB_CTP = 4, ///< 华为统一总线UB_CTP COMM_PROTOCOL_UBC_CTP = COMM_PROTOCOL_UB_CTP, ///< 兼容旧协议名UBC_CTP COMM_PROTOCOL_UBC_TP = 5, ///< 华为统一总线UBC_TP修复建议: 若
UBC_TP也应统一为UB_前缀,则补充:COMM_PROTOCOL_UB_TP = 5, ///< 华为统一总线UB_TP COMM_PROTOCOL_UBC_TP = COMM_PROTOCOL_UB_TP, ///< 兼容旧协议名UBC_TP若
UBC_TP为有意保留的最终命名,建议在PR描述或注释中说明命名规则差异,避免后续维护者困惑。查看代码对比