eventdev: hide timer adapter PMD file
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Mon, 18 Oct 2021 23:36:03 +0000 (05:06 +0530)
committerJerin Jacob <jerinj@marvell.com>
Thu, 21 Oct 2021 08:14:50 +0000 (10:14 +0200)
Hide rte_event_timer_adapter_pmd.h file as it is an internal file.
Remove rte_ prefix from rte_event_timer_adapter_ops structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
16 files changed:
drivers/event/cnxk/cnxk_tim_evdev.c
drivers/event/cnxk/cnxk_tim_evdev.h
drivers/event/dsw/dsw_evdev.c
drivers/event/octeontx/ssovf_evdev.c
drivers/event/octeontx/timvf_evdev.c
drivers/event/octeontx/timvf_evdev.h
drivers/event/octeontx2/otx2_tim_evdev.c
drivers/event/octeontx2/otx2_tim_evdev.h
drivers/event/sw/sw_evdev.c
lib/eventdev/event_timer_adapter_pmd.h [new file with mode: 0644]
lib/eventdev/eventdev_pmd.h
lib/eventdev/meson.build
lib/eventdev/rte_event_timer_adapter.c
lib/eventdev/rte_event_timer_adapter.h
lib/eventdev/rte_event_timer_adapter_pmd.h [deleted file]
lib/eventdev/rte_eventdev.c

index 3dd93ae..99b3ace 100644 (file)
@@ -5,7 +5,7 @@
 #include "cnxk_eventdev.h"
 #include "cnxk_tim_evdev.h"
 
