aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/perf/l2/2n1l-10ge2p1x710-eth-l2bdbasemaclrn-ndrpdr.robot
blob: 5ec047b8c30d4ba41d2d3507bb9e08d929b6e3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Copyright (c) 2019 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Resource | resources/libraries/robot/shared/default.robot
| ...
| Force Tags | 2_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | NDRPDR
| ... | NIC_Intel-X710 | ETH | L2BDMACLRN | BASE | L2BDBASE | DRV_VFIO_PCI
| ...
| Suite Setup | Setup suite single link | performance
| Suite Teardown | Tear down suite | performance
| Test Setup | Setup test
| Test Teardown | Tear down test | performance
| ...
| Test Template | Local Template
| ...
| Documentation | *RFC2544: Pkt throughput L2BD test cases*
| ...
| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology\
| ... | with single links between nodes.
| ... | *[Enc] Packet Encapsulations:* Eth-IPv4 for L2 switching of IPv4.
| ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 bridge-domain\
| ... | and MAC learning enabled. DUT1 tested with ${nic_name}.\
| ... | *[Ver] TG verification:* TG finds and reports throughput NDR (Non Drop\
| ... | Rate) with zero packet loss tolerance and throughput PDR (Partial Drop\
| ... | Rate) with non-zero packet loss tolerance (LT) expressed in percentage\
| ... | of packets transmitted. NDR and PDR are discovered for different\
| ... | Ethernet L2 frame sizes using MLRsearch library.\
| ... | Test packets are generated by TG on links to DUT1. TG traffic profile\
| ... | contains two L3 flow-groups (flow-group per direction, 254 flows per\
| ... | flow-group) with all packets containing Ethernet header, IPv4 header\
| ... | with IP protocol=61 and static payload. MAC addresses are matching MAC\
| ... | addresses of the TG node interfaces.
| ... | *[Ref] Applicable standard specifications:* RFC2544.

*** Variables ***
| @{plugins_to_enable}= | dpdk_plugin.so
| ${crypto_type}= | ${None}
| ${nic_name}= | Intel-X710
| ${nic_driver}= | vfio-pci
| ${osi_layer}= | L2
| ${overhead}= | ${0}
# Traffic profile:
| ${traffic_profile}= | trex-sl-2n-ethip4-ip4src254

*** Keywords ***
| Local Template
| | [Documentation]
| | ... | [Cfg] DUT runs L2BD switching config and uses ${phy_cores} physical\
| | ... | core(s) for worker threads.
| | ... | [Ver] Measure NDR and PDR values using MLRsearch algorithm.\
| | ...
| | ... | *Arguments:*
| | ... | - frame_size - Framesize in Bytes in integer or string (IMIX_v4_1).
| | ... |   Type: integer, string
| | ... | - phy_cores - Number of physical cores. Type: integer
| | ... | - rxq - Number of RX queues, default value: ${None}. Type: integer
| | ...
| | [Arguments] | ${frame_size} | ${phy_cores} | ${rxq}=${None}
| | ...
| | Set Test Variable | \${frame_size}
| | ...
| | Given Set Max Rate And Jumbo
| | And Add worker threads to all DUTs | ${phy_cores} | ${rxq}
| | And Pre-initialize layer driver | ${nic_driver}
| | And Apply Startup configuration on all VPP DUTs
| | When Initialize layer driver | ${nic_driver}
| | And Initialize layer interface
| | And Initialize L2 bridge domain
| | Then Find NDR and PDR intervals using optimized search

*** Test Cases ***
| tc01-64B-1c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 64B | 1C
| | frame_size=${64} | phy_cores=${1}

| tc02-64B-2c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 64B | 2C
| | frame_size=${64} | phy_cores=${2}

| tc03-64B-4c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 64B | 4C
| | frame_size=${64} | phy_cores=${4}

| tc04-1518B-1c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 1518B | 1C
| | frame_size=${1518} | phy_cores=${1}

| tc05-1518B-2c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 1518B | 2C
| | frame_size=${1518} | phy_cores=${2}

| tc06-1518B-4c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 1518B | 4C
| | frame_size=${1518} | phy_cores=${4}

| tc07-9000B-1c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 9000B | 1C
| | frame_size=${9000} | phy_cores=${1}

| tc08-9000B-2c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 9000B | 2C
| | frame_size=${9000} | phy_cores=${2}

| tc09-9000B-4c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | 9000B | 4C
| | frame_size=${9000} | phy_cores=${4}

| tc10-IMIX-1c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | IMIX | 1C
| | frame_size=IMIX_v4_1 | phy_cores=${1}

| tc11-IMIX-2c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | IMIX | 2C
| | frame_size=IMIX_v4_1 | phy_cores=${2}

