diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:36 -0400 |
commit | d7dc7e5f49299739e610ea8febf9ea91a4dc1ae9 (patch) | |
tree | 30a2e1c3b9e99b1a386ca99efa71769415437885 /net/dccp/dccp.h | |
parent | 4829007c7bc689cbc290fc09eccbe90bd52c2a5e (diff) |
dccp ccid-2: Implementation of circular Ack Vector buffer with overflow handling
This completes the implementation of a circular buffer for Ack Vectors, by
extending the current (linear array-based) implementation. The changes are:
(a) An `overflow' flag to deal with the case of overflow. As before, dynamic
growth of the buffer will not be supported; but code will be added to deal
robustly with overflowing Ack Vector buffers.
(b) A `tail_seqno' field. When naively implementing the algorithm of Appendix A
in RFC 4340, problems arise whenever subsequent Ack Vector records overlap,
which can bring the entire run length calculation completely out of synch.
(This is documented on http://www.erg.abdn.ac.uk/users/gerrit/dccp/notes/\
ack_vectors/tracking_tail_ackno/ .)
(c) The buffer lengthi is now computed dynamically (i.e. current fill level),
as the span between head to tail.
As a result, dccp_ackvec_pending() is now simpler - the #ifdef is no longer
necessary since buf_empty is always true when IP_DCCP_ACKVEC is not configured.
Note on overflow handling:
-------------------------
The Ack Vector code previously simply started to drop packets when the
Ack Vector buffer overflowed. This means that the userspace application
will not be able to receive, only because of an Ack Vector storage problem.
Furthermore, overflow may be transient, so that applications may later
recover from the overflow. Recovering from dropped packets is more difficult
(e.g. video key frames).
Hence the patch uses a different policy: when the buffer overflows, the oldest
entries are subsequently overwritten. This has a higher chance of recovery.
Details are on http://www.erg.abdn.ac.uk/users/gerrit/dccp/notes/ack_vectors/
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r-- | net/dccp/dccp.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index e4d6e76ced41..1e65378eea3f 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -448,15 +448,15 @@ static inline void dccp_update_gss(struct sock *sk, u64 seq) | |||
448 | dp->dccps_awh = dp->dccps_gss; | 448 | dp->dccps_awh = dp->dccps_gss; |
449 | } | 449 | } |
450 | 450 | ||
451 | static inline int dccp_ackvec_pending(const struct sock *sk) | ||
452 | { | ||
453 | return dccp_sk(sk)->dccps_hc_rx_ackvec != NULL && | ||
454 | !dccp_ackvec_is_empty(dccp_sk(sk)->dccps_hc_rx_ackvec); | ||
455 | } | ||
456 | |||
451 | static inline int dccp_ack_pending(const struct sock *sk) | 457 | static inline int dccp_ack_pending(const struct sock *sk) |
452 | { | 458 | { |
453 | const struct dccp_sock *dp = dccp_sk(sk); | 459 | return dccp_ackvec_pending(sk) || inet_csk_ack_scheduled(sk); |
454 | return | ||
455 | #ifdef CONFIG_IP_DCCP_ACKVEC | ||
456 | (dp->dccps_hc_rx_ackvec != NULL && | ||
457 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec)) || | ||
458 | #endif | ||
459 | inet_csk_ack_scheduled(sk); | ||
460 | } | 460 | } |
461 | 461 | ||
462 | extern int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val); | 462 | extern int dccp_feat_signal_nn_change(struct sock *sk, u8 feat, u64 nn_val); |