diff options
author | Eli Cohen <eli@mellanox.co.il> | 2010-10-25 00:08:52 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-25 13:20:39 -0400 |
commit | fa417f7b520ee60b39f7e23528d2030af30a07d1 (patch) | |
tree | 8eca6ed53c985616e990b57b99a21714ed011534 /include/linux/mlx4/device.h | |
parent | 7ac870ed7d2316587ec06747c28cb9f44f67997d (diff) |
IB/mlx4: Add support for IBoE
Add support for IBoE to mlx4_ib. The bulk of the code is handling the
new address vector fields; mlx4 needs the MAC address of a remote node
to include it in a WQE (for datagrams) or in the QP context (for
connected QPs). Address resolution is done by assuming all unicast
GIDs are either link-local IPv6 addresses.
Multicast group attach/detach needs to update the NIC's multicast
filters; but since attaching a QP to a multicast group can be done
before the QP is bound to a port, for IBoE we need to keep track of
all multicast groups that a QP is attached too before it transitions
from INIT to RTR (since it does not have a port in the INIT state).
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
[ Many things cleaned up and otherwise monkeyed with; hope I didn't
introduce too many bugs. - Roland ]
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/linux/mlx4/device.h')
-rw-r--r-- | include/linux/mlx4/device.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 47e163ad3d11..ca5645c43f61 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -374,6 +374,27 @@ struct mlx4_av { | |||
374 | u8 dgid[16]; | 374 | u8 dgid[16]; |
375 | }; | 375 | }; |
376 | 376 | ||
377 | struct mlx4_eth_av { | ||
378 | __be32 port_pd; | ||
379 | u8 reserved1; | ||
380 | u8 smac_idx; | ||
381 | u16 reserved2; | ||
382 | u8 reserved3; | ||
383 | u8 gid_index; | ||
384 | u8 stat_rate; | ||
385 | u8 hop_limit; | ||
386 | __be32 sl_tclass_flowlabel; | ||
387 | u8 dgid[16]; | ||
388 | u32 reserved4[2]; | ||
389 | __be16 vlan; | ||
390 | u8 mac[6]; | ||
391 | }; | ||
392 | |||
393 | union mlx4_ext_av { | ||
394 | struct mlx4_av ib; | ||
395 | struct mlx4_eth_av eth; | ||
396 | }; | ||
397 | |||
377 | struct mlx4_dev { | 398 | struct mlx4_dev { |
378 | struct pci_dev *pdev; | 399 | struct pci_dev *pdev; |
379 | unsigned long flags; | 400 | unsigned long flags; |
@@ -402,6 +423,12 @@ struct mlx4_init_port_param { | |||
402 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ | 423 | if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ |
403 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) | 424 | ~(dev)->caps.port_mask) & 1 << ((port) - 1)) |
404 | 425 | ||
426 | #define mlx4_foreach_ib_transport_port(port, dev) \ | ||
427 | for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ | ||
428 | if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \ | ||
429 | ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) | ||
430 | |||
431 | |||
405 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, | 432 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, |
406 | struct mlx4_buf *buf); | 433 | struct mlx4_buf *buf); |
407 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); | 434 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); |