1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef __OTX2_EVDEV_H__
6 #define __OTX2_EVDEV_H__
8 #include <rte_eventdev.h>
10 #include "otx2_common.h"
12 #include "otx2_mempool.h"
14 #define EVENTDEV_NAME_OCTEONTX2_PMD otx2_eventdev
16 #define sso_func_trace otx2_sso_dbg
18 #define OTX2_SSO_MAX_VHGRP RTE_EVENT_MAX_QUEUES_PER_DEV
19 #define OTX2_SSO_MAX_VHWS (UINT8_MAX)
20 #define OTX2_SSO_FC_NAME "otx2_evdev_xaq_fc"
21 #define OTX2_SSO_XAQ_SLACK (8)
22 #define OTX2_SSO_XAQ_CACHE_CNT (0x7)
24 /* SSO LF register offsets (BAR2) */
25 #define SSO_LF_GGRP_OP_ADD_WORK0 (0x0ull)
26 #define SSO_LF_GGRP_OP_ADD_WORK1 (0x8ull)
28 #define SSO_LF_GGRP_QCTL (0x20ull)
29 #define SSO_LF_GGRP_EXE_DIS (0x80ull)
30 #define SSO_LF_GGRP_INT (0x100ull)
31 #define SSO_LF_GGRP_INT_W1S (0x108ull)
32 #define SSO_LF_GGRP_INT_ENA_W1S (0x110ull)
33 #define SSO_LF_GGRP_INT_ENA_W1C (0x118ull)
34 #define SSO_LF_GGRP_INT_THR (0x140ull)
35 #define SSO_LF_GGRP_INT_CNT (0x180ull)
36 #define SSO_LF_GGRP_XAQ_CNT (0x1b0ull)
37 #define SSO_LF_GGRP_AQ_CNT (0x1c0ull)
38 #define SSO_LF_GGRP_AQ_THR (0x1e0ull)
39 #define SSO_LF_GGRP_MISC_CNT (0x200ull)
41 #define USEC2NSEC(__us) ((__us) * 1E3)
43 enum otx2_sso_lf_type {
48 struct otx2_sso_evdev {
49 OTX2_DEV; /* Base class */
50 uint8_t max_event_queues;
51 uint8_t max_event_ports;
52 uint8_t is_timeout_deq;
53 uint8_t nb_event_queues;
54 uint8_t nb_event_ports;
57 uint32_t min_dequeue_timeout_ns;
58 uint32_t max_dequeue_timeout_ns;
59 int32_t max_num_events;
64 struct rte_mempool *xaq_pool;
69 uint32_t xaq_buf_size;
71 } __rte_cache_aligned;
73 static inline struct otx2_sso_evdev *
74 sso_pmd_priv(const struct rte_eventdev *event_dev)
76 return event_dev->data->dev_private;
80 parse_kvargs_value(const char *key, const char *value, void *opaque)
84 *(uint32_t *)opaque = (uint32_t)atoi(value);
88 /* Init and Fini API's */
89 int otx2_sso_init(struct rte_eventdev *event_dev);
90 int otx2_sso_fini(struct rte_eventdev *event_dev);
92 #endif /* __OTX2_EVDEV_H__ */