1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright(c) 2017 Intel Corporation. 3 4Software Eventdev Poll Mode Driver 5================================== 6 7The software eventdev is an implementation of the eventdev API, that provides a 8wide range of the eventdev features. The eventdev relies on a CPU core to 9perform event scheduling. This PMD can use the service core library to run the 10scheduling function, allowing an application to utilize the power of service 11cores to multiplex other work on the same core if required. 12 13 14Features 15-------- 16 17The software eventdev implements many features in the eventdev API; 18 19Queues 20 * Atomic 21 * Ordered 22 * Parallel 23 * Single-Link 24 25Ports 26 * Load balanced (for Atomic, Ordered, Parallel queues) 27 * Single Link (for single-link queues) 28 29Event Priorities 30 * Each event has a priority, which can be used to provide basic QoS 31 32 33Configuration and Options 34------------------------- 35 36The software eventdev is a vdev device, and as such can be created from the 37application code, or from the EAL command line: 38 39* Call ``rte_vdev_init("event_sw0")`` from the application 40 41* Use ``--vdev="event_sw0"`` in the EAL options, which will call 42 rte_vdev_init() internally 43 44Example: 45 46.. code-block:: console 47 48 ./your_eventdev_application --vdev="event_sw0" 49 50 51Scheduling Quanta 52~~~~~~~~~~~~~~~~~ 53 54The scheduling quanta sets the number of events that the device attempts to 55schedule in a single schedule call performed by the service core. Note that 56is a *hint* only, and that fewer or more events may be scheduled in a given 57iteration. 58 59The scheduling quanta can be set using a string argument to the vdev 60create call: 61 62.. code-block:: console 63 64 --vdev="event_sw0,sched_quanta=64" 65 66 67Credit Quanta 68~~~~~~~~~~~~~ 69 70The credit quanta is the number of credits that a port will fetch at a time from 71the instance's credit pool. Higher numbers will cause less overhead in the 72atomic credit fetch code, however it also reduces the overall number of credits 73in the system faster. A balanced number (e.g. 32) ensures that only small numbers 74of credits are pre-allocated at a time, while also mitigating performance impact 75of the atomics. 76 77Experimentation with higher values may provide minor performance improvements, 78at the cost of the whole system having less credits. On the other hand, 79reducing the quanta may cause measurable performance impact but provide the 80system with a higher number of credits at all times. 81 82A value of 32 seems a good balance however your specific application may 83benefit from a higher or reduced quanta size, experimentation is required to 84verify possible gains. 85 86.. code-block:: console 87 88 --vdev="event_sw0,credit_quanta=64" 89 90 91Limitations 92----------- 93 94The software eventdev implementation has a few limitations. The reason for 95these limitations is usually that the performance impact of supporting the 96feature would be significant. 97 98 99"All Types" Queues 100~~~~~~~~~~~~~~~~~~ 101 102The software eventdev does not support creating queues that handle all types of 103traffic. An eventdev with this capability allows enqueuing Atomic, Ordered and 104Parallel traffic to the same queue, but scheduling each of them appropriately. 105 106The reason to not allow Atomic, Ordered and Parallel event types in the 107same queue is that it causes excessive branching in the code to enqueue packets 108to the queue, causing a significant performance impact. 109 110The ``RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES`` flag is not set in the 111``event_dev_cap`` field of the ``rte_event_dev_info`` struct for the software 112eventdev. 113 114Distributed Scheduler 115~~~~~~~~~~~~~~~~~~~~~ 116 117The software eventdev is a centralized scheduler, requiring a service core to 118perform the required event distribution. This is not really a limitation but 119rather a design decision. 120 121The ``RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED`` flag is not set in the 122``event_dev_cap`` field of the ``rte_event_dev_info`` struct for the software 123eventdev. 124 125Dequeue Timeout 126~~~~~~~~~~~~~~~ 127 128The eventdev API supports a timeout when dequeuing packets using the 129``rte_event_dequeue_burst`` function. 130This allows a core to wait for an event to arrive, or until ``timeout`` number 131of ticks have passed. Timeout ticks is not supported by the software eventdev 132for performance reasons. 133