[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>
This commit is contained in:
Christian Iversen
2021-01-27 00:43:51 +01:00
committed by Michael Brown
parent 4f9fbe6c16
commit b9de7e6eda
9 changed files with 9 additions and 22 deletions

View File

@@ -3829,6 +3829,7 @@ static int hermon_probe ( struct pci_device *pci ) {
ibdev->op = &hermon_ib_operations;
ibdev->dev = &pci->dev;
ibdev->port = ( HERMON_PORT_BASE + i );
ibdev->ports = hermon->cap.num_ports;
ib_set_drvdata ( ibdev, hermon );
}