1. 13 7月, 2010 2 次提交
  2. 03 7月, 2010 2 次提交
  3. 01 7月, 2010 4 次提交
  4. 29 6月, 2010 2 次提交
  5. 27 6月, 2010 1 次提交
  6. 26 6月, 2010 1 次提交
    • E
      snmp: add align parameter to snmp_mib_init() · 1823e4c8
      Eric Dumazet 提交于
      In preparation for 64bit snmp counters for some mibs,
      add an 'align' parameter to snmp_mib_init(), instead
      of assuming mibs only contain 'unsigned long' fields.
      
      Callers can use __alignof__(type) to provide correct
      alignment.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      CC: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      CC: Vlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1823e4c8
  7. 25 6月, 2010 2 次提交
  8. 24 6月, 2010 3 次提交
  9. 22 6月, 2010 1 次提交
    • J
      mac80211: Add interface for driver to temporarily disable dynamic ps · f90754c1
      Juuso Oikarinen 提交于
      This mechanism introduced in this patch applies (at least) for hardware
      designs using a single shared antenna for both WLAN and BT. In these designs,
      the antenna must be toggled between WLAN and BT.
      
      In those hardware, managing WLAN co-existence with Bluetooth requires WLAN
      full power save whenever there is Bluetooth activity in order for WLAN to be
      able to periodically relinquish the antenna to be used for BT. This is because
      BT can only access the shared antenna when WLAN is idle or asleep.
      
      Some hardware, for instance the wl1271, are able to indicate to the host
      whenever there is BT traffic. In essence, the hardware will send an indication
      to the host whenever there is, for example, SCO traffic or A2DP traffic, and
      will send another indication when the traffic is over.
      
      The hardware gets information of Bluetooth traffic via hardware co-existence
      control lines - these lines are used to negotiate the shared antenna
      ownership. The hardware will give the antenna to BT whenever WLAN is sleeping.
      
      This patch adds the interface to mac80211 to facilitate temporarily disabling
      of dynamic power save as per request of the WLAN driver. This interface will
      immediately force WLAN to full powersave, hence allowing BT coexistence as
      described above.
      
      In these kind of shared antenna desings, when WLAN powersave is fully disabled,
      Bluetooth will not work simultaneously with WLAN at all. This patch does not
      address that problem. This interface will not change PSM state, so if PSM is
      disabled it will remain so. Solving this problem requires knowledge about BT
      state, and is best done in user-space.
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f90754c1
  10. 21 6月, 2010 3 次提交
  11. 17 6月, 2010 7 次提交
    • P
      netfilter: nf_nat: support user-specified SNAT rules in LOCAL_IN · c68cd6cc
      Patrick McHardy 提交于
      2.6.34 introduced 'conntrack zones' to deal with cases where packets
      from multiple identical networks are handled by conntrack/NAT. Packets
      are looped through veth devices, during which they are NATed to private
      addresses, after which they can continue normally through the stack
      and possibly have NAT rules applied a second time.
      
      This works well, but is needlessly complicated for cases where only
      a single SNAT/DNAT mapping needs to be applied to these packets. In that
      case, all that needs to be done is to assign each network to a seperate
      zone and perform NAT as usual. However this doesn't work for packets
      destined for the machine performing NAT itself since its corrently not
      possible to configure SNAT mappings for the LOCAL_IN chain.
      
      This patch adds a new INPUT chain to the NAT table and changes the
      targets performing SNAT to be usable in that chain.
      
      Example usage with two identical networks (192.168.0.0/24) on eth0/eth1:
      
      iptables -t raw -A PREROUTING -i eth0 -j CT --zone 1
      iptables -t raw -A PREROUTING -i eth0 -j MARK --set-mark 1
      iptables -t raw -A PREROUTING -i eth1 -j CT --zone 2
      iptabels -t raw -A PREROUTING -i eth1 -j MARK --set-mark 2
      
      iptables -t nat -A INPUT       -m mark --mark 1 -j NETMAP --to 10.0.0.0/24
      iptables -t nat -A POSTROUTING -m mark --mark 1 -j NETMAP --to 10.0.0.0/24
      iptables -t nat -A INPUT       -m mark --mark 2 -j NETMAP --to 10.0.1.0/24
      iptables -t nat -A POSTROUTING -m mark --mark 2 -j NETMAP --to 10.0.1.0/24
      
      iptables -t raw -A PREROUTING -d 10.0.0.0/24 -j CT --zone 1
      iptables -t raw -A OUTPUT     -d 10.0.0.0/24 -j CT --zone 1
      iptables -t raw -A PREROUTING -d 10.0.1.0/24 -j CT --zone 2
      iptables -t raw -A OUTPUT     -d 10.0.1.0/24 -j CT --zone 2
      
      iptables -t nat -A PREROUTING -d 10.0.0.0/24 -j NETMAP --to 192.168.0.0/24
      iptables -t nat -A OUTPUT     -d 10.0.0.0/24 -j NETMAP --to 192.168.0.0/24
      iptables -t nat -A PREROUTING -d 10.0.1.0/24 -j NETMAP --to 192.168.0.0/24
      iptables -t nat -A OUTPUT     -d 10.0.1.0/24 -j NETMAP --to 192.168.0.0/24
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      c68cd6cc
    • E
      af_unix: Allow credentials to work across user and pid namespaces. · 7361c36c
      Eric W. Biederman 提交于
      In unix_skb_parms store pointers to struct pid and struct cred instead
      of raw uid, gid, and pid values, then translate the credentials on
      reception into values that are meaningful in the receiving processes
      namespaces.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7361c36c
    • E
      scm: Capture the full credentials of the scm sender. · 257b5358
      Eric W. Biederman 提交于
      Start capturing not only the userspace pid, uid and gid values of the
      sending process but also the struct pid and struct cred of the sending
      process as well.
      
      This is in preparation for properly supporting SCM_CREDENTIALS for
      sockets that have different uid and/or pid namespaces at the different
      ends.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NSerge E. Hallyn <serge@hallyn.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      257b5358
    • E
      af_unix: Allow SO_PEERCRED to work across namespaces. · 109f6e39
      Eric W. Biederman 提交于
      Use struct pid and struct cred to store the peer credentials on struct
      sock.  This gives enough information to convert the peer credential
      information to a value relative to whatever namespace the socket is in
      at the time.
      
      This removes nasty surprises when using SO_PEERCRED on socket
      connetions where the processes on either side are in different pid and
      user namespaces.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@free.fr>
      Acked-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      109f6e39
    • E
      scm: Reorder scm_cookie. · 812e876e
      Eric W. Biederman 提交于
      Reorder the fields in scm_cookie so they pack better on 64bit.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      812e876e
    • F
      syncookies: check decoded options against sysctl settings · 8c763681
      Florian Westphal 提交于
      Discard the ACK if we find options that do not match current sysctl
      settings.
      
      Previously it was possible to create a connection with sack, wscale,
      etc. enabled even if the feature was disabled via sysctl.
      
      Also remove an unneeded call to tcp_sack_reset() in
      cookie_check_timestamp: Both call sites (cookie_v4_check,
      cookie_v6_check) zero "struct tcp_options_received", hand it to
      tcp_parse_options() (which does not change tcp_opt->num_sacks/dsack)
      and then call cookie_check_timestamp().
      
      Even if num_sacks/dsacks were changed, the structure is allocated on
      the stack and after cookie_check_timestamp returns only a few selected
      members are copied to the inet_request_sock.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c763681
    • E
      inetpeer: restore small inet_peer structures · 317fe0e6
      Eric Dumazet 提交于
      Addition of rcu_head to struct inet_peer added 16bytes on 64bit arches.
      
      Thats a bit unfortunate, since old size was exactly 64 bytes.
      
      This can be solved, using an union between this rcu_head an four fields,
      that are normally used only when a refcount is taken on inet_peer.
      rcu_head is used only when refcnt=-1, right before structure freeing.
      
      Add a inet_peer_refcheck() function to check this assertion for a while.
      
      We can bring back SLAB_HWCACHE_ALIGN qualifier in kmem cache creation.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      317fe0e6
  12. 16 6月, 2010 3 次提交
    • E
      inetpeer: RCU conversion · aa1039e7
      Eric Dumazet 提交于
      inetpeer currently uses an AVL tree protected by an rwlock.
      
      It's possible to make most lookups use RCU
      
      1) Add a struct rcu_head to struct inet_peer
      
      2) add a lookup_rcu_bh() helper to perform lockless and opportunistic
      lookup. This is a normal function, not a macro like lookup().
      
      3) Add a limit to number of links followed by lookup_rcu_bh(). This is
      needed in case we fall in a loop.
      
      4) add an smp_wmb() in link_to_pool() right before node insert.
      
      5) make unlink_from_pool() use atomic_cmpxchg() to make sure it can take
      last reference to an inet_peer, since lockless readers could increase
      refcount, even while we hold peers.lock.
      
      6) Delay struct inet_peer freeing after rcu grace period so that
      lookup_rcu_bh() cannot crash.
      
      7) inet_getpeer() first attempts lockless lookup.
         Note this lookup can fail even if target is in AVL tree, but a
      concurrent writer can let tree in a non correct form.
         If this attemps fails, lock is taken a regular lookup is performed
      again.
      
      8) convert peers.lock from rwlock to a spinlock
      
      9) Remove SLAB_HWCACHE_ALIGN when peer_cachep is created, because
      rcu_head adds 16 bytes on 64bit arches, doubling effective size (64 ->
      128 bytes)
      In a future patch, this is probably possible to revert this part, if rcu
      field is put in an union to share space with rid, ip_id_count, tcp_ts &
      tcp_ts_stamp. These fields being manipulated only with refcnt > 0.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aa1039e7
    • J
      mac80211: Fix ps-qos network latency handling · ff616381
      Juuso Oikarinen 提交于
      The ps-qos latency handling is broken. It uses predetermined latency values
      to select specific dynamic PS timeouts. With common AP configurations, these
      values overlap with beacon interval and are therefore essentially useless
      (for network latencies less than the beacon interval, PSM is disabled.)
      
      This patch remedies the problem by replacing the predetermined network latency
      values with one high value (1900ms) which is used to go trigger full psm. For
      backwards compatibility, the value 2000ms is still mapped to a dynamic ps
      timeout of 100ms.
      
      Currently also the mac80211 internal value for storing user space configured
      dynamic PSM values is incorrectly in the driver visible ieee80211_conf struct.
      Move it to the ieee80211_local struct.
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ff616381
    • C
      tcp: unify tcp flag macros · a3433f35
      Changli Gao 提交于
      unify tcp flag macros: TCPHDR_FIN, TCPHDR_SYN, TCPHDR_RST, TCPHDR_PSH,
      TCPHDR_ACK, TCPHDR_URG, TCPHDR_ECE and TCPHDR_CWR. TCBCB_FLAG_* are replaced
      with the corresponding TCPHDR_*.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      ----
       include/net/tcp.h                      |   24 ++++++-------
       net/ipv4/tcp.c                         |    8 ++--
       net/ipv4/tcp_input.c                   |    2 -
       net/ipv4/tcp_output.c                  |   59 ++++++++++++++++-----------------
       net/netfilter/nf_conntrack_proto_tcp.c |   32 ++++++-----------
       net/netfilter/xt_TCPMSS.c              |    4 --
       6 files changed, 58 insertions(+), 71 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3433f35
  13. 15 6月, 2010 4 次提交
    • J
      mac80211: Fix circular locking dependency in ARP filter handling · 68542962
      Juuso Oikarinen 提交于
      There is a circular locking dependency when configuring the
      hardware ARP filters on association, occurring when flushing the mac80211
      workqueue. This is what happens:
      
      [   92.026800] =======================================================
      [   92.030507] [ INFO: possible circular locking dependency detected ]
      [   92.030507] 2.6.34-04781-g2b2c009e #85
      [   92.030507] -------------------------------------------------------
      [   92.030507] modprobe/5225 is trying to acquire lock:
      [   92.030507]  ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8105b5c0>] flush_workq
      ueue+0x0/0xb0
      [   92.030507]
      [   92.030507] but task is already holding lock:
      [   92.030507]  (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
      [   92.030507]
      [   92.030507] which lock already depends on the new lock.
      [   92.030507]
      [   92.030507]
      [   92.030507] the existing dependency chain (in reverse order) is:
      [   92.030507]
      [   92.030507] -> #2 (rtnl_mutex){+.+.+.}:
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff81341754>] mutex_lock_nested+0x44/0x300
      [   92.030507]        [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
      [   92.030507]        [<ffffffffa022d47c>] ieee80211_assoc_done+0x6c/0xe0 [mac80211]
      [   92.030507]        [<ffffffffa022f2ad>] ieee80211_work_work+0x31d/0x1280 [mac80211]
      
      [   92.030507] -> #1 ((&local->work_work)){+.+.+.}:
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff8105a51a>] worker_thread+0x22a/0x370
      [   92.030507]        [<ffffffff8105ecc6>] kthread+0x96/0xb0
      [   92.030507]        [<ffffffff81003a94>] kernel_thread_helper+0x4/0x10
      [   92.030507]
      [   92.030507] -> #0 ((wiphy_name(local->hw.wiphy))){+.+.+.}:
      [   92.030507]        [<ffffffff81075fdc>] __lock_acquire+0x1c0c/0x1d50
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff8105b60e>] flush_workqueue+0x4e/0xb0
      [   92.030507]        [<ffffffffa023ff7b>] ieee80211_stop_device+0x2b/0xb0 [mac80211]
      [   92.030507]        [<ffffffffa0231635>] ieee80211_stop+0x3e5/0x680 [mac80211]
      
      The locking in this case is quite complex. Fix the problem by rewriting the
      way the hardware ARP filter list is handled - i.e. make a copy of the address
      list to the bss_conf struct, and provide that list to the hardware driver
      when needed.
      
      The current patch will enable filtering also in promiscuous mode. This may need
      to be changed in the future.
      Reported-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      68542962
    • T
      mac80211: Set basic rates while joining ibss network · fbd2c8dc
      Teemu Paasikivi 提交于
      This patch adds support to nl80211 and mac80211 to set basic rates when
      joining/creating ibss network.
      
      Original patch was posted by Johannes Berg on the linux-wireless posting list.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fbd2c8dc
    • J
      mac80211: allow drivers to sleep in ampdu_action · 85ad181e
      Johannes Berg 提交于
      Allow drivers to sleep, and indicate this in
      the documentation. ath9k has some locking I
      don't understand, so keep it safe and disable
      BHs in it, all other drivers look fine with
      the context change.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      85ad181e
    • J
      mac80211: remove non-irqsafe aggregation callbacks · 5d22c89b
      Johannes Berg 提交于
      The non-irqsafe aggregation start/stop done
      callbacks are currently only used by ath9k_htc,
      and can cause callbacks into the driver again.
      This might lead to locking issues, which will
      only get worse as we modify locking. To avoid
      trouble, remove the non-irqsafe versions and
      change ath9k_htc to use those instead.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5d22c89b
  14. 12 6月, 2010 1 次提交
    • E
      pkt_sched: gen_kill_estimator() rcu fixes · c7de2cf0
      Eric Dumazet 提交于
      gen_kill_estimator() API is incomplete or not well documented, since
      caller should make sure an RCU grace period is respected before
      freeing stats_lock.
      
      This was partially addressed in commit 5d944c64
      (gen_estimator: deadlock fix), but same problem exist for all
      gen_kill_estimator() users, if lock they use is not already RCU
      protected.
      
      A code review shows xt_RATEEST.c, act_api.c, act_police.c have this
      problem. Other are ok because they use qdisc lock, already RCU
      protected.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7de2cf0
  15. 11 6月, 2010 2 次提交
  16. 10 6月, 2010 1 次提交
  17. 09 6月, 2010 1 次提交