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 407B0A046B for ; Sat, 1 Jun 2019 20:58:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 901BD1B9E6; Sat, 1 Jun 2019 20:56:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id B6AEA1B947 for ; Sat, 1 Jun 2019 20:55:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x51It56h029939 for ; Sat, 1 Jun 2019 11:55:49 -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=kpO6B40qqySm68rKnLexyi1uCcQH1XyiKozKmUqvKKQ=; b=Yjz59jDjce7PP6tu+DGimoICEacEkcMwctvmyU4yHtlHEvLHkxYHywIK1wtfptyDiWOD g1wXZl1dI+I3TnSqf00t4sqNNjqSUIbUjWaJsQDKWTm8DwW7/iIlpnV8D4woaTihqj9u llKhGMthoQWxK/R1dt7+XzxGFBPlWOlActv71vA/aR5oJdIGpGr1Q8sqvTsDkjpi4D/S hnHr05Z9UtiziAxIK9JITLauWcSatIBE9RDRx1adJruZTiZhIi8Wx0vaiFSFP7sWb84H ow3FTSVEsiMHIZR0SaNP6dE94DvwxF8nX0WHlFhBal2hXGsXnxh/nx92fzPTF5MiFOwR eQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2survk12eh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 01 Jun 2019 11:55:49 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 1 Jun 2019 11:55:47 -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:47 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.28]) by maili.marvell.com (Postfix) with ESMTP id 1ACAF3F7040; Sat, 1 Jun 2019 11:55:45 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Sun, 2 Jun 2019 00:23:30 +0530 Message-ID: <20190601185355.370-21-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 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 fdcac527f..2b4e32c19 100644 --- a/drivers/event/octeontx2/otx2_evdev.h +++ b/drivers/event/octeontx2/otx2_evdev.h @@ -199,6 +199,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); +} -- 2.21.0