From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nipun Gupta Subject: [PATCH 3/3] net/dpaa2: prefetch the annotation in event processing Date: Tue, 23 Jan 2018 19:47:53 +0530 Message-ID: <1516717073-6020-3-git-send-email-nipun.gupta@nxp.com> References: <1516717073-6020-1-git-send-email-nipun.gupta@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , Nipun Gupta To: Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0054.outbound.protection.outlook.com [104.47.36.54]) by dpdk.org (Postfix) with ESMTP id 38E2F3195 for ; Tue, 23 Jan 2018 16:03:21 +0100 (CET) In-Reply-To: <1516717073-6020-1-git-send-email-nipun.gupta@nxp.com> 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 adds software prefetching of the annotation which is accessed by the driver to fetch the parsing results. The changes also include as many instructions in between prefetching memory and using it. Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/dpaa2_rxtx.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 3d45669..fee7e4c 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -676,7 +676,8 @@ void __attribute__((hot)) struct dpaa2_queue *rxq, struct rte_event *ev) { - ev->mbuf = eth_fd_to_mbuf(fd); + rte_prefetch0((void *)(DPAA2_GET_FD_ADDR(fd) + + DPAA2_FD_PTA_SIZE + 16)); ev->flow_id = rxq->ev.flow_id; ev->sub_event_type = rxq->ev.sub_event_type; @@ -686,18 +687,22 @@ void __attribute__((hot)) ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; + ev->mbuf = eth_fd_to_mbuf(fd); + qbman_swp_dqrr_consume(swp, dq); } -void dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused)), - const struct qbman_fd *fd, - const struct qbman_result *dq, - struct dpaa2_queue *rxq, - struct rte_event *ev) +void __attribute__((hot)) +dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused)), + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct dpaa2_queue *rxq, + struct rte_event *ev) { - uint8_t dqrr_index = qbman_get_dqrr_idx(dq); + uint8_t dqrr_index; - ev->mbuf = eth_fd_to_mbuf(fd); + rte_prefetch0((void *)(DPAA2_GET_FD_ADDR(fd) + + DPAA2_FD_PTA_SIZE + 16)); ev->flow_id = rxq->ev.flow_id; ev->sub_event_type = rxq->ev.sub_event_type; @@ -707,6 +712,9 @@ void dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused) ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; + ev->mbuf = eth_fd_to_mbuf(fd); + + dqrr_index = qbman_get_dqrr_idx(dq); ev->mbuf->seqn = dqrr_index + 1; DPAA2_PER_LCORE_DQRR_SIZE++; DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; -- 1.9.1