1. 16 6月, 2009 2 次提交
  2. 15 6月, 2009 2 次提交
  3. 14 6月, 2009 4 次提交
  4. 13 6月, 2009 11 次提交
    • J
      x_tables: Convert printk to pr_err · 3dd5d7e3
      Joe Perches 提交于
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      3dd5d7e3
    • P
      netfilter: conntrack: optional reliable conntrack event delivery · dd7669a9
      Pablo Neira Ayuso 提交于
      This patch improves ctnetlink event reliability if one broadcast
      listener has set the NETLINK_BROADCAST_ERROR socket option.
      
      The logic is the following: if an event delivery fails, we keep
      the undelivered events in the missed event cache. Once the next
      packet arrives, we add the new events (if any) to the missed
      events in the cache and we try a new delivery, and so on. Thus,
      if ctnetlink fails to deliver an event, we try to deliver them
      once we see a new packet. Therefore, we may lose state
      transitions but the userspace process gets in sync at some point.
      
      At worst case, if no events were delivered to userspace, we make
      sure that destroy events are successfully delivered. Basically,
      if ctnetlink fails to deliver the destroy event, we remove the
      conntrack entry from the hashes and we insert them in the dying
      list, which contains inactive entries. Then, the conntrack timer
      is added with an extra grace timeout of random32() % 15 seconds
      to trigger the event again (this grace timeout is tunable via
      /proc). The use of a limited random timeout value allows
      distributing the "destroy" resends, thus, avoiding accumulating
      lots "destroy" events at the same time. Event delivery may
      re-order but we can identify them by means of the tuple plus
      the conntrack ID.
      
      The maximum number of conntrack entries (active or inactive) is
      still handled by nf_conntrack_max. Thus, we may start dropping
      packets at some point if we accumulate a lot of inactive conntrack
      entries that did not successfully report the destroy event to
      userspace.
      
      During my stress tests consisting of setting a very small buffer
      of 2048 bytes for conntrackd and the NETLINK_BROADCAST_ERROR socket
      flag, and generating lots of very small connections, I noticed
      very few destroy entries on the fly waiting to be resend.
      
      A simple way to test this patch consist of creating a lot of
      entries, set a very small Netlink buffer in conntrackd (+ a patch
      which is not in the git tree to set the BROADCAST_ERROR flag)
      and invoke `conntrack -F'.
      
      For expectations, no changes are introduced in this patch.
      Currently, event delivery is only done for new expectations (no
      events from expectation expiration, removal and confirmation).
      In that case, they need a per-expectation event cache to implement
      the same idea that is exposed in this patch.
      
      This patch can be useful to provide reliable flow-accouting. We
      still have to add a new conntrack extension to store the creation
      and destroy time.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      dd7669a9
    • P
      netfilter: conntrack: move helper destruction to nf_ct_helper_destroy() · 9858a3ae
      Pablo Neira Ayuso 提交于
      This patch moves the helper destruction to a function that lives
      in nf_conntrack_helper.c. This new function is used in the patch
      to add ctnetlink reliable event delivery.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      9858a3ae
    • P
      netfilter: conntrack: move event caching to conntrack extension infrastructure · a0891aa6
      Pablo Neira Ayuso 提交于
      This patch reworks the per-cpu event caching to use the conntrack
      extension infrastructure.
      
      The main drawback is that we consume more memory per conntrack
      if event delivery is enabled. This patch is required by the
      reliable event delivery that follows to this patch.
      
      BTW, this patch allows you to enable/disable event delivery via
      /proc/sys/net/netfilter/nf_conntrack_events in runtime, although
      you can still disable event caching as compilation option.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      a0891aa6
    • P
      netfilter: nf_conntrack: use mod_timer_pending() for conntrack refresh · 65cb9fda
      Patrick McHardy 提交于
      Use mod_timer_pending() instead of atomic sequence of del_timer()/
      add_timer(). mod_timer_pending() does not rearm an inactive timer,
      so we don't need the conntrack lock anymore to make sure we don't
      accidentally rearm a timer of a conntrack which is in the process
      of being destroyed.
      
      With this change, we don't need to take the global lock anymore at all,
      counter updates can be performed under the per-conntrack lock.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      65cb9fda
    • P
      netfilter: nf_log: fix sleeping function called from invalid context · 266d07cb
      Patrick McHardy 提交于
      Fix regression introduced by 17625274 "netfilter: sysctl support of
      logger choice":
      
      BUG: sleeping function called from invalid context at /mnt/s390test/linux-2.6-tip/arch/s390/include/asm/uaccess.h:234
      in_atomic(): 1, irqs_disabled(): 0, pid: 3245, name: sysctl
      CPU: 1 Not tainted 2.6.30-rc8-tipjun10-02053-g39ae214 #1
      Process sysctl (pid: 3245, task: 000000007f675da0, ksp: 000000007eb17cf0)
      0000000000000000 000000007eb17be8 0000000000000002 0000000000000000
             000000007eb17c88 000000007eb17c00 000000007eb17c00 0000000000048156
             00000000003e2de8 000000007f676118 000000007eb17f10 0000000000000000
             0000000000000000 000000007eb17be8 000000000000000d 000000007eb17c58
             00000000003e2050 000000000001635c 000000007eb17be8 000000007eb17c30
      Call Trace:
      (<00000000000162e6> show_trace+0x13a/0x148)
       <00000000000349ea> __might_sleep+0x13a/0x164
       <0000000000050300> proc_dostring+0x134/0x22c
       <0000000000312b70> nf_log_proc_dostring+0xfc/0x188
       <0000000000136f5e> proc_sys_call_handler+0xf6/0x118
       <0000000000136fda> proc_sys_read+0x26/0x34
       <00000000000d6e9c> vfs_read+0xac/0x158
       <00000000000d703e> SyS_read+0x56/0x88
       <0000000000027f42> sysc_noemu+0x10/0x16
      
      Use the nf_log_mutex instead of RCU to fix this.
      Reported-and-tested-by: NMaran Pakkirisamy <maranpsamy@in.ibm.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      266d07cb
    • P
      net: use symbolic values for ndo_start_xmit() return codes · 5b548140
      Patrick McHardy 提交于
      Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively.
      
      0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases
      where its in direct proximity to one of the other values.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b548140
    • P
      net: fix network drivers ndo_start_xmit() return values (part 7) · 81fbbf60
      Patrick McHardy 提交于
      Fix up ATM drivers that return an errno value to qdisc_restart(), causing
      qdisc_restart() to print a warning an requeue/retransmit the skb.
      
      - lec: condition can only be remedied by userspace, until that retransmissions
      
      Compile tested only.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      81fbbf60
    • M
      590a9887
    • P
      trivial: Kconfig: .ko is normally not included in module names · 4737f097
      Pavel Machek 提交于
      .ko is normally not included in Kconfig help, make it consistent.
      Signed-off-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4737f097
    • M
  5. 12 6月, 2009 6 次提交
  6. 11 6月, 2009 15 次提交
    • P
      netfilter: nf_ct_tcp: fix up build after merge · 334a47f6
      Patrick McHardy 提交于
      Replace the last occurence of tcp_lock by the per-conntrack lock.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      334a47f6
    • T
      neigh: fix state transition INCOMPLETE->FAILED via Netlink request · 5ef12d98
      Timo Teras 提交于
      The current code errors out the INCOMPLETE neigh entry skb queue only from
      the timer if maximum probes have been attempted and there has been no reply.
      This also causes the transtion to FAILED state.
      
      However, the neigh entry can be also updated via Netlink to inform that the
      address is unavailable.  Currently, neigh_update() just stops the timers and
      leaves the pending skb's unreleased. This results that the clean up code in
      the timer callback is never called, preventing also proper garbage collection.
      
      This fixes neigh_update() to process the pending skb queue immediately if
      INCOMPLETE -> FAILED state transtion occurs due to a Netlink request.
      Signed-off-by: NTimo Teras <timo.teras@iki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ef12d98
    • E
      net: No more expensive sock_hold()/sock_put() on each tx · 2b85a34e
      Eric Dumazet 提交于
      One of the problem with sock memory accounting is it uses
      a pair of sock_hold()/sock_put() for each transmitted packet.
      
      This slows down bidirectional flows because the receive path
      also needs to take a refcount on socket and might use a different
      cpu than transmit path or transmit completion path. So these
      two atomic operations also trigger cache line bounces.
      
      We can see this in tx or tx/rx workloads (media gateways for example),
      where sock_wfree() can be in top five functions in profiles.
      
      We use this sock_hold()/sock_put() so that sock freeing
      is delayed until all tx packets are completed.
      
      As we also update sk_wmem_alloc, we could offset sk_wmem_alloc
      by one unit at init time, until sk_free() is called.
      Once sk_free() is called, we atomic_dec_and_test(sk_wmem_alloc)
      to decrement initial offset and atomicaly check if any packets
      are in flight.
      
      skb_set_owner_w() doesnt call sock_hold() anymore
      
      sock_wfree() doesnt call sock_put() anymore, but check if sk_wmem_alloc
      reached 0 to perform the final freeing.
      
      Drawback is that a skb->truesize error could lead to unfreeable sockets, or
      even worse, prematurely calling __sk_free() on a live socket.
      
      Nice speedups on SMP. tbench for example, going from 2691 MB/s to 2711 MB/s
      on my 8 cpu dev machine, even if tbench was not really hitting sk_refcnt
      contention point. 5 % speedup on a UDP transmit workload (depends
      on number of flows), lowering TX completion cpu usage.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b85a34e
    • D
      e5241c44
    • J
      cfg80211: fix rfkill locking problem · 2f0accc1
      Johannes Berg 提交于
      rfkill currently requires a global lock within the
      rfkill_register() function, and holds that lock over
      calls to the set_block() methods. This means that we
      cannot hold a lock around rfkill_register() that we
      also require in set_block(), directly or indirectly.
      Fix cfg80211 to register rfkill outside the block
      locked by its global lock. Much of what cfg80211 does
      in the locked block doesn't need to be locked anyway.
      Reported-by: NVasanthakumar Thiagarajan <vasanth@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2f0accc1
    • J
      mac80211: disable PS while probing AP · 4e751843
      Johannes Berg 提交于
      When associated, but probing the AP because we detected
      beacon loss, we need to disable powersave to be able to
      receive the probe response. Change the code to do that by
      checking whether we're trying to probe when determining
      the possibility of going into PS, and recalculate the PS
      ability at the necessary spots.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4e751843
    • L
      mac80211: disable moving between PS modes during scan · 43f78531
      Luis R. Rodriguez 提交于
      We don't want to trigger moving between PS mode during scan,
      because then we will sometimes end up sending nullfunc frames
      during scan. We're supposed to only send one prior to scan
      and after scan.
      
      This fixes an oops which occured due to an assert in ath9k:
      
      http://marc.info/?l=linux-wireless&m=124277331319024
      
      The assert was happening because the rate control algorithm
      figures it should find at least one valid dual stream or
      single stream rate. Since we allow mac80211 to send nullfunc
      frames during scan and dynamic PS was enabled at times we ended
      up trying to send nullfunc frames for the target sta on the
      wrong band for which we have no valid rate to communicate with
      it. This breaks the assumptions in rate control.
      
      We determine we also need to disable moving between PS modes
      when not associated so lets just add that now as well, and we
      should not have a ps_sdata when that interface cannot actually
      go into PS because it's not associated.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      43f78531
    • J
      mac80211: clean up return value of __ieee80211_parse_tx_radiotap · 27004b10
      Johannes Berg 提交于
      The return type has more than two values, but it can validly
      only ever return TX_DROP and TX_CONTINUE, so use a bool
      instead of ieee80211_tx_result.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      27004b10
    • J
      mac80211: don't use master netdev name · 0bffe40f
      Johannes Berg 提交于
      Always use the wiphy name instead.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0bffe40f
    • V
      mac80211: Fix the way ADDBA request count being modified · 736708bd
      Vasanthakumar Thiagarajan 提交于
      addba_req_num[tid] is supposed to have the count of consecutive
      addba request attempts on 'tid' which failed. This count is checked
      against a retry threshold (3 times) before starting the addba negotiation.
      This patch fixes the way this addba count is incremented/reset and thereby
      avoids indefinite addba attempts.
      Signed-off-by: NVasanthakumar Thiagarajan <vasanth@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      736708bd
    • L
      cfg80211: fix for duplicate response for driver reg request · 558f6d32
      Luis R. Rodriguez 提交于
      As Pavel puts userspace can be stupid and should not
      cause kernel crashes. In this case Pavel was able to
      find a crash here but unable to reproduce. Either way
      lets deal with this.
      
      This should fix:
      
      ------------[ cut here ]------------
      kernel BUG at /home/proski/src/linux-2.6/net/wireless/reg.c:2132!
      Oops: Exception in kernel mode, sig: 5 [#1]
      PowerMac
      Modules linked in: ath5k ath [last unloaded: scsi_wait_scan]
      NIP: c02f3eac LR: c02f3d08 CTR: 00000000
      REGS: ef107aa0 TRAP: 0700   Not tainted  (2.6.30-rc8-wl)
      MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 88002442  XER: 20000000
      TASK = ef84acb0[834] 'crda' THREAD: ef106000
      GPR00: ef953840 ef107b50 ef84acb0 ef1380bc 00000006 c035a5c8 ef107b90 c035a5c8
      GPR08: 00080005 efb68980 c0445628 ef130004 28002422 10019ce0 10012d3c 00000001
      GPR16: 1070b2ac 00000005 48023558 1070b380 4802304c 00000000 ef107ddc c035a5c8
      GPR24: ef107b78 c0443350 ef8bcb00 00000005 ef138080 c04a6a70 c04a0000 ef8bcb00
      NIP [c02f3eac] set_regdom+0x4c4/0x4ec
      LR [c02f3d08] set_regdom+0x320/0x4ec
      Call Trace:
      [ef107b50] [c02f3d08] set_regdom+0x320/0x4ec (unreliable)
      [ef107b70] [c02f9d10] nl80211_set_reg+0x140/0x2d0
      [ef107bc0] [c02aa2b8] genl_rcv_msg+0x204/0x228
      [ef107c10] [c02a97cc] netlink_rcv_skb+0xe8/0x10c
      [ef107c30] [c02aa094] genl_rcv+0x3c/0x5c
      [ef107c40] [c02a9050] netlink_unicast+0x308/0x36c
      [ef107c80] [c02a92bc] netlink_sendmsg+0x208/0x2f0
      [ef107cd0] [c0282048] sock_sendmsg+0xac/0xe4
      [ef107db0] [c02822b4] sys_sendmsg+0x234/0x2d8
      [ef107f00] [c0283a88] sys_socketcall+0x108/0x258
      [ef107f40] [c0012790] ret_from_syscall+0x0/0x38
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      558f6d32
    • A
      rfkill: don't impose global states on resume (just restore the previous states) · 908209c1
      Alan Jenkins 提交于
      Once rfkill-input is disabled, the "global" states will only be used as
      default initial states.
      
      Since the states will always be the same after resume, we shouldn't
      generate events on resume.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      908209c1
    • A
      rfkill: remove set_global_sw_state · b3fa1329
      Alan Jenkins 提交于
      rfkill_set_global_sw_state() (previously rfkill_set_default()) will no
      longer be exported by the rewritten rfkill core.
      
      Instead, platform drivers which can provide persistent soft-rfkill state
      across power-down/reboot should indicate their initial state by calling
      rfkill_set_sw_state() before registration.  Otherwise, they will be
      initialized to a default value during registration by a set_block call.
      
      We remove existing calls to rfkill_set_sw_state() which happen before
      registration, since these had no effect in the old model.  If these
      drivers do have persistent state, the calls can be put back (subject
      to testing :-).  This affects hp-wmi and acer-wmi.
      
      Drivers with persistent state will affect the global state only if
      rfkill-input is enabled.  This is required, otherwise booting with
      wireless soft-blocked and pressing the wireless-toggle key once would
      have no apparent effect.  This special case will be removed in future
      along with rfkill-input, in favour of a more flexible userspace daemon
      (see Documentation/feature-removal-schedule.txt).
      
      Now rfkill_global_states[n].def is only used to preserve global states
      over EPO, it is renamed to ".sav".
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b3fa1329
    • J
      mac80211: do not pass PS frames out of mac80211 again · 8f77f384
      Johannes Berg 提交于
      In order to handle powersave frames properly we had needed
      to pass these out to the device queues again, and introduce
      the skb->requeue bit. This, however, also has unnecessary
      overhead by needing to 'clean up' already tried frames, and
      this clean-up code is also buggy when software encryption
      is used.
      
      Instead of sending the frames via the master netdev queue
      again, simply put them into the pending queue. This also
      fixes a problem where frames for that particular station
      could be reordered when some were still on the software
      queues and older ones are re-injected into the software
      queue after them.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8f77f384
    • J
      rfkill: remove input Kconfig · b91d0e36
      Johannes Berg 提交于
      Now that we added the ioctl, there's no need to ask
      the user to configure this. We will keep it enabled
      for now, and eventually swap the default to n. Also
      let embedded users select it only if they need it.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b91d0e36