]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
librdmacm: implement address change event
authorOr Gerlitz <ogerlitz@voltaire.com>
Wed, 2 Jul 2008 18:53:49 +0000 (11:53 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 2 Jul 2008 18:53:49 +0000 (11:53 -0700)
RDMA_CM_EVENT_ADDR_CHANGE event can be used by librdmacm consumers
that wish to have their RDMA sessions always use the same links
(eg <hca/port>) as the IP stack does. In the current code, this
does not happen when bonding is used and fail-over happened,
but the IB link used by an already existing session is operating fine.

The kernel rdma-cm code was enhanced to use netevent notification
for sensing that a change has happened in the IP stack, and deliver
this event for ID that is misaligned that respect with the IP
stack. The user can act on the event or just ignore it

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
examples/rping.c
include/rdma/rdma_cma.h
man/rdma_get_cm_event.3
src/cma.c

index 8bfa05327d693ff7a601eb0b651d0192ba8314e9..a85f398ec7631d1123cde61a558b8c61c6f7d3c2 100644 (file)
@@ -227,9 +227,8 @@ static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
                break;
 
        default:
-               fprintf(stderr, "oof bad type!\n");
-               sem_post(&cb->sem);
-               ret = -1;
+               fprintf(stderr, "unhandled event: %s, ignoring\n",
+                       rdma_event_str(event->event));
                break;
        }
 
index 8b0f1d257bb4ca80e8c3a6c3080cae6a9b78fdc8..a516ab85c114cb9621c4617775f64316a8c7926e 100644 (file)
@@ -61,7 +61,8 @@ enum rdma_cm_event_type {
        RDMA_CM_EVENT_DISCONNECTED,
        RDMA_CM_EVENT_DEVICE_REMOVAL,
        RDMA_CM_EVENT_MULTICAST_JOIN,
-       RDMA_CM_EVENT_MULTICAST_ERROR
+       RDMA_CM_EVENT_MULTICAST_ERROR,
+       RDMA_CM_EVENT_ADDR_CHANGE
 };
 
 enum rdma_port_space {
index 1ba8797afcb40f3ae79316ec5e3197d0ef485fc3..3537e558dd5548be77b90e5d5d0e07d9815d9c8b 100644 (file)
@@ -140,6 +140,11 @@ The multicast join operation (rdma_join_multicast) completed successfully.
 An error either occurred joining a multicast group, or, if the group had
 already been joined, on an existing group.  The specified multicast group is
 no longer accessible and should be rejoined, if desired.
+.IP RDMA_CM_EVENT_ADDR_CHANGE_
+The network device associated with this ID through address resolution changed its
+HW address, eg following of bonding failover. This event can serve as a hint for
+applications who want the links used for their RDMA sessions to align with the
+network stack.
 .SH "SEE ALSO"
 rdma_ack_cm_event(3), rdma_create_event_channel(3), rdma_resolve_addr(3),
 rdma_resolve_route(3), rdma_connect(3), rdma_listen(3), rdma_join_multicast(3),
index fc98c8fe68b46136410217ea376715291f875746..ecb41bca630f615a3bed069e7a7288d8d8da21f5 100644 (file)
--- a/src/cma.c
+++ b/src/cma.c
@@ -1438,6 +1438,8 @@ const char *rdma_event_str(enum rdma_cm_event_type event)
                return "RDMA_CM_EVENT_MULTICAST_JOIN";
        case RDMA_CM_EVENT_MULTICAST_ERROR:
                return "RDMA_CM_EVENT_MULTICAST_ERROR";
+       case RDMA_CM_EVENT_ADDR_CHANGE:
+               return "RDMA_CM_EVENT_ADDR_CHANGE";
        default:
                return "UNKNOWN EVENT";
        }