Commit 064a1899 authored by David S. Miller's avatar David S. Miller
Browse files

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



Saeed Mahameed says:

====================
Mellanox, mlx5 fixes 2019-11-20

This series introduces some fixes to mlx5 driver.

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

For -stable v4.9:
 ('net/mlx5e: Fix set vf link state error flow')

For -stable v4.14
 ('net/mlxfw: Verify FSM error code translation doesn't exceed array size')

For -stable v4.19
 ('net/mlx5: Fix auto group size calculation')

For -stable v5.3
 ('net/mlx5e: Fix error flow cleanup in mlx5e_tc_tun_create_header_ipv4/6')
 ('net/mlx5e: Do not use non-EXT link modes in EXT mode')
 ('net/mlx5: Update the list of the PCI supported devices')
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 84811412 30e9e055
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -239,12 +239,15 @@ int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
	if (max_encap_size < ipv4_encap_size) {
	if (max_encap_size < ipv4_encap_size) {
		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
			       ipv4_encap_size, max_encap_size);
			       ipv4_encap_size, max_encap_size);
		return -EOPNOTSUPP;
		err = -EOPNOTSUPP;
		goto out;
	}
	}


	encap_header = kzalloc(ipv4_encap_size, GFP_KERNEL);
	encap_header = kzalloc(ipv4_encap_size, GFP_KERNEL);
	if (!encap_header)
	if (!encap_header) {
		return -ENOMEM;
		err = -ENOMEM;
		goto out;
	}


	/* used by mlx5e_detach_encap to lookup a neigh hash table
	/* used by mlx5e_detach_encap to lookup a neigh hash table
	 * entry in the neigh hash table when a user deletes a rule
	 * entry in the neigh hash table when a user deletes a rule
@@ -355,12 +358,15 @@ int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
	if (max_encap_size < ipv6_encap_size) {
	if (max_encap_size < ipv6_encap_size) {
		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
		mlx5_core_warn(priv->mdev, "encap size %d too big, max supported is %d\n",
			       ipv6_encap_size, max_encap_size);
			       ipv6_encap_size, max_encap_size);
		return -EOPNOTSUPP;
		err = -EOPNOTSUPP;
		goto out;
	}
	}


	encap_header = kzalloc(ipv6_encap_size, GFP_KERNEL);
	encap_header = kzalloc(ipv6_encap_size, GFP_KERNEL);
	if (!encap_header)
	if (!encap_header) {
		return -ENOMEM;
		err = -ENOMEM;
		goto out;
	}


	/* used by mlx5e_detach_encap to lookup a neigh hash table
	/* used by mlx5e_detach_encap to lookup a neigh hash table
	 * entry in the neigh hash table when a user deletes a rule
	 * entry in the neigh hash table when a user deletes a rule
+6 −6
Original line number Original line Diff line number Diff line
@@ -708,9 +708,9 @@ static int get_fec_supported_advertised(struct mlx5_core_dev *dev,


static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings *link_ksettings,
static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings *link_ksettings,
						   u32 eth_proto_cap,
						   u32 eth_proto_cap,
						   u8 connector_type)
						   u8 connector_type, bool ext)
{
{
	if (!connector_type || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
	if ((!connector_type && !ext) || connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) {
		if (eth_proto_cap & (MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
		if (eth_proto_cap & (MLX5E_PROT_MASK(MLX5E_10GBASE_CR)
				   | MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
				   | MLX5E_PROT_MASK(MLX5E_10GBASE_SR)
				   | MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
				   | MLX5E_PROT_MASK(MLX5E_40GBASE_CR4)
@@ -842,9 +842,9 @@ static int ptys2connector_type[MLX5E_CONNECTOR_TYPE_NUMBER] = {
		[MLX5E_PORT_OTHER]              = PORT_OTHER,
		[MLX5E_PORT_OTHER]              = PORT_OTHER,
	};
	};


static u8 get_connector_port(u32 eth_proto, u8 connector_type)
static u8 get_connector_port(u32 eth_proto, u8 connector_type, bool ext)
{
{
	if (connector_type && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
	if ((connector_type || ext) && connector_type < MLX5E_CONNECTOR_TYPE_NUMBER)
		return ptys2connector_type[connector_type];
		return ptys2connector_type[connector_type];


	if (eth_proto &
	if (eth_proto &
@@ -945,9 +945,9 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
	eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
	eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;


	link_ksettings->base.port = get_connector_port(eth_proto_oper,
	link_ksettings->base.port = get_connector_port(eth_proto_oper,
						       connector_type);
						       connector_type, ext);
	ptys2ethtool_supported_advertised_port(link_ksettings, eth_proto_admin,
	ptys2ethtool_supported_advertised_port(link_ksettings, eth_proto_admin,
					       connector_type);
					       connector_type, ext);
	get_lp_advertising(mdev, eth_proto_lp, link_ksettings);
	get_lp_advertising(mdev, eth_proto_lp, link_ksettings);


	if (an_status == MLX5_AN_COMPLETE)
	if (an_status == MLX5_AN_COMPLETE)
+4 −1
Original line number Original line Diff line number Diff line
@@ -4252,9 +4252,12 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,


	switch (proto) {
	switch (proto) {
	case IPPROTO_GRE:
	case IPPROTO_GRE:
		return features;
	case IPPROTO_IPIP:
	case IPPROTO_IPIP:
	case IPPROTO_IPV6:
	case IPPROTO_IPV6:
		if (mlx5e_tunnel_proto_supported(priv->mdev, IPPROTO_IPIP))
			return features;
			return features;
		break;
	case IPPROTO_UDP:
	case IPPROTO_UDP:
		udph = udp_hdr(skb);
		udph = udp_hdr(skb);
		port = be16_to_cpu(udph->dest);
		port = be16_to_cpu(udph->dest);
+15 −16
Original line number Original line Diff line number Diff line
@@ -3268,7 +3268,20 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,


			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
			if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
			if (encap) {
				parse_attr->mirred_ifindex[attr->out_count] =
					out_dev->ifindex;
				parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
				if (!parse_attr->tun_info[attr->out_count])
					return -ENOMEM;
				encap = false;
				attr->dests[attr->out_count].flags |=
					MLX5_ESW_DEST_ENCAP;
				attr->out_count++;
				/* attr->dests[].rep is resolved when we
				 * handle encap
				 */
			} else if (netdev_port_same_parent_id(priv->netdev, out_dev)) {
				struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
				struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
				struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
				struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH);
				struct net_device *uplink_upper;
				struct net_device *uplink_upper;
