[qca-nss-sfe] Use rcu read lock for ipv4
Change-Id: I249fa74af19238e415b848f376bf5ba59fac79c8
Signed-off-by: Ratheesh Kannoth <quic_rkannoth@quicinc.com>
diff --git a/sfe_ipv4.h b/sfe_ipv4.h
index 60876a7..46f2a59 100644
--- a/sfe_ipv4.h
+++ b/sfe_ipv4.h
@@ -61,8 +61,8 @@
/*
* References to other objects.
*/
- struct sfe_ipv4_connection_match *next;
- struct sfe_ipv4_connection_match *prev;
+ struct hlist_node hnode;
+
struct sfe_ipv4_connection *connection;
struct sfe_ipv4_connection_match *counter_match;
/* Matches the flow in the opposite direction as the one in *connection */
@@ -101,8 +101,8 @@
* Stats recorded in a sync period. These stats will be added to
* rx_packet_count64/rx_byte_count64 after a sync period.
*/
- u32 rx_packet_count;
- u32 rx_byte_count;
+ atomic_t rx_packet_count;
+ atomic_t rx_byte_count;
/*
* Packet translation information.
@@ -176,6 +176,8 @@
/* Pointer to the previous entry in the list of all connections */
u32 mark; /* mark for outgoing packet */
u32 debug_read_seq; /* sequence number for debug dump */
+ bool removed; /* Indicates the connection is removed */
+ struct rcu_head rcu; /* delay rcu free */
};
/*
@@ -244,8 +246,10 @@
/* Callback function registered by a connection manager for stats syncing */
struct sfe_ipv4_connection *conn_hash[SFE_IPV4_CONNECTION_HASH_SIZE];
/* Connection hash table */
- struct sfe_ipv4_connection_match *conn_match_hash[SFE_IPV4_CONNECTION_HASH_SIZE];
+
+ struct hlist_head hlist_conn_match_hash_head[SFE_IPV4_CONNECTION_HASH_SIZE];
/* Connection match hash table */
+
#ifdef CONFIG_NF_FLOW_COOKIE
struct sfe_flow_cookie_entry sfe_flow_cookie_table[SFE_FLOW_COOKIE_SIZE];
/* flow cookie table*/