net/mlx5: Split FDB fast path prio to multiple namespaces
[sfrench/cifs-2.6.git] / include / linux / mlx5 / fs.h
index 804516e4f483286e973ec2127f6980a0b98533de..f8d00872c7d370e752971918afcbef9a33fe24a9 100644 (file)
@@ -45,7 +45,8 @@ enum {
 };
 
 enum {
-       MLX5_FLOW_TABLE_TUNNEL_EN = BIT(0),
+       MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT = BIT(0),
+       MLX5_FLOW_TABLE_TUNNEL_EN_DECAP = BIT(1),
 };
 
 #define LEFTOVERS_RULE_NUM      2
@@ -91,7 +92,7 @@ struct mlx5_flow_destination {
                u32                     tir_num;
                u32                     ft_num;
                struct mlx5_flow_table  *ft;
-               struct mlx5_fc          *counter;
+               u32                     counter_id;
                struct {
                        u16             num;
                        u16             vhca_id;
@@ -100,6 +101,8 @@ struct mlx5_flow_destination {
        };
 };
 
+struct mlx5_flow_namespace *
+mlx5_get_fdb_sub_ns(struct mlx5_core_dev *dev, int n);
 struct mlx5_flow_namespace *
 mlx5_get_flow_namespace(struct mlx5_core_dev *dev,
                        enum mlx5_flow_namespace_type type);
@@ -159,7 +162,7 @@ struct mlx5_flow_act {
        u32 action;
        bool has_flow_tag;
        u32 flow_tag;
-       u32 encap_id;
+       u32 reformat_id;
        u32 modify_id;
        uintptr_t esp_id;
        struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];
@@ -185,15 +188,30 @@ int mlx5_modify_rule_destination(struct mlx5_flow_handle *handler,
                                 struct mlx5_flow_destination *new_dest,
                                 struct mlx5_flow_destination *old_dest);
 
-struct mlx5_fc *mlx5_flow_rule_counter(struct mlx5_flow_handle *handler);
 struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);
 void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);
 void mlx5_fc_query_cached(struct mlx5_fc *counter,
                          u64 *bytes, u64 *packets, u64 *lastuse);
 int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter,
                  u64 *packets, u64 *bytes);
+u32 mlx5_fc_id(struct mlx5_fc *counter);
 
 int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
 int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
 
+int mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
+                            u8 namespace, u8 num_actions,
+                            void *modify_actions, u32 *modify_header_id);
+void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
+                               u32 modify_header_id);
+
+int mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
+                              int reformat_type,
+                              size_t size,
+                              void *reformat_data,
+                              enum mlx5_flow_namespace_type namespace,
+                              u32 *packet_reformat_id);
+void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
+                                 u32 packet_reformat_id);
+
 #endif