Commit 3d61a39d authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mlx5-fixes-2020-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux



Saeed Mahameed says:

====================
Mellanox, mlx5 fixes 2020-04-08

This series introduces some fixes to mlx5 driver.

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

For -stable v5.3
 ('net/mlx5: Fix frequent ioread PCI access during recovery')
 ('net/mlx5e: Add missing release firmware call')

For -stable v5.4
 ('net/mlx5e: Fix nest_level for vlan pop action')
 ('net/mlx5e: Fix pfnum in devlink port attribute')
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e750b84d 9808dd0a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -23,7 +23,10 @@ static int mlx5_devlink_flash_update(struct devlink *devlink,
	if (err)
		return err;

	return mlx5_firmware_flash(dev, fw, extack);
	err = mlx5_firmware_flash(dev, fw, extack);
	release_firmware(fw);

	return err;
}

static u8 mlx5_fw_ver_major(u32 version)
+7 −12
Original line number Diff line number Diff line
@@ -67,11 +67,9 @@ struct mlx5_ct_ft {
	struct nf_flowtable *nf_ft;
	struct mlx5_tc_ct_priv *ct_priv;
	struct rhashtable ct_entries_ht;
	struct list_head ct_entries_list;
};

struct mlx5_ct_entry {
	struct list_head list;
	u16 zone;
	struct rhash_head node;
	struct flow_rule *flow_rule;
@@ -617,8 +615,6 @@ mlx5_tc_ct_block_flow_offload_add(struct mlx5_ct_ft *ft,
	if (err)
		goto err_insert;

	list_add(&entry->list, &ft->ct_entries_list);

	return 0;

err_insert:
@@ -646,7 +642,6 @@ mlx5_tc_ct_block_flow_offload_del(struct mlx5_ct_ft *ft,
	WARN_ON(rhashtable_remove_fast(&ft->ct_entries_ht,
				       &entry->node,
				       cts_ht_params));
	list_del(&entry->list);
	kfree(entry);

	return 0;
@@ -818,7 +813,6 @@ mlx5_tc_ct_add_ft_cb(struct mlx5_tc_ct_priv *ct_priv, u16 zone,
	ft->zone = zone;
	ft->nf_ft = nf_ft;
	ft->ct_priv = ct_priv;
	INIT_LIST_HEAD(&ft->ct_entries_list);
	refcount_set(&ft->refcount, 1);

	err = rhashtable_init(&ft->ct_entries_ht, &cts_ht_params);
@@ -847,12 +841,12 @@ err_init:
}

static void
mlx5_tc_ct_flush_ft(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)
mlx5_tc_ct_flush_ft_entry(void *ptr, void *arg)
{
	struct mlx5_ct_entry *entry;
	struct mlx5_tc_ct_priv *ct_priv = arg;
	struct mlx5_ct_entry *entry = ptr;

	list_for_each_entry(entry, &ft->ct_entries_list, list)
		mlx5_tc_ct_entry_del_rules(ft->ct_priv, entry);
	mlx5_tc_ct_entry_del_rules(ct_priv, entry);
}

static void
@@ -863,9 +857,10 @@ mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)

	nf_flow_table_offload_del_cb(ft->nf_ft,
				     mlx5_tc_ct_block_flow_offload, ft);
	mlx5_tc_ct_flush_ft(ct_priv, ft);
	rhashtable_remove_fast(&ct_priv->zone_ht, &ft->node, zone_params);
	rhashtable_destroy(&ft->ct_entries_ht);
	rhashtable_free_and_destroy(&ft->ct_entries_ht,
				    mlx5_tc_ct_flush_ft_entry,
				    ct_priv);
	kfree(ft);
}

+1 −1
Original line number Diff line number Diff line
@@ -5526,8 +5526,8 @@ static void mlx5e_remove(struct mlx5_core_dev *mdev, void *vpriv)
#ifdef CONFIG_MLX5_CORE_EN_DCB
	mlx5e_dcbnl_delete_app(priv);
#endif
	mlx5e_devlink_port_unregister(priv);
	unregister_netdev(priv->netdev);
	mlx5e_devlink_port_unregister(priv);
	mlx5e_detach(mdev, vpriv);
	mlx5e_destroy_netdev(priv);
}
+5 −4
Original line number Diff line number Diff line
@@ -2050,29 +2050,30 @@ static int register_devlink_port(struct mlx5_core_dev *dev,
	struct mlx5_eswitch_rep *rep = rpriv->rep;
	struct netdev_phys_item_id ppid = {};
	unsigned int dl_port_index = 0;
	u16 pfnum;

	if (!is_devlink_port_supported(dev, rpriv))
		return 0;

	mlx5e_rep_get_port_parent_id(rpriv->netdev, &ppid);
	pfnum = PCI_FUNC(dev->pdev->devfn);

	if (rep->vport == MLX5_VPORT_UPLINK) {
		devlink_port_attrs_set(&rpriv->dl_port,
				       DEVLINK_PORT_FLAVOUR_PHYSICAL,
				       PCI_FUNC(dev->pdev->devfn), false, 0,
				       pfnum, false, 0,
				       &ppid.id[0], ppid.id_len);
		dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
	} else if (rep->vport == MLX5_VPORT_PF) {
		devlink_port_attrs_pci_pf_set(&rpriv->dl_port,
					      &ppid.id[0], ppid.id_len,
					      dev->pdev->devfn);
					      pfnum);
		dl_port_index = rep->vport;
	} else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch,
					    rpriv->rep->vport)) {
		devlink_port_attrs_pci_vf_set(&rpriv->dl_port,
					      &ppid.id[0], ppid.id_len,
					      dev->pdev->devfn,
					      rep->vport - 1);
					      pfnum, rep->vport - 1);
		dl_port_index = vport_to_devlink_port_index(dev, rep->vport);
	}

+5 −3
Original line number Diff line number Diff line
@@ -1343,7 +1343,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
	if (err)
		return err;

	if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) {
	if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
	    !(attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR)) {
		err = mlx5e_attach_mod_hdr(priv, flow, parse_attr);
		dealloc_mod_hdr_actions(&parse_attr->mod_hdr_acts);
		if (err)
@@ -3558,12 +3559,13 @@ static int add_vlan_pop_action(struct mlx5e_priv *priv,
			       struct mlx5_esw_flow_attr *attr,
			       u32 *action)
{
	int nest_level = attr->parse_attr->filter_dev->lower_level;
	struct flow_action_entry vlan_act = {
		.id = FLOW_ACTION_VLAN_POP,
	};
	int err = 0;
	int nest_level, err = 0;

	nest_level = attr->parse_attr->filter_dev->lower_level -
						priv->netdev->lower_level;
	while (nest_level--) {
		err = parse_tc_vlan_action(priv, &vlan_act, attr, action);
		if (err)
Loading