aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/perf/l2/10ge2p1x520-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr.robot
blob: 9bc5c86deb052d7ef6b93f05bf0d7090546e68f7 (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
144
145
146
# 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
| ...
| Force Tags | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | NDRPDR
| ... | NIC_Intel-X520-DA2 | ETH | L2BDMACLRN | FEATURE | MACIP | ACL_STATELESS
| ... | IACL | ACL50 | 10k_FLOWS
| ...
| Suite Setup | Run Keywords
| ... | Set up 3-node performance topology with DUT's NIC model | L2
| ... | Intel-X520-DA2
| ... | AND | Set up performance test suite with ACL
| ...
| Suite Teardown | Tear down 3-node performance topology
| ...
| Test Setup | Set up performance test
| ...
| Test Teardown | Tear down performance test with MACIP ACL
| ... | ${min_rate}pps | ${framesize} | ${traffic_profile}
| ...
| Test Template | Local Template
| ...
| Documentation | *RFC2544: Packet throughput L2BD test cases with ACL*
| ...
| ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-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. DUT2 is configured with L2 cross-connects.\
| ... | Required MACIP ACL rules are applied to input paths of both DUT1\
| ... | interfaces. DUT1 and DUT2 are tested with 2p10GE NIC X520 Niantic by\
| ... | Intel.
| ... | *[Ver] TG verification:* TG finds and reports throughput NDR (Non Drop\
| ... | Rate) with zero packet loss tolerance or 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 DUTs. TG traffic profile contains two L3 flow-groups\
| ... | (flow-group per direction, ${flows_per_dir} 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 ***
# X520-DA2 bandwidth limit
| ${s_limit}= | ${10000000000}

# ACL test setup
| ${acl_action}= | permit
| ${no_hit_aces_number}= | 50
| ${flows_per_dir}= | 10k

# starting points for non-hitting ACLs
| ${src_ip_start}= | 30.30.30.1
| ${ip_step}= | ${1}
| ${src_mac_start}= | 01:02:03:04:05:06
| ${src_mac_step}= | ${1000}
| ${src_mac_mask}= | 00:00:00:00:00:00
| ${tg_stream1_mac}= | ca:fe:00:00:00:00
| ${tg_stream2_mac}= | fa:ce:00:00:00:00
| ${tg_mac_mask}= | ff:ff:ff:ff:c0:00
| ${tg_stream1_subnet}= | 10.0.0.0/18
| ${tg_stream2_subnet}= | 20.0.0.0/18

# traffic profile
| ${traffic_profile}= | trex-sl-3n-ethip4-macsrc10kip4src10k

*** Keywords ***
| Local Template
| | [Documentation] | FIXME.
| | [Arguments] | ${framesize} | ${phy_cores} | ${rxq}=${None}
| | ...
| | Set Test Variable | ${framesize}
| | Set Test Variable | ${min_rate} | ${10000}
| | ...
| | Given Add worker threads and rxqueues to all DUTs | ${phy_cores} | ${rxq}
| | And Add PCI devices to all DUTs
| | ${max_rate} | ${jumbo} = | Get Max Rate And Jumbo And Handle Multi Seg
| | ... | ${s_limit} | ${framesize}
| | And Apply startup configuration on all VPP DUTs
| | When Initialize L2 bridge domain with MACIP ACLs on DUT1 in 3-node circular topology
| | Then Find NDR and PDR intervals using optimized search
| | ... | ${framesize} | ${traffic_profile} | ${min_rate} | ${max_rate}

*** Test Cases ***
| tc01-64B-1c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 64B | 1C
| | framesize=${64} | phy_cores=${1}

| tc02-64B-2c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 64B | 2C
| | framesize=${64} | phy_cores=${2}

| tc03-64B-4c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 64B | 4C
| | framesize=${64} | phy_cores=${4}

| tc04-1518B-1c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 1518B | 1C
| | framesize=${1518} | phy_cores=${1}

| tc05-1518B-2c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 1518B | 2C
| | framesize=${1518} | phy_cores=${2}

| tc06-1518B-4c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 1518B | 4C
| | framesize=${1518} | phy_cores=${4}

| tc07-9000B-1c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 9000B | 1C
| | framesize=${9000} | phy_cores=${1}

| tc08-9000B-2c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 9000B | 2C
| | framesize=${9000} | phy_cores=${2}

| tc09-9000B-4c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | 9000B | 4C
| | framesize=${9000} | phy_cores=${4}

| tc10-IMIX-1c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | IMIX | 1C
| | framesize=IMIX_v4_1 | phy_cores=${1}

| tc11-IMIX-2c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | IMIX | 2C
| | framesize=IMIX_v4_1 | phy_cores=${2}

| tc12-IMIX-4c-eth-l2bdbasemaclrn-macip-iacl50sl-10kflows-ndrpdr
| | [Tags] | IMIX | 4C
| | framesize=IMIX_v4_1 | phy_cores=${4}
an class="n">vnet_get_main (), hi->hw_if_index); vnet_hw_interface_walk_sw (vnet_get_main (), hi->hw_if_index, lcp_itf_pair_walk_sync_state_hw_cb, NULL); } static clib_error_t * lcp_itf_admin_state_change (vnet_main_t *vnm, u32 sw_if_index, u32 flags) { lcp_itf_pair_t *lip; vnet_hw_interface_t *hi; vnet_sw_interface_t *si; if (!lcp_sync ()) return 0; LCP_ITF_PAIR_DBG ("admin_state_change: sw %U %u", format_vnet_sw_if_index_name, vnm, sw_if_index, flags); // Sync interface state changes into host lip = lcp_itf_pair_get (lcp_itf_pair_find_by_phy (sw_if_index)); if (!lip) return NULL; LCP_ITF_PAIR_INFO ("admin_state_change: %U flags %u", format_lcp_itf_pair, lip, flags); if (vnet_sw_interface_is_sub (vnm, sw_if_index)) { lcp_itf_pair_sync_state (lip); return NULL; } // When Linux changes link on a parent interface, all of its children also // change. If a parent interface changes MTU, all of its children are clamped // at that MTU by Linux. Neither holds true in VPP, so we are forced to undo // change by walking the sub-interfaces of a phy and syncing their state back // into Linux. si = vnet_get_sw_interface_or_null (vnm, sw_if_index); if (!si) return NULL; hi = vnet_get_hw_interface_or_null (vnm, si->hw_if_index); if (!hi) return NULL; LCP_ITF_PAIR_DBG ("admin_state_change: si %U hi %U, syncing children", format_vnet_sw_if_index_name, vnm, si->sw_if_index, format_vnet_sw_if_index_name, vnm, hi->sw_if_index); lcp_itf_pair_sync_state_hw (hi); return NULL; } VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (lcp_itf_admin_state_change); static clib_error_t * lcp_itf_mtu_change (vnet_main_t *vnm, u32 sw_if_index, u32 flags) { vnet_sw_interface_t *si; vnet_hw_interface_t *hi; if (!lcp_sync ()) return NULL; LCP_ITF_PAIR_DBG ("mtu_change: sw %U %u", format_vnet_sw_if_index_name, vnm, sw_if_index, flags); if (vnet_sw_interface_is_sub (vnm, sw_if_index)) { lcp_itf_pair_t *lip; lip = lcp_itf_pair_get (lcp_itf_pair_find_by_phy (sw_if_index)); if (lip) lcp_itf_pair_sync_state (lip); return NULL; } // When Linux changes link on a parent interface, all of its children also // change. If a parent interface changes MTU, all of its children are clamped // at that MTU by Linux. Neither holds true in VPP, so we are forced to undo // change by walking the sub-interfaces of a phy and syncing their state back // into Linux. si = vnet_get_sw_interface_or_null (vnm, sw_if_index); if (!si) return NULL; hi = vnet_get_hw_interface_or_null (vnm, si->hw_if_index); if (!hi) return NULL; LCP_ITF_PAIR_DBG ("mtu_change: si %U hi %U, syncing children", format_vnet_sw_if_index_name, vnm, si->sw_if_index, format_vnet_sw_if_index_name, vnm, hi->sw_if_index); lcp_itf_pair_sync_state_hw (hi); return NULL; } VNET_SW_INTERFACE_MTU_CHANGE_FUNCTION (lcp_itf_mtu_change); static void lcp_itf_ip4_add_del_interface_addr (ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del) { const lcp_itf_pair_t *lip; int curr_ns_fd = -1; int vif_ns_fd = -1; if (!lcp_sync ()) return; LCP_ITF_PAIR_DBG ("ip4_addr_%s: si:%U %U/%u", is_del ? "del" : "add", format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, format_ip4_address, address, address_length); lip = lcp_itf_pair_get (lcp_itf_pair_find_by_phy (sw_if_index)); if (!lip) return; if (lip->lip_namespace) { curr_ns_fd = clib_netns_open (NULL /* self */); vif_ns_fd = clib_netns_open (lip->lip_namespace); if (vif_ns_fd != -1) clib_setns (vif_ns_fd); } LCP_ITF_PAIR_DBG ("ip4_addr_%s: %U ip4 %U/%u", is_del ? "del" : "add", format_lcp_itf_pair, lip, format_ip4_address, address, address_length); if (is_del) vnet_netlink_del_ip4_addr (lip->lip_vif_index, address, address_length); else vnet_netlink_add_ip4_addr (lip->lip_vif_index, address, address_length); if (vif_ns_fd != -1) close (vif_ns_fd); if (curr_ns_fd != -1) { clib_setns (curr_ns_fd); close (curr_ns_fd); } return; } static void lcp_itf_ip6_add_del_interface_addr (ip6_main_t *im, uword opaque, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 if_address_index, u32 is_del) { const lcp_itf_pair_t *lip; int curr_ns_fd = -1; int vif_ns_fd = -1; if (!lcp_sync ()) return; LCP_ITF_PAIR_DBG ("ip6_addr_%s: si:%U %U/%u", is_del ? "del" : "add", format_vnet_sw_if_index_name, vnet_get_main (), sw_if_index, format_ip6_address, address, address_length); lip = lcp_itf_pair_get (lcp_itf_pair_find_by_phy (sw_if_index)); if (!lip) return; if (lip->lip_namespace) { curr_ns_fd = clib_netns_open (NULL /* self */); vif_ns_fd = clib_netns_open (lip->lip_namespace); if (vif_ns_fd != -1) clib_setns (vif_ns_fd); } LCP_ITF_PAIR_DBG ("ip6_addr_%s: %U ip4 %U/%u", is_del ? "del" : "add", format_lcp_itf_pair, lip, format_ip6_address, address, address_length); if (is_del) vnet_netlink_del_ip6_addr (lip->lip_vif_index, address, address_length); else vnet_netlink_add_ip6_addr (lip->lip_vif_index, address, address_length); if (vif_ns_fd != -1) close (vif_ns_fd); if (curr_ns_fd != -1) { clib_setns (curr_ns_fd); close (curr_ns_fd); } } static clib_error_t * lcp_itf_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_create) { const vnet_sw_interface_t *sw; uword is_sub; if (!lcp_auto_subint ()) return NULL; sw = vnet_get_sw_interface_or_null (vnm, sw_if_index); if (!sw) return NULL; is_sub = vnet_sw_interface_is_sub (vnm, sw_if_index); if (!is_sub) return NULL; LCP_ITF_PAIR_DBG ("interface_%s: sw %U parent %U", is_create ? "add" : "del", format_vnet_sw_if_index_name, vnet_get_main (), sw->sw_if_index, format_vnet_sw_if_index_name, vnet_get_main (), sw->sup_sw_if_index); if (is_create) { const lcp_itf_pair_t *sup_lip; u8 *name = 0; // If the parent has a LIP auto-create a LIP for this interface sup_lip = lcp_itf_pair_get (lcp_itf_pair_find_by_phy (sw->sup_sw_if_index)); if (!sup_lip) return NULL; name = format (name, "%s.%d", sup_lip->lip_host_name, sw->sub.id); LCP_ITF_PAIR_INFO ( "interface_%s: %U has parent %U, auto-creating LCP with host-if %s", is_create ? "add" : "del", format_vnet_sw_if_index_name, vnet_get_main (), sw->sw_if_index, format_lcp_itf_pair, sup_lip, name); lcp_itf_pair_create (sw->sw_if_index, name, LCP_ITF_HOST_TAP, sup_lip->lip_namespace, NULL); vec_free (name); } else { lcp_itf_pair_delete (sw_if_index); } return NULL; } VNET_SW_INTERFACE_ADD_DEL_FUNCTION (lcp_itf_interface_add_del); static clib_error_t * lcp_itf_sync_init (vlib_main_t *vm) { ip4_main_t *im4 = &ip4_main; ip6_main_t *im6 = &ip6_main; ip4_add_del_interface_address_callback_t cb4; ip6_add_del_interface_address_callback_t cb6; cb4.function = lcp_itf_ip4_add_del_interface_addr; cb4.function_opaque = 0; vec_add1 (im4->add_del_interface_address_callbacks, cb4); cb6.function = lcp_itf_ip6_add_del_interface_addr; cb6.function_opaque = 0; vec_add1 (im6->add_del_interface_address_callbacks, cb6); return NULL; } VLIB_INIT_FUNCTION (lcp_itf_sync_init) = { .runs_after = VLIB_INITS ("vnet_interface_init", "tcp_init", "udp_init"), }; /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */