]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
[linux.git] / drivers / net / ethernet / mellanox / mlx5 / core / eswitch.h
index aaafc9f171151db2f273f7eb12b3d2a5d12d93c6..0a3eee8746c145d97ff36410ed587f2d39e737c4 100644 (file)
@@ -49,8 +49,6 @@
 #define MLX5_MAX_MC_PER_VPORT(dev) \
        (1 << MLX5_CAP_GEN(dev, log_max_current_mc_list))
 
-#define FDB_UPLINK_VPORT 0xffff
-
 #define MLX5_MIN_BW_SHARE 1
 
 #define MLX5_RATE_TO_BW_SHARE(rate, divider, limit) \
@@ -143,6 +141,8 @@ struct mlx5_eswitch_fdb {
                struct offloads_fdb {
                        struct mlx5_flow_table *slow_fdb;
                        struct mlx5_flow_group *send_to_vport_grp;
+                       struct mlx5_flow_group *peer_miss_grp;
+                       struct mlx5_flow_handle **peer_miss_rules;
                        struct mlx5_flow_group *miss_grp;
                        struct mlx5_flow_handle *miss_rule_uni;
                        struct mlx5_flow_handle *miss_rule_multi;
@@ -165,6 +165,8 @@ struct mlx5_esw_offload {
        struct mlx5_flow_table *ft_offloads;
        struct mlx5_flow_group *vport_rx_group;
        struct mlx5_eswitch_rep *vport_reps;
+       struct list_head peer_flows;
+       struct mutex peer_mutex;
        DECLARE_HASHTABLE(encap_tbl, 8);
        DECLARE_HASHTABLE(mod_hdr_tbl, 8);
        u8 inline_mode;
@@ -181,6 +183,7 @@ struct esw_mc_addr { /* SRIOV only */
 
 struct mlx5_eswitch {
        struct mlx5_core_dev    *dev;
+       struct mlx5_nb          nb;
        struct mlx5_eswitch_fdb fdb_table;
        struct hlist_head       mc_table[MLX5_L2_ADDR_HASH_SIZE];
        struct workqueue_struct *work_queue;
@@ -211,7 +214,6 @@ int esw_offloads_init_reps(struct mlx5_eswitch *esw);
 /* E-Switch API */
 int mlx5_eswitch_init(struct mlx5_core_dev *dev);
 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw);
-void mlx5_eswitch_vport_event(struct mlx5_eswitch *esw, struct mlx5_eqe *eqe);
 int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode);
 void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw);
 int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
@@ -281,13 +283,17 @@ enum mlx5_flow_match_level {
 /* current maximum for flow based vport multicasting */
 #define MLX5_MAX_FLOW_FWD_VPORTS 2
 
+enum {
+       MLX5_ESW_DEST_ENCAP         = BIT(0),
+       MLX5_ESW_DEST_ENCAP_VALID   = BIT(1),
+};
+
 struct mlx5_esw_flow_attr {
        struct mlx5_eswitch_rep *in_rep;
-       struct mlx5_eswitch_rep *out_rep[MLX5_MAX_FLOW_FWD_VPORTS];
-       struct mlx5_core_dev    *out_mdev[MLX5_MAX_FLOW_FWD_VPORTS];
        struct mlx5_core_dev    *in_mdev;
+       struct mlx5_core_dev    *counter_dev;
 
-       int mirror_count;
+       int split_count;
        int out_count;
 
        int     action;
@@ -296,9 +302,15 @@ struct mlx5_esw_flow_attr {
        u8      vlan_prio[MLX5_FS_VLAN_DEPTH];
        u8      total_vlan;
        bool    vlan_handled;
-       u32     encap_id;
+       struct {
+               u32 flags;
+               struct mlx5_eswitch_rep *rep;
+               struct mlx5_core_dev *mdev;
+               u32 encap_id;
+       } dests[MLX5_MAX_FLOW_FWD_VPORTS];
        u32     mod_hdr_id;
        u8      match_level;
+       u8      tunnel_match_level;
        struct mlx5_fc *counter;
        u32     chain;
        u16     prio;
@@ -338,6 +350,9 @@ static inline bool mlx5_eswitch_vlan_actions_supported(struct mlx5_core_dev *dev
                MLX5_CAP_ESW_FLOWTABLE_FDB(dev, push_vlan_2);
 }
 
+bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0,
+                        struct mlx5_core_dev *dev1);
+
 #define MLX5_DEBUG_ESWITCH_MASK BIT(3)
 
 #define esw_info(dev, format, ...)                             \
@@ -352,9 +367,9 @@ static inline bool mlx5_eswitch_vlan_actions_supported(struct mlx5_core_dev *dev
 /* eswitch API stubs */
 static inline int  mlx5_eswitch_init(struct mlx5_core_dev *dev) { return 0; }
 static inline void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw) {}
-static inline void mlx5_eswitch_vport_event(struct mlx5_eswitch *esw, struct mlx5_eqe *eqe) {}
 static inline int  mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode) { return 0; }
 static inline void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw) {}
+static inline bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1) { return true; }
 
 #define FDB_MAX_CHAIN 1
 #define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)