Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4be99934 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'mlx4-misc-improvements'

Tariq Toukan says:

====================
mlx4 misc improvements

This patchset contains several improvements and cleanups
from the team to the mlx4 Eth and core drivers.

Series generated against net-next commit:
4e8f2fc1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net



Thanks,
Tariq.

v3:
* Patch 6/9: forgot to actually update the commit message in v2, now it is.

v2:
* Patch 1/9: used EOPNOTSUPP and not ENOTSUPP.
* Patch 3/9: dropped, to be submitted separately in the future.
* Patch 6/9: updated commit message.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 30357d7d 1f8176f7
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -902,6 +902,7 @@ mlx4_en_set_link_ksettings(struct net_device *dev,
	struct mlx4_en_priv *priv = netdev_priv(dev);
	struct mlx4_ptys_reg ptys_reg;
	__be32 proto_admin;
	u8 cur_autoneg;
	int ret;

	u32 ptys_adv = ethtool2ptys_link_modes(
@@ -931,10 +932,21 @@ mlx4_en_set_link_ksettings(struct net_device *dev,
		return 0;
	}

	proto_admin = link_ksettings->base.autoneg == AUTONEG_ENABLE ?
		cpu_to_be32(ptys_adv) :
		speed_set_ptys_admin(priv, speed,
	cur_autoneg = ptys_reg.flags & MLX4_PTYS_AN_DISABLE_ADMIN ?
				AUTONEG_DISABLE : AUTONEG_ENABLE;

	if (link_ksettings->base.autoneg == AUTONEG_DISABLE) {
		proto_admin = speed_set_ptys_admin(priv, speed,
						   ptys_reg.eth_proto_cap);
		if ((be32_to_cpu(proto_admin) &
		     (MLX4_PROT_MASK(MLX4_1000BASE_CX_SGMII) |
		      MLX4_PROT_MASK(MLX4_1000BASE_KX))) &&
		    (ptys_reg.flags & MLX4_PTYS_AN_DISABLE_CAP))
			ptys_reg.flags |= MLX4_PTYS_AN_DISABLE_ADMIN;
	} else {
		proto_admin = cpu_to_be32(ptys_adv);
		ptys_reg.flags &= ~MLX4_PTYS_AN_DISABLE_ADMIN;
	}

	proto_admin &= ptys_reg.eth_proto_cap;
	if (!proto_admin) {
@@ -942,7 +954,9 @@ mlx4_en_set_link_ksettings(struct net_device *dev,
		return -EINVAL; /* nothing to change due to bad input */
	}

	if (proto_admin == ptys_reg.eth_proto_admin)
	if ((proto_admin == ptys_reg.eth_proto_admin) &&
	    ((ptys_reg.flags & MLX4_PTYS_AN_DISABLE_CAP) &&
	     (link_ksettings->base.autoneg == cur_autoneg)))
		return 0; /* Nothing to change */

	en_dbg(DRV, priv, "mlx4_ACCESS_PTYS_REG SET: ptys_reg.eth_proto_admin = 0x%x\n",
@@ -1788,7 +1802,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
	netif_set_real_num_tx_queues(dev, priv->tx_ring_num[TX]);
	netif_set_real_num_rx_queues(dev, priv->rx_ring_num);

	if (dev->num_tc)
	if (netdev_get_num_tc(dev))
		mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP);

	en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num[TX]);
@@ -1980,7 +1994,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
		modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
		break;
	default:
		return -ENOSYS;
		return -EINVAL;
	}

	return 0;
+8 −0
Original line number Diff line number Diff line
@@ -1695,6 +1695,14 @@ int mlx4_en_start_port(struct net_device *dev)
		       priv->port, err);
		goto tx_err;
	}

	err = mlx4_SET_PORT_user_mtu(mdev->dev, priv->port, dev->mtu);
	if (err) {
		en_err(priv, "Failed to pass user MTU(%d) to Firmware for port %d, with error %d\n",
		       dev->mtu, priv->port, err);
		goto tx_err;
	}

	/* Set default qp number */
	err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, priv->base_qpn, 0);
	if (err) {
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@
#define _MLX4_EN_PORT_H_


#define SET_PORT_GEN_ALL_VALID	0x7
#define SET_PORT_PROMISC_SHIFT	31
#define SET_PORT_MC_PROMISC_SHIFT	30

+1 −1
Original line number Diff line number Diff line
@@ -710,7 +710,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb,
	u16 rings_p_up = priv->num_tx_rings_p_up;
	u8 up = 0;

	if (dev->num_tc)
	if (netdev_get_num_tc(dev))
		return skb_tx_hash(dev, skb);

	if (skb_vlan_tag_present(skb))
+3 −3
Original line number Diff line number Diff line
@@ -672,7 +672,7 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
	MLX4_GET(field, outbox, QUERY_FUNC_CAP_PHYS_PORT_OFFSET);
	func_cap->physical_port = field;
	if (func_cap->physical_port != gen_or_port) {
		err = -ENOSYS;
		err = -EINVAL;
		goto out;
	}

@@ -1875,7 +1875,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
	*((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION;

	*((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) =
		(ilog2(cache_line_size()) - 4) << 5;
		((ilog2(cache_line_size()) - 4) << 5) | (1 << 4);

#if defined(__LITTLE_ENDIAN)
	*(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1);
@@ -2983,7 +2983,7 @@ static int mlx4_SET_PORT_phv_bit(struct mlx4_dev *dev, u8 port, u8 phv_bit)
		return PTR_ERR(mailbox);
	context = mailbox->buf;

	context->v_ignore_fcs |=  SET_PORT_GEN_PHV_VALID;
	context->flags2 |=  SET_PORT_GEN_PHV_VALID;
	if (phv_bit)
		context->phv_en |=  SET_PORT_GEN_PHV_EN;

Loading