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 90Scheduler tuning arguments 91~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 93The scheduler minimum number of events that are processed can be increased to 94reduce per event overhead and increase internal burst sizes, which can 95improve throughput. 96 97* ``min_burst`` specifies the minimum number of inflight events that can be 98 moved to the next stage in the scheduler. Default value is 1. 99 100* ``refill_once`` is a switch that when set instructs the scheduler to deque 101 the events waiting in the ingress rings only once per call. The default 102 behavior is to dequeue as needed. 103 104* ``deq_burst`` is the burst size used to dequeue from the port rings. 105 Default value is 32, and it should be increased to 64 or 128 when setting 106 ``refill_once=1``. 107 108.. code-block:: console 109 110 --vdev="event_sw0,min_burst=8,deq_burst=64,refill_once=1" 111 112 113Limitations 114----------- 115 116The software eventdev implementation has a few limitations. The reason for 117these limitations is usually that the performance impact of supporting the 118feature would be significant. 119 120 121"All Types" Queues 122~~~~~~~~~~~~~~~~~~ 123 124The software eventdev does not support creating queues that handle all types of 125traffic. An eventdev with this capability allows enqueuing Atomic, Ordered and 126Parallel traffic to the same queue, but scheduling each of them appropriately. 127 128The reason to not allow Atomic, Ordered and Parallel event types in the 129same queue is that it causes excessive branching in the code to enqueue packets 130to the queue, causing a significant performance impact. 131 132The ``RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES`` flag is not set in the 133``event_dev_cap`` field of the ``rte_event_dev_info`` struct for the software 134eventdev. 135 136Distributed Scheduler 137~~~~~~~~~~~~~~~~~~~~~ 138 139The software eventdev is a centralized scheduler, requiring a service core to 140perform the required event distribution. This is not really a limitation but 141rather a design decision. 142 143The ``RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED`` flag is not set in the 144``event_dev_cap`` field of the ``rte_event_dev_info`` struct for the software 145eventdev. 146 147Dequeue Timeout 148~~~~~~~~~~~~~~~ 149 150The eventdev API supports a timeout when dequeuing packets using the 151``rte_event_dequeue_burst`` function. 152This allows a core to wait for an event to arrive, or until ``timeout`` number 153of ticks have passed. Timeout ticks is not supported by the software eventdev 154for performance reasons. 155