[dpdk-dev] [PATCH] pmd: use byte ordering functions from dpdk

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Sep 30 10:55:53 CEST 2013


CPU should always use little endian on Intel
but it is more consistent to use DPDK macros.

Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
---
 pmd/vmx_user.h |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/pmd/vmx_user.h b/pmd/vmx_user.h
index 4a1a95c..7181a3b 100644
--- a/pmd/vmx_user.h
+++ b/pmd/vmx_user.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 6WIND 2012-2013, All rights reserved.
+ * Copyright 2012-2013 6WIND S.A.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -40,12 +40,12 @@ typedef uint32_t u32;
 typedef uint64_t u64;
 typedef phys_addr_t dma_addr_t;
 
-#define le16_to_cpu(x) (x)
-#define cpu_to_le16(x) (x)
-#define le32_to_cpu(x) (x)
-#define cpu_to_le32(x) (x)
-#define le64_to_cpu(x) (x)
-#define cpu_to_le64(x) (x)
+#define le16_to_cpu(x) rte_le_to_cpu_16(x)
+#define cpu_to_le16(x) rte_cpu_to_le_16(x)
+#define le32_to_cpu(x) rte_le_to_cpu_32(x)
+#define cpu_to_le32(x) rte_cpu_to_le_32(x)
+#define le64_to_cpu(x) rte_le_to_cpu_64(x)
+#define cpu_to_le64(x) rte_cpu_to_le_64(x)
 
 #define readl(addr) \
 	(*((volatile uint32_t*)((unsigned long)(addr))))
-- 
1.7.10.4



More information about the dev mailing list