diff options
author | Eli Cohen <eli@mellanox.co.il> | 2010-09-27 20:51:10 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-09-27 20:51:10 -0400 |
commit | a3f5adaf491490089215f863a61b9422fae902f8 (patch) | |
tree | ab4bd1d3875a220cf752bd1a9fd233a1c14bd86e /drivers/infiniband/core | |
parent | 252a52aa4fa22a668f019e55b3aac3ff71ec1c29 (diff) |
IB/core: Add link layer property to ports
This patch allows ports to have different link layers:
IB_LINK_LAYER_INFINIBAND or IB_LINK_LAYER_ETHERNET. This is required
for adding IBoE (InfiniBand-over-Ethernet, aka RoCE) support. For
devices that do not provide an implementation for querying the link
layer property of a port, we return a default value based on the
transport: RMA_TRANSPORT_IB nodes will return IB_LINK_LAYER_INFINIBAND
and RDMA_TRANSPORT_IWARP nodes will return IB_LINK_LAYER_ETHERNET.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r-- | drivers/infiniband/core/verbs.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index e0fa22238715..af7a8b08b2e9 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
@@ -94,6 +94,22 @@ rdma_node_get_transport(enum rdma_node_type node_type) | |||
94 | } | 94 | } |
95 | EXPORT_SYMBOL(rdma_node_get_transport); | 95 | EXPORT_SYMBOL(rdma_node_get_transport); |
96 | 96 | ||
97 | enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num) | ||
98 | { | ||
99 | if (device->get_link_layer) | ||
100 | return device->get_link_layer(device, port_num); | ||
101 | |||
102 | switch (rdma_node_get_transport(device->node_type)) { | ||
103 | case RDMA_TRANSPORT_IB: | ||
104 | return IB_LINK_LAYER_INFINIBAND; | ||
105 | case RDMA_TRANSPORT_IWARP: | ||
106 | return IB_LINK_LAYER_ETHERNET; | ||
107 | default: | ||
108 | return IB_LINK_LAYER_UNSPECIFIED; | ||
109 | } | ||
110 | } | ||
111 | EXPORT_SYMBOL(rdma_port_get_link_layer); | ||
112 | |||
97 | /* Protection domains */ | 113 | /* Protection domains */ |
98 | 114 | ||
99 | struct ib_pd *ib_alloc_pd(struct ib_device *device) | 115 | struct ib_pd *ib_alloc_pd(struct ib_device *device) |