09 Oct, 2014

1 commit


27 Aug, 2014

1 commit

  • The "rcu_dereference()" calls are used directly in conditions.
    Since their return values are never dereferenced it is recommended to
    use "rcu_access_pointer()" instead of "rcu_dereference()".
    Therefore, this patch makes the replacements.

    The following Coccinelle semantic patch was used:
    @@
    @@

    (
    if(
    ()) {...}
    |
    while(
    ()) {...}
    )

    Signed-off-by: Andreea-Cristina Bernat
    Signed-off-by: Johannes Berg

    Andreea-Cristina Bernat
     

29 Apr, 2014

1 commit

  • These BUG_ON statements should never trigger, but in the unlikely
    event that somebody does manage don't stop everything but simply
    exit the code path with an error.

    Leave the one BUG_ON where changing it would result in a NULL
    pointer dereference.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

26 Nov, 2013

1 commit


08 Apr, 2013

1 commit

  • Most times that mesh_path_add() is called, it is followed by
    a lookup to get the just-added mpath. We can instead just
    return the new mpath in the case that we allocated one (or the
    existing one if already there), so do that. Also, reorder the
    code in mesh_path_add a bit so that we don't need to allocate
    in the pre-existing case.

    Signed-off-by: Bob Copeland
    Signed-off-by: Johannes Berg

    Bob Copeland
     

28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

15 Feb, 2013

2 commits


05 Feb, 2013

1 commit

  • Add routines to
    - maintain a PS mode for each peer and a non-peer PS mode
    - indicate own PS mode in transmitted frames
    - track neighbor STAs power modes
    - buffer frames when neighbors are in PS mode
    - add TIM and Awake Window IE to beacons
    - release frames in Mesh Peer Service Periods

    Add local_pm to sta_info to represent the link-specific power
    mode at this station towards the remote station. When a peer
    link is established, use the default power mode stored in mesh
    config. Update the PS status if the peering status of a neighbor
    changes.
    Maintain a mesh power mode for non-peer mesh STAs. Set the
    non-peer power mode to active mode during peering. Authenticated
    mesh peering is currently not working when either node is
    configured to be in power save mode.

    Indicate the current power mode in transmitted frames. Use QoS
    Nulls to indicate mesh power mode transitions.
    For performance reasons, calls to the function setting the frame
    flags are placed in HWMP routing routines, as there the STA
    pointer is already available.

    Add peer_pm to sta_info to represent the peer's link-specific
    power mode towards the local station. Add nonpeer_pm to
    represent the peer's power mode towards all non-peer stations.
    Track power modes based on received frames.

    Add the ps_data structure to ieee80211_if_mesh (for TIM map, PS
    neighbor counter and group-addressed frame buffer).

    Set WLAN_STA_PS flag for STA in PS mode to use the unicast frame
    buffering routines in the tx path. Update num_sta_ps to buffer
    and release group-addressed frames after DTIM beacons.

    Announce the awake window duration in beacons if in light or
    deep sleep mode towards any peer or non-peer. Create a TIM IE
    similarly to AP mode and add it to mesh beacons. Parse received
    Awake Window IEs and check TIM IEs for buffered frames.

    Release frames towards peers in mesh Peer Service Periods. Use
    the corresponding trigger frames and monitor the MPSP status.
    Append a QoS Null as trigger frame if neccessary to properly end
    the MPSP. Currently, in HT channels MPSPs behave imperfectly and
    show large delay spikes and frame losses.

    Signed-off-by: Marco Porsch
    Signed-off-by: Ivan Bezyazychnyy
    Signed-off-by: Mike Krinkin
    Signed-off-by: Max Filippov
    Signed-off-by: Johannes Berg

    Marco Porsch
     

20 Aug, 2012

2 commits


31 Jul, 2012

1 commit


11 Jul, 2012

1 commit


24 Jun, 2012

1 commit

  • There are a few things that make the logging and
    debugging in mac80211 less useful than it should
    be right now:
    * a lot of messages should be pr_info, not pr_debug
    * wholesale use of pr_debug makes it require *both*
    Kconfig and dynamic configuration
    * there are still a lot of ifdefs
    * the style is very inconsistent, sometimes the
    sdata->name is printed in front

    Clean up everything, introducing new macros and
    separating out the station MLME debugging into
    a new Kconfig symbol.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

06 Jun, 2012

1 commit


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
     

13 Apr, 2012

1 commit


21 Mar, 2012

