Skip to content

Commit

Permalink
libibumad: Change find_preffered_port to set same portnum for smi/gsi…
Browse files Browse the repository at this point in the history
… device in case that its the same device

(otherwise we might choose different port for same device)

Signed-off-by: Asaf Mazor <[email protected]>
  • Loading branch information
mazorasaf committed Jan 29, 2025
1 parent b30c36d commit e0ab872
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libibumad/umad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,15 @@ static int umad_find_active(struct umad_ca_pair *ca_pair, const umad_ca_t *ca, b
static int find_preferred_ports(struct umad_ca_pair *ca_pair, const umad_ca_t *ca, bool is_gsi, int portnum)
{
if (portnum) {
//in case we have same device, use same port for smi/gsi
if (!strncmp(ca_pair->gsi_name, ca_pair->smi_name, UMAD_CA_NAME_LEN)) {
if (!umad_check_active(ca, portnum)) {
ca_pair->gsi_preferred_port = portnum;
ca_pair->smi_preferred_port = portnum;
return 0;
}
return 1;
}
uint32_t *port_to_set = is_gsi ?
&ca_pair->gsi_preferred_port :
&ca_pair->smi_preferred_port;
Expand Down

0 comments on commit e0ab872

Please sign in to comment.