aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-12-21 07:07:11 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-26 13:00:04 -0500
commit0a3d805c9c503e05d6e5d3868c53e92a06589dcf (patch)
tree71328c48da69cb0a6bae978865f140c223905797
parentb2fb01f426883a794ed80be9110675a2d8356347 (diff)
tipc: base group replicast ack counter on number of actual receivers
In commit 2f487712b893 ("tipc: guarantee that group broadcast doesn't bypass group unicast") we introduced a mechanism that requires the first (replicated) broadcast sent after a unicast to be acknowledged by all receivers before permitting sending of the next (true) broadcast. The counter for keeping track of the number of acknowledges to expect is based on the tipc_group::member_cnt variable. But this misses that some of the known members may not be ready for reception, and will never acknowledge the message, either because they haven't fully joined the group or because they are leaving the group. Such members are identified by not fulfilling the condition tested for in the function tipc_group_is_enabled(). We now set the counter for the actual number of acks to receive at the moment the message is sent, by just counting the number of recipients satisfying the tipc_group_is_enabled() test. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/group.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 7ebbdeb2a90e..e5b03f08f076 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -368,18 +368,20 @@ void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack)
368 u16 prev = grp->bc_snd_nxt - 1; 368 u16 prev = grp->bc_snd_nxt - 1;
369 struct tipc_member *m; 369 struct tipc_member *m;
370 struct rb_node *n; 370 struct rb_node *n;
371 u16 ackers = 0;
371 372
372 for (n = rb_first(&grp->members); n; n = rb_next(n)) { 373 for (n = rb_first(&grp->members); n; n = rb_next(n)) {
373 m = container_of(n, struct tipc_member, tree_node); 374 m = container_of(n, struct tipc_member, tree_node);
374 if (tipc_group_is_enabled(m)) { 375 if (tipc_group_is_enabled(m)) {
375 tipc_group_update_member(m, len); 376 tipc_group_update_member(m, len);
376 m->bc_acked = prev; 377 m->bc_acked = prev;
378 ackers++;
377 } 379 }
378 } 380 }
379 381
380 /* Mark number of acknowledges to expect, if any */ 382 /* Mark number of acknowledges to expect, if any */
381 if (ack) 383 if (ack)
382 grp->bc_ackers = grp->member_cnt; 384 grp->bc_ackers = ackers;
383 grp->bc_snd_nxt++; 385 grp->bc_snd_nxt++;
384} 386}
385 387