|
@@ -1052,6 +1052,7 @@ static int send_token_unbind (struct totemiba_instance *instance)
|
|
|
static int recv_token_bind (struct totemiba_instance *instance)
|
|
static int recv_token_bind (struct totemiba_instance *instance)
|
|
|
{
|
|
{
|
|
|
int res;
|
|
int res;
|
|
|
|
|
+ struct ibv_port_attr port_attr;
|
|
|
|
|
|
|
|
instance->listen_recv_token_channel = rdma_create_event_channel();
|
|
instance->listen_recv_token_channel = rdma_create_event_channel();
|
|
|
if (instance->listen_recv_token_channel == NULL) {
|
|
if (instance->listen_recv_token_channel == NULL) {
|
|
@@ -1073,6 +1074,20 @@ static int recv_token_bind (struct totemiba_instance *instance)
|
|
|
return (-1);
|
|
return (-1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * Determine active_mtu of port and compare it with the configured one (160 is aproximation of all totem
|
|
|
|
|
+ * structures.
|
|
|
|
|
+ *
|
|
|
|
|
+ * TODO: Implement MTU discovery also for IP and handle MTU correctly for all structures inside totemsrp,
|
|
|
|
|
+ * crypto, ...
|
|
|
|
|
+ */
|
|
|
|
|
+ res = ibv_query_port (instance->listen_recv_token_cma_id->verbs, instance->listen_recv_token_cma_id->port_num, &port_attr);
|
|
|
|
|
+ if ( (1 << (port_attr.active_mtu + 7)) < instance->totem_config->net_mtu + 160) {
|
|
|
|
|
+ log_printf (LOGSYS_LEVEL_ERROR, "requested net_mtu is %d and is larger than the active port mtu %d\n",\
|
|
|
|
|
+ instance->totem_config->net_mtu + 160, (1 << (port_attr.active_mtu + 7)));
|
|
|
|
|
+ return (-1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/*
|
|
/*
|
|
|
* Resolve the recv_token address into a GUID
|
|
* Resolve the recv_token address into a GUID
|
|
|
*/
|
|
*/
|