@@ -3310,19 +3323,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
				attr->dests[attr->out_count].rep = rpriv->rep;
				attr->dests[attr->out_count].rep = rpriv->rep;
				attr->dests[attr->out_count].mdev = out_priv->mdev;
				attr->dests[attr->out_count].mdev = out_priv->mdev;
				attr->out_count++;
				attr->out_count++;
			} else if (encap) {
				parse_attr->mirred_ifindex[attr->out_count] =
					out_dev->ifindex;
				parse_attr->tun_info[attr->out_count] = dup_tun_info(info);
				if (!parse_attr->tun_info[attr->out_count])
					return -ENOMEM;
				encap = false;
				attr->dests[attr->out_count].flags |=
					MLX5_ESW_DEST_ENCAP;
				attr->out_count++;
				/* attr->dests[].rep is resolved when we
				 * handle encap
				 */
			} else if (parse_attr->filter_dev != priv->netdev) {
			} else if (parse_attr->filter_dev != priv->netdev) {
				/* All mlx5 devices are called to configure
				/* All mlx5 devices are called to configure
				 * high level device filters. Therefore, the
				 * high level device filters. Therefore, the
@@ -4000,9 +4000,8 @@ int mlx5e_tc_configure_matchall(struct mlx5e_priv *priv,
				struct tc_cls_matchall_offload *ma)
				struct tc_cls_matchall_offload *ma)
{
{
	struct netlink_ext_ack *extack = ma->common.extack;
	struct netlink_ext_ack *extack = ma->common.extack;
	int prio = TC_H_MAJ(ma->common.prio) >> 16;


	if (prio != 1) {
	if (ma->common.prio != 1) {
		NL_SET_ERR_MSG_MOD(extack, "only priority 1 is supported");
		NL_SET_ERR_MSG_MOD(extack, "only priority 1 is supported");
		return -EINVAL;
		return -EINVAL;
	}
	}
+1 −1
Original line number Original line Diff line number Diff line
@@ -2117,7 +2117,7 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,


unlock:
unlock:
	mutex_unlock(&esw->state_lock);
	mutex_unlock(&esw->state_lock);
	return 0;
	return err;
}
}


int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
Loading