tipc: simplify tipc_link_rcv() reception loop
authorJon Paul Maloy <jon.maloy@ericsson.com>
Thu, 15 Oct 2015 18:52:41 +0000 (14:52 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Oct 2015 06:55:19 +0000 (23:55 -0700)
commitf9aa358a8109f9f33e96c3a7efb9a07631670294
treec57a7818339bdf794941a00c490e5b1cbfd136b5
parent9945e8043ef9273cfb633d930e2a5a9116009b09
tipc: simplify tipc_link_rcv() reception loop

Currently, all packets received in tipc_link_rcv() are unconditionally
added to the packet deferred queue, whereafter that queue is walked and
all its buffers evaluated for delivery. This is both non-optimal and
and makes the queue sorting function unnecessary complex.

This commit changes the loop so that an arrived packet is evaluated
first, and added to the deferred queue only when a sequence number gap
is discovered. A non-empty deferred queue is walked until it is empty
or until its head's sequence number doesn't fit.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c