]> Git Repo - linux.git/commitdiff
Merge tag 'mlx5-fixes-2018-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorDavid S. Miller <[email protected]>
Thu, 28 Jun 2018 07:21:35 +0000 (16:21 +0900)
committerDavid S. Miller <[email protected]>
Thu, 28 Jun 2018 07:21:35 +0000 (16:21 +0900)
Saeed Mahameed says:

====================
mlx5-fixes-2018-06-26

Fixes for mlx5 core and netdev driver:

Two fixes from Alex Vesker to address command interface issues
 - Race in command interface polling mode
 - Incorrect raw command length parsing

From Shay Agroskin, Fix wrong size allocation for QoS ETC TC regitster.

From Or Gerlitz and Eli Cohin, Address backward compatability issues for when
Eswitch capability is not advertised for the PF host driver
    - Fix required capability for manipulating MPFS
    - E-Switch, Disallow vlan/spoofcheck setup if not being esw manager
    - Avoid dealing with vport IB/eth representors if not being e-switch manager
    - E-Switch, Avoid setup attempt if not being e-switch manager
    - Don't attempt to dereference the ppriv struct if not being eswitch manager
====================

Signed-off-by: David S. Miller <[email protected]>
1  2 
drivers/infiniband/hw/mlx5/main.c

index e3e330f59c2c01216f3e8e90a161c06c73c5e4ec,634be96dcb862df3336a4661e78520db1a57a7c9..b3ba9a222550750f9c92a1ea8d1cf23b93e05d12
@@@ -3199,8 -3199,8 +3199,8 @@@ static int flow_counters_set_data(struc
        if (!mcounters->hw_cntrs_hndl) {
                mcounters->hw_cntrs_hndl = mlx5_fc_create(
                        to_mdev(ibcounters->device)->mdev, false);
 -              if (!mcounters->hw_cntrs_hndl) {
 -                      ret = -ENOMEM;
 +              if (IS_ERR(mcounters->hw_cntrs_hndl)) {
 +                      ret = PTR_ERR(mcounters->hw_cntrs_hndl);
                        goto free;
                }
                hw_hndl = true;
@@@ -3546,35 -3546,29 +3546,35 @@@ static struct ib_flow *mlx5_ib_create_f
                        return ERR_PTR(-ENOMEM);
  
                err = ib_copy_from_udata(ucmd, udata, required_ucmd_sz);
 -              if (err) {
 -                      kfree(ucmd);
 -                      return ERR_PTR(err);
 -              }
 +              if (err)
 +                      goto free_ucmd;
        }
  
 -      if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO)
 -              return ERR_PTR(-ENOMEM);
 +      if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO) {
 +              err = -ENOMEM;
 +              goto free_ucmd;
 +      }
  
        if (domain != IB_FLOW_DOMAIN_USER ||
            flow_attr->port > dev->num_ports ||
            (flow_attr->flags & ~(IB_FLOW_ATTR_FLAGS_DONT_TRAP |
 -                                IB_FLOW_ATTR_FLAGS_EGRESS)))
 -              return ERR_PTR(-EINVAL);
 +                                IB_FLOW_ATTR_FLAGS_EGRESS))) {
 +              err = -EINVAL;
 +              goto free_ucmd;
 +      }
  
        if (is_egress &&
            (flow_attr->type == IB_FLOW_ATTR_ALL_DEFAULT ||
 -           flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT))
 -              return ERR_PTR(-EINVAL);
 +           flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT)) {
 +              err = -EINVAL;
 +              goto free_ucmd;
 +      }
  
        dst = kzalloc(sizeof(*dst), GFP_KERNEL);
 -      if (!dst)
 -              return ERR_PTR(-ENOMEM);
 +      if (!dst) {
 +              err = -ENOMEM;
 +              goto free_ucmd;
 +      }
  
        mutex_lock(&dev->flow_db->lock);
  
@@@ -3643,8 -3637,8 +3643,8 @@@ destroy_ft
  unlock:
        mutex_unlock(&dev->flow_db->lock);
        kfree(dst);
 +free_ucmd:
        kfree(ucmd);
 -      kfree(handler);
        return ERR_PTR(err);
  }
  
@@@ -6113,7 -6107,7 +6113,7 @@@ static void *mlx5_ib_add(struct mlx5_co
        dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports),
                             MLX5_CAP_GEN(mdev, num_vhca_ports));
  
-       if (MLX5_VPORT_MANAGER(mdev) &&
+       if (MLX5_ESWITCH_MANAGER(mdev) &&
            mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
                dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0);
  
This page took 0.088602 seconds and 4 git commands to generate.