Skip to content

Commit

Permalink
ibdiags: Fix incorrect forming of comp_mask
Browse files Browse the repository at this point in the history
Sparse says this flows through to the packet as host endian while the
constants are in big endian. Add the missing swap.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
jgunthorpe committed May 7, 2019
1 parent eddc3e7 commit 36742a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcm_rereg_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ static uint64_t build_mcm_rec(uint8_t *data, ibmad_gid_t mgid,
mad_set_array(data, 0, IB_SA_MCM_PORTGID_F, port_gid);
mad_set_field(data, 0, IB_SA_MCM_JOIN_STATE_F, 1);

return IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID |
IB_MCR_COMPMASK_JOIN_STATE;
return be64toh(IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID |
IB_MCR_COMPMASK_JOIN_STATE);
}

static void build_mcm_rec_umad(void *umad, ib_portid_t * dport, int method,
Expand Down

0 comments on commit 36742a3

Please sign in to comment.