lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 21 Mar 2020 19:29:17 +0800
From:   wenxu@...oud.cn
To:     pablo@...filter.org, paulb@...lanox.com
Cc:     netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH nf-next 2/3] netfilter: nf_flow_table: add nf_conn_acct for HW flowtable offload

From: wenxu <wenxu@...oud.cn>

Add nf_conn_acct counter for the hardware flowtable offload

Signed-off-by: wenxu <wenxu@...oud.cn>
---
 net/netfilter/nf_flow_table_offload.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c
index a68136a..5b02bdd 100644
--- a/net/netfilter/nf_flow_table_offload.c
+++ b/net/netfilter/nf_flow_table_offload.c
@@ -784,6 +784,14 @@ static void flow_offload_work_stats(struct flow_offload_work *offload)
 	lastused = max_t(u64, stats[0].lastused, stats[1].lastused);
 	offload->flow->timeout = max_t(u64, offload->flow->timeout,
 				       lastused + NF_FLOW_TIMEOUT);
+	if (stats[0].pkts)
+		flow_offload_update_acct(offload->flow, stats[0].pkts,
+					 stats[0].bytes,
+					 FLOW_OFFLOAD_DIR_ORIGINAL);
+	if (stats[1].pkts)
+		flow_offload_update_acct(offload->flow, stats[1].pkts,
+					 stats[1].bytes,
+					 FLOW_OFFLOAD_DIR_REPLY);
 }
 
 static void flow_offload_work_handler(struct work_struct *work)
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