Skip to contentSkip to conversation

rdma_get_cm_event() vs ibv_async_event()

DISCUSSION Yann Droneaud 3 participants 5 messages Mar 29, 2011 7 messages not in the archive InfiniBand

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1301059658.2192.23.camel-H/[email protected]

#3 lore raw

[This question was already asked on [email protected]]

Hi,

I'm using RDMA CM to manage connections above Infiniband.

On the server side, RDMA CM event are monitored using an event channel created by rdma_create_event_channel(), polled using file descriptor rdma_event_channel->fd and later processed by rdma_get_cm_event() on event.

After a connection is established, IB async events are polled using the file descriptor found in the associated connection id returned by RDMA CM layer: ibv_context->async_fd and proceed using ibv_get_async_event().

But the only event I caught and handle is IBV_EVENT_COMM_EST because it happen sometimes under high load. In this case, rdma_notify() is used to send the event back to RDMA CM layer. But sometimes, rdma_notify() returns -1 and errno is set to EISCONN : Transport endpoint is already connected. (It happens mostly when I'm running my test program under strace).

I'm suspecting there's some kind of race between RDMA event channel and IB async event processing.

So here's my question: should I monitor async events using ibv_get_async_event() or is it fully managed by the RDMA CM layer ?

Regards.

Signature · 8 lines
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1301391461.2192.41.camel-H/[email protected]

#5 lore raw
Quoted 5 lines · Yann Droneaud

[...] I caught and handle is IBV_EVENT_COMM_EST because it
happen sometimes under high load. In this case, rdma_notify() is used to send the event back to RDMA CM layer. But sometimes, rdma_notify() returns -1 and errno is set to EISCONN : Transport endpoint is already connected. (It happens mostly when I'm running my test program under strace).

EISCONN means that between the time you've got the comm established async event to the time you reported on it by calling rdma_notify,
the kernel CM managed to establish the connection. Note that the man page says that rdma_notify "handle the rare situation where the connection never forms on its own", so as for your questions, the errno you see isn't a failure (see the patch I sent to Sean), and you should
listen on IB async event and report the comm established for the rare case the kernel can't establish the connection as of repeated CM packet loss

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4D91B107.2040007-VPRAkNaXOzVWk0Htik3J/[email protected]

#7 lore raw
Quoted 7 lines · Or Gerlitz
Quoted 5 lines · Yann Droneaud

[...] I caught and handle is IBV_EVENT_COMM_EST because it
happen sometimes under high load. In this case, rdma_notify() is used to send the event back to RDMA CM layer. But sometimes, rdma_notify() returns -1 and errno is set to EISCONN : Transport endpoint is already connected. (It happens mostly when I'm running my test program under strace).

Quoted 9 lines

EISCONN means that between the time you've got the comm established async event to the time you reported on it by calling rdma_notify, the kernel CM managed to establish the connection. Note that the man page says that rdma_notify "handle the rare situation where the connection never forms on its own", so as for your questions, the errno you see isn't a failure (see the patch I sent to Sean), and you should listen on IB async event and report the comm established for the rare case the kernel can't establish the connection as of repeated CM packet loss

Thanks for the information.

So ignoring IBV_EVENT_COMM_EST async event seems the best option when using RDMA CM to establish connection ?

Regards.

Signature · 8 lines
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1301394815.2193.2.camel-H/[email protected]

#9 lore raw
Quoted 2 lines · Yann Droneaud

So ignoring IBV_EVENT_COMM_EST async event seems the best option when using RDMA CM to establish connection ?

no! its a must for the rare case of repeated CM packet loss - Sean, do you agree to that assertion? should the man page be more clear about that?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 4D91B85C.1080106-VPRAkNaXOzVWk0Htik3J/[email protected]

#11 lore raw

PiA+IFNvIGlnbm9yaW5nIElCVl9FVkVOVF9DT01NX0VTVCBhc3luYyBldmVudCBzZWVtc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ZSB0YWtlcyB0aHJvdWdoIHRo ZSBmYWJyaWMgbWF5IGRpZmZlciBmcm9tIHRoYXQgdGFrZW4gYnkgYSBtZXNzYWdlIHBvc3RlZCBv biB0aGUgUVAuICBJbiBwcmFjdGljZSwgdGhpcyBpcyBub3QgdGhlIGNhc2UgZ2l2ZW4gdGhlIGN1 cnJlbnQgaW1wbGVtZW50YXRpb24uKQ0KDQpTby4uLiBoYW5kbGluZyB0aGUgQ09NTV9FU1QgZXZl bnQgZG9lcyBoYW5kbGUgdGhlIHJhcmUgY29uZGl0aW9uIGxpc3RlZCBhYm92ZS4gIFRoZXJlJ3Mg bm8gaGFybSBpbiBoYW5kbGluZyB0aGUgZXZlbnQsIGJ1dCBkZWNpZGluZyBob3cgZXNzZW50aWFs IGl0IGlzIHRvIGhhbmRsZSBpcyBsZWZ0IGFzIGFuIGV4ZXJjaXNlIHRvIHRoZSByZWFkZXIuIDop DQoNCi0gU2Vhbg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html