From patchwork Fri Jun 28 07:49:59 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: 55555 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 ABE0D1B9FA; Fri, 28 Jun 2019 09:51:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 9D7DC1B9D4 for ; Fri, 28 Jun 2019 09:51:10 +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 x5S7oNMn001550 for ; Fri, 28 Jun 2019 00:51:09 -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=EMh+ArKJvriNbSxEjljUENiWN+FoBf4J+eBt/JTzi0w=; b=DkHfzTFG30MmPtT+rC5e/5XCGzYvu2vgJeKN3mOH2Hk+vlUYRcUVte/UV9bp6REj52um q9DAlYDwXFVWRobJQHOAasr3mfnvtdVzLhzqgHf2uS3pmaLEUw9m0Z2ez2Qkcx45tHKW EinG5j7KIiPQlw31XlmVdQj6XqLR4WoV4IEgBKRZ9aZcpS+r0iPct1EfCbjHJujGJhTI eXIyeruN9HfK3aXYB86pAcRNjXCyN0CiyOh+kMIyuh0TIS6AVdds2MKz2POSQI/ueHpr wjL1LfN1ceTyYOD3UE4Q3s2lz50qt5YjlEt6MxMvpF0frdUMx6ms6no1sAy60UN1108J gQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2tdd778as1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 28 Jun 2019 00:51:09 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 28 Jun 2019 00:51:08 -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 00:51:08 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id A15823F7040; Fri, 28 Jun 2019 00:51:07 -0700 (PDT) From: To: CC: , Pavan Nikhilesh Date: Fri, 28 Jun 2019 13:19:59 +0530 Message-ID: <20190628075024.404-21-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190628075024.404-1-pbhagavatula@marvell.com> References: <20190628075024.404-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-28_02:, , signatures=0 Subject: [dpdk-dev] [PATCH v2 20/44] event/octeontx2: add worker dual GWS 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 workder dual workslot mode dequeue functions. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.h | 9 +++ drivers/event/octeontx2/otx2_worker_dual.c | 66 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h index fd2a4c330..30b5d2c32 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -214,6 +214,15 @@ uint16_t otx2_ssogws_dual_enq_new_burst(void *port, const struct rte_event ev[], uint16_t otx2_ssogws_dual_enq_fwd_burst(void *port, const struct rte_event ev[], uint16_t nb_events); +uint16_t otx2_ssogws_dual_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t otx2_ssogws_dual_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks); +uint16_t otx2_ssogws_dual_deq_timeout(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t otx2_ssogws_dual_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_dual.c b/drivers/event/octeontx2/otx2_worker_dual.c index 661c78c23..58fd588f6 100644 --- a/drivers/event/octeontx2/otx2_worker_dual.c +++ b/drivers/event/octeontx2/otx2_worker_dual.c @@ -139,3 +139,69 @@ otx2_ssogws_dual_enq_fwd_burst(void *port, const struct rte_event ev[], return 1; } + +uint16_t __hot +otx2_ssogws_dual_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct otx2_ssogws_dual *ws = port; + uint8_t gw; + + RTE_SET_USED(timeout_ticks); + if (ws->swtag_req) { + otx2_ssogws_swtag_wait((struct otx2_ssogws *) + &ws->ws_state[!ws->vws]); + ws->swtag_req = 0; + return 1; + } + + gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], + &ws->ws_state[!ws->vws], ev); + ws->vws = !ws->vws; + + return gw; +} + +uint16_t __hot +otx2_ssogws_dual_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return otx2_ssogws_dual_deq(port, ev, timeout_ticks); +} + +uint16_t __hot +otx2_ssogws_dual_deq_timeout(void *port, struct rte_event *ev, + uint64_t timeout_ticks) +{ + struct otx2_ssogws_dual *ws = port; + uint64_t iter; + uint8_t gw; + + if (ws->swtag_req) { + otx2_ssogws_swtag_wait((struct otx2_ssogws *) + &ws->ws_state[!ws->vws]); + ws->swtag_req = 0; + return 1; + } + + gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], + &ws->ws_state[!ws->vws], ev); + ws->vws = !ws->vws; + for (iter = 1; iter < timeout_ticks && (gw == 0); iter++) { + gw = otx2_ssogws_dual_get_work(&ws->ws_state[ws->vws], + &ws->ws_state[!ws->vws], ev); + ws->vws = !ws->vws; + } + + return gw; +} + +uint16_t __hot +otx2_ssogws_dual_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_dual_deq_timeout(port, ev, timeout_ticks); +}