From patchwork Fri Jun 28 18:23:31 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: 55625 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 7BCC41BA00; Fri, 28 Jun 2019 20:25:12 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 2FDE51B9B5 for ; Fri, 28 Jun 2019 20:24:46 +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 x5SIMM3q012139 for ; Fri, 28 Jun 2019 11:24:45 -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=k7LsMa54DMW5zkbV2DnDvW4M86P9/Safdu88COENMuChC6B8hAdCxSyoYZ5s08TkQYx+ LydfaUoGWlGxfoELCkxyD9UKAJJIfnsh9PZZG2PJ0ZtdarFln2WBodFTJILqjnkiiXSk Y6iTEZH6mq9wjfLb4FkbN+Y3wOMbPilEtanLaqGQL3/jKvwmwT2YDIAl7GkKrC/oZIx8 /6oFRD4nrmJyQVZXsMopfWL5RyZhSVcpv6A5f+XWKTsNcchY2X5RO3KAc4ks0j5a6dNT wsKRE78/AXXXyl3Mxo7AJQDDw0gBt/A47Ga7A7RP9+7vUuEuIjYHtW9UQ0LCUzc1kHG3 8A== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2tdd77agmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 28 Jun 2019 11:24:45 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) 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:44 -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; Fri, 28 Jun 2019 11:24:44 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.12]) by maili.marvell.com (Postfix) with ESMTP id D82543F7040; Fri, 28 Jun 2019 11:24:42 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Fri, 28 Jun 2019 23:53:31 +0530 Message-ID: <20190628182354.228-21-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 20/42] 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); +}