summaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-07-01 10:22:41 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-08 04:55:07 +0200
commit3f53bd8f8b563cc6024d25c1665d8358745f48b2 (patch)
tree321f71bfb9e45193a99318225ba1b9b3944c0ff1 /net/tipc/link.c
parenttipc: refactor message delivery out of tipc_rcv (diff)
downloadlinux-3f53bd8f8b563cc6024d25c1665d8358745f48b2.tar.xz
linux-3f53bd8f8b563cc6024d25c1665d8358745f48b2.zip
tipc: fix link acknowledge logic in receive path
Link state acks triggered from the receive path is done before the last received packet have been processed by the link layer. The effect of this is that the last received packet will not be included in the ack. This causes problems if the link window is set to TIPC_MIN_LINK_WIN, where the ack interval will be equal to the link tolerance, and the link enters a stop-and-go behavior. We move the ack logic to after link state processing, just before the packet is delivered to higher layers. Signed-off-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: Carl Sigurjonsson <carl.sigurjonsson@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 18b1524098c6..a235b245f682 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1422,11 +1422,6 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
if (unlikely(!list_empty(&l_ptr->waiting_ports)))
tipc_link_wakeup_ports(l_ptr, 0);
- if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) {
- l_ptr->stats.sent_acks++;
- tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
- }
-
/* Process the incoming packet */
if (unlikely(!link_working_working(l_ptr))) {
if (msg_user(msg) == LINK_PROTOCOL) {
@@ -1460,6 +1455,11 @@ void tipc_rcv(struct sk_buff *head, struct tipc_bearer *b_ptr)
if (unlikely(l_ptr->oldest_deferred_in))
head = link_insert_deferred_queue(l_ptr, head);
+ if (unlikely(++l_ptr->unacked_window >= TIPC_MIN_LINK_WIN)) {
+ l_ptr->stats.sent_acks++;
+ tipc_link_proto_xmit(l_ptr, STATE_MSG, 0, 0, 0, 0, 0);
+ }
+
if (tipc_link_prepare_input(l_ptr, &buf)) {
tipc_node_unlock(n_ptr);
continue;