aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 11:16:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 11:16:03 -0400
commit724bdd097e4d47b6ad963db5d92258ab5c485e05 (patch)
treef9d2de5f826780aa04532a89c3b67a01ae413f7d /include
parentdc8dcad83b53e3aebc52889e81772c00a1490408 (diff)
parent56f2fdaade2a6b91ccd785de938b91172d5c94f2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/ehca: Reject dynamic memory add/remove when ehca adapter is present IB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter IPoIB: Set netdev offload features properly for child (VLAN) interfaces IPoIB: Clean up ethtool support mlx4_core: Add Ethernet PCI device IDs mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC mlx4_core: Multiple port type support mlx4_core: Ethernet MAC/VLAN management mlx4_core: Get ethernet MTU and default address from firmware mlx4_core: Support multiple pre-reserved QP regions Update NetEffect maintainer emails to Intel emails RDMA/cxgb3: Remove cmid reference on tid allocation failures IB/mad: Use krealloc() to resize snoop table IPoIB: Always initialize poll_timer to avoid crash on unload IB/ehca: Don't allow creating UC QP with SRQ mlx4_core: Add QP range reservation support RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR()
Diffstat (limited to 'include')
-rw-r--r--include/linux/mlx4/cmd.h9
-rw-r--r--include/linux/mlx4/device.h54
2 files changed, 60 insertions, 3 deletions
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 77323a72dd3c..cf9c679ab38b 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -132,6 +132,15 @@ enum {
132 MLX4_MAILBOX_SIZE = 4096 132 MLX4_MAILBOX_SIZE = 4096
133}; 133};
134 134
135enum {
136 /* set port opcode modifiers */
137 MLX4_SET_PORT_GENERAL = 0x0,
138 MLX4_SET_PORT_RQP_CALC = 0x1,
139 MLX4_SET_PORT_MAC_TABLE = 0x2,
140 MLX4_SET_PORT_VLAN_TABLE = 0x3,
141 MLX4_SET_PORT_PRIO_MAP = 0x4,
142};
143
135struct mlx4_dev; 144struct mlx4_dev;
136 145
137struct mlx4_cmd_mailbox { 146struct mlx4_cmd_mailbox {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index b2f944468313..bd9977b89490 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -60,6 +60,7 @@ enum {
60 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, 60 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7,
61 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, 61 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8,
62 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, 62 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9,
63 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12,
63 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, 64 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16,
64 MLX4_DEV_CAP_FLAG_APM = 1 << 17, 65 MLX4_DEV_CAP_FLAG_APM = 1 << 17,
65 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 66 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18,
@@ -145,6 +146,29 @@ enum {
145 MLX4_MTT_FLAG_PRESENT = 1 146 MLX4_MTT_FLAG_PRESENT = 1
146}; 147};
147 148
149enum mlx4_qp_region {
150 MLX4_QP_REGION_FW = 0,
151 MLX4_QP_REGION_ETH_ADDR,
152 MLX4_QP_REGION_FC_ADDR,
153 MLX4_QP_REGION_FC_EXCH,
154 MLX4_NUM_QP_REGION
155};
156
157enum mlx4_port_type {
158 MLX4_PORT_TYPE_IB = 1 << 0,
159 MLX4_PORT_TYPE_ETH = 1 << 1,
160};
161
162enum mlx4_special_vlan_idx {
163 MLX4_NO_VLAN_IDX = 0,
164 MLX4_VLAN_MISS_IDX,
165 MLX4_VLAN_REGULAR
166};
167
168enum {
169 MLX4_NUM_FEXCH = 64 * 1024,
170};
171
148static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 172static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
149{ 173{
150 return (major << 32) | (minor << 16) | subminor; 174 return (major << 32) | (minor << 16) | subminor;
@@ -154,7 +178,9 @@ struct mlx4_caps {
154 u64 fw_ver; 178 u64 fw_ver;
155 int num_ports; 179 int num_ports;
156 int vl_cap[MLX4_MAX_PORTS + 1]; 180 int vl_cap[MLX4_MAX_PORTS + 1];
157 int mtu_cap[MLX4_MAX_PORTS + 1]; 181 int ib_mtu_cap[MLX4_MAX_PORTS + 1];
182 u64 def_mac[MLX4_MAX_PORTS + 1];
183 int eth_mtu_cap[MLX4_MAX_PORTS + 1];
158 int gid_table_len[MLX4_MAX_PORTS + 1]; 184 int gid_table_len[MLX4_MAX_PORTS + 1];
159 int pkey_table_len[MLX4_MAX_PORTS + 1]; 185 int pkey_table_len[MLX4_MAX_PORTS + 1];
160 int local_ca_ack_delay; 186 int local_ca_ack_delay;
@@ -169,7 +195,6 @@ struct mlx4_caps {
169 int max_rq_desc_sz; 195 int max_rq_desc_sz;
170 int max_qp_init_rdma; 196 int max_qp_init_rdma;
171 int max_qp_dest_rdma; 197 int max_qp_dest_rdma;
172 int reserved_qps;
173 int sqp_start; 198 int sqp_start;
174 int num_srqs; 199 int num_srqs;
175 int max_srq_wqes; 200 int max_srq_wqes;
@@ -201,6 +226,15 @@ struct mlx4_caps {
201 u16 stat_rate_support; 226 u16 stat_rate_support;
202 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 227 u8 port_width_cap[MLX4_MAX_PORTS + 1];
203 int max_gso_sz; 228 int max_gso_sz;
229 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
230 int reserved_qps;
231 int reserved_qps_base[MLX4_NUM_QP_REGION];
232 int log_num_macs;
233 int log_num_vlans;
234 int log_num_prios;
235 enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1];
236 u8 supported_type[MLX4_MAX_PORTS + 1];
237 u32 port_mask;
204}; 238};
205 239
206struct mlx4_buf_list { 240struct mlx4_buf_list {
@@ -355,6 +389,11 @@ struct mlx4_init_port_param {
355 u64 si_guid; 389 u64 si_guid;
356}; 390};
357 391
392#define mlx4_foreach_port(port, dev, type) \
393 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
394 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \
395 ~(dev)->caps.port_mask) & 1 << ((port) - 1))
396
358int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, 397int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
359 struct mlx4_buf *buf); 398 struct mlx4_buf *buf);
360void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); 399void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
@@ -400,7 +439,10 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt,
400 int collapsed); 439 int collapsed);
401void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); 440void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq);
402 441
403int mlx4_qp_alloc(struct mlx4_dev *dev, int sqpn, struct mlx4_qp *qp); 442int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base);
443void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt);
444
445int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp);
404void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); 446void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp);
405 447
406int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, 448int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt,
@@ -416,6 +458,12 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
416 int block_mcast_loopback); 458 int block_mcast_loopback);
417int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); 459int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);
418 460
461int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
462void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
463
464int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
465void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
466
419int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list, 467int mlx4_map_phys_fmr(struct mlx4_dev *dev, struct mlx4_fmr *fmr, u64 *page_list,
420 int npages, u64 iova, u32 *lkey, u32 *rkey); 468 int npages, u64 iova, u32 *lkey, u32 *rkey);
421int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages, 469int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,