Merge branch 'mlx4-fixes'

Or Gerlitz says:

====================
mlx4 driver fixes, July 22nd 2015

Just few mlx4 fixes.. the fix related to propagating port state
changes to VF should go to -stable of >= 3.11, all the rest just
to 4.2-rc
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2015-07-26 16:29:26 -07:00
commit 10e59ee3b1
4 changed files with 22 additions and 5 deletions

View File

@ -686,6 +686,7 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
{ {
struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd; struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd;
struct mlx4_cmd_context *context; struct mlx4_cmd_context *context;
long ret_wait;
int err = 0; int err = 0;
down(&cmd->event_sem); down(&cmd->event_sem);
@ -711,8 +712,20 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
if (err) if (err)
goto out_reset; goto out_reset;
if (!wait_for_completion_timeout(&context->done, if (op == MLX4_CMD_SENSE_PORT) {
msecs_to_jiffies(timeout))) { ret_wait =
wait_for_completion_interruptible_timeout(&context->done,
msecs_to_jiffies(timeout));
if (ret_wait < 0) {
context->fw_status = 0;
context->out_param = 0;
context->result = 0;
}
} else {
ret_wait = (long)wait_for_completion_timeout(&context->done,
msecs_to_jiffies(timeout));
}
if (!ret_wait) {
mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n", mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n",
op); op);
if (op == MLX4_CMD_NOP) { if (op == MLX4_CMD_NOP) {

View File

@ -246,7 +246,6 @@ static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv,
static inline bool mlx4_en_is_ring_empty(struct mlx4_en_rx_ring *ring) static inline bool mlx4_en_is_ring_empty(struct mlx4_en_rx_ring *ring)
{ {
BUG_ON((u32)(ring->prod - ring->cons) > ring->actual_size);
return ring->prod == ring->cons; return ring->prod == ring->cons;
} }

View File

@ -601,7 +601,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
continue; continue;
mlx4_dbg(dev, "%s: Sending MLX4_PORT_CHANGE_SUBTYPE_DOWN to slave: %d, port:%d\n", mlx4_dbg(dev, "%s: Sending MLX4_PORT_CHANGE_SUBTYPE_DOWN to slave: %d, port:%d\n",
__func__, i, port); __func__, i, port);
s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state; s_info = &priv->mfunc.master.vf_oper[i].vport[port].state;
if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) { if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) {
eqe->event.port_change.port = eqe->event.port_change.port =
cpu_to_be32( cpu_to_be32(
@ -640,7 +640,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
continue; continue;
if (i == mlx4_master_func_num(dev)) if (i == mlx4_master_func_num(dev))
continue; continue;
s_info = &priv->mfunc.master.vf_oper[slave].vport[port].state; s_info = &priv->mfunc.master.vf_oper[i].vport[port].state;
if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) { if (IFLA_VF_LINK_STATE_AUTO == s_info->link_state) {
eqe->event.port_change.port = eqe->event.port_change.port =
cpu_to_be32( cpu_to_be32(

View File

@ -2273,6 +2273,11 @@ static int mlx4_allocate_default_counters(struct mlx4_dev *dev)
} else if (err == -ENOENT) { } else if (err == -ENOENT) {
err = 0; err = 0;
continue; continue;
} else if (mlx4_is_slave(dev) && err == -EINVAL) {
priv->def_counter[port] = MLX4_SINK_COUNTER_INDEX(dev);
mlx4_warn(dev, "can't allocate counter from old PF driver, using index %d\n",
MLX4_SINK_COUNTER_INDEX(dev));
err = 0;
} else { } else {
mlx4_err(dev, "%s: failed to allocate default counter port %d err %d\n", mlx4_err(dev, "%s: failed to allocate default counter port %d err %d\n",
__func__, port + 1, err); __func__, port + 1, err);