From 361a9ccf81d6edd4902adedca104028f85a44d1d Mon Sep 17 00:00:00 2001 From: Xiaoyun Wang Date: Thu, 10 Oct 2019 22:52:02 +0800 Subject: [PATCH] net/hinic: optimize Rx performance This patch optimizes receive packets performance on arm platform. Signed-off-by: Xiaoyun Wang --- drivers/net/hinic/hinic_pmd_rx.c | 5 +---- drivers/net/hinic/hinic_pmd_rx.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c index a9f396222a..743bae9693 100644 --- a/drivers/net/hinic/hinic_pmd_rx.c +++ b/drivers/net/hinic/hinic_pmd_rx.c @@ -971,13 +971,10 @@ u16 hinic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, u16 nb_pkts) while (pkts < nb_pkts) { /* 2. current ci is done */ rx_cqe = &rxq->rx_cqe[sw_ci]; - status = rx_cqe->status; + status = __atomic_load_n(&rx_cqe->status, __ATOMIC_ACQUIRE); if (!HINIC_GET_RX_DONE_BE(status)) break; - /* read other cqe member after status */ - rte_rmb(); - /* convert cqe and get packet length */ hinic_rq_cqe_be_to_cpu32(&cqe, (volatile void *)rx_cqe); vlan_len = cqe.vlan_len; diff --git a/drivers/net/hinic/hinic_pmd_rx.h b/drivers/net/hinic/hinic_pmd_rx.h index 5cd17ecc21..1a80f95af4 100644 --- a/drivers/net/hinic/hinic_pmd_rx.h +++ b/drivers/net/hinic/hinic_pmd_rx.h @@ -35,7 +35,7 @@ struct hinic_rq_cqe { u32 rss_hash; u32 rsvd[4]; -}; +} __rte_cache_aligned; struct hinic_rq_cqe_sect { struct hinic_sge sge; -- 2.20.1