29 Nov, 2011

2 commits


22 Nov, 2011

1 commit

  • Sparse RCU checking reports two warnings in the mesh
    path table code. These are due to questionable uses of
    rcu_dereference.

    To fix the first one, get rid of mesh_gate_add() and
    just make mesh_path_add_gate() do the correct deref.

    To fix the second one, simply remove rcu_dereference()
    in mesh_gate_del() -- it already gets a proper pointer
    as indicated by the prototype (no __rcu annotation)
    and confirmed by the code.

    Cc: Javier Cardona
    Cc: Thomas Pedersen
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

10 Nov, 2011

1 commit

  • We only need to set the skb queue twice:

    1. by the netdev, on local TX.
    2. when forwarding a mesh frame.

    We only need to set the qos header twice:

    1. by mac80211, on local TX.
    2. when putting a frame on the mpath->frame_queue

    We also don't need the RA in order to set the proper queue mapping since
    all mesh STAs are QoS, indicate this and do it once when the frame is
    received. Also fixes an issue where the QoS header and queue mapping was not
    set for unicast forwarded frames.

    Signed-off-by: Javier Cardona
    Signed-off-by: Thomas Pedersen
    Signed-off-by: John W. Linville

    Javier Cardona
     

20 Sep, 2011

1 commit


15 Sep, 2011

2 commits


14 Sep, 2011

9 commits


30 Aug, 2011

2 commits


26 Aug, 2011

1 commit

  • Since a v1 of the mesh gate series was accidentally applied, this patch
    contains the changes in v2.

    These are:
    - automatically make mesh gate a root node.
    - use TU_TO_EXP_TIME macro.
    - initialize timer instead of checking for NULL timer function.
    - cleanups.

    Signed-off-by: Thomas Pedersen
    Signed-off-by: John W. Linville

    Thomas Pedersen
     

25 Aug, 2011

5 commits

  • In this implementation, a mesh gate is a root node with a certain bit
    set in its RANN flags. The mpath to this root node is marked as a path
    to a gate, and added to our list of known gates for this if_mesh. Once a
    path discovery process fails, we forward the unresolved frames to a
    known gate. Thanks to Luis Rodriguez for refactoring and bug fix help.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • Previously, mpaths were never flushed since the mpath is not active once
    we call this function.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • mesh_queue_preq is invoked invoked from both user (work queue) and
    softirq (timer) context, so the _bh version of spinlock needs to be
    used. Also, the mpath->state_lock should be softirq safe as well.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • If we have an mpath whose timer has not been initialized, don't try to
    delete it.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • make hwmp_dbg print the relevant sdata->name by default and improve
    formatting. Also add mpath_dbg macro for debugging of mesh path
    operations.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

23 Aug, 2011

1 commit


12 Aug, 2011

1 commit


06 Jul, 2011

1 commit

  • mlme.c
    l.757 ieee80211_dynamic_ps_enable_work(11)
    variable dereferenced before check 'sdata'

    mesh_pathtbl.c
    l.650 mesh_path_del(20) double lock 'bottom_half'
    l.663 mesh_path_del(33) double unlock 'bottom_half'

    Signed-off-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Christian Lamparter
     

25 May, 2011

1 commit


20 May, 2011

1 commit

  • After commit 1928ecab620907a0953f811316d05f367f3f4dba (mac80211: fix and
    simplify mesh locking) mesh table allocation is performed with the
    pathtbl_resize_lock taken. Under those conditions one should not sleep.
    This patch makes the allocations GFP_ATOMIC to prevent that.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

17 May, 2011

4 commits

  • …wireless-next-2.6 into for-davem

    Conflicts:
    drivers/net/wireless/iwlwifi/iwl-agn-tx.c
    net/mac80211/sta_info.h

    John W. Linville
     
  • This adds proper RCU annotations to the mesh path
    table code, and fixes a number of bugs in the code
    that I found while checking the sparse warnings I
    got as a result of the annotations.

    Some things like the changes in mesh_path_add() or
    mesh_pathtbl_init() only serve to shut up sparse,
    but other changes like the changes surrounding the
    for_each_mesh_entry() macro fix real RCU bugs in
    the code.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • The locking in mesh_{mpath,mpp}_table_grow not only
    has an rcu_read_unlock() missing, it's also racy
    (though really only technically since it's invoked
    from a single function only) since it obtains the
    new size of the table without any locking, so two
    invocations of the function could attempt the same
    resize.

    Additionally, it uses synchronize_rcu() which is
    rather expensive and can be avoided trivially here.

    Modify the functions to only use the table lock
    and use call_rcu() instead of synchronize_rcu().

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Mesh paths are deleted via mesh_path_del() which properly
    deactivates the timer associated to a mesh path. But if paths were
    deleted by mesh_table_free(..., true) timers would not be deactivated.
    This fixes this case.

    Reported-by: Johannes Berg
    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

13 May, 2011

1 commit

  • There's no need to have table functions in one
    file and all users in another, move the functions
    to the right file and make them static. Also move
    a static variable to the beginning of the file to
    make it easier to find.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

12 May, 2011

2 commits

  • The mesh and mpp path tables are accessed from softirq and workqueue
    context so non-irq locking cannot be used. Or at least that's what
    PROVE_RCU seems to tell us here:

    [ 431.240946] =================================
    [ 431.241061] [ INFO: inconsistent lock state ]
    [ 431.241061] 2.6.39-rc3-wl+ #354
    [ 431.241061] ---------------------------------
    [ 431.241061] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
    [ 431.241061] kworker/u:1/1423 [HC0[0]:SC0[0]:HE1:SE1] takes:
    [ 431.241061] (&(&newtbl->hashwlock[i])->rlock){+.?...}, at:
    [] mesh_path_add+0x167/0x257

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • Not sure if I'm chasing a ghost here, seems like the
    mesh_path->size_order needs to be inside an RCU-read section to prevent
    that value from changing between table allocation and copying. We have
    observed crashes that might be caused by this.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

26 Apr, 2011

1 commit


14 Apr, 2011

1 commit

  • It is unnecessary to hold the path table resize lock while allocating a
    new table. Allocate first and take lock later. This resolves a
    soft-lockup:

    [ 293.385799] BUG: soft lockup - CPU#0 stuck for 61s! [kworker/u:3:744]
    (...)
    [ 293.386049] Call Trace:
    [ 293.386049] [] do_raw_read_lock+0x26/0x29
    [ 293.386049] [] _raw_read_lock+0x8/0xa
    [ 293.386049] [] mesh_path_add+0xb7/0x24e
    [ 293.386049] [] ? mesh_path_lookup+0x1b/0xa6
    [ 293.386049] [] hwmp_route_info_get+0x276/0x2fd
    [ 293.386049] [] mesh_rx_path_sel_frame+0x5a/0x5d9
    [ 293.386049] [] ? update_curr+0x1cf/0x1d7
    [ 293.386049] [] ieee80211_mesh_rx_queued_mgmt+0x60/0x67
    [ 293.386049] [] ieee80211_iface_work+0x1f0/0x258
    (...)

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    cozybit Inc
     

31 Mar, 2011

1 commit


07 Dec, 2010

1 commit