Skip to content

Commit

Permalink
Merge pull request #6 from intel-go/hotfix
Browse files Browse the repository at this point in the history
Updated build instructions and added check for go mod downloads
  • Loading branch information
gshimansky authored Feb 22, 2019
2 parents 03b7595 + 1640f97 commit bccb914
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

0 comments on commit bccb914

Please sign in to comment.