1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Ericsson AB
8 #include <rte_event_ring.h>
9 #include <rte_eventdev.h>
11 #define DSW_PMD_NAME RTE_STR(event_dsw)
13 /* Code changes are required to allow more ports. */
14 #define DSW_MAX_PORTS (64)
15 #define DSW_MAX_PORT_DEQUEUE_DEPTH (128)
16 #define DSW_MAX_PORT_ENQUEUE_DEPTH (128)
18 #define DSW_MAX_QUEUES (16)
20 #define DSW_MAX_EVENTS (16384)
22 /* Code changes are required to allow more flows than 32k. */
23 #define DSW_MAX_FLOWS_BITS (15)
24 #define DSW_MAX_FLOWS (1<<(DSW_MAX_FLOWS_BITS))
25 #define DSW_MAX_FLOWS_MASK (DSW_MAX_FLOWS-1)
27 /* The rings are dimensioned so that all in-flight events can reside
28 * on any one of the port rings, to avoid the trouble of having to
29 * care about the case where there's no room on the destination port's
32 #define DSW_IN_RING_SIZE (DSW_MAX_EVENTS)
37 /* Keeping a pointer here to avoid container_of() calls, which
38 * are expensive since they are very frequent and will result
39 * in an integer multiplication (since the port id is an index
40 * into the dsw_evdev port array).
42 struct dsw_evdev *dsw;
44 uint16_t dequeue_depth;
45 uint16_t enqueue_depth;
47 int32_t new_event_threshold;
49 struct rte_event_ring *in_ring __rte_cache_aligned;
50 } __rte_cache_aligned;
53 uint8_t schedule_type;
54 uint8_t serving_ports[DSW_MAX_PORTS];
55 uint16_t num_serving_ports;
59 struct rte_eventdev_data *data;
61 struct dsw_port ports[DSW_MAX_PORTS];
63 struct dsw_queue queues[DSW_MAX_QUEUES];
67 static inline struct dsw_evdev *
68 dsw_pmd_priv(const struct rte_eventdev *eventdev)
70 return eventdev->data->dev_private;