From patchwork Fri Jun 28 18:23:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 55621 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D8211B9E7; Fri, 28 Jun 2019 20:25:01 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id BECA81B9B0 for ; Fri, 28 Jun 2019 20:24:36 +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 x5SILDWo011345 for ; Fri, 28 Jun 2019 11:24:36 -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=sWd14JhzqMBho9qkdL8JkD7C4gk8kAEdxbsvjTpS9D8=; b=exC2Qxc0ZfVF4T2g6CxG8fxpt+U6iKRpmbzLc3axxrR+gu7i5PKwUvWPNpz6GHQgcRDv o1WKb4I5lFvux+d5bBGUCJrqxeZ/pujQEuUSTRf8KgMbu16xvIcXXx/CoXSpL37EwjH3 qB2t134i6FnPfPha4WguOHdvDQaZ17iJ2sxMZXSYpO4ft79neX83TYlXlEDf4J/ApM9V mquB6VVDq+AIYcYyaoIultBGHEIJiumyofUI2eicuvihuWL+wy1RhD387doWRrrop0v4 OJG6Ura0NlhNZtySNeONQztcxb9dW9iMdNZV+Vhq9JMqkgX4rftrtZnsXiyXsrZMR3Av 8A== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2tdd77agkr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 28 Jun 2019 11:24:35 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 28 Jun 2019 11:24:34 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 28 Jun 2019 11:24:34 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.12]) by maili.marvell.com (Postfix) with ESMTP id C1AD43F7040; Fri, 28 Jun 2019 11:24:33 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Fri, 28 Jun 2019 23:53:27 +0530 Message-ID: <20190628182354.228-17-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628182354.228-1-pbhagavatula@marvell.com> References: <20190628182354.228-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-28_08:, , signatures=0 Subject: [dpdk-dev] [PATCH v3 16/42] 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 4f2fd33df..6f8d709b6 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -178,6 +178,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) {