diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mlx4/cmd.h | 2 | ||||
-rw-r--r-- | include/linux/mlx4/device.h | 35 | ||||
-rw-r--r-- | include/linux/mlx4/driver.h | 9 | ||||
-rw-r--r-- | include/linux/mlx4/qp.h | 9 | ||||
-rw-r--r-- | include/rdma/ib_addr.h | 134 | ||||
-rw-r--r-- | include/rdma/ib_pack.h | 39 | ||||
-rw-r--r-- | include/rdma/ib_user_verbs.h | 3 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 11 | ||||
-rw-r--r-- | include/scsi/srp.h | 38 |
9 files changed, 266 insertions, 14 deletions
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 78a1b9671752..9a18667c13cc 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
@@ -58,6 +58,7 @@ enum { | |||
58 | MLX4_CMD_SENSE_PORT = 0x4d, | 58 | MLX4_CMD_SENSE_PORT = 0x4d, |
59 | MLX4_CMD_HW_HEALTH_CHECK = 0x50, | 59 | MLX4_CMD_HW_HEALTH_CHECK = 0x50, |
60 | MLX4_CMD_SET_PORT = 0xc, | 60 | MLX4_CMD_SET_PORT = 0xc, |
61 | MLX4_CMD_SET_NODE = 0x5a, | ||
61 | MLX4_CMD_ACCESS_DDR = 0x2e, | 62 | MLX4_CMD_ACCESS_DDR = 0x2e, |
62 | MLX4_CMD_MAP_ICM = 0xffa, | 63 | MLX4_CMD_MAP_ICM = 0xffa, |
63 | MLX4_CMD_UNMAP_ICM = 0xff9, | 64 | MLX4_CMD_UNMAP_ICM = 0xff9, |
@@ -141,6 +142,7 @@ enum { | |||
141 | MLX4_SET_PORT_MAC_TABLE = 0x2, | 142 | MLX4_SET_PORT_MAC_TABLE = 0x2, |
142 | MLX4_SET_PORT_VLAN_TABLE = 0x3, | 143 | MLX4_SET_PORT_VLAN_TABLE = 0x3, |
143 | MLX4_SET_PORT_PRIO_MAP = 0x4, | 144 | MLX4_SET_PORT_PRIO_MAP = 0x4, |
145 | MLX4_SET_PORT_GID_TABLE = 0x5, | ||
144 | }; | 146 | }; |
145 | 147 | ||
146 | struct mlx4_dev; | 148 | struct mlx4_dev; |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 7338654c02b4..a7b15bc7648e 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -67,7 +67,8 @@ enum { | |||
67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | 67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, |
68 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, | 68 | MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, |
69 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, | 69 | MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, |
70 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 | 70 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, |
71 | MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | enum { | 74 | enum { |
@@ -171,6 +172,10 @@ enum { | |||
171 | MLX4_NUM_FEXCH = 64 * 1024, | 172 | MLX4_NUM_FEXCH = 64 * 1024, |
172 | }; | 173 | }; |
173 | 174 | ||
175 | enum { | ||
176 | MLX4_MAX_FAST_REG_PAGES = 511, | ||
177 | }; | ||
178 | |||
174 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 179 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
175 | { | 180 | { |
176 | return (major << 32) | (minor << 16) | subminor; | 181 | return (major << 32) | (minor << 16) | subminor; |
@@ -379,6 +384,27 @@ struct mlx4_av { | |||
379 | u8 dgid[16]; | 384 | u8 dgid[16]; |
380 | }; | 385 | }; |
381 | 386 | ||
387 | struct mlx4_eth_av { | ||
388 | __be32 port_pd; | ||
389 | u8 reserved1; | ||
390 | u8 smac_idx; | ||
391 | u16 reserved2; | ||
392 | u8 reserved3; | ||
393 | u8 gid_index; | ||
394 | u8 stat_rate; | ||
395 | u8 hop_limit; | ||
396 | __be32 sl_tclass_flowlabel; | ||
397 | u8 dgid[16]; | ||
398 | u32 reserved4[2]; | ||
399 | __be16 vlan; | ||
400 | u8 mac[6]; | ||
401 | }; | ||
402 | |||
403 | union mlx4_ext_av { | ||
404 | struct mlx4_av ib; | ||
405 | struct mlx4_eth_av eth; | ||
406 | }; | ||
407 | |||
382 | struct mlx4_dev { | 408 | struct mlx4_dev { |
383 | struct pci_dev *pdev; | 409 | struct pci_dev *pdev; |
384 | unsigned long flags; | 410 | unsigned long flags; |
@@ -407,6 +433,12 @@ struct mlx4_init_port_param { | |||
407 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ | 433 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ |
408 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) | 434 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) |
409 | 435 | ||
436 | #define mlx4_foreach_ib_transport_port(port, dev) \ | ||
437 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | ||
438 | if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \ | ||
439 | ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) | ||
440 | |||
441 | |||
410 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, | 442 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, |
411 | struct mlx4_buf *buf); | 443 | struct mlx4_buf *buf); |
412 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); | 444 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); |
@@ -474,6 +506,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]); | |||
474 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); | 506 | int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); |
475 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); | 507 | void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); |
476 | 508 | ||
509 | int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); | ||
477 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); | 510 | int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); |
478 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); | 511 | void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); |
479 | 512 | ||
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 53c5fdb6eac4..f407cd4bfb34 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
@@ -44,15 +44,24 @@ enum mlx4_dev_event { | |||
44 | MLX4_DEV_EVENT_PORT_REINIT, | 44 | MLX4_DEV_EVENT_PORT_REINIT, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | enum mlx4_protocol { | ||
48 | MLX4_PROTOCOL_IB, | ||
49 | MLX4_PROTOCOL_EN, | ||
50 | }; | ||
51 | |||
47 | struct mlx4_interface { | 52 | struct mlx4_interface { |
48 | void * (*add) (struct mlx4_dev *dev); | 53 | void * (*add) (struct mlx4_dev *dev); |
49 | void (*remove)(struct mlx4_dev *dev, void *context); | 54 | void (*remove)(struct mlx4_dev *dev, void *context); |
50 | void (*event) (struct mlx4_dev *dev, void *context, | 55 | void (*event) (struct mlx4_dev *dev, void *context, |
51 | enum mlx4_dev_event event, int port); | 56 | enum mlx4_dev_event event, int port); |
57 | void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); | ||
52 | struct list_head list; | 58 | struct list_head list; |
59 | enum mlx4_protocol protocol; | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | int mlx4_register_interface(struct mlx4_interface *intf); | 62 | int mlx4_register_interface(struct mlx4_interface *intf); |
56 | void mlx4_unregister_interface(struct mlx4_interface *intf); | 63 | void mlx4_unregister_interface(struct mlx4_interface *intf); |
57 | 64 | ||
65 | void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); | ||
66 | |||
58 | #endif /* MLX4_DRIVER_H */ | 67 | #endif /* MLX4_DRIVER_H */ |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 7abe64326f72..0eeb2a1a867c 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -109,10 +109,11 @@ struct mlx4_qp_path { | |||
109 | __be32 tclass_flowlabel; | 109 | __be32 tclass_flowlabel; |
110 | u8 rgid[16]; | 110 | u8 rgid[16]; |
111 | u8 sched_queue; | 111 | u8 sched_queue; |
112 | u8 snooper_flags; | 112 | u8 vlan_index; |
113 | u8 reserved3[2]; | 113 | u8 reserved3[2]; |
114 | u8 counter_index; | 114 | u8 counter_index; |
115 | u8 reserved4[7]; | 115 | u8 reserved4; |
116 | u8 dmac[6]; | ||
116 | }; | 117 | }; |
117 | 118 | ||
118 | struct mlx4_qp_context { | 119 | struct mlx4_qp_context { |
@@ -166,6 +167,7 @@ enum { | |||
166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, | 167 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, |
167 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, | 168 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, |
168 | MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, | 169 | MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, |
170 | MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0, | ||
169 | }; | 171 | }; |
170 | 172 | ||
171 | struct mlx4_wqe_ctrl_seg { | 173 | struct mlx4_wqe_ctrl_seg { |
@@ -219,7 +221,8 @@ struct mlx4_wqe_datagram_seg { | |||
219 | __be32 av[8]; | 221 | __be32 av[8]; |
220 | __be32 dqpn; | 222 | __be32 dqpn; |
221 | __be32 qkey; | 223 | __be32 qkey; |
222 | __be32 reservd[2]; | 224 | __be16 vlan; |
225 | u8 mac[6]; | ||
223 | }; | 226 | }; |
224 | 227 | ||
225 | struct mlx4_wqe_lso_seg { | 228 | struct mlx4_wqe_lso_seg { |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index fa0d52b8e622..b5fc9f39122b 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -39,7 +39,9 @@ | |||
39 | #include <linux/if_arp.h> | 39 | #include <linux/if_arp.h> |
40 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
41 | #include <linux/socket.h> | 41 | #include <linux/socket.h> |
42 | #include <linux/if_vlan.h> | ||
42 | #include <rdma/ib_verbs.h> | 43 | #include <rdma/ib_verbs.h> |
44 | #include <rdma/ib_pack.h> | ||
43 | 45 | ||
44 | struct rdma_addr_client { | 46 | struct rdma_addr_client { |
45 | atomic_t refcount; | 47 | atomic_t refcount; |
@@ -63,6 +65,7 @@ struct rdma_dev_addr { | |||
63 | unsigned char broadcast[MAX_ADDR_LEN]; | 65 | unsigned char broadcast[MAX_ADDR_LEN]; |
64 | unsigned short dev_type; | 66 | unsigned short dev_type; |
65 | int bound_dev_if; | 67 | int bound_dev_if; |
68 | enum rdma_transport_type transport; | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | /** | 71 | /** |
@@ -127,9 +130,51 @@ static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr) | |||
127 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; | 130 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; |
128 | } | 131 | } |
129 | 132 | ||
133 | static inline void iboe_mac_vlan_to_ll(union ib_gid *gid, u8 *mac, u16 vid) | ||
134 | { | ||
135 | memset(gid->raw, 0, 16); | ||
136 | *((__be32 *) gid->raw) = cpu_to_be32(0xfe800000); | ||
137 | if (vid < 0x1000) { | ||
138 | gid->raw[12] = vid & 0xff; | ||
139 | gid->raw[11] = vid >> 8; | ||
140 | } else { | ||
141 | gid->raw[12] = 0xfe; | ||
142 | gid->raw[11] = 0xff; | ||
143 | } | ||
144 | memcpy(gid->raw + 13, mac + 3, 3); | ||
145 | memcpy(gid->raw + 8, mac, 3); | ||
146 | gid->raw[8] ^= 2; | ||
147 | } | ||
148 | |||
149 | static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev) | ||
150 | { | ||
151 | return dev->priv_flags & IFF_802_1Q_VLAN ? | ||
152 | vlan_dev_vlan_id(dev) : 0xffff; | ||
153 | } | ||
154 | |||
155 | static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, | ||
156 | union ib_gid *gid) | ||
157 | { | ||
158 | struct net_device *dev; | ||
159 | u16 vid = 0xffff; | ||
160 | |||
161 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); | ||
162 | if (dev) { | ||
163 | vid = rdma_vlan_dev_vlan_id(dev); | ||
164 | dev_put(dev); | ||
165 | } | ||
166 | |||
167 | iboe_mac_vlan_to_ll(gid, dev_addr->src_dev_addr, vid); | ||
168 | } | ||
169 | |||
130 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) | 170 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
131 | { | 171 | { |
132 | memcpy(gid, dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); | 172 | if (dev_addr->transport == RDMA_TRANSPORT_IB && |
173 | dev_addr->dev_type != ARPHRD_INFINIBAND) | ||
174 | iboe_addr_get_sgid(dev_addr, gid); | ||
175 | else | ||
176 | memcpy(gid, dev_addr->src_dev_addr + | ||
177 | rdma_addr_gid_offset(dev_addr), sizeof *gid); | ||
133 | } | 178 | } |
134 | 179 | ||
135 | static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) | 180 | static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
@@ -147,4 +192,91 @@ static inline void rdma_addr_set_dgid(struct rdma_dev_addr *dev_addr, union ib_g | |||
147 | memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); | 192 | memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); |
148 | } | 193 | } |
149 | 194 | ||
195 | static inline enum ib_mtu iboe_get_mtu(int mtu) | ||
196 | { | ||
197 | /* | ||
198 | * reduce IB headers from effective IBoE MTU. 28 stands for | ||
199 | * atomic header which is the biggest possible header after BTH | ||
200 | */ | ||
201 | mtu = mtu - IB_GRH_BYTES - IB_BTH_BYTES - 28; | ||
202 | |||
203 | if (mtu >= ib_mtu_enum_to_int(IB_MTU_4096)) | ||
204 | return IB_MTU_4096; | ||
205 | else if (mtu >= ib_mtu_enum_to_int(IB_MTU_2048)) | ||
206 | return IB_MTU_2048; | ||
207 | else if (mtu >= ib_mtu_enum_to_int(IB_MTU_1024)) | ||
208 | return IB_MTU_1024; | ||
209 | else if (mtu >= ib_mtu_enum_to_int(IB_MTU_512)) | ||
210 | return IB_MTU_512; | ||
211 | else if (mtu >= ib_mtu_enum_to_int(IB_MTU_256)) | ||
212 | return IB_MTU_256; | ||
213 | else | ||
214 | return 0; | ||
215 | } | ||
216 | |||
217 | static inline int iboe_get_rate(struct net_device *dev) | ||
218 | { | ||
219 | struct ethtool_cmd cmd; | ||
220 | |||
221 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings || | ||
222 | dev->ethtool_ops->get_settings(dev, &cmd)) | ||
223 | return IB_RATE_PORT_CURRENT; | ||
224 | |||
225 | if (cmd.speed >= 40000) | ||
226 | return IB_RATE_40_GBPS; | ||
227 | else if (cmd.speed >= 30000) | ||
228 | return IB_RATE_30_GBPS; | ||
229 | else if (cmd.speed >= 20000) | ||
230 | return IB_RATE_20_GBPS; | ||
231 | else if (cmd.speed >= 10000) | ||
232 | return IB_RATE_10_GBPS; | ||
233 | else | ||
234 | return IB_RATE_PORT_CURRENT; | ||
235 | } | ||
236 | |||
237 | static inline int rdma_link_local_addr(struct in6_addr *addr) | ||
238 | { | ||
239 | if (addr->s6_addr32[0] == htonl(0xfe800000) && | ||
240 | addr->s6_addr32[1] == 0) | ||
241 | return 1; | ||
242 | |||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static inline void rdma_get_ll_mac(struct in6_addr *addr, u8 *mac) | ||
247 | { | ||
248 | memcpy(mac, &addr->s6_addr[8], 3); | ||
249 | memcpy(mac + 3, &addr->s6_addr[13], 3); | ||
250 | mac[0] ^= 2; | ||
251 | } | ||
252 | |||
253 | static inline int rdma_is_multicast_addr(struct in6_addr *addr) | ||
254 | { | ||
255 | return addr->s6_addr[0] == 0xff; | ||
256 | } | ||
257 | |||
258 | static inline void rdma_get_mcast_mac(struct in6_addr *addr, u8 *mac) | ||
259 | { | ||
260 | int i; | ||
261 | |||
262 | mac[0] = 0x33; | ||
263 | mac[1] = 0x33; | ||
264 | for (i = 2; i < 6; ++i) | ||
265 | mac[i] = addr->s6_addr[i + 10]; | ||
266 | } | ||
267 | |||
268 | static inline u16 rdma_get_vlan_id(union ib_gid *dgid) | ||
269 | { | ||
270 | u16 vid; | ||
271 | |||
272 | vid = dgid->raw[11] << 8 | dgid->raw[12]; | ||
273 | return vid < 0x1000 ? vid : 0xffff; | ||
274 | } | ||
275 | |||
276 | static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev) | ||
277 | { | ||
278 | return dev->priv_flags & IFF_802_1Q_VLAN ? | ||
279 | vlan_dev_real_dev(dev) : 0; | ||
280 | } | ||
281 | |||
150 | #endif /* IB_ADDR_H */ | 282 | #endif /* IB_ADDR_H */ |
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h index cbb50f4da3dd..b37fe3b10a9d 100644 --- a/include/rdma/ib_pack.h +++ b/include/rdma/ib_pack.h | |||
@@ -37,6 +37,8 @@ | |||
37 | 37 | ||
38 | enum { | 38 | enum { |
39 | IB_LRH_BYTES = 8, | 39 | IB_LRH_BYTES = 8, |
40 | IB_ETH_BYTES = 14, | ||
41 | IB_VLAN_BYTES = 4, | ||
40 | IB_GRH_BYTES = 40, | 42 | IB_GRH_BYTES = 40, |
41 | IB_BTH_BYTES = 12, | 43 | IB_BTH_BYTES = 12, |
42 | IB_DETH_BYTES = 8 | 44 | IB_DETH_BYTES = 8 |
@@ -210,14 +212,32 @@ struct ib_unpacked_deth { | |||
210 | __be32 source_qpn; | 212 | __be32 source_qpn; |
211 | }; | 213 | }; |
212 | 214 | ||
215 | struct ib_unpacked_eth { | ||
216 | u8 dmac_h[4]; | ||
217 | u8 dmac_l[2]; | ||
218 | u8 smac_h[2]; | ||
219 | u8 smac_l[4]; | ||
220 | __be16 type; | ||
221 | }; | ||
222 | |||
223 | struct ib_unpacked_vlan { | ||
224 | __be16 tag; | ||
225 | __be16 type; | ||
226 | }; | ||
227 | |||
213 | struct ib_ud_header { | 228 | struct ib_ud_header { |
229 | int lrh_present; | ||
214 | struct ib_unpacked_lrh lrh; | 230 | struct ib_unpacked_lrh lrh; |
215 | int grh_present; | 231 | int eth_present; |
216 | struct ib_unpacked_grh grh; | 232 | struct ib_unpacked_eth eth; |
217 | struct ib_unpacked_bth bth; | 233 | int vlan_present; |
234 | struct ib_unpacked_vlan vlan; | ||
235 | int grh_present; | ||
236 | struct ib_unpacked_grh grh; | ||
237 | struct ib_unpacked_bth bth; | ||
218 | struct ib_unpacked_deth deth; | 238 | struct ib_unpacked_deth deth; |
219 | int immediate_present; | 239 | int immediate_present; |
220 | __be32 immediate_data; | 240 | __be32 immediate_data; |
221 | }; | 241 | }; |
222 | 242 | ||
223 | void ib_pack(const struct ib_field *desc, | 243 | void ib_pack(const struct ib_field *desc, |
@@ -230,9 +250,12 @@ void ib_unpack(const struct ib_field *desc, | |||
230 | void *buf, | 250 | void *buf, |
231 | void *structure); | 251 | void *structure); |
232 | 252 | ||
233 | void ib_ud_header_init(int payload_bytes, | 253 | void ib_ud_header_init(int payload_bytes, |
234 | int grh_present, | 254 | int lrh_present, |
235 | int immediate_present, | 255 | int eth_present, |
256 | int vlan_present, | ||
257 | int grh_present, | ||
258 | int immediate_present, | ||
236 | struct ib_ud_header *header); | 259 | struct ib_ud_header *header); |
237 | 260 | ||
238 | int ib_ud_header_pack(struct ib_ud_header *header, | 261 | int ib_ud_header_pack(struct ib_ud_header *header, |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index a17f77106149..fe5b05177a2c 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -205,7 +205,8 @@ struct ib_uverbs_query_port_resp { | |||
205 | __u8 active_width; | 205 | __u8 active_width; |
206 | __u8 active_speed; | 206 | __u8 active_speed; |
207 | __u8 phys_state; | 207 | __u8 phys_state; |
208 | __u8 reserved[3]; | 208 | __u8 link_layer; |
209 | __u8 reserved[2]; | ||
209 | }; | 210 | }; |
210 | 211 | ||
211 | struct ib_uverbs_alloc_pd { | 212 | struct ib_uverbs_alloc_pd { |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 857b3b9cf120..e04c4888d1fd 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -75,6 +75,12 @@ enum rdma_transport_type { | |||
75 | enum rdma_transport_type | 75 | enum rdma_transport_type |
76 | rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__; | 76 | rdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__; |
77 | 77 | ||
78 | enum rdma_link_layer { | ||
79 | IB_LINK_LAYER_UNSPECIFIED, | ||
80 | IB_LINK_LAYER_INFINIBAND, | ||
81 | IB_LINK_LAYER_ETHERNET, | ||
82 | }; | ||
83 | |||
78 | enum ib_device_cap_flags { | 84 | enum ib_device_cap_flags { |
79 | IB_DEVICE_RESIZE_MAX_WR = 1, | 85 | IB_DEVICE_RESIZE_MAX_WR = 1, |
80 | IB_DEVICE_BAD_PKEY_CNTR = (1<<1), | 86 | IB_DEVICE_BAD_PKEY_CNTR = (1<<1), |
@@ -1010,6 +1016,8 @@ struct ib_device { | |||
1010 | int (*query_port)(struct ib_device *device, | 1016 | int (*query_port)(struct ib_device *device, |
1011 | u8 port_num, | 1017 | u8 port_num, |
1012 | struct ib_port_attr *port_attr); | 1018 | struct ib_port_attr *port_attr); |
1019 | enum rdma_link_layer (*get_link_layer)(struct ib_device *device, | ||
1020 | u8 port_num); | ||
1013 | int (*query_gid)(struct ib_device *device, | 1021 | int (*query_gid)(struct ib_device *device, |
1014 | u8 port_num, int index, | 1022 | u8 port_num, int index, |
1015 | union ib_gid *gid); | 1023 | union ib_gid *gid); |
@@ -1222,6 +1230,9 @@ int ib_query_device(struct ib_device *device, | |||
1222 | int ib_query_port(struct ib_device *device, | 1230 | int ib_query_port(struct ib_device *device, |
1223 | u8 port_num, struct ib_port_attr *port_attr); | 1231 | u8 port_num, struct ib_port_attr *port_attr); |
1224 | 1232 | ||
1233 | enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, | ||
1234 | u8 port_num); | ||
1235 | |||
1225 | int ib_query_gid(struct ib_device *device, | 1236 | int ib_query_gid(struct ib_device *device, |
1226 | u8 port_num, int index, union ib_gid *gid); | 1237 | u8 port_num, int index, union ib_gid *gid); |
1227 | 1238 | ||
diff --git a/include/scsi/srp.h b/include/scsi/srp.h index ad178fa78f66..1ae84db4c9fb 100644 --- a/include/scsi/srp.h +++ b/include/scsi/srp.h | |||
@@ -239,4 +239,42 @@ struct srp_rsp { | |||
239 | u8 data[0]; | 239 | u8 data[0]; |
240 | } __attribute__((packed)); | 240 | } __attribute__((packed)); |
241 | 241 | ||
242 | struct srp_cred_req { | ||
243 | u8 opcode; | ||
244 | u8 sol_not; | ||
245 | u8 reserved[2]; | ||
246 | __be32 req_lim_delta; | ||
247 | u64 tag; | ||
248 | }; | ||
249 | |||
250 | struct srp_cred_rsp { | ||
251 | u8 opcode; | ||
252 | u8 reserved[7]; | ||
253 | u64 tag; | ||
254 | }; | ||
255 | |||
256 | /* | ||
257 | * The SRP spec defines the fixed portion of the AER_REQ structure to be | ||
258 | * 36 bytes, so it needs to be packed to avoid having it padded to 40 bytes | ||
259 | * on 64-bit architectures. | ||
260 | */ | ||
261 | struct srp_aer_req { | ||
262 | u8 opcode; | ||
263 | u8 sol_not; | ||
264 | u8 reserved[2]; | ||
265 | __be32 req_lim_delta; | ||
266 | u64 tag; | ||
267 | u32 reserved2; | ||
268 | __be64 lun; | ||
269 | __be32 sense_data_len; | ||
270 | u32 reserved3; | ||
271 | u8 sense_data[0]; | ||
272 | } __attribute__((packed)); | ||
273 | |||
274 | struct srp_aer_rsp { | ||
275 | u8 opcode; | ||
276 | u8 reserved[7]; | ||
277 | u64 tag; | ||
278 | }; | ||
279 | |||
242 | #endif /* SCSI_SRP_H */ | 280 | #endif /* SCSI_SRP_H */ |