feat(docs): Add Methodology
[csit.git] / docs / content / methodology / per_thread_resources.md
1 ---
2 bookToc: false
3 title: "Per Thread Resources"
4 weight: 2
5 ---
6
7 # Per Thread Resources
8
9 CSIT test framework is managing mapping of the following resources per
10 thread:
11
12 1. Cores, physical cores (pcores) allocated as pairs of sibling logical cores
13    (lcores) if server in HyperThreading/SMT mode, or as single lcores
14    if server not in HyperThreading/SMT mode. Note that if server's
15    processors are running in HyperThreading/SMT mode sibling lcores are
16    always used.
17 2. Receive Queues (RxQ), packet receive queues allocated on each
18    physical and logical interface tested.
19 3. Transmit Queues(TxQ), packet transmit queues allocated on each
20    physical and logical interface tested.
21
22 Approach to mapping per thread resources depends on the application/DUT
23 tested (VPP or DPDK apps) and associated thread types, as follows:
24
25 1. Data-plane workers, used for data-plane packet processing, when no
26    feature workers present.
27
28    - Cores: data-plane workers are typically tested in 1, 2 and 4 pcore
29      configurations, running on single lcore per pcore or on sibling
30      lcores per pcore. Result is a set of {T}t{C}c thread-core
31      configurations, where{T} stands for a total number of threads
32      (lcores), and {C} for a total number of pcores. Tested
33      configurations are encoded in CSIT test case names,
34      e.g. "1c", "2c", "4c", and test tags "2T1C"(or "1T1C"), "4T2C"
35      (or "2T2C"), "8T4C" (or "4T4C").
36    - Interface Receive Queues (RxQ): as of CSIT-2106 release, number of
37      RxQs used on each physical or virtual interface is equal to the
38      number of data-plane workers. In other words each worker has a
39      dedicated RxQ on each interface tested. This ensures packet
40      processing load to be equal for each worker, subject to RSS flow
41      load balancing efficacy. Note: Before CSIT-2106 total number of
42      RxQs across all interfaces of specific type was equal to the
43      number of data-plane workers.
44    - Interface Transmit Queues (TxQ): number of TxQs used on each
45      physical or virtual interface is equal to the number of data-plane
46      workers. In other words each worker has a dedicated TxQ on each
47      interface tested.
48    - Applies to VPP and DPDK Testpmd and L3Fwd.
49
50 2. Data-plane and feature workers (e.g. IPsec async crypto workers), the
51    latter dedicated to specific feature processing.
52
53    - Cores: data-plane and feature workers are tested in 2, 3 and 4
54      pcore configurations, running on single lcore per pcore or on
55      sibling lcores per pcore. This results in a two sets of
56      thread-core combinations separated by "-", {T}t{C}c-{T}t{C}c, with
57      the leading set denoting total number of threads (lcores) and
58      pcores used for data-plane workers, and the trailing set denoting
59      total number of lcores and pcores used for feature workers.
60      Accordingly, tested configurations are encoded in CSIT test case
61      names, e.g. "1c-1c", "1c-2c", "1c-3c", and test tags "2T1C_2T1C"
62      (or "1T1C_1T1C"), "2T1C_4T2C"(or "1T1C_2T2C"), "2T1C_6T3C"
63      (or "1T1C_3T3C").
64    - RxQ and TxQ: no RxQs and no TxQs are used by feature workers.
65    - Applies to VPP only.
66
67 3. Management/main worker, control plane and management.
68
69    - Cores: single lcore.
70    - RxQ: not used (VPP default behaviour).
71    - TxQ: single TxQ per interface, allocated but not used
72      (VPP default behaviour).
73    - Applies to VPP only.
74
75 ## VPP Thread Configuration
76
77 Mapping of cores and RxQs to VPP data-plane worker threads is done in
78 the VPP startup.conf during test suite setup:
79
80 1. `corelist-workers <list_of_cores>`: List of logical cores to run VPP
81    data-plane workers and feature workers. The actual lcores'
82    allocations depends on HyperThreading/SMT server configuration and
83    per test core configuration.
84
85    - For tests without feature workers, by default, all CPU cores
86      configured in startup.conf are used for data-plane workers.
87    - For tests with feature workers, CSIT code distributes lcores across
88      data-plane and feature workers.
89
90 2. `num-rx-queues <value>`: Number of Rx queues used per interface.
91
92 Mapping of TxQs to VPP data-plane worker threads uses the default VPP
93 setting of one TxQ per interface per data-plane worker.
94
95 ## DPDK Thread Configuration
96
97 Mapping of cores and RxQs to DPDK Testpmd/L3Fwd data-plane worker
98 threads is done in the startup CLI:
99
100 1. `-l <list_of_cores>` - List of logical cores to run DPDK
101    application.
102 2. `nb-cores=<N>` - Number of forwarding cores.
103 3. `rxq=<N>` - Number of Rx queues used per interface.