summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorMatan Barak <matanb@mellanox.com>2014-09-10 16:41:55 +0300
committerDavid S. Miller <davem@davemloft.net>2014-09-10 15:21:34 -0700
commitb7834758e6f33da401f584035f1b6b62d0672aab (patch)
treedab363af1a4d20eb424b80e05f0028ada65e3dbe /drivers/net/ethernet/mellanox
parent311be98a3cca6469adf369714d689f9bbf286190 (diff)
downloadtalos-obmc-linux-b7834758e6f33da401f584035f1b6b62d0672aab.tar.gz
talos-obmc-linux-b7834758e6f33da401f584035f1b6b62d0672aab.zip
net/mlx4: Avoid dealing with MAC index in UPDATE_QP wrapper if not needed
The current wrapper implementation of the UPDATE_QP command tries to get the MAC index, even if MAC wasn't set by the VF. Fix it up to only handle the MAC field if it's valid. Fixes: ce8d9e0 ('net/mlx4_core: Add UPDATE_QP SRIOV wrapper support') Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/resource_tracker.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index f87a4a38575f..2fe61b6a8e37 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -3998,13 +3998,17 @@ int mlx4_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave,
}
port = (rqp->sched_queue >> 6 & 1) + 1;
- smac_index = cmd->qp_context.pri_path.grh_mylmc;
- err = mac_find_smac_ix_in_slave(dev, slave, port,
- smac_index, &mac);
- if (err) {
- mlx4_err(dev, "Failed to update qpn 0x%x, MAC is invalid. smac_ix: %d\n",
- qpn, smac_index);
- goto err_mac;
+
+ if (pri_addr_path_mask & (1ULL << MLX4_UPD_QP_PATH_MASK_MAC_INDEX)) {
+ smac_index = cmd->qp_context.pri_path.grh_mylmc;
+ err = mac_find_smac_ix_in_slave(dev, slave, port,
+ smac_index, &mac);
+
+ if (err) {
+ mlx4_err(dev, "Failed to update qpn 0x%x, MAC is invalid. smac_ix: %d\n",
+ qpn, smac_index);
+ goto err_mac;
+ }
}
err = mlx4_cmd(dev, inbox->dma,
OpenPOWER on IntegriCloud