1. 28 10月, 2008 1 次提交
  2. 23 10月, 2008 1 次提交
    • H
      net: Fix disjunct computation of netdev features · b63365a2
      Herbert Xu 提交于
      My change
      
          commit e2a6b852
          net: Enable TSO if supported by at least one device
      
      didn't do what was intended because the netdev_compute_features
      function was designed for conjunctions.  So what happened was that
      it would simply take the TSO status of the last constituent device.
      
      This patch extends it to support both conjunctions and disjunctions
      under the new name of netdev_increment_features.
      
      It also adds a new function netdev_fix_features which does the
      sanity checking that usually occurs upon registration.  This ensures
      that the computation doesn't result in an illegal combination
      since this checking is absent when the change is initiated via
      ethtool.
      
      The two users of netdev_compute_features have been converted.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b63365a2
  3. 20 10月, 2008 1 次提交
  4. 17 10月, 2008 1 次提交
  5. 15 10月, 2008 1 次提交
  6. 14 10月, 2008 2 次提交
  7. 13 10月, 2008 1 次提交
  8. 08 10月, 2008 5 次提交
    • A
      netns: export netns list · b76a461f
      Alexey Dobriyan 提交于
      Conntrack code will use it for
      a) removing expectations and helpers when corresponding module is removed, and
      b) removing conntracks when L3 protocol conntrack module is removed.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      b76a461f
    • H
      net: Fix netdev_run_todo dead-lock · 58ec3b4d
      Herbert Xu 提交于
      Benjamin Thery tracked down a bug that explains many instances
      of the error
      
      unregister_netdevice: waiting for %s to become free. Usage count = %d
      
      It turns out that netdev_run_todo can dead-lock with itself if
      a second instance of it is run in a thread that will then free
      a reference to the device waited on by the first instance.
      
      The problem is really quite silly.  We were trying to create
      parallelism where none was required.  As netdev_run_todo always
      follows a RTNL section, and that todo tasks can only be added
      with the RTNL held, by definition you should only need to wait
      for the very ones that you've added and be done with it.
      
      There is no need for a second mutex or spinlock.
      
      This is exactly what the following patch does.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58ec3b4d
    • P
      net: only invoke dev->change_rx_flags when device is UP · b6c40d68
      Patrick McHardy 提交于
      Jesper Dangaard Brouer <hawk@comx.dk> reported a bug when setting a VLAN
      device down that is in promiscous mode:
      
      When the VLAN device is set down, the promiscous count on the real
      device is decremented by one by vlan_dev_stop(). When removing the
      promiscous flag from the VLAN device afterwards, the promiscous
      count on the real device is decremented a second time by the
      vlan_change_rx_flags() callback.
      
      The root cause for this is that the ->change_rx_flags() callback is
      invoked while the device is down. The synchronization is meant to mirror
      the behaviour of the ->set_rx_mode callbacks, meaning the ->open function
      is responsible for doing a full sync on open, the ->close() function is
      responsible for doing full cleanup on ->stop() and ->change_rx_flags()
      is meant to do incremental changes while the device is UP.
      
      Only invoke ->change_rx_flags() while the device is UP to provide the
      intended behaviour.
      Tested-by: NJesper Dangaard Brouer <jdb@comx.dk>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6c40d68
    • P
      net: packet split receive api · 654bed16
      Peter Zijlstra 提交于
      Add some packet-split receive hooks.
      
      For one this allows to do NUMA node affine page allocs. Later on these
      hooks will be extended to do emergency reserve allocations for
      fragments.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      654bed16
    • P
      net: wrap sk->sk_backlog_rcv() · c57943a1
      Peter Zijlstra 提交于
      Wrap calling sk->sk_backlog_rcv() in a function. This will allow extending the
      generic sk_backlog_rcv behaviour.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c57943a1
  9. 01 10月, 2008 2 次提交
  10. 30 9月, 2008 2 次提交
  11. 24 9月, 2008 1 次提交
  12. 23 9月, 2008 3 次提交
  13. 21 9月, 2008 2 次提交
  14. 19 9月, 2008 1 次提交
  15. 13 9月, 2008 1 次提交
    • B
      net: fix scheduling of dst_gc_task by __dst_free · f262b59b
      Benjamin Thery 提交于
      The dst garbage collector dst_gc_task() may not be scheduled as we
      expect it to be in __dst_free().
      
      Indeed, when the dst_gc_timer was replaced by the delayed_work
      dst_gc_work, the mod_timer() call used to schedule the garbage
      collector at an earlier date was replaced by a schedule_delayed_work()
      (see commit 86bba269).
      
      But, the behaviour of mod_timer() and schedule_delayed_work() is
      different in the way they handle the delay. 
      
      mod_timer() stops the timer and re-arm it with the new given delay,
      whereas schedule_delayed_work() only check if the work is already
      queued in the workqueue (and queue it (with delay) if it is not)
      BUT it does NOT take into account the new delay (even if the new delay
      is earlier in time).
      schedule_delayed_work() returns 0 if it didn't queue the work,
      but we don't check the return code in __dst_free().
      
      If I understand the code in __dst_free() correctly, we want dst_gc_task
      to be queued after DST_GC_INC jiffies if we pass the test (and not in
      some undetermined time in the future), so I think we should add a call
      to cancel_delayed_work() before schedule_delayed_work(). Patch below.
      
      Or we should at least test the return code of schedule_delayed_work(),
      and reset the values of dst_garbage.timer_inc and dst_garbage.timer_expires
      back to their former values if schedule_delayed_work() failed.
      Otherwise the subsequent calls to __dst_free will test the wrong values
      and assume wrong thing about when the garbage collector is supposed to
      be scheduled.
      
      dst_gc_task() also calls schedule_delayed_work() without checking
      its return code (or calling cancel_scheduled_work() first), but it
      should fine there: dst_gc_task is the routine of the delayed_work, so
      no dst_gc_work should be pending in the queue when it's running.
      Signed-off-by: NBenjamin Thery <benjamin.thery@bull.net>
      Acked-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f262b59b
  16. 11 9月, 2008 1 次提交
  17. 09 9月, 2008 1 次提交
    • H
      net: Enable TSO if supported by at least one device · e2a6b852
      Herbert Xu 提交于
      As it stands users of netdev_compute_features (e.g., bridges/bonding)
      will only enable TSO if all consituent devices support it.  This
      is unnecessarily pessimistic since even on devices that do not
      support hardware TSO and SG, emulated TSO still performs to a par
      with TSO off.
      
      This patch enables TSO if at least on constituent device supports
      it in hardware.
      
      The direct beneficiaries will be virtualisation that uses bridging
      since this means that TSO will always be enabled for communication
      from the host to the guests.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e2a6b852
  18. 08 9月, 2008 1 次提交
  19. 19 8月, 2008 2 次提交
  20. 18 8月, 2008 3 次提交
  21. 16 8月, 2008 2 次提交
  22. 14 8月, 2008 2 次提交
    • J
      pkt_sched: Protect gen estimators under est_lock. · d4766692
      Jarek Poplawski 提交于
      gen_kill_estimator() required rtnl_lock() protection, but since it is
      moved to an RCU callback __qdisc_destroy() let's use est_lock instead.
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4766692
    • A
      pktgen: prevent pktgen from using bad tx queue · 64c00d81
      Andrew Gallatin 提交于
      With the new multi-queue transmit code, it is possible to accidentally
      make pktgen pick a non-existing tx queue simply by using a stale
      script to drive pktgen.  Access to this non-existing tx queue will
      then trigger a bad memory access and kill the machine.
      
      For example, setting "queue_map_max 2" will cause my machine to die
      when accessing a garbage spinlock in the non-existing tx queue:
      
      BUG: spinlock bad magic on CPU#0, kpktgend_0/564
        lock: ffff88001ddf6718, .magic: ffffffff, .owner: /-1, .owner_cpu: 0
      Pid: 564, comm: kpktgend_0 Not tainted 2.6.27-rc3 #35
      
      Call Trace:
        [<ffffffff803a1228>] spin_bug+0xa4/0xac
        [<ffffffff803a1253>] _raw_spin_lock+0x23/0x123
        [<ffffffff8055b06f>] _spin_lock_bh+0x17/0x1b
        [<ffffffff804cb57d>] pktgen_thread_worker+0xa97/0x1002
        [<ffffffff8022874d>] ? finish_task_switch+0x38/0x97
        [<ffffffff80242077>] ? autoremove_wake_function+0x0/0x36
        [<ffffffff80242077>] ? autoremove_wake_function+0x0/0x36
        [<ffffffff804caae6>] ? pktgen_thread_worker+0x0/0x1002
        [<ffffffff80241a40>] kthread+0x44/0x6d
        [<ffffffff8020c399>] child_rip+0xa/0x11
        [<ffffffff802419fc>] ? kthread+0x0/0x6d
        [<ffffffff8020c38f>] ? child_rip+0x0/0x11
      
      The attached patch adds some sanity checking to prevent
      these sorts of configuration errors.
      Signed-off-by: NAndrew Gallatin <gallatin@myri.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      64c00d81
  23. 07 8月, 2008 3 次提交
    • R
      pktgen: multiqueue etc. · e6fce5b9
      Robert Olsson 提交于
      Sofar far pktgen have had a restriction to only use one device per kernel 
      thread. With the new multiqueue architecture this is no longer adequate.
      
      The patch below is an effort to remove this by in pktgen configuration 
      adding a tag to  the device name a la eth0@0 etc. The tag is used for 
      usual device config just as before. Also a new flag is introduced to mirror 
      queue_map with sending threads smp_processor_id() QUEUE_MAP_CPU.
      
      An example: We use 4 CPU's to send to one 10g interface (eth0)
       and we use the new tagging to send a mix of packet sizes, 64, 576 and
       1500 bytes. Also we use TX queues according to smp_processor_id()
      
       PGDEV=/proc/net/pktgen/kpktgend_0
       pgset "add_device eth0@0" 
      
       PGDEV=/proc/net/pktgen/kpktgend_1
       pgset "add_device eth0@1" 
      
       PGDEV=/proc/net/pktgen/kpktgend_2
       pgset "add_device eth0@2" 
      
       PGDEV=/proc/net/pktgen/kpktgend_3
       pgset "add_device eth0@3" 
      ....
      PGDEV=/proc/net/pktgen/eth0@0 
      pgset "pkt_size 64"
      pgset "flag QUEUE_MAP_CPU"
      
      PGDEV=/proc/net/pktgen/eth0@1
      pgset "pkt_size 572"
      pgset "flag QUEUE_MAP_CPU"
      
      PGDEV=/proc/net/pktgen/eth0@2
      pgset "pkt_size 1496"
      
      PGDEV=/proc/net/pktgen/eth0@3
      pgset "pkt_size 1496"
      pgset "flag QUEUE_MAP_CPU"
      Signed-off-by: NRobert Olsson <robert.olsson@its.uu.se>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6fce5b9
    • J
      net/core: Allow receive on active slaves. · f982307f
      Joe Eykholt 提交于
      If a packet_type specifies an active slave to bonding and not just any
      interface, allow it to receive frames that came in on that interface.
      Signed-off-by: NJoe Eykholt <jre@nuovasystems.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      f982307f
    • J
      net/core: Allow certain receives on inactive slave. · 0d7a3681
      Joe Eykholt 提交于
      Allow a packet_type that specifies the exact device to receive
      even on an inactive bonding slave devices.  This is important for some
      L2 protocols such as LLDP and FCoE.  This can eventually be used
      for the bonding special cases as well.
      Signed-off-by: NJoe Eykholt <jre@nuovasystems.com>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0d7a3681