aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:20:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:20:40 -0400
commit7a9a2970b5c1c2ce73d4bb84edaa7ebf13e0c841 (patch)
treebd4909abfcd759b376cfd2fab06281df366f6a0f /include/linux
parentfc47912d9cda50ae6bd9ca30e97e8c03de5b7b60 (diff)
parentd172f5a4ab151a952a0d898ba3b0ff6a020171a6 (diff)
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband updates from Roland Dreier: "First batch of InfiniBand/RDMA changes for the 3.7 merge window: - mlx4 IB support for SR-IOV - A couple of SRP initiator fixes - Batch of nes hardware driver fixes - Fix for long-standing use-after-free crash in IPoIB - Other miscellaneous fixes" This merge also removes a new use of __cancel_delayed_work(), and replaces it with the regular cancel_delayed_work() that is now irq-safe thanks to the workqueue updates. That said, I suspect the sequence in question should probably use "mod_delayed_work()". I just did the minimal "don't use deprecated functions" fixup, though. * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (45 commits) IB/qib: Fix local access validation for user MRs mlx4_core: Disable SENSE_PORT for multifunction devices mlx4_core: Clean up enabling of SENSE_PORT for older (ConnectX-1/-2) HCAs mlx4_core: Stash PCI ID driver_data in mlx4_priv structure IB/srp: Avoid having aborted requests hang IB/srp: Fix use-after-free in srp_reset_req() IB/qib: Add a qib driver version RDMA/nes: Fix compilation error when nes_debug is enabled RDMA/nes: Print hardware resource type RDMA/nes: Fix for crash when TX checksum offload is off RDMA/nes: Cosmetic changes RDMA/nes: Fix for incorrect MSS when TSO is on RDMA/nes: Fix incorrect resolving of the loopback MAC address mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem mlx4_core: Trivial cleanups to driver log messages mlx4_core: Trivial readability fix: "0X30" -> "0x30" IB/mlx4: Create paravirt contexts for VFs when master IB driver initializes mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations mlx4: Paravirtualize Node Guids for slaves mlx4: Activate SR-IOV mode for IB ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h69
-rw-r--r--include/linux/mlx4/driver.h2
-rw-r--r--include/linux/mlx4/qp.h3
3 files changed, 68 insertions, 6 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6e1b0f973a03..6d1acb04cd17 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -54,7 +54,13 @@ enum {
54}; 54};
55 55
56enum { 56enum {
57 MLX4_MAX_PORTS = 2 57 MLX4_PORT_CAP_IS_SM = 1 << 1,
58 MLX4_PORT_CAP_DEV_MGMT_SUP = 1 << 19,
59};
60
61enum {
62 MLX4_MAX_PORTS = 2,
63 MLX4_MAX_PORT_PKEYS = 128
58}; 64};
59 65
60/* base qkey for use in sriov tunnel-qp/proxy-qp communication. 66/* base qkey for use in sriov tunnel-qp/proxy-qp communication.
@@ -191,6 +197,25 @@ enum {
191 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0, 197 MLX4_FATAL_WARNING_SUBTYPE_WARMING = 0,
192}; 198};
193 199
200enum slave_port_state {
201 SLAVE_PORT_DOWN = 0,
202 SLAVE_PENDING_UP,
203 SLAVE_PORT_UP,
204};
205
206enum slave_port_gen_event {
207 SLAVE_PORT_GEN_EVENT_DOWN = 0,
208 SLAVE_PORT_GEN_EVENT_UP,
209 SLAVE_PORT_GEN_EVENT_NONE,
210};
211
212enum slave_port_state_event {
213 MLX4_PORT_STATE_DEV_EVENT_PORT_DOWN,
214 MLX4_PORT_STATE_DEV_EVENT_PORT_UP,
215 MLX4_PORT_STATE_IB_PORT_STATE_EVENT_GID_VALID,
216 MLX4_PORT_STATE_IB_EVENT_GID_INVALID,
217};
218
194enum { 219enum {
195 MLX4_PERM_LOCAL_READ = 1 << 10, 220 MLX4_PERM_LOCAL_READ = 1 << 10,
196 MLX4_PERM_LOCAL_WRITE = 1 << 11, 221 MLX4_PERM_LOCAL_WRITE = 1 << 11,
@@ -303,6 +328,9 @@ struct mlx4_phys_caps {
303 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1]; 328 u32 gid_phys_table_len[MLX4_MAX_PORTS + 1];
304 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1]; 329 u32 pkey_phys_table_len[MLX4_MAX_PORTS + 1];
305 u32 num_phys_eqs; 330 u32 num_phys_eqs;
331 u32 base_sqpn;
332 u32 base_proxy_sqpn;
333 u32 base_tunnel_sqpn;
306}; 334};
307 335
308struct mlx4_caps { 336struct mlx4_caps {
@@ -333,9 +361,10 @@ struct mlx4_caps {
333 int max_rq_desc_sz; 361 int max_rq_desc_sz;
334 int max_qp_init_rdma; 362 int max_qp_init_rdma;
335 int max_qp_dest_rdma; 363 int max_qp_dest_rdma;
336 int sqp_start; 364 u32 *qp0_proxy;
337 u32 base_sqpn; 365 u32 *qp1_proxy;
338 u32 base_tunnel_sqpn; 366 u32 *qp0_tunnel;
367 u32 *qp1_tunnel;
339 int num_srqs; 368 int num_srqs;
340 int max_srq_wqes; 369 int max_srq_wqes;
341 int max_srq_sge; 370 int max_srq_sge;
@@ -389,6 +418,7 @@ struct mlx4_caps {
389 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 418 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
390 u32 max_counters; 419 u32 max_counters;
391 u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; 420 u8 port_ib_mtu[MLX4_MAX_PORTS + 1];
421 u16 sqp_demux;
392}; 422};
393 423
394struct mlx4_buf_list { 424struct mlx4_buf_list {
@@ -671,6 +701,10 @@ struct mlx4_init_port_param {
671 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 701 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
672 if ((type) == (dev)->caps.port_mask[(port)]) 702 if ((type) == (dev)->caps.port_mask[(port)])
673 703
704#define mlx4_foreach_non_ib_transport_port(port, dev) \
705 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
706 if (((dev)->caps.port_mask[port] != MLX4_PORT_TYPE_IB))
707
674#define mlx4_foreach_ib_transport_port(port, dev) \ 708#define mlx4_foreach_ib_transport_port(port, dev) \
675 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 709 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
676 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \ 710 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
@@ -692,7 +726,18 @@ static inline int mlx4_is_master(struct mlx4_dev *dev)
692 726
693static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) 727static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn)
694{ 728{
695 return (qpn < dev->caps.sqp_start + 8); 729 return (qpn < dev->phys_caps.base_sqpn + 8 +
730 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev));
731}
732
733static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn)
734{
735 int guest_proxy_base = dev->phys_caps.base_proxy_sqpn + slave * 8;
736
737 if (qpn >= guest_proxy_base && qpn < guest_proxy_base + 8)
738 return 1;
739
740 return 0;
696} 741}
697 742
698static inline int mlx4_is_mfunc(struct mlx4_dev *dev) 743static inline int mlx4_is_mfunc(struct mlx4_dev *dev)
@@ -927,6 +972,20 @@ int mlx4_flow_attach(struct mlx4_dev *dev,
927 struct mlx4_net_trans_rule *rule, u64 *reg_id); 972 struct mlx4_net_trans_rule *rule, u64 *reg_id);
928int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); 973int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id);
929 974
975void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port,
976 int i, int val);
977
930int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey); 978int mlx4_get_parav_qkey(struct mlx4_dev *dev, u32 qpn, u32 *qkey);
931 979
980int mlx4_is_slave_active(struct mlx4_dev *dev, int slave);
981int mlx4_gen_pkey_eqe(struct mlx4_dev *dev, int slave, u8 port);
982int mlx4_gen_guid_change_eqe(struct mlx4_dev *dev, int slave, u8 port);
983int mlx4_gen_slaves_port_mgt_ev(struct mlx4_dev *dev, u8 port, int attr);
984int mlx4_gen_port_state_change_eqe(struct mlx4_dev *dev, int slave, u8 port, u8 port_subtype_change);
985enum slave_port_state mlx4_get_slave_port_state(struct mlx4_dev *dev, int slave, u8 port);
986int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int event, enum slave_port_gen_event *gen_event);
987
988void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
989__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
990
932#endif /* MLX4_DEVICE_H */ 991#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index d813704b963b..c257e1b211be 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -45,6 +45,8 @@ enum mlx4_dev_event {
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 MLX4_DEV_EVENT_PORT_MGMT_CHANGE,
48 MLX4_DEV_EVENT_SLAVE_INIT,
49 MLX4_DEV_EVENT_SLAVE_SHUTDOWN,
48}; 50};
49 51
50struct mlx4_interface { 52struct mlx4_interface {
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 338388ba260a..4b4ad6ffef92 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -126,7 +126,8 @@ struct mlx4_rss_context {
126 126
127struct mlx4_qp_path { 127struct mlx4_qp_path {
128 u8 fl; 128 u8 fl;
129 u8 reserved1[2]; 129 u8 reserved1[1];
130 u8 disable_pkey_check;
130 u8 pkey_index; 131 u8 pkey_index;
131 u8 counter_index; 132 u8 counter_index;
132 u8 grh_mylmc; 133 u8 grh_mylmc;