aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c10
-rw-r--r--include/linux/mlx4/device.h3
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index b969bfb569e3..8f7314394cc2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -274,6 +274,10 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
274 dev->caps.stat_rate_support = dev_cap->stat_rate_support; 274 dev->caps.stat_rate_support = dev_cap->stat_rate_support;
275 dev->caps.max_gso_sz = dev_cap->max_gso_sz; 275 dev->caps.max_gso_sz = dev_cap->max_gso_sz;
276 276
277 /* Sense port always allowed on supported devices for ConnectX1 and 2 */
278 if (dev->pdev->device != 0x1003)
279 dev->caps.flags |= MLX4_DEV_CAP_FLAG_SENSE_SUPPORT;
280
277 dev->caps.log_num_macs = log_num_mac; 281 dev->caps.log_num_macs = log_num_mac;
278 dev->caps.log_num_vlans = MLX4_LOG_NUM_VLANS; 282 dev->caps.log_num_vlans = MLX4_LOG_NUM_VLANS;
279 dev->caps.log_num_prios = use_prio ? 3 : 0; 283 dev->caps.log_num_prios = use_prio ? 3 : 0;
@@ -311,7 +315,8 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
311 } 315 }
312 dev->caps.possible_type[i] = dev->caps.port_type[i]; 316 dev->caps.possible_type[i] = dev->caps.port_type[i];
313 mlx4_priv(dev)->sense.sense_allowed[i] = 317 mlx4_priv(dev)->sense.sense_allowed[i] =
314 dev->caps.supported_type[i] == MLX4_PORT_TYPE_AUTO; 318 ((dev->caps.supported_type[i] == MLX4_PORT_TYPE_AUTO) &&
319 (dev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT));
315 320
316 if (dev->caps.log_num_macs > dev_cap->log_max_macs[i]) { 321 if (dev->caps.log_num_macs > dev_cap->log_max_macs[i]) {
317 dev->caps.log_num_macs = dev_cap->log_max_macs[i]; 322 dev->caps.log_num_macs = dev_cap->log_max_macs[i];
@@ -583,7 +588,8 @@ static ssize_t set_port_type(struct device *dev,
583 types[i] = mdev->caps.port_type[i+1]; 588 types[i] = mdev->caps.port_type[i+1];
584 } 589 }
585 590
586 if (!(mdev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { 591 if (!(mdev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) &&
592 !(mdev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT)) {
587 for (i = 1; i <= mdev->caps.num_ports; i++) { 593 for (i = 1; i <= mdev->caps.num_ports; i++) {
588 if (mdev->caps.possible_type[i] == MLX4_PORT_TYPE_AUTO) { 594 if (mdev->caps.possible_type[i] == MLX4_PORT_TYPE_AUTO) {
589 mdev->caps.possible_type[i] = mdev->caps.port_type[i]; 595 mdev->caps.possible_type[i] = mdev->caps.port_type[i];
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 5f784ff6a36e..b06a44ba1565 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -94,7 +94,8 @@ enum {
94 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, 94 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
95 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, 95 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
96 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, 96 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
97 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 97 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48,
98 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55
98}; 99};
99 100
100#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 101#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)