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 9E8A5A046B for ; Sat, 1 Jun 2019 21:00:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B2231B9FB; Sat, 1 Jun 2019 20:56:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 3AFDB1B9BA for ; Sat, 1 Jun 2019 20:56:12 +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 x51It9nn029954 for ; Sat, 1 Jun 2019 11:56:11 -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=hxqcUvNpYDsSHbDbPfllqNsp9VxQ4AXPZ3FplR1mPOM=; b=y6eazDCs1vKBf0mBJFh+BvSx9HhI0VEHAp4AC3+HrG6vDt6cmZUiAOQXJlvghzleXFte TM4ci9jkOM/oE3SGwatqPB9YqstgeaSxTMTh3fRLnruEJCePM0htIHE9rE3O+XVS36C7 EqzBTAQCK9C3JpL9gqndNfps0811ttMJdd4Bfg3mNDZe1bvs/LJzYUw6ewZHQscDaiml 8u/X4DSB+bT+ts3uXOQXPHnuORepfJVxwnymRWpcDLF5BqgmeqIpUpF9HUFfX32X0ILj 7I8SJDHsSsiw7ImVcYDH0t7L/StIRQCK/k0bVzN11myLeIOG4K6EOXpmkV5ZwWhxrnPS pA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2survk12g2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 01 Jun 2019 11:56:11 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 1 Jun 2019 11:56:10 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sat, 1 Jun 2019 11:56:10 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.28]) by maili.marvell.com (Postfix) with ESMTP id 254EA3F7040; Sat, 1 Jun 2019 11:56:08 -0700 (PDT) From: To: , Pavan Nikhilesh CC: Date: Sun, 2 Jun 2019 00:23:38 +0530 Message-ID: <20190601185355.370-29-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 28/44] event/octeontx2: add timer adapter capabilities 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 function to retrieve event timer adapter capabilities. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx2/otx2_evdev.c | 2 ++ drivers/event/octeontx2/otx2_tim_evdev.c | 19 +++++++++++++++++++ drivers/event/octeontx2/otx2_tim_evdev.h | 17 +++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c index c247848be..86b9fee97 100644 --- a/drivers/event/octeontx2/otx2_evdev.c +++ b/drivers/event/octeontx2/otx2_evdev.c @@ -1087,6 +1087,8 @@ static struct rte_eventdev_ops otx2_sso_ops = { .port_unlink = otx2_sso_port_unlink, .timeout_ticks = otx2_sso_timeout_ticks, + .timer_adapter_caps_get = otx2_tim_caps_get, + .xstats_get = otx2_sso_xstats_get, .xstats_reset = otx2_sso_xstats_reset, .xstats_get_names = otx2_sso_xstats_get_names, diff --git a/drivers/event/octeontx2/otx2_tim_evdev.c b/drivers/event/octeontx2/otx2_tim_evdev.c index a4f6bc673..aa470f0ad 100644 --- a/drivers/event/octeontx2/otx2_tim_evdev.c +++ b/drivers/event/octeontx2/otx2_tim_evdev.c @@ -5,6 +5,25 @@ #include "otx2_evdev.h" #include "otx2_tim_evdev.h" +int +otx2_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags, + uint32_t *caps, + const struct rte_event_timer_adapter_ops **ops) +{ + struct otx2_tim_evdev *dev = otx2_tim_priv_get(); + + RTE_SET_USED(flags); + RTE_SET_USED(ops); + if (dev == NULL) + return -ENODEV; + + /* Store evdev pointer for later use. */ + dev->event_dev = (struct rte_eventdev *)(uintptr_t)evdev; + *caps = RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT; + + return 0; +} + void otx2_tim_init(struct rte_pci_device *pci_dev, struct otx2_dev *cmn_dev) { diff --git a/drivers/event/octeontx2/otx2_tim_evdev.h b/drivers/event/octeontx2/otx2_tim_evdev.h index 14bbaf43c..c71094c39 100644 --- a/drivers/event/octeontx2/otx2_tim_evdev.h +++ b/drivers/event/octeontx2/otx2_tim_evdev.h @@ -13,11 +13,28 @@ struct otx2_tim_evdev { struct rte_pci_device *pci_dev; + struct rte_eventdev *event_dev; struct otx2_mbox *mbox; uint16_t nb_rings; uintptr_t bar2; }; +static inline struct otx2_tim_evdev * +otx2_tim_priv_get(void) +{ + const struct rte_memzone *mz; + + mz = rte_memzone_lookup(RTE_STR(OTX2_TIM_EVDEV_NAME)); + if (mz == NULL) + return NULL; + + return mz->addr; +} + +int otx2_tim_caps_get(const struct rte_eventdev *dev, uint64_t flags, + uint32_t *caps, + const struct rte_event_timer_adapter_ops **ops); + void otx2_tim_init(struct rte_pci_device *pci_dev, struct otx2_dev *cmn_dev); #endif /* __OTX2_TIM_EVDEV_H__ */ -- 2.21.0