diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:56:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 16:56:26 -0400 |
commit | 5dedb9f3bd5bcb186313ea0c0cff8f2c525d4122 (patch) | |
tree | 88514547a6e95176e7a9dc2fbdc7fa7c1bec3107 /include/linux/mlx4 | |
parent | ddb03448274b95bff6df2a2f1a74d7eb4be529d3 (diff) | |
parent | 089117e1ad265625b523a4168f77f2521b18fd32 (diff) |
Merge tag 'rdma-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull InfiniBand/RDMA changes from Roland Dreier:
- Updates to the qib low-level driver
- First chunk of changes for SR-IOV support for mlx4 IB
- RDMA CM support for IPv6-only binding
- Other misc cleanups and fixes
Fix up some add-add conflicts in include/linux/mlx4/device.h and
drivers/net/ethernet/mellanox/mlx4/main.c
* tag 'rdma-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (30 commits)
IB/qib: checkpatch fixes
IB/qib: Add congestion control agent implementation
IB/qib: Reduce sdma_lock contention
IB/qib: Fix an incorrect log message
IB/qib: Fix QP RCU sparse warnings
mlx4: Put physical GID and P_Key table sizes in mlx4_phys_caps struct and paravirtualize them
mlx4_core: Allow guests to have IB ports
mlx4_core: Implement mechanism for reserved Q_Keys
net/mlx4_core: Free ICM table in case of error
IB/cm: Destroy idr as part of the module init error flow
mlx4_core: Remove double function declarations
IB/mlx4: Fill the masked_atomic_cap attribute in query device
IB/mthca: Fill in sq_sig_type in query QP
IB/mthca: Warning about event for non-existent QPs should show event type
IB/qib: Fix sparse RCU warnings in qib_keys.c
net/mlx4_core: Initialize IB port capabilities for all slaves
mlx4: Use port management change event instead of smp_snoop
IB/qib: RCU locking for MR validation
IB/qib: Avoid returning EBUSY from MR deregister
IB/qib: Fix UC MR refs for immediate operations
...
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r-- | include/linux/mlx4/device.h | 119 | ||||
-rw-r--r-- | include/linux/mlx4/driver.h | 3 |
2 files changed, 120 insertions, 2 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 4d7761f8c3f6..bd6c9fcdf2dd 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -57,6 +57,13 @@ enum { | |||
57 | MLX4_MAX_PORTS = 2 | 57 | MLX4_MAX_PORTS = 2 |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* base qkey for use in sriov tunnel-qp/proxy-qp communication. | ||
61 | * These qkeys must not be allowed for general use. This is a 64k range, | ||
62 | * and to test for violation, we use the mask (protect against future chg). | ||
63 | */ | ||
64 | #define MLX4_RESERVED_QKEY_BASE (0xFFFF0000) | ||
65 | #define MLX4_RESERVED_QKEY_MASK (0xFFFF0000) | ||
66 | |||
60 | enum { | 67 | enum { |
61 | MLX4_BOARD_ID_LEN = 64 | 68 | MLX4_BOARD_ID_LEN = 64 |
62 | }; | 69 | }; |
@@ -127,7 +134,8 @@ enum { | |||
127 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, | 134 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, |
128 | MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, | 135 | MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42, |
129 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, | 136 | MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, |
130 | MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55 | 137 | MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, |
138 | MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, | ||
131 | }; | 139 | }; |
132 | 140 | ||
133 | enum { | 141 | enum { |
@@ -170,6 +178,7 @@ enum mlx4_event { | |||
170 | MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, | 178 | MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, |
171 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, | 179 | MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, |
172 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, | 180 | MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, |
181 | MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, | ||
173 | MLX4_EVENT_TYPE_NONE = 0xff, | 182 | MLX4_EVENT_TYPE_NONE = 0xff, |
174 | }; | 183 | }; |
175 | 184 | ||
@@ -267,12 +276,32 @@ enum { | |||
267 | MLX4_MAX_FAST_REG_PAGES = 511, | 276 | MLX4_MAX_FAST_REG_PAGES = 511, |
268 | }; | 277 | }; |
269 | 278 | ||
279 | enum { | ||
280 | MLX4_DEV_PMC_SUBTYPE_GUID_INFO = 0x14, | ||
281 | MLX4_DEV_PMC_SUBTYPE_PORT_INFO = 0x15, | ||
282 | MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE = 0x16, | ||
283 | }; | ||
284 | |||
285 | /* Port mgmt change event handling */ | ||
286 | enum { | ||
287 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK = 1 << 0, | ||
288 | MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK = 1 << 1, | ||
289 | MLX4_EQ_PORT_INFO_LID_CHANGE_MASK = 1 << 2, | ||
290 | MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK = 1 << 3, | ||
291 | MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK = 1 << 4, | ||
292 | }; | ||
293 | |||
294 | #define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ | ||
295 | MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) | ||
296 | |||
270 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 297 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
271 | { | 298 | { |
272 | return (major << 32) | (minor << 16) | subminor; | 299 | return (major << 32) | (minor << 16) | subminor; |
273 | } | 300 | } |
274 | 301 | ||
275 | struct mlx4_phys_caps { | 302 | struct mlx4_phys_caps { |
303 | u32 gid_phys_table_len[MLX4_MAX_PORTS + 1]; | ||
304 | u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1]; | ||
276 | u32 num_phys_eqs; | 305 | u32 num_phys_eqs; |
277 | }; | 306 | }; |
278 | 307 | ||
@@ -305,6 +334,8 @@ struct mlx4_caps { | |||
305 | int max_qp_init_rdma; | 334 | int max_qp_init_rdma; |
306 | int max_qp_dest_rdma; | 335 | int max_qp_dest_rdma; |
307 | int sqp_start; | 336 | int sqp_start; |
337 | u32 base_sqpn; | ||
338 | u32 base_tunnel_sqpn; | ||
308 | int num_srqs; | 339 | int num_srqs; |
309 | int max_srq_wqes; | 340 | int max_srq_wqes; |
310 | int max_srq_sge; | 341 | int max_srq_sge; |
@@ -547,6 +578,81 @@ struct mlx4_dev { | |||
547 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; | 578 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; |
548 | }; | 579 | }; |
549 | 580 | ||
581 | struct mlx4_eqe { | ||
582 | u8 reserved1; | ||
583 | u8 type; | ||
584 | u8 reserved2; | ||
585 | u8 subtype; | ||
586 | union { | ||
587 | u32 raw[6]; | ||
588 | struct { | ||
589 | __be32 cqn; | ||
590 | } __packed comp; | ||
591 | struct { | ||
592 | u16 reserved1; | ||
593 | __be16 token; | ||
594 | u32 reserved2; | ||
595 | u8 reserved3[3]; | ||
596 | u8 status; | ||
597 | __be64 out_param; | ||
598 | } __packed cmd; | ||
599 | struct { | ||
600 | __be32 qpn; | ||
601 | } __packed qp; | ||
602 | struct { | ||
603 | __be32 srqn; | ||
604 | } __packed srq; | ||
605 | struct { | ||
606 | __be32 cqn; | ||
607 | u32 reserved1; | ||
608 | u8 reserved2[3]; | ||
609 | u8 syndrome; | ||
610 | } __packed cq_err; | ||
611 | struct { | ||
612 | u32 reserved1[2]; | ||
613 | __be32 port; | ||
614 | } __packed port_change; | ||
615 | struct { | ||
616 | #define COMM_CHANNEL_BIT_ARRAY_SIZE 4 | ||
617 | u32 reserved; | ||
618 | u32 bit_vec[COMM_CHANNEL_BIT_ARRAY_SIZE]; | ||
619 | } __packed comm_channel_arm; | ||
620 | struct { | ||
621 | u8 port; | ||
622 | u8 reserved[3]; | ||
623 | __be64 mac; | ||
624 | } __packed mac_update; | ||
625 | struct { | ||
626 | __be32 slave_id; | ||
627 | } __packed flr_event; | ||
628 | struct { | ||
629 | __be16 current_temperature; | ||
630 | __be16 warning_threshold; | ||
631 | } __packed warming; | ||
632 | struct { | ||
633 | u8 reserved[3]; | ||
634 | u8 port; | ||
635 | union { | ||
636 | struct { | ||
637 | __be16 mstr_sm_lid; | ||
638 | __be16 port_lid; | ||
639 | __be32 changed_attr; | ||
640 | u8 reserved[3]; | ||
641 | u8 mstr_sm_sl; | ||
642 | __be64 gid_prefix; | ||
643 | } __packed port_info; | ||
644 | struct { | ||
645 | __be32 block_ptr; | ||
646 | __be32 tbl_entries_mask; | ||
647 | } __packed tbl_change_info; | ||
648 | } params; | ||
649 | } __packed port_mgmt_change; | ||
650 | } event; | ||
651 | u8 slave_id; | ||
652 | u8 reserved3[2]; | ||
653 | u8 owner; | ||
654 | } __packed; | ||
655 | |||
550 | struct mlx4_init_port_param { | 656 | struct mlx4_init_port_param { |
551 | int set_guid0; | 657 | int set_guid0; |
552 | int set_node_guid; | 658 | int set_node_guid; |
@@ -570,6 +676,15 @@ struct mlx4_init_port_param { | |||
570 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ | 676 | if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ |
571 | ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) | 677 | ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) |
572 | 678 | ||
679 | #define MLX4_INVALID_SLAVE_ID 0xFF | ||
680 | |||
681 | void handle_port_mgmt_change_event(struct work_struct *work); | ||
682 | |||
683 | static inline int mlx4_master_func_num(struct mlx4_dev *dev) | ||
684 | { | ||
685 | return dev->caps.function; | ||
686 | } | ||
687 | |||
573 | static inline int mlx4_is_master(struct mlx4_dev *dev) | 688 | static inline int mlx4_is_master(struct mlx4_dev *dev) |
574 | { | 689 | { |
575 | return dev->flags & MLX4_FLAG_MASTER; | 690 | return dev->flags & MLX4_FLAG_MASTER; |
@@ -799,4 +914,6 @@ int mlx4_flow_attach(struct mlx4_dev *dev, | |||
799 | struct mlx4_net_trans_rule *rule, u64 *reg_id); | 914 | struct mlx4_net_trans_rule *rule, u64 *reg_id); |
800 | int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); | 915 | int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); |
801 | 916 | ||
917 | int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); | ||
918 | |||
802 | #endif /* MLX4_DEVICE_H */ | 919 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 8dc485febc6b..d813704b963b 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -44,13 +44,14 @@ enum mlx4_dev_event { | |||
44 | MLX4_DEV_EVENT_PORT_UP, | 44 | MLX4_DEV_EVENT_PORT_UP, |
45 | MLX4_DEV_EVENT_PORT_DOWN, | 45 | MLX4_DEV_EVENT_PORT_DOWN, |
46 | MLX4_DEV_EVENT_PORT_REINIT, | 46 | MLX4_DEV_EVENT_PORT_REINIT, |
47 | MLX4_DEV_EVENT_PORT_MGMT_CHANGE, | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | struct mlx4_interface { | 50 | struct mlx4_interface { |
50 | void * (*add) (struct mlx4_dev *dev); | 51 | void * (*add) (struct mlx4_dev *dev); |
51 | void (*remove)(struct mlx4_dev *dev, void *context); | 52 | void (*remove)(struct mlx4_dev *dev, void *context); |
52 | void (*event) (struct mlx4_dev *dev, void *context, | 53 | void (*event) (struct mlx4_dev *dev, void *context, |
53 | enum mlx4_dev_event event, int port); | 54 | enum mlx4_dev_event event, unsigned long param); |
54 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | 55 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); |
55 | struct list_head list; | 56 | struct list_head list; |
56 | enum mlx4_protocol protocol; | 57 | enum mlx4_protocol protocol; |