Skip to contentSkip to conversation

IB/hfi1: fix pstateinfo from returning improperly byteswapped value

PATCH Applied [email protected] 3 participants 3 messages Sep 9, 2015 – Sep 18, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/hfi1: fix pstateinfo from returning improperly byteswapped value

From: Ira Weiny <[email protected]>

Byteswap link_width_downgrade_*_active values before sending on the wire. In addition properly define the Port State Info structure.

---
 drivers/staging/rdma/hfi1/mad.c | 4 ++--
 include/rdma/opa_port_info.h    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rdma/hfi1/mad.c +2 -2
index 37269eb90c34..b2c1b72d38ce 100644
@@ -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);
 
include/rdma/opa_port_info.h +2 -2
index 391dae1931c0..a0fa975cd1c1 100644
@@ -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 {
Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1441776501-5881-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 5 lines

Subject: [PATCH] IB/hfi1: fix pstateinfo from returning improperly byteswapped value

From: Ira Weiny <[email protected]>

Quoted 8 lines

Byteswap link_width_downgrade_*_active values before sending on the wire. In addition properly define the Port State Info structure.

---

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · On 09/09/2015 01:28 AM, [email protected] wrote:

From: Ira Weiny <[email protected]>

Byteswap link_width_downgrade_*_active values before sending on the wire. In addition properly define the Port State Info structure.

Applied, thanks.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD