1. 19 5月, 2009 1 次提交
    • 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
  2. 20 4月, 2009 1 次提交
    • E
      loopback: packet drops accounting · 7eebb0b2
      Eric Dumazet 提交于
      We can in some situations drop packets in netif_rx()
      
      loopback driver does not report these (unlikely) drops to its stats,
      and incorrectly change packets/bytes counts.
      
      After this patch applied, "ifconfig lo" can reports these drops as in :
      
      # ifconfig lo
      lo        Link encap:Local Loopback
                inet addr:127.0.0.1  Mask:255.0.0.0
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:692562900 errors:3228 dropped:3228 overruns:0 frame:0
                TX packets:692562900 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0
                RX bytes:2865674174 (2.6 GiB)  TX bytes:2865674174 (2.6 GiB)
      
      I initialy chose to reflect those errors only in tx_dropped/tx_errors, but David
      convinced me that it was really RX errors, as loopback_xmit() really starts
      a RX process. (calling eth_type_trans() for example, that itself pulls the ethernet header)
      
      These errors are accounted in rx_dropped/rx_errors.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7eebb0b2
  3. 21 11月, 2008 1 次提交
  4. 20 11月, 2008 1 次提交
  5. 08 11月, 2008 2 次提交
  6. 06 11月, 2008 1 次提交
    • E
      net: Guaranetee the proper ordering of the loopback device. · ae33bc40
      Eric W. Biederman 提交于
      I was recently hunting a bug that occurred in network namespace
      cleanup.  In looking at the code it became apparrent that we have
      and will continue to have cases where if we have anything going
      on in a network namespace there will be assumptions that the
      loopback device is present.   Things like sending igmp unsubscribe
      messages when we bring down network devices invokes the routing
      code which assumes that at least the loopback driver is present.
      
      Therefore to avoid magic initcall ordering hackery that is hard
      to follow and hard to get right insert a call to register the
      loopback device directly from net_dev_init().    This guarantes
      that the loopback device is the first device registered and
      the last network device to go away.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ae33bc40
  7. 04 11月, 2008 1 次提交
  8. 31 10月, 2008 1 次提交
  9. 16 8月, 2008 3 次提交
  10. 18 7月, 2008 1 次提交
  11. 26 3月, 2008 1 次提交
  12. 29 1月, 2008 1 次提交
  13. 13 1月, 2008 1 次提交
  14. 13 11月, 2007 1 次提交
  15. 27 10月, 2007 1 次提交
    • E
      [NET]: Marking struct pernet_operations __net_initdata was inappropriate · 2b008b0a
      Eric W. Biederman 提交于
      It is not safe to to place struct pernet_operations in a special section.
      We need struct pernet_operations to last until we call unregister_pernet_subsys.
      Which doesn't happen until module unload.
      
      So marking struct pernet_operations is a disaster for modules in two ways.
      - We discard it before we call the exit method it points to.
      - Because I keep struct pernet_operations on a linked list discarding
        it for compiled in code removes elements in the middle of a linked
        list and does horrible things for linked insert.
      
      So this looks safe assuming __exit_refok is not discarded
      for modules.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b008b0a
  16. 16 10月, 2007 1 次提交
  17. 11 10月, 2007 12 次提交
  18. 31 7月, 2007 1 次提交
  19. 26 4月, 2007 7 次提交
  20. 04 1月, 2007 1 次提交