19 Feb, 2013

1 commit

  • proc_net_remove is only used to remove proc entries
    that under /proc/net,it's not a general function for
    removing proc entries of netns. if we want to remove
    some proc entries which under /proc/net/stat/, we still
    need to call remove_proc_entry.

    this patch use remove_proc_entry to replace proc_net_remove.
    we can remove proc_net_remove after this patch.

    Signed-off-by: Gao feng
    Signed-off-by: David S. Miller

    Gao feng
     

18 Dec, 2012

1 commit


02 Dec, 2012

6 commits

  • We don't need to schedule the wakeup tasklet on *every* unlock; only if we
    actually blocked the channel in the first place.

    Signed-off-by: David Woodhouse
    Acked-by: Krzysztof Mazur

    David Woodhouse
     
  • The br2684 does not check if used vcc is in connected state,
    causing potential Oops in pppoatm_send() when vcc->send() is called
    on not fully connected socket.

    Now br2684 can be assigned only on connected sockets; otherwise
    -EINVAL error is returned.

    Signed-off-by: Krzysztof Mazur
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     
  • The br2684 code used module_put() during unassignment from vcc with
    hope that we have BKL. This assumption is no longer true.

    Now owner field in atmvcc is used to move this module_put()
    to vcc_destroy_socket().

    Signed-off-by: David Woodhouse
    Acked-by: Krzysztof Mazur

    David Woodhouse
     
  • Now that we can return zero from pppoatm_send() for reasons *other* than
    the queue being full, that means we can't depend on a subsequent call to
    pppoatm_pop() waking the queue, and we might leave it stalled
    indefinitely.

    Use the ->release_cb() callback to wake the queue after the sock is
    unlocked.

    Signed-off-by: David Woodhouse
    Acked-by: Krzysztof Mazur

    David Woodhouse
     
  • Avoid submitting packets to a vcc which is being closed. Things go badly
    wrong when the ->pop method gets later called after everything's been
    torn down.

    Use the ATM socket lock for synchronisation with vcc_destroy_socket(),
    which clears the ATM_VF_READY bit under the same lock. Otherwise, we
    could end up submitting a packet to the device driver even after its
    ->ops->close method has been called. And it could call the vcc's ->pop
    method after the protocol has been shut down. Which leads to a panic.

    Signed-off-by: David Woodhouse
    Acked-by: Krzysztof Mazur

    David Woodhouse
     
  • The immediate use case for this is that it will allow us to ensure that a
    pppoatm queue is woken after it has to drop a packet due to the sock being
    locked.

    Note that 'release_cb' is called when the socket is *unlocked*. This is
    not to be confused with vcc_release() — which probably ought to be called
    vcc_close().

    Signed-off-by: David Woodhouse
    Acked-by: Krzysztof Mazur

    David Woodhouse
     

30 Nov, 2012

2 commits

  • The pppoatm_may_send() is quite heavy and it's called three times
    in pppoatm_send() and inlining costs more than 200 bytes of code
    (more than 10% of total pppoatm driver code size).

    add/remove: 1/0 grow/shrink: 0/1 up/down: 132/-367 (-235)
    function old new delta
    pppoatm_may_send - 132 +132
    pppoatm_send 900 533 -367

    Signed-off-by: Krzysztof Mazur
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     
  • The vcc_destroy_socket() closes vcc before the protocol is detached
    from vcc by calling vcc->push() with NULL skb. This leaves some time
    window, where the protocol may call vcc->send() on closed vcc
    and crash.

    Now pppoatm_send(), like vcc_sendmsg(), checks for vcc flags that
    indicate that vcc is not ready. If the vcc is not ready we just
    drop frame. Queueing frames is much more complicated because we
    don't have callbacks that inform us about vcc flags changes.

    Signed-off-by: Krzysztof Mazur
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     

28 Nov, 2012

