From patchwork Fri Apr 30 13:53:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 92517 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8137A0547; Fri, 30 Apr 2021 15:54:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A597E41153; Fri, 30 Apr 2021 15:54:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AC8BF40A4B for ; Fri, 30 Apr 2021 15:53:58 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13UDpJmP016431 for ; Fri, 30 Apr 2021 06:53:58 -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=otQ9wQOxGaArGyUCZBMfa0Mx42tUih0jgLRm+xnP86s=; b=Gb+cGPdLg7ue0jvC7vfzH7ck6/n2nSsup30B1DJGLHEisxKg5Q8NJN6stLNihZr1zezx 4KMx0jIsQyv6yUEUqvep2724kn56wtMW+w6pZJ8X1iiymQYIkeJKkFQx9fNe3LvCym2f qy9rSBXwrro1CG7Kt3SgSSncLDLV2F0U2m35Mr3BQpKgZ7BiqwBZAu2kmtpUD/uhA9eD 7V65/sRFybYO82xlSrobt9tKuZqzSRlQ1ywUEgZlLstBFTJNJ/u4s3A5Ml9NFFFtiZLl m9exOiDQ5TctlbwWqZTsdJ36O8ukgNBYz30Vmznq1KLn6aAhnMlE/BBXn4DJ+RgQNTOV +A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 387rpneatm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 30 Apr 2021 06:53:57 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 30 Apr 2021 06:53:56 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 30 Apr 2021 06:53:55 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id 78ED03F703F; Fri, 30 Apr 2021 06:53:54 -0700 (PDT) From: To: , Pavan Nikhilesh , "Shijith Thotton" CC: Date: Fri, 30 Apr 2021 19:23:08 +0530 Message-ID: <20210430135336.2749-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210430135336.2749-1-pbhagavatula@marvell.com> References: <20210426174441.2302-1-pbhagavatula@marvell.com> <20210430135336.2749-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: jebnyiwt4c0c2OB2uXy9GJ29V2kOIowy X-Proofpoint-ORIG-GUID: jebnyiwt4c0c2OB2uXy9GJ29V2kOIowy X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-30_08:2021-04-30, 2021-04-30 signatures=0 Subject: [dpdk-dev] [PATCH v3 05/33] event/cnxk: add platform specific device config 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: Shijith Thotton Add platform specific event device configuration that attaches the requested number of SSO HWS(event ports) and HWGRP(event queues) LFs to the RVU PF/VF. Signed-off-by: Shijith Thotton Signed-off-by: Pavan Nikhilesh --- drivers/event/cnxk/cn10k_eventdev.c | 35 +++++++++++++++++++++++++++ drivers/event/cnxk/cn9k_eventdev.c | 37 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index f5caa5537..ab1c98946 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -16,6 +16,14 @@ cn10k_sso_set_rsrc(void *arg) dev->sso.max_hwgrp; } +static int +cn10k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp) +{ + struct cnxk_sso_evdev *dev = arg; + + return roc_sso_rsrc_init(&dev->sso, hws, hwgrp); +} + static void cn10k_sso_info_get(struct rte_eventdev *event_dev, struct rte_event_dev_info *dev_info) @@ -26,8 +34,35 @@ cn10k_sso_info_get(struct rte_eventdev *event_dev, cnxk_sso_info_get(dev, dev_info); } +static int +cn10k_sso_dev_configure(const struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + int rc; + + rc = cnxk_sso_dev_validate(event_dev); + if (rc < 0) { + plt_err("Invalid event device configuration"); + return -EINVAL; + } + + roc_sso_rsrc_fini(&dev->sso); + + rc = cn10k_sso_rsrc_init(dev, dev->nb_event_ports, + dev->nb_event_queues); + if (rc < 0) { + plt_err("Failed to initialize SSO resources"); + return -ENODEV; + } + + return rc; +} + static struct rte_eventdev_ops cn10k_sso_dev_ops = { .dev_infos_get = cn10k_sso_info_get, + .dev_configure = cn10k_sso_dev_configure, + .queue_def_conf = cnxk_sso_queue_def_conf, + .port_def_conf = cnxk_sso_port_def_conf, }; static int diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c index d02c0c9bd..66aea70be 100644 --- a/drivers/event/cnxk/cn9k_eventdev.c +++ b/drivers/event/cnxk/cn9k_eventdev.c @@ -22,6 +22,17 @@ cn9k_sso_set_rsrc(void *arg) dev->sso.max_hwgrp; } +static int +cn9k_sso_rsrc_init(void *arg, uint8_t hws, uint8_t hwgrp) +{ + struct cnxk_sso_evdev *dev = arg; + + if (dev->dual_ws) + hws = hws * CN9K_DUAL_WS_NB_WS; + + return roc_sso_rsrc_init(&dev->sso, hws, hwgrp); +} + static void cn9k_sso_info_get(struct rte_eventdev *event_dev, struct rte_event_dev_info *dev_info) @@ -32,8 +43,34 @@ cn9k_sso_info_get(struct rte_eventdev *event_dev, cnxk_sso_info_get(dev, dev_info); } +static int +cn9k_sso_dev_configure(const struct rte_eventdev *event_dev) +{ + struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); + int rc; + + rc = cnxk_sso_dev_validate(event_dev); + if (rc < 0) { + plt_err("Invalid event device configuration"); + return -EINVAL; + } + + roc_sso_rsrc_fini(&dev->sso); + + rc = cn9k_sso_rsrc_init(dev, dev->nb_event_ports, dev->nb_event_queues); + if (rc < 0) { + plt_err("Failed to initialize SSO resources"); + return -ENODEV; + } + + return rc; +} + static struct rte_eventdev_ops cn9k_sso_dev_ops = { .dev_infos_get = cn9k_sso_info_get, + .dev_configure = cn9k_sso_dev_configure, + .queue_def_conf = cnxk_sso_queue_def_conf, + .port_def_conf = cnxk_sso_port_def_conf, }; static int