1. 21 9月, 2010 5 次提交
    • G
      dccp ccid-3: Remove redundant 'options_received' struct · 536bb20b
      Gerrit Renker 提交于
      The `options_received' struct is redundant, since it re-duplicates the existing
      `p' and `x_recv' fields. This patch removes the sub-struct and migrates the
      format conversion operations to ccid3_hc_tx_parse_options().
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      536bb20b
    • G
      dccp tfrc/ccid-3: computing the loss rate from the Loss Event Rate · 792e6d33
      Gerrit Renker 提交于
      This adds a function to take care of the following, separate cases occurring in
      the computation of the Loss Rate p:
      
       * 1/(2^32-1) is mapped into 0% as per RFC 4342, 8.5;
       * 1/0        is mapped into 100%, the maximum;
       * to avoid that p = 1/x is rounded down to 0 when x is very large, since this
         means accidentally re-entering slow-start indicated by p == 0, the minimum
         resolution value of p is now returned instead;
       * a bug in ccid3_hc_rx_getsockopt is fixed: 1/0 was mapped into ~0U.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      792e6d33
    • G
      dccp ccid-3: remove dead states · 80763dfb
      Gerrit Renker 提交于
      This patch is thanks to an investigation by Leandro Sales de Melo and his
      colleagues. They worked out two state diagrams which highlight the fact that
      the xxx_TERM states in CCID-3/4 are in fact not necessary.
      
      And this can be confirmed by in turn looking at the code: the xxx_TERM states
      are only ever set in ccid3_hc_{rx,tx}_exit(): when CCID-3 sets the state
      to xxx_TERM, it is at a time where no more processing should be going on,
      hence it is not necessary to introduce a dedicated exit state - this is already
      implied by unloading the CCID.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      80763dfb
    • G
      dccp: Replace magic CCID-specific numbers by symbolic constants · a18213d1
      Gerrit Renker 提交于
      The constants DCCPO_{MIN,MAX}_CCID_SPECIFIC are nowhere used in the code, but
      instead for the CCID-specific options numbers are used.
      
      This patch unifies the use of CCID-specific option numbers, by adding symbolic
      names reflecting the definitions in RFC 4340, 10.3.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      a18213d1
    • G
      dccp: Add packet type information to CCID-specific option parsing · 4874c131
      Gerrit Renker 提交于
      This
       1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is
          necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
          which options may (not) appear on what packet type.
      
       2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
          RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
          and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").
      
       3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
          is also no longer necessary, since the CCID-specific option-parsing routines
          are passed every single parameter of the type-length-value option encoding.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      4874c131
  2. 20 9月, 2010 4 次提交
  3. 18 9月, 2010 3 次提交
  4. 17 9月, 2010 2 次提交
  5. 16 9月, 2010 13 次提交
  6. 15 9月, 2010 8 次提交
    • G
      dccp ccid-3: Simplify and consolidate tx_parse_options · 37efb03f
      Gerrit Renker 提交于
      This simplifies and consolidates the TX option-parsing code:
      
       1. The Loss Intervals option is not currently used, so dead code related to
          this option is removed. I am aware of no plans to support the option, but
          if someone wants to implement it (e.g. for inter-op tests), it is better
          to start afresh than having to also update currently unused code.
      
       2. The Loss Event and Receive Rate options have a lot of code in common (both
          are 32 bit, both have same length etc.), so this is consolidated.
      
       3. The test against GSR is not necessary, because
          - on first loading CCID3, ccid_new() zeroes out all fields in the socket;
          - ccid3_hc_tx_packet_recv() treats 0 and ~0U equivalently, due to
      
      	pinv = opt_recv->ccid3or_loss_event_rate;
      	if (pinv == ~0U || pinv == 0)
      		hctx->p = 0;
      
          - as a result, the sequence number field is removed from opt_recv.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      37efb03f
    • G
      dccp ccid-3: remove buggy RTT-sampling history lookup · d2c72630
      Gerrit Renker 提交于
      This removes the RTT-sampling function tfrc_tx_hist_rtt(), since
      
       1. it suffered from complex passing of return values (the return value both
          indicated successful lookup while the value doubled as RTT sample);
      
       2. when for some odd reason the sample value equalled 0, this triggered a bug
          warning about "bogus Ack", due to the ambiguity of the return value;
      
       3. on a passive host which has not sent anything the TX history is empty and
          thus will lead to unwanted "bogus Ack" warnings such as
          ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-28197148
          ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-26641606.
      
      The fix is to replace the implicit encoding by performing the steps manually.
      
      Furthermore, the "bogus Ack" warning has been removed, since it can actually be
      triggered due to several reasons (network reordering, old packet, (3) above),
      hence it is not very useful.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      d2c72630
    • G
      dccp ccid-3: A lower bound for the inter-packet scheduling algorithm · 20cbd3e1
      Gerrit Renker 提交于
      This fixes a subtle bug in the calculation of the inter-packet gap and shows
      that t_delta, as it is currently used, is not needed.
      
      The algorithm from RFC 5348, 8.3 below continually computes a send time t_nom,
      which is initialised with the current time t_now; t_gran = 1E6 / HZ specifies
      the scheduling granularity, s the packet size, and X the sending rate:
      
        t_distance = t_nom - t_now;		// in microseconds
        t_delta    = min(t_ipi, t_gran) / 2;	// `delta' parameter in microseconds
      
        if (t_distance >= t_delta) {
      	reschedule after (t_distance / 1000) milliseconds;
        } else {
        	t_ipi  = s / X;			// inter-packet interval in usec
      	t_nom += t_ipi;			// compute the next send time
      	send packet now;
        }
      
      Problem:
      --------
      Rescheduling requires a conversion into milliseconds (sk_reset_timer()). The
      highest jiffy resolution with HZ=1000 is 1 millisecond, so using a higher
      granularity does not make much sense here.
      
      As a consequence, values of t_distance < 1000 are truncated to 0. This issue
      has so far been resolved by using instead
      
        if (t_distance >= t_delta + 1000)
      	reschedule after (t_distance / 1000) milliseconds;
      
      This is unnecessarily large, a lower bound is t_delta' = max(t_delta, 1000).
      And it implies a further simplification:
      
       a) when HZ >= 500, then t_delta <= t_gran/2 = 10^6/(2*HZ) <= 1000, so that
          t_delta' = MAX(1000, t_delta) = 1000 (constant value);
      
       b) when HZ < 500, then t_delta = 1/2*MIN(rtt, t_ipi, t_gran) <= t_gran/2,
          so that 1000 <= t_delta' <= t_gran/2.
      
      The maximum error of using a constant t_delta in (b) is less than half a jiffy.
      
      Fix:
      ----
      The patch replaces t_delta with a constant, whose value depends on CONFIG_HZ,
      changing the above algorithm to:
      
        if (t_distance >= t_delta')
      	reschedule after (t_distance / 1000) milliseconds;
      
      where t_delta' = 10^6/(2*HZ) if HZ < 500, and t_delta' = 1000 otherwise.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      20cbd3e1
    • A
      X.25 remove bkl in connect · 21a45917
      andrew hendry 提交于
      Connect already has socket locking.
      Signed-off-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21a45917
    • A
      X.25 remove bkl in accept · 141646ce
      Andrew Hendry 提交于
      Accept already has socket locking.
      
      [ Extend socket locking over TCP_LISTEN state test. -DaveM ]
      Signed-off-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      141646ce
    • A
      X.25 remove bkl in bind · 90c27297
      andrew hendry 提交于
      Accept updates socket values in 3 lines so wrapped with lock_sock.
      Signed-off-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90c27297
    • A
      X.25 remove bkl in listen · 25aa4efe
      andrew hendry 提交于
      Listen updates socket values and needs lock_sock.
      Signed-off-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25aa4efe
    • J
      55b1804c
  7. 14 9月, 2010 1 次提交
  8. 11 9月, 2010 2 次提交
  9. 10 9月, 2010 2 次提交