6bdf0b347d5fe0ae056f828b4f203b4f50f71b09
[dpdk.git] / drivers / event / cnxk / cnxk_eventdev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef __CNXK_EVENTDEV_H__
6 #define __CNXK_EVENTDEV_H__
7
8 #include <rte_pci.h>
9
10 #include <eventdev_pmd_pci.h>
11
12 #include "roc_api.h"
13
14 #define USEC2NSEC(__us) ((__us)*1E3)
15
16 #define CNXK_SSO_MZ_NAME "cnxk_evdev_mz"
17
18 struct cnxk_sso_evdev {
19         struct roc_sso sso;
20         uint8_t max_event_queues;
21         uint8_t max_event_ports;
22         uint8_t is_timeout_deq;
23         uint8_t nb_event_queues;
24         uint8_t nb_event_ports;
25         uint32_t min_dequeue_timeout_ns;
26         uint32_t max_dequeue_timeout_ns;
27         int32_t max_num_events;
28         /* CN9K */
29         uint8_t dual_ws;
30 } __rte_cache_aligned;
31
32 static inline struct cnxk_sso_evdev *
33 cnxk_sso_pmd_priv(const struct rte_eventdev *event_dev)
34 {
35         return event_dev->data->dev_private;
36 }
37
38 /* Common ops API. */
39 int cnxk_sso_init(struct rte_eventdev *event_dev);
40 int cnxk_sso_fini(struct rte_eventdev *event_dev);
41 int cnxk_sso_remove(struct rte_pci_device *pci_dev);
42 void cnxk_sso_info_get(struct cnxk_sso_evdev *dev,
43                        struct rte_event_dev_info *dev_info);
44
45 #endif /* __CNXK_EVENTDEV_H__ */