aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/perf/ip4_tunnels/10ge2p1x520-ethip4lispip4-ip4base-mrr.robot
blob: f86f1bf419d94788586fa4bc9f53d0a57831c861 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright (c) 2018 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/performance/performance_setup.robot
| Resource | resources/libraries/robot/overlay/lisp_static_adjacency.robot
| Variables | resources/test_data/lisp/performance/lisp_static_adjacency.py
| ...
| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | MRR
| ... | NIC_Intel-X520-DA2 | IP4FWD | ENCAP | LISP | IP4UNRLAY | IP4OVRLAY
| ...
| Suite Setup | Set up 3-node performance topology with DUT's NIC model
| ... | L3 | Intel-X520-DA2
| Suite Teardown | Tear down 3-node performance topology
| ...
| Test Setup | Set up performance test
| ...
| Test Teardown | Tear down performance mrr test
| ...
| Test Template | Local template
| ...
| Documentation | *Raw results Lisp test cases*
| ...
| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
| ... | with single links between nodes.
| ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4 on DUT1-DUT2,\
| ... | Eth-IPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel.
| ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4\
| ... | routing and static routes. LISPoIPv4 tunnel is configured between DUT1\
| ... | and DUT2. DUT1 and DUT2 tested with 2p10GE NIC X520 Niantic by Intel.
| ... | *[Ver] TG verification:* In MaxReceivedRate test TG sends traffic
| ... | at line rate and reports total received/sent packets over trial period.
| ... | Test packets are generated by TG on links to DUTs. TG traffic profile
| ... | contains two L3 flow-groups (flow-group per direction, 253 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:* RFC6830.

*** Variables ***
# X520-DA2 bandwidth limit
| ${s_limit}= | ${10000000000}
| ${lisp_overhead}= | ${8}
# Traffic profile:
| ${traffic_profile}= | trex-sl-3n-ethip4-ip4src253

*** Keywords ***
| Local template
| | [Documentation]
| | ... | [Cfg] DUT runs IPv4 LISP remote static mappings and whitelist filters\
| | ... | config.
| | ... | Each DUT uses ${phy_cores} physical core(s) for worker threads.
| | ... | [Ver] Measure MaxReceivedRate for ${framesize}B frames using single\
| | ... | trial throughput test.
| | ...
| | ... | *Arguments:*
| | ... | - framesize - 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] | ${phy_cores} | ${framesize} | ${rxq}=${None}
| | ...
| | # Test Variables required for test execution and test teardown
| | Set Test Variable | ${framesize}
| | ${get_framesize}= | Get Frame Size | ${framesize}
| | ${max_rate}= | Calculate pps | ${s_limit}
| | ... | ${get_framesize + ${lisp_overhead}}
| | ...
| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq}
| | And Add PCI devices to all DUTs
| | And Run Keyword If | ${get_framesize + ${lisp_overhead}} < ${1522}
| | ... | Add no multi seg to all DUTs
| | And Apply startup configuration on all VPP DUTs
| | When Initialize LISP IPv4 forwarding in 3-node circular topology
| | ... | ${dut1_to_dut2_ip4} | ${dut1_to_tg_ip4} | ${dut2_to_dut1_ip4}
| | ... | ${dut2_to_tg_ip4} | ${prefix4}
| | And Configure LISP topology in 3-node circular topology
| | ... | ${dut1} | ${dut1_if2} | ${NONE}
| | ... | ${dut2} | ${dut2_if1} | ${NONE}
| | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
| | ... | ${dut1_ip4_static_adjacency} | ${dut2_ip4_static_adjacency}
| | Then Traffic should pass with maximum rate
| | ... | ${max_rate}pps | ${framesize} | ${traffic_profile}

*** Test Cases ***
| tc01-64B-1t1c-ethip4lispip4-ip4base-mrr
| | [Tags] | 64B | 1C
| | phy_cores=${1} | framesize=${64}

| tc02-1480B-1t1c-ethip4lispip4-ip4base-mrr
| | [Tags] | 1480B | 1C
| | phy_cores=${1} | framesize=${1480}

| tc03-9000B-1t1c-ethip4lispip4-ip4base-mrr
| | [Tags] | 9000B | 1C
| | phy_cores=${1} | framesize=${9000}

