1. 01 Sep, 2009 1 commit
  2. 31 Aug, 2009 1 commit
  3. 14 Aug, 2009 1 commit
  4. 06 Jul, 2009 1 commit
  5. 18 Jun, 2009 1 commit
    • Jiri Pirko's avatar
      net: group address list and its count · 31278e71
      Jiri Pirko authored
      This patch is inspired by patch recently posted by Johannes Berg. Basically what
      my patch does is to group list and a count of addresses into newly introduced
      structure netdev_hw_addr_list. This brings us two benefits:
      1) struct net_device becames a bit nicer.
      2) in the future there will be a possibility to operate with lists independently
         on netdevices (with exporting right functions).
      I wanted to introduce this patch before I'll post a multicast lists conversion.
      Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
       drivers/net/bnx2.c              |    4 +-
       drivers/net/e1000/e1000_main.c  |    4 +-
       drivers/net/ixgbe/ixgbe_main.c  |    6 +-
       drivers/net/mv643xx_eth.c       |    2 +-
       drivers/net/niu.c               |    4 +-
       drivers/net/virtio_net.c        |   10 ++--
       drivers/s390/net/qeth_l2_main.c |    2 +-
       include/linux/netdevice.h       |   17 +++--
       net/core/dev.c                  |  130 ++++++++++++++++++--------------------
       9 files changed, 89 insertions(+), 90 deletions(-)
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  6. 09 Jun, 2009 1 commit
  7. 04 Jun, 2009 1 commit
    • Herbert Xu's avatar
      gso: Stop fraglists from escaping · 278b2513
      Herbert Xu authored
      As it stands skb fraglists can get past the check in dev_queue_xmit
      if the skb is marked as GSO.  In particular, if the packet doesn't
      have the proper checksums for GSO, but can otherwise be handled by
      the underlying device, we will not perform the fraglist check on it
      at all.
      If the underlying device cannot handle fraglists, then this will
      The fix is as simple as moving the fraglist check from the device
      check into skb_gso_ok.
      This has caused crashes with Xen when used together with GRO which
      can generate GSO packets with fraglists.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  8. 30 May, 2009 1 commit
    • Jiri Pirko's avatar
      net: convert unicast addr list · ccffad25
      Jiri Pirko authored
      This patch converts unicast address list to standard list_head using
      previously introduced struct netdev_hw_addr. It also relaxes the
      locking. Original spinlock (still used for multicast addresses) is not
      needed and is no longer used for a protection of this list. All
      reading and writing takes place under rtnl (with no changes).
      I also removed a possibility to specify the length of the address
      while adding or deleting unicast address. It's always dev->addr_len.
      The convertion touched especially e1000 and ixgbe codes when the
      change is not so trivial.
      Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
       drivers/net/bnx2.c               |   13 +--
       drivers/net/e1000/e1000_main.c   |   24 +++--
       drivers/net/ixgbe/ixgbe_common.c |   14 ++--
       drivers/net/ixgbe/ixgbe_common.h |    4 +-
       drivers/net/ixgbe/ixgbe_main.c   |    6 +-
       drivers/net/ixgbe/ixgbe_type.h   |    4 +-
       drivers/net/macvlan.c            |   11 +-
       drivers/net/mv643xx_eth.c        |   11 +-
       drivers/net/niu.c                |    7 +-
       drivers/net/virtio_net.c         |    7 +-
       drivers/s390/net/qeth_l2_main.c  |    6 +-
       drivers/scsi/fcoe/fcoe.c         |   16 ++--
       include/linux/netdevice.h        |   18 ++--
       net/8021q/vlan.c                 |    4 +-
       net/8021q/vlan_dev.c             |   10 +-
       net/core/dev.c                   |  195 +++++++++++++++++++++++++++-----------
       net/dsa/slave.c                  |   10 +-
       net/packet/af_packet.c           |    4 +-
       18 files changed, 227 insertions(+), 137 deletions(-)
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  9. 29 May, 2009 1 commit
    • Jiri Pirko's avatar
      bonding: allow bond in mode balance-alb to work properly in bridge -try4.3 · 5d4e039b
      Jiri Pirko authored
      [PATCH net-next] bonding: allow bond in mode balance-alb to work properly in bridge -try4.3
      changes v4.2 -> v4.3
      - memcpy the address always, not just in case it differs from master->dev_addr
      - compare_ether_addr_64bits() is not used so there is no direct need to make new
        header file (I think it would be good to have bond stuff in separate file
      changes v4.1 -> v4.2
      - use skb->pkt_type == PACKET_HOST compare rather then comparing skb dest addr
        against skb->dev->dev_addr
      The problem is described in following bugzilla:
      Basically here's what's going on. In every mode, bonding interface uses the same
      mac address for all enslaved devices (except fail_over_mac). Only balance-alb
      will simultaneously use multiple MAC addresses across different slaves. When you
      put this kind of bond device into a bridge it will only add one of mac adresses
      into a hash list of mac addresses, say X. This mac address is marked as local.
      But this bonding interface also has mac address Y. Now then packet arrives with
      destination address Y, this address is not marked as local and the packed looks
      like it needs to be forwarded. This packet is then lost which is wrong.
      Notice that interfaces can be added and removed from bond while it is in bridge.
      When the multiple addresses for bridge port approach failed to solve this issue
      due to STP I started to think other way to solve this. I returned to previous
      solution but tweaked one.
      This patch solves the situation in the bonding without touching bridge code.
      For every incoming frame to bonding the destination address is compared to
      current address of the slave device from which tha packet came. If these two
      match destination address is replaced by mac address of the master. This address
      is known by bridge so it is delivered properly. Note that the comparsion is not
      made directly, it's used skb->pkt_type == PACKET_HOST instead. This is "set"
      previously in eth_type_trans().
      I experimentally tried that this works as good as searching through the slave
      list (v4 of this patch).
      Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  10. 27 May, 2009 6 commits
  11. 26 May, 2009 1 commit
    • Eric Dumazet's avatar
      net: txq_trans_update() helper · 08baf561
      Eric Dumazet authored
      We would like to get rid of netdev->trans_start = jiffies; that about all net
      drivers have to use in their start_xmit() function, and use txq->trans_start
      This can be done generically in core network, as suggested by David.
      Some devices, (particularly loopback) dont need trans_start update, because
      they dont have transmit watchdog. We could add a new device flag, or rely
      on fact that txq->tran_start can be updated is txq->xmit_lock_owner is
      different than -1. Use a helper function to hide our choice.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  12. 25 May, 2009 1 commit
  13. 18 May, 2009 2 commits
    • Eric Dumazet's avatar
      net: add tx_packets/tx_bytes/tx_dropped counters in struct netdev_queue · 7004bf25
      Eric Dumazet authored
      offsetof(struct net_device, features)=0x44
      offsetof(struct net_device, stats.tx_packets)=0x54
      offsetof(struct net_device, stats.tx_bytes)=0x5c
      offsetof(struct net_device, stats.tx_dropped)=0x6c
      Network drivers that touch dev->stats.tx_packets/stats.tx_bytes in their
      tx path can slow down SMP operations, since they dirty a cache line
      that should stay shared (dev->features is needed in rx and tx paths)
      We could move away stats field in net_device but it wont help that much.
      (Two cache lines dirtied in tx path, we can do one only)
      Better solution is to add tx_packets/tx_bytes/tx_dropped in struct
      netdev_queue because this structure is already touched in tx path and
      counters updates will then be free (no increase in size)
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Eric Dumazet's avatar
      net: tx scalability works : trans_start · 9d21493b
      Eric Dumazet authored
      struct net_device trans_start field is a hot spot on SMP and high performance
      devices, particularly multi queues ones, because every transmitter dirties
      it. Is main use is tx watchdog and bonding alive checks.
      But as most devices dont use NETIF_F_LLTX, we have to lock
      a netdev_queue before calling their ndo_start_xmit(). So it makes
      sense to move trans_start from net_device to netdev_queue. Its update
      will occur on a already present (and in exclusive state) cache line, for
      We can do this transition smoothly. An old driver continue to
      update dev->trans_start, while an updated one updates txq->trans_start.
      Further patches could also put tx_bytes/tx_packets counters in 
      netdev_queue to avoid dirtying dev->stats (vlan device comes to mind)
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  14. 06 May, 2009 1 commit
  15. 05 May, 2009 1 commit
    • Jiri Pirko's avatar
      net: introduce a list of device addresses dev_addr_list (v6) · f001fde5
      Jiri Pirko authored
      v5 -> v6 (current):
      -removed so far unused static functions
      -corrected dev_addr_del_multiple to call del instead of add
      v4 -> v5:
      -added device address type (suggested by davem)
      -removed refcounting (better to have simplier code then safe potentially few
      v3 -> v4:
      -changed kzalloc to kmalloc in __hw_addr_add_ii()
      -ASSERT_RTNL() avoided in dev_addr_flush() and dev_addr_init()
      v2 -> v3:
      -removed unnecessary rcu read locking
      -moved dev_addr_flush() calling to ensure no null dereference of dev_addr
      v1 -> v2:
      -added forgotten ASSERT_RTNL to dev_addr_init and dev_addr_flush
      -removed unnecessary rcu_read locking in dev_addr_init
      -use compare_ether_addr_64bits instead of compare_ether_addr
      -use L1_CACHE_BYTES as size for allocating struct netdev_hw_addr
      -use call_rcu instead of rcu_synchronize
      -moved is_etherdev_addr into __KERNEL__ ifdef
      This patch introduces a new list in struct net_device and brings a set of
      functions to handle the work with device address list. The list is a replacement
      for the original dev_addr field and because in some situations there is need to
      carry several device addresses with the net device. To be backward compatible,
      dev_addr is made to point to the first member of the list so original drivers
      sees no difference.
      Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  16. 28 Apr, 2009 2 commits
  17. 27 Apr, 2009 4 commits
  18. 21 Apr, 2009 1 commit
  19. 16 Apr, 2009 1 commit
  20. 27 Mar, 2009 1 commit
    • Dmitri Vorobiev's avatar
      net: Add missing include into include/linux/netdevice.h · cc0be322
      Dmitri Vorobiev authored
      The inline function skb_gro_mac_header defined in include/linux/netdevice.h
      makes use of page_address(). Depending on configuration options, the latter
      is either defined as a macro or is declared as a function in another header
      file, namely include/linux/mm.h. However, include/linux/netdevice.h does not
      include include/linux/mm.h.
      On MIPS, this has produced the following build error:
        CC      kernel/sysctl_check.o
      In file included from include/linux/icmpv6.h:173,
                       from include/linux/ipv6.h:208,
                       from include/net/ip_vs.h:26,
                       from kernel/sysctl_check.c:6:
      include/linux/netdevice.h: In function 'skb_gro_mac_header':
      include/linux/netdevice.h:1132: error: implicit declaration of function
      include/linux/netdevice.h:1133: warning: pointer/integer type mismatch
      in conditional expression
      make[1]: *** [kernel/sysctl_check.o] Error 1
      make: *** [kernel] Error 2
      The patch adds the missing include and fixes the build error.
      Signed-off-by: default avatarDmitri Vorobiev <dmitri.vorobiev@movial.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  21. 16 Mar, 2009 1 commit
    • Herbert Xu's avatar
      GRO: Move netpoll checks to correct location · d1c76af9
      Herbert Xu authored
      As my netpoll fix for net doesn't really work for net-next, we
      need this update to move the checks into the right place.  As it
      stands we may pass freed skbs to netpoll_receive_skb.
      This patch also introduces a netpoll_rx_on function to avoid GRO
      completely if we're invoked through netpoll.  This might seem
      paranoid but as netpoll may have an external receive hook it's
      better to be safe than sorry.  I don't think we need this for
      2.6.29 though since there's nothing immediately broken by it.
      This patch also moves the GRO_* return values to netdevice.h since
      VLAN needs them too (I tried to avoid this originally but alas
      this seems to be the easiest way out).  This fixes a bug in VLAN
      where it continued to use the old return value 2 instead of the
      correct GRO_DROP.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  22. 13 Mar, 2009 3 commits
  23. 05 Mar, 2009 1 commit
    • David S. Miller's avatar
      vlan: Fix vlan-in-vlan crashes. · 9d40bbda
      David S. Miller authored
      As analyzed by Patrick McHardy, vlan needs to reset it's
      netdev_ops pointer in it's ->init() function but this
      leaves the compat method pointers stale.
      Add a netdev_resync_ops() and call it from the vlan code.
      Any other driver which changes ->netdev_ops after register_netdevice()
      will need to call this new function after doing so too.
      With help from Patrick McHardy.
      Tested-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  24. 15 Feb, 2009 1 commit
  25. 09 Feb, 2009 2 commits
  26. 06 Feb, 2009 1 commit
  27. 30 Jan, 2009 1 commit
    • Herbert Xu's avatar
      gro: Avoid copying headers of unmerged packets · 86911732
      Herbert Xu authored
      Unfortunately simplicity isn't always the best.  The fraginfo
      interface turned out to be suboptimal.  The problem was quite
      obvious.  For every packet, we have to copy the headers from
      the frags structure into skb->head, even though for 99% of the
      packets this part is immediately thrown away after the merge.
      LRO didn't have this problem because it directly read the headers
      from the frags structure.
      This patch attempts to address this by creating an interface
      that allows GRO to access the headers in the first frag without
      having to copy it.  Because all drivers that use frags place the
      headers in the first frag this optimisation should be enough.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>