aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/mlx4_ib.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/mlx4/mlx4_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx4/mlx4_ib.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index 3486d7675e5..2a322f21049 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -112,6 +112,13 @@ enum mlx4_ib_qp_flags {
112 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK = 1 << 1, 112 MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK = 1 << 1,
113}; 113};
114 114
115struct mlx4_ib_gid_entry {
116 struct list_head list;
117 union ib_gid gid;
118 int added;
119 u8 port;
120};
121
115struct mlx4_ib_qp { 122struct mlx4_ib_qp {
116 struct ib_qp ibqp; 123 struct ib_qp ibqp;
117 struct mlx4_qp mqp; 124 struct mlx4_qp mqp;
@@ -138,6 +145,8 @@ struct mlx4_ib_qp {
138 u8 resp_depth; 145 u8 resp_depth;
139 u8 sq_no_prefetch; 146 u8 sq_no_prefetch;
140 u8 state; 147 u8 state;
148 int mlx_type;
149 struct list_head gid_list;
141}; 150};
142 151
143struct mlx4_ib_srq { 152struct mlx4_ib_srq {
@@ -157,7 +166,14 @@ struct mlx4_ib_srq {
157 166
158struct mlx4_ib_ah { 167struct mlx4_ib_ah {
159 struct ib_ah ibah; 168 struct ib_ah ibah;
160 struct mlx4_av av; 169 union mlx4_ext_av av;
170};
171
172struct mlx4_ib_iboe {
173 spinlock_t lock;
174 struct net_device *netdevs[MLX4_MAX_PORTS];
175 struct notifier_block nb;
176 union ib_gid gid_table[MLX4_MAX_PORTS][128];
161}; 177};
162 178
163struct mlx4_ib_dev { 179struct mlx4_ib_dev {
@@ -176,6 +192,7 @@ struct mlx4_ib_dev {
176 192
177 struct mutex cap_mask_mutex; 193 struct mutex cap_mask_mutex;
178 bool ib_active; 194 bool ib_active;
195 struct mlx4_ib_iboe iboe;
179}; 196};
180 197
181static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev) 198static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev)
@@ -314,9 +331,20 @@ int mlx4_ib_map_phys_fmr(struct ib_fmr *ibfmr, u64 *page_list, int npages,
314int mlx4_ib_unmap_fmr(struct list_head *fmr_list); 331int mlx4_ib_unmap_fmr(struct list_head *fmr_list);
315int mlx4_ib_fmr_dealloc(struct ib_fmr *fmr); 332int mlx4_ib_fmr_dealloc(struct ib_fmr *fmr);
316 333
334int mlx4_ib_resolve_grh(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah_attr,
335 u8 *mac, int *is_mcast, u8 port);
336
317static inline int mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah) 337static inline int mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah)
318{ 338{
319 return !!(ah->av.g_slid & 0x80); 339 u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3;
340
341 if (rdma_port_get_link_layer(ah->ibah.device, port) == IB_LINK_LAYER_ETHERNET)
342 return 1;
343
344 return !!(ah->av.ib.g_slid & 0x80);
320} 345}
321 346
347int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp,
348 union ib_gid *gid);
349
322#endif /* MLX4_IB_H */ 350#endif /* MLX4_IB_H */