diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-06 18:17:50 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-06 18:17:50 -0400 |
commit | 3eba148d75670f61463dd3c9ef8672da8f290f36 (patch) | |
tree | 45cb8fbda6d6ce9d73aeeac673282e37b0be2531 /drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |
parent | 057b0a7518e4b8fca26201715996d6d928a62300 (diff) | |
parent | 4cf563c5d97c83d4b2fb3a778dd7d5e362cc3e34 (diff) |
Merge branch 'acpi-pm' into pm-sleep
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/resource_tracker.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 3b5f53ef29b2..1c3fdd4a1f7d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -3733,6 +3733,25 @@ static int qp_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, | |||
3733 | } | 3733 | } |
3734 | } | 3734 | } |
3735 | 3735 | ||
3736 | static int mlx4_adjust_port(struct mlx4_dev *dev, int slave, | ||
3737 | u8 *gid, enum mlx4_protocol prot) | ||
3738 | { | ||
3739 | int real_port; | ||
3740 | |||
3741 | if (prot != MLX4_PROT_ETH) | ||
3742 | return 0; | ||
3743 | |||
3744 | if (dev->caps.steering_mode == MLX4_STEERING_MODE_B0 || | ||
3745 | dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { | ||
3746 | real_port = mlx4_slave_convert_port(dev, slave, gid[5]); | ||
3747 | if (real_port < 0) | ||
3748 | return -EINVAL; | ||
3749 | gid[5] = real_port; | ||
3750 | } | ||
3751 | |||
3752 | return 0; | ||
3753 | } | ||
3754 | |||
3736 | int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | 3755 | int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, |
3737 | struct mlx4_vhcr *vhcr, | 3756 | struct mlx4_vhcr *vhcr, |
3738 | struct mlx4_cmd_mailbox *inbox, | 3757 | struct mlx4_cmd_mailbox *inbox, |
@@ -3768,6 +3787,10 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, | |||
3768 | if (err) | 3787 | if (err) |
3769 | goto ex_detach; | 3788 | goto ex_detach; |
3770 | } else { | 3789 | } else { |
3790 | err = mlx4_adjust_port(dev, slave, gid, prot); | ||
3791 | if (err) | ||
3792 | goto ex_put; | ||
3793 | |||
3771 | err = rem_mcg_res(dev, slave, rqp, gid, prot, type, ®_id); | 3794 | err = rem_mcg_res(dev, slave, rqp, gid, prot, type, ®_id); |
3772 | if (err) | 3795 | if (err) |
3773 | goto ex_put; | 3796 | goto ex_put; |