diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2008-10-08 17:18:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 17:18:39 -0400 |
commit | 8e1ee18c332e08bee9d8bd66e63cd564fbf17fc2 (patch) | |
tree | 8dace1db660d555eb6e020f301fdfe6cf6c05b80 /include/net/sctp/constants.h | |
parent | 3c689b7320ae6f20dba6a8b71806a6c6fd604ee8 (diff) |
sctp: Rework the tsn map to use generic bitmap.
The tsn map currently use is 4K large and is stuck inside
the sctp_association structure making memory references REALLY
expensive. What we really need is at most 4K worth of bits
so the biggest map we would have is 512 bytes. Also, the
map is only really usefull when we have gaps to store and
report. As such, starting with minimal map of say 32 TSNs (bits)
should be enough for normal low-loss operations. We can grow
the map by some multiple of 32 along with some extra room any
time we receive the TSN which would put us outside of the map
boundry. As we close gaps, we can shift the map to rebase
it on the latest TSN we've seen. This saves 4088 bytes per
association just in the map alone along savings from the now
unnecessary structure members.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/constants.h')
-rw-r--r-- | include/net/sctp/constants.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index c32ddf0279c8..b05b0557211f 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -261,7 +261,9 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 }; | |||
261 | * must be less than 65535 (2^16 - 1), or we will have overflow | 261 | * must be less than 65535 (2^16 - 1), or we will have overflow |
262 | * problems creating SACK's. | 262 | * problems creating SACK's. |
263 | */ | 263 | */ |
264 | #define SCTP_TSN_MAP_SIZE 2048 | 264 | #define SCTP_TSN_MAP_INITIAL BITS_PER_LONG |
265 | #define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL | ||
266 | #define SCTP_TSN_MAP_SIZE 4096 | ||
265 | #define SCTP_TSN_MAX_GAP 65535 | 267 | #define SCTP_TSN_MAX_GAP 65535 |
266 | 268 | ||
267 | /* We will not record more than this many duplicate TSNs between two | 269 | /* We will not record more than this many duplicate TSNs between two |