aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
diff options
context:
space:
mode:
authorLouis Peens <louis.peens@corigine.com>2021-06-02 13:59:51 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-02 14:04:42 -0700
commitf7ae12e2f95dc5bed1a0c6cfd73cf6690d465855 (patch)
treeee09f4ed0e81be497bde66a10ad4647b6b4c4fe9 /drivers/net/ethernet/netronome/nfp/flower/conntrack.h
parentnfp: flower-ct: add a table to map flow cookies to ct flows (diff)
downloadlinux-dev-f7ae12e2f95dc5bed1a0c6cfd73cf6690d465855.tar.xz
linux-dev-f7ae12e2f95dc5bed1a0c6cfd73cf6690d465855.zip
nfp: flower-ct: add tc_merge_tb
Add the table required to store the merge result of pre_ct and post_ct flows. This is just the initial setup and teardown of the table, the implementation will be in follow-up patches. Signed-off-by: Louis Peens <louis.peens@corigine.com> Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com> Signed-off-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower/conntrack.h')
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/conntrack.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
index a7f0d7c76b72..3d7d260c6e5c 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/conntrack.h
@@ -10,6 +10,7 @@
extern const struct rhashtable_params nfp_zone_table_params;
extern const struct rhashtable_params nfp_ct_map_params;
+extern const struct rhashtable_params nfp_tc_ct_merge_params;
/**
* struct nfp_fl_ct_zone_entry - Zone entry containing conntrack flow information
@@ -23,6 +24,9 @@ extern const struct rhashtable_params nfp_ct_map_params;
*
* @post_ct_list: The post_ct_list of nfp_fl_ct_flow_entry entries
* @post_ct_count: Keep count of the number of post_ct entries
+ *
+ * @tc_merge_tb: The table of merged tc flows
+ * @tc_merge_count: Keep count of the number of merged tc entries
*/
struct nfp_fl_ct_zone_entry {
u16 zone;
@@ -36,6 +40,9 @@ struct nfp_fl_ct_zone_entry {
struct list_head post_ct_list;
unsigned int post_ct_count;
+
+ struct rhashtable tc_merge_tb;
+ unsigned int tc_merge_count;
};
enum ct_entry_type {
@@ -71,6 +78,28 @@ struct nfp_fl_ct_flow_entry {
};
/**
+ * struct nfp_fl_ct_tc_merge - Merge of two flows from tc
+ * @cookie: Flow cookie, combination of pre and post ct cookies
+ * @hash_node: Used by the hashtable
+ * @pre_ct_list: This entry is part of a pre_ct_list
+ * @post_ct_list: This entry is part of a post_ct_list
+ * @zt: Reference to the zone table this belongs to
+ * @pre_ct_parent: The pre_ct_parent
+ * @post_ct_parent: The post_ct_parent
+ * @children: List of nft merged entries
+ */
+struct nfp_fl_ct_tc_merge {
+ unsigned long cookie[2];
+ struct rhash_head hash_node;
+ struct list_head pre_ct_list;
+ struct list_head post_ct_list;
+ struct nfp_fl_ct_zone_entry *zt;
+ struct nfp_fl_ct_flow_entry *pre_ct_parent;
+ struct nfp_fl_ct_flow_entry *post_ct_parent;
+ struct list_head children;
+};
+
+/**
* struct nfp_fl_ct_map_entry - Map between flow cookie and specific ct_flow
* @cookie: Flow cookie, same as original TC flow, used as key
* @hash_node: Used by the hashtable