|
@@ -164,11 +164,17 @@ static void (*totempg_log_printf) (int subsys_id, const char *function,
|
|
|
|
|
|
|
|
struct totem_config *totempg_totem_config;
|
|
struct totem_config *totempg_totem_config;
|
|
|
|
|
|
|
|
|
|
+enum throw_away_mode {
|
|
|
|
|
+ THROW_AWAY_INACTIVE,
|
|
|
|
|
+ THROW_AWAY_ACTIVE
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
struct assembly {
|
|
struct assembly {
|
|
|
unsigned int nodeid;
|
|
unsigned int nodeid;
|
|
|
unsigned char data[MESSAGE_SIZE_MAX];
|
|
unsigned char data[MESSAGE_SIZE_MAX];
|
|
|
int index;
|
|
int index;
|
|
|
unsigned char last_frag_num;
|
|
unsigned char last_frag_num;
|
|
|
|
|
+ enum throw_away_mode throw_away_mode;
|
|
|
struct list_head list;
|
|
struct list_head list;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -177,13 +183,6 @@ static void assembly_deref (struct assembly *assembly);
|
|
|
static int callback_token_received_fn (enum totem_callback_token_type type,
|
|
static int callback_token_received_fn (enum totem_callback_token_type type,
|
|
|
const void *data);
|
|
const void *data);
|
|
|
|
|
|
|
|
-enum throw_away_mode_t {
|
|
|
|
|
- THROW_AWAY_INACTIVE,
|
|
|
|
|
- THROW_AWAY_ACTIVE
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-static enum throw_away_mode_t throw_away_mode = THROW_AWAY_INACTIVE;
|
|
|
|
|
-
|
|
|
|
|
DECLARE_LIST_INIT(assembly_list_inuse);
|
|
DECLARE_LIST_INIT(assembly_list_inuse);
|
|
|
|
|
|
|
|
DECLARE_LIST_INIT(assembly_list_free);
|
|
DECLARE_LIST_INIT(assembly_list_free);
|
|
@@ -274,6 +273,9 @@ static struct assembly *assembly_ref (unsigned int nodeid)
|
|
|
list_del (&assembly->list);
|
|
list_del (&assembly->list);
|
|
|
list_add (&assembly->list, &assembly_list_inuse);
|
|
list_add (&assembly->list, &assembly_list_inuse);
|
|
|
assembly->nodeid = nodeid;
|
|
assembly->nodeid = nodeid;
|
|
|
|
|
+ assembly->index = 0;
|
|
|
|
|
+ assembly->last_frag_num = 0;
|
|
|
|
|
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
|
|
|
return (assembly);
|
|
return (assembly);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -287,6 +289,9 @@ static struct assembly *assembly_ref (unsigned int nodeid)
|
|
|
*/
|
|
*/
|
|
|
assert (assembly);
|
|
assert (assembly);
|
|
|
assembly->nodeid = nodeid;
|
|
assembly->nodeid = nodeid;
|
|
|
|
|
+ assembly->index = 0;
|
|
|
|
|
+ assembly->last_frag_num = 0;
|
|
|
|
|
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
|
|
|
list_init (&assembly->list);
|
|
list_init (&assembly->list);
|
|
|
list_add (&assembly->list, &assembly_list_inuse);
|
|
list_add (&assembly->list, &assembly_list_inuse);
|
|
|
|
|
|
|
@@ -597,10 +602,10 @@ static void totempg_deliver_fn (
|
|
|
*/
|
|
*/
|
|
|
start = 0;
|
|
start = 0;
|
|
|
|
|
|
|
|
- if (throw_away_mode == THROW_AWAY_ACTIVE) {
|
|
|
|
|
|
|
+ if (assembly->throw_away_mode == THROW_AWAY_ACTIVE) {
|
|
|
/* Throw away the first msg block */
|
|
/* Throw away the first msg block */
|
|
|
if (mcast->fragmented == 0 || mcast->fragmented == 1) {
|
|
if (mcast->fragmented == 0 || mcast->fragmented == 1) {
|
|
|
- throw_away_mode = THROW_AWAY_INACTIVE;
|
|
|
|
|
|
|
+ assembly->throw_away_mode = THROW_AWAY_INACTIVE;
|
|
|
|
|
|
|
|
assembly->index += msg_lens[0];
|
|
assembly->index += msg_lens[0];
|
|
|
iov_delv.iov_base = &assembly->data[assembly->index];
|
|
iov_delv.iov_base = &assembly->data[assembly->index];
|
|
@@ -608,7 +613,7 @@ static void totempg_deliver_fn (
|
|
|
start = 1;
|
|
start = 1;
|
|
|
}
|
|
}
|
|
|
} else
|
|
} else
|
|
|
- if (throw_away_mode == THROW_AWAY_INACTIVE) {
|
|
|
|
|
|
|
+ if (assembly->throw_away_mode == THROW_AWAY_INACTIVE) {
|
|
|
if (continuation == assembly->last_frag_num) {
|
|
if (continuation == assembly->last_frag_num) {
|
|
|
assembly->last_frag_num = mcast->fragmented;
|
|
assembly->last_frag_num = mcast->fragmented;
|
|
|
for (i = start; i < msg_count; i++) {
|
|
for (i = start; i < msg_count; i++) {
|
|
@@ -621,7 +626,7 @@ static void totempg_deliver_fn (
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- throw_away_mode = THROW_AWAY_ACTIVE;
|
|
|
|
|
|
|
+ assembly->throw_away_mode = THROW_AWAY_ACTIVE;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|