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>
This commit is contained in:
@@ -94,6 +94,22 @@ rdma_node_get_transport(enum rdma_node_type node_type)
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_node_get_transport);
|
||||
|
||||
enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num)
|
||||
{
|
||||
if (device->get_link_layer)
|
||||
return device->get_link_layer(device, port_num);
|
||||
|
||||
switch (rdma_node_get_transport(device->node_type)) {
|
||||
case RDMA_TRANSPORT_IB:
|
||||
return IB_LINK_LAYER_INFINIBAND;
|
||||
case RDMA_TRANSPORT_IWARP:
|
||||
return IB_LINK_LAYER_ETHERNET;
|
||||
default:
|
||||
return IB_LINK_LAYER_UNSPECIFIED;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(rdma_port_get_link_layer);
|
||||
|
||||
/* Protection domains */
|
||||
|
||||
struct ib_pd *ib_alloc_pd(struct ib_device *device)
|
||||
|
Reference in New Issue
Block a user