1. 18 6月, 2009 5 次提交
  2. 17 6月, 2009 1 次提交
  3. 16 6月, 2009 5 次提交
  4. 15 6月, 2009 2 次提交
  5. 14 6月, 2009 4 次提交
  6. 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
  7. 12 6月, 2009 6 次提交
  8. 11 6月, 2009 6 次提交
    • 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