mbuf: remove control mbuf
[dpdk.git] / doc / guides / prog_guide / service_cores.rst
1 ..  BSD LICENSE
2     Copyright(c) 2017 Intel Corporation. All rights reserved.
3     All rights reserved.
4
5     Redistribution and use in source and binary forms, with or without
6     modification, are permitted provided that the following conditions
7     are met:
8
9     * Redistributions of source code must retain the above copyright
10     notice, this list of conditions and the following disclaimer.
11     * Redistributions in binary form must reproduce the above copyright
12     notice, this list of conditions and the following disclaimer in
13     the documentation and/or other materials provided with the
14     distribution.
15     * Neither the name of Intel Corporation nor the names of its
16     contributors may be used to endorse or promote products derived
17     from this software without specific prior written permission.
18
19     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22     A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23     OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25     LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 Service Cores
32 =============
33
34 DPDK has a concept known as service cores, which enables a dynamic way of
35 performing work on DPDK lcores. Service core support is built into the EAL, and
36 an API is provided to optionally allow applications to control how the service
37 cores are used at runtime.
38
39 The service cores concept is built up out of services (components of DPDK that
40 require CPU cycles to operate) and service cores (DPDK lcores, tasked with
41 running services). The power of the service core concept is that the mapping
42 between service cores and services can be configured to abstract away the
43 difference between platforms and environments.
44
45 For example, the Eventdev has hardware and software PMDs. Of these the software
46 PMD requires an lcore to perform the scheduling operations, while the hardware
47 PMD does not. With service cores, the application would not directly notice
48 that the scheduling is done in software.
49
50 For detailed information about the service core API, please refer to the docs.
51
52 Service Core Initialization
53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
54
55 There are two methods to having service cores in a DPDK application, either by
56 using the service coremask, or by dynamically adding cores using the API.
57 The simpler of the two is to pass the `-s` coremask argument to EAL, which will
58 take any cores available in the main DPDK coremask, an if the bits are also set
59 in the service coremask the cores become service-cores instead of DPDK
60 application lcores.
61
62 Enabling Services on Cores
63 ~~~~~~~~~~~~~~~~~~~~~~~~~~
64
65 Each registered service can be individually mapped to a service core, or set of
66 service cores. Enabling a service on a particular core means that the lcore in
67 question will run the service. Disabling that core on the service stops the
68 lcore in question from running the service.
69
70 Using this method, it is possible to assign specific workloads to each
71 service core, and map N workloads to M number of service cores. Each service
72 lcore loops over the services that are enabled for that core, and invokes the
73 function to run the service.
74
75 Service Core Statistics
76 ~~~~~~~~~~~~~~~~~~~~~~~
77
78 The service core library is capable of collecting runtime statistics like number
79 of calls to a specific service, and number of cycles used by the service. The
80 cycle count collection is dynamically configurable, allowing any application to
81 profile the services running on the system at any time.