Commit 200c6758 authored by David S. Miller's avatar David S. Miller

Merge tag 'mlx5-fixes-2019-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
Mellanox, mlx5 fixes 2019-05-28

This series introduces some fixes to mlx5 driver.

Please pull and let me know if there is any problem.

For -stable v4.13:
('net/mlx5: Allocate root ns memory using kzalloc to match kfree')

For -stable v4.16:
('net/mlx5: Avoid double free in fs init error unwinding path')

For -stable v4.18:
('net/mlx5e: Disable rxhash when CQE compress is enabled')
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4b280531 c0194e2d
...@@ -3687,6 +3687,12 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, ...@@ -3687,6 +3687,12 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n"); netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n");
} }
if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {
features &= ~NETIF_F_RXHASH;
if (netdev->features & NETIF_F_RXHASH)
netdev_warn(netdev, "Disabling rxhash, not supported when CQE compress is active\n");
}
mutex_unlock(&priv->state_lock); mutex_unlock(&priv->state_lock);
return features; return features;
...@@ -3812,6 +3818,9 @@ int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr) ...@@ -3812,6 +3818,9 @@ int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr)
memcpy(&priv->tstamp, &config, sizeof(config)); memcpy(&priv->tstamp, &config, sizeof(config));
mutex_unlock(&priv->state_lock); mutex_unlock(&priv->state_lock);
/* might need to fix some features */
netdev_update_features(priv->netdev);
return copy_to_user(ifr->ifr_data, &config, return copy_to_user(ifr->ifr_data, &config,
sizeof(config)) ? -EFAULT : 0; sizeof(config)) ? -EFAULT : 0;
} }
...@@ -4680,6 +4689,10 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) ...@@ -4680,6 +4689,10 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
if (!priv->channels.params.scatter_fcs_en) if (!priv->channels.params.scatter_fcs_en)
netdev->features &= ~NETIF_F_RXFCS; netdev->features &= ~NETIF_F_RXFCS;
/* prefere CQE compression over rxhash */
if (MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS))
netdev->features &= ~NETIF_F_RXHASH;
#define FT_CAP(f) MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.f) #define FT_CAP(f) MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.f)
if (FT_CAP(flow_modify_en) && if (FT_CAP(flow_modify_en) &&
FT_CAP(modify_root) && FT_CAP(modify_root) &&
......
...@@ -813,7 +813,7 @@ static int mlx5e_nic_rep_netdevice_event(struct notifier_block *nb, ...@@ -813,7 +813,7 @@ static int mlx5e_nic_rep_netdevice_event(struct notifier_block *nb,
struct net_device *netdev = netdev_notifier_info_to_dev(ptr); struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
if (!mlx5e_tc_tun_device_to_offload(priv, netdev) && if (!mlx5e_tc_tun_device_to_offload(priv, netdev) &&
!is_vlan_dev(netdev)) !(is_vlan_dev(netdev) && vlan_dev_real_dev(netdev) == rpriv->netdev))
return NOTIFY_OK; return NOTIFY_OK;
switch (event) { switch (event) {
......
...@@ -2284,7 +2284,7 @@ static struct mlx5_flow_root_namespace ...@@ -2284,7 +2284,7 @@ static struct mlx5_flow_root_namespace
cmds = mlx5_fs_cmd_get_default_ipsec_fpga_cmds(table_type); cmds = mlx5_fs_cmd_get_default_ipsec_fpga_cmds(table_type);
/* Create the root namespace */ /* Create the root namespace */
root_ns = kvzalloc(sizeof(*root_ns), GFP_KERNEL); root_ns = kzalloc(sizeof(*root_ns), GFP_KERNEL);
if (!root_ns) if (!root_ns)
return NULL; return NULL;
...@@ -2427,6 +2427,7 @@ static void cleanup_egress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2427,6 +2427,7 @@ static void cleanup_egress_acls_root_ns(struct mlx5_core_dev *dev)
cleanup_root_ns(steering->esw_egress_root_ns[i]); cleanup_root_ns(steering->esw_egress_root_ns[i]);
kfree(steering->esw_egress_root_ns); kfree(steering->esw_egress_root_ns);
steering->esw_egress_root_ns = NULL;
} }
static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev) static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev)
...@@ -2441,6 +2442,7 @@ static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2441,6 +2442,7 @@ static void cleanup_ingress_acls_root_ns(struct mlx5_core_dev *dev)
cleanup_root_ns(steering->esw_ingress_root_ns[i]); cleanup_root_ns(steering->esw_ingress_root_ns[i]);
kfree(steering->esw_ingress_root_ns); kfree(steering->esw_ingress_root_ns);
steering->esw_ingress_root_ns = NULL;
} }
void mlx5_cleanup_fs(struct mlx5_core_dev *dev) void mlx5_cleanup_fs(struct mlx5_core_dev *dev)
...@@ -2474,11 +2476,7 @@ static int init_sniffer_tx_root_ns(struct mlx5_flow_steering *steering) ...@@ -2474,11 +2476,7 @@ static int init_sniffer_tx_root_ns(struct mlx5_flow_steering *steering)
/* Create single prio */ /* Create single prio */
prio = fs_create_prio(&steering->sniffer_tx_root_ns->ns, 0, 1); prio = fs_create_prio(&steering->sniffer_tx_root_ns->ns, 0, 1);
if (IS_ERR(prio)) { return PTR_ERR_OR_ZERO(prio);
cleanup_root_ns(steering->sniffer_tx_root_ns);
return PTR_ERR(prio);
}
return 0;
} }
static int init_sniffer_rx_root_ns(struct mlx5_flow_steering *steering) static int init_sniffer_rx_root_ns(struct mlx5_flow_steering *steering)
...@@ -2491,11 +2489,7 @@ static int init_sniffer_rx_root_ns(struct mlx5_flow_steering *steering) ...@@ -2491,11 +2489,7 @@ static int init_sniffer_rx_root_ns(struct mlx5_flow_steering *steering)
/* Create single prio */ /* Create single prio */
prio = fs_create_prio(&steering->sniffer_rx_root_ns->ns, 0, 1); prio = fs_create_prio(&steering->sniffer_rx_root_ns->ns, 0, 1);
if (IS_ERR(prio)) { return PTR_ERR_OR_ZERO(prio);
cleanup_root_ns(steering->sniffer_rx_root_ns);
return PTR_ERR(prio);
}
return 0;
} }
static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering) static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering)
...@@ -2511,11 +2505,7 @@ static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering) ...@@ -2511,11 +2505,7 @@ static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering)
/* Create single prio */ /* Create single prio */
prio = fs_create_prio(&steering->rdma_rx_root_ns->ns, 0, 1); prio = fs_create_prio(&steering->rdma_rx_root_ns->ns, 0, 1);
if (IS_ERR(prio)) { return PTR_ERR_OR_ZERO(prio);
cleanup_root_ns(steering->rdma_rx_root_ns);
return PTR_ERR(prio);
}
return 0;
} }
static int init_fdb_root_ns(struct mlx5_flow_steering *steering) static int init_fdb_root_ns(struct mlx5_flow_steering *steering)
{ {
...@@ -2637,6 +2627,7 @@ static int init_egress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2637,6 +2627,7 @@ static int init_egress_acls_root_ns(struct mlx5_core_dev *dev)
for (i--; i >= 0; i--) for (i--; i >= 0; i--)
cleanup_root_ns(steering->esw_egress_root_ns[i]); cleanup_root_ns(steering->esw_egress_root_ns[i]);
kfree(steering->esw_egress_root_ns); kfree(steering->esw_egress_root_ns);
steering->esw_egress_root_ns = NULL;
return err; return err;
} }
...@@ -2664,6 +2655,7 @@ static int init_ingress_acls_root_ns(struct mlx5_core_dev *dev) ...@@ -2664,6 +2655,7 @@ static int init_ingress_acls_root_ns(struct mlx5_core_dev *dev)
for (i--; i >= 0; i--) for (i--; i >= 0; i--)
cleanup_root_ns(steering->esw_ingress_root_ns[i]); cleanup_root_ns(steering->esw_ingress_root_ns[i]);
kfree(steering->esw_ingress_root_ns); kfree(steering->esw_ingress_root_ns);
steering->esw_ingress_root_ns = NULL;
return err; return err;
} }
......
...@@ -1067,7 +1067,7 @@ static int mlx5_load(struct mlx5_core_dev *dev) ...@@ -1067,7 +1067,7 @@ static int mlx5_load(struct mlx5_core_dev *dev)
err = mlx5_core_set_hca_defaults(dev); err = mlx5_core_set_hca_defaults(dev);
if (err) { if (err) {
mlx5_core_err(dev, "Failed to set hca defaults\n"); mlx5_core_err(dev, "Failed to set hca defaults\n");
goto err_fs; goto err_sriov;
} }
err = mlx5_sriov_attach(dev); err = mlx5_sriov_attach(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment