diff mbox series

[09/13] net/ionic: observe endiannness in ioread/iowrite

Message ID 20210118203508.1332-10-aboyer@pensando.io (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series net/ionic: fixes and optimizations | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Boyer Jan. 18, 2021, 8:35 p.m. UTC
The IONIC FW is little-endian.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_dev.h   | 2 +-
 drivers/net/ionic/ionic_osdep.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h
index 8847d6cad4..bacbe3f053 100644
--- a/drivers/net/ionic/ionic_dev.h
+++ b/drivers/net/ionic/ionic_dev.h
@@ -277,7 +277,7 @@  ionic_q_flush(struct ionic_queue *q)
 {
 	uint64_t val = IONIC_DBELL_QID(q->hw_index) | q->head_idx;
 
-	rte_write64(val, q->db);
+	rte_write64(rte_cpu_to_le_64(val), q->db);
 }
 
 int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
diff --git a/drivers/net/ionic/ionic_osdep.h b/drivers/net/ionic/ionic_osdep.h
index d46687b32f..b20c1cc8d5 100644
--- a/drivers/net/ionic/ionic_osdep.h
+++ b/drivers/net/ionic/ionic_osdep.h
@@ -42,8 +42,8 @@  typedef uint32_t __le32;
 typedef uint64_t __le64;
 
 #define ioread8(reg)		rte_read8(reg)
-#define ioread32(reg)		rte_read32(reg)
+#define ioread32(reg)		rte_read32(rte_le_to_cpu_32(reg))
 #define iowrite8(value, reg)	rte_write8(value, reg)
-#define iowrite32(value, reg)	rte_write32(value, reg)
+#define iowrite32(value, reg)	rte_write32(rte_cpu_to_le_32(value), reg)
 
 #endif