-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dpapp] Initial dpapp implementation being a vpp plugin (#609)
Following dpapp HLD - #606, this is the 3th part implementation. It implements the basic logic of inline flow creation, deletion and ageout. - Build with command `make dpapp` - Run with command `make run-dpapp`
- Loading branch information
Showing
20 changed files
with
2,167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -559,6 +559,7 @@ sai | |
saic | ||
SAIC | ||
saichallenger | ||
saidashdpapp | ||
saigen | ||
sairedis | ||
SAIRPC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(dash-plugin) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I /SAI/SAI/inc -I /SAI/SAI/experimental") | ||
|
||
find_package(VPP) | ||
|
||
add_subdirectory(dash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
SHELL=/bin/bash | ||
BUILD_DIR=build | ||
CMAKE_ARGS= | ||
|
||
ifeq ($(V),1) | ||
CMAKE_ARGS += --verbose | ||
endif | ||
|
||
all: dpapp | ||
|
||
.PHONY:configure install clean | ||
|
||
configure: | ||
@cmake $(CMAKE_ARGS) -G Ninja -S . -B $(BUILD_DIR) | ||
|
||
dpapp: configure | ||
@cmake --build $(BUILD_DIR) $(CMAKE_ARGS) | ||
|
||
clean: | ||
@cmake --build $(BUILD_DIR) $(CMAKE_ARGS) -- clean | ||
|
||
install: | ||
@sudo cmake --build $(BUILD_DIR) $(CMAKE_ARGS) -- install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# DPAPP - Data Plane Application | ||
## Overview | ||
DPAPP fulfills [VPP](https://fd.io/) plugin mechanism to implement the slow (exception) path of | ||
packet processing. It works with [DASH pipeline BMv2](https://github.com/sonic-net/DASH/tree/main/dash-pipeline/bmv2), | ||
serving fast path, to consist of a complete DASH data plane. Refer to the doc | ||
[bmv2 data plane app](https://github.com/sonic-net/DASH/blob/main/documentation/dataplane/dash-bmv2-data-plane-app.md) | ||
for design details. | ||
|
||
## Usage | ||
1. build dpapp | ||
``` | ||
DASH/dash-pipeline$ make dpapp | ||
``` | ||
2. Run dpapp | ||
``` | ||
DASH/dash-pipeline$ make run-dpapp | ||
``` | ||
|
||
## Debug | ||
VPP CLI `vppctl` provides lots of commands for debugging. Use the command `docker exec -it dash-dpapp-${USER} vppctl` | ||
to launch it. | ||
|
||
- Check dpapp interfaces and the counters | ||
``` | ||
vpp# show interface | ||
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count | ||
host-veth5 1 up 9000/0/0/0 rx packets 39 | ||
rx bytes 10764 | ||
tx packets 39 | ||
tx bytes 7628 | ||
local0 0 down 0/0/0/0 | ||
vpp# show hardware-interfaces | ||
Name Idx Link Hardware | ||
host-veth5 1 up host-veth5 | ||
Link speed: unknown | ||
RX Queues: | ||
queue thread mode | ||
0 vpp_wk_0 (1) interrupt | ||
TX Queues: | ||
TX Hash: [name: hash-eth-l34 priority: 50 description: Hash ethernet L34 headers] | ||
queue shared thread(s) | ||
0 yes 0-1 | ||
Ethernet address 02:fe:23:f0:88:99 | ||
Linux PACKET socket interface v3 | ||
FEATURES: | ||
qdisc-bpass-enabled | ||
cksum-gso-enabled | ||
RX Queue 0: | ||
block size:65536 nr:160 frame size:2048 nr:5120 next block:39 | ||
TX Queue 0: | ||
block size:69206016 nr:1 frame size:67584 nr:1024 next frame:39 | ||
available:1024 request:0 sending:0 wrong:0 total:1024 | ||
local0 0 down local0 | ||
Link speed: unknown | ||
local | ||
``` | ||
|
||
- Check flow table in dpapp | ||
``` | ||
vpp# show dash flow | ||
1: eni 00:cc:cc:cc:cc:cc, vnet_id 343, proto 17, 10.1.1.10 1234 -> 10.1.2.50 80 | ||
common data - version 0, direction 1, actions 0x9, timeout 28 | ||
vpp# clear dash flow 1 | ||
``` | ||
|
||
- Check packet processing trace in dpapp | ||
``` | ||
vpp# trace add af-packet-input 100 | ||
vpp# show trace | ||
``` | ||
|
||
On behalf of BMv2 switch, script `tools/send_p2a_pkt.py` can send packet with dash header to verify basic flow | ||
functionality of dpapp. | ||
|
||
## Test | ||
By default, flow lookup is not enabled in DASH pipeline. The decorator `@use_flow` will enable it and then involve dpapp | ||
for slow path. If test cases are verified to support flow, aka stateful packet processing, use the decorator to mark | ||
the test class. | ||
|
||
PTF test script [saidashdpapp_sanity.py](https://github.com/sonic-net/DASH/blob/main/test/test-cases/functional/ptf/saidashdpapp_sanity.py) | ||
provides sanity check for dpapp. Refer to it as a sample for new flow tests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 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. | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}) | ||
|
||
# for generated API headers: | ||
include_directories(${CMAKE_BINARY_DIR}) | ||
|
||
add_vpp_plugin(dash | ||
SOURCES | ||
dash.c | ||
dash_node.c | ||
flow.c | ||
saiapi.c | ||
|
||
MULTIARCH_SOURCES | ||
dash_node.c | ||
|
||
API_FILES | ||
dash.api | ||
|
||
API_TEST_SOURCES | ||
dash_test.c | ||
|
||
COMPONENT vpp-plugin-dash | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Define a simple binary API to control the feature */ | ||
|
||
option version = "0.1.0"; | ||
import "vnet/interface_types.api"; | ||
|
||
autoreply define dash_enable_disable { | ||
/* Client identifier, set from api_main.my_client_index */ | ||
u32 client_index; | ||
|
||
/* Arbitrary context, so client can match reply to request */ | ||
u32 context; | ||
|
||
/* Enable / disable the feature */ | ||
bool enable_disable; | ||
|
||
/* Interface handle */ | ||
vl_api_interface_index_t sw_if_index; | ||
}; |
Oops, something went wrong.