[PATCH 1/2] Be more flexible (correct) with flowcontrol.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Many functions do not require flowcontrol and are two-way
so they can get failures from corosync.
Only cpg_mcast_joined() _really_ needs the current level
of flowcontrol.

Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx>
---
 exec/ipc_glue.c |    6 ++++--
 lib/cpg.c       |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/exec/ipc_glue.c b/exec/ipc_glue.c
index 2bfa9b4..8ec7c96 100644
--- a/exec/ipc_glue.c
+++ b/exec/ipc_glue.c
@@ -733,7 +733,7 @@ static void cs_ipcs_check_for_flow_control(void)
 		if (ais_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
 			continue;
 		}
-		fc_enabled = QB_TRUE;
+		fc_enabled = QB_IPCS_RATE_OFF;
 		if (ipc_fc_is_quorate == 1 ||
 			ais_service[i]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
 			/*
@@ -743,10 +743,12 @@ static void cs_ipcs_check_for_flow_control(void)
 			if (ipc_fc_totem_queue_level != TOTEM_Q_LEVEL_CRITICAL &&
 				ipc_fc_sync_in_process == 0) {
 				fc_enabled = QB_FALSE;
+			} else {
+				fc_enabled = QB_IPCS_RATE_OFF_2;
 			}
 		}
 		if (fc_enabled) {
-			qb_ipcs_request_rate_limit(ipcs_mapper[i].inst, QB_IPCS_RATE_OFF);
+			qb_ipcs_request_rate_limit(ipcs_mapper[i].inst, fc_enabled);
 
 			qb_loop_timer_add(cs_poll_handle_get(), QB_LOOP_MED, 1*QB_TIME_NS_IN_MSEC,
 			       NULL, corosync_recheck_the_q_level, &ipcs_check_for_flow_control_timer);
diff --git a/lib/cpg.c b/lib/cpg.c
index 39e29bc..c7f51f7 100644
--- a/lib/cpg.c
+++ b/lib/cpg.c
@@ -940,7 +940,9 @@ cs_error_t cpg_mcast_joined (
 	iov[0].iov_len = sizeof (struct req_lib_cpg_mcast);
 	memcpy (&iov[1], iovec, iov_len * sizeof (struct iovec));
 
+	qb_ipcc_fc_enable_max_set(cpg_inst->c,  2);
 	error = qb_to_cs_error(qb_ipcc_sendv(cpg_inst->c, iov, iov_len + 1));
+	qb_ipcc_fc_enable_max_set(cpg_inst->c,  1);
 
 	hdb_handle_put (&cpg_handle_t_db, handle);
 
-- 
1.7.7.3

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux