diff options
author | Christian Iversen <ci@iversenit.dk> | 2021-01-27 00:43:51 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2021-01-27 01:15:35 +0000 |
commit | b9de7e6eda04cecaff6735a60c7fe7f488fdccf1 (patch) | |
tree | 5ddb8c4da2964b5b9e2fb2e4ceb154a6d523522c /src/net | |
parent | 4f9fbe6c16e0d0b8930e2ef9880b9e54c264e685 (diff) | |
download | ipxe-b9de7e6eda04cecaff6735a60c7fe7f488fdccf1.tar.gz |
[infiniband] Require drivers to specify the number of ports
Require drivers to report the total number of Infiniband ports. This
is necessary to report the correct number of ports on devices with
dynamic port types.
For example, dual-port Mellanox cards configured for (eth, ib) would
be rejected by the subnet manager, because they report using "port 2,
out of 1".
Signed-off-by: Christian Iversen <ci@iversenit.dk>
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/infiniband.c | 20 | ||||
-rw-r--r-- | src/net/infiniband/ib_sma.c | 2 |
2 files changed, 1 insertions, 21 deletions
diff --git a/src/net/infiniband.c b/src/net/infiniband.c index 3b79a660c..e19e121c1 100644 --- a/src/net/infiniband.c +++ b/src/net/infiniband.c @@ -814,26 +814,6 @@ void ib_mcast_detach ( struct ib_device *ibdev, struct ib_queue_pair *qp, */ /** - * Count Infiniband HCA ports - * - * @v ibdev Infiniband device - * @ret num_ports Number of ports - */ -int ib_count_ports ( struct ib_device *ibdev ) { - struct ib_device *tmp; - int num_ports = 0; - - /* Search for IB devices with the same physical device to - * identify port count. - */ - for_each_ibdev ( tmp ) { - if ( tmp->dev == ibdev->dev ) - num_ports++; - } - return num_ports; -} - -/** * Set port information * * @v ibdev Infiniband device diff --git a/src/net/infiniband/ib_sma.c b/src/net/infiniband/ib_sma.c index 24ec9f4e0..b553e66b1 100644 --- a/src/net/infiniband/ib_sma.c +++ b/src/net/infiniband/ib_sma.c @@ -63,7 +63,7 @@ static void ib_sma_node_info ( struct ib_device *ibdev, node_info->base_version = IB_MGMT_BASE_VERSION; node_info->class_version = IB_SMP_CLASS_VERSION; node_info->node_type = IB_NODE_TYPE_HCA; - node_info->num_ports = ib_count_ports ( ibdev ); + node_info->num_ports = ibdev->ports; memcpy ( &node_info->sys_guid, &ibdev->node_guid, sizeof ( node_info->sys_guid ) ); memcpy ( &node_info->node_guid, &ibdev->node_guid, |