[PATCH nf-next 2/3] netfilter: nf_flow_table: add nf_conn_acct for HW flowtable offload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: wenxu <wenxu@xxxxxxxxx>

Add nf_conn_acct counter for the hardware flowtable offload

Signed-off-by: wenxu <wenxu@xxxxxxxxx>
---
 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




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux