[10/44] event/octeontx2: support dequeue timeout tick conversion

Message ID 20190601185355.370-11-pbhagavatula@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series OCTEON TX2 event device driver |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Pavan Nikhilesh Bhagavatula June 1, 2019, 6:53 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/octeontx2/otx2_evdev.c | 11 +++++++++++
 drivers/event/octeontx2/otx2_evdev.h |  1 +
 2 files changed, 12 insertions(+)
  

Comments

Jerin Jacob Kollanukkaran June 17, 2019, 8:01 a.m. UTC | #1
> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Sunday, June 2, 2019 12:23 AM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Pavan Nikhilesh
> Bhagavatula <pbhagavatula@marvell.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 10/44] event/octeontx2: support dequeue timeout
> tick conversion
> 

Missing git comment

> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
  

Patch

diff --git a/drivers/event/octeontx2/otx2_evdev.c b/drivers/event/octeontx2/otx2_evdev.c
index 7875a9ac5..485552c44 100644
--- a/drivers/event/octeontx2/otx2_evdev.c
+++ b/drivers/event/octeontx2/otx2_evdev.c
@@ -630,6 +630,16 @@  otx2_sso_port_setup(struct rte_eventdev *event_dev, uint8_t port_id,
 	return 0;
 }
 
+static int
+otx2_sso_timeout_ticks(struct rte_eventdev *event_dev, uint64_t ns,
+		       uint64_t *tmo_ticks)
+{
+	RTE_SET_USED(event_dev);
+	*tmo_ticks = NSEC2TICK(ns, rte_get_timer_hz());
+
+	return 0;
+}
+
 /* Initialize and register event driver with DPDK Application */
 static struct rte_eventdev_ops otx2_sso_ops = {
 	.dev_infos_get    = otx2_sso_info_get,
@@ -642,6 +652,7 @@  static struct rte_eventdev_ops otx2_sso_ops = {
 	.port_release     = otx2_sso_port_release,
 	.port_link        = otx2_sso_port_link,
 	.port_unlink      = otx2_sso_port_unlink,
+	.timeout_ticks    = otx2_sso_timeout_ticks,
 };
 
 #define OTX2_SSO_XAE_CNT	"xae_cnt"
diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h
index 3f4931ff1..1a9de1b86 100644
--- a/drivers/event/octeontx2/otx2_evdev.h
+++ b/drivers/event/octeontx2/otx2_evdev.h
@@ -75,6 +75,7 @@ 
 
 #define NSEC2USEC(__ns)			((__ns) / 1E3)
 #define USEC2NSEC(__us)                 ((__us) * 1E3)
+#define NSEC2TICK(__ns, __freq)		(((__ns) * (__freq)) / 1E9)
 
 enum otx2_sso_lf_type {
 	SSO_LF_GGRP,