forked from BeStateless/RAMCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfiniband-fix.patch.TODO
104 lines (94 loc) · 3.54 KB
/
infiniband-fix.patch.TODO
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Remove references to old infiniband symbol.
From: Aaron Jones <aaron@vexing.codes>
---
src/HaveInfiniband.cc | 3 ---
src/InfUdDriver.cc | 5 +++--
src/Infiniband.cc | 16 ++++++++--------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/HaveInfiniband.cc b/src/HaveInfiniband.cc
index 502ba65b..f8ae8ca0 100644
--- a/src/HaveInfiniband.cc
+++ b/src/HaveInfiniband.cc
@@ -23,9 +23,6 @@
int main() {
int r;
- static_assert(IBV_QPT_RAW_ETH >= 0,
- "Symbol `IBV_QPT_RAW_ETH` is undefined; consider upgrading "
- "your libverbs.");
ibv_free_device_list(ibv_get_device_list(&r));
return r;
}
diff --git a/src/InfUdDriver.cc b/src/InfUdDriver.cc
index 3fa2e4d3..df629345 100644
--- a/src/InfUdDriver.cc
+++ b/src/InfUdDriver.cc
@@ -158,8 +158,9 @@ InfUdDriver::InfUdDriver(Context* context, const ServiceLocator *sl,
throw DriverException(HERE, errno);
}
- qp = infiniband->createQueuePair(localMac ? IBV_QPT_RAW_ETH
- : IBV_QPT_UD,
+// qp = infiniband->createQueuePair(localMac ? IBV_QPT_RAW_ETH
+// : IBV_QPT_UD,
+ qp = infiniband->createQueuePair(IBV_QPT_UD,
ibPhysicalPort, NULL,
txcq, rxcq, MAX_TX_QUEUE_DEPTH,
MAX_RX_QUEUE_DEPTH,
diff --git a/src/Infiniband.cc b/src/Infiniband.cc
index 93344f75..6dcd7cbb 100644
--- a/src/Infiniband.cc
+++ b/src/Infiniband.cc
@@ -520,7 +520,8 @@ Infiniband::QueuePair::QueuePair(Infiniband& infiniband, ibv_qp_type type,
peerLid(0)
{
snprintf(peerName, sizeof(peerName), "?unknown?");
- if (type != IBV_QPT_RC && type != IBV_QPT_UD && type != IBV_QPT_RAW_ETH)
+ //if (type != IBV_QPT_RC && type != IBV_QPT_UD && type != IBV_QPT_RAW_ETH)
+ if (type != IBV_QPT_RC && type != IBV_QPT_UD)
throw TransportException(HERE, "invalid queue pair type");
ibv_qp_init_attr qpia;
@@ -564,8 +565,6 @@ Infiniband::QueuePair::QueuePair(Infiniband& infiniband, ibv_qp_type type,
mask |= IBV_QP_QKEY;
mask |= IBV_QP_PKEY_INDEX;
break;
- case IBV_QPT_RAW_ETH:
- break;
default:
assert(0);
}
@@ -683,7 +682,8 @@ void
Infiniband::QueuePair::activate(const Tub<MacAddress>& localMac)
{
ibv_qp_attr qpa;
- if (type != IBV_QPT_UD && type != IBV_QPT_RAW_ETH)
+// if (type != IBV_QPT_UD && type != IBV_QPT_RAW_ETH)
+ if (type != IBV_QPT_UD)
throw TransportException(HERE, "activate() called on wrong qp type");
if (getState() != IBV_QPS_INIT) {
@@ -704,17 +704,17 @@ Infiniband::QueuePair::activate(const Tub<MacAddress>& localMac)
// now move to RTS state
qpa.qp_state = IBV_QPS_RTS;
int flags = IBV_QP_STATE;
- if (type != IBV_QPT_RAW_ETH) {
+// if (type != IBV_QPT_RAW_ETH) {
qpa.sq_psn = initialPsn;
flags |= IBV_QP_SQ_PSN;
- }
+// }
ret = ibv_modify_qp(qp, &qpa, flags);
if (ret) {
LOG(ERROR, "failed to transition to RTS state");
throw TransportException(HERE, ret);
}
- if (type == IBV_QPT_RAW_ETH) {
+// if (type == IBV_QPT_RAW_ETH) {
ibv_gid mgid;
memset(&mgid, 0, sizeof(mgid));
memcpy(&mgid.raw[10], localMac->address, 6);
@@ -722,7 +722,7 @@ Infiniband::QueuePair::activate(const Tub<MacAddress>& localMac)
LOG(ERROR, "failed to bind to mac address");
throw TransportException(HERE, ret);
}
- }
+// }
}
/**