aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:30:19 -0400
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:45:36 -0400
commitff49e27089ec363b7fc3849504e0435d447ab18a (patch)
treeeb6f7d4ec829f2c0ca206c0769c15c08e592743c /net/dccp/ccids
parentb8c6bcee1dbc1aadcd67af998e414e73fa166a7d (diff)
dccp ccid-2: Ack Vector interface clean-up
This patch brings the Ack Vector interface up to date. Its main purpose is to lay the basis for the subsequent patches of this set, which will use the new data structure fields and routines. There are no real algorithmic changes, rather an adaptation: (1) Replaced the static Ack Vector size (2) with a #define so that it can be adapted (with low loss / Ack Ratio, a value of 1 works, so 2 seems to be sufficient for the moment) and added a solution so that computing the ECN nonce will continue to work - even with larger Ack Vectors. (2) Replaced the #defines for Ack Vector states with a complete enum. (3) Replaced #defines to compute Ack Vector length and state with general purpose routines (inlines), and updated code to use these. (4) Added a `tail' field (conversion to circular buffer in subsequent patch). (5) Updated the (outdated) documentation for Ack Vector struct. (6) All sequence number containers now trimmed to 48 bits. (7) Removal of unused bits: * removed dccpav_ack_nonce from struct dccp_ackvec, since this is already redundantly stored in the `dccpavr_ack_nonce' (of Ack Vector record); * removed Elapsed Time for Ack Vectors (it was nowhere used); * replaced semantics of dccpavr_sent_len with dccpavr_ack_runlen, since the code needs to be able to remember the old run length; * reduced the de-/allocation routines (redundant / duplicate tests). Justification for removing Elapsed Time information [can be removed]: --------------------------------------------------------------------- 1. The Elapsed Time information for Ack Vectors was nowhere used in the code. 2. DCCP does not implement rate-based pacing of acknowledgments. The only recommendation for always including Elapsed Time is in section 11.3 of RFC 4340: "Receivers that rate-pace acknowledgements SHOULD [...] include Elapsed Time options". But such is not the case here. 3. It does not really improve estimation accuracy. The Elapsed Time field only records the time between the arrival of the last acknowledgeable packet and the time the Ack Vector is sent out. Since Linux does not (yet) implement delayed Acks, the time difference will typically be small, since often the arrival of a data packet triggers sending feedback at the HC-receiver. Justification for changes in de-/allocation routines [can be removed]: ---------------------------------------------------------------------- * INIT_LIST_HEAD in dccp_ackvec_record_new was redundant, since the list pointers were later overwritten when the node was added via list_add(); * dccp_ackvec_record_new() was called in a single place only; * calls to list_del_init() before calling dccp_ackvec_record_delete() were redundant, since subsequently the entire element was k-freed; * since all calls to dccp_ackvec_record_delete() were preceded to a call to list_del_init(), the WARN_ON test would never evaluate to true; * since all calls to dccp_ackvec_record_delete() were made from within list_for_each_entry_safe(), the test for avr == NULL was redundant; * list_empty() in ackvec_free was redundant, since the same condition is embedded in the loop condition of the subsequent list_for_each_entry_safe(). Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r--net/dccp/ccids/ccid2.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index f56ab68a4b78..813d5cd40e8b 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -580,8 +580,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
580 &vector, &veclen)) != -1) { 580 &vector, &veclen)) != -1) {
581 /* go through this ack vector */ 581 /* go through this ack vector */
582 while (veclen--) { 582 while (veclen--) {
583 const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK; 583 u64 ackno_end_rl = SUB48(ackno, dccp_ackvec_runlen(vector));
584 u64 ackno_end_rl = SUB48(ackno, rl);
585 584
586 ccid2_pr_debug("ackvec start:%llu end:%llu\n", 585 ccid2_pr_debug("ackvec start:%llu end:%llu\n",
587 (unsigned long long)ackno, 586 (unsigned long long)ackno,
@@ -604,17 +603,15 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
604 * run length 603 * run length
605 */ 604 */
606 while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) { 605 while (between48(seqp->ccid2s_seq,ackno_end_rl,ackno)) {
607 const u8 state = *vector & 606 const u8 state = dccp_ackvec_state(vector);
608 DCCP_ACKVEC_STATE_MASK;
609 607
610 /* new packet received or marked */ 608 /* new packet received or marked */
611 if (state != DCCP_ACKVEC_STATE_NOT_RECEIVED && 609 if (state != DCCPAV_NOT_RECEIVED &&
612 !seqp->ccid2s_acked) { 610 !seqp->ccid2s_acked) {
613 if (state == 611 if (state == DCCPAV_ECN_MARKED)
614 DCCP_ACKVEC_STATE_ECN_MARKED) {
615 ccid2_congestion_event(sk, 612 ccid2_congestion_event(sk,
616 seqp); 613 seqp);
617 } else 614 else
618 ccid2_new_ack(sk, seqp, 615 ccid2_new_ack(sk, seqp,
619 &maxincr); 616 &maxincr);
620 617