OP_FLAG_TCP = 0x1
OP_FLAG_RDMA = 0x2
+# from include/uapi/linux/rds.h: SO_RDS_TRANSPORT pins a socket to a
+# specific RDS transport so connection setup cannot silently fall back
+# to another (e.g. loopback) transport.
+SOL_RDS = 276
+SO_RDS_TRANSPORT = 8
+RDS_TRANS_TCP = 2
+RDS_TRANS_IB = 0
+
signal_handler_label = ""
tap_idx = 0
netns_socket(netns_list[0], socket.AF_RDS, socket.SOCK_SEQPACKET),
netns_socket(netns_list[1], socket.AF_RDS, socket.SOCK_SEQPACKET),
]
+
+ # Pin the sockets to the TCP transport so it doesn't fail over to a
+ # different transport during this test
+ for s in sockets:
+ s.setsockopt(SOL_RDS, SO_RDS_TRANSPORT, RDS_TRANS_TCP)
elif flags & OP_FLAG_RDMA:
sockets = [
socket.socket(socket.AF_RDS, socket.SOCK_SEQPACKET),
socket.socket(socket.AF_RDS, socket.SOCK_SEQPACKET),
]
+
+ # Pin the sockets to the RDMA transport so it doesn't fail over to a
+ # different transport during this test
+ for s in sockets:
+ s.setsockopt(SOL_RDS, SO_RDS_TRANSPORT, RDS_TRANS_IB)
else:
raise RuntimeError(f"Invalid transport flag sets no transports: {flags}")