Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox...
authorSaeed Mahameed <saeedm@mellanox.com>
Fri, 28 Jun 2019 22:49:59 +0000 (15:49 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 28 Jun 2019 23:03:54 +0000 (16:03 -0700)
Misc updates from mlx5-next branch:

1) E-Switch vport metadata support for source vport matching
2) Convert mkey_table to XArray
3) Shared IRQs and to use single IRQ for all async EQs

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
13 files changed:
1  2 
drivers/infiniband/hw/mlx5/main.c
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
include/linux/mlx5/driver.h
include/linux/mlx5/eswitch.h
include/net/devlink.h
net/core/devlink.c

Simple merge
@@@ -13,10 -13,9 +13,10 @@@ obj-$(CONFIG_MLX5_CORE) += mlx5_core.
  #
  mlx5_core-y :=        main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
                health.o mcg.o cq.o alloc.o qp.o port.o mr.o pd.o \
-               transobj.o vport.o sriov.o fs_cmd.o fs_core.o \
+               transobj.o vport.o sriov.o fs_cmd.o fs_core.o pci_irq.o \
                fs_counters.o rl.o lag.o dev.o events.o wq.o lib/gid.o \
 -              lib/devcom.o diag/fs_tracepoint.o diag/fw_tracer.o
 +              lib/devcom.o lib/pci_vsc.o diag/fs_tracepoint.o \
 +              diag/fw_tracer.o diag/crdump.o devlink.o
  
  #
  # Netdev basic
@@@ -269,27 -276,13 +278,32 @@@ int mlx5_eswitch_get_vport_stats(struc
                                 struct ifla_vf_stats *vf_stats);
  void mlx5_eswitch_del_send_to_vport_rule(struct mlx5_flow_handle *rule);
  
+ int mlx5_eswitch_modify_esw_vport_context(struct mlx5_eswitch *esw, u16 vport,
+                                         void *in, int inlen);
+ int mlx5_eswitch_query_esw_vport_context(struct mlx5_eswitch *esw, u16 vport,
+                                        void *out, int outlen);
  struct mlx5_flow_spec;
  struct mlx5_esw_flow_attr;
 +struct mlx5_termtbl_handle;
 +
 +bool
 +mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw,
 +                            struct mlx5_flow_act *flow_act,
 +                            struct mlx5_flow_spec *spec);
 +
 +struct mlx5_flow_handle *
 +mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
 +                            struct mlx5_flow_table *ft,
 +                            struct mlx5_flow_spec *spec,
 +                            struct mlx5_esw_flow_attr *attr,
 +                            struct mlx5_flow_act *flow_act,
 +                            struct mlx5_flow_destination *dest,
 +                            int num_dest);
 +
 +void
 +mlx5_eswitch_termtbl_put(struct mlx5_eswitch *esw,
 +                       struct mlx5_termtbl_handle *tt);
  
  struct mlx5_flow_handle *
  mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
@@@ -255,25 -283,10 +287,11 @@@ mlx5_eswitch_add_fwd_rule(struct mlx5_e
        dest[i].ft = fwd_fdb,
        i++;
  
-       misc = MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_parameters);
-       MLX5_SET(fte_match_set_misc, misc, source_port, attr->in_rep->vport);
-       if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
-               MLX5_SET(fte_match_set_misc, misc,
-                        source_eswitch_owner_vhca_id,
-                        MLX5_CAP_GEN(attr->in_mdev, vhca_id));
+       mlx5_eswitch_set_rule_source_port(esw, spec, attr);
  
-       misc = MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_parameters);
-       MLX5_SET_TO_ONES(fte_match_set_misc, misc, source_port);
-       if (MLX5_CAP_ESW(esw->dev, merged_eswitch))
-               MLX5_SET_TO_ONES(fte_match_set_misc, misc,
-                                source_eswitch_owner_vhca_id);
-       if (attr->match_level == MLX5_MATCH_NONE)
-               spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
-       else
-               spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS |
-                                              MLX5_MATCH_MISC_PARAMETERS;
++      spec->match_criteria_enable |= MLX5_MATCH_MISC_PARAMETERS;
+       if (attr->match_level != MLX5_MATCH_NONE)
+               spec->match_criteria_enable |= MLX5_MATCH_OUTER_HEADERS;
  
        rule = mlx5_add_flow_rules(fast_fdb, spec, &flow_act, dest, i);
  
@@@ -1747,10 -1971,11 +1985,12 @@@ static void esw_destroy_offloads_acl_ta
                esw_vport_disable_egress_acl(esw, vport);
                esw_vport_disable_ingress_acl(esw, vport);
        }
+       esw->flags &= ~MLX5_ESWITCH_VPORT_MATCH_METADATA;
  }
  
 -static int esw_offloads_steering_init(struct mlx5_eswitch *esw, int nvports)
 +static int esw_offloads_steering_init(struct mlx5_eswitch *esw, int vf_nvports,
 +                                    int nvports)
  {
        int err;
  
@@@ -890,11 -901,10 +908,11 @@@ static void mlx5_cleanup_once(struct ml
  {
        mlx5_fw_tracer_destroy(dev->tracer);
        mlx5_fpga_cleanup(dev);
-       mlx5_sriov_cleanup(dev);
        mlx5_eswitch_cleanup(dev->priv.eswitch);
+       mlx5_sriov_cleanup(dev);
        mlx5_mpfs_cleanup(dev);
        mlx5_cleanup_rl_table(dev);
 +      mlx5_geneve_destroy(dev->geneve);
        mlx5_vxlan_destroy(dev->vxlan);
        mlx5_cleanup_clock(dev);
        mlx5_cleanup_reserved_gids(dev);
Simple merge
@@@ -61,5 -62,33 +62,33 @@@ void *mlx5_eswitch_uplink_get_proto_dev
  u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
  struct mlx5_flow_handle *
  mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
 -                                  int vport, u32 sqn);
 +                                  u16 vport_num, u32 sqn);
+ #ifdef CONFIG_MLX5_ESWITCH
+ enum devlink_eswitch_encap_mode
+ mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev);
+ bool mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw);
+ u32 mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,
+                                             u16 vport_num);
+ #else  /* CONFIG_MLX5_ESWITCH */
+ static inline enum devlink_eswitch_encap_mode
+ mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
+ {
+       return DEVLINK_ESWITCH_ENCAP_MODE_NONE;
+ }
+ static inline bool
+ mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw)
+ {
+       return false;
+ };
+ static inline u32
+ mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,
+                                         int vport_num)
+ {
+       return 0;
+ };
+ #endif /* CONFIG_MLX5_ESWITCH */
  #endif
Simple merge
Simple merge