diff mbox

[rdma-core,2/2] qedr: Convert immediate data to network order

Message ID 1497279852-30901-3-git-send-email-Ram.Amrani@cavium.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Amrani, Ram June 12, 2017, 3:04 p.m. UTC
Convert immediate data sent over EDPM to network order.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
---
 providers/qedr/qelr_verbs.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c
index 358f3f7..193b274 100644
--- a/providers/qedr/qelr_verbs.c
+++ b/providers/qedr/qelr_verbs.c
@@ -922,14 +922,17 @@  static inline void qelr_edpm_set_inv_imm(struct qelr_qp *qp,
 					 struct qelr_edpm *edpm,
 					 uint32_t inv_key_or_imm_data)
 {
+	uint32_t data;
+
 	if (!edpm->is_edpm)
 		return;
 
-	memcpy(&edpm->dpm_payload[edpm->dpm_payload_offset],
-	       &inv_key_or_imm_data, sizeof(inv_key_or_imm_data));
+	data = htobe32(inv_key_or_imm_data);
+
+	memcpy(&edpm->dpm_payload[edpm->dpm_payload_offset], &data, sizeof(data));
 
-	edpm->dpm_payload_offset += sizeof(inv_key_or_imm_data);
-	edpm->dpm_payload_size += sizeof(inv_key_or_imm_data);
+	edpm->dpm_payload_offset += sizeof(data);
+	edpm->dpm_payload_size += sizeof(data);
 }
 
 static inline void qelr_edpm_set_rdma_ext(struct qelr_qp *qp,