net/ionic: observe endiannness in ioread/iowrite
authorAndrew Boyer <aboyer@pensando.io>
Mon, 18 Jan 2021 20:35:04 +0000 (12:35 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:10 +0000 (18:16 +0100)
The IONIC FW is little-endian.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
drivers/net/ionic/ionic_dev.h
drivers/net/ionic/ionic_osdep.h

index ef63ff7..e13b6c8 100644 (file)
@@ -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);
index a352849..a6575c3 100644 (file)
@@ -40,8 +40,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