All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] librdmacm/mckey: add notifications on events
@ 2009-11-11 16:15 Or Gerlitz
       [not found] ` <Pine.LNX.4.64.0911111814350.6979-aDiYczhfhVLdX2U7gxhm1tBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2009-11-11 16:15 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma

add notifications on multicast error and address change events which
can take place while traffic is running.

Signed-off-by: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>

Index: librdmacm/examples/mckey.c
===================================================================
--- librdmacm.orig/examples/mckey.c
+++ librdmacm/examples/mckey.c
@@ -62,6 +62,7 @@ struct cmatest_node {

 struct cmatest {
 	struct rdma_event_channel *channel;
+	pthread_t 		cmathread;
 	struct cmatest_node	*nodes;
 	int			conn_index;
 	int			connects_left;
@@ -319,6 +320,30 @@ static int cma_handler(struct rdma_cm_id
 	return ret;
 }

+static void *cma_thread(void *arg)
+{
+	struct rdma_cm_event *event;
+	int ret;
+
+	while (1) {
+		ret = rdma_get_cm_event(test.channel, &event);
+		if (ret) {
+			perror("rdma_get_cm_event");
+			exit(ret);
+		}
+		switch (event->event) {
+		case RDMA_CM_EVENT_MULTICAST_ERROR:
+		case RDMA_CM_EVENT_ADDR_CHANGE:
+			printf("mckey: event: %s, status: %d\n",
+			       rdma_event_str(event->event), event->status);
+			break;
+		default:
+			break;
+		}
+		rdma_ack_cm_event(event);
+	}
+}
+
 static void destroy_node(struct cmatest_node *node)
 {
 	if (!node->cma_id)
@@ -475,6 +500,7 @@ static int run(void)
 	if (ret)
 		goto out;

+	pthread_create(&test.cmathread, NULL, cma_thread, NULL);
 	/*
 	 * Pause to give SM chance to configure switches.  We don't want to
 	 * handle reliability issue in this simple test program.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] librdmacm/mckey: add notifications on events
       [not found] ` <Pine.LNX.4.64.0911111814350.6979-aDiYczhfhVLdX2U7gxhm1tBPR1lH4CV8@public.gmane.org>
@ 2009-11-12  0:39   ` Sean Hefty
       [not found]     ` <C2A8DE4897EE4AA19F125A933FF8B08E-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Sean Hefty @ 2009-11-12  0:39 UTC (permalink / raw)
  To: 'Or Gerlitz'; +Cc: linux-rdma

>add notifications on multicast error and address change events which
>can take place while traffic is running.

mckey is intended to be a fairly simple send/receive multicast test program.
What's the reasoning behind adding the event handling?

- Sean

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] librdmacm/mckey: add notifications on events
       [not found]     ` <C2A8DE4897EE4AA19F125A933FF8B08E-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
@ 2009-11-12  8:52       ` Or Gerlitz
       [not found]         ` <4AFBCCE3.9090106-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2009-11-12  8:52 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma

Sean Hefty wrote:
> mckey is intended to be a fairly simple send/receive multicast test program.
> What's the reasoning behind adding the event handling?

The librdmacm examples serve for multiple purposes, among them user education on how to write rdmacm based apps and as a vehicle to test/validate/reproduce features/bugs/issues, for example a follow program claimed that she isn't sure to get a multicast error event on her application when a port goes down, so with my patch to mckey we were able to see that this event is generated and we can now do better testing. In the future mckey can be further enhanced to rejoin,etc on either of the events, makes sense?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] librdmacm/mckey: add notifications on events
       [not found]         ` <4AFBCCE3.9090106-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
@ 2009-11-12 16:24           ` Sean Hefty
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Hefty @ 2009-11-12 16:24 UTC (permalink / raw)
  To: 'Or Gerlitz'; +Cc: linux-rdma

>The librdmacm examples serve for multiple purposes, among them user education
>on how to write rdmacm based apps and as a vehicle to test/validate/reproduce
>features/bugs/issues, for example a follow program claimed that she isn't sure
>to get a multicast error event on her application when a port goes down, so
>with my patch to mckey we were able to see that this event is generated and we
>can now do better testing. In the future mckey can be further enhanced to
>rejoin,etc on either of the events, makes sense?

ok - thanks - I'll merge it in

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-12 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-11 16:15 [PATCH] librdmacm/mckey: add notifications on events Or Gerlitz
     [not found] ` <Pine.LNX.4.64.0911111814350.6979-aDiYczhfhVLdX2U7gxhm1tBPR1lH4CV8@public.gmane.org>
2009-11-12  0:39   ` Sean Hefty
     [not found]     ` <C2A8DE4897EE4AA19F125A933FF8B08E-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-11-12  8:52       ` Or Gerlitz
     [not found]         ` <4AFBCCE3.9090106-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2009-11-12 16:24           ` Sean Hefty

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.