4 commits

  • The pppoatm_send() does not take any lock that will prevent concurrent
    vcc_sendmsg(). This causes two problems:

    - there is no locking between checking the send queue size
    with atm_may_send() and incrementing sk_wmem_alloc,
    and the real queue size can be a little higher than sk_sndbuf

    - the vcc->sendmsg() can be called concurrently. I'm not sure
    if it's allowed. Some drivers (eni, nicstar, ...) seem
    to assume it will never happen.

    Now pppoatm_send() takes ATM socket lock, the same that is used
    in vcc_sendmsg() and other ATM socket functions. The pppoatm_send()
    is called with BH disabled, so bh_lock_sock() is used instead
    of lock_sock().

    Signed-off-by: Krzysztof Mazur
    Cc: Chas Williams - CONTRACTOR
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     
  • The pppoatm used module_put() during unassignment from vcc with
    hope that we have BKL. This assumption is no longer true.

    Now owner field in atmvcc is used to move this module_put()
    to vcc_destroy_socket().

    Signed-off-by: Krzysztof Mazur
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     
  • The pppoatm does not check if used vcc is in connected state,
    causing an Oops in pppoatm_send() when vcc->send() is called
    on not fully connected socket.

    Now pppoatm can be assigned only on connected sockets; otherwise
    -EINVAL error is returned.

    Signed-off-by: Krzysztof Mazur
    Cc: Chas Williams - CONTRACTOR
    Signed-off-by: David Woodhouse

    Krzysztof Mazur
     
  • The atm is using atmvcc->push(vcc, NULL) callback to notify protocol
    that vcc will be closed and protocol must detach from it. This callback
    is usually used by protocol to decrement module usage count by module_put(),
    but it leaves small window then module is still used after module_put().

    Now the owner of push() callback is kept in atmvcc and
    module_put(atmvcc->owner) is called after the protocol is detached from vcc.

    Signed-off-by: Krzysztof Mazur
    Signed-off-by: David Woodhouse
    Acked-by: Chas Williams

    Krzysztof Mazur
     

27 Nov, 2012

1 commit

  • There's really no excuse for an additional wmem_default of buffering
    between the netdev queue and the ATM device. Two packets (one in-flight,
    and one ready to send) ought to be fine. It's not as if it should take
    long to get another from the netdev queue when we need it.

    If necessary we can make the queue space configurable later, but I don't
    think it's likely to be necessary.

    cf. commit 9d02daf754238adac48fa075ee79e7edd3d79ed3 (pppoatm: Fix
    excessive queue bloat) which did something very similar for PPPoATM.

    Note that there is a tremendously unlikely race condition which may
    result in qspace temporarily going negative. If a CPU running the
    br2684_pop() function goes off into the weeds for a long period of time
    after incrementing qspace to 1, but before calling netdev_wake_queue()...
    and another CPU ends up calling br2684_start_xmit() and *stopping* the
    queue again before the first CPU comes back, the netdev queue could
    end up being woken when qspace has already reached zero.

    An alternative approach to coping with this race would be to check in
    br2684_start_xmit() for qspace==0 and return NETDEV_TX_BUSY, but just
    using '> 0' and '< 1' for comparison instead of '== 0' and '!= 0' is
    simpler. It just warranted a mention of *why* we do it that way...

    Move the call to atmvcc->send() to happen *after* the accounting and
    potentially stopping the netdev queue, in br2684_xmit_vcc(). This matters
    if the ->send() call suffers an immediate failure, because it'll call
    br2684_pop() with the offending skb before returning. We want that to
    happen *after* we've done the initial accounting for the packet in
    question. Also make it return an appropriate success/failure indication
    while we're at it.

    Tested by running 'ping -l 1000 bottomless.aaisp.net.uk' from within my
    network, with only a single PPPoE-over-BR2684 link running. And after
    setting txqueuelen on the nas0 interface to something low (5, in fact).
    Before the patch, we'd see about 15 packets being queued and a resulting
    latency of ~56ms being reached. After the patch, we see only about 8,
    which is fairly much what we expect. And a max latency of ~36ms. On this
    OpenWRT box, wmem_default is 163840.

    Signed-off-by: David Woodhouse
    Reviewed-by: Krzysztof Mazur
    Signed-off-by: David S. Miller

    David Woodhouse
     

01 Sep, 2012

1 commit


16 Aug, 2012

2 commits


04 Jun, 2012

2 commits

  • Adding casts of objects to the same type is unnecessary
    and confusing for a human reader.

    For example, this cast:

    int y;
    int *p = (int *)&y;

    I used the coccinelle script below to find and remove these
    unnecessary casts. I manually removed the conversions this
    script produces of casts with __force and __user.

    @@
    type T;
    T *p;
    @@

    - (T *)p
    + p

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     
  • Remove some dropwatch/drop_monitor false positives.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

23 May, 2012

