Skip to content

Commit

Permalink
IB/hfi1: fix pstateinfo from returning improperly byteswapped value
Browse files Browse the repository at this point in the history
Byteswap link_width_downgrade_*_active values before sending on the wire.  In
addition properly define the Port State Info structure.

Reviewed-by: Dennis Dalessandro <[email protected]>
Reviewed-by: Christian Gomez <[email protected]>
Signed-off-by: Rimmer, Todd <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
Acked-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
weiny2 authored and dledford committed Sep 18, 2015
1 parent 447e9a4 commit aadfc3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rdma/hfi1/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,9 +1717,9 @@ static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data,
psi->port_states.portphysstate_portstate =
(hfi1_ibphys_portstate(ppd) << 4) | (lstate & 0xf);
psi->link_width_downgrade_tx_active =
ppd->link_width_downgrade_tx_active;
cpu_to_be16(ppd->link_width_downgrade_tx_active);
psi->link_width_downgrade_rx_active =
ppd->link_width_downgrade_rx_active;
cpu_to_be16(ppd->link_width_downgrade_rx_active);
if (resp_len)
*resp_len += sizeof(struct opa_port_state_info);

Expand Down
4 changes: 2 additions & 2 deletions include/rdma/opa_port_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ struct opa_port_states {

struct opa_port_state_info {
struct opa_port_states port_states;
u16 link_width_downgrade_tx_active;
u16 link_width_downgrade_rx_active;
__be16 link_width_downgrade_tx_active;
__be16 link_width_downgrade_rx_active;
};

struct opa_port_info {
Expand Down

0 comments on commit aadfc3b

Please sign in to comment.