From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44926A0613 for ; Mon, 26 Aug 2019 17:32:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC3E01C0C6; Mon, 26 Aug 2019 17:32:30 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 68E841C0C6 for ; Mon, 26 Aug 2019 17:32:29 +0200 (CEST) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 22BA7CC9383DEF168F17 for ; Mon, 26 Aug 2019 23:32:27 +0800 (CST) Received: from tester.localdomain (10.175.119.39) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Mon, 26 Aug 2019 23:32:19 +0800 From: Xiaoyun Wang To: CC: , , , , , Xiaoyun Wang Date: Mon, 26 Aug 2019 23:46:48 +0800 Message-ID: <1566834408-110260-1-git-send-email-cloud.wangxiaoyun@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.119.39] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [PATCH v1 1/1] net/hinic: fix receive pkts errs on arm platform X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- 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