Commit 32c3973d authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: flowtable: avoid possible false sharing

The flowtable follows the same timeout approach as conntrack, use the
same idiom as in cc169213 ("netfilter: conntrack: avoid same-timeout
update") but also include the fix provided by e37542ba ("netfilter:
conntrack: avoid possible false sharing").
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent cfbe3650
...@@ -331,7 +331,11 @@ EXPORT_SYMBOL_GPL(flow_offload_add); ...@@ -331,7 +331,11 @@ EXPORT_SYMBOL_GPL(flow_offload_add);
void flow_offload_refresh(struct nf_flowtable *flow_table, void flow_offload_refresh(struct nf_flowtable *flow_table,
struct flow_offload *flow) struct flow_offload *flow)
{ {
flow->timeout = nf_flowtable_time_stamp + flow_offload_get_timeout(flow); u32 timeout;
timeout = nf_flowtable_time_stamp + flow_offload_get_timeout(flow);
if (READ_ONCE(flow->timeout) != timeout)
WRITE_ONCE(flow->timeout, timeout);
if (likely(!nf_flowtable_hw_offload(flow_table))) if (likely(!nf_flowtable_hw_offload(flow_table)))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment