LCOV - code coverage report
Current view: top level - base_comm/resources/hccp/rdma_service - rs.h (source / functions) Coverage Total Hit
Test: coverage.info Lines: 86.8 % 38 33
Test Date: 2026-08-18 17:47:01 Functions: 84.4 % 32 27

            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 RS_H
      12              : #define RS_H
      13              : 
      14              : #include <unistd.h>
      15              : #include <stdbool.h>
      16              : #include <sys/time.h>
      17              : #include <infiniband/verbs.h>
      18              : #include <infiniband/driver.h>
      19              : #include "hccp_common.h"
      20              : #include "user_log.h"
      21              : #include "ra_rs_comm.h"
      22              : 
      23              : #define PROCESS_RS_SIGN_LENGTH 49
      24              : #define PROCESS_RS_RESV_LENGTH 4
      25              : #define EXP_DEVNUM 2
      26              : 
      27              : struct RsMrRegInfo {
      28              :     unsigned int phyId;
      29              :     char *addr;
      30              :     unsigned long long len;
      31              :     int access;
      32              : };
      33              : 
      34              : struct ProcessRsSign {
      35              :     int tgid;
      36              :     char sign[PROCESS_RS_SIGN_LENGTH];
      37              :     char resv[PROCESS_RS_RESV_LENGTH];
      38              : };
      39              : 
      40              : struct RsQpNorm {
      41              :     int flag;
      42              :     int qpMode;
      43              :     int isExp;
      44              :     int isExt;
      45              :     int memAlign; // 0,1:4KB, 2:2MB
      46              : };
      47              : 
      48              : struct RsQpStatusInfo {
      49              :     int status;
      50              :     unsigned int udpSport;
      51              : };
      52              : 
      53              : struct RsWrlistBaseInfo {
      54              :     unsigned int phyId;
      55              :     unsigned int rdevIndex;
      56              :     unsigned int qpn;
      57              :     unsigned int keyFlag;
      58              : };
      59              : 
      60              : struct RsLinuxVersionInfo {
      61              :     int major;
      62              :     int minor;
      63              :     int patch;
      64              : };
      65              : 
      66              : #if defined(HNS_ROCE_LLT) || defined(DEFINE_HNS_LLT)
      67              : #define STATIC
      68              : #else
      69              : #define STATIC static
      70              : #endif
      71              : 
      72              : #ifdef __cplusplus
      73              : extern "C" {
      74              : #endif
      75              : 
      76              : /* ++++++++++++++++++++++++++++++RDMA API for RA++++++++++++++++++++++++++++++++++ */
      77              : /*
      78              :  * rs_open
      79              :  * flag: bit0: 0 = RC, 1= UD
      80              :  */
      81              : #define MS_PER_SECOND_F 1000.0
      82              : #define US_PER_MS_F 1000.0
      83              : #define MS_PER_SECOND_I 1000
      84              : #define RS_EXPECT_TIME_MAX 200.0 // ms
      85              : 
      86              : #define RS_GID_SEQ_NUM 4
      87              : #define RS_GID_SEQ_ZERO 0
      88              : #define RS_GID_SEQ_ONE 1
      89              : #define RS_GID_SEQ_TWO 2
      90              : #define RS_GID_SEQ_THREE 3
      91              : 
      92              : #define RS_ATTRI_VISI_DEF __attribute__((visibility("default")))
      93              : 
      94              : RS_ATTRI_VISI_DEF int RsSetTsqpDepth(unsigned int phyId, unsigned int rdevIndex, unsigned int tempDepth,
      95              :     unsigned int *qpNum);
      96              : RS_ATTRI_VISI_DEF int RsGetTsqpDepth(unsigned int phyId, unsigned int rdevIndex, unsigned int *tempDepth,
      97              :     unsigned int *qpNum);
      98              : RS_ATTRI_VISI_DEF int RsQpCreate(unsigned int phyId, unsigned int rdevIndex, struct RsQpNorm qpNorm,
      99              :     struct RsQpResp *qpResp);
     100              : RS_ATTRI_VISI_DEF int RsQpCreateWithAttrs(unsigned int phyId, unsigned int rdevIndex, struct RsQpNormWithAttrs *qpNorm,
     101              :     struct RsQpRespWithAttrs *qpResp);
     102              : RS_ATTRI_VISI_DEF int RsQpDestroy(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn);
     103              : RS_ATTRI_VISI_DEF int RsQpDestroyWithoutCQ(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn);
     104              : RS_ATTRI_VISI_DEF int RsTypicalQpModify(unsigned int phyId, unsigned int rdevIndex, struct TypicalQp localQpInfo,
     105              :     struct TypicalQp remoteQpInfo, struct TypicalQpAttr *qpAttr);
     106              : RS_ATTRI_VISI_DEF int RsTypicalCqCreate(unsigned int phyId, unsigned int rdevIndex, unsigned int cqDepth,
     107              :     unsigned int *cqn);
     108              : RS_ATTRI_VISI_DEF int RsTypicalCqDestroy(unsigned int phyId, unsigned int rdevIndex, unsigned int cqn);
     109              : RS_ATTRI_VISI_DEF int RsQpBatchModify(unsigned int phyId, unsigned int rdevIndex, int status, int qpn[], int qpnNum);
     110              : RS_ATTRI_VISI_DEF int RsSetQpLbValue(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int lbValue);
     111              : RS_ATTRI_VISI_DEF int RsGetQpLbValue(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int *lbValue);
     112              : RS_ATTRI_VISI_DEF int RsQpConnectAsync(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int fd);
     113              : 
     114              : enum RsQpStatus {
     115              :     RS_QP_STATUS_DISCONNECT = 0,
     116              :     RS_QP_STATUS_CONNECTED = 1,
     117              :     RS_QP_STATUS_TIMEOUT = 2,
     118              :     RS_QP_STATUS_CONNECTING = 3,
     119              :     RS_QP_STATUS_REM_FD_CLOSE = 4,
     120              :     RS_QP_STATUS_PAUSE = 5,
     121              : };
     122              : 
     123              : #define RS_IS_EXP 0
     124              : #define RS_NOT_EXP 1
     125              : 
     126              : enum RsAccessFlags {
     127              :     RS_ACCESS_LOCAL_WRITE = 1,
     128              :     RS_ACCESS_REMOTE_WRITE = (1 << 1),
     129              :     RS_ACCESS_REMOTE_READ = (1 << 2UL),
     130              :     RS_ACCESS_REDUCE = (1 << 8),
     131              : };
     132              : 
     133              : struct RsInitConfig {
     134              :     unsigned int chipId;
     135              :     unsigned int hccpMode;
     136              :     unsigned int whiteListStatus;
     137              : };
     138              : 
     139              : struct RsQpConnPara {
     140              :     unsigned int phyId;
     141              :     unsigned int rdevIndex;
     142              :     uint32_t qpn;
     143              : };
     144              : 
     145              : struct RsBackupInfo {
     146              :     bool backupFlag;
     147              :     struct rdev rdevInfo;
     148              : };
     149              : 
     150              : #define RS_HEARTBEAT_TIME (1000.0 * 60) // ms
     151              : #define PTHREAD_NAME_LEN 32
     152              : 
     153              : struct RsPthreadInfo {
     154              :     char pthreadName[PTHREAD_NAME_LEN];
     155              :     struct timeval lastCheckTime;
     156              : };
     157              : 
     158              : RS_ATTRI_VISI_DEF int RsMrReg(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     159              :     struct RdmaMrRegInfo *mrRegInfo);
     160              : RS_ATTRI_VISI_DEF int RsMrDereg(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, char *addr);
     161              : 
     162              : RS_ATTRI_VISI_DEF int RsRegisterMr(unsigned int phyId, unsigned int rdevIndex, struct RdmaMrRegInfo *mrRegInfo,
     163              :     void **mrHandle);
     164              : RS_ATTRI_VISI_DEF int RsTypicalRegisterMrV1(unsigned int phyId, unsigned int rdevIndex, struct RdmaMrRegInfo *mrRegInfo,
     165              :     void **mrHandle);
     166              : RS_ATTRI_VISI_DEF int RsTypicalRegisterMr(unsigned int phyId, unsigned int rdevIndex, struct RdmaMrRegInfo *mrRegInfo,
     167              :     void **mrHandle);
     168              : RS_ATTRI_VISI_DEF int RsRemapMr(unsigned int phyId, unsigned int rdevIndex, struct MemRemapInfo memList[],
     169              :     unsigned int memNum);
     170              : RS_ATTRI_VISI_DEF int RsTypicalDeregisterMr(unsigned int phyId, unsigned int devIndex, unsigned long long addr);
     171              : RS_ATTRI_VISI_DEF int RsDeregisterMr(unsigned int phyId, unsigned int rdevIndex, void *mrHandle);
     172              : 
     173              : enum RsSendFlags {
     174              :     RS_SEND_FENCE = 1 << 0,
     175              :     RS_SEND_SIGNALED = 1 << 1,
     176              :     RS_SEND_SOLICITED = 1 << 2,
     177              :     RS_SEND_INLINE = 1 << 3,
     178              : };
     179              : RS_ATTRI_VISI_DEF int RsSendWr(unsigned int phyId, unsigned int rdevIndex, uint32_t qpn, struct SendWr *wr,
     180              :     struct SendWrRsp *wrRsp);
     181              : RS_ATTRI_VISI_DEF int RsSendWrlist(struct RsWrlistBaseInfo baseInfo, struct WrInfo *wrList, unsigned int sendNum,
     182              :     struct SendWrRsp *wrRsp, unsigned int *completeNum);
     183              : 
     184              : RS_ATTRI_VISI_DEF int RsRecvWrlist(struct RsWrlistBaseInfo baseInfo, struct RecvWrlistData *wr, unsigned int recvNum,
     185              :     unsigned int *completeNum);
     186              : 
     187              : RS_ATTRI_VISI_DEF int RsGetNotifyMrInfo(unsigned int phyId, unsigned int rdevIndex, struct MrInfoT *info);
     188              : RS_ATTRI_VISI_DEF int RsSetHostPid(uint32_t phyId, pid_t hostPid, const char *pidSign);
     189              : 
     190              : RS_ATTRI_VISI_DEF int RsInit(struct RsInitConfig *cfg);
     191              : RS_ATTRI_VISI_DEF int RsGetTlsEnable(unsigned int phyId, bool *tlsEnable);
     192              : RS_ATTRI_VISI_DEF int RsGetHccnCfg(unsigned int phyId, enum HccnCfgKey key, char *value, unsigned int *valueLen);
     193              : RS_ATTRI_VISI_DEF int RsBindHostpid(unsigned int chipId, pid_t pid);
     194              : RS_ATTRI_VISI_DEF int RsDeinit(struct RsInitConfig *cfg);
     195              : 
     196            2 : RS_ATTRI_VISI_DEF int RsSocketInit(const unsigned int *vnicIp, unsigned int num);
     197              : RS_ATTRI_VISI_DEF int RsSocketDeinit(struct rdev rdevInfo);
     198              : 
     199              : RS_ATTRI_VISI_DEF int RsRdevInit(struct rdev rdevInfo, unsigned int notifyType, unsigned int *rdevIndex);
     200              : RS_ATTRI_VISI_DEF int RsRdevInitWithBackup(struct rdev rdevInfo, struct rdev backupRdevInfo, unsigned int notifyType,
     201              :     unsigned int *rdevIndex);
     202              : RS_ATTRI_VISI_DEF int RsRdevGetPortStatus(unsigned int phyId, unsigned int rdevIndex, enum PortStatus *status);
     203              : RS_ATTRI_VISI_DEF int RsGetLbMax(unsigned int phyId, unsigned int rdevIndex, int *lbMax);
     204              : RS_ATTRI_VISI_DEF int RsRdevDeinit(unsigned int phyId, unsigned int notifyType, unsigned int rdevIndex);
     205              : 
     206              : /* ++++++++++++++++++++++++++++++Epoll API start++++++++++++++++++++++++++++++++++ */
     207              : RS_ATTRI_VISI_DEF int RsEpollCtlAdd(const void *fdHandle, enum RaEpollEvent event);
     208              : RS_ATTRI_VISI_DEF int RsEpollCtlMod(const void *fdHandle, enum RaEpollEvent event);
     209              : RS_ATTRI_VISI_DEF int RsEpollCtlDel(int fd);
     210              : RS_ATTRI_VISI_DEF void RsSetTcpRecvCallback(const void *callback);
     211            4 : RS_ATTRI_VISI_DEF int RsCreateEventHandle(int *eventHandle);
     212            5 : RS_ATTRI_VISI_DEF int RsCtlEventHandle(int eventHandle, const void *fdHandle, int opcode, enum RaEpollEvent event);
     213            4 : RS_ATTRI_VISI_DEF int RsWaitEventHandle(int eventHandle, struct SocketEventInfoT *eventInfos, int timeout,
     214              :     unsigned int maxevents, unsigned int *eventsNum);
     215            4 : RS_ATTRI_VISI_DEF int RsDestroyEventHandle(int *eventHandle);
     216              : /* ++++++++++++++++++++++++++++++Epoll API end++++++++++++++++++++++++++++++++++ */
     217              : 
     218              : /* ++++++++++++++++++++++++++++++Socket API++++++++++++++++++++++++++++++++++ */
     219              : #define RS_SOCK_PORT_DEF 16666
     220           28 : RS_ATTRI_VISI_DEF int RsSocketListenStart(struct SocketListenInfo conn[], uint32_t num);
     221           22 : RS_ATTRI_VISI_DEF int RsSocketListenStop(struct SocketListenInfo conn[], uint32_t num);
     222              : 
     223           16 : RS_ATTRI_VISI_DEF int RsSocketBatchConnect(struct SocketConnectInfo conn[], uint32_t num);
     224            2 : RS_ATTRI_VISI_DEF int RsSocketBatchAbort(struct SocketConnectInfo conn[], uint32_t num);
     225              : 
     226            2 : RS_ATTRI_VISI_DEF int RsSocketGetClientSocketErrInfo(struct SocketConnectInfo conn[], struct SocketErrInfo err[],
     227              :     unsigned int num);
     228            2 : RS_ATTRI_VISI_DEF int RsSocketGetServerSocketErrInfo(struct SocketListenInfo conn[], struct ServerSocketErrInfo err[],
     229              :     unsigned int num);
     230              : 
     231              : RS_ATTRI_VISI_DEF void RsGetCurTime(struct timeval *time);
     232              : RS_ATTRI_VISI_DEF void HccpTimeInterval(struct timeval *endTime, struct timeval *startTime, float *msec);
     233            0 : RS_ATTRI_VISI_DEF int RsSocketWhiteListSwitch(unsigned int phyId, unsigned int enable);
     234           13 : RS_ATTRI_VISI_DEF int RsSocketWhiteListAdd(struct rdev rdevInfo, struct SocketWlistInfoT whiteList[], unsigned int num);
     235            2 : RS_ATTRI_VISI_DEF int RsSocketWhiteListDel(struct rdev rdevInfo, struct SocketWlistInfoT whiteList[], unsigned int num);
     236            2 : RS_ATTRI_VISI_DEF int RsSocketAcceptCreditAdd(struct SocketListenInfo conn[], uint32_t num, unsigned int creditLimit);
     237            3 : RS_ATTRI_VISI_DEF int RsGetIfnum(unsigned int phyId, bool isAll, unsigned int *num);
     238            1 : RS_ATTRI_VISI_DEF int RsPeerGetIfnum(unsigned int phyId, unsigned int *num);
     239            0 : RS_ATTRI_VISI_DEF int RsGetIfaddrs(struct IfaddrInfo ifaddrInfos[], unsigned int *num, unsigned int phyId);
     240            0 : RS_ATTRI_VISI_DEF int RsGetIfaddrsV2(struct InterfaceInfo interfaceInfos[], unsigned int *num, unsigned int phyId,
     241              :     bool isAll);
     242            1 : RS_ATTRI_VISI_DEF int RsPeerGetIfaddrs(struct InterfaceInfo interfaceInfos[], unsigned int *num, unsigned int phyId);
     243              : RS_ATTRI_VISI_DEF int RsGetVnicIp(unsigned int phyId, unsigned int *vnicIp);
     244              : RS_ATTRI_VISI_DEF int RsGetInterfaceVersion(unsigned int opcode, unsigned int *version);
     245              : RS_ATTRI_VISI_DEF int RsGetVnicIpInfos(unsigned int phyId, enum IdType type, unsigned int ids[], unsigned int num,
     246              :     struct IpInfo infos[]);
     247            1 : RS_ATTRI_VISI_DEF int RsSocketSetScopeId(unsigned int devId, int scopeId);
     248              : struct RsSocketCloseInfoT {
     249              :     int fd;
     250              : };
     251           34 : RS_ATTRI_VISI_DEF int RsSocketBatchClose(int disuseLinger, struct RsSocketCloseInfoT conn[], uint32_t num);
     252              : 
     253              : enum RsConnRole {
     254              :     RS_CONN_ROLE_SERVER = 0,
     255              :     RS_CONN_ROLE_CLIENT = 1,
     256              : };
     257              : 
     258              : enum ProductType {
     259              :     PRODUCT_TYPE_INVALID = -2,
     260              :     PRODUCT_TYPE_NO_VALUE = -1,
     261              :     PRODUCT_TYPE_310p = 0,
     262              :     PRODUCT_TYPE_910,
     263              :     PRODUCT_TYPE_910B,
     264              :     PRODUCT_TYPE_910_93,
     265              :     PRODUCT_TYPE_950,
     266              :     PRODUCT_TYPE_910_96,
     267              :     PRODUCT_TYPE_350,
     268              :     PRODUCT_TYPE_OTHERS,
     269              : };
     270              : 
     271              : enum RsSocketStatus {
     272              :     RS_SOCK_STATUS_NA = 0,
     273              :     RS_SOCK_STATUS_OK = 1,
     274              :     RS_SOCK_STATUS_TIMEOUT = 2,
     275              :     RS_SOCK_STATUS_ING = 3,
     276              : };
     277              : 
     278           31 : RS_ATTRI_VISI_DEF int RsGetSockets(uint32_t role, struct SocketFdData conn[], uint32_t num);
     279            0 : RS_ATTRI_VISI_DEF int RsGetSslEnable(uint32_t *sslEnable);
     280           83 : RS_ATTRI_VISI_DEF int RsSocketSend(int fd, const void *data, uint64_t size);
     281            0 : RS_ATTRI_VISI_DEF int RsHdcSocketSend(int fd, const void *data, uint64_t size);
     282            4 : RS_ATTRI_VISI_DEF int RsPeerSocketSend(uint32_t sslEnable, int fd, const void *data, uint64_t size);
     283           28 : RS_ATTRI_VISI_DEF int RsSocketRecv(int fd, void *data, uint64_t size);
     284            4 : RS_ATTRI_VISI_DEF int RsPeerSocketRecv(uint32_t sslEnable, int fd, void *data, uint64_t size);
     285              : RS_ATTRI_VISI_DEF int RsNotifyCfgSet(unsigned int phyId, unsigned long long va, unsigned long long size);
     286              : RS_ATTRI_VISI_DEF int RsNotifyCfgGet(unsigned int phyId, unsigned long long *va, unsigned long long *size);
     287              : RS_ATTRI_VISI_DEF void RsHeartbeatAlivePrint(struct RsPthreadInfo *pthreadInfo);
     288              : 
     289              : RS_ATTRI_VISI_DEF int RsGetQpContext(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, void **qp,
     290              :     void **sendCq, void **recvCq);
     291              : RS_ATTRI_VISI_DEF int RsGetQpStatus(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     292              :     struct RsQpStatusInfo *qpInfo);
     293              : 
     294              : int rsGetLocalDevIDByHostDevID(unsigned int phyId, unsigned int *chipId);
     295              : int rsGetDevIDByLocalDevID(unsigned int chipId, unsigned int *phyId);
     296              : 
     297              : RS_ATTRI_VISI_DEF int RsCqCreate(unsigned int phyId, unsigned int rdevIndex, struct CqAttr *attr);
     298              : RS_ATTRI_VISI_DEF int RsCqDestroy(unsigned int phyId, unsigned int rdevIndex, struct CqAttr *attr);
     299              : RS_ATTRI_VISI_DEF int RsNormalQpCreate(unsigned int phyId, unsigned int rdevIndex, struct ibv_qp_init_attr *qpInitAttr,
     300              :     struct RsQpResp *qpResp, void **qp);
     301              : RS_ATTRI_VISI_DEF int RsNormalQpDestroy(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn);
     302              : RS_ATTRI_VISI_DEF int RsSetQpAttrQos(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     303              :     struct QosAttr *attr);
     304              : RS_ATTRI_VISI_DEF int RsSetQpAttrTimeout(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     305              :     unsigned int *timeout);
     306              : RS_ATTRI_VISI_DEF int RsSetQpAttrRetryCnt(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     307              :     unsigned int *retryCnt);
     308              : RS_ATTRI_VISI_DEF int RsCreateCompChannel(unsigned int phyId, unsigned int rdevIndex, void **compChannel);
     309              : RS_ATTRI_VISI_DEF int RsDestroyCompChannel(void *compChannel);
     310              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfo(struct CqeErrInfo *info);
     311              : RS_ATTRI_VISI_DEF int RsCreateSrq(unsigned int phyId, unsigned int rdevIndex, struct SrqAttr *attr);
     312              : RS_ATTRI_VISI_DEF int RsDestroySrq(unsigned int phyId, unsigned int rdevIndex, struct SrqAttr *attr);
     313              : RS_ATTRI_VISI_DEF int RsGetLiteSupport(unsigned int phyId, unsigned int rdevIndex, int *supportLite);
     314              : RS_ATTRI_VISI_DEF int RsGetLiteRdevCap(unsigned int phyId, unsigned int rdevIndex, struct LiteRdevCapResp *resp);
     315              : RS_ATTRI_VISI_DEF int RsGetLiteQpCqAttr(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     316              :     struct LiteQpCqAttrResp *resp);
     317              : RS_ATTRI_VISI_DEF int RsGetLiteQpAttr(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     318              :     struct LiteQpAttrResp *resp);
     319              : RS_ATTRI_VISI_DEF int RsGetLiteCqAttr(unsigned int phyId, unsigned int rdevIndex, unsigned int cqn,
     320              :     struct rdma_lite_device_cq_attr *deviceCqAttr);
     321              : RS_ATTRI_VISI_DEF int RsQpCreateWithCQWithAttrs(unsigned int phyId, unsigned int rdevIndex, unsigned int sendCqn,
     322              :     unsigned int recvCqn, struct RsQpNormWithAttrs *qpNorm, struct RsQpRespWithAttrs *qpResp);
     323              : RS_ATTRI_VISI_DEF int RsGetLiteConnectedInfo(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     324              :     struct LiteConnectedInfoResp *resp);
     325              : RS_ATTRI_VISI_DEF int RsGetLiteMemAttr(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     326              :     struct LiteMemAttrResp *resp);
     327              : RS_ATTRI_VISI_DEF void RsSetCtx(unsigned int phyId);
     328              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfoNum(unsigned int phyId, unsigned int rdevIdx, unsigned int *num);
     329              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfoList(unsigned int phyId, unsigned int rdevIdx, struct CqeErrInfo *info,
     330              :     unsigned int *num);
     331              : RS_ATTRI_VISI_DEF int RsDrvGetRandomNum(int *randNum);
     332              : RS_ATTRI_VISI_DEF int RsGetSecRandom(unsigned int *value);
     333              : // note: The FIRST invocation of this function MAY throw exceptions for each process
     334              : RS_ATTRI_VISI_DEF enum ProductType RsGetProductType(int devId);
     335              : 
     336              : static inline bool RsIsTlvSupported(void)
     337              : {
     338              :     enum ProductType productType;
     339              :     productType = RsGetProductType(0); // Ensure that RsGetProductType has been called at least once
     340              :     return (productType == PRODUCT_TYPE_910B || productType == PRODUCT_TYPE_910_93 || productType == PRODUCT_TYPE_950 ||
     341              :             productType == PRODUCT_TYPE_910_96 || productType == PRODUCT_TYPE_350);
     342              : }
     343              : 
     344           88 : static inline bool RsIsRdmaSupported(void)
     345              : {
     346              :     enum ProductType productType;
     347           88 :     productType = RsGetProductType(0);
     348           88 :     return (productType == PRODUCT_TYPE_910B || productType == PRODUCT_TYPE_910_93 || productType == PRODUCT_TYPE_910);
     349              : }
     350              : 
     351           88 : static inline bool RsIsUdmaSupported(void)
     352              : {
     353              :     enum ProductType productType;
     354           88 :     productType = RsGetProductType(0);
     355           88 :     return (productType == PRODUCT_TYPE_950 || productType == PRODUCT_TYPE_910_96 || productType == PRODUCT_TYPE_350);
     356              : }
     357              : 
     358          232 : static inline bool RsIsCustomInterfaceSupported(void)
     359              : {
     360              :     enum ProductType productType;
     361          232 :     productType = RsGetProductType(0);
     362          232 :     return (productType != PRODUCT_TYPE_310p);
     363              : }
     364              : #ifdef __cplusplus
     365              : }
     366              : #endif
     367              : #endif // RS_H
        

Generated by: LCOV version 2.0-1