-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libibumad, libibmad: add support for XDR infiniband tools
This patch adds support for SMI/GSI separation in XDR-supported HCAs by introducing new APIs and structures in libibumad and libibmad. In libibumad: - Add umad_get_smi_gsi_pairs() and umad_get_smi_gsi_pairs_by_name(). - Introduce umad_ca_pair to represent SMI/GSI pairs. In libibmad: - Add mad_rpc_open_port2() and mad_rpc_close_port2(). - Return an ibmad_ports_pair structure from mad_rpc_open_port2(). In smpquery: Demonstrate the new API to retrieve SMI/GSI details and properly use the SMI or GSI port based on the call type: - GMP calls (e.g., resolve_portid_str()) use the GSI port. - SMP calls (e.g., smp_query_via()) use the SMI port. These changes improve SMI/GSI separation handling and enhance the usability of the API. Signed-off-by: Asaf Mazor <[email protected]>
- Loading branch information
Showing
13 changed files
with
610 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.. -*- rst -*- | ||
.. Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md | ||
umad_get_smi_gsi_pair_by_ca_name(3) | ||
=================================== | ||
|
||
Retrieve SMI/GSI pair information based on device name and port number. | ||
|
||
Synopsis | ||
-------- | ||
|
||
.. code-block:: c | ||
#include <infiniband/umad.h> | ||
int umad_get_smi_gsi_pair_by_ca_name(const char *devname, uint8_t portnum, | ||
struct umad_ca_pair *ca, unsigned enforce_smi); | ||
Description | ||
----------- | ||
|
||
``umad_get_smi_gsi_pair_by_ca_name()`` fills the provided ``ca`` structure with the SMI and GSI pair information | ||
for the specified device name and port number. | ||
|
||
The ``devname`` parameter specifies the name of the device, and ``portnum`` is the associated port number. | ||
|
||
``enforce_smi`` parameter if enabled, will look only for pairs that has both SMI and GSI interfaces. | ||
|
||
The ``struct umad_ca_pair`` is defined in ``<infiniband/umad.h>`` and includes the following members: | ||
|
||
.. code-block:: c | ||
struct umad_ca_pair { | ||
char smi_name[UMAD_CA_NAME_LEN]; | ||
/* Name of the SMI */ | ||
uint32_t smi_preferred_port; | ||
/* Preferred port for the SMI */ | ||
char gsi_name[UMAD_CA_NAME_LEN]; | ||
/* Name of the GSI */ | ||
uint32_t gsi_preferred_port; | ||
/* Preferred port for the GSI */ | ||
}; | ||
The function populates this structure with the relevant data for the given ``devname`` and ``portnum``. | ||
|
||
Return Value | ||
------------ | ||
|
||
``umad_get_smi_gsi_pair_by_ca_name()`` returns: | ||
|
||
- **0**: If the specified device and port are found and the structure is successfully populated. | ||
- **1**: If no matching device or port is found. | ||
|
||
Authors | ||
------- | ||
|
||
- Asaf Mazor <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.. -*- rst -*- | ||
.. Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md | ||
umad_get_smi_gsi_pairs(3) | ||
========================= | ||
|
||
Get CAs as SMI/GSI pairs. | ||
|
||
Synopsis | ||
-------- | ||
|
||
.. code-block:: c | ||
#include <infiniband/umad.h> | ||
int umad_get_smi_gsi_pairs(struct umad_ca_pair cas[], size_t max); | ||
Description | ||
----------- | ||
|
||
``umad_get_smi_gsi_pairs()`` fills a user-allocated array of ``struct umad_ca_pair``. | ||
It fills up to ``max`` devices. | ||
|
||
The argument ``cas`` is an array of ``struct umad_ca_pair`` as specified in ``<infiniband/umad.h>``: | ||
|
||
.. code-block:: c | ||
struct umad_ca_pair { | ||
char smi_name[UMAD_CA_NAME_LEN]; | ||
/* Name of the SMI */ | ||
uint32_t smi_preferred_port; | ||
/* Preferred port for the SMI */ | ||
char gsi_name[UMAD_CA_NAME_LEN]; | ||
/* Name of the GSI */ | ||
uint32_t gsi_preferred_port; | ||
/* Preferred port for the GSI */ | ||
}; | ||
The ``smi_preferred_port`` and ``gsi_preferred_port`` fields represent the first ports found active | ||
for the corresponding SMI/GSI device. | ||
|
||
Return Value | ||
------------ | ||
|
||
``umad_get_smi_gsi_pairs()`` returns the number of devices filled, or **-1** on error. | ||
|
||
Authors | ||
------- | ||
|
||
- Asaf Mazor <[email protected]> |
Oops, something went wrong.