summaryrefslogtreecommitdiff
path: root/net/netfilter/nft_counter.c
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@intel.com>2024-08-27 17:06:28 -0400
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-08-27 17:06:28 -0400
commit04cf420bbc32a599aa2481725f708435ea19bf3d (patch)
tree232b7a3c36adc63c92ca60ec39ed5f031c2e5c53 /net/netfilter/nft_counter.c
parent67733d7a71503fd3e32eeada371f8aa2516c5c95 (diff)
parente55ef65510a401862b902dc979441ea10ae25c61 (diff)
Merge drm/drm-next into drm-intel-next
Need to take some Xe bo definition in here before we can add the BMG display 64k aligned size restrictions. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'net/netfilter/nft_counter.c')
-rw-r--r--net/netfilter/nft_counter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/netfilter/nft_counter.c b/net/netfilter/nft_counter.c
index 291ed2026367..eab0dc66bee6 100644
--- a/net/netfilter/nft_counter.c
+++ b/net/netfilter/nft_counter.c
@@ -107,11 +107,16 @@ static void nft_counter_reset(struct nft_counter_percpu_priv *priv,
struct nft_counter *total)
{
struct nft_counter *this_cpu;
+ seqcount_t *myseq;
local_bh_disable();
this_cpu = this_cpu_ptr(priv->counter);
+ myseq = this_cpu_ptr(&nft_counter_seq);
+
+ write_seqcount_begin(myseq);
this_cpu->packets -= total->packets;
this_cpu->bytes -= total->bytes;
+ write_seqcount_end(myseq);
local_bh_enable();
}
@@ -265,7 +270,7 @@ static void nft_counter_offload_stats(struct nft_expr *expr,
struct nft_counter *this_cpu;
seqcount_t *myseq;
- preempt_disable();
+ local_bh_disable();
this_cpu = this_cpu_ptr(priv->counter);
myseq = this_cpu_ptr(&nft_counter_seq);
@@ -273,7 +278,7 @@ static void nft_counter_offload_stats(struct nft_expr *expr,
this_cpu->packets += stats->pkts;
this_cpu->bytes += stats->bytes;
write_seqcount_end(myseq);
- preempt_enable();
+ local_bh_enable();
}
void nft_counter_init_seqcount(void)