diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-07-09 09:55:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-07-09 10:08:38 +0100 |
commit | 024247317d50ffc4c44dd041aae19ae23b72788e (patch) | |
tree | c059ac8afb0a71f79ba3795b2ff2d954f70cd0ce /src/include/ipxe/malloc.h | |
parent | 8d95e1d6ff7b77ac6ea4d675c524c75d896c5d4b (diff) | |
download | ipxe-024247317d50ffc4c44dd041aae19ae23b72788e.tar.gz |
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/malloc.h')
-rw-r--r-- | src/include/ipxe/malloc.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/include/ipxe/malloc.h b/src/include/ipxe/malloc.h index c435a7ddb..d41b05628 100644 --- a/src/include/ipxe/malloc.h +++ b/src/include/ipxe/malloc.h @@ -76,6 +76,17 @@ struct cache_discarder { #define CACHE_DISCARDERS __table ( struct cache_discarder, "cache_discarders" ) /** Declare a cache discarder */ -#define __cache_discarder __table_entry ( CACHE_DISCARDERS, 01 ) +#define __cache_discarder( cost ) __table_entry ( CACHE_DISCARDERS, cost ) + +/** @defgroup cache_cost Cache discarder costs + * + * @{ + */ + +#define CACHE_CHEAP 01 /**< Items with a low replacement cost */ +#define CACHE_NORMAL 02 /**< Items with a normal replacement cost */ +#define CACHE_EXPENSIVE 03 /**< Items with a high replacement cost */ + +/** @} */ #endif /* _IPXE_MALLOC_H */ |