| tc04-IMIX-1t1c-ethip4lispip4-ip4base-mrr
| | [Tags] | IMIX | 1C
| | phy_cores=${1} | framesize=IMIX_v4_1

| tc05-64B-2t2c-ethip4lispip4-ip4base-mrr
| | [Tags] | 64B | 2C
| | phy_cores=${2} | framesize=${64}

| tc06-1480B-2t2c-ethip4lispip4-ip4base-mrr
| | [Tags] | 1480B | 2C
| | phy_cores=${2} | framesize=${1480}

| tc07-9000B-2t2c-ethip4lispip4-ip4base-mrr
| | [Tags] | 9000B | 2C
| | phy_cores=${2} | framesize=${9000}

| tc08-IMIX-2t2c-ethip4lispip4-ip4base-mrr
| | [Tags] | IMIX | 2C
| | phy_cores=${2} | framesize=IMIX_v4_1

| tc09-64B-4t4c-ethip4lispip4-ip4base-mrr
| | [Tags] | 64B | 4C
| | phy_cores=${4} | framesize=${64}

| tc10-1480B-4t4c-ethip4lispip4-ip4base-mrr
| | [Tags] | 1480B | 4C
| | phy_cores=${4} | framesize=${1480}

| tc11-9000B-4t4c-ethip4lispip4-ip4base-mrr
| | [Tags] | 9000B | 4C
| | phy_cores=${4} | framesize=${9000}

