From 024247317d50ffc4c44dd041aae19ae23b72788e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 9 Jul 2012 09:55:26 +0100 Subject: [arp] Try to avoid discarding ARP cache entries Discarding the active ARP cache entry in the middle of a download will substantially disrupt the TCP stream. Try to minimise any such disruption by treating ARP cache entries as expensive, and discarding them only when nothing else is available to discard. Signed-off-by: Michael Brown --- src/net/arp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/net/arp.c') diff --git a/src/net/arp.c b/src/net/arp.c index d6b4e731a..7cec73d5f 100644 --- a/src/net/arp.c +++ b/src/net/arp.c @@ -525,7 +525,12 @@ static unsigned int arp_discard ( void ) { return 0; } -/** ARP cache discarder */ -struct cache_discarder arp_cache_discarder __cache_discarder = { +/** ARP cache discarder + * + * ARP cache entries are deemed to have a high replacement cost, since + * flushing an active ARP cache entry midway through a TCP transfer + * will cause substantial disruption. + */ +struct cache_discarder arp_discarder __cache_discarder ( CACHE_EXPENSIVE ) = { .discard = arp_discard, }; -- cgit v1.2.3-55-g7522