Skip to content

Commit

Permalink
Added 2 new methods to libibumad:
Browse files Browse the repository at this point in the history
 - umad_get_smi_gsi_pairs
 - umad_get_smi_gsi_pairs_by_name

Also new strucure to represent smi/gsi pairs:
 - umad_ca_pair

Signed-off-by: Asaf Mazor <[email protected]>
  • Loading branch information
mazorasaf committed Dec 11, 2024
1 parent 7fc6039 commit 5d15305
Show file tree
Hide file tree
Showing 7 changed files with 436 additions and 1 deletion.
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;

70 changes: 70 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,70 @@
.\" -*- nroff -*-
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
.\"
.TH UMAD_GET_SMI_GSI_PAIR_BY_CA_NAME 3 "May 21, 2007" "OpenIB" "OpenIB Programmer's Manual"
.SH NAME
.B umad_get_smi_gsi_pair_by_ca_name \-
Retrieve SMI/GSI pair information based on device name and port number
.SH SYNOPSIS
.nf
.B #include <infiniband/umad.h>
.sp
.BI "int umad_get_smi_gsi_pair_by_ca_name(const char * " "devname" ", uint8_t " "portnum" ", struct umad_ca_pair " "*ca" );
.fi
.SH DESCRIPTION
.B umad_get_smi_gsi_pair_by_ca_name()
fills the provided
.I ca
structure with the SMI and GSI pair information for the specified device name and port number.

The
.I devname
parameter specifies the name of the device, and
.I portnum
is the associated port number.

The
.I struct umad_ca_pair
is defined in
.I <infiniband/umad.h>
and includes the following members:
.PP
.nf
struct umad_ca_pair {
.in +4
char smi_name[UMAD_CA_NAME_LEN];
.in +4
\" Name of the SMI
.in -4
uint32_t smi_preferred_port;
.in +4
\" Preferred port for the SMI
.in -4
char gsi_name[UMAD_CA_NAME_LEN];
.in +4
\" Name of the GSI
.in -4
uint32_t gsi_preferred_port;
.in +4
\" Preferred port for the GSI
.in -8
};
.fi
.PP
The function populates this structure with the relevant data for the given
.I devname
and
.I portnum.
.SH RETURN VALUE
.B umad_get_smi_gsi_pair_by_ca_name()
returns:
.TP
0
If the specified device and port are found and the structure is successfully populated.
.TP
1
If no matching device or port is found.
.SH AUTHORS
.TP
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 @@
.\" -*- nroff -*-
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
.\"
.TH UMAD_GET_SMI_GSI_PAIRS 3 "Dec 1, 2024" "OpenIB" "OpenIB Programmer's Manual"
.SH "NAME"
umad_get_smi_gsi_pairs \- get cas as SMI/GSI pairs
.SH "SYNOPSIS"
.nf
.B #include <infiniband/umad.h>
.sp
.BI "int umad_get_smi_gsi_pairs(struct umad_ca_pair " "cas[]" ", size_t " "max" );
.fi
.SH "DESCRIPTION"
.B umad_get_smi_gsi_pairs()
fill a user allocated array of struct
.I umad_ca_pair\fr
it fills up to
.I max
devices
The argument
.I cas
is an array of
.I struct umad_ca_pair as specified in <infiniband/umad.h>.
.PP
.nf
struct umad_ca_pair {
.in +1
char smi_name[UMAD_CA_NAME_LEN];
.in +0
uint32_t smi_preferred_port;
.in +0
char gsi_name[UMAD_CA_NAME_LEN];
.in +0
uint32_t gsi_preferred_port;
.in -2
} umad_ca_pair;
.nf
.fi
.PP

smi_preferred_port/gsi_preferred_port are the first ports found active for SMI/GSI device

.SH "RETURN VALUE"
.B umad_get_smi_gsi_pairs()
returns the number of devices filled,
or -1 on error.

.SH "AUTHORS"
.TP
Asaf Mazor <[email protected]>
Loading

0 comments on commit 5d15305

Please sign in to comment.