patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1 1/1] net/hinic: fix receive pkts errs on arm platform
@ 2019-08-26 15:46 Xiaoyun Wang
  0 siblings, 0 replies; only message in thread
From: Xiaoyun Wang @ 2019-08-26 15:46 UTC (permalink / raw)
  To: ferruh.yigit
  Cc: stable, xuanziyang2, waterman.cao, shahar.belkar, luoxianjun,
	Xiaoyun Wang

For arm platform, because compiler optimization, use inline function
may cause outorder problem, which affects receive packets.

Fixes: 81d53291a466 ("net/hinic/base: add various headers")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_compat.h    | 32 --------------------------------
 drivers/net/hinic/base/hinic_pmd_hwdev.c | 32 ++++++++++++++++++++++++++++++++
 drivers/net/hinic/base/hinic_pmd_hwdev.h |  4 ++++
 drivers/net/hinic/hinic_pmd_ethdev.c     |  2 +-
 4 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index f599947..4a9e632 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -223,38 +223,6 @@ static inline u16 ilog2(u32 n)
 	return res;
 }
 
-/**
- * hinic_cpu_to_be32 - convert data to big endian 32 bit format
- * @data: the data to convert
- * @len: length of data to convert, must be Multiple of 4B
- **/
-static inline void hinic_cpu_to_be32(void *data, u32 len)
-{
-	u32 i;
-	u32 *mem = (u32 *)data;
-
-	for (i = 0; i < (len >> 2); i++) {
-		*mem = cpu_to_be32(*mem);
-		mem++;
-	}
-}
-
-/**
- * hinic_be32_to_cpu - convert data from big endian 32 bit format
- * @data: the data to convert
- * @len: length of data to convert, must be Multiple of 4B
- **/
-static inline void hinic_be32_to_cpu(void *data, u32 len)
-{
-	u32 i;
-	u32 *mem = (u32 *)data;
-
-	for (i = 0; i < (len >> 2); i++) {
-		*mem = be32_to_cpu(*mem);
-		mem++;
-	}
-}
-
 static inline int hinic_mutex_init(pthread_mutex_t *pthreadmutex,
 					const pthread_mutexattr_t *mattr)
 {
diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c
index 4f70baf..fd76abb 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwdev.c
+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c
@@ -65,6 +65,38 @@
 	"Unrecognized module",
 };
 
+/**
+ * hinic_cpu_to_be32 - convert data to big endian 32 bit format
+ * @data: the data to convert
+ * @len: length of data to convert, must be Multiple of 4B
+ **/
+void hinic_cpu_to_be32(void *data, u32 len)
+{
+	u32 i;
+	u32 *mem = (u32 *)data;
+
+	for (i = 0; i < (len >> 2); i++) {
+		*mem = cpu_to_be32(*mem);
+		mem++;
+	}
+}
+
+/**
+ * hinic_be32_to_cpu - convert data from big endian 32 bit format
+ * @data: the data to convert
+ * @len: length of data to convert, must be Multiple of 4B
+ **/
+void hinic_be32_to_cpu(void *data, u32 len)
+{
+	u32 i;
+	u32 *mem = (u32 *)data;
+
+	for (i = 0; i < (len >> 2); i++) {
+		*mem = be32_to_cpu(*mem);
+		mem++;
+	}
+}
+
 static void *
 hinic_dma_mem_zalloc(struct hinic_hwdev *hwdev, size_t size,
 		dma_addr_t *dma_handle, unsigned int flag, unsigned int align)
diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.h b/drivers/net/hinic/base/hinic_pmd_hwdev.h
index 6c21c47..162e462 100644
--- a/drivers/net/hinic/base/hinic_pmd_hwdev.h
+++ b/drivers/net/hinic/base/hinic_pmd_hwdev.h
@@ -482,4 +482,8 @@ void hinic_hilink_async_event_handle(struct hinic_hwdev *hwdev, u8 cmd,
 
 int hinic_set_pagesize(void *hwdev, u8 page_size);
 
+void hinic_cpu_to_be32(void *data, u32 len);
+
+void hinic_be32_to_cpu(void *data, u32 len);
+
 #endif /* _HINIC_PMD_HWDEV_H_ */
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index 044af90..d7c743e 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -1840,7 +1840,7 @@ static int hinic_copy_mempool_init(struct hinic_nic_dev *nic_dev)
 		nic_dev->cpy_mpool =
 		rte_pktmbuf_pool_create(nic_dev->proc_dev_name,
 					HINIC_COPY_MEMPOOL_DEPTH,
-					RTE_CACHE_LINE_SIZE, 0,
+					0, 0,
 					HINIC_COPY_MBUF_SIZE,
 					rte_socket_id());
 		if (!nic_dev->cpy_mpool) {
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-26 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 15:46 [dpdk-stable] [PATCH v1 1/1] net/hinic: fix receive pkts errs on arm platform Xiaoyun Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).