aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAndrea Bittau <a.bittau@cs.ucl.ac.uk>2006-11-14 13:19:45 -0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:22:31 -0800
commitd23ca15a21804631d8f787a0cc5646df81b9c2ea (patch)
treecd81e5363e700b5b6b61691851abfcb1c17865f2 /net
parent09dbc3895e3242346bd434dae743c456fd28fc6a (diff)
[DCCP] ACKVEC: Optimization - Do not traverse records if none will be found
Do not traverse the list of ack vector records [proportional to window size] when we know we will not find what we are looking for. This is especially useful because ack vectors are checked twice: 1) Upon parsing of options. 2) Upon notification of a new ack. All of the work will occur during check #1. Therefore, when check #2 is performed, no new work will be done. This is now "detected" and there is no performance hit when doing #2. Signed-off-by: Andrea Bittau <a.bittau@cs.ucl.ac.uk> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ackvec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index 0c54b89a4e9..bd20a2c55e2 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -383,7 +383,8 @@ void dccp_ackvec_check_rcv_ackno(struct dccp_ackvec *av, struct sock *sk,
(unsigned long long)avr->dccpavr_ack_ackno);
dccp_ackvec_throw_record(av, avr);
break;
- }
+ } else if (avr->dccpavr_ack_seqno > ackno)
+ break; /* old news */
}
}