-static struct rte_event_timer_adapter_ops cnxk_tim_ops;
+static struct event_timer_adapter_ops cnxk_tim_ops;
 
 static int
 cnxk_tim_chnk_pool_create(struct cnxk_tim_ring *tim_ring,
@@ -353,8 +353,7 @@ cnxk_tim_stats_reset(const struct rte_event_timer_adapter *adapter)
 
 int
 cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
-                 uint32_t *caps,
-                 const struct rte_event_timer_adapter_ops **ops)
+                 uint32_t *caps, const struct event_timer_adapter_ops **ops)
 {
        struct cnxk_tim_evdev *dev = cnxk_tim_priv_get();
 
index 9a23952..2478a5c 100644 (file)
@@ -268,7 +268,7 @@ cnxk_tim_timer_cancel_burst(const struct rte_event_timer_adapter *adptr,
 
 int cnxk_tim_caps_get(const struct rte_eventdev *dev, uint64_t flags,
                      uint32_t *caps,
-                     const struct rte_event_timer_adapter_ops **ops);
+                     const struct event_timer_adapter_ops **ops);
 
 void cnxk_tim_init(struct roc_sso *sso);
 void cnxk_tim_fini(void);
index 1756896..0652d83 100644 (file)
@@ -381,8 +381,8 @@ dsw_eth_rx_adapter_caps_get(const struct rte_eventdev *dev __rte_unused,
 
 static int
 dsw_timer_adapter_caps_get(const struct rte_eventdev *dev __rte_unused,
-                          uint64_t flags  __rte_unused, uint32_t *caps,
-                          const struct rte_event_timer_adapter_ops **ops)
+                          uint64_t flags __rte_unused, uint32_t *caps,
+                          const struct event_timer_adapter_ops **ops)
 {
        *caps = 0;
        *ops = NULL;
index eb80eea..2245599 100644 (file)
@@ -721,7 +721,7 @@ ssovf_parsekv(const char *key __rte_unused, const char *value, void *opaque)
 
 static int
 ssovf_timvf_caps_get(const struct rte_eventdev *dev, uint64_t flags,
-               uint32_t *caps, const struct rte_event_timer_adapter_ops **ops)
+                    uint32_t *caps, const struct event_timer_adapter_ops **ops)
 {
        return timvf_timer_adapter_caps_get(dev, flags, caps, ops,
                        timvf_enable_stats);
index 06fc53c..090b3ed 100644 (file)
@@ -407,18 +407,19 @@ timvf_stats_reset(const struct rte_event_timer_adapter *adapter)
        return 0;
 }
 
-static struct rte_event_timer_adapter_ops timvf_ops = {
-       .init           = timvf_ring_create,
-       .uninit         = timvf_ring_free,
-       .start          = timvf_ring_start,
-       .stop           = timvf_ring_stop,
-       .get_info       = timvf_ring_info_get,
+static struct event_timer_adapter_ops timvf_ops = {
+       .init = timvf_ring_create,
+       .uninit = timvf_ring_free,
+       .start = timvf_ring_start,
+       .stop = timvf_ring_stop,
+       .get_info = timvf_ring_info_get,
 };
 
 int
 timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags,
-               uint32_t *caps, const struct rte_event_timer_adapter_ops **ops,
-               uint8_t enable_stats)
+                            uint32_t *caps,
+                            const struct event_timer_adapter_ops **ops,
+                            uint8_t enable_stats)
 {
        RTE_SET_USED(dev);
 
index 2977063..cef02cd 100644 (file)
@@ -5,13 +5,13 @@
 #ifndef __TIMVF_EVDEV_H__
 #define __TIMVF_EVDEV_H__
 
+#include <event_timer_adapter_pmd.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_debug.h>
 #include <rte_eal.h>
-#include <rte_eventdev.h>
 #include <rte_event_timer_adapter.h>
-#include <rte_event_timer_adapter_pmd.h>
+#include <rte_eventdev.h>
 #include <rte_io.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
@@ -196,8 +196,9 @@ uint8_t timvf_get_ring(void);
 void timvf_release_ring(uint8_t vfid);
 void *timvf_bar(uint8_t id, uint8_t bar);
 int timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags,
-               uint32_t *caps, const struct rte_event_timer_adapter_ops **ops,
-               uint8_t enable_stats);
+                                uint32_t *caps,
+                                const struct event_timer_adapter_ops **ops,
+                                uint8_t enable_stats);
 uint16_t timvf_timer_cancel_burst(const struct rte_event_timer_adapter *adptr,
                struct rte_event_timer **tim, const uint16_t nb_timers);
 uint16_t timvf_timer_arm_burst_sp(const struct rte_event_timer_adapter *adptr,
index 3cdc468..6da8b14 100644 (file)
@@ -9,7 +9,7 @@
 #include "otx2_evdev.h"
 #include "otx2_tim_evdev.h"
 
-static struct rte_event_timer_adapter_ops otx2_tim_ops;
+static struct event_timer_adapter_ops otx2_tim_ops;
 
 static inline int
 tim_get_msix_offsets(void)
@@ -497,8 +497,7 @@ otx2_tim_stats_reset(const struct rte_event_timer_adapter *adapter)
 
 int
 otx2_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
-                 uint32_t *caps,
-                 const struct rte_event_timer_adapter_ops **ops)
+                 uint32_t *caps, const struct event_timer_adapter_ops **ops)
 {
        struct otx2_tim_evdev *dev = tim_priv_get();
 
index caa6ad3..dac642e 100644 (file)
@@ -5,8 +5,8 @@
 #ifndef __OTX2_TIM_EVDEV_H__
 #define __OTX2_TIM_EVDEV_H__
 
+#include <event_timer_adapter_pmd.h>
 #include <rte_event_timer_adapter.h>
-#include <rte_event_timer_adapter_pmd.h>
 #include <rte_reciprocal.h>
 
 #include "otx2_dev.h"
@@ -244,7 +244,7 @@ uint16_t otx2_tim_timer_cancel_burst(
 
 int otx2_tim_caps_get(const struct rte_eventdev *dev, uint64_t flags,
                      uint32_t *caps,
-                     const struct rte_event_timer_adapter_ops **ops);
+                     const struct event_timer_adapter_ops **ops);
 
 void otx2_tim_init(struct rte_pci_device *pci_dev, struct otx2_dev *cmn_dev);
 void otx2_tim_fini(void);
index e99b47a..070a480 100644 (file)
@@ -561,10 +561,9 @@ sw_eth_rx_adapter_caps_get(const struct rte_eventdev *dev,
 }
 
 static int
-sw_timer_adapter_caps_get(const struct rte_eventdev *dev,
-                         uint64_t flags,
+sw_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags,
                          uint32_t *caps,
-                         const struct rte_event_timer_adapter_ops **ops)
+                         const struct event_timer_adapter_ops **ops)
 {
        RTE_SET_USED(dev);
        RTE_SET_USED(flags);
diff --git a/lib/eventdev/event_timer_adapter_pmd.h b/lib/eventdev/event_timer_adapter_pmd.h
new file mode 100644 (file)
index 0000000..189017b
--- /dev/null
@@ -0,0 +1,114 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Intel Corporation.
+ * All rights reserved.
+ */
+
+#ifndef __EVENT_TIMER_ADAPTER_PMD_H__
+#define __EVENT_TIMER_ADAPTER_PMD_H__
+
+/**
+ * @file
+ * RTE Event Timer Adapter API (PMD Side)
+ *
+ * @note
+ * This file provides implementation helpers for internal use by PMDs.  They
+ * are not intended to be exposed to applications and are not subject to ABI
+ * versioning.
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "rte_event_timer_adapter.h"
+
+/*
+ * Definitions of functions exported by an event timer adapter implementation
+ * through *rte_event_timer_adapter_ops* structure supplied in the
+ * *rte_event_timer_adapter* structure associated with an event timer adapter.
+ */
+
+typedef int (*rte_event_timer_adapter_init_t)(
+               struct rte_event_timer_adapter *adapter);
+/**< @internal Event timer adapter implementation setup */
+typedef int (*rte_event_timer_adapter_uninit_t)(
+               struct rte_event_timer_adapter *adapter);
+/**< @internal Event timer adapter implementation teardown */
+typedef int (*rte_event_timer_adapter_start_t)(
+               const struct rte_event_timer_adapter *adapter);
+/**< @internal Start running event timer adapter */
+typedef int (*rte_event_timer_adapter_stop_t)(
+               const struct rte_event_timer_adapter *adapter);
+/**< @internal Stop running event timer adapter */
+typedef void (*rte_event_timer_adapter_get_info_t)(
+               const struct rte_event_timer_adapter *adapter,
+               struct rte_event_timer_adapter_info *adapter_info);
+/**< @internal Get contextual information for event timer adapter */
+typedef int (*rte_event_timer_adapter_stats_get_t)(
+               const struct rte_event_timer_adapter *adapter,
+               struct rte_event_timer_adapter_stats *stats);
+/**< @internal Get statistics for event timer adapter */
+typedef int (*rte_event_timer_adapter_stats_reset_t)(
+               const struct rte_event_timer_adapter *adapter);
+/**< @internal Reset statistics for event timer adapter */
+
+/**
+ * @internal Structure containing the functions exported by an event timer
+ * adapter implementation.
+ */
+struct event_timer_adapter_ops {
+       rte_event_timer_adapter_init_t          init;  /**< Set up adapter */
+       rte_event_timer_adapter_uninit_t        uninit;/**< Tear down adapter */
+       rte_event_timer_adapter_start_t         start; /**< Start adapter */
+       rte_event_timer_adapter_stop_t          stop;  /**< Stop adapter */
+       rte_event_timer_adapter_get_info_t      get_info;
+       /**< Get info from driver */
+       rte_event_timer_adapter_stats_get_t     stats_get;
+       /**< Get adapter statistics */
+       rte_event_timer_adapter_stats_reset_t   stats_reset;
+       /**< Reset adapter statistics */
+       rte_event_timer_arm_burst_t             arm_burst;
+       /**< Arm one or more event timers */
+       rte_event_timer_arm_tmo_tick_burst_t    arm_tmo_tick_burst;
+       /**< Arm event timers with same expiration time */
+       rte_event_timer_cancel_burst_t          cancel_burst;
+       /**< Cancel one or more event timers */
+};
+
+/**
+ * @internal Adapter data; structure to be placed in shared memory to be
+ * accessible by various processes in a multi-process configuration.
+ */
+struct rte_event_timer_adapter_data {
+       uint8_t id;
+       /**< Event timer adapter ID */
+       uint8_t event_dev_id;
+       /**< Event device ID */
+       uint32_t socket_id;
+       /**< Socket ID where memory is allocated */
+       uint8_t event_port_id;
+       /**< Optional: event port ID used when the inbuilt port is absent */
+       const struct rte_memzone *mz;
+       /**< Event timer adapter memzone pointer */
+       struct rte_event_timer_adapter_conf conf;
+       /**< Configuration used to configure the adapter. */
+       uint32_t caps;
+       /**< Adapter capabilities */
+       void *adapter_priv;
+       /**< Timer adapter private data*/
+       uint8_t service_inited;
+       /**< Service initialization state */
+       uint32_t service_id;
+       /**< Service ID*/
+
+       RTE_STD_C11
+       uint8_t started : 1;
+       /**< Flag to indicate adapter started. */
+} __rte_cache_aligned;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __EVENT_TIMER_ADAPTER_PMD_H__ */
index 9aa9943..d009e24 100644 (file)
@@ -24,8 +24,8 @@
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
 
+#include "event_timer_adapter_pmd.h"
 #include "rte_eventdev.h"
-#include "rte_event_timer_adapter_pmd.h"
 
 /* Logging Macros */
 #define RTE_EDEV_LOG_ERR(...) \
@@ -591,10 +591,8 @@ struct rte_event_eth_rx_adapter_queue_conf;
  *
  */
 typedef int (*eventdev_timer_adapter_caps_get_t)(
-                               const struct rte_eventdev *dev,
-                               uint64_t flags,
-                               uint32_t *caps,
-                               const struct rte_event_timer_adapter_ops **ops);
+       const struct rte_eventdev *dev, uint64_t flags, uint32_t *caps,
+       const struct event_timer_adapter_ops **ops);
 
 /**
  * Add ethernet Rx queues to event device. This callback is invoked if
index cb9abe9..22c3289 100644 (file)
@@ -23,7 +23,6 @@ headers = files(
         'rte_event_eth_tx_adapter.h',
         'rte_event_ring.h',
         'rte_event_timer_adapter.h',
-        'rte_event_timer_adapter_pmd.h',
         'rte_eventdev.h',
         'rte_eventdev_trace.h',
         'rte_eventdev_trace_fp.h',
@@ -35,6 +34,7 @@ driver_sdk_headers += files(
         'eventdev_pmd.h',
         'eventdev_pmd_pci.h',
         'eventdev_pmd_vdev.h',
+        'event_timer_adapter_pmd.h',
 )
 
 deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev']
index ee20b39..ae55407 100644 (file)
 #include <rte_service_component.h>
 #include <rte_cycles.h>
 
-#include "rte_eventdev.h"
+#include "event_timer_adapter_pmd.h"
 #include "eventdev_pmd.h"
-#include "rte_eventdev_trace.h"
 #include "rte_event_timer_adapter.h"
-#include "rte_event_timer_adapter_pmd.h"
+#include "rte_eventdev.h"
+#include "rte_eventdev_trace.h"
 
 #define DATA_MZ_NAME_MAX_LEN 64
 #define DATA_MZ_NAME_FORMAT "rte_event_timer_adapter_data_%d"
@@ -35,7 +35,7 @@ RTE_LOG_REGISTER_SUFFIX(evtim_svc_logtype, adapter.timer.svc, NOTICE);
 
 static struct rte_event_timer_adapter adapters[RTE_EVENT_TIMER_ADAPTER_NUM_MAX];
 
-static const struct rte_event_timer_adapter_ops swtim_ops;
+static const struct event_timer_adapter_ops swtim_ops;
 
 #define EVTIM_LOG(level, logtype, ...) \
        rte_log(RTE_LOG_ ## level, logtype, \
@@ -1207,15 +1207,15 @@ swtim_arm_tmo_tick_burst(const struct rte_event_timer_adapter *adapter,
        return __swtim_arm_burst(adapter, evtims, nb_evtims);
 }
 
-static const struct rte_event_timer_adapter_ops swtim_ops = {
-       .init                   = swtim_init,
-       .uninit                 = swtim_uninit,
-       .start                  = swtim_start,
-       .stop                   = swtim_stop,
-       .get_info               = swtim_get_info,
-       .stats_get              = swtim_stats_get,
-       .stats_reset            = swtim_stats_reset,
-       .arm_burst              = swtim_arm_burst,
-       .arm_tmo_tick_burst     = swtim_arm_tmo_tick_burst,
-       .cancel_burst           = swtim_cancel_burst,
+static const struct event_timer_adapter_ops swtim_ops = {
+       .init = swtim_init,
+       .uninit = swtim_uninit,
+       .start = swtim_start,
+       .stop = swtim_stop,
+       .get_info = swtim_get_info,
+       .stats_get = swtim_stats_get,
+       .stats_reset = swtim_stats_reset,
+       .arm_burst = swtim_arm_burst,
+       .arm_tmo_tick_burst = swtim_arm_tmo_tick_burst,
+       .cancel_burst = swtim_cancel_burst,
 };
index 4e0d2a8..cad6d3b 100644 (file)
@@ -523,7 +523,7 @@ struct rte_event_timer_adapter {
        /**< Pointer to driver cancel function. */
        struct rte_event_timer_adapter_data *data;
        /**< Pointer to shared adapter data */
