1. 19 Oct, 2007 7 commits
    • Herbert Xu's avatar
      [NET]: Fix possible dev_deactivate race condition · ce0e32e6
      Herbert Xu authored
      The function dev_deactivate is supposed to only return when
      all outstanding transmissions have completed.  Unfortunately
      it is possible for store operations in the driver's transmit
      function to only become visible after dev_deactivate returns.
      
      This patch fixes this by taking the queue lock after we see
      the end of the queue run.  This ensures that all effects of
      any previous transmit calls are visible.
      
      If however we detect that there is another queue run occuring,
      then we'll warn about it because this should never happen as
      we have pointed dev->qdisc to noop_qdisc within the same queue
      lock earlier in the functino.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce0e32e6
    • Anton Arapov's avatar
      [INET]: Justification for local port range robustness. · a25de534
      Anton Arapov authored
        There is a justifying patch for Stephen's patches. Stephen's patches
      disallows using a port range of one single port and brakes the meaning
      of the 'remaining' variable, in some places it has different meaning.
      My patch gives back the sense of 'remaining' variable. It should mean
      how many ports are remaining and nothing else. Also my patch allows
      using a single port.
      
        I sure we must be able to use mentioned port range, this does not
      restricted by documentation and does not brake current behavior.
      
      usefull links:
      Patches posted by Stephen Hemminger
        http://marc.info/?l=linux-netdev&m=119206106218187&w=2
        http://marc.info/?l=linux-netdev&m=119206109918235&w=2
      
      Andrew Morton's comment
        http://marc.info/?l=linux-kernel&m=119248225007737&w=2
      
      1. Allows using a port range of one single port.
      2. Gives back sense of 'remaining' variable.
      Signed-off-by: default avatarAnton Arapov <aarapov@redhat.com>
      Acked-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a25de534
    • Patrick McHardy's avatar
      [PACKET]: Kill unused pg_vec_endpage() function · be702d5e
      Patrick McHardy authored
      The conversion to vm_insert_page() left this unused function behind,
      remove it.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be702d5e
    • David S. Miller's avatar
    • Randy Dunlap's avatar
      [NET]: QoS/Sched as menuconfig · 85ef3e5c
      Randy Dunlap authored
      Convert "QoS and/or fair queueing" to menuconfig.
      This makes it easy for someone to disable all sub-options with
      one config symbol.
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      85ef3e5c
    • Olof Johansson's avatar
      [NET]: Fix bug in sk_filter race cures. · 9b013e05
      Olof Johansson authored
      Looks like this might be causing problems, at least for me on ppc. This
      happened during a normal boot, right around first interface config/dhcp
      run..
      
      cpu 0x0: Vector: 300 (Data Access) at [c00000000147b820]
          pc: c000000000435e5c: .sk_filter_delayed_uncharge+0x1c/0x60
          lr: c0000000004360d0: .sk_attach_filter+0x170/0x180
          sp: c00000000147baa0
         msr: 9000000000009032
         dar: 4
       dsisr: 40000000
        current = 0xc000000004780fa0
        paca    = 0xc000000000650480
          pid   = 1295, comm = dhclient3
      0:mon> t
      [c00000000147bb20] c0000000004360d0 .sk_attach_filter+0x170/0x180
      [c00000000147bbd0] c000000000418988 .sock_setsockopt+0x788/0x7f0
      [c00000000147bcb0] c000000000438a74 .compat_sys_setsockopt+0x4e4/0x5a0
      [c00000000147bd90] c00000000043955c .compat_sys_socketcall+0x25c/0x2b0
      [c00000000147be30] c000000000007508 syscall_exit+0x0/0x40
      --- Exception: c01 (System Call) at 000000000ff618d8
      SP (fffdf040) is in userspace
      0:mon> 
      
      I.e. null pointer deref at sk_filter_delayed_uncharge+0x1c:
      
      0:mon> di $.sk_filter_delayed_uncharge
      c000000000435e40  7c0802a6      mflr    r0
      c000000000435e44  fbc1fff0      std     r30,-16(r1)
      c000000000435e48  7c8b2378      mr      r11,r4
      c000000000435e4c  ebc2cdd0      ld      r30,-12848(r2)
      c000000000435e50  f8010010      std     r0,16(r1)
      c000000000435e54  f821ff81      stdu    r1,-128(r1)
      c000000000435e58  380300a4      addi    r0,r3,164
      c000000000435e5c  81240004      lwz     r9,4(r4)
      
      That's the deref of fp:
      
      static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp)
      {
              unsigned int size = sk_filter_len(fp);
      ...
      
      That is called from sk_attach_filter():
      
      ...
              rcu_read_lock_bh();
              old_fp = rcu_dereference(sk->sk_filter);
              rcu_assign_pointer(sk->sk_filter, fp);
              rcu_read_unlock_bh();
      
              sk_filter_delayed_uncharge(sk, old_fp);
              return 0;
      ...
      
      So, looks like rcu_dereference() returned NULL. I don't know the
      filter code at all, but it seems like it might be a valid case?
      sk_detach_filter() seems to handle a NULL sk_filter, at least.
      
      So, this needs review by someone who knows the filter, but it fixes the
      problem for me:
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b013e05
    • Linus Torvalds's avatar
      Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 · 4fa4d23f
      Linus Torvalds authored
      * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
        pcnet32: remove private net_device_stats structure
        vortex_up should initialize "err"
        pcnet32: remove compile warnings in non-napi mode
        pcnet32: fix non-napi packet reception
        fix EMAC driver for proper napi_synchronize API
        sky2: shutdown cleanup
        napi_synchronize: waiting for NAPI
        forcedeth msi bugfix
        gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement
        fs_enet: Update for API changes
        gianfar: remove orphan struct.
        forcedeth: fix rx-work condition in nv_rx_process_optimized() too
      4fa4d23f
  2. 18 Oct, 2007 33 commits