diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-11-23 21:41:21 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-11-23 22:02:38 +0300 |
commit | 7e0b5a3f515f85f3b50d33b17de6b9acf8cee790 (patch) | |
tree | 75dd62495462916221a8e38a664ad619f1eacfa2 /contrib/libs/ibdrv | |
parent | ac691915bc3127118492c2ec79e30ed5942a4544 (diff) | |
download | ydb-7e0b5a3f515f85f3b50d33b17de6b9acf8cee790.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/libs/ibdrv')
-rw-r--r-- | contrib/libs/ibdrv/impl.cpp | 19 | ||||
-rw-r--r-- | contrib/libs/ibdrv/symbols.h | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/contrib/libs/ibdrv/impl.cpp b/contrib/libs/ibdrv/impl.cpp index 82660fae82..f354451850 100644 --- a/contrib/libs/ibdrv/impl.cpp +++ b/contrib/libs/ibdrv/impl.cpp @@ -16,6 +16,17 @@ int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask) { } Y_HIDDEN +int ibv_query_pkey(struct ibv_context *context, uint8_t port_num, + int index, __be16 *pkey) { + return Call(IBSym()->ibv_query_pkey, context, port_num, index, pkey); +} + +Y_HIDDEN +const char *ibv_node_type_str(enum ibv_node_type node_type) { + return Call(IBSym()->ibv_node_type_str, node_type); +} + +Y_HIDDEN struct ibv_ah *ibv_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr) { return Call(IBSym()->ibv_create_ah, pd, attr); } @@ -102,7 +113,13 @@ struct ibv_mr *ibv_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int acce Y_HIDDEN struct ibv_mr *ibv_reg_mr_iova2(struct ibv_pd *pd, void *addr, size_t length, uint64_t iova, unsigned int access) { - return Call(IBSym()->ibv_reg_mr_iova2, pd, addr, length, iova, access); + auto symFunc = IBSym()->ibv_reg_mr_iova2; + if (!symFunc) { + // On old versions we don`t have optimized ibv_reg_mr_iova2 on machines, + // so fallback on ibv_reg_mr + return Call(IBSym()->ibv_reg_mr, pd, addr, length, access); + } + return Call(symFunc, pd, addr, length, iova, access); } Y_HIDDEN diff --git a/contrib/libs/ibdrv/symbols.h b/contrib/libs/ibdrv/symbols.h index ec87815470..e02781f224 100644 --- a/contrib/libs/ibdrv/symbols.h +++ b/contrib/libs/ibdrv/symbols.h @@ -47,6 +47,8 @@ extern "C" { M(ibv_reg_mr, struct ibv_mr *(struct ibv_pd *pd, void *addr, size_t length, int access)) \ M(ibv_reg_mr_iova2, struct ibv_mr *(struct ibv_pd *pd, void *addr, size_t length, uint64_t iova, unsigned int access)) \ M(ibv_dereg_mr, int (struct ibv_mr *mr)) \ + M(ibv_query_pkey, int (struct ibv_context *context, uint8_t port_num, int index, __be16 *pkey)) \ + M(ibv_node_type_str, const char *(enum ibv_node_type node_type)) \ M(ibv_destroy_cq, int (struct ibv_cq *cq)) \ M(ibv_query_gid, int (struct ibv_context *context, uint8_t port_num, int index, union ibv_gid *gid)) \ M(ibv_query_port, int (struct ibv_context *context, uint8_t port_num, struct _compat_ibv_port_attr *port_attr)) \ |