| tc12-IMIX-4t4c-ethip4lispip4-ip4base-mrr
| | [Tags] | IMIX | 4C
| | phy_cores=${4} | framesize=IMIX_v4_1
">(!ip4_is_fragment (ip0) || ip4_is_first_fragment (ip0)) { /* process leading fragment/whole packet (with L4 header) */ sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; rx_fib_index0 = fib_table_get_index_for_sw_if_index (FIB_PROTOCOL_IP4, sw_if_index0); make_ed_kv (&ed_kv0, &ip0->src_address, &ip0->dst_address, ip0->protocol, rx_fib_index0, udp0->src_port, udp0->dst_port); if (ip4_is_fragment (ip0)) { reass0 = nat_ip4_reass_find_or_create (ip0->src_address, ip0->dst_address, ip0->fragment_id, ip0->protocol, 1, &fragments_to_drop); if (PREDICT_FALSE (!reass0)) { next0 = NAT44_CLASSIFY_NEXT_DROP; b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_REASS]; nat_log_notice ("maximum reassemblies exceeded"); goto enqueue0; } if (!clib_bihash_search_16_8 (&tsm->in2out_ed, &ed_kv0, &ed_value0)) { /* session exists so classify as IN2OUT, * save this information for future fragments and set * past fragments to be looped over and reprocessed */ reass0->sess_index = ed_value0.value; reass0->classify_next = NAT_REASS_IP4_CLASSIFY_NEXT_IN2OUT; nat_ip4_reass_get_frags (reass0, &fragments_to_loopback); goto enqueue0; } else { /* session doesn't exist so continue in the code, * save this information for future fragments and set * past fragments to be looped over and reprocessed */ reass0->flags |= NAT_REASS_FLAG_CLASSIFY_ED_CONTINUE; nat_ip4_reass_get_frags (reass0, &fragments_to_loopback); } } else { /* process whole packet */ if (!clib_bihash_search_16_8 (&tsm->in2out_ed, &ed_kv0, &ed_value0)) goto enqueue0; /* session doesn't exist so continue in code */ } } else { /* process non-first fragment */ reass0 = nat_ip4_reass_find_or_create (ip0->src_address, ip0->dst_address, ip0->fragment_id, ip0->protocol, 1, &fragments_to_drop); if (PREDICT_FALSE (!reass0)) { next0 = NAT44_CLASSIFY_NEXT_DROP; b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_REASS]; nat_log_notice ("maximum reassemblies exceeded"); goto enqueue0; } /* check if first fragment has arrived */ if (reass0->classify_next == NAT_REASS_IP4_CLASSIFY_NONE && !(reass0->flags & NAT_REASS_FLAG_CLASSIFY_ED_CONTINUE)) { /* first fragment still hasn't arrived, cache this fragment */ if (nat_ip4_reass_add_fragment (reass0, bi0, &fragments_to_drop)) { b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_FRAG]; nat_log_notice ("maximum fragments per reassembly exceeded"); next0 = NAT44_CLASSIFY_NEXT_DROP; goto enqueue0; } cached0 = 1; goto enqueue0; } if (reass0->classify_next == NAT_REASS_IP4_CLASSIFY_NEXT_IN2OUT) goto enqueue0; /* flag NAT_REASS_FLAG_CLASSIFY_ED_CONTINUE is set * so keep the default next0 and continue in code to * potentially find other classification for this packet */ } } /* *INDENT-OFF* */ vec_foreach (ap, sm->addresses) { if (ip0->dst_address.as_u32 == ap->addr.as_u32) { next0 = NAT44_CLASSIFY_NEXT_OUT2IN; goto enqueue0; } } /* *INDENT-ON* */ if (PREDICT_FALSE (pool_elts (sm->static_mappings))) { m_key0.addr = ip0->dst_address; m_key0.port = 0; m_key0.protocol = 0; m_key0.fib_index = 0; kv0.key = m_key0.as_u64; /* try to classify the fragment based on IP header alone */ if (!clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv0, &value0)) { m = pool_elt_at_index (sm->static_mappings, value0.value); if (m->local_addr.as_u32 != m->external_addr.as_u32) next0 = NAT44_CLASSIFY_NEXT_OUT2IN; goto enqueue0; } if (!ip4_is_fragment (ip0) || ip4_is_first_fragment (ip0)) { /* process leading fragment/whole packet (with L4 header) */ m_key0.port = clib_net_to_host_u16 (udp0->dst_port); m_key0.protocol = ip_proto_to_snat_proto (ip0->protocol); kv0.key = m_key0.as_u64; if (!clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv0, &value0)) { m = pool_elt_at_index (sm->static_mappings, value0.value); if (m->local_addr.as_u32 != m->external_addr.as_u32) next0 = NAT44_CLASSIFY_NEXT_OUT2IN; } if (ip4_is_fragment (ip0)) { reass0 = nat_ip4_reass_find_or_create (ip0->src_address, ip0->dst_address, ip0->fragment_id, ip0->protocol, 1, &fragments_to_drop); if (PREDICT_FALSE (!reass0)) { next0 = NAT44_CLASSIFY_NEXT_DROP; b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_REASS]; nat_log_notice ("maximum reassemblies exceeded"); goto enqueue0; } /* save classification for future fragments and set past * fragments to be looped over and reprocessed */ if (next0 == NAT44_CLASSIFY_NEXT_OUT2IN) reass0->classify_next = NAT_REASS_IP4_CLASSIFY_NEXT_OUT2IN; else reass0->classify_next = NAT_REASS_IP4_CLASSIFY_NEXT_IN2OUT; nat_ip4_reass_get_frags (reass0, &fragments_to_loopback); } } else { /* process non-first fragment */ reass0 = nat_ip4_reass_find_or_create (ip0->src_address, ip0->dst_address, ip0->fragment_id, ip0->protocol, 1, &fragments_to_drop); if (PREDICT_FALSE (!reass0)) { next0 = NAT44_CLASSIFY_NEXT_DROP; b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_REASS]; nat_log_notice ("maximum reassemblies exceeded"); goto enqueue0; } if (reass0->classify_next == NAT_REASS_IP4_CLASSIFY_NONE) /* first fragment still hasn't arrived */ { if (nat_ip4_reass_add_fragment (reass0, bi0, &fragments_to_drop)) { b0->error = node->errors[NAT44_CLASSIFY_ERROR_MAX_FRAG]; nat_log_notice ("maximum fragments per reassembly exceeded"); next0 = NAT44_CLASSIFY_NEXT_DROP; goto enqueue0; } cached0 = 1; goto enqueue0; } else if (reass0->classify_next == NAT_REASS_IP4_CLASSIFY_NEXT_OUT2IN) next0 = NAT44_CLASSIFY_NEXT_OUT2IN; else if (reass0->classify_next == NAT_REASS_IP4_CLASSIFY_NEXT_IN2OUT) next0 = NAT44_CLASSIFY_NEXT_IN2OUT; } } enqueue0: if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && (b0->flags & VLIB_BUFFER_IS_TRACED))) { nat44_classify_trace_t *t = vlib_add_trace (vm, node, b0, sizeof (*t)); t->cached = cached0; if (!cached0) t->next_in2out = next0 == NAT44_CLASSIFY_NEXT_IN2OUT ? 1 : 0; } if (cached0) { n_left_to_next++; to_next--; } else /* verify speculative enqueue, maybe switch current next frame */ vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); if (n_left_from == 0 && vec_len (fragments_to_loopback)) { from = vlib_frame_vector_args (frame); u32 len = vec_len (fragments_to_loopback); if (len <= VLIB_FRAME_SIZE) { clib_memcpy (from, fragments_to_loopback, sizeof (u32) * len); n_left_from = len; vec_reset_length (fragments_to_loopback); } else { clib_memcpy (from, fragments_to_loopback + (len - VLIB_FRAME_SIZE), sizeof (u32) * VLIB_FRAME_SIZE); n_left_from = VLIB_FRAME_SIZE; _vec_len (fragments_to_loopback) = len - VLIB_FRAME_SIZE; } } } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } nat_send_all_to_node (vm, fragments_to_drop, node, 0, NAT44_CLASSIFY_NEXT_DROP); vec_free (fragments_to_drop); return frame->n_vectors; } static uword nat44_classify_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return nat44_classify_node_fn_inline (vm, node, frame, 0); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat44_classify_node) = { .function = nat44_classify_node_fn, .name = "nat44-classify", .vector_size = sizeof (u32), .format_trace = format_nat44_classify_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN(nat44_classify_error_strings), .error_strings = nat44_classify_error_strings, .n_next_nodes = NAT44_CLASSIFY_N_NEXT, .next_nodes = { [NAT44_CLASSIFY_NEXT_IN2OUT] = "nat44-in2out", [NAT44_CLASSIFY_NEXT_OUT2IN] = "nat44-out2in", [NAT44_CLASSIFY_NEXT_DROP] = "error-drop", }, }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (nat44_classify_node, nat44_classify_node_fn); static uword nat44_ed_classify_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return nat44_classify_node_fn_inline (vm, node, frame, 1); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat44_ed_classify_node) = { .function = nat44_ed_classify_node_fn, .name = "nat44-ed-classify", .vector_size = sizeof (u32), .format_trace = format_nat44_classify_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_next_nodes = NAT44_CLASSIFY_N_NEXT, .next_nodes = { [NAT44_CLASSIFY_NEXT_IN2OUT] = "nat44-ed-in2out", [NAT44_CLASSIFY_NEXT_OUT2IN] = "nat44-ed-out2in", [NAT44_CLASSIFY_NEXT_DROP] = "error-drop", }, }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (nat44_ed_classify_node, nat44_ed_classify_node_fn); static uword nat44_det_classify_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return nat44_classify_node_fn_inline (vm, node, frame, 0); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat44_det_classify_node) = { .function = nat44_det_classify_node_fn, .name = "nat44-det-classify", .vector_size = sizeof (u32), .format_trace = format_nat44_classify_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_next_nodes = NAT44_CLASSIFY_N_NEXT, .next_nodes = { [NAT44_CLASSIFY_NEXT_IN2OUT] = "nat44-det-in2out", [NAT44_CLASSIFY_NEXT_OUT2IN] = "nat44-det-out2in", [NAT44_CLASSIFY_NEXT_DROP] = "error-drop", }, }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (nat44_det_classify_node, nat44_det_classify_node_fn); static uword nat44_handoff_classify_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { return nat44_classify_node_fn_inline (vm, node, frame, 0); } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat44_handoff_classify_node) = { .function = nat44_handoff_classify_node_fn, .name = "nat44-handoff-classify", .vector_size = sizeof (u32), .format_trace = format_nat44_classify_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_next_nodes = NAT44_CLASSIFY_N_NEXT, .next_nodes = { [NAT44_CLASSIFY_NEXT_IN2OUT] = "nat44-in2out-worker-handoff", [NAT44_CLASSIFY_NEXT_OUT2IN] = "nat44-out2in-worker-handoff", [NAT44_CLASSIFY_NEXT_DROP] = "error-drop", }, }; VLIB_NODE_FUNCTION_MULTIARCH (nat44_handoff_classify_node, nat44_handoff_classify_node_fn); /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */