1. 01 9月, 2009 1 次提交
  2. 31 8月, 2009 1 次提交
  3. 15 8月, 2009 1 次提交
  4. 06 7月, 2009 1 次提交
  5. 18 6月, 2009 1 次提交
    • J
      net: group address list and its count · 31278e71
      Jiri Pirko 提交于
      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: NJiri 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: NDavid S. Miller <davem@davemloft.net>
      31278e71
  6. 09 6月, 2009 1 次提交
  7. 04 6月, 2009 1 次提交
    • H
      gso: Stop fraglists from escaping · 278b2513
      Herbert Xu 提交于
      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
      break.
      
      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: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      278b2513
  8. 30 5月, 2009 1 次提交
    • J
      net: convert unicast addr list · ccffad25
      Jiri Pirko 提交于
      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: NJiri 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: NDavid S. Miller <davem@davemloft.net>
      ccffad25
  9. 29 5月, 2009 1 次提交
    • J
      bonding: allow bond in mode balance-alb to work properly in bridge -try4.3 · 5d4e039b
      Jiri Pirko 提交于
      [PATCH net-next] bonding: allow bond in mode balance-alb to work properly in bridge -try4.3
      
      (updated)
      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
        anyway).
      
      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:
      https://bugzilla.redhat.com/show_bug.cgi?id=487763
      
      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).
      
      Jirka
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d4e039b
  10. 28 5月, 2009 2 次提交
  11. 27 5月, 2009 4 次提交
  12. 26 5月, 2009 1 次提交
    • E
      net: txq_trans_update() helper · 08baf561
      Eric Dumazet 提交于
      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
      instead.
      
      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: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      08baf561
  13. 25 5月, 2009 1 次提交
  14. 19 5月, 2009 1 次提交
    • E
      net: add tx_packets/tx_bytes/tx_dropped counters in struct netdev_queue · 7004bf25
      Eric Dumazet 提交于
      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: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7004bf25
  15. 18 5月, 2009 1 次提交
    • E
      net: tx scalability works : trans_start · 9d21493b
      Eric Dumazet 提交于
      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
      free.
      
      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: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d21493b
  16. 07 5月, 2009 1 次提交
  17. 06 5月, 2009 1 次提交
    • J
      net: introduce a list of device addresses dev_addr_list (v6) · f001fde5
      Jiri Pirko 提交于
      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
       bytes)
      
      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: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f001fde5
  18. 28 4月, 2009 2 次提交
  19. 27 4月, 2009 4 次提交
  20. 21 4月, 2009 1 次提交
  21. 16 4月, 2009 1 次提交
  22. 28 3月, 2009 1 次提交
    • D
      net: Add missing include into include/linux/netdevice.h · cc0be322
      Dmitri Vorobiev 提交于
      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
      'page_address'
      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: NDmitri Vorobiev <dmitri.vorobiev@movial.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc0be322
  23. 17 3月, 2009 1 次提交
    • H
      GRO: Move netpoll checks to correct location · d1c76af9
      Herbert Xu 提交于
      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: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1c76af9
  24. 14 3月, 2009 3 次提交
  25. 05 3月, 2009 1 次提交
    • D
      vlan: Fix vlan-in-vlan crashes. · 9d40bbda
      David S. Miller 提交于
      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: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d40bbda
  26. 15 2月, 2009 1 次提交
  27. 09 2月, 2009 2 次提交
  28. 06 2月, 2009 1 次提交
  29. 30 1月, 2009 1 次提交
    • H
      gro: Avoid copying headers of unmerged packets · 86911732
      Herbert Xu 提交于
      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: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86911732