Skip to content

Commit

Permalink
Merge branch 'pr-hero-doc' into work-hero-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mgheorghe authored Oct 7, 2024
2 parents c25e66a + cd7eb95 commit 7d85503
Show file tree
Hide file tree
Showing 26 changed files with 1,421 additions and 260 deletions.
23 changes: 18 additions & 5 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ configurated
Conntrack
Containerlab
CP
CPUs
CreatedHalfOpenFlow
CreatedOtherFlow
CreatedTcpFlow
Expand All @@ -133,6 +134,8 @@ DACs
DASHOrch
dashorch
DashOrch
dashsai
dashsubmodule
dashsubmodule
datacenter
DataCenter
Expand All @@ -158,6 +161,8 @@ decaps
deliverables
DemoDays
deparsing
dequeue
dequeues
designator
DEST
dest
Expand All @@ -183,6 +188,8 @@ dockerized
DoS
DotNet
downcasting
dpapp
DPAPP
DPDK
DPU
dpu
Expand Down Expand Up @@ -227,11 +234,14 @@ eni
Eni
ENIs
ENI's
enqueue
enqueues
entrypoints
enum
EPUs
EPYC
ethernet
EtherType
executables
ExpressRoute
extern
Expand All @@ -241,6 +251,7 @@ failovers
fakesai
FastPath
fc
FDio
FEC
ffe
FINACK
Expand Down Expand Up @@ -335,6 +346,7 @@ Jinja
jitter
journaled
json
Junhua
keepalive
keepalives
Keysight
Expand Down Expand Up @@ -483,7 +495,6 @@ PrivateAddress
programmability
programmatically
proto
proto
protobuf
provids
PRs
Expand All @@ -501,7 +512,6 @@ Pyunit
qcow
qos
QoS
qos
qsfp
Radv
RangeOrValue
Expand All @@ -512,7 +522,6 @@ READMEs
README's
recirculation
reconvergence
reconvergence
RECV
RedirectRuleResimulatedUf
redis
Expand All @@ -537,6 +546,7 @@ routable
RPC
RPCs
RPF
RSS
RST
RSTPackets
RSTs
Expand Down Expand Up @@ -735,11 +745,13 @@ vport
VPort
vPORT
VPorts
vpp
VPP
vppctl
VTEP
VTEPs
VxLAN
VXLAN
VxLAN
VxLan
vxlan
warmboots
Expand All @@ -759,6 +771,7 @@ YAML
yaml
yml
Ze
Zhai
Zhixiong
ZMQ
ZTVN
ZTVN
106 changes: 104 additions & 2 deletions dash-pipeline/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
SHELL = /bin/bash

HAVE_DPAPP ?=
ifeq ($(HAVE_DPAPP),y)
DPAPP_LINK = veth4
DPAPP_LINK_PEER = veth5
SWITCH_PORT_DPAPP = --interface 2@$(DPAPP_LINK)
endif

mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))

Expand Down Expand Up @@ -64,6 +71,10 @@ include dockerfiles/DOCKER_SAI_CHALLENGER_CLIENT_BLDR_IMG.env
# SAIChallenger Client image built locally with saithrift client libs + PTF & Pytest frameworks
DOCKER_SAI_CHALLENGER_CLIENT_IMG ?= local/dash-saichallenger-client:latest

# Run/compile dpapp
# include file defines DOCKER_DPAPP_IMG
include dockerfiles/DOCKER_DPAPP_IMG.env

# Set differently in CI scripts as needed, e.g. run switch container in -d mode
DOCKER_FLAGS ?=-it

Expand Down Expand Up @@ -251,6 +262,53 @@ run-saithrift-bldr-bash:
$(DOCKER_RUN_SAITHRIFT_BLDR) \
/bin/bash

