Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdma-core/libibumad: Add all pair SMI&GSI support #1517

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions debian/libibumad3.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ libibumad.so.3 libibumad3 #MINVER#
umad_sort_ca_device_list@IBUMAD_1.2 3.2.30
umad_status@IBUMAD_1.0 1.3.9
umad_unregister@IBUMAD_1.0 1.3.9
umad_get_smi_gsi_pairs@IBUMAD_1.4 3.4.55
umad_get_smi_gsi_pair_by_ca_name@IBUMAD_1.4 3.4.55
2 changes: 1 addition & 1 deletion libibumad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish_headers(infiniband

rdma_library(ibumad libibumad.map
# See Documentation/versioning.md
3 3.3.${PACKAGE_VERSION}
3 3.4.${PACKAGE_VERSION}
sysfs.c
umad.c
umad_str.c
Expand Down
7 changes: 7 additions & 0 deletions libibumad/libibumad.map
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,10 @@ IBUMAD_1.3 {
global:
umad_open_smi_port;
} IBUMAD_1.2;

IBUMAD_1.4 {
global:
umad_get_smi_gsi_pairs;
umad_get_smi_gsi_pair_by_ca_name;
} IBUMAD_1.3;

54 changes: 54 additions & 0 deletions libibumad/man/umad_get_smi_gsi_pair_by_ca_name.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.. -*- 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);

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.

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]>
50 changes: 50 additions & 0 deletions libibumad/man/umad_get_smi_gsi_pairs.3
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]>
Loading