1. 21 5月, 2009 19 次提交
  2. 20 5月, 2009 17 次提交
  3. 19 5月, 2009 4 次提交
    • E
      net: release dst entry in dev_hard_start_xmit() · 93f154b5
      Eric Dumazet 提交于
      One point of contention in high network loads is the dst_release() performed
      when a transmited skb is freed. This is because NIC tx completion calls
      dev_kree_skb() long after original call to dev_queue_xmit(skb).
      
      CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
      quite visible if one CPU is 100% handling softirqs for a network device,
      since dst_clone() is done by other cpus, involving cache line ping pongs.
      
      It seems right place to release dst is in dev_hard_start_xmit(), for most
      devices but ones that are virtual, and some exceptions.
      
      David Miller suggested to define a new device flag, set in alloc_netdev_mq()
      (so that most devices set it at init time), and carefuly unset in devices
      which dont want a NULL skb->dst in their ndo_start_xmit().
      
      List of devices that must clear this flag is :
      
      - loopback device, because it calls netif_rx() and quoting Patrick :
          "ip_route_input() doesn't accept loopback addresses, so loopback packets
           already need to have a dst_entry attached."
      - appletalk/ipddp.c : needs skb->dst in its xmit function
      
      - And all devices that call again dev_queue_xmit() from their xmit function
      (as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc_fr
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93f154b5
    • E
      net: FIX bonding sysfs rtnl_lock deadlock · 496a60cd
      Eric W. Biederman 提交于
      Sysfs files for a network device can not unconditionally take the
      rtnl_lock as the bonding sysfs files do.  If someone accesses those
      sysfs files while the network device is being unregistered with the
      rtnl_lock held we will deadlock.
      
      So use trylock and restart_syscall to avoid this problem.
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      496a60cd
    • E
      net: Fix ipoib rtnl_lock sysfs deadlock. · 26574401
      Eric W. Biederman 提交于
      Network device sysfs files that grab the rtnl_lock unconditionally
      will deadlock if accessed when the network device is being
      unregistered.  So use trylock and syscall_restart to avoid this
      deadlock.
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26574401
    • E
      net: Fix bridgeing sysfs handling of rtnl_lock · af38f298
      Eric W. Biederman 提交于
      Holding rtnl_lock when we are unregistering the sysfs files can
      deadlock if we unconditionally take rtnl_lock in a sysfs file.  So fix
      it with the now familiar patter of: rtnl_trylock and syscall_restart()
      Signed-off-by: NEric W. Biederman <ebiederm@aristanetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af38f298