diff options
author | David S. Miller <davem@davemloft.net> | 2018-01-09 10:37:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-09 10:37:00 -0500 |
commit | a0ce093180f2bbb832b3f5583adc640ad67ea568 (patch) | |
tree | 62c9aca5be3566ea4810e4584a02870de8b953f8 /net/tipc | |
parent | f4803f1b73f877a571be4c8e531dfcf190acc691 (diff) | |
parent | ef7f8cec80a0ba7bd00ece46844c8994117dc910 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/group.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c index fb7fe971e51b..3e8268d966fa 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c | |||
@@ -109,7 +109,8 @@ static void tipc_group_proto_xmit(struct tipc_group *grp, struct tipc_member *m, | |||
109 | static void tipc_group_decr_active(struct tipc_group *grp, | 109 | static void tipc_group_decr_active(struct tipc_group *grp, |
110 | struct tipc_member *m) | 110 | struct tipc_member *m) |
111 | { | 111 | { |
112 | if (m->state == MBR_ACTIVE || m->state == MBR_RECLAIMING) | 112 | if (m->state == MBR_ACTIVE || m->state == MBR_RECLAIMING || |
113 | m->state == MBR_REMITTED) | ||
113 | grp->active_cnt--; | 114 | grp->active_cnt--; |
114 | } | 115 | } |
115 | 116 | ||
@@ -560,7 +561,7 @@ void tipc_group_update_rcv_win(struct tipc_group *grp, int blks, u32 node, | |||
560 | int max_active = grp->max_active; | 561 | int max_active = grp->max_active; |
561 | int reclaim_limit = max_active * 3 / 4; | 562 | int reclaim_limit = max_active * 3 / 4; |
562 | int active_cnt = grp->active_cnt; | 563 | int active_cnt = grp->active_cnt; |
563 | struct tipc_member *m, *rm; | 564 | struct tipc_member *m, *rm, *pm; |
564 | 565 | ||
565 | m = tipc_group_find_member(grp, node, port); | 566 | m = tipc_group_find_member(grp, node, port); |
566 | if (!m) | 567 | if (!m) |
@@ -603,6 +604,17 @@ void tipc_group_update_rcv_win(struct tipc_group *grp, int blks, u32 node, | |||
603 | pr_warn_ratelimited("Rcv unexpected msg after REMIT\n"); | 604 | pr_warn_ratelimited("Rcv unexpected msg after REMIT\n"); |
604 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); | 605 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); |
605 | } | 606 | } |
607 | grp->active_cnt--; | ||
608 | list_del_init(&m->list); | ||
609 | if (list_empty(&grp->pending)) | ||
610 | return; | ||
611 | |||
612 | /* Set oldest pending member to active and advertise */ | ||
613 | pm = list_first_entry(&grp->pending, struct tipc_member, list); | ||
614 | pm->state = MBR_ACTIVE; | ||
615 | list_move_tail(&pm->list, &grp->active); | ||
616 | grp->active_cnt++; | ||
617 | tipc_group_proto_xmit(grp, pm, GRP_ADV_MSG, xmitq); | ||
606 | break; | 618 | break; |
607 | case MBR_RECLAIMING: | 619 | case MBR_RECLAIMING: |
608 | case MBR_DISCOVERED: | 620 | case MBR_DISCOVERED: |
@@ -740,14 +752,14 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup, | |||
740 | if (!m || m->state != MBR_RECLAIMING) | 752 | if (!m || m->state != MBR_RECLAIMING) |
741 | return; | 753 | return; |
742 | 754 | ||
743 | list_del_init(&m->list); | ||
744 | grp->active_cnt--; | ||
745 | remitted = msg_grp_remitted(hdr); | 755 | remitted = msg_grp_remitted(hdr); |
746 | 756 | ||
747 | /* Messages preceding the REMIT still in receive queue */ | 757 | /* Messages preceding the REMIT still in receive queue */ |
748 | if (m->advertised > remitted) { | 758 | if (m->advertised > remitted) { |
749 | m->state = MBR_REMITTED; | 759 | m->state = MBR_REMITTED; |
750 | in_flight = m->advertised - remitted; | 760 | in_flight = m->advertised - remitted; |
761 | m->advertised = ADV_IDLE + in_flight; | ||
762 | return; | ||
751 | } | 763 | } |
752 | /* All messages preceding the REMIT have been read */ | 764 | /* All messages preceding the REMIT have been read */ |
753 | if (m->advertised <= remitted) { | 765 | if (m->advertised <= remitted) { |
@@ -759,6 +771,8 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup, | |||
759 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); | 771 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); |
760 | 772 | ||
761 | m->advertised = ADV_IDLE + in_flight; | 773 | m->advertised = ADV_IDLE + in_flight; |
774 | grp->active_cnt--; | ||
775 | list_del_init(&m->list); | ||
762 | 776 | ||
763 | /* Set oldest pending member to active and advertise */ | 777 | /* Set oldest pending member to active and advertise */ |
764 | if (list_empty(&grp->pending)) | 778 | if (list_empty(&grp->pending)) |