aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/perf/l2/10ge2p1x710-eth-l2bdbasemaclrn-oacl10sl-100kflows-ndrpdr.robot
blob: 5f9626d63605d800b8cf012f80af956f6841535e (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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Copyright (c) 2023 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 | 3_NODE_SINGLE_LINK_TOPO | PERFTEST | HW_ENV | NDRPDR
| ... | NIC_Intel-X710 | ETH | L2BDMACLRN | FEATURE | ACL | ACL_STATELESS
| ... | OACL | ACL10 | 100K_FLOWS | DRV_VFIO_PCI
| ... | RXQ_SIZE_0 | TXQ_SIZE_0
| ... | eth-l2bdbasemaclrn-oacl10sl-100kflows
|
| Suite Setup | Setup suite topology interfaces | performance
| Suite Teardown | Tear down suite | performance
| Test Setup | Setup test | performance
| Test Teardown | Tear down test | performance | acl
|
| 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-UDP 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 ACL rules are applied to input paths of both DUT1 intefaces. \
| ... | DUT1 and DUT2 are 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 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 UDP header \
| ... | 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 | perfmon_plugin.so | acl_plugin.so
| ${crypto_type}= | ${None}
| ${nic_name}= | Intel-X710
| ${nic_driver}= | vfio-pci
| ${nic_rxq_size}= | 0
| ${nic_txq_size}= | 0
| ${nic_pfs}= | 2
| ${nic_vfs}= | 0
| ${osi_layer}= | L2
| ${overhead}= | ${0}
# ACL test setup
| ${acl_action}= | permit
| ${acl_apply_type}= | output
| ${no_hit_aces_number}= | 10
| ${flows_per_dir}= | 100k
# starting points for non-hitting ACLs
| ${src_ip_start}= | 30.30.30.1
| ${dst_ip_start}= | 40.40.40.1
| ${ip_step}= | ${1}
| ${sport_start}= | ${1000}
| ${dport_start}= | ${1000}
| ${port_step}= | ${1}
| ${trex_stream1_subnet}= | 10.10.10.0/24
| ${trex_stream2_subnet}= | 20.20.20.0/24
# Traffic profile:
| ${traffic_profile}= | trex-stl-ethip4udp-100u1000p-conc

*** Keywords ***
| Local Template
| | [Documentation]
| | ... | - **[Cfg]** DUT runs IPv4 routing config. \
| | ... | Each DUT 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 with IPv4 ACLs in circular topology
| | Then Find NDR and PDR intervals using optimized search

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

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

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

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

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

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

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

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

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

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

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

| IMIX-4c-eth-l2bdbasemaclrn-oacl10sl-100kflows-ndrpdr
| | [Tags] | IMIX | 4C
| | frame_size=IMIX_v4_1 | phy_cores=${4}
"cm"> * A pointer to a ether_addr structure where to copy the Ethernet address. */ static inline void ether_addr_copy(const struct ether_addr *ea_from, struct ether_addr *ea_to) { #ifdef __INTEL_COMPILER uint16_t *from_words = (uint16_t *)(ea_from->addr_bytes); uint16_t *to_words = (uint16_t *)(ea_to->addr_bytes); to_words[0] = from_words[0]; to_words[1] = from_words[1]; to_words[2] = from_words[2]; #else /* * Use the common way, because of a strange gcc warning. */ *ea_to = *ea_from; #endif } #define ETHER_ADDR_FMT_SIZE 18 /** * Format 48bits Ethernet address in pattern xx:xx:xx:xx:xx:xx. * * @param buf * A pointer to buffer contains the formatted MAC address. * @param size * The format buffer size. * @param eth_addr * A pointer to a ether_addr structure. */ static inline void ether_format_addr(char *buf, uint16_t size, const struct ether_addr *eth_addr) { snprintf(buf, size, "%02X:%02X:%02X:%02X:%02X:%02X", eth_addr->addr_bytes[0], eth_addr->addr_bytes[1], eth_addr->addr_bytes[2], eth_addr->addr_bytes[3], eth_addr->addr_bytes[4], eth_addr->addr_bytes[5]); } /** * Ethernet header: Contains the destination address, source address * and frame type. */ struct ether_hdr { struct ether_addr d_addr; /**< Destination address. */ struct ether_addr s_addr; /**< Source address. */ uint16_t ether_type; /**< Frame type. */ } __attribute__((__packed__)); /** * Ethernet VLAN Header. * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type * of the encapsulated frame. */ struct vlan_hdr { uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */ uint16_t eth_proto;/**< Ethernet type of encapsulated frame. */ } __attribute__((__packed__)); /** * VXLAN protocol header. * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and * Reserved fields (24 bits and 8 bits) */ struct vxlan_hdr { uint32_t vx_flags; /**< flag (8) + Reserved (24). */ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __attribute__((__packed__)); /* Ethernet frame types */ #define ETHER_TYPE_IPv4 0x0800 /**< IPv4 Protocol. */ #define ETHER_TYPE_IPv6 0x86DD /**< IPv6 Protocol. */ #define ETHER_TYPE_ARP 0x0806 /**< Arp Protocol. */ #define ETHER_TYPE_RARP 0x8035 /**< Reverse Arp Protocol. */ #define ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */ #define ETHER_TYPE_QINQ 0x88A8 /**< IEEE 802.1ad QinQ tagging. */ #define ETHER_TYPE_1588 0x88F7 /**< IEEE 802.1AS 1588 Precise Time Protocol. */ #define ETHER_TYPE_SLOW 0x8809 /**< Slow protocols (LACP and Marker). */ #define ETHER_TYPE_TEB 0x6558 /**< Transparent Ethernet Bridging. */ #define ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr)) /**< VXLAN tunnel header length. */ /** * Extract VLAN tag information into mbuf * * Software version of VLAN stripping * * @param m * The packet mbuf. * @return * - 0: Success * - 1: not a vlan packet */ static inline int rte_vlan_strip(struct rte_mbuf *m) { struct ether_hdr *eh = rte_pktmbuf_mtod(m, struct ether_hdr *); if (eh->ether_type != rte_cpu_to_be_16(ETHER_TYPE_VLAN)) return -1; struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1); m->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED; m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci); /* Copy ether header over rather than moving whole packet */ memmove(rte_pktmbuf_adj(m, sizeof(struct vlan_hdr)), eh, 2 * ETHER_ADDR_LEN); return 0; } /** * Insert VLAN tag into mbuf. * * Software version of VLAN unstripping * * @param m * The packet mbuf. * @return * - 0: On success * -EPERM: mbuf is is shared overwriting would be unsafe * -ENOSPC: not enough headroom in mbuf */ static inline int rte_vlan_insert(struct rte_mbuf **m) { struct ether_hdr *oh, *nh; struct vlan_hdr *vh; /* Can't insert header if mbuf is shared */ if (rte_mbuf_refcnt_read(*m) > 1) { struct rte_mbuf *copy; copy = rte_pktmbuf_clone(*m, (*m)->pool); if (unlikely(copy == NULL)) return -ENOMEM; rte_pktmbuf_free(*m); *m = copy; } oh = rte_pktmbuf_mtod(*m, struct ether_hdr *); nh = (struct ether_hdr *) rte_pktmbuf_prepend(*m, sizeof(struct vlan_hdr)); if (nh == NULL) return -ENOSPC; memmove(nh, oh, 2 * ETHER_ADDR_LEN); nh->ether_type = rte_cpu_to_be_16(ETHER_TYPE_VLAN); vh = (struct vlan_hdr *) (nh + 1); vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci); (*m)->ol_flags &= ~PKT_RX_VLAN_STRIPPED; return 0; } #ifdef __cplusplus } #endif #endif /* _RTE_ETHER_H_ */