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

Commit 005e35f5 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'mlx4-next'



Or Gerlitz says:

====================
Mellanox driver update 2014-05-12

This patchset introduce some small bug fixes:

Eyal fixed some compilation and syntactic checkers warnings. Ido fixed a
coruption in user priority mapping when changing number of channels. Shani
fixed some other problems when modifying MAC address. Yuval fixed a problem
when changing IRQ affinity during high traffic - IRQ changes got effective
only after the first pause in traffic.

This patchset was tested and applied over commit 93dccc59: "mdio_bus: fix
devm_mdiobus_alloc_size export"

Changes from V1:
- applied feedback from Dave to use true/false and not 0/1 in patch 1/9
- removed the patch from Noa which adddressed a bug in flow steering table
  when using a bond device, as the fix might need to be in the bonding driver,
  this is now dicussed in the netdev thread "bonding directly changes
  underlying device address"

Changes from V0:
- Patch 1/9 - net/mlx4_core: Enforce irq affinity changes immediatly
  - Moved the new members to a hot cache line as Eric suggested
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3763e7ef 75720384
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -473,6 +473,13 @@ static int mlx4_cmd_poll(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
		goto out;
	}

	if (out_is_imm && !out_param) {
		mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n",
			 op);
		err = -EINVAL;
		goto out;
	}

	err = mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0,
			    in_modifier, op_modifier, op, CMD_POLL_TOKEN, 0);
	if (err)
@@ -551,6 +558,13 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
	cmd->free_head = context->next;
	spin_unlock(&cmd->context_lock);

	if (out_is_imm && !out_param) {
		mlx4_err(dev, "response expected while output mailbox is NULL for command 0x%x\n",
			 op);
		err = -EINVAL;
		goto out;
	}

	init_completion(&context->done);

	mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0,
+3 −0
Original line number Diff line number Diff line
@@ -293,6 +293,9 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent,
	atomic_set(&cq->refcount, 1);
	init_completion(&cq->free);

	cq->irq = priv->eq_table.eq[cq->vector].irq;
	cq->irq_affinity_change = false;

	return 0;

err_radix:
+2 −1
Original line number Diff line number Diff line
@@ -1151,6 +1151,7 @@ static int mlx4_en_set_channels(struct net_device *dev,
	netif_set_real_num_tx_queues(dev, priv->tx_ring_num);
	netif_set_real_num_rx_queues(dev, priv->rx_ring_num);

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

	en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num);
+6 −6
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static enum mlx4_net_trans_rule_id mlx4_ip_proto_to_trans_rule_id(u8 ip_proto)
	case IPPROTO_TCP:
		return MLX4_NET_TRANS_RULE_ID_TCP;
	default:
		return -EPROTONOSUPPORT;
		return MLX4_NET_TRANS_RULE_NUM;
	}
};

@@ -177,7 +177,7 @@ static void mlx4_en_filter_work(struct work_struct *work)
	int rc;
	__be64 mac_mask = cpu_to_be64(MLX4_MAC_MASK << 16);

	if (spec_tcp_udp.id < 0) {
	if (spec_tcp_udp.id >= MLX4_NET_TRANS_RULE_NUM) {
		en_warn(priv, "RFS: ignoring unsupported ip protocol (%d)\n",
			filter->ip_proto);
		goto ignore;
@@ -770,11 +770,12 @@ static int mlx4_en_do_set_mac(struct mlx4_en_priv *priv)
					  priv->dev->dev_addr, priv->prev_mac);
		if (err)
			en_err(priv, "Failed changing HW MAC address\n");
		memcpy(priv->prev_mac, priv->dev->dev_addr,
		       sizeof(priv->prev_mac));
	} else
		en_dbg(HW, priv, "Port is down while registering mac, exiting...\n");

	memcpy(priv->prev_mac, priv->dev->dev_addr,
	       sizeof(priv->prev_mac));

	return err;
}

@@ -788,9 +789,8 @@ static int mlx4_en_set_mac(struct net_device *dev, void *addr)
	if (!is_valid_ether_addr(saddr->sa_data))
		return -EADDRNOTAVAIL;

	memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);

	mutex_lock(&mdev->state_lock);
	memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);
	err = mlx4_en_do_set_mac(priv);
	mutex_unlock(&mdev->state_lock);

+9 −2
Original line number Diff line number Diff line
@@ -895,10 +895,17 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget)
	mlx4_en_cq_unlock_napi(cq);

	/* If we used up all the quota - we're probably not done yet... */
	if (done == budget)
	if (done == budget) {
		INC_PERF_COUNTER(priv->pstats.napi_quota);
	else {
		if (unlikely(cq->mcq.irq_affinity_change)) {
			cq->mcq.irq_affinity_change = false;
			napi_complete(napi);
			mlx4_en_arm_cq(priv, cq);
			return 0;
		}
	} else {
		/* Done for now */
		cq->mcq.irq_affinity_change = false;
		napi_complete(napi);
		mlx4_en_arm_cq(priv, cq);
	}
Loading