1 commit

  • Pull networking merge from David Miller:
    "1) Move ixgbe driver over to purely page based buffering on receive.
    From Alexander Duyck.

    2) Add receive packet steering support to e1000e, from Bruce Allan.

    3) Convert TCP MD5 support over to RCU, from Eric Dumazet.

    4) Reduce cpu usage in handling out-of-order TCP packets on modern
    systems, also from Eric Dumazet.

    5) Support the IP{,V6}_UNICAST_IF socket options, making the wine
    folks happy, from Erich Hoover.

    6) Support VLAN trunking from guests in hyperv driver, from Haiyang
    Zhang.

    7) Support byte-queue-limtis in r8169, from Igor Maravic.

    8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but
    was never properly implemented, Jiri Benc fixed that.

    9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang.

    10) Support kernel side dump filtering by ctmark in netfilter
    ctnetlink, from Pablo Neira Ayuso.

    11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker.

    12) Add new peek socket options to assist with socket migration, from
    Pavel Emelyanov.

    13) Add sch_plug packet scheduler whose queue is controlled by
    userland daemons using explicit freeze and release commands. From
    Shriram Rajagopalan.

    14) Fix FCOE checksum offload handling on transmit, from Yi Zou."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits)
    Fix pppol2tp getsockname()
    Remove printk from rds_sendmsg
    ipv6: fix incorrent ipv6 ipsec packet fragment
    cpsw: Hook up default ndo_change_mtu.
    net: qmi_wwan: fix build error due to cdc-wdm dependecy
    netdev: driver: ethernet: Add TI CPSW driver
    netdev: driver: ethernet: add cpsw address lookup engine support
    phy: add am79c874 PHY support
    mlx4_core: fix race on comm channel
    bonding: send igmp report for its master
    fs_enet: Add MPC5125 FEC support and PHY interface selection
    net: bpf_jit: fix BPF_S_LDX_B_MSH compilation
    net: update the usage of CHECKSUM_UNNECESSARY
    fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx
    net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso
    ixgbe: Fix issues with SR-IOV loopback when flow control is disabled
    net/hyperv: Fix the code handling tx busy
    ixgbe: fix namespace issues when FCoE/DCB is not enabled
    rtlwifi: Remove unused ETH_ADDR_LEN defines
    igbvf: Use ETH_ALEN
    ...

    Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and
    drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.

    Linus Torvalds
     

08 Mar, 2012

1 commit

  • smatch was complaining:

    CHECK net/mac80211/mesh_pathtbl.c
    net/mac80211/mesh_pathtbl.c:562 mesh_path_add() error: double lock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:580 mesh_path_add() error: double unlock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:589 mesh_path_add() error: double unlock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:691 mpp_path_add() error: double lock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:707 mpp_path_add() error: double unlock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:716 mpp_path_add() error: double unlock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:814 mesh_path_flush_by_nexthop() error:
    double lock 'bottom_half:'
    net/mac80211/mesh_pathtbl.c:819 mesh_path_flush_by_nexthop() error:
    double unlock 'bottom_half:'
    net/mac80211/mesh_pathtbl.c:887 mesh_path_del() error: double lock
    'bottom_half:'
    net/mac80211/mesh_pathtbl.c:901 mesh_path_del() error: double unlock
    'bottom_half:'

    So don't lock / unlock with _bh() while bottom halves are already
    disabled.

    Reported-by: Johannes Berg
    Signed-off-by: Thomas Pedersen
    Signed-off-by: John W. Linville

    Thomas Pedersen
     

06 Mar, 2012

1 commit


22 Feb, 2012

1 commit


09 Feb, 2012

1 commit

  • If you want to use mesh support from mac80211 on a recent
    kernel on 2.6.24 you'll run into a name clash when compiling
    against include/linux/namei.h, so rename this routine.

    /home/mcgrof/tmp/compat-wireless-3.2.5-1/net/mac80211/mesh_pathtbl.c: At top level:
    /home/mcgrof/tmp/compat-wireless-3.2.5-1/net/mac80211/mesh_pathtbl.c:342:26: error: conflicting types for ‘path_lookup’
    include/linux/namei.h:71:12: note: previous declaration of ‘path_lookup’ was here

    Although this could sit as a separate patch in compat-wireless it seems
    best to just merge upstream.

    Cc: Javier Cardona
    Signed-off-by: Luis R. Rodriguez
    Acked-by: Javier Cardona
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

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