From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 48765A047C for ; Sat, 1 Jun 2019 20:57:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B4BC1B9AB; Sat, 1 Jun 2019 20:56:08 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id CB35F1B945 for ; Sat, 1 Jun 2019 20:55:40 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x51ItbNN029526 for ; Sat, 1 Jun 2019 11:55:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=gfjS+m7WVxg9n6Y2UeC37HycN9wmyfxWjp01pXeAZKg=; b=hWTTWW+DBkcjQsIVNJL+pKu1l9m5oOrsj3s0rqJYjrXsutr7Ta0o1HOcls6tQEhgZMFK gwUmtZwuuJiipg7x4PSLJQ0HQSJ2mMK2z6q1BQkNchCQV4C4kxi5VlHVA4/m3p7hs7Py 3lIs5c267L7J4qoqiJqiu0H/MtvCCCr0QTJH2mrt5VYgMf7XT+dwF41NyeXzvLsMgHA/ AdUoDdVc074jNgv8HbprVuBmvvkmBldwTD3fUStzmyGGbURz6YzjIKxn8BiqdwZWiGtz Lr2XKCNXYEfDn6Q5AFIBlGAJCElMJwaWmd4j2M0MGBkC8LIwy9hweF6VKq1pU0OJ0hEh IA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2supqksfw5-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 01 Jun 2019 11:55:39 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 1 Jun 2019 11:55:38 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sat, 1 Jun 2019 11:55:38 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.28]) by maili.marvell.com (Postfix) with ESMTP id 0CE543F7053; Sat, 1 Jun 2019 11:55:35 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Sun, 2 Jun 2019 00:23:26 +0530 Message-ID: <20190601185355.370-17-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190601185355.370-1-pbhagavatula@marvell.com> References: <20190601185355.370-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-01_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 16/44] event/octeontx2: add worker dequeue functions 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" From: Pavan Nikhilesh Add worker event dequeue functions. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.h | 10 +++++ drivers/event/octeontx2/otx2_worker.c | 55 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h index b5d889132..99ee6cea0 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -163,6 +163,16 @@ uint16_t otx2_ssogws_enq_new_burst(void *port, const struct rte_event ev[], uint16_t otx2_ssogws_enq_fwd_burst(void *port, const struct rte_event ev[], uint16_t nb_events); +uint16_t otx2_ssogws_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t otx2_ssogws_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks); +uint16_t otx2_ssogws_deq_timeout(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t otx2_ssogws_deq_timeout_burst(void *port, struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); + /* Init and Fini API's */ int otx2_sso_init(struct rte_eventdev *event_dev); int otx2_sso_fini(struct rte_eventdev *event_dev); diff --git a/drivers/event/octeontx2/otx2_worker.c b/drivers/event/octeontx2/otx2_worker.c index 044c5f132..edc574673 100644 --- a/drivers/event/octeontx2/otx2_worker.c +++ b/drivers/event/octeontx2/otx2_worker.c @@ -81,6 +81,61 @@ otx2_ssogws_release_event(struct otx2_ssogws *ws) otx2_ssogws_swtag_flush(ws); } +uint16_t __hot +otx2_ssogws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct otx2_ssogws *ws = port; + + RTE_SET_USED(timeout_ticks); + + if (ws->swtag_req) { + ws->swtag_req = 0; + otx2_ssogws_swtag_wait(ws); + return 1; + } + + return otx2_ssogws_get_work(ws, ev); +} + +uint16_t __hot +otx2_ssogws_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events, + uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return otx2_ssogws_deq(port, ev, timeout_ticks); +} + +uint16_t __hot +otx2_ssogws_deq_timeout(void *port, struct rte_event *ev, + uint64_t timeout_ticks) +{ + struct otx2_ssogws *ws = port; + uint16_t ret = 1; + uint64_t iter; + + if (ws->swtag_req) { + ws->swtag_req = 0; + otx2_ssogws_swtag_wait(ws); + return ret; + } + + ret = otx2_ssogws_get_work(ws, ev); + for (iter = 1; iter < timeout_ticks && (ret == 0); iter++) + ret = otx2_ssogws_get_work(ws, ev); + + return ret; +} + +uint16_t __hot +otx2_ssogws_deq_timeout_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return otx2_ssogws_deq_timeout(port, ev, timeout_ticks); +} + uint16_t __hot otx2_ssogws_enq(void *port, const struct rte_event *ev) { -- 2.21.0