From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A48E6C432C2 for ; Wed, 25 Sep 2019 14:19:02 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 5972021D7B for ; Wed, 25 Sep 2019 14:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5972021D7B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9938E1BEC6; Wed, 25 Sep 2019 16:19:01 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id CDAD31BE99 for ; Wed, 25 Sep 2019 16:18:59 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CD4E2383001C86DD93B0 for ; Wed, 25 Sep 2019 22:18:58 +0800 (CST) Received: from tester.localdomain (10.175.119.39) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Wed, 25 Sep 2019 22:18:48 +0800 From: Xiaoyun wang To: CC: , , , , , , , Xiaoyun wang Date: Wed, 25 Sep 2019 22:30:45 +0800 Message-ID: <8fa4210f9ba33fe2db2a66f0c16fd01b1c7a57f5.1569421287.git.cloud.wangxiaoyun@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.119.39] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2 17/17] net/hinic: optimize tx&rx performance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch optimizes receive packets performance in arm platform. Signed-off-by: Xiaoyun wang --- drivers/net/hinic/hinic_pmd_rx.c | 17 +++++++++++++++++ drivers/net/hinic/hinic_pmd_rx.h | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/net/hinic/hinic_pmd_rx.c b/drivers/net/hinic/hinic_pmd_rx.c index 37b4f5c..94071ee 100644 --- a/drivers/net/hinic/hinic_pmd_rx.c +++ b/drivers/net/hinic/hinic_pmd_rx.c @@ -950,6 +950,19 @@ void hinic_rx_alloc_pkts(struct hinic_rxq *rxq) } } +#if defined(__ARM64_NEON__) +static inline uint32_t __attribute__((always_inline)) +hinic_read_cqe_status(uintptr_t addr) +{ + uint32_t val; + + asm volatile("ldar %x[val], [%x[addr]]" + : [val] "=r" (val) + : [addr] "r" (addr)); + return val; +} +#endif + u16 hinic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, u16 nb_pkts) { struct rte_mbuf *rxm; @@ -972,7 +985,11 @@ 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]; +#if defined(__X86_64_SSE__) status = rx_cqe->status; +#elif defined(__ARM64_NEON__) + status = hinic_read_cqe_status((uintptr_t)&rxq->rx_cqe[sw_ci]); +#endif if (!HINIC_GET_RX_DONE_BE(status)) break; diff --git a/drivers/net/hinic/hinic_pmd_rx.h b/drivers/net/hinic/hinic_pmd_rx.h index fe2735b..fa27e91 100644 --- a/drivers/net/hinic/hinic_pmd_rx.h +++ b/drivers/net/hinic/hinic_pmd_rx.h @@ -28,6 +28,7 @@ struct hinic_rq_ctrl { u32 ctrl_fmt; }; +#if defined(__X86_64_SSE__) struct hinic_rq_cqe { u32 status; u32 vlan_len; @@ -36,6 +37,16 @@ struct hinic_rq_cqe { u32 rsvd[4]; }; +#elif defined(__ARM64_NEON__) +struct hinic_rq_cqe { + u32 status; + u32 vlan_len; + u32 offload_type; + u32 rss_hash; + + u32 rsvd[4]; +} __rte_cache_aligned; +#endif struct hinic_rq_cqe_sect { struct hinic_sge sge; -- 1.8.3.1