aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2022-04-05 11:28:29 +0000
committerBeno�t Ganne <bganne@cisco.com>2022-04-05 14:17:38 +0000
commit61a2c8939d188ce2fc033695fe6dbf84b4ad61a6 (patch)
tree61b18081ec8b31f1fab8acb881e6a0f788d772fa /src/vnet/devices
parenta94563e12801ae2a3d69921d205dfd117caeae5b (diff)
devices: remove redundant code af-packet
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Id485f525057163582dc7a83f7dab7a8b2e759270
Diffstat (limited to 'src/vnet/devices')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c25
-rw-r--r--src/vnet/devices/af_packet/af_packet.h1
2 files changed, 3 insertions, 23 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index b84f5cd280e..c941d3763cf 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -191,16 +191,13 @@ af_packet_set_tx_queues (vlib_main_t *vm, af_packet_if_t *apif)
static int
create_packet_v3_sock (int host_if_index, tpacket_req3_t *rx_req,
tpacket_req3_t *tx_req, int *fd, af_packet_ring_t *ring,
- u32 *hdrlen_ptr, u8 *is_cksum_gso_enabled,
- u32 fanout_id, u8 is_fanout)
+ u8 *is_cksum_gso_enabled, u32 fanout_id, u8 is_fanout)
{
af_packet_main_t *apm = &af_packet_main;
struct sockaddr_ll sll;
socklen_t req_sz = sizeof (tpacket_req3_t);
int ret;
int ver = TPACKET_V3;
- u32 hdrlen = 0;
- u32 len = sizeof (hdrlen);
u32 ring_sz = 0;
if (rx_req)
@@ -241,18 +238,6 @@ create_packet_v3_sock (int host_if_index, tpacket_req3_t *rx_req,
goto error;
}
- if (getsockopt (*fd, SOL_PACKET, PACKET_HDRLEN, &hdrlen, &len) < 0)
- {
- vlib_log_err (
- apm->log_class,
- "Failed to get packet hdr len error handling option: %s (errno %d)",
- strerror (errno), errno);
- ret = VNET_API_ERROR_SYSCALL_ERROR_1;
- goto error;
- }
- else
- *hdrlen_ptr = hdrlen;
-
int opt = 1;
if (setsockopt (*fd, SOL_PACKET, PACKET_LOSS, &opt, sizeof (opt)) < 0)
{
@@ -357,7 +342,6 @@ af_packet_queue_init (vlib_main_t *vm, af_packet_if_t *apif,
u8 *ring_addr = 0;
u32 rx_frames_per_block, tx_frames_per_block;
u32 rx_frame_size, tx_frame_size;
- u32 hdrlen = 0;
u32 i = 0;
u8 is_cksum_gso_enabled = 0;
@@ -404,7 +388,7 @@ af_packet_queue_init (vlib_main_t *vm, af_packet_if_t *apif,
if (rx_queue || tx_queue)
{
ret = create_packet_v3_sock (apif->host_if_index, rx_req, tx_req, &fd,
- &ring, &hdrlen, &is_cksum_gso_enabled,
+ &ring, &is_cksum_gso_enabled,
apif->dev_instance, is_fanout);
if (ret != 0)
@@ -447,10 +431,7 @@ af_packet_queue_init (vlib_main_t *vm, af_packet_if_t *apif,
}
if (queue_id == 0)
- {
- apif->hdrlen = hdrlen;
- apif->is_cksum_gso_enabled = is_cksum_gso_enabled;
- }
+ apif->is_cksum_gso_enabled = is_cksum_gso_enabled;
return 0;
error:
diff --git a/src/vnet/devices/af_packet/af_packet.h b/src/vnet/devices/af_packet/af_packet.h
index 4cae700909a..1b24eef788c 100644
--- a/src/vnet/devices/af_packet/af_packet.h
+++ b/src/vnet/devices/af_packet/af_packet.h
@@ -96,7 +96,6 @@ typedef struct
u8 *host_if_name;
int host_if_index;
- u32 hdrlen;
u32 host_mtu;
u32 dev_instance;
ef='#n143'>143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
# Copyright (c) 2021 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 | 10K_FLOWS | DRV_VFIO_PCI
| ... | RXQ_SIZE_0 | TXQ_SIZE_0
| ... | eth-l2bdbasemaclrn-oacl10sl-10kflows
|
| 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}= | 10k
# 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-3n-ethip4udp-10u1000p-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-10kflows-ndrpdr
| | [Tags] | 64B | 1C
| | frame_size=${64} | phy_cores=${1}

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

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

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

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

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

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

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

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

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

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

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