summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-12-21 16:48:08 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-21 16:48:08 -0500
commitc0ed1c14a72ca9ebacd51fb94a8aca488b0d361e (patch)
treee689f7fd62e7633b9b254f9a456b65a1150c6e23 /net/core
parent9f28a2fc0bd77511f649c0a788c7bf9a5fd04edb (diff)
downloadlinux-c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e.tar.gz
linux-c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e.tar.bz2
linux-c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e.zip
net: Add a flow_cache_flush_deferred function
flow_cach_flush() might sleep but can be called from atomic context via the xfrm garbage collector. So add a flow_cache_flush_deferred() function and use this if the xfrm garbage colector is invoked from within the packet path. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/flow.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/core/flow.c b/net/core/flow.c
index 8ae42de9c79e..e318c7e98042 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -358,6 +358,18 @@ void flow_cache_flush(void)
put_online_cpus();
}
+static void flow_cache_flush_task(struct work_struct *work)
+{
+ flow_cache_flush();
+}
+
+static DECLARE_WORK(flow_cache_flush_work, flow_cache_flush_task);
+
+void flow_cache_flush_deferred(void)
+{
+ schedule_work(&flow_cache_flush_work);
+}
+
static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu)
{
struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu);