net/mlx5: Split FDB fast path prio to multiple namespaces
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / fs_core.h
index 32070e5d993d856d0c560e9adde78b3e86d928bf..b51ad217da32d608a95a16909fd5577174a755d0 100644 (file)
 #include <linux/refcount.h>
 #include <linux/mlx5/fs.h>
 #include <linux/rhashtable.h>
+#include <linux/llist.h>
+
+/* FS_TYPE_PRIO_CHAINS is a PRIO that will have namespaces only,
+ * and those are in parallel to one another when going over them to connect
+ * a new flow table. Meaning the last flow table in a TYPE_PRIO prio in one
+ * parallel namespace will not automatically connect to the first flow table
+ * found in any prio in any next namespace, but skip the entire containing
+ * TYPE_PRIO_CHAINS prio.
+ *
+ * This is used to implement tc chains, each chain of prios is a different
+ * namespace inside a containing TYPE_PRIO_CHAINS prio.
+ */
 
 enum fs_node_type {
        FS_TYPE_NAMESPACE,
        FS_TYPE_PRIO,
+       FS_TYPE_PRIO_CHAINS,
        FS_TYPE_FLOW_TABLE,
        FS_TYPE_FLOW_GROUP,
        FS_TYPE_FLOW_ENTRY,
@@ -72,6 +85,7 @@ struct mlx5_flow_steering {
        struct kmem_cache               *ftes_cache;
        struct mlx5_flow_root_namespace *root_ns;
        struct mlx5_flow_root_namespace *fdb_root_ns;
+       struct mlx5_flow_namespace      **fdb_sub_ns;
        struct mlx5_flow_root_namespace **esw_egress_root_ns;
        struct mlx5_flow_root_namespace **esw_ingress_root_ns;
        struct mlx5_flow_root_namespace *sniffer_tx_root_ns;
@@ -138,8 +152,9 @@ struct mlx5_fc_cache {
 };
 
 struct mlx5_fc {
-       struct rb_node node;
        struct list_head list;
+       struct llist_node addlist;
+       struct llist_node dellist;
 
        /* last{packets,bytes} members are used when calculating the delta since
         * last reading
@@ -148,7 +163,6 @@ struct mlx5_fc {
        u64 lastbytes;
 
        u32 id;
-       bool deleted;
        bool aging;
 
        struct mlx5_fc_cache cache ____cacheline_aligned_in_smp;