diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-13 22:19:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-13 22:19:09 -0500 |
commit | f132c54e3ab25b305a1e368ad413a417052c966e (patch) | |
tree | e34ef551cd3e544f9b8599728e56cce292703179 /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | d3b43e12b2c8c69f79ab76dcdc5956f47c376378 (diff) | |
parent | 01e03365981ebd99f1b4027dbf7c215d1c136f71 (diff) |
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband upate from Roland Dreier:
"First batch of InfiniBand/RDMA changes for the 3.8 merge window:
- A good chunk of Bart Van Assche's SRP fixes
- UAPI disintegration from David Howells
- mlx4 support for "64-byte CQE" hardware feature from Or Gerlitz
- Other miscellaneous fixes"
Fix up trivial conflict in mellanox/mlx4 driver.
* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (33 commits)
RDMA/nes: Fix for crash when registering zero length MR for CQ
RDMA/nes: Fix for terminate timer crash
RDMA/nes: Fix for BUG_ON due to adding already-pending timer
IB/srp: Allow SRP disconnect through sysfs
srp_transport: Document sysfs attributes
srp_transport: Simplify attribute initialization code
srp_transport: Fix attribute registration
IB/srp: Document sysfs attributes
IB/srp: send disconnect request without waiting for CM timewait exit
IB/srp: destroy and recreate QP and CQs when reconnecting
IB/srp: Eliminate state SRP_TARGET_DEAD
IB/srp: Introduce the helper function srp_remove_target()
IB/srp: Suppress superfluous error messages
IB/srp: Process all error completions
IB/srp: Introduce srp_handle_qp_err()
IB/srp: Simplify SCSI error handling
IB/srp: Keep processing commands during host removal
IB/srp: Eliminate state SRP_TARGET_CONNECTING
IB/srp: Increase block layer timeout
RDMA/cm: Change return value from find_gid_port()
...
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 200cc0ec8052..b2acbe7706a3 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -95,8 +95,14 @@ MODULE_PARM_DESC(log_num_mgm_entry_size, "log mgm size, that defines the num" | |||
95 | " Not in use with device managed" | 95 | " Not in use with device managed" |
96 | " flow steering"); | 96 | " flow steering"); |
97 | 97 | ||
98 | static bool enable_64b_cqe_eqe; | ||
99 | module_param(enable_64b_cqe_eqe, bool, 0444); | ||
100 | MODULE_PARM_DESC(enable_64b_cqe_eqe, | ||
101 | "Enable 64 byte CQEs/EQEs when the the FW supports this"); | ||
102 | |||
98 | #define HCA_GLOBAL_CAP_MASK 0 | 103 | #define HCA_GLOBAL_CAP_MASK 0 |
99 | #define PF_CONTEXT_BEHAVIOUR_MASK 0 | 104 | |
105 | #define PF_CONTEXT_BEHAVIOUR_MASK MLX4_FUNC_CAP_64B_EQE_CQE | ||
100 | 106 | ||
101 | static char mlx4_version[] = | 107 | static char mlx4_version[] = |
102 | DRV_NAME ": Mellanox ConnectX core driver v" | 108 | DRV_NAME ": Mellanox ConnectX core driver v" |
@@ -386,6 +392,21 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
386 | dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH]; | 392 | dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH]; |
387 | 393 | ||
388 | dev->caps.sqp_demux = (mlx4_is_master(dev)) ? MLX4_MAX_NUM_SLAVES : 0; | 394 | dev->caps.sqp_demux = (mlx4_is_master(dev)) ? MLX4_MAX_NUM_SLAVES : 0; |
395 | |||
396 | if (!enable_64b_cqe_eqe) { | ||
397 | if (dev_cap->flags & | ||
398 | (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) { | ||
399 | mlx4_warn(dev, "64B EQEs/CQEs supported by the device but not enabled\n"); | ||
400 | dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_CQE; | ||
401 | dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_EQE; | ||
402 | } | ||
403 | } | ||
404 | |||
405 | if ((dev_cap->flags & | ||
406 | (MLX4_DEV_CAP_FLAG_64B_CQE | MLX4_DEV_CAP_FLAG_64B_EQE)) && | ||
407 | mlx4_is_master(dev)) | ||
408 | dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE; | ||
409 | |||
389 | return 0; | 410 | return 0; |
390 | } | 411 | } |
391 | /*The function checks if there are live vf, return the num of them*/ | 412 | /*The function checks if there are live vf, return the num of them*/ |
@@ -599,6 +620,21 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) | |||
599 | goto err_mem; | 620 | goto err_mem; |
600 | } | 621 | } |
601 | 622 | ||
623 | if (hca_param.dev_cap_enabled & MLX4_DEV_CAP_64B_EQE_ENABLED) { | ||
624 | dev->caps.eqe_size = 64; | ||
625 | dev->caps.eqe_factor = 1; | ||
626 | } else { | ||
627 | dev->caps.eqe_size = 32; | ||
628 | dev->caps.eqe_factor = 0; | ||
629 | } | ||
630 | |||
631 | if (hca_param.dev_cap_enabled & MLX4_DEV_CAP_64B_CQE_ENABLED) { | ||
632 | dev->caps.cqe_size = 64; | ||
633 | dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_64B_CQE; | ||
634 | } else { | ||
635 | dev->caps.cqe_size = 32; | ||
636 | } | ||
637 | |||
602 | return 0; | 638 | return 0; |
603 | 639 | ||
604 | err_mem: | 640 | err_mem: |