1. 12 Jan, 2011 1 commit
  2. 19 Dec, 2010 1 commit
  3. 23 Sep, 2010 1 commit
  4. 21 Sep, 2010 1 commit
    • Eric Dumazet's avatar
      ip: fix truesize mismatch in ip fragmentation · 3d13008e
      Eric Dumazet authored
      Special care should be taken when slow path is hit in ip_fragment() :
      When walking through frags, we transfert truesize ownership from skb to
      frags. Then if we hit a slow_path condition, we must undo this or risk
      uncharging frags->truesize twice, and in the end, having negative socket
      sk_wmem_alloc counter, or even freeing socket sooner than expected.
      Many thanks to Nick Bowler, who provided a very clean bug report and
      test program.
      Thanks to Jarek for reviewing my first patch and providing a V2
      While Nick bisection pointed to commit 2b85a34e (net: No more
      expensive sock_hold()/sock_put() on each tx), underlying bug is older
      A side effect is to extend work done in commit b2722b1c
      (ip_fragment: also adjust skb->truesize for packets not owned by a
      socket) to ipv6 as well.
      Reported-and-bisected-by: default avatarNick Bowler <nbowler@elliptictech.com>
      Tested-by: default avatarNick Bowler <nbowler@elliptictech.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Jarek Poplawski <jarkao2@gmail.com>
      CC: Patrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  5. 23 Aug, 2010 1 commit
  6. 11 Jun, 2010 1 commit
  7. 28 May, 2010 1 commit
  8. 11 May, 2010 1 commit
    • Patrick McHardy's avatar
      ipv6: ip6mr: support multiple tables · d1db275d
      Patrick McHardy authored
      This patch adds support for multiple independant multicast routing instances,
      named "tables".
      Userspace multicast routing daemons can bind to a specific table instance by
      issuing a setsockopt call using a new option MRT6_TABLE. The table number is
      stored in the raw socket data and affects all following ip6mr setsockopt(),
      getsockopt() and ioctl() calls. By default, a single table (RT6_TABLE_DFLT)
      is created with a default routing rule pointing to it. Newly created pim6reg
      devices have the table number appended ("pim6regX"), with the exception of
      devices created in the default table, which are named just "pim6reg" for
      compatibility reasons.
      Packets are directed to a specific table instance using routing rules,
      similar to how regular routing rules work. Currently iif, oif and mark
      are supported as keys, source and destination addresses could be supported
      Example usage:
      - bind pimd/xorp/... to a specific table:
      uint32_t table = 123;
      setsockopt(fd, SOL_IPV6, MRT6_TABLE, &table, sizeof(table));
      - create routing rules directing packets to the new table:
      # ip -6 mrule add iif eth0 lookup 123
      # ip -6 mrule add oif eth0 lookup 123
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
  9. 30 Apr, 2010 1 commit
  10. 24 Apr, 2010 2 commits
  11. 21 Apr, 2010 1 commit
    • Shan Wei's avatar
      ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU... · f2228f78
      Shan Wei authored
      ipv6: allow to send packet after receiving ICMPv6 Too Big message with MTU field less than IPV6_MIN_MTU
      According to RFC2460, PMTU is set to the IPv6 Minimum Link
      MTU (1280) and a fragment header should always be included
      after a node receiving Too Big message reporting PMTU is
      less than the IPv6 Minimum Link MTU.
      After receiving a ICMPv6 Too Big message reporting PMTU is
      less than the IPv6 Minimum Link MTU, sctp *can't* send any
      data/control chunk that total length including IPv6 head
      and IPv6 extend head is less than IPV6_MIN_MTU(1280 bytes).
      The failure occured in p6_fragment(), about reason
      see following(take SHUTDOWN chunk for example):
      sctp_packet_transmit (SHUTDOWN chunk, len=16 byte)
      |------sctp_v6_xmit (local_df=0)
             |------ip6_output (dst_allfrag is ture)
      In ip6_fragment(), for local_df=0, drops the the packet
      and returns EMSGSIZE.
      The patch fixes it with adding check length of skb->len.
      In this case, Ipv6 not to fragment upper protocol data,
      just only add a fragment header before it.
      Signed-off-by: default avatarShan Wei <shanwei@cn.fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  12. 19 Apr, 2010 2 commits
  13. 16 Apr, 2010 3 commits
  14. 15 Apr, 2010 1 commit
    • Eric Dumazet's avatar
      ip: Fix ip_dev_loopback_xmit() · e30b38c2
      Eric Dumazet authored
      Eric Paris got following trace with a linux-next kernel
      [   14.203970] BUG: using smp_processor_id() in preemptible [00000000]
      code: avahi-daemon/2093
      [   14.204025] caller is netif_rx+0xfa/0x110
      [   14.204035] Call Trace:
      [   14.204064]  [<ffffffff81278fe5>] debug_smp_processor_id+0x105/0x110
      [   14.204070]  [<ffffffff8142163a>] netif_rx+0xfa/0x110
      [   14.204090]  [<ffffffff8145b631>] ip_dev_loopback_xmit+0x71/0xa0
      [   14.204095]  [<ffffffff8145b892>] ip_mc_output+0x192/0x2c0
      [   14.204099]  [<ffffffff8145d610>] ip_local_out+0x20/0x30
      [   14.204105]  [<ffffffff8145d8ad>] ip_push_pending_frames+0x28d/0x3d0
      [   14.204119]  [<ffffffff8147f1cc>] udp_push_pending_frames+0x14c/0x400
      [   14.204125]  [<ffffffff814803fc>] udp_sendmsg+0x39c/0x790
      [   14.204137]  [<ffffffff814891d5>] inet_sendmsg+0x45/0x80
      [   14.204149]  [<ffffffff8140af91>] sock_sendmsg+0xf1/0x110
      [   14.204189]  [<ffffffff8140dc6c>] sys_sendmsg+0x20c/0x380
      [   14.204233]  [<ffffffff8100ad82>] system_call_fastpath+0x16/0x1b
      While current linux-2.6 kernel doesnt emit this warning, bug is latent
      and might cause unexpected failures.
      ip_dev_loopback_xmit() runs in process context, preemption enabled, so
      must call netif_rx_ni() instead of netif_rx(), to make sure that we
      process pending software interrupt.
      Same change for ip6_dev_loopback_xmit()
      Reported-by: default avatarEric Paris <eparis@redhat.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  15. 13 Apr, 2010 2 commits
  16. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      The script does the followings.
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
      The conversion was done in the following steps.
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
      6. percpu.h was updated not to include slab.h.
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  17. 25 Mar, 2010 1 commit
  18. 26 Feb, 2010 1 commit
    • Ulrich Weber's avatar
      ipv6: Use 1280 as min MTU for ipv6 forwarding · 14f3ad6f
      Ulrich Weber authored
      Clients will set their MTU to 1280 if they receive a
      ICMPV6_PKT_TOOBIG message with an MTU less than 1280.
      To allow encapsulating of packets over a 1280 link
      we should always accept packets with a size of 1280
      for forwarding even if the path has a lower MTU and
      fragment the encapsulated packets afterwards.
      In case a forwarded packet is not going to be encapsulated
      a ICMPV6_PKT_TOOBIG msg will still be send by ip6_fragment()
      with the correct MTU.
      Signed-off-by: default avatarUlrich Weber <uweber@astaro.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  19. 18 Feb, 2010 1 commit
  20. 06 Jan, 2010 1 commit
    • Octavian Purdila's avatar
      ip: fix mc_loop checks for tunnels with multicast outer addresses · 7ad6848c
      Octavian Purdila authored
      When we have L3 tunnels with different inner/outer families
      (i.e. IPV4/IPV6) which use a multicast address as the outer tunnel
      destination address, multicast packets will be loopbacked back to the
      sending socket even if IP*_MULTICAST_LOOP is set to disabled.
      The mc_loop flag is present in the family specific part of the socket
      (e.g. the IPv4 or IPv4 specific part).  setsockopt sets the inner
      family mc_loop flag. When the packet is pushed through the L3 tunnel
      it will eventually be processed by the outer family which if different
      will check the flag in a different part of the socket then it was set.
      Signed-off-by: default avatarOctavian Purdila <opurdila@ixiacom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  21. 02 Sep, 2009 1 commit
    • Eric Dumazet's avatar
      ip: Report qdisc packet drops · 6ce9e7b5
      Eric Dumazet authored
      Christoph Lameter pointed out that packet drops at qdisc level where not
      accounted in SNMP counters. Only if application sets IP_RECVERR, drops
      are reported to user (-ENOBUFS errors) and SNMP counters updated.
      IP_RECVERR is used to enable extended reliable error message passing,
      but these are not needed to update system wide SNMP stats.
      This patch changes things a bit to allow SNMP counters to be updated,
      regardless of IP_RECVERR being set or not on the socket.
      Example after an UDP tx flood
      # netstat -s 
          1487048 outgoing packets dropped
          SndbufErrors: 1487048
      send() syscalls, do however still return an OK status, to not
      break applications.
      Note : send() manual page explicitly says for -ENOBUFS error :
       "The output queue for a network interface was full.
        This generally indicates that the interface has stopped sending,
        but may be caused by transient congestion.
        (Normally, this does not occur in Linux. Packets are just silently
        dropped when a device queue overflows.) "
      This is not true for IP_RECVERR enabled sockets : a send() syscall
      that hit a qdisc drop returns an ENOBUFS error.
      Many thanks to Christoph, David, and last but not least, Alexey !
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  22. 01 Sep, 2009 1 commit
  23. 13 Aug, 2009 1 commit
  24. 12 Jul, 2009 2 commits
  25. 11 Jul, 2009 1 commit
  26. 11 Jun, 2009 1 commit
    • Eric Dumazet's avatar
      net: No more expensive sock_hold()/sock_put() on each tx · 2b85a34e
      Eric Dumazet authored
      One of the problem with sock memory accounting is it uses
      a pair of sock_hold()/sock_put() for each transmitted packet.
      This slows down bidirectional flows because the receive path
      also needs to take a refcount on socket and might use a different
      cpu than transmit path or transmit completion path. So these
      two atomic operations also trigger cache line bounces.
      We can see this in tx or tx/rx workloads (media gateways for example),
      where sock_wfree() can be in top five functions in profiles.
      We use this sock_hold()/sock_put() so that sock freeing
      is delayed until all tx packets are completed.
      As we also update sk_wmem_alloc, we could offset sk_wmem_alloc
      by one unit at init time, until sk_free() is called.
      Once sk_free() is called, we atomic_dec_and_test(sk_wmem_alloc)
      to decrement initial offset and atomicaly check if any packets
      are in flight.
      skb_set_owner_w() doesnt call sock_hold() anymore
      sock_wfree() doesnt call sock_put() anymore, but check if sk_wmem_alloc
      reached 0 to perform the final freeing.
      Drawback is that a skb->truesize error could lead to unfreeable sockets, or
      even worse, prematurely calling __sk_free() on a live socket.
      Nice speedups on SMP. tbench for example, going from 2691 MB/s to 2711 MB/s
      on my 8 cpu dev machine, even if tbench was not really hitting sk_refcnt
      contention point. 5 % speedup on a UDP transmit workload (depends
      on number of flows), lowering TX completion cpu usage.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  27. 09 Jun, 2009 1 commit
  28. 03 Jun, 2009 1 commit
  29. 27 Apr, 2009 1 commit
  30. 05 Feb, 2009 1 commit
  31. 10 Dec, 2008 1 commit
  32. 28 Oct, 2008 1 commit
  33. 08 Oct, 2008 2 commits