######################################
# bmv2 date-plane app TARGETS
######################################
DOCKER_RUN_DPAPP = docker run\
$(DOCKER_FLAGS) \
-v $(PWD)/bmv2:/bmv2 \
-v $(PWD)/$(P4_OUTDIR)/dash_pipeline.json:/etc/dash/dash_pipeline.json \
-v $(PWD)/$(P4_OUTDIR)/dash_pipeline_p4rt.txt:/etc/dash/dash_pipeline_p4rt.txt \
-v $(PWD)/SAI:/SAI \
-v $(PWD)/tests:/tests \
-v $(PWD)/../:/dash \
--network=host \
-u $(HOST_USER):$(HOST_GROUP) \
--rm \

.PHONY:dpapp dpapp-clean
dpapp-clean:
$(DOCKER_RUN_DPAPP) \
--name dash-dpapp-$(USER) \
-w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \
make clean

dpapp:
@echo "Compile dpapp for date-plane app ..."
$(DOCKER_RUN_DPAPP) \
--name dash-dpapp-$(USER) \
-w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \
make

run-dpapp-bash:
$(DOCKER_RUN_DPAPP) \
--privileged \
--name dash-dpapp-$(USER) \
-w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \
/bin/bash

run-dpapp: $(DPAPP_LINK)
$(DOCKER_RUN_DPAPP) \
--privileged \
-u root \
--name dash-dpapp-$(USER) \
-w /dash/dash-pipeline/dpapp $(DOCKER_DPAPP_IMG) \
env HOST_INTERFACE=$(DPAPP_LINK_PEER) ./dpapp.sh startup.conf

kill-dpapp:
-docker kill dash-dpapp-$(USER)

######################################
# P4 Behavioral-model (switch) TARGETS
######################################
Expand All @@ -267,6 +325,7 @@ run-switch: network
simple_switch_grpc \
--interface 0@veth0 \
--interface 1@veth2 \
$(SWITCH_PORT_DPAPP) \
--log-console \
--no-p4

Expand Down Expand Up @@ -621,11 +680,40 @@ docker-publish-dash-grpc:
docker push $(DOCKER_GRPC_IMG)
[ -n $(DOCKER_GRPC_IMG_CTAG) ] && docker push $(DOCKER_GRPC_IMG_NAME):$(DOCKER_GRPC_IMG_CTAG)

###############################

DOCKER_DPAPP_IMG_TAG = $(shell cat dockerfiles/Dockerfile.dpapp | $(SHA1SUM))
DOCKER_DPAPP_IMG = $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_TAG)

docker-dash-dpapp:
{ [ x$(ENABLE_DOCKER_PULL) == xy ] && docker pull $(DOCKER_DPAPP_IMG); } || \
docker build \
-f dockerfiles/Dockerfile.dpapp \
-t $(DOCKER_DPAPP_IMG) \
--build-arg user=$(DASH_USER) \
--build-arg group=$(DASH_GROUP) \
--build-arg uid=$(DASH_UID) \
--build-arg guid=$(DASH_GUID) \
--build-arg hostname=$(DASH_HOST) \
--build-arg available_processors=$(shell nproc) \
dockerfiles
[ -n $(DOCKER_DPAPP_IMG_CTAG) ] && \
docker tag $(DOCKER_DPAPP_IMG) $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_CTAG)

docker-pull-dash-dpapp:
docker pull $(DOCKER_DPAPP_IMG)

docker-publish-dash-dpapp:
@echo "Publish $(DOCKER_DPAPP_IMG) - requires credentials, can only do from DASH repo, not a fork"
docker push $(DOCKER_DPAPP_IMG)
[ -n $(DOCKER_DPAPP_IMG_CTAG) ] && \
docker push $(DOCKER_DPAPP_IMG_NAME):$(DOCKER_DPAPP_IMG_CTAG)

###############################
# BMV2-PKTGEN NETWORKING TARGETS
###############################

network:veth0 veth2 disable-ipv6
network:veth0 veth2 $(DPAPP_LINK) disable-ipv6

veth0: /sys/class/net/veth0
/sys/class/net/veth0:
Expand All @@ -644,13 +732,27 @@ veth2: /sys/class/net/veth2
sudo ip link set veth2 mtu 9500
sudo ip link set veth3 mtu 9500

