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-04 10:52:23 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,
     101              :     struct RsQpNormWithAttrs *qpNorm, 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,
     105              :     struct TypicalQp localQpInfo, 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,
     110              :     int status, int qpn[], int qpnNum);
     111              : RS_ATTRI_VISI_DEF int RsSetQpLbValue(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int lbValue);
     112              : RS_ATTRI_VISI_DEF int RsGetQpLbValue(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int *lbValue);
     113              : RS_ATTRI_VISI_DEF int RsQpConnectAsync(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, int fd);
     114              : 
     115              : enum RsQpStatus {
     116              :     RS_QP_STATUS_DISCONNECT = 0,
     117              :     RS_QP_STATUS_CONNECTED = 1,
     118              :     RS_QP_STATUS_TIMEOUT = 2,
     119              :     RS_QP_STATUS_CONNECTING = 3,
     120              :     RS_QP_STATUS_REM_FD_CLOSE = 4,
     121              :     RS_QP_STATUS_PAUSE = 5,
     122              : };
     123              : 
     124              : #define RS_IS_EXP       0
     125              : #define RS_NOT_EXP      1
     126              : 
     127              : enum RsAccessFlags {
     128              :     RS_ACCESS_LOCAL_WRITE  = 1,
     129              :     RS_ACCESS_REMOTE_WRITE = (1 << 1),
     130              :     RS_ACCESS_REMOTE_READ  = (1 << 2UL),
     131              :     RS_ACCESS_REDUCE       = (1 << 8),
     132              : };
     133              : 
     134              : struct RsInitConfig {
     135              :     unsigned int chipId;
     136              :     unsigned int hccpMode;
     137              :     unsigned int whiteListStatus;
     138              : };
     139              : 
     140              : struct RsQpConnPara {
     141              :     unsigned int phyId;
     142              :     unsigned int rdevIndex;
     143              :     uint32_t qpn;
     144              : };
     145              : 
     146              : struct RsBackupInfo {
     147              :     bool backupFlag;
     148              :     struct rdev rdevInfo;
     149              : };
     150              : 
     151              : #define RS_HEARTBEAT_TIME (1000.0 * 60) // ms
     152              : #define PTHREAD_NAME_LEN 32
     153              : 
     154              : struct RsPthreadInfo {
     155              :     char pthreadName[PTHREAD_NAME_LEN];
     156              :     struct timeval lastCheckTime;
     157              : };
     158              : 
     159              : RS_ATTRI_VISI_DEF int RsMrReg(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     160              :     struct RdmaMrRegInfo *mrRegInfo);
     161              : RS_ATTRI_VISI_DEF int RsMrDereg(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, char *addr);
     162              : 
     163              : RS_ATTRI_VISI_DEF int RsRegisterMr(unsigned int phyId, unsigned int rdevIndex,
     164              :     struct RdmaMrRegInfo *mrRegInfo, void **mrHandle);
     165              : RS_ATTRI_VISI_DEF int RsTypicalRegisterMrV1(unsigned int phyId, unsigned int rdevIndex,
     166              :     struct RdmaMrRegInfo *mrRegInfo, void **mrHandle);
     167              : RS_ATTRI_VISI_DEF int RsTypicalRegisterMr(unsigned int phyId, unsigned int rdevIndex,
     168              :     struct RdmaMrRegInfo *mrRegInfo, void **mrHandle);
     169              : RS_ATTRI_VISI_DEF int RsRemapMr(unsigned int phyId, unsigned int rdevIndex, struct MemRemapInfo memList[],
     170              :     unsigned int memNum);
     171              : RS_ATTRI_VISI_DEF int RsTypicalDeregisterMr(unsigned int phyId, unsigned int devIndex, unsigned long long addr);
     172              : RS_ATTRI_VISI_DEF int RsDeregisterMr(unsigned int phyId, unsigned int rdevIndex, void *mrHandle);
     173              : 
     174              : enum RsSendFlags {
     175              :     RS_SEND_FENCE  = 1 << 0,
     176              :     RS_SEND_SIGNALED = 1 << 1,
     177              :     RS_SEND_SOLICITED = 1 << 2,
     178              :     RS_SEND_INLINE  = 1 << 3,
     179              : };
     180              : RS_ATTRI_VISI_DEF int RsSendWr(unsigned int phyId, unsigned int rdevIndex, uint32_t qpn, struct SendWr *wr,
     181              :     struct SendWrRsp *wrRsp);
     182              : RS_ATTRI_VISI_DEF int RsSendWrlist(struct RsWrlistBaseInfo baseInfo, struct WrInfo *wrList,
     183              :     unsigned int sendNum, struct SendWrRsp *wrRsp, unsigned int *completeNum);
     184              : 
     185              : RS_ATTRI_VISI_DEF int RsRecvWrlist(struct RsWrlistBaseInfo baseInfo, struct RecvWrlistData *wr,
     186              :     unsigned int recvNum, unsigned int *completeNum);
     187              : 
     188              : RS_ATTRI_VISI_DEF int RsGetNotifyMrInfo(unsigned int phyId, unsigned int rdevIndex, struct MrInfoT *info);
     189              : RS_ATTRI_VISI_DEF int RsSetHostPid(uint32_t phyId, pid_t hostPid, const char *pidSign);
     190              : 
     191              : RS_ATTRI_VISI_DEF int RsInit(struct RsInitConfig *cfg);
     192              : RS_ATTRI_VISI_DEF int RsGetTlsEnable(unsigned int phyId, bool *tlsEnable);
     193              : RS_ATTRI_VISI_DEF int RsGetHccnCfg(unsigned int phyId, enum HccnCfgKey key, char *value,
     194              :     unsigned int *valueLen);
     195              : RS_ATTRI_VISI_DEF int RsBindHostpid(unsigned int chipId, pid_t pid);
     196              : RS_ATTRI_VISI_DEF int RsDeinit(struct RsInitConfig *cfg);
     197              : 
     198            2 : RS_ATTRI_VISI_DEF int RsSocketInit(const unsigned int *vnicIp, unsigned int num);
     199              : RS_ATTRI_VISI_DEF int RsSocketDeinit(struct rdev rdevInfo);
     200              : 
     201              : RS_ATTRI_VISI_DEF int RsRdevInit(struct rdev rdevInfo, unsigned int notifyType, unsigned int *rdevIndex);
     202              : RS_ATTRI_VISI_DEF int RsRdevInitWithBackup(struct rdev rdevInfo, struct rdev backupRdevInfo,
     203              :     unsigned int notifyType, unsigned int *rdevIndex);
     204              : RS_ATTRI_VISI_DEF int RsRdevGetPortStatus(unsigned int phyId, unsigned int rdevIndex, enum PortStatus *status);
     205              : RS_ATTRI_VISI_DEF int RsGetLbMax(unsigned int phyId, unsigned int rdevIndex, int *lbMax);
     206              : RS_ATTRI_VISI_DEF int RsRdevDeinit(unsigned int phyId, unsigned int notifyType, unsigned int rdevIndex);
     207              : 
     208              : /* ++++++++++++++++++++++++++++++Epoll API start++++++++++++++++++++++++++++++++++ */
     209              : RS_ATTRI_VISI_DEF int RsEpollCtlAdd(const void *fdHandle, enum RaEpollEvent event);
     210              : RS_ATTRI_VISI_DEF int RsEpollCtlMod(const void *fdHandle, enum RaEpollEvent event);
     211              : RS_ATTRI_VISI_DEF int RsEpollCtlDel(int fd);
     212              : RS_ATTRI_VISI_DEF void RsSetTcpRecvCallback(const void *callback);
     213            4 : RS_ATTRI_VISI_DEF int RsCreateEventHandle(int *eventHandle);
     214            5 : RS_ATTRI_VISI_DEF int RsCtlEventHandle(int eventHandle, const void *fdHandle, int opcode,
     215              :     enum RaEpollEvent event);
     216            4 : RS_ATTRI_VISI_DEF int RsWaitEventHandle(int eventHandle, struct SocketEventInfoT *eventInfos,
     217              :     int timeout, unsigned int maxevents, unsigned int *eventsNum);
     218            4 : RS_ATTRI_VISI_DEF int RsDestroyEventHandle(int *eventHandle);
     219              : /* ++++++++++++++++++++++++++++++Epoll API end++++++++++++++++++++++++++++++++++ */
     220              : 
     221              : /* ++++++++++++++++++++++++++++++Socket API++++++++++++++++++++++++++++++++++ */
     222              : #define RS_SOCK_PORT_DEF 16666
     223           28 : RS_ATTRI_VISI_DEF int RsSocketListenStart(struct SocketListenInfo conn[], uint32_t num);
     224           22 : RS_ATTRI_VISI_DEF int RsSocketListenStop(struct SocketListenInfo conn[], uint32_t num);
     225              : 
     226           16 : RS_ATTRI_VISI_DEF int RsSocketBatchConnect(struct SocketConnectInfo conn[], uint32_t num);
     227            2 : RS_ATTRI_VISI_DEF int RsSocketBatchAbort(struct SocketConnectInfo conn[], uint32_t num);
     228              : 
     229            2 : RS_ATTRI_VISI_DEF int RsSocketGetClientSocketErrInfo(struct SocketConnectInfo conn[],
     230              :     struct SocketErrInfo err[], unsigned int num);
     231            2 : RS_ATTRI_VISI_DEF int RsSocketGetServerSocketErrInfo(struct SocketListenInfo conn[],
     232              :     struct ServerSocketErrInfo err[], unsigned int num);
     233              : 
     234              : RS_ATTRI_VISI_DEF void RsGetCurTime(struct timeval *time);
     235              : RS_ATTRI_VISI_DEF void HccpTimeInterval(struct timeval *endTime, struct timeval *startTime, float *msec);
     236            0 : RS_ATTRI_VISI_DEF int RsSocketWhiteListSwitch(unsigned int phyId, unsigned int enable);
     237           13 : RS_ATTRI_VISI_DEF int RsSocketWhiteListAdd(struct rdev rdevInfo, struct SocketWlistInfoT whiteList[],
     238              :     unsigned int num);
     239            2 : RS_ATTRI_VISI_DEF int RsSocketWhiteListDel(struct rdev rdevInfo, struct SocketWlistInfoT whiteList[],
     240              :     unsigned int num);
     241            2 : RS_ATTRI_VISI_DEF int RsSocketAcceptCreditAdd(struct SocketListenInfo conn[], uint32_t num,
     242              :     unsigned int creditLimit);
     243            3 : RS_ATTRI_VISI_DEF int RsGetIfnum(unsigned int phyId, bool isAll, unsigned int *num);
     244            1 : RS_ATTRI_VISI_DEF int RsPeerGetIfnum(unsigned int phyId, unsigned int *num);
     245            0 : RS_ATTRI_VISI_DEF int RsGetIfaddrs(struct IfaddrInfo ifaddrInfos[], unsigned int *num, unsigned int phyId);
     246            0 : RS_ATTRI_VISI_DEF int RsGetIfaddrsV2(struct InterfaceInfo interfaceInfos[], unsigned int *num,
     247              :     unsigned int phyId, bool isAll);
     248            1 : RS_ATTRI_VISI_DEF int RsPeerGetIfaddrs(struct InterfaceInfo interfaceInfos[], unsigned int *num,
     249              :     unsigned int phyId);
     250              : RS_ATTRI_VISI_DEF int RsGetVnicIp(unsigned int phyId, unsigned int *vnicIp);
     251              : RS_ATTRI_VISI_DEF int RsGetInterfaceVersion(unsigned int opcode, unsigned int *version);
     252              : RS_ATTRI_VISI_DEF int RsGetVnicIpInfos(unsigned int phyId, enum IdType type, unsigned int ids[], unsigned int num,
     253              :     struct IpInfo infos[]);
     254            1 : RS_ATTRI_VISI_DEF int RsSocketSetScopeId(unsigned int devId, int scopeId);
     255              : struct RsSocketCloseInfoT {
     256              :     int fd;
     257              : };
     258           34 : RS_ATTRI_VISI_DEF int RsSocketBatchClose(int disuseLinger, struct RsSocketCloseInfoT conn[], uint32_t num);
     259              : 
     260              : enum RsConnRole {
     261              :     RS_CONN_ROLE_SERVER = 0,
     262              :     RS_CONN_ROLE_CLIENT = 1,
     263              : };
     264              : 
     265              : enum ProductType {
     266              :     PRODUCT_TYPE_INVALID = -2,
     267              :     PRODUCT_TYPE_NO_VALUE = -1,
     268              :     PRODUCT_TYPE_310p = 0,
     269              :     PRODUCT_TYPE_910,
     270              :     PRODUCT_TYPE_910B,
     271              :     PRODUCT_TYPE_910_93,
     272              :     PRODUCT_TYPE_950,
     273              :     PRODUCT_TYPE_910_96,
     274              :     PRODUCT_TYPE_350,
     275              :     PRODUCT_TYPE_OTHERS,
     276              : };
     277              : 
     278              : enum RsSocketStatus {
     279              :     RS_SOCK_STATUS_NA = 0,
     280              :     RS_SOCK_STATUS_OK = 1,
     281              :     RS_SOCK_STATUS_TIMEOUT = 2,
     282              :     RS_SOCK_STATUS_ING = 3,
     283              : };
     284              : 
     285           31 : RS_ATTRI_VISI_DEF int RsGetSockets(uint32_t role, struct SocketFdData conn[], uint32_t num);
     286            0 : RS_ATTRI_VISI_DEF int RsGetSslEnable(uint32_t *sslEnable);
     287           83 : RS_ATTRI_VISI_DEF int RsSocketSend(int fd, const void *data, uint64_t size);
     288            0 : RS_ATTRI_VISI_DEF int RsHdcSocketSend(int fd, const void *data, uint64_t size);
     289            4 : RS_ATTRI_VISI_DEF int RsPeerSocketSend(uint32_t sslEnable, int fd, const void *data, uint64_t size);
     290           28 : RS_ATTRI_VISI_DEF int RsSocketRecv(int fd, void *data, uint64_t size);
     291            4 : RS_ATTRI_VISI_DEF int RsPeerSocketRecv(uint32_t sslEnable, int fd, void *data, uint64_t size);
     292              : RS_ATTRI_VISI_DEF int RsNotifyCfgSet(unsigned int phyId, unsigned long long va, unsigned long long size);
     293              : RS_ATTRI_VISI_DEF int RsNotifyCfgGet(unsigned int phyId, unsigned long long *va, unsigned long long *size);
     294              : RS_ATTRI_VISI_DEF void RsHeartbeatAlivePrint(struct RsPthreadInfo *pthreadInfo);
     295              : 
     296              : RS_ATTRI_VISI_DEF int RsGetQpContext(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, void** qp,
     297              :                                         void** sendCq, void** recvCq);
     298              : RS_ATTRI_VISI_DEF int RsGetQpStatus(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     299              :     struct RsQpStatusInfo *qpInfo);
     300              : 
     301              : int rsGetLocalDevIDByHostDevID(unsigned int phyId, unsigned int *chipId);
     302              : int rsGetDevIDByLocalDevID(unsigned int chipId, unsigned int *phyId);
     303              : 
     304              : RS_ATTRI_VISI_DEF int RsCqCreate(unsigned int phyId, unsigned int rdevIndex, struct CqAttr *attr);
     305              : RS_ATTRI_VISI_DEF int RsCqDestroy(unsigned int phyId, unsigned int rdevIndex, struct CqAttr *attr);
     306              : RS_ATTRI_VISI_DEF int RsNormalQpCreate(unsigned int phyId, unsigned int rdevIndex,
     307              :     struct ibv_qp_init_attr *qpInitAttr, struct RsQpResp *qpResp, void **qp);
     308              : RS_ATTRI_VISI_DEF int RsNormalQpDestroy(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn);
     309              : RS_ATTRI_VISI_DEF int RsSetQpAttrQos(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     310              :     struct QosAttr *attr);
     311              : RS_ATTRI_VISI_DEF int RsSetQpAttrTimeout(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     312              :     unsigned int *timeout);
     313              : RS_ATTRI_VISI_DEF int RsSetQpAttrRetryCnt(unsigned int phyId, unsigned int rdevIndex, unsigned int qpn,
     314              :     unsigned int *retryCnt);
     315              : RS_ATTRI_VISI_DEF int RsCreateCompChannel(unsigned int phyId, unsigned int rdevIndex, void** compChannel);
     316              : RS_ATTRI_VISI_DEF int RsDestroyCompChannel(void* compChannel);
     317              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfo(struct CqeErrInfo *info);
     318              : RS_ATTRI_VISI_DEF int RsCreateSrq(unsigned int phyId, unsigned int rdevIndex, struct SrqAttr *attr);
     319              : RS_ATTRI_VISI_DEF int RsDestroySrq(unsigned int phyId, unsigned int rdevIndex, struct SrqAttr *attr);
     320              : RS_ATTRI_VISI_DEF int RsGetLiteSupport(unsigned int phyId, unsigned int rdevIndex, int *supportLite);
     321              : RS_ATTRI_VISI_DEF int RsGetLiteRdevCap(
     322              :     unsigned int phyId, unsigned int rdevIndex, struct LiteRdevCapResp *resp);
     323              : RS_ATTRI_VISI_DEF int RsGetLiteQpCqAttr(
     324              :     unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, struct LiteQpCqAttrResp *resp);
     325              : RS_ATTRI_VISI_DEF int RsGetLiteQpAttr(
     326              :     unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, struct LiteQpAttrResp *resp);
     327              : RS_ATTRI_VISI_DEF int RsGetLiteCqAttr(unsigned int phyId, unsigned int rdevIndex, unsigned int cqn,
     328              :     struct rdma_lite_device_cq_attr *deviceCqAttr);
     329              : RS_ATTRI_VISI_DEF int RsQpCreateWithCQWithAttrs(unsigned int phyId, unsigned int rdevIndex,
     330              :     unsigned int sendCqn, unsigned int recvCqn,
     331              :     struct RsQpNormWithAttrs *qpNorm, struct RsQpRespWithAttrs *qpResp);
     332              : RS_ATTRI_VISI_DEF int RsGetLiteConnectedInfo(
     333              :     unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, struct LiteConnectedInfoResp *resp);
     334              : RS_ATTRI_VISI_DEF int RsGetLiteMemAttr(
     335              :     unsigned int phyId, unsigned int rdevIndex, unsigned int qpn, struct LiteMemAttrResp *resp);
     336              : RS_ATTRI_VISI_DEF void RsSetCtx(unsigned int phyId);
     337              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfoNum(unsigned int phyId, unsigned int rdevIdx, unsigned int *num);
     338              : RS_ATTRI_VISI_DEF int RsGetCqeErrInfoList(unsigned int phyId, unsigned int rdevIdx, struct CqeErrInfo *info,
     339              :     unsigned int *num);
     340              : RS_ATTRI_VISI_DEF int RsDrvGetRandomNum(int *randNum);
     341              : RS_ATTRI_VISI_DEF int RsGetSecRandom(unsigned int *value);
     342              : // note: The FIRST invocation of this function MAY throw exceptions for each process
     343              : RS_ATTRI_VISI_DEF enum ProductType RsGetProductType(int devId);
     344              : 
     345              : static inline bool RsIsTlvSupported(void)
     346              : {
     347              :     enum ProductType productType;
     348              :     productType = RsGetProductType(0); // Ensure that RsGetProductType has been called at least once
     349              :     return (productType == PRODUCT_TYPE_910B || productType == PRODUCT_TYPE_910_93 ||
     350              :         productType == PRODUCT_TYPE_950 || productType == PRODUCT_TYPE_910_96 ||
     351              :         productType == PRODUCT_TYPE_350);
     352              : }
     353              : 
     354           86 : static inline bool RsIsRdmaSupported(void)
     355              : {
     356              :     enum ProductType productType;
     357           86 :     productType = RsGetProductType(0);
     358           86 :     return (productType == PRODUCT_TYPE_910B || productType == PRODUCT_TYPE_910_93 ||
     359              :         productType == PRODUCT_TYPE_910);
     360              : }
     361              : 
     362           86 : static inline bool RsIsUdmaSupported(void)
     363              : {
     364              :     enum ProductType productType;
     365           86 :     productType = RsGetProductType(0);
     366           86 :     return (productType == PRODUCT_TYPE_950 || productType == PRODUCT_TYPE_910_96 ||
     367              :         productType == PRODUCT_TYPE_350);
     368              : }
     369              : 
     370          225 : static inline bool RsIsCustomInterfaceSupported(void)
     371              : {
     372              :     enum ProductType productType;
     373          225 :     productType = RsGetProductType(0);
     374          225 :     return (productType != PRODUCT_TYPE_310p);
     375              : }
     376              : #ifdef __cplusplus
     377              : }
     378              : #endif
     379              : #endif // RS_H
        

Generated by: LCOV version 2.0-1