summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-12-21 16:48:08 -0500
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-11 10:25:00 -0800
commitb4758165fe80041d797687f58e94b08bfbae3fd4 (patch)
tree14609844ce2ef7b77ab7361c507e6c9ff8081033 /net/core
parent70ad9207b3bb735afe9bd3b94bd0fdf99ea91ae4 (diff)
net: Add a flow_cache_flush_deferred function
[ Upstream commit c0ed1c14a72ca9ebacd51fb94a8aca488b0d361e ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Change-Id: I6561c4fa576a9e83f4e2faf7b62dbd1d9b598c39 Reviewed-on: http://git-master/r/74221 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
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 555a456efb07..d6968e5ae75b 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);