Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox...
authorSaeed Mahameed <saeedm@mellanox.com>
Thu, 4 Jul 2019 20:40:32 +0000 (16:40 -0400)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 4 Jul 2019 20:42:59 +0000 (16:42 -0400)
Misc updates from mlx5-next branch:

1) Add the required HW definitions and structures for upcoming TLS
   support.
2) Add support for MCQI and MCQS hardware registers for fw version query.
3) Added hardware bits and structures definitions for sub-functions
4) Small code cleanup and improvement for PF pci driver.
5) Bluefield (ECPF) updates and refactoring for better E-Switch
   management on ECPF embedded CPU NIC:
   5.1) Consolidate querying eswitch number of VFs
   5.2) Register event handler at the correct E-Switch init stage
   5.3) Setup PF's inline mode and vlan pop when the ECPF is the
        E-Swtich manager ( the host PF is basically a VF ).
   5.4) Handle Vport UC address changes in switchdev mode.

6) Cleanup the rep and netdev reference when unloading IB rep.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
i# All conflicts fixed but you are still merging.

18 files changed:
1  2 
drivers/infiniband/hw/mlx5/ib_rep.c
drivers/infiniband/hw/mlx5/ib_rep.h
drivers/infiniband/hw/mlx5/main.c
drivers/net/ethernet/mellanox/mlx5/core/dev.c
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.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/fw.c
drivers/net/ethernet/mellanox/mlx5/core/main.c
include/linux/mlx5/device.h
include/linux/mlx5/driver.h
include/linux/mlx5/eswitch.h

Simple merge
Simple merge
Simple merge
@@@ -391,19 -385,30 +391,19 @@@ static const struct ethtool_ops mlx5e_u
  static int mlx5e_rep_get_port_parent_id(struct net_device *dev,
                                        struct netdev_phys_item_id *ppid)
  {
 -      struct mlx5e_priv *priv = netdev_priv(dev);
 -      struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
 -      struct net_device *uplink_upper = NULL;
 -      struct mlx5e_priv *uplink_priv = NULL;
 -      struct net_device *uplink_dev;
 +      struct mlx5_eswitch *esw;
 +      struct mlx5e_priv *priv;
 +      u64 parent_id;
 +
 +      priv = netdev_priv(dev);
 +      esw = priv->mdev->priv.eswitch;
  
-       if (esw->mode == SRIOV_NONE)
+       if (esw->mode == MLX5_ESWITCH_NONE)
                return -EOPNOTSUPP;
  
 -      uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
 -      if (uplink_dev) {
 -              uplink_upper = netdev_master_upper_dev_get(uplink_dev);
 -              uplink_priv = netdev_priv(uplink_dev);
 -      }
 -
 -      ppid->id_len = ETH_ALEN;
 -      if (uplink_upper && mlx5_lag_is_sriov(uplink_priv->mdev)) {
 -              ether_addr_copy(ppid->id, uplink_upper->dev_addr);
 -      } else {
 -              struct mlx5e_rep_priv *rpriv = priv->ppriv;
 -              struct mlx5_eswitch_rep *rep = rpriv->rep;
 -
 -              ether_addr_copy(ppid->id, rep->hw_id);
 -      }
 +      parent_id = mlx5_query_nic_system_image_guid(priv->mdev);
 +      ppid->id_len = sizeof(parent_id);
 +      memcpy(ppid->id, &parent_id, sizeof(parent_id));
  
        return 0;
  }
@@@ -1552,7 -1552,8 +1552,8 @@@ static void node_guid_gen_from_mac(u64 
  static void esw_apply_vport_conf(struct mlx5_eswitch *esw,
                                 struct mlx5_vport *vport)
  {
 -      int vport_num = vport->vport;
 +      u16 vport_num = vport->vport;
+       int flags;
  
        if (esw->manager_vport == vport_num)
                return;
@@@ -255,19 -253,19 +255,19 @@@ void esw_vport_del_ingress_acl_modify_m
  /* E-Switch API */
  int mlx5_eswitch_init(struct mlx5_core_dev *dev);
  void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw);
- 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_enable(struct mlx5_eswitch *esw, int mode);
+ void mlx5_eswitch_disable(struct mlx5_eswitch *esw);
  int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
 -                             int vport, u8 mac[ETH_ALEN]);
 +                             u16 vport, u8 mac[ETH_ALEN]);
  int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
 -                               int vport, int link_state);
 +                               u16 vport, int link_state);
  int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
 -                              int vport, u16 vlan, u8 qos);
 +                              u16 vport, u16 vlan, u8 qos);
  int mlx5_eswitch_set_vport_spoofchk(struct mlx5_eswitch *esw,
 -                                  int vport, bool spoofchk);
 +                                  u16 vport, bool spoofchk);
  int mlx5_eswitch_set_vport_trust(struct mlx5_eswitch *esw,
 -                               int vport_num, bool setting);
 -int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, int vport,
 +                               u16 vport_num, bool setting);
 +int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, u16 vport,
                                u32 max_rate, u32 min_rate);
  int mlx5_eswitch_set_vepa(struct mlx5_eswitch *esw, u8 setting);
  int mlx5_eswitch_get_vepa(struct mlx5_eswitch *esw, u8 *setting);
@@@ -2155,22 -2132,9 +2146,10 @@@ int esw_offloads_init(struct mlx5_eswit
                goto err_reps;
  
        esw_offloads_devcom_init(esw);
 +      mutex_init(&esw->offloads.termtbl_mutex);
  
-       esw_functions_changed_event_init(esw, vf_nvports);
        mlx5_rdma_enable_roce(esw->dev);
  
-       /* Call esw_functions_changed event to load VF reps:
-        * 1. HW does not support the event then emulate it
-        * Or
-        * 2. The event was already notified when num_vfs changed
-        * and eswitch was in legacy mode
-        */
-       esw_functions_changed_event(&esw->esw_funcs.nb.nb,
-                                   MLX5_EVENT_TYPE_ESW_FUNCTIONS_CHANGED,
-                                   NULL);
        return 0;
  
  err_reps:
Simple merge
Simple merge
@@@ -62,8 -64,10 +64,10 @@@ 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);
  
+ u16 mlx5_eswitch_get_total_vports(const struct mlx5_core_dev *dev);
  #ifdef CONFIG_MLX5_ESWITCH
  enum devlink_eswitch_encap_mode
  mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev);