From 1640f972357ab838a6fe2cfc8f30e3dfe482f81e Mon Sep 17 00:00:00 2001 From: Gregory Shimansky Date: Fri, 22 Feb 2019 13:01:49 -0600 Subject: [PATCH] Updated build instructions and added check for go mod downloads --- Makefile | 7 +++++-- README.md | 29 +++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 265f5c8..daf6079 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,13 @@ debug: | .set-debug all .set-debug: $(eval GO_COMPILE_FLAGS := -gcflags=all='-N -l') -client/client: .check-env Makefile client/client.go +.check-downloads: + go mod download + +client/client: .check-env .check-downloads Makefile client/client.go cd client && go build $(GO_COMPILE_FLAGS) -nff-go-nat: .check-env Makefile nat.go $(wildcard nat/*.go) +nff-go-nat: .check-env .check-downloads Makefile nat.go $(wildcard nat/*.go) go build $(GO_COMPILE_FLAGS) .PHONY: httpperfserv diff --git a/README.md b/README.md index 49012c9..643c51d 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,30 @@ ## What it is NAT example is a fully functional NAT (network address translation) -program written using [NFF-Go +program written using [NFF-Go framework](https://github.com/intel-go/nff-go). It has support for IPv4 and IPv6, ARP, ND, ICMP, ICMPv6, DHCP and DHCPv6 protocols with remote control over GRPC. ## Building -To build you need to first check out NFF-Go framework repository and -build DPDK there with `make`. After that execute `source env.sh` -script to initialize necessary variables to build native code and run -`go build` or `go install ./...`. Main executable is `nff-go-nat` and -there is also a GRPC command line client in `client` directory. NAT -example uses new Go 1.11 go.mod mechanism of fetching dependencies and -should be build outside of GOPATH. +To build NAT application you need Go tools. Get them from +[Golang site](https://golang.org/). Go should be `1.11.5` or newer. + +First, you need DPDK. Usually NAT application uses DPDK from NFF-Go +framework. If you want to go this way, check out NFF-Go framework from +[NFF-Go framework](https://github.com/intel-go/nff-go) and run `make` +in it. This will also build DPDK. After that execute `source env.sh` +script to initialize necessary variables to build native code. + +If you have DPDK already built in some other location, change `env.sh` +script to point `RTE_SDK` variable to it so that it can set up other +variables correctly and run `source env.sh`. + +To build NFF-Go NAT application use `make` in this +repository. Alternatively you can run `go build` or `go install +./...`. Main executable is `nff-go-nat` and there is also a GRPC +command line client in `client` directory. ## Testing @@ -28,3 +38,6 @@ deployed with `make deploy` target (removed from target hosts with It is possible to run stability and performance tests with `make test-stability` and `make test-performance`. + +Performance testing is done using `wrk` web server benchmark on one +side and test http server on another side.