LCOV - code coverage report
Current view: top level - legacy/ascend910/platform/inc/adapter - adapter_hccp.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 74.4 % 43 32
Test Date: 2026-07-28 12:11:00 Functions: 62.5 % 16 10

            Line data    Source code
       1              : /**
       2              :  * Copyright (c) 2025 Huawei Technologies Co., Ltd.
       3              :  * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
       4              :  * CANN Open Software License Agreement Version 2.0 (the "License").
       5              :  * Please refer to the License for details. You may not use this file except in compliance with the License.
       6              :  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
       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.
       9              :  */
      10              : 
      11              : #ifndef HCOMM_HCCL_INC_ADAPTER_HCCP_H
      12              : #define HCOMM_HCCL_INC_ADAPTER_HCCP_H
      13              : 
      14              : #include <functional>
      15              : 
      16              : #include "hccl/base.h"
      17              : // ltm路径指定
      18              : #include "network/hccp.h"
      19              : #include "hccl_common.h"
      20              : #include "workflow_pub.h"
      21              : #include "network/hccp_tlv.h"
      22              : #include "adapter_hccp_common.h"
      23              : 
      24              : constexpr u64 SOCKET_SEND_MAX_SIZE = 0x7FFFFFFFFFFFFFFF;
      25              : constexpr u32 MAX_VALUE_U32 = 0xFFFFFFFF; // u32 数据类型最大值
      26              : constexpr u32 MAX_SRQ_DEPTH = 16 * 1024 - 1;
      27              : constexpr u32 DEFAULT_INIT_PHY_ID = 0;
      28              : constexpr u32 DEFAULT_INIT_NIC_POS = 0;
      29              : constexpr u32 DEFAULT_HDC_TYPE = 6;
      30              : constexpr u32 PID_HDC_TYPE = 18;
      31              : constexpr u32 DEFAULT_INIT_RDMA_CONFIG = 0; // 初始化rdma rdev_init_info默认初始化参数
      32              : constexpr u32 MAX_PORT_ID = 65535;
      33              : constexpr u32 MIN_PORT_ID = 1024;
      34              : constexpr u32 AUTO_LISTEN_PORT = 0;
      35              : constexpr u32 MAX_SEND_SGE_NUM = 8;
      36              : constexpr u32 HOST_SQ_CQ_DEPTH = 8192;  // 8K
      37              : constexpr u32 AICPU_SQ_CQ_DEPTH = 2048; // 2K
      38              : 
      39              : // QP CQ default attr
      40              : constexpr u32 DEFAULT_OPBASE_MAX_SEND_WR = 32768;
      41              : constexpr u32 DEFAULT_OFFLINE_MAX_SEND_WR = 128;
      42              : constexpr u32 DEFAULT_MAX_RECV_WR = 128;
      43              : constexpr u32 DEFAULT_MAX_SEND_SGE = 1;
      44              : constexpr u32 DEFAULT_MAX_RECV_SGE = 1;
      45              : constexpr u32 DEFAULT_MAX_SEND_CQ_DEPTH = 32768;
      46              : constexpr u32 DEFAULT_MAX_ONE_SIDED_SEND_CQ_DEPTH = 512;
      47              : constexpr u32 DEFAULT_MAX_RECV_CQ_DEPTH = 128;
      48              : constexpr u32 DEFAULT_MAX_INLINE_DATA = 32;
      49              : constexpr u32 HETEROG_OFFLINE_EXT_MAX_SEND_WR = 512;
      50              : 
      51              : constexpr u32 AI_QP_CREATE = 68;    // RA_RS_AI_QP_CREATE 的 opcode为68
      52              : constexpr u32 AI_QP_CREATE_VERSION = 2; // 当前支持的版本号为2
      53              : constexpr u32 AI_NORMAL_QP_CREATE_VERSION = 3; // 支持创建NormalQP的版本号为3
      54              : constexpr u32 AI_QP_CREATE_WITH_ATTRS = 86; // RA_RS_AI_QP_CREATE_WITH_ATTRS  的 opcode为86
      55              : constexpr u32 AI_QP_CREATE_WITH_ATTRS_VERSION = 1; // 当前支持的版本号为1
      56              : 
      57              : constexpr u32 GET_HCCH_CFG = 100;
      58              : constexpr u32 GET_HCCH_CFG_VERSION = 1;  // 当前支持的版本号为1
      59              : 
      60              : const std::string SOC_NAME_910B = "Ascend910B";
      61              : 
      62              : constexpr u32 RA_RS_GET_ROCE_API= 96; // RA_RS_GET_ROCE_API 的 opcode为96
      63              : constexpr u32 RA_RS_ATOMIC_WRITE_VERSION = 1; // 支持使用atomic write的版本号为1
      64              : 
      65              : constexpr u32 QP_DEPTH_MAX = 32768;
      66              : constexpr u32 QP_DEPTH_MIN = 128;
      67              : 
      68              : using QpConfig = struct QpConfigDef {
      69              :     hccl::HcclIpAddress selfIp;
      70              :     hccl::HcclIpAddress peerIp;
      71              :     u32 maxWr;
      72              :     u32 maxSendSge;
      73              :     u32 maxRecvSge; 
      74              :     s32 sqEvent;
      75              :     s32 rqEvent;
      76              : 
      77            1 :     QpConfigDef(hccl::HcclIpAddress &selfIp, hccl::HcclIpAddress &peerIp, u32 maxWr, u32 maxSendSge,
      78              :         u32 maxRecvSge, s32 sqEvent, s32 rqEvent)
      79            1 :         : selfIp(selfIp),
      80            1 :           peerIp(peerIp),
      81            1 :           maxWr(maxWr),
      82            1 :           maxSendSge(maxSendSge),
      83            1 :           maxRecvSge(maxRecvSge),
      84            1 :           sqEvent(sqEvent),
      85            1 :           rqEvent(rqEvent)
      86            1 :     {}
      87            1 :     QpConfigDef(u32 maxWr, u32 maxSendSge, u32 maxRecvSge, s32 sqEvent, s32 rqEvent)
      88            1 :         : maxWr(maxWr), maxSendSge(maxSendSge), maxRecvSge(maxRecvSge), sqEvent(sqEvent), rqEvent(rqEvent)
      89            1 :     {}
      90           11 :     QpConfigDef() : maxWr(0), maxSendSge(0), maxRecvSge(0), sqEvent(0), rqEvent(0) {}
      91              : };
      92              : 
      93              : using QpInfo = struct QpInfoDef {
      94              :     QpConfig attr;
      95              :     RdmaHandle rdmaHandle;
      96              :     QpHandle qpHandle;
      97              :     struct ibv_qp* qp;
      98              :     void* context;
      99              :     struct ibv_cq* sendCq;
     100              :     struct ibv_cq* recvCq;
     101              :     struct ibv_srq *srq;
     102              :     struct ibv_cq* srqCq;
     103              :     void *srqContext;
     104              :     struct ibv_comp_channel *sendChannel;
     105              :     struct ibv_comp_channel *recvChannel;
     106              :     s32 flag = 0;
     107              :     s32 qpMode = 0;
     108              :     u32 trafficClass;
     109              :     u32 serviceLevel;
     110           22 :     QpInfoDef() : rdmaHandle(nullptr), qpHandle(nullptr), qp(nullptr), context(nullptr), sendCq(nullptr),
     111           11 :         recvCq(nullptr), srq(nullptr), srqCq(nullptr), srqContext(nullptr),
     112           11 :         sendChannel(nullptr), recvChannel(nullptr), trafficClass(HCCL_COMM_TRAFFIC_CLASS_CONFIG_NOT_SET),
     113           11 :         serviceLevel(HCCL_COMM_SERVICE_LEVEL_CONFIG_NOT_SET) {}
     114            2 :     QpInfoDef(QpConfig attr, RdmaHandle rdmaHandle, QpHandle qpHandle, struct ibv_qp* qp, void* context,
     115              :               struct ibv_cq* sendCq, struct ibv_cq* recvCq, struct ibv_srq *srq, struct ibv_cq* srqCq,
     116              :               void *srqContext = nullptr, struct ibv_comp_channel *sendChannel = nullptr,
     117              :               struct ibv_comp_channel *recvChannel = nullptr, u32 tc = HCCL_COMM_TRAFFIC_CLASS_CONFIG_NOT_SET,
     118              :               u32 sl = HCCL_COMM_SERVICE_LEVEL_CONFIG_NOT_SET)
     119            2 :         : attr(attr), rdmaHandle(rdmaHandle), qpHandle(qpHandle), qp(qp), context(context), sendCq(sendCq),
     120            2 :         recvCq(recvCq), srq(srq), srqCq(srqCq), srqContext(srqContext),
     121            2 :         sendChannel(sendChannel), recvChannel(recvChannel), trafficClass(tc), serviceLevel(sl) {}
     122              : };
     123              : 
     124              : using QpConfigInfo = struct QpConfigInfoDef {
     125              :     uint32_t sq_depth;
     126              :     uint32_t rq_depth;
     127              :     uint32_t scq_depth;
     128              :     uint32_t rcq_depth;
     129              :     uint32_t use_resv_mem;
     130              :     uint32_t resv_mem_pool_id;
     131              : };
     132              : 
     133              : using QpConfigWithCQInfo = struct QpConfigWithCQInfoDef {
     134              :     uint32_t sq_depth;
     135              :     uint32_t rq_depth;
     136              :     uint32_t scq_depth;
     137              :     uint32_t rcq_depth;
     138              :     uint32_t sendCqn;
     139              :     uint32_t recvCqn;
     140              :     uint32_t use_resv_mem;
     141              :     uint32_t resv_mem_pool_id;
     142              :     int sq_sig_all;
     143              :     uint32_t max_send_sge;
     144              :     uint32_t max_recv_sge;
     145              :     uint32_t max_inline_data;
     146              : };
     147              : 
     148              : 
     149              : using CqInfo = struct CqInfoDef {
     150              :     struct ibv_cq* sq;
     151              :     struct ibv_cq* rq;
     152              :     void* context;
     153              :     u32 depth;
     154              :     u32 used;
     155              :     s32 sqEvent;
     156              :     s32 rqEvent;
     157              :     void *srqContext;
     158              :     struct ibv_comp_channel *sendChannel;
     159              :     struct ibv_comp_channel *recvChannel;
     160              :     std::vector<QpInfo> qps;
     161            0 :     CqInfoDef() : sq(nullptr), rq(nullptr), context(nullptr), depth(0), used(0), sqEvent(-1), rqEvent(-1),
     162            0 :         srqContext(nullptr), sendChannel(nullptr), recvChannel(nullptr) {}
     163            2 :     CqInfoDef(struct ibv_cq* sq, struct ibv_cq* rq, void* context, u32 depth, s32 sqEvent, s32 rqEvent,
     164              :         void *srqContext = nullptr, struct ibv_comp_channel *sendChannel = nullptr,
     165              :         struct ibv_comp_channel *recvChannel = nullptr)
     166            2 :         : sq(sq), rq(rq), context(context), depth(depth), used(0), sqEvent(sqEvent),
     167            2 :         rqEvent(rqEvent), srqContext(srqContext), sendChannel(sendChannel), recvChannel(recvChannel) {}
     168              : };
     169              : 
     170              : using SrqInfo = struct SrqInfoDef {
     171              :     struct ibv_srq *srq;
     172              :     struct ibv_cq* srqCq;
     173              :     void* context;
     174              :     s32 srqDepth;
     175              :     s32 srqEvent;
     176            4 :     SrqInfoDef() : srq(nullptr), srqCq(nullptr), context(nullptr), srqDepth(0), srqEvent(-1) {}
     177              : };
     178              : 
     179              : template <typename connStruct>
     180           88 : void CheckConnPort(connStruct& conn, u32 num)
     181              : {
     182          176 :     for (u32 i = 0; i < num; i++) {
     183           88 :         if (conn[i].port > MAX_PORT_ID) {
     184              :             // 未定义或者已定义但不合法的情况下,port默认赋值16666
     185            0 :             HCCL_WARNING("Port is invalid, set to 16666!");
     186            0 :             conn[i].port = HETEROG_CCL_PORT;
     187              :         }
     188              :     }
     189           88 : }
     190              : 
     191           16 : inline HcclResult CheckQpDepth(uint32_t depth)
     192              : {
     193           16 :     if ((depth == INVALID_UINT) ||
     194            0 :         (depth >= QP_DEPTH_MIN && ((depth & (depth - 1)) == 0) && depth <= QP_DEPTH_MAX)) {
     195           16 :         return HCCL_SUCCESS;
     196              :     }
     197            0 :     return HCCL_E_PARA;
     198              : }
     199              : 
     200              : HcclResult ConstructQpAttrs(s32 qpMode, struct QpExtAttrs &attrs, const QueueDepthAttr& qpDepth,
     201              :     bool isWorkFlowLib = false);
     202              : 
     203              : HcclResult HrtRaGetQpDepth(RdmaHandle rdmaHandle, unsigned int *tempDepth, unsigned int *qpNum);
     204              : HcclResult HrtRaSetQpDepth(RdmaHandle rdmaHandle, unsigned int tempDepth, unsigned int *qpNum);
     205              : HcclResult HrtRaQpCreate(RdmaHandle rdmaHandle, int flag, int qpMode, QpHandle &qpHandle);
     206              : HcclResult HrtRaQpDestroy(QpHandle handle);
     207              : HcclResult HrtRaQpDestroyWithoutCQ(QpHandle handle);
     208              : HcclResult HrtRaQpNonBlockConnectAsync(QpHandle handle, const SocketHandle sockHandle);
     209              : HcclResult HrtRaQpConnectAsync(QpHandle handle, const SocketHandle sockHandle,
     210            0 :     std::function<bool()> needStop = []() { return false; }, u32 timeout = 0);
     211              : s32 hrtGetRaQpStatus(QpHandle handle, int *status);
     212              : HcclResult HrtRaMrReg(QpHandle handle, struct MrInfoT *mrInfo);
     213              : HcclResult HrtRaGetNotifyMrInfo(u32 phyId, RdmaHandle handle, struct MrInfoT *mrInfo);
     214              : HcclResult HrtRaMrDereg(QpHandle handle, struct MrInfoT *mrInfo);
     215              : HcclResult HrtRaSendWr(QpHandle handle, struct SendWr *wr, struct SendWrRsp *opRsp);
     216              : HcclResult HrtRaSendWrV2(QpHandle handle, struct SendWrV2 *wr, struct SendWrRsp *opRsp,
     217              :     HcclWorkflowMode workflowMode = HcclWorkflowMode::HCCL_WORKFLOW_MODE_OP_BASE);
     218              : HcclResult HrtRaSendWrVerbs(QpHandle handle, struct SendWrVerbs *wr, struct SendWrRsp *opRsp);
     219              : HcclResult HrtRaRecvWrVerbs(QpHandle handle, struct RecvWrVerbs *wr);
     220              : s32 hrtRaPollCq(QpHandle handle, bool is_send_cq, unsigned int num, void *wc);
     221              : s32 HrtRaPollTypicalCq(void* cqHandle, u32 num, void *wc);
     222              : HcclResult HrtRaSendWrlist(QpHandle handle, struct SendWrlistData wr[], struct SendWrRsp opRsp[],
     223              :     unsigned int sendNum, unsigned int *completeNum);
     224              : HcclResult HrtRaSendWrlistExt(QpHandle handle, struct SendWrlistDataExt wr[], struct SendWrRsp opRsp[],
     225              :     unsigned int sendNum, unsigned int *completeNum);
     226              : HcclResult HrtRaSendNormalWrlist(QpHandle handle, struct WrInfo wr[], struct SendWrRsp opRsp[],
     227              :                            unsigned int sendNum, unsigned int *completeNum);
     228              : HcclResult HrtRaGetNotifyBaseAddr(RdmaHandle handle, u64 *va, u64 *size,
     229            0 :     std::function<bool()> needStop = []() { return false; });
     230              : HcclResult HrtRaInit(struct RaInitConfig *config);
     231              : HcclResult HrtRaDeInit(struct RaInitConfig *config);
     232              : 
     233              : HcclResult HrtRaRdmaInit(int mode, u32 notifyType, struct rdev rdevInfo, RdmaHandle &rdmaHandle);
     234              : HcclResult HrtRaRdmaInitRef(int mode, u32 notifyType, const struct rdev &rdevInfo, RdmaHandle &rdmaHandle);
     235              : HcclResult HrtRaRdmaInitWithAttr(struct RdevInitInfo &init_info, const struct rdev &rdevInfo, RdmaHandle &rdmaHandle);
     236              : HcclResult HrtRdmaInitWithBackupAttr(struct RdevInitInfo &init_info, struct rdev &rdevInfo,
     237              :     struct rdev &backupRdevInfo, RdmaHandle &rdmaHandle);
     238              : HcclResult HrtRaRdmaGetHandle(unsigned int phyId, RdmaHandle &rdmaHandle);
     239              : HcclResult HrtRaRdmaDeInit(RdmaHandle &rdmaHandle, u32 notifyType);
     240              : HcclResult HrtRaRdmaDeInitRef(RdmaHandle &rdmaHandle, u32 notifyType);
     241              : HcclResult HrtGetRdmaLiteStatus(RdmaHandle rdmaHandle, int *supportLite);
     242              : HcclResult hrtRaSocketInit(int mode, struct rdev rdevInfo, SocketHandle &socketHandle);
     243              : HcclResult hrtRaSocketInitRef(int mode, const struct rdev &rdevInfo, SocketHandle &socketHandle);
     244              : HcclResult hrtRaSocketInitV1(int mode, struct SocketInitInfoT socket_init, SocketHandle &socketHandle);
     245              : HcclResult hrtRaSocketDeInit(SocketHandle &socketHandle);
     246              : HcclResult hrtRaSocketDeInitRef(SocketHandle &socketHandle);
     247              : 
     248              : HcclResult hrtRaSocketNonBlockListenStart(struct SocketListenInfoT conn[], u32 num);
     249              : HcclResult hrtRaSocketListenStart(struct SocketListenInfoT conn[], u32 num);
     250              : HcclResult hrtRaSocketAcceptCreditAdd(struct SocketListenInfoT conn[], u32 num, u32 creditLimit);
     251              : HcclResult hrtRaSocketListenStop(struct SocketListenInfoT conn[], u32 num);
     252              : HcclResult hrtRaSocketNonBlockBatchConnect(struct SocketConnectInfoT conn[], u32 num);
     253              : HcclResult hrtRaSocketBatchConnect(struct SocketConnectInfoT conn[], u32 num, u32 maxLen = MAX_VALUE_U32,
     254            0 :     std::function<bool()> needStop = []() { return false; });
     255              : HcclResult hrtRaSocketBatchClose(struct SocketCloseInfoT conn[], u32 num, u32 maxLen = MAX_VALUE_U32);
     256              : s32 hrtRaGetSockets(u32 role, struct SocketInfoT conn[], u32 num, u32 *connectedNum);
     257              : HcclResult hrtRaNonBlockGetSockets(u32 role, struct SocketInfoT conn[], u32 num, u32 *connectedNum);
     258              : HcclResult hrtRaBlockGetSockets(u32 role, struct SocketInfoT conn[], u32 num);
     259              : HcclResult hrtRaSocketNonBlockSendHeterog(const FdHandle fdHandle, const void *data, u64 size, u64 *sentSize);
     260              : s32 hrtRaSocketNonBlockSend(const FdHandle fdHandle, const void *data, u64 size, u64 *sentSize);
     261              : HcclResult hrtRaSocketNonBlockSendHeart(const FdHandle fdHandle, const void *data, u64 size, u64 *sentSize);
     262              : HcclResult hrtRaSocketBlockSend(const FdHandle fdHandle, const void *data, u64 sendSize,
     263            0 :     std::function<bool()> needStop = []() { return false; });
     264              : HcclResult  hrtRaSocketNonBlockRecvHeterog(const FdHandle fdHandle, void *data, u64 size, u64 *recvSize);
     265              : s32 hrtRaSocketNonBlockRecv(const FdHandle fdHandle, void *data, u64 size, u64 *recvSize);
     266              : HcclResult hrtRaSocketNonBlockRecvHeart(const FdHandle fdHandle, void *data, u64 size, u64 *recvSize);
     267              : HcclResult hrtRaSocketBlockRecv(const FdHandle fdHandle, void *data, u64 size,
     268            0 :     std::function<bool()> needStop = []() { return false; }, u32 timeout = 0);
     269              : 
     270              : s32 hrtRaSocketRecv(const FdHandle fdHandle, void *data, u64 size, u64 *recvSize);
     271              : 
     272              : HcclResult IsSupportHdcAsync(bool &isSupportHdcAsync);
     273              : s32 hrtRaSocketSendAsync(const FdHandle fdHandle, const void *data, u64 size, u64 *sentSize, void **reqHandle);
     274              : s32 hrtRaSocketRecvAsync(const FdHandle fdHandle, void *data, u64 size, u64 *receivedSize, void **reqHandle);
     275              : s32 hrtRaSocketGetAsyncReqResult(void *reqHandle, s32 *reqResult);
     276              : 
     277              : HcclResult hrtEpollCtlAdd(const FdHandle fdHandle, RaEpollEvent event);
     278              : HcclResult hrtEpollCtlMod(const FdHandle fdHandle, RaEpollEvent event);
     279              : HcclResult hrtEpollCtlDel(const FdHandle fdHandle);
     280              : HcclResult hrtSetRecvDataCallback(const SocketHandle socketHandle, const void *callback);
     281              : 
     282              : HcclResult hrtGetServerId(std::string& serverId);
     283              : HcclResult hrtGetIfNum(struct RaGetIfattr &config, u32 &num);
     284              : HcclResult hrtGetIfAddress(struct RaGetIfattr &config, struct InterfaceInfo ifaddrInfos[], u32 &num);
     285              : HcclResult hrtRaGetInterfaceVersion(unsigned int phyId, unsigned int interfaceOpcode,
     286              :     unsigned int* interfaceVersion);
     287              : HcclResult hrtRaSocketSetWhiteListStatus(u32 enable);
     288              : HcclResult hrtRaSocketGetWhiteListStatus(u32 &enable);
     289              : HcclResult hrtRaSocketWhiteListAdd(SocketHandle socketHandle, struct SocketWlistInfoT whiteList[], u32 num);
     290              : HcclResult hrtRaSocketWhiteListDel(SocketHandle socketHandle, struct SocketWlistInfoT whiteList[], u32 num);
     291              : HcclResult hrtRaRegGlobalMr(const RdmaHandle rdmaHandle, struct MrInfoT &mrInfo, MrHandle &mrHandle);
     292              : HcclResult hrtRaDeRegGlobalMr(const RdmaHandle rdmaHandle, MrHandle mrHandle);
     293              : HcclResult hrtRaNormalQpCreate(RdmaHandle handle, struct ibv_qp_init_attr* initAttr, QpHandle &qpHandle,
     294              :     struct ibv_qp* &qp);
     295              : HcclResult hrtRaNormalQpDestroy(QpHandle qpHandle);
     296              : HcclResult hrtRaCreateCq(RdmaHandle handle, struct CqAttr* attr);
     297              : HcclResult hrtRaDestroyCq(RdmaHandle handle, struct CqAttr* attr);
     298              : HcclResult CreateNormalQp(RdmaHandle rdmaHandle, QpInfo& qp);
     299              : HcclResult CreateQp(RdmaHandle rdmaHandle, int& flag, s32& qpMode, QpInfo& qp, bool isESMode = false);
     300              : HcclResult CreateCqAndQp(RdmaHandle &rdmaHandle, std::string &label, QpConfig &config, QpInfo &info);
     301              : HcclResult CreateQpWithSharedCq(RdmaHandle rdmaHandle, hccl::HcclIpAddress &selfIp, hccl::HcclIpAddress &peerIp,
     302              :     s32 sqEvent, s32 rqEvent, QpInfo &info, s32 qpAppend = 0, u32 maxSegNum = MAX_SEND_SGE_NUM);
     303              : HcclResult DestroyQpWithSharedCq(const QpInfo& info, s32 qpAppend);
     304              : HcclResult CreateQpWithCq(RdmaHandle rdmaHandle, s32 sqEvent, s32 rqEvent, RdmaHandle sendChannel,
     305              :     RdmaHandle recvChannel, QpInfo& info, bool isHdcMode = false, bool isESMode = false);
     306              : HcclResult DestroyQpWithCq(const QpInfo& info, bool isHdcMode = false);
     307              : HcclResult CreateAiQp(RdmaHandle rdmaHandle, struct AiQpInfo &aiQpInfo, QpInfo &info, u32 devicePhyId);
     308              : HcclResult DestroyAiQp(const QpInfo &info);
     309              : HcclResult hrtRaSetQpAttrQos(QpHandle qpHandle, struct QosAttr &attr);
     310              : HcclResult hrtRaSetQpAttrTimeOut(QpHandle qpHandle, u32 &timeOut);
     311              : HcclResult hrtRaSetQpAttrRetryCnt(QpHandle qpHandle, u32 &retryCnt);
     312              : HcclResult SetQpAttrQos(QpHandle qpHandle, u32 tc = HCCL_COMM_TRAFFIC_CLASS_CONFIG_NOT_SET,
     313              :     u32 sl = HCCL_COMM_SERVICE_LEVEL_CONFIG_NOT_SET);
     314              : HcclResult SetQpAttrTimeOut(QpHandle qpHandle);
     315              : HcclResult SetQpAttrRetryCnt(QpHandle qpHandle);
     316              : HcclResult hrtRaCreateCompChannel(RdmaHandle rdmaHandle, void **compChannel);
     317              : HcclResult hrtRaDestroyCompChannel(RdmaHandle rdmaHandle, void *compChannel);
     318              : HcclResult hrtRaGetCqeErrInfo(unsigned int phyId, struct CqeErrInfo *info);
     319              : HcclResult hrtRaGetCqeErrInfoList(RdmaHandle rdmaHandle, struct CqeErrInfo *infolist, u32 *num);
     320              : HcclResult IsSuppCqeErrInfoListConfig(bool& supCqeErrInfoListConfig);
     321              : HcclResult IsSupportRaSendNormalWrlist(bool& isSupportRaSendNormalWrlist);
     322              : HcclResult hrtRaGetQpAttr(QpHandle qpHandle, struct QpAttr *attr);
     323              : HcclResult hrtRaCreateSrq(RdmaHandle rdmaHandle, SrqInfo &srqInfo);
     324              : HcclResult hrtRaDestroySrq(RdmaHandle rdmaHandle, SrqInfo &srqInfo);
     325              : HcclResult hrtRaRecvWrlist(QpHandle handle, struct RecvWrlistData *wr, unsigned int recvNum,
     326              :     unsigned int *completeNum);
     327              : 
     328              : HcclResult hrtRaQpCreateWithAttrs(RdmaHandle rdmaHandle, struct QpExtAttrs *attrs, QpHandle &qpHandle);
     329              : HcclResult hrtRaQpCreateWithCQWithAttrs(RdmaHandle rdmaHandle, struct QpExtAttrs *attrs,
     330              :     unsigned int sendCqn, unsigned int recvCqn, QpHandle &qpHandle);
     331              : HcclResult hrtRaAiQpCreate(u32 phyId, RdmaHandle rdmaHandle, struct QpExtAttrs *attrs,
     332              :     struct AiQpInfo *info, QpHandle &qpHandle);
     333              : 
     334              : HcclResult IsSuppportRaGetSocketVnicIps(bool& supportGetSocketVnicIp);
     335              : HcclResult hrtRaGetSocketVnicIpInfos(u32 phyId, enum IdType type, std::vector<u32> deviceIds,
     336              :     std::vector<hccl::HcclIpAddress> &vnicIps);
     337              : 
     338              : HcclResult hrtRaPingInit(struct PingInitAttr *initAttr, struct PingInitInfo *initInfo, void **pingHandle);
     339              : HcclResult hrtRaPingDeinit(void *pingHandle);
     340              : HcclResult hrtRaPingTargetAdd(void *pingHandle, struct PingTargetInfo target[], uint32_t num);
     341              : HcclResult hrtRaPingTargetDel(void *pingHandle, struct PingTargetCommInfo target[], uint32_t num);
     342              : HcclResult hrtRaPingTaskStart(void *pingHandle, struct PingTaskAttr *attr);
     343              : HcclResult hrtRaPingTaskStop(void *pingHandle);
     344              : HcclResult hrtRaPingGetResults(void *pingHandle, struct PingTargetResult target[], uint32_t *num);
     345              : 
     346              : HcclResult hrtRaIsFirstUsed(s32 insId, bool &used);
     347              : HcclResult hrtRaIsLastUsed(s32 insId, bool &used);
     348              : HcclResult hrtRaQpBatchModify(RdmaHandle rdmaHandle, QpHandle qpHandle[], unsigned int num, int expectStatus);
     349              : HcclResult hrtRaTypicalQpCreate(RdmaHandle rdmaHandle, int flag,
     350              :     int qpMode, struct TypicalQp* qpInfo, QpHandle &qpHandle);
     351              : HcclResult hrtRaTypicalQpModify(QpHandle qpHandle, struct TypicalQp* localQpInfo, struct TypicalQp* remoteQpInfo);
     352              : HcclResult hrtRaTypicalSendWr(QpHandle handle, struct SendWr *wr, struct SendWrRsp *opRsp);
     353              : HcclResult hrtRaRdevGetPortStatus(RdmaHandle rdmaHandle, enum PortStatus *status);
     354              : HcclResult HrtRaRemapMr(RdmaHandle rdmaHandle, struct MemRemapInfo info[], unsigned int num);
     355              : HcclResult HrtRaGetTlsEnable(struct RaInfo *info, bool *tlsEnable);
     356              : // 目前该接口只支持peer模式,且只适用于终止未建链成功的链路,即未get_socket成功的链路
     357              : HcclResult hrtRaSocketNonBlockBatchAbort(SocketConnectInfoT conn[], u32 num);
     358              : 
     359              : HcclResult CreateQpWithDepthConfig(RdmaHandle rdmaHandle, s32 qpMode, const QpConfigInfo& qpConfig, QpHandle &qpHandle, struct TypicalQp& qpInfo);
     360              : HcclResult CreateQpWithCQConfig(RdmaHandle rdmaHandle, s32 qpMode, const QpConfigWithCQInfo& qpConfig, QpHandle &qpHandle, struct TypicalQp& qpInfo);
     361              : HcclResult CreateTypicalCq(RdmaHandle rdmaHandle, u32 cqDepth, u32 &cqn, void **cqHandle);
     362              : HcclResult DestroyTypicalCq(RdmaHandle rdmaHandle, u32 cqn, void *cqHandle);
     363              : HcclResult IsSupportRaSocketAbort(bool& isSupportRaSocketAbort);
     364              : HcclResult hrtRaGetSecRandom(struct RaInfo *info, unsigned int* token);
     365              : HcclResult hrtRaGetDevEidInfoNum(RaInfo info, unsigned int* num);
     366              : HcclResult hrtRaGetDevEidInfoList(RaInfo info, struct HccpDevEidInfo *eid_info, unsigned int* num);
     367              : #endif
        

Generated by: LCOV version 2.0-1