Changeset View
Changeset View
Standalone View
Standalone View
contrib/ofed/libibverbs/driver.h
Show All 29 Lines | |||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#ifndef INFINIBAND_DRIVER_H | #ifndef INFINIBAND_DRIVER_H | ||||
#define INFINIBAND_DRIVER_H | #define INFINIBAND_DRIVER_H | ||||
#include <stdbool.h> | |||||
#include <infiniband/verbs.h> | #include <infiniband/verbs.h> | ||||
#include <infiniband/kern-abi.h> | #include <infiniband/kern-abi.h> | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
# define BEGIN_C_DECLS extern "C" { | # define BEGIN_C_DECLS extern "C" { | ||||
# define END_C_DECLS } | # define END_C_DECLS } | ||||
#else /* !__cplusplus */ | #else /* !__cplusplus */ | ||||
# define BEGIN_C_DECLS | # define BEGIN_C_DECLS | ||||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | |||||
static inline int verbs_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num) | static inline int verbs_get_srq_num(struct ibv_srq *srq, uint32_t *srq_num) | ||||
{ | { | ||||
struct verbs_srq *vsrq = container_of(srq, struct verbs_srq, srq); | struct verbs_srq *vsrq = container_of(srq, struct verbs_srq, srq); | ||||
if (vsrq->comp_mask & VERBS_SRQ_NUM) { | if (vsrq->comp_mask & VERBS_SRQ_NUM) { | ||||
*srq_num = vsrq->srq_num; | *srq_num = vsrq->srq_num; | ||||
return 0; | return 0; | ||||
} | } | ||||
return ENOSYS; | return ENOSYS; | ||||
} | |||||
static inline bool check_comp_mask(uint64_t input, uint64_t supported) | |||||
{ | |||||
return (input & ~supported) == 0; | |||||
} | } | ||||
int ibv_query_gid_type(struct ibv_context *context, uint8_t port_num, | int ibv_query_gid_type(struct ibv_context *context, uint8_t port_num, | ||||
unsigned int index, enum ibv_gid_type *type); | unsigned int index, enum ibv_gid_type *type); | ||||
#endif /* INFINIBAND_DRIVER_H */ | #endif /* INFINIBAND_DRIVER_H */ |