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 F2952A0548; Sat, 6 Mar 2021 17:32:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6C0322A4AF; Sat, 6 Mar 2021 17:31:02 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C056522A4B4 for ; Sat, 6 Mar 2021 17:31:00 +0100 (CET) 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 126GPGmp025389; Sat, 6 Mar 2021 08:31:00 -0800 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=Q88vOG4zmLfhvQu3+AsKi71ciZomJmJSOZ14/cgqIXg=; b=RR1A718qloSSOh2f4GTvpwZ0YUOGNJ+FZXqisMbE5zZ8Jd7q9OcY7JkaK27dP8uxPEUY EIvZrMLqsuiyXGq4v2IdxDULydG71L6CX0GaLf0qQajRaZu5KMMlxQpRh2hVBePZM4XH RrcPef51H9KerciQxx4gQy8Y6DxrlGma2fetVcdpICnHjBfrD9obYs3rrq1dlB6p3/5V oG1Oys0iqpeJ+Ld7PtSji3r8k6qGCX3SHn4YMWk/qjbKaePRhr2DT18/kP9r7y5Rf53z fPc/LuD4tEDuBvplb3M97Wj8wSFRp4Fn7u2/C6WTgmdczRoQwDioBuSkrMi+ZV0ACnbh qg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3747yurewd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 06 Mar 2021 08:30:59 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Mar 2021 08:30:58 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 6 Mar 2021 08:30:58 -0800 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; Sat, 6 Mar 2021 08:30:57 -0800 Received: from BG-LT7430.marvell.com (unknown [10.193.68.121]) by maili.marvell.com (Postfix) with ESMTP id 0C0453F7040; Sat, 6 Mar 2021 08:30:55 -0800 (PST) From: To: , Pavan Nikhilesh , "Shijith Thotton" , Anatoly Burakov CC: , Date: Sat, 6 Mar 2021 21:59:19 +0530 Message-ID: <20210306162942.6845-15-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210306162942.6845-1-pbhagavatula@marvell.com> References: <20210306162942.6845-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:6.0.369, 18.0.761 definitions=2021-03-06_08:2021-03-03, 2021-03-06 signatures=0 Subject: [dpdk-dev] [PATCH 14/36] event/cnxk: add SSO GWS fastpath enqueue 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 fastpath event device enqueue functions. Signed-off-by: Pavan Nikhilesh --- drivers/event/cnxk/cn10k_eventdev.c | 16 +++- drivers/event/cnxk/cn10k_worker.c | 54 ++++++++++++++ drivers/event/cnxk/cn10k_worker.h | 12 +++ drivers/event/cnxk/cn9k_eventdev.c | 25 ++++++- drivers/event/cnxk/cn9k_worker.c | 112 ++++++++++++++++++++++++++++ drivers/event/cnxk/cn9k_worker.h | 24 ++++++ 6 files changed, 241 insertions(+), 2 deletions(-) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 310acc011..16848798c 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -2,7 +2,9 @@ * Copyright(C) 2021 Marvell International Ltd. */ +#include "cn10k_worker.h" #include "cnxk_eventdev.h" +#include "cnxk_worker.h" static void cn10k_init_hws_ops(struct cn10k_sso_hws *ws, uintptr_t base) @@ -130,6 +132,16 @@ cn10k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp) return roc_sso_rsrc_init(&dev->sso, hws, hwgrp); } +static void +cn10k_sso_fp_fns_set(struct rte_eventdev *event_dev) +{ + PLT_SET_USED(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; +} + static void cn10k_sso_info_get(struct rte_eventdev *event_dev, struct rte_event_dev_info *dev_info) @@ -276,8 +288,10 @@ cn10k_sso_init(struct rte_eventdev *event_dev) event_dev->dev_ops = &cn10k_sso_dev_ops; /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + cn10k_sso_fp_fns_set(event_dev); return 0; + } rc = cnxk_sso_init(event_dev); if (rc < 0) diff --git a/drivers/event/cnxk/cn10k_worker.c b/drivers/event/cnxk/cn10k_worker.c index 4a7d0b535..cef24f4e2 100644 --- a/drivers/event/cnxk/cn10k_worker.c +++ b/drivers/event/cnxk/cn10k_worker.c @@ -5,3 +5,57 @@ #include "cn10k_worker.h" #include "cnxk_eventdev.h" #include "cnxk_worker.h" + +uint16_t __rte_hot +cn10k_sso_hws_enq(void *port, const struct rte_event *ev) +{ + struct cn10k_sso_hws *ws = port; + + switch (ev->op) { + case RTE_EVENT_OP_NEW: + return cn10k_sso_hws_new_event(ws, ev); + case RTE_EVENT_OP_FORWARD: + cn10k_sso_hws_forward_event(ws, ev); + break; + case RTE_EVENT_OP_RELEASE: + cnxk_sso_hws_swtag_flush(ws->tag_wqe_op, ws->swtag_flush_op); + break; + default: + return 0; + } + + return 1; +} + +uint16_t __rte_hot +cn10k_sso_hws_enq_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + RTE_SET_USED(nb_events); + return cn10k_sso_hws_enq(port, ev); +} + +uint16_t __rte_hot +cn10k_sso_hws_enq_new_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn10k_sso_hws *ws = port; + uint16_t i, rc = 1; + + for (i = 0; i < nb_events && rc; i++) + rc = cn10k_sso_hws_new_event(ws, &ev[i]); + + return nb_events; +} + +uint16_t __rte_hot +cn10k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn10k_sso_hws *ws = port; + + RTE_SET_USED(nb_events); + cn10k_sso_hws_forward_event(ws, ev); + + return 1; +} diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h index 0a7cb9c57..d75e92846 100644 --- a/drivers/event/cnxk/cn10k_worker.h +++ b/drivers/event/cnxk/cn10k_worker.h @@ -148,4 +148,16 @@ cn10k_sso_hws_get_work_empty(struct cn10k_sso_hws *ws, struct rte_event *ev) return !!gw.u64[1]; } +/* CN10K Fastpath functions. */ +uint16_t __rte_hot cn10k_sso_hws_enq(void *port, const struct rte_event *ev); +uint16_t __rte_hot cn10k_sso_hws_enq_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn10k_sso_hws_enq_new_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn10k_sso_hws_enq_fwd_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); + #endif diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index 44c7a0c3a..7e4c1b415 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -2,7 +2,9 @@ * Copyright(C) 2021 Marvell International Ltd. */ +#include "cn9k_worker.h" #include "cnxk_eventdev.h" +#include "cnxk_worker.h" #define CN9K_DUAL_WS_NB_WS 2 #define CN9K_DUAL_WS_PAIR_ID(x, id) (((x)*CN9K_DUAL_WS_NB_WS) + id) @@ -150,6 +152,25 @@ cn9k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp) return roc_sso_rsrc_init(&dev->sso, hws, hwgrp); } +static void +cn9k_sso_fp_fns_set(struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + + event_dev->enqueue = cn9k_sso_hws_enq; + event_dev->enqueue_burst = cn9k_sso_hws_enq_burst; + event_dev->enqueue_new_burst = cn9k_sso_hws_enq_new_burst; + event_dev->enqueue_forward_burst = cn9k_sso_hws_enq_fwd_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; + } +} + static void * cn9k_sso_init_hws_mem(void *arg, uint8_t port_id) { @@ -349,8 +370,10 @@ cn9k_sso_init(struct rte_eventdev *event_dev) event_dev->dev_ops = &cn9k_sso_dev_ops; /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + cn9k_sso_fp_fns_set(event_dev); return 0; + } rc = cnxk_sso_init(event_dev); if (rc < 0) diff --git a/drivers/event/cnxk/cn9k_worker.c b/drivers/event/cnxk/cn9k_worker.c index 77856f2e7..c2f09a99b 100644 --- a/drivers/event/cnxk/cn9k_worker.c +++ b/drivers/event/cnxk/cn9k_worker.c @@ -5,3 +5,115 @@ #include "roc_api.h" #include "cn9k_worker.h" + +uint16_t __rte_hot +cn9k_sso_hws_enq(void *port, const struct rte_event *ev) +{ + struct cn9k_sso_hws *ws = port; + + switch (ev->op) { + case RTE_EVENT_OP_NEW: + return cn9k_sso_hws_new_event(ws, ev); + case RTE_EVENT_OP_FORWARD: + cn9k_sso_hws_forward_event(ws, ev); + break; + case RTE_EVENT_OP_RELEASE: + cnxk_sso_hws_swtag_flush(ws->tag_op, ws->swtag_flush_op); + break; + default: + return 0; + } + + return 1; +} + +uint16_t __rte_hot +cn9k_sso_hws_enq_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + RTE_SET_USED(nb_events); + return cn9k_sso_hws_enq(port, ev); +} + +uint16_t __rte_hot +cn9k_sso_hws_enq_new_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn9k_sso_hws *ws = port; + uint16_t i, rc = 1; + + for (i = 0; i < nb_events && rc; i++) + rc = cn9k_sso_hws_new_event(ws, &ev[i]); + + return nb_events; +} + +uint16_t __rte_hot +cn9k_sso_hws_enq_fwd_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn9k_sso_hws *ws = port; + + RTE_SET_USED(nb_events); + cn9k_sso_hws_forward_event(ws, ev); + + return 1; +} + +/* Dual ws ops. */ + +uint16_t __rte_hot +cn9k_sso_hws_dual_enq(void *port, const struct rte_event *ev) +{ + struct cn9k_sso_hws_dual *dws = port; + struct cn9k_sso_hws_state *vws; + + vws = &dws->ws_state[!dws->vws]; + switch (ev->op) { + case RTE_EVENT_OP_NEW: + return cn9k_sso_hws_dual_new_event(dws, ev); + case RTE_EVENT_OP_FORWARD: + cn9k_sso_hws_dual_forward_event(dws, vws, ev); + break; + case RTE_EVENT_OP_RELEASE: + cnxk_sso_hws_swtag_flush(vws->tag_op, vws->swtag_flush_op); + break; + default: + return 0; + } + + return 1; +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_enq_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + RTE_SET_USED(nb_events); + return cn9k_sso_hws_dual_enq(port, ev); +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_enq_new_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn9k_sso_hws_dual *dws = port; + uint16_t i, rc = 1; + + for (i = 0; i < nb_events && rc; i++) + rc = cn9k_sso_hws_dual_new_event(dws, &ev[i]); + + return nb_events; +} + +uint16_t __rte_hot +cn9k_sso_hws_dual_enq_fwd_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + struct cn9k_sso_hws_dual *dws = port; + + RTE_SET_USED(nb_events); + cn9k_sso_hws_dual_forward_event(dws, &dws->ws_state[!dws->vws], ev); + + return 1; +} diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h index ff7851642..e75ed10ad 100644 --- a/drivers/event/cnxk/cn9k_worker.h +++ b/drivers/event/cnxk/cn9k_worker.h @@ -246,4 +246,28 @@ cn9k_sso_hws_get_work_empty(struct cn9k_sso_hws_state *ws, struct rte_event *ev) return !!gw.u64[1]; } +/* CN9K Fastpath functions. */ +uint16_t __rte_hot cn9k_sso_hws_enq(void *port, const struct rte_event *ev); +uint16_t __rte_hot cn9k_sso_hws_enq_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn9k_sso_hws_enq_new_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn9k_sso_hws_enq_fwd_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); + +uint16_t __rte_hot cn9k_sso_hws_dual_enq(void *port, + const struct rte_event *ev); +uint16_t __rte_hot cn9k_sso_hws_dual_enq_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn9k_sso_hws_dual_enq_new_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); +uint16_t __rte_hot cn9k_sso_hws_dual_enq_fwd_burst(void *port, + const struct rte_event ev[], + uint16_t nb_events); + #endif -- 2.17.1