-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathib1.h
80 lines (58 loc) · 1.76 KB
/
ib1.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Copyright (c) 2016 Wu, Xingbo <[email protected]>
*
* All rights reserved. No warranty, explicit or implicit, provided.
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <infiniband/verbs.h>
struct ib_port;
struct ib_mr;
struct ib_socket;
struct ib_remote {
int lid;
int qpn;
};
struct ib_memory {
void * ptr;
size_t size;
u32 key;
};
extern struct ib_port *
ib_port_create(const u64 index);
extern void
ib_port_destroy(struct ib_port * const port);
extern struct ibv_mr *
ib_mr_helper(struct ib_port *port, void *addr, size_t length);
extern void *
ib_sge_refill_off(struct ibv_sge * const sg, struct ibv_mr * const mr, const size_t offset, const size_t size);
extern u64
ib_sge_refill_ptr(struct ibv_sge * const sg, struct ibv_mr * const mr, void * const ptr, const size_t size);
extern struct ib_socket *
ib_socket_create(struct ib_port * const port, const u64 depth);
extern bool
ib_socket_export(struct ib_socket * const s, struct ib_remote * const r);
extern bool
ib_socket_connect(struct ib_socket * const s, struct ib_remote * const r);
extern bool
ib_socket_connect_stream2(struct ib_socket * const s, struct stream2 * const s2);
extern bool
ib_socket_post_send(struct ib_socket * const s, struct ibv_sge * const sg, const bool signaled);
extern bool
ib_socket_post_recv(struct ib_socket * const s, struct ibv_sge * const sg);
extern bool
ib_socket_flush_send(struct ib_socket * const s);
extern bool
ib_socket_flush_recv(struct ib_socket * const s);
extern bool
ib_socket_poll_send(struct ib_socket * const s, u64 * const nr);
extern bool
ib_socket_poll_recv(struct ib_socket * const s, u64 * const nr);
extern void
ib_socket_destroy(struct ib_socket * const s);
#ifdef __cplusplus
}
#endif
// vim:fdm=marker