| tc12-IMIX-4c-eth-l2bdbasemaclrn-ndrpdr
| | [Tags] | IMIX | 4C
| | frame_size=IMIX_v4_1 | phy_cores=${4}
_index, buffers, nexts, VLIB_FRAME_SIZE, n_left, tmp); } buffers += VLIB_FRAME_SIZE; nexts += VLIB_FRAME_SIZE; count -= VLIB_FRAME_SIZE; } if (count) { u64 used_elt_bmp[VLIB_FRAME_SIZE / 64] = {}; next_index = nexts[0]; n_left = count; u32 off = 0; n_left = enqueue_one (vm, node, used_elt_bmp, next_index, buffers, nexts, count, n_left, tmp); while (n_left) { while (PREDICT_FALSE (used_elt_bmp[off] == ~0)) { off++; ASSERT (off < ARRAY_LEN (used_elt_bmp)); } next_index = nexts[off * 64 + count_trailing_zeros (~used_elt_bmp[off])]; n_left = enqueue_one (vm, node, used_elt_bmp, next_index, buffers, nexts, count, n_left, tmp); } } } CLIB_MARCH_FN_REGISTRATION (vlib_buffer_enqueue_to_next_fn); void __clib_section (".vlib_buffer_enqueue_to_single_next_fn") CLIB_MULTIARCH_FN (vlib_buffer_enqueue_to_single_next_fn) (vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 next_index, u32 count) { u32 *to_next, n_left_to_next, n_enq; vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); if (PREDICT_TRUE (n_left_to_next >= count)) { vlib_buffer_copy_indices (to_next, buffers, count); n_left_to_next -= count; vlib_put_next_frame (vm, node, next_index, n_left_to_next); return; } n_enq = n_left_to_next; next: vlib_buffer_copy_indices (to_next, buffers, n_enq); n_left_to_next -= n_enq; if (PREDICT_FALSE (count > n_enq)) { count -= n_enq; buffers += n_enq; vlib_put_next_frame (vm, node, next_index, n_left_to_next); vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); n_enq = clib_min (n_left_to_next, count); goto next; } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } CLIB_MARCH_FN_REGISTRATION (vlib_buffer_enqueue_to_single_next_fn); static inline vlib_frame_queue_elt_t * vlib_get_frame_queue_elt (vlib_frame_queue_main_t *fqm, u32 index, int dont_wait) { vlib_frame_queue_t *fq; u64 nelts, tail, new_tail; fq = fqm->vlib_frame_queues[index]; ASSERT (fq); nelts = fq->nelts; retry: tail = __atomic_load_n (&fq->tail, __ATOMIC_ACQUIRE); new_tail = tail + 1; if (new_tail >= fq->head + nelts) { if (dont_wait) return 0; /* Wait until a ring slot is available */ while (new_tail >= fq->head + nelts) vlib_worker_thread_barrier_check (); } if (!__atomic_compare_exchange_n (&fq->tail, &tail, new_tail, 0 /* weak */, __ATOMIC_RELAXED, __ATOMIC_RELAXED)) goto retry; return fq->elts + (new_tail & (nelts - 1)); } static_always_inline u32 vlib_buffer_enqueue_to_thread_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_queue_main_t *fqm, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion) { u32 drop_list[VLIB_FRAME_SIZE], n_drop = 0; u64 used_elts[VLIB_FRAME_SIZE / 64] = {}; u64 mask[VLIB_FRAME_SIZE / 64]; vlib_frame_queue_elt_t *hf = 0; u16 thread_index; u32 n_comp, off = 0, n_left = n_packets; thread_index = thread_indices[0]; more: clib_mask_compare_u16 (thread_index, thread_indices, mask, n_packets); hf = vlib_get_frame_queue_elt (fqm, thread_index, drop_on_congestion); n_comp = clib_compress_u32 (hf ? hf->buffer_index : drop_list + n_drop, buffer_indices, mask, n_packets); if (hf) { if (node->flags & VLIB_NODE_FLAG_TRACE) hf->maybe_trace = 1; hf->n_vectors = n_comp; __atomic_store_n (&hf->valid, 1, __ATOMIC_RELEASE); vlib_get_main_by_index (thread_index)->check_frame_queues = 1; } else n_drop += n_comp; n_left -= n_comp; if (n_left) { for (int i = 0; i < ARRAY_LEN (used_elts); i++) used_elts[i] |= mask[i]; while (PREDICT_FALSE (used_elts[off] == ~0)) { off++; ASSERT (off < ARRAY_LEN (used_elts)); } thread_index = thread_indices[off * 64 + count_trailing_zeros (~used_elts[off])]; goto more; } if (drop_on_congestion && n_drop) vlib_buffer_free (vm, drop_list, n_drop); return n_packets - n_drop; } u32 __clib_section (".vlib_buffer_enqueue_to_thread_fn") CLIB_MULTIARCH_FN (vlib_buffer_enqueue_to_thread_fn) (vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion) { vlib_thread_main_t *tm = vlib_get_thread_main (); vlib_frame_queue_main_t *fqm; u32 n_enq = 0; fqm = vec_elt_at_index (tm->frame_queue_mains, frame_queue_index); while (n_packets >= VLIB_FRAME_SIZE) { n_enq += vlib_buffer_enqueue_to_thread_inline ( vm, node, fqm, buffer_indices, thread_indices, VLIB_FRAME_SIZE, drop_on_congestion); buffer_indices += VLIB_FRAME_SIZE; thread_indices += VLIB_FRAME_SIZE; n_packets -= VLIB_FRAME_SIZE; } if (n_packets == 0) return n_enq; n_enq += vlib_buffer_enqueue_to_thread_inline (vm, node, fqm, buffer_indices, thread_indices, n_packets, drop_on_congestion); return n_enq; } CLIB_MARCH_FN_REGISTRATION (vlib_buffer_enqueue_to_thread_fn); u32 __clib_section (".vlib_frame_queue_dequeue_fn") CLIB_MULTIARCH_FN (vlib_frame_queue_dequeue_fn) (vlib_main_t *vm, vlib_frame_queue_main_t *fqm) { u32 thread_id = vm->thread_index; vlib_frame_queue_t *fq = fqm->vlib_frame_queues[thread_id]; u32 mask = fq->nelts - 1; vlib_frame_queue_elt_t *elt; u32 n_free, n_copy, *from, *to = 0, processed = 0, vectors = 0; vlib_frame_t *f = 0; ASSERT (fq); ASSERT (vm == vlib_global_main.vlib_mains[thread_id]); if (PREDICT_FALSE (fqm->node_index == ~0)) return 0; /* * Gather trace data for frame queues */ if (PREDICT_FALSE (fq->trace)) { frame_queue_trace_t *fqt; frame_queue_nelt_counter_t *fqh; u32 elix; fqt = &fqm->frame_queue_traces[thread_id]; fqt->nelts = fq->nelts; fqt->head = fq->head; fqt->tail = fq->tail; fqt->threshold = fq->vector_threshold; fqt->n_in_use = fqt->tail - fqt->head; if (fqt->n_in_use >= fqt->nelts) { // if beyond max then use max fqt->n_in_use = fqt->nelts - 1; } /* Record the number of elements in use in the histogram */ fqh = &fqm->frame_queue_histogram[thread_id]; fqh->count[fqt->n_in_use]++; /* Record a snapshot of the elements in use */ for (elix = 0; elix < fqt->nelts; elix++) { elt = fq->elts + ((fq->head + 1 + elix) & (mask)); if (1 || elt->valid) { fqt->n_vectors[elix] = elt->n_vectors; } } fqt->written = 1; } while (1) { if (fq->head == fq->tail) break; elt = fq->elts + ((fq->head + 1) & mask); if (!__atomic_load_n (&elt->valid, __ATOMIC_ACQUIRE)) break; from = elt->buffer_index + elt->offset; ASSERT (elt->offset + elt->n_vectors <= VLIB_FRAME_SIZE); if (f == 0) { f = vlib_get_frame_to_node (vm, fqm->node_index); to = vlib_frame_vector_args (f); n_free = VLIB_FRAME_SIZE; } if (elt->maybe_trace) f->frame_flags |= VLIB_NODE_FLAG_TRACE; n_copy = clib_min (n_free, elt->n_vectors); vlib_buffer_copy_indices (to, from, n_copy); to += n_copy; n_free -= n_copy; vectors += n_copy; if (n_free == 0) { f->n_vectors = VLIB_FRAME_SIZE; vlib_put_frame_to_node (vm, fqm->node_index, f); f = 0; } if (n_copy < elt->n_vectors) { /* not empty - leave it on the ring */ elt->n_vectors -= n_copy; elt->offset += n_copy; } else { /* empty - reset and bump head */ u32 sz = STRUCT_OFFSET_OF (vlib_frame_queue_elt_t, end_of_reset); clib_memset (elt, 0, sz); __atomic_store_n (&fq->head, fq->head + 1, __ATOMIC_RELEASE); processed++; } /* Limit the number of packets pushed into the graph */ if (vectors >= fq->vector_threshold) break; } if (f) { f->n_vectors = VLIB_FRAME_SIZE - n_free; vlib_put_frame_to_node (vm, fqm->node_index, f); } return processed; } CLIB_MARCH_FN_REGISTRATION (vlib_frame_queue_dequeue_fn); #ifndef CLIB_MARCH_VARIANT vlib_buffer_func_main_t vlib_buffer_func_main; static clib_error_t * vlib_buffer_funcs_init (vlib_main_t *vm) { vlib_buffer_func_main_t *bfm = &vlib_buffer_func_main; bfm->buffer_enqueue_to_next_fn = CLIB_MARCH_FN_POINTER (vlib_buffer_enqueue_to_next_fn); bfm->buffer_enqueue_to_single_next_fn = CLIB_MARCH_FN_POINTER (vlib_buffer_enqueue_to_single_next_fn); bfm->buffer_enqueue_to_thread_fn = CLIB_MARCH_FN_POINTER (vlib_buffer_enqueue_to_thread_fn); bfm->frame_queue_dequeue_fn = CLIB_MARCH_FN_POINTER (vlib_frame_queue_dequeue_fn); return 0; } VLIB_INIT_FUNCTION (vlib_buffer_funcs_init); #endif