-       const struct rte_event_timer_adapter_ops *ops;
+       const struct event_timer_adapter_ops *ops;
        /**< Functions exported by adapter driver */
 
        RTE_STD_C11
diff --git a/lib/eventdev/rte_event_timer_adapter_pmd.h b/lib/eventdev/rte_event_timer_adapter_pmd.h
deleted file mode 100644 (file)
index cf3509d..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017-2018 Intel Corporation.
- * All rights reserved.
- */
-
-#ifndef __RTE_EVENT_TIMER_ADAPTER_PMD_H__
-#define __RTE_EVENT_TIMER_ADAPTER_PMD_H__
-
-/**
- * @file
- * RTE Event Timer Adapter API (PMD Side)
- *
- * @note
- * This file provides implementation helpers for internal use by PMDs.  They
- * are not intended to be exposed to applications and are not subject to ABI
- * versioning.
- *
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "rte_event_timer_adapter.h"
-
-/*
- * Definitions of functions exported by an event timer adapter implementation
- * through *rte_event_timer_adapter_ops* structure supplied in the
- * *rte_event_timer_adapter* structure associated with an event timer adapter.
- */
-
-typedef int (*rte_event_timer_adapter_init_t)(
-               struct rte_event_timer_adapter *adapter);
-/**< @internal Event timer adapter implementation setup */
-typedef int (*rte_event_timer_adapter_uninit_t)(
-               struct rte_event_timer_adapter *adapter);
-/**< @internal Event timer adapter implementation teardown */
-typedef int (*rte_event_timer_adapter_start_t)(
-               const struct rte_event_timer_adapter *adapter);
-/**< @internal Start running event timer adapter */
-typedef int (*rte_event_timer_adapter_stop_t)(
-               const struct rte_event_timer_adapter *adapter);
-/**< @internal Stop running event timer adapter */
-typedef void (*rte_event_timer_adapter_get_info_t)(
-               const struct rte_event_timer_adapter *adapter,
-               struct rte_event_timer_adapter_info *adapter_info);
-/**< @internal Get contextual information for event timer adapter */
-typedef int (*rte_event_timer_adapter_stats_get_t)(
-               const struct rte_event_timer_adapter *adapter,
-               struct rte_event_timer_adapter_stats *stats);
-/**< @internal Get statistics for event timer adapter */
-typedef int (*rte_event_timer_adapter_stats_reset_t)(
-               const struct rte_event_timer_adapter *adapter);
-/**< @internal Reset statistics for event timer adapter */
-
-/**
- * @internal Structure containing the functions exported by an event timer
- * adapter implementation.
- */
-struct rte_event_timer_adapter_ops {
-       rte_event_timer_adapter_init_t          init;  /**< Set up adapter */
-       rte_event_timer_adapter_uninit_t        uninit;/**< Tear down adapter */
-       rte_event_timer_adapter_start_t         start; /**< Start adapter */
-       rte_event_timer_adapter_stop_t          stop;  /**< Stop adapter */
-       rte_event_timer_adapter_get_info_t      get_info;
-       /**< Get info from driver */
-       rte_event_timer_adapter_stats_get_t     stats_get;
-       /**< Get adapter statistics */
-       rte_event_timer_adapter_stats_reset_t   stats_reset;
-       /**< Reset adapter statistics */
-       rte_event_timer_arm_burst_t             arm_burst;
-       /**< Arm one or more event timers */
-       rte_event_timer_arm_tmo_tick_burst_t    arm_tmo_tick_burst;
-       /**< Arm event timers with same expiration time */
-       rte_event_timer_cancel_burst_t          cancel_burst;
-       /**< Cancel one or more event timers */
-};
-
-/**
- * @internal Adapter data; structure to be placed in shared memory to be
- * accessible by various processes in a multi-process configuration.
- */
-struct rte_event_timer_adapter_data {
-       uint8_t id;
-       /**< Event timer adapter ID */
-       uint8_t event_dev_id;
-       /**< Event device ID */
-       uint32_t socket_id;
-       /**< Socket ID where memory is allocated */
-       uint8_t event_port_id;
-       /**< Optional: event port ID used when the inbuilt port is absent */
-       const struct rte_memzone *mz;
-       /**< Event timer adapter memzone pointer */
-       struct rte_event_timer_adapter_conf conf;
-       /**< Configuration used to configure the adapter. */
-       uint32_t caps;
-       /**< Adapter capabilities */
-       void *adapter_priv;
-       /**< Timer adapter private data*/
-       uint8_t service_inited;
-       /**< Service initialization state */
-       uint32_t service_id;
-       /**< Service ID*/
-
-       RTE_STD_C11
-       uint8_t started : 1;
-       /**< Flag to indicate adapter started. */
-} __rte_cache_aligned;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __RTE_EVENT_TIMER_ADAPTER_PMD_H__ */
index ad3217e..5764652 100644 (file)
@@ -142,7 +142,7 @@ int
 rte_event_timer_adapter_caps_get(uint8_t dev_id, uint32_t *caps)
 {
        struct rte_eventdev *dev;
-       const struct rte_event_timer_adapter_ops *ops;
+       const struct event_timer_adapter_ops *ops;
 
        RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);