1. 04 9月, 2014 11 次提交
  2. 03 9月, 2014 21 次提交
  3. 02 9月, 2014 8 次提交
    • W
      sock: deduplicate errqueue dequeue · 364a9e93
      Willem de Bruijn 提交于
      sk->sk_error_queue is dequeued in four locations. All share the
      exact same logic. Deduplicate.
      
      Also collapse the two critical sections for dequeue (at the top of
      the recv handler) and signal (at the bottom).
      
      This moves signal generation for the next packet forward, which should
      be harmless.
      
      It also changes the behavior if the recv handler exits early with an
      error. Previously, a signal for follow-up packets on the errqueue
      would then not be scheduled. The new behavior, to always signal, is
      arguably a bug fix.
      
      For rxrpc, the change causes the same function to be called repeatedly
      for each queued packet (because the recv handler == sk_error_report).
      It is likely that all packets will fail for the same reason (e.g.,
      memory exhaustion).
      
      This code runs without sk_lock held, so it is not safe to trust that
      sk->sk_err is immutable inbetween releasing q->lock and the subsequent
      test. Introduce int err just to avoid this potential race.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      364a9e93
    • W
      net-timestamp: expand documentation · 8fe2f761
      Willem de Bruijn 提交于
      Expand Documentation/networking/timestamping.txt with new
      interfaces and bytestream timestamping. Also minor
      cleanup of the other text.
      
      Import txtimestamp.c test of the new features.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8fe2f761
    • D
      Merge branch 'csums-next' · c5a65680
      David S. Miller 提交于
      Tom Herbert says:
      
      ====================
      net: Checksum offload changes - Part VI
      
      I am working on overhauling RX checksum offload. Goals of this effort
      are:
      
      - Specify what exactly it means when driver returns CHECKSUM_UNNECESSARY
      - Preserve CHECKSUM_COMPLETE through encapsulation layers
      - Don't do skb_checksum more than once per packet
      - Unify GRO and non-GRO csum verification as much as possible
      - Unify the checksum functions (checksum_init)
      - Simplify code
      
      What is in this seventh patch set:
      
      - Add skb->csum. This allows a device or GRO to indicate that an
        invalid checksum was detected.
      - Checksum unncessary to checksum complete conversions.
      
      With these changes, I believe that the third goal of the overhaul is
      now mostly achieved. In the case of no encapsulation or one layer of
      encapsulation, there should only be at most one skb_checksum over
      each packet (between GRO and normal path). In the case of two layers
      of encapsulation, it is still possible with the right combination of
      non-zero and zero UDP checksums to have >1 skb_checksum. For instance:
      IP>GRE(with csum)>IP>UDP(zero csum)>VXLAN>IP>UDP(non-zero csum),
      would likely necessiate an skb_checksum in GRO and normal path.
      This doesn't seem like a common scenario at all so I'm inclined to
      not address this now, if multiple layers of encapsulation becomes
      popular we can reassess.
      
      Note that checksum conversion shows a nice improvement for RX VXLAN when
      outer UDP checksum is enabled (12.65% CPU compared to 20.94%). This
      is not only from the fact that we don't need checksum calculation on
      the host, but also allows GRO for VXLAN in this case. Checksum
      conversion does not help send side (which still needs to perform
      a checksum on host). For that we will implement remote checksum offload
      in a later patch
      (http://tools.ietf.org/html/draft-herbert-remotecsumoffload-00).
      
      Please review carefully and test if possible, mucking with basic
      checksum functions is always a little precarious :-)
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5a65680
    • T
    • T
    • T
      gre: Add support for checksum unnecessary conversions · 884d338c
      Tom Herbert 提交于
      Call skb_checksum_try_convert and skb_gro_checksum_try_convert
      after checksum is found present and validated in the GRE header
      for normal and GRO paths respectively.
      
      In GRO path, call skb_gro_checksum_try_convert
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      884d338c
    • T
      udp: Add support for doing checksum unnecessary conversion · 2abb7cdc
      Tom Herbert 提交于
      Add support for doing CHECKSUM_UNNECESSARY to CHECKSUM_COMPLETE
      conversion in UDP tunneling path.
      
      In the normal UDP path, we call skb_checksum_try_convert after locating
      the UDP socket. The check is that checksum conversion is enabled for
      the socket (new flag in UDP socket) and that checksum field is
      non-zero.
      
      In the UDP GRO path, we call skb_gro_checksum_try_convert after
      checksum is validated and checksum field is non-zero. Since this is
      already in GRO we assume that checksum conversion is always wanted.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2abb7cdc
    • T
      net: Infrastructure for checksum unnecessary conversions · d96535a1
      Tom Herbert 提交于
      For normal path, added skb_checksum_try_convert which is called
      to attempt to convert CHECKSUM_UNNECESSARY to CHECKSUM_COMPLETE. The
      primary condition to allow this is that ip_summed is CHECKSUM_NONE
      and csum_valid is true, which will be the state after consuming
      a CHECKSUM_UNNECESSARY.
      
      For GRO path, added skb_gro_checksum_try_convert which is the GRO
      analogue of skb_checksum_try_convert. The primary condition to allow
      this is that NAPI_GRO_CB(skb)->csum_cnt == 0 and
      NAPI_GRO_CB(skb)->csum_valid is set. This implies that we have consumed
      all available CHECKSUM_UNNECESSARY checksums in the GRO path.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d96535a1