From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9EEEEA0548; Mon, 26 Apr 2021 19:46:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C73D4123D; Mon, 26 Apr 2021 19:45:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id F2ED341238 for ; Mon, 26 Apr 2021 19:45:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13QHjZVn009150 for ; Mon, 26 Apr 2021 10:45:46 -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=pfpt0220; bh=Qfl4Wks1Me/E5mjXy2I+4Mtn5V9n/H5wiuKGJfEzeI4=; b=FTI80OmrZikqIlmpSWKyMcwvkNfOSuZx1FU5u3XRTc4bvA5b7SA+4R55AuIsK0TlU2HI ZdtAwt9EoaVu41u7oHDLCWDiT7lIx9v3N/mu1zOeB2y2GTpVCHkNkddKMVz2Rm1ceRvd gMi30LvLIX0qrCtY3VYV+D680eWZe6Bv+xjKYLu1570Munk9PZu5vn7o/ORfMCyU6jOO 9j4ZWt3RnnvVLmgwhjnlhTzoiZ7viorDEt2suQNh3fJ7XjNT+HGVBFjLFYsyt5E9ame/ TONJQRfvXF86gKj8AFGnjn5L8NzzI8MpAhwQFxWjEBfEQtD+8OCv+ITVd0z99+yhgi+G UQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 385hfr2tmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 26 Apr 2021 10:45:46 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 26 Apr 2021 10:45:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 26 Apr 2021 10:45:44 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id E698B5B6C97; Mon, 26 Apr 2021 10:45:42 -0700 (PDT) From: To: , Pavan Nikhilesh , "Shijith Thotton" CC: Date: Mon, 26 Apr 2021 23:14:22 +0530 Message-ID: <20210426174441.2302-16-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210426174441.2302-1-pbhagavatula@marvell.com> References: <20210306162942.6845-1-pbhagavatula@marvell.com> <20210426174441.2302-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: O4ci2UhY8G0omlOgaNBVKxN0ZBs1A0ps X-Proofpoint-GUID: O4ci2UhY8G0omlOgaNBVKxN0ZBs1A0ps X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-26_09:2021-04-26, 2021-04-26 signatures=0 Subject: [dpdk-dev] [PATCH v2 15/33] event/cnxk: add SSO GWS dequeue fastpath functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 SSO GWS event dequeue fastpath functions. Signed-off-by: Pavan Nikhilesh --- drivers/event/cnxk/cn10k_eventdev.c | 10 ++- drivers/event/cnxk/cn10k_worker.c | 54 +++++++++++++ drivers/event/cnxk/cn10k_worker.h | 12 +++ drivers/event/cnxk/cn9k_eventdev.c | 15 ++++ drivers/event/cnxk/cn9k_worker.c | 117 ++++++++++++++++++++++++++++ drivers/event/cnxk/cn9k_worker.h | 24 ++++++ 6 files changed, 231 insertions(+), 1 deletion(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 16848798c..a9948e1b2 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -135,11 +135,19 @@ cn10k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp) static void cn10k_sso_fp_fns_set(struct rte_eventdev *event_dev) { - PLT_SET_USED(event_dev); + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + event_dev->enqueue = cn10k_sso_hws_enq; event_dev->enqueue_burst = cn10k_sso_hws_enq_burst; event_dev->enqueue_new_burst = cn10k_sso_hws_enq_new_burst; event_dev->enqueue_forward_burst = cn10k_sso_hws_enq_fwd_burst; + + event_dev->dequeue = cn10k_sso_hws_deq; + event_dev->dequeue_burst = cn10k_sso_hws_deq_burst; + if (dev->is_timeout_deq) { + event_dev->dequeue = cn10k_sso_hws_tmo_deq; + event_dev->dequeue_burst = cn10k_sso_hws_tmo_deq_burst; + } } static void diff --git a/drivers/event/cnxk/cn10k_worker.c b/drivers/event/cnxk/cn10k_worker.c index cef24f4e2..57b0714bb 100644 --- a/drivers/event/cnxk/cn10k_worker.c +++ b/drivers/event/cnxk/cn10k_worker.c @@ -59,3 +59,57 @@ cn10k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[], return 1; } + +uint16_t __rte_hot +cn10k_sso_hws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct cn10k_sso_hws *ws = port; + + RTE_SET_USED(timeout_ticks); + + if (ws->swtag_req) { + ws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(ws->tag_wqe_op); + return 1; + } + + return cn10k_sso_hws_get_work(ws, ev); +} + +uint16_t __rte_hot +cn10k_sso_hws_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events, + uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn10k_sso_hws_deq(port, ev, timeout_ticks); +} + +uint16_t __rte_hot +cn10k_sso_hws_tmo_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct cn10k_sso_hws *ws = port; + uint16_t ret = 1; + uint64_t iter; + + if (ws->swtag_req) { + ws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(ws->tag_wqe_op); + return ret; + } + + ret = cn10k_sso_hws_get_work(ws, ev); + for (iter = 1; iter < timeout_ticks && (ret == 0); iter++) + ret = cn10k_sso_hws_get_work(ws, ev); + + return ret; +} + +uint16_t __rte_hot +cn10k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn10k_sso_hws_tmo_deq(port, ev, timeout_ticks); +} diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h index d75e92846..ed4e3bd63 100644 --- a/drivers/event/cnxk/cn10k_worker.h +++ b/drivers/event/cnxk/cn10k_worker.h @@ -160,4 +160,16 @@ uint16_t __rte_hot cn10k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[], uint16_t nb_events); +uint16_t __rte_hot cn10k_sso_hws_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn10k_sso_hws_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); +uint16_t __rte_hot cn10k_sso_hws_tmo_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn10k_sso_hws_tmo_deq_burst(void *port, + struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); + #endif diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 7e4c1b415..8100140fc 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -162,12 +162,27 @@ cn9k_sso_fp_fns_set(struct rte_eventdev *event_dev) event_dev->enqueue_new_burst = cn9k_sso_hws_enq_new_burst; event_dev->enqueue_forward_burst = cn9k_sso_hws_enq_fwd_burst; + event_dev->dequeue = cn9k_sso_hws_deq; + event_dev->dequeue_burst = cn9k_sso_hws_deq_burst; + if (dev->deq_tmo_ns) { + event_dev->dequeue = cn9k_sso_hws_tmo_deq; + event_dev->dequeue_burst = cn9k_sso_hws_tmo_deq_burst; + } + if (dev->dual_ws) { event_dev->enqueue = cn9k_sso_hws_dual_enq; event_dev->enqueue_burst = cn9k_sso_hws_dual_enq_burst; event_dev->enqueue_new_burst = cn9k_sso_hws_dual_enq_new_burst; event_dev->enqueue_forward_burst = cn9k_sso_hws_dual_enq_fwd_burst; + + event_dev->dequeue = cn9k_sso_hws_dual_deq; + event_dev->dequeue_burst = cn9k_sso_hws_dual_deq_burst; + if (dev->deq_tmo_ns) { + event_dev->dequeue = cn9k_sso_hws_dual_tmo_deq; + event_dev->dequeue_burst = + cn9k_sso_hws_dual_tmo_deq_burst; + } } } diff --git a/drivers/event/cnxk/cn9k_worker.c b/drivers/event/cnxk/cn9k_worker.c index c2f09a99b..41ffd88a0 100644 --- a/drivers/event/cnxk/cn9k_worker.c +++ b/drivers/event/cnxk/cn9k_worker.c @@ -60,6 +60,60 @@ cn9k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[], return 1; } +uint16_t __rte_hot +cn9k_sso_hws_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct cn9k_sso_hws *ws = port; + + RTE_SET_USED(timeout_ticks); + + if (ws->swtag_req) { + ws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(ws->tag_op); + return 1; + } + + return cn9k_sso_hws_get_work(ws, ev); +} + +uint16_t __rte_hot +cn9k_sso_hws_deq_burst(void *port, struct rte_event ev[], uint16_t nb_events, + uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn9k_sso_hws_deq(port, ev, timeout_ticks); +} + +uint16_t __rte_hot +cn9k_sso_hws_tmo_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct cn9k_sso_hws *ws = port; + uint16_t ret = 1; + uint64_t iter; + + if (ws->swtag_req) { + ws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(ws->tag_op); + return ret; + } + + ret = cn9k_sso_hws_get_work(ws, ev); + for (iter = 1; iter < timeout_ticks && (ret == 0); iter++) + ret = cn9k_sso_hws_get_work(ws, ev); + + return ret; +} + +uint16_t __rte_hot +cn9k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn9k_sso_hws_tmo_deq(port, ev, timeout_ticks); +} + /* Dual ws ops. */ uint16_t __rte_hot @@ -117,3 +171,66 @@ cn9k_sso_hws_dual_enq_fwd_burst(void *port, const struct rte_event ev[], return 1; } + +uint16_t __rte_hot +cn9k_sso_hws_dual_deq(void *port, struct rte_event *ev, uint64_t timeout_ticks) +{ + struct cn9k_sso_hws_dual *dws = port; + uint16_t gw; + + RTE_SET_USED(timeout_ticks); + if (dws->swtag_req) { + dws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(dws->ws_state[!dws->vws].tag_op); + return 1; + } + + gw = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws], + &dws->ws_state[!dws->vws], ev); + dws->vws = !dws->vws; + return gw; +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn9k_sso_hws_dual_deq(port, ev, timeout_ticks); +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_tmo_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks) +{ + struct cn9k_sso_hws_dual *dws = port; + uint16_t ret = 1; + uint64_t iter; + + if (dws->swtag_req) { + dws->swtag_req = 0; + cnxk_sso_hws_swtag_wait(dws->ws_state[!dws->vws].tag_op); + return ret; + } + + ret = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws], + &dws->ws_state[!dws->vws], ev); + dws->vws = !dws->vws; + for (iter = 1; iter < timeout_ticks && (ret == 0); iter++) { + ret = cn9k_sso_hws_dual_get_work(&dws->ws_state[dws->vws], + &dws->ws_state[!dws->vws], ev); + dws->vws = !dws->vws; + } + + return ret; +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_tmo_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(nb_events); + + return cn9k_sso_hws_dual_tmo_deq(port, ev, timeout_ticks); +} diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h index e75ed10ad..b997db2fe 100644 --- a/drivers/event/cnxk/cn9k_worker.h +++ b/drivers/event/cnxk/cn9k_worker.h @@ -270,4 +270,28 @@ uint16_t __rte_hot cn9k_sso_hws_dual_enq_fwd_burst(void *port, const struct rte_event ev[], uint16_t nb_events); +uint16_t __rte_hot cn9k_sso_hws_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_tmo_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_tmo_deq_burst(void *port, struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); + +uint16_t __rte_hot cn9k_sso_hws_dual_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_dual_deq_burst(void *port, + struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_dual_tmo_deq(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +uint16_t __rte_hot cn9k_sso_hws_dual_tmo_deq_burst(void *port, + struct rte_event ev[], + uint16_t nb_events, + uint64_t timeout_ticks); + #endif -- 2.17.1