Skip to content

Commit cf68017

Browse files
committed
Merge branch 'mlx4-misc-fixes'
Tariq Toukan says: ==================== mlx4 misc fixes This patchset contains misc bug fixes from the team to the mlx4 Core and Eth drivers. Series generated against net commit: 32f1bc0 Revert "ipv4: restore rt->fi for reference counting" ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4c19e2f + 83bd511 commit cf68017

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

drivers/net/ethernet/mellanox/mlx4/cmd.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,9 +1789,17 @@ static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave,
17891789
}
17901790

17911791
if (err) {
1792-
if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR))
1793-
mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
1794-
vhcr->op, slave, vhcr->errno, err);
1792+
if (!(dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR)) {
1793+
if (vhcr->op == MLX4_CMD_ALLOC_RES &&
1794+
(vhcr->in_modifier & 0xff) == RES_COUNTER &&
1795+
err == -EDQUOT)
1796+
mlx4_dbg(dev,
1797+
"Unable to allocate counter for slave %d (%d)\n",
1798+
slave, err);
1799+
else
1800+
mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with error:%d, status %d\n",
1801+
vhcr->op, slave, vhcr->errno, err);
1802+
}
17951803
vhcr_cmd->status = mlx4_errno_to_status(err);
17961804
goto out_status;
17971805
}

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,11 @@ static int mlx4_en_flow_replace(struct net_device *dev,
15621562
qpn = priv->drop_qp.qpn;
15631563
else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) {
15641564
qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1);
1565+
if (qpn < priv->rss_map.base_qpn ||
1566+
qpn >= priv->rss_map.base_qpn + priv->rx_ring_num) {
1567+
en_warn(priv, "rxnfc: QP (0x%x) doesn't exist\n", qpn);
1568+
return -EINVAL;
1569+
}
15651570
} else {
15661571
if (cmd->fs.ring_cookie >= priv->rx_ring_num) {
15671572
en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n",

drivers/net/ethernet/mellanox/mlx4/en_rx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,8 @@ void mlx4_en_calc_rx_buf(struct net_device *dev)
997997
en_dbg(DRV, priv, "Rx buffer scatter-list (effective-mtu:%d num_frags:%d):\n",
998998
eff_mtu, priv->num_frags);
999999
for (i = 0; i < priv->num_frags; i++) {
1000-
en_err(priv,
1000+
en_dbg(DRV,
1001+
priv,
10011002
" frag:%d - size:%d stride:%d\n",
10021003
i,
10031004
priv->frag_info[i].frag_size,

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static inline int mlx4_grant_resource(struct mlx4_dev *dev, int slave,
311311
struct mlx4_priv *priv = mlx4_priv(dev);
312312
struct resource_allocator *res_alloc =
313313
&priv->mfunc.master.res_tracker.res_alloc[res_type];
314-
int err = -EINVAL;
314+
int err = -EDQUOT;
315315
int allocated, free, reserved, guaranteed, from_free;
316316
int from_rsvd;
317317

0 commit comments

Comments
 (0)