Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290037
b: refs/heads/master
c: 8a275a6
h: refs/heads/master
i:
  290035: f5855cd
v: v3
  • Loading branch information
Allan Stephens authored and Paul Gortmaker committed Feb 6, 2012
1 parent 6323027 commit f9a41eb
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57732560d1aa7d454d10e557f8959d19d1454174
refs/heads/master: 8a275a6a30ba871eb34ea41c1fbb507039f4c0dc
58 changes: 40 additions & 18 deletions trunk/net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
struct tipc_node *node;
u32 next_in;
u32 seqno;
struct sk_buff *deferred;
int deferred;

/* Screen out unwanted broadcast messages */

Expand All @@ -489,6 +489,8 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
if (unlikely(!node->bclink.supported))
goto unlock;

/* Handle broadcast protocol message */

if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) {
if (msg_type(msg) != STATE_MSG)
goto unlock;
Expand All @@ -513,11 +515,11 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)

/* Handle in-sequence broadcast message */

receive:
next_in = mod(node->bclink.last_in + 1);
seqno = msg_seqno(msg);
next_in = mod(node->bclink.last_in + 1);

if (likely(seqno == next_in)) {
receive:
bcl->stats.recv_info++;
node->bclink.last_in++;
bclink_set_gap(node);
Expand Down Expand Up @@ -551,23 +553,40 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
buf_discard(buf);
}
buf = NULL;

/* Determine new synchronization state */

tipc_node_lock(node);
deferred = node->bclink.deferred_head;
if (deferred && (buf_seqno(deferred) == mod(next_in + 1))) {
buf = deferred;
msg = buf_msg(buf);
node->bclink.deferred_head = deferred->next;
goto receive;
}
} else if (less(next_in, seqno)) {
if (unlikely(!tipc_node_is_up(node)))
goto unlock;

if (!node->bclink.deferred_head)
goto unlock;

msg = buf_msg(node->bclink.deferred_head);
seqno = msg_seqno(msg);
next_in = mod(next_in + 1);
if (seqno != next_in)
goto unlock;

/* Take in-sequence message from deferred queue & deliver it */

buf = node->bclink.deferred_head;
node->bclink.deferred_head = buf->next;
goto receive;
}

/* Handle out-of-sequence broadcast message */

if (less(next_in, seqno)) {
u32 gap_after = node->bclink.gap_after;
u32 gap_to = node->bclink.gap_to;

if (tipc_link_defer_pkt(&node->bclink.deferred_head,
&node->bclink.deferred_tail,
buf)) {
deferred = tipc_link_defer_pkt(&node->bclink.deferred_head,
&node->bclink.deferred_tail,
buf);
if (deferred) {
node->bclink.nack_sync++;
bcl->stats.deferred_recv++;
if (seqno == mod(gap_after + 1))
node->bclink.gap_after = seqno;
else if (less(gap_after, seqno) && less(seqno, gap_to))
Expand All @@ -579,9 +598,12 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
bclink_send_nack(node);
bclink_set_gap(node);
}
} else {
bcl->stats.duplicates++;
}
} else
deferred = 0;

if (deferred)
bcl->stats.deferred_recv++;

unlock:
tipc_node_unlock(node);
exit:
Expand Down

0 comments on commit f9a41eb

Please sign in to comment.