Add support for notifying totem of delivery congestion.

-Angus

Signed-off-by: Angus Salkeld <[email protected]>
---
 exec/totemmrp.c                  |    5 +++--
 exec/totemmrp.h                  |    2 +-
 exec/totempg.c                   |    7 ++++++-
 exec/totemsrp.c                  |    2 +-
 exec/totemsrp.h                  |    2 +-
 include/corosync/totem/totem.h   |    5 +++++
 include/corosync/totem/totempg.h |    2 ++

diff --git a/exec/totemmrp.c b/exec/totemmrp.c
index 6473c19..dceb44a 100644
--- a/exec/totemmrp.c
+++ b/exec/totemmrp.c
@@ -188,8 +188,9 @@ void totemmrp_callback_token_destroy (
        totemsrp_callback_token_destroy (totemsrp_context, handle_out);
 }
 
-void totemmrp_new_msg_signal (void) {
-       totemsrp_new_msg_signal (totemsrp_context);
+void totemmrp_event_signal (enum totem_event_type type, int value)
+{
+       totemsrp_event_signal (totemsrp_context, type, value);
 }
 
 int totemmrp_ifaces_get (
diff --git a/exec/totemmrp.h b/exec/totemmrp.h
index 66449b6..f9b1911 100644
--- a/exec/totemmrp.h
+++ b/exec/totemmrp.h
@@ -97,7 +97,7 @@ extern int totemmrp_callback_token_create (
 extern void totemmrp_callback_token_destroy (
        void *handle_out);
 
-extern void totemmrp_new_msg_signal (void);
+extern void totemmrp_event_signal (enum totem_event_type type, int value);
 
 extern int totemmrp_ifaces_get (
        unsigned int nodeid,
diff --git a/exec/totempg.c b/exec/totempg.c
index 6a4b7bf..10effc8 100644
--- a/exec/totempg.c
+++ b/exec/totempg.c
@@ -773,7 +773,7 @@ static int mcast_msg (
        int total_size = 0;
 
        pthread_mutex_lock (&mcast_msg_mutex);
-       totemmrp_new_msg_signal ();
+       totemmrp_event_signal (TOTEM_EVENT_NEW_MSG, 1);
 
        /*
         * Remove zero length iovectors from the list
@@ -1307,6 +1307,11 @@ int totempg_ifaces_get (
        return (res);
 }
 
+void totempg_event_signal (enum totem_event_type type, int value)
+{
+       totemmrp_event_signal (type, value);
+}
+
 void* totempg_get_stats (void)
 {
        return &totempg_stats;
diff --git a/exec/totemsrp.c b/exec/totemsrp.c
index 4329f0c..23a1732 100644
--- a/exec/totemsrp.c
+++ b/exec/totemsrp.c
@@ -2090,7 +2090,7 @@ originated:
        return;
 }
 
-int totemsrp_new_msg_signal (void *srp_context)
+void totemsrp_event_signal (void *srp_context, enum totem_event_type type, int 
value)
 {
        struct totemsrp_instance *instance = (struct totemsrp_instance 
*)srp_context;
 
diff --git a/exec/totemsrp.h b/exec/totemsrp.h
index cb6dac1..37ef588 100644
--- a/exec/totemsrp.h
+++ b/exec/totemsrp.h
@@ -92,7 +92,7 @@ void totemsrp_callback_token_destroy (
        void *srp_context,
        void **handle_out);
 
-int totemsrp_new_msg_signal (void *srp_context);
+void totemsrp_event_signal (void *srp_context, enum totem_event_type type, int 
value);
 
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 
diff --git a/include/corosync/totem/totem.h b/include/corosync/totem/totem.h
index a769d57..80bbf5c 100644
--- a/include/corosync/totem/totem.h
+++ b/include/corosync/totem/totem.h
@@ -179,6 +179,11 @@ enum totem_callback_token_type {
        TOTEM_CALLBACK_TOKEN_SENT = 2
 };
 
+enum totem_event_type {
+       TOTEM_EVENT_DELIVERY_CONGESTED,
+       TOTEM_EVENT_NEW_MSG,
+};
+
 #define MEMB_RING_ID
 struct memb_ring_id {
        struct totem_ip_address rep;
diff --git a/include/corosync/totem/totempg.h b/include/corosync/totem/totempg.h
index 86a799e..fbf71fb 100644
--- a/include/corosync/totem/totempg.h
+++ b/include/corosync/totem/totempg.h
@@ -145,6 +145,8 @@ extern int totempg_ifaces_get (
 
 extern void* totempg_get_stats (void);
 
+void totempg_event_signal (enum totem_event_type type, int value);
+
 extern const char *totempg_ifaces_print (unsigned int nodeid);
 
 extern unsigned int totempg_my_nodeid_get (void);


_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to