1 commit

  • Pull trivial updates from Jiri Kosina:
    "As usual, it's mostly typo fixes, redundant code elimination and some
    documentation updates."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
    edac, mips: don't change code that has been removed in edac/mips tree
    xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
    lib: Change mail address of Oskar Schirmer
    net: Change mail address of Oskar Schirmer
    arm/m68k: Change mail address of Sebastian Hess
    i2c: Change mail address of Oskar Schirmer
    net: Fix tcp_build_and_update_options comment in struct tcp_sock
    atomic64_32.h: fix parameter naming mismatch
    Kconfig: replace "--- help ---" with "---help---"
    c2port: fix bogus Kconfig "default no"
    edac: Fix spelling errors.
    qla1280: Remove redundant NULL check before release_firmware() call
    remoteproc: remove redundant NULL check before release_firmware()
    qla2xxx: Remove redundant NULL check before release_firmware() call.
    aic94xx: Get rid of redundant NULL check before release_firmware() call
    tehuti: delete redundant NULL check before release_firmware()
    qlogic: get rid of a redundant test for NULL before call to release_firmware()
    bna: remove redundant NULL test before release_firmware()
    tg3: remove redundant NULL test before release_firmware() call
    typhoon: get rid of redundant conditional before all to release_firmware()
    ...

    Linus Torvalds
     

16 May, 2012

2 commits


10 May, 2012

1 commit

  • Use the new bool function ether_addr_equal to add
    some clarity and reduce the likelihood for misuse
    of compare_ether_addr for sorting.

    Done via cocci script:

    $ cat compare_ether_addr.cocci
    @@
    expression a,b;
    @@
    - !compare_ether_addr(a, b)
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - compare_ether_addr(a, b)
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !ether_addr_equal(a, b) == 0
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !ether_addr_equal(a, b) != 0
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - ether_addr_equal(a, b) == 0
    + !ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - ether_addr_equal(a, b) != 0
    + ether_addr_equal(a, b)

    @@
    expression a,b;
    @@
    - !!ether_addr_equal(a, b)
    + ether_addr_equal(a, b)

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

16 Apr, 2012

1 commit


14 Apr, 2012

1 commit

  • We discovered that PPPoATM has an excessively deep transmit queue. A
    queue the size of the default socket send buffer (wmem_default) is
    maintained between the PPP generic core and the ATM device.

    Fix it to queue a maximum of *two* packets. The one the ATM device is
    currently working on, and one more for the ATM driver to process
    immediately in its TX done interrupt handler. The PPP core is designed
    to feed packets to the channel with minimal latency, so that really
    ought to be enough to keep the ATM device busy.

    While we're at it, fix the fact that we were triggering the wakeup
    tasklet on *every* pppoatm_pop() call. The comment saying "this is
    inefficient, but doing it right is too hard" turns out to be overly
    pessimistic... I think :)

    On machines like the Traverse Geos, with a slow Geode CPU and two
    high-speed ADSL2+ interfaces, there were reports of extremely high CPU
    usage which could partly be attributed to the extra wakeups.

    (The wakeup handling could actually be made a whole lot easier if we
    stop checking sk->sk_sndbuf altogether. Given that we now only queue
    *two* packets ever, one wonders what the point is. As it is, you could
    already deadlock the thing by setting the sk_sndbuf to a value lower
    than the MTU of the device, and it'd just block for ever.)

    Signed-off-by: David Woodhouse
    Signed-off-by: David S. Miller

    David Woodhouse
     

09 Apr, 2012

1 commit


06 Apr, 2012

1 commit


29 Mar, 2012

1 commit


05 Mar, 2012

1 commit

  • Since all that include/linux/if_ppp.h does is #include ,
    this replaces the occurrences of #include with
    #include .

    It also corrects an error in Documentation/networking/l2tp.txt, where
    it referenced include/linux/if_ppp.h as the source of some definitions
    that are actually now defined in include/linux/if_pppol2tp.h.

    Signed-off-by: Paul Mackerras
    Signed-off-by: David S. Miller

    Paul Mackerras
     

27 Feb, 2012

1 commit


22 Feb, 2012

1 commit

  • Commit 32092ecf0644 (atm: clip: Use device neigh support on top of
    "arp_tbl".) introduced a bug since clip_tbl is zeroed : Crash occurs in
    __neigh_for_each_release()

    idle_timer_check() must use instead arp_tbl and neigh_check_cb() should
    ignore non clip neighbours.

    Idea from David Miller.

    Reported-by: Meelis Roos
    Signed-off-by: Eric Dumazet
    Tested-by: Meelis Roos
    Signed-off-by: David S. Miller

    Eric Dumazet
     

02 Feb, 2012

1 commit


06 Dec, 2011

1 commit


03 Dec, 2011

1 commit


01 Dec, 2011

4 commits


29 Nov, 2011

1 commit