ifeq ($(HAVE_DPAPP),y)
$(DPAPP_LINK): /sys/class/net/$(DPAPP_LINK)
/sys/class/net/$(DPAPP_LINK):
sudo ip link add name $(DPAPP_LINK) type veth peer name $(DPAPP_LINK_PEER)
sudo ip link set dev $(DPAPP_LINK) up
sudo ip link set dev $(DPAPP_LINK_PEER) up
sudo ip link set $(DPAPP_LINK) mtu 9500
sudo ip link set $(DPAPP_LINK_PEER) mtu 9500
endif

disable-ipv6:
./disable_veth_ipv6.sh
DPAPP_LINK=$(DPAPP_LINK) DPAPP_LINK_PEER=$(DPAPP_LINK_PEER) ./disable_veth_ipv6.sh

# Delete veth's, test existence to avoid needless use of sudo
network-clean:
@-([ -e /sys/class/net/veth0 ] && sudo ip link delete dev veth0 && echo "Deleted veth0/1") || echo "No veth0, not deleting"
@-([ -e /sys/class/net/veth2 ] && sudo ip link delete dev veth2 && echo "Deleted veth2/3") || echo "No veth2, not deleting"
ifeq ($(HAVE_DPAPP),y)
@-([ -e /sys/class/net/$(DPAPP_LINK) ] && sudo ip link delete dev $(DPAPP_LINK) \
&& echo "Deleted $(DPAPP_LINK)") || echo "No $(DPAPP_LINK), not deleting"
endif

###############################
# IXIA-C TARGETS
Expand Down
2 changes: 1 addition & 1 deletion dash-pipeline/SAI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: copysrc
./sai_api_gen.py \
/bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.json \
--ir /bmv2/dash_pipeline.bmv2/dash_pipeline_ir.json \
--ignore-tables=appliance,eni_meter,slb_decap \
--ignore-tables=underlay_mac,eni_meter,slb_decap \
--sai-spec-dir=/SAI/specs \
dash

Expand Down
35 changes: 35 additions & 0 deletions dash-pipeline/SAI/specs/dash_appliance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
!!python/object:utils.sai_spec.sai_api_group.SaiApiGroup
name: dash_appliance
description: DASH appliance
api_type: overlay
sai_apis:
- !!python/object:utils.sai_spec.sai_api.SaiApi
name: dash_appliance
description: DASH appliance
is_object: true
enums: []
structs: []
attributes:
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_DASH_APPLIANCE_ATTR_LOCAL_REGION_ID
description: Action parameter local region id
type: sai_uint8_t
attr_value_field: u8
default: '0'
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
allow_null: false
valid_only: null
is_vlan: false
deprecated: false
stats: []
p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta
tables:
- !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable
id: 41082190
actions:
default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction
name: default
id: 29775410
attr_param_id: {}
26 changes: 26 additions & 0 deletions dash-pipeline/SAI/specs/dash_eni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,32 @@ sai_apis:
valid_only: null
is_vlan: false
deprecated: false
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_ENI_ATTR_ENABLE_REVERSE_TUNNEL_LEARNING
description: Action parameter enable reverse tunnel learning
type: bool
attr_value_field: booldata
default: 'false'
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
allow_null: false
valid_only: null
is_vlan: false
deprecated: false
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_ENI_ATTR_REVERSE_TUNNEL_SIP
description: Action parameter reverse tunnel sip
type: sai_ip_address_t
attr_value_field: ipaddr
default: 0.0.0.0
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
allow_null: false
valid_only: null
is_vlan: false
deprecated: false
stats:
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_ENI_STAT_RX_BYTES
Expand Down
2 changes: 1 addition & 1 deletion dash-pipeline/SAI/specs/dash_flow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sai_apis:
description: Action parameter DASH flow enabled key
type: sai_dash_flow_enabled_key_t
attr_value_field: s32
default: SAI_DASH_FLOW_ENABLED_KEY_ENI_ADDR
default: SAI_DASH_FLOW_ENABLED_KEY_ENI_MAC
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
Expand Down
Loading

0 comments on commit 7d85503

Please sign in to comment.