Skip to content

Commit 7d8e13e

Browse files
authored
Merge pull request #500 from intel-go/develop
New release 0.7.0. DPDK updated to version 18.11, switch to go.mod for dependencies.
2 parents 394f218 + 1f6062b commit 7d8e13e

16 files changed

+93
-67
lines changed

.gitmodules

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "dpdk/dpdk"]
2+
path = dpdk/dpdk
3+
url = http://dpdk.org/git/dpdk
4+
[submodule "dpdk/pktgen-dpdk"]
5+
path = dpdk/pktgen-dpdk
6+
url = http://dpdk.org/git/apps/pktgen-dpdk

.travis.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ services:
1212

1313
before_script:
1414
- sudo apt-get install -y linux-headers-$(uname -r)
15-
- docker pull ubuntu:bionic
16-
- docker build -t test-bionic .
17-
- docker run -it -d --privileged -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /sys/devices/system/node:/sys/devices/system/node --name test-nff-go test-bionic /bin/bash
15+
- docker pull ubuntu:cosmic
16+
- docker build --build-arg https_proxy=${https_proxy} -t test-cosmic .
17+
- docker run -it -d --privileged -v /usr/src:/usr/src -v /lib/modules:/lib/modules -v /sys/devices/system/node:/sys/devices/system/node --name test-nff-go test-cosmic /bin/bash
1818

1919
script:
20-
- docker exec -i test-nff-go ./scripts/get-depends.sh
2120
- docker exec -i test-nff-go make
2221
# Build standalone examples
2322
- docker exec -i test-nff-go bash -c "cd examples && make gopacketParserExample && cd .."

Dockerfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:cosmic
22

3-
ENV GO_VERSION 1.9
4-
ENV GOPATH /gopath
5-
ENV GOROOT /usr/lib/go-${GO_VERSION}
3+
ARG MAKEFLAGS=-j2
64

5+
ENV GOROOT /opt/go
76
ENV PATH ${GOROOT}/bin:${GOPATH}/bin:${PATH}
8-
ENV NFF_GO_DIR /gopath/src/github.com/intel-go/nff-go
9-
10-
ARG MAKEFLAGS=-j2
7+
ENV NFF_GO /nff-go
118

129
RUN apt-get -q update && apt-get -q -y install \
1310
make \
@@ -19,9 +16,12 @@ RUN apt-get -q update && apt-get -q -y install \
1916
libelf-dev \
2017
hugepages \
2118
libnuma-dev \
22-
libhyperscan-dev
19+
libhyperscan-dev \
20+
liblua5.3-dev
21+
22+
RUN cd /opt && curl -L -s https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz | tar zx
2323

24-
RUN mkdir -p ${NFF_GO_DIR}
25-
COPY . ${NFF_GO_DIR}
24+
RUN mkdir -p ${NFF_GO}
25+
COPY . ${NFF_GO}
2626

27-
WORKDIR ${NFF_GO_DIR}
27+
WORKDIR ${NFF_GO}

README.md

+6-20
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,11 @@ available in the *_develop_* branch. master branch provides the latest stable re
6969

7070
## Getting NFF-GO
7171

72-
Use the **go get** command to download NFF-GO. You must first set your GOPATH:
72+
Starting with release 0.7.0 NFF-Go uses go.mod for getting dependencies,
73+
therefore Go version 1.11 or later is required. To checkout NFF-Go
74+
sources use the following command
7375

74-
export GOPATH=/my/local/directory
75-
go get -v -d github.com/intel-go/nff-go
76-
77-
Go will download the sources into $GOPATH/src. It will try to build NFF-GO and
78-
fail with a message:
79-
80-
can't load package: package github.com/intel-go/nff-go: no buildable Go source files in /localdisk/work/rscohn1/ws/nff-go-test/src/github.com/intel-go/nff-go
81-
Ignore the message for now. We need to install some dependencies before you can
82-
build.
76+
git clone --recurse-submodules http://github.com/intel-go/nff-go
8377

8478
### Working with a github fork
8579

@@ -119,21 +113,12 @@ not installed into kernel directory. You can load it using the full path to the
119113
module file:
120114
$GOPATH/src/github.com/intel-go/nff-go/test/dpdk/dpdk-17.08/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
121115

122-
123116
### Go
124117

125-
Use Go version 1.9 or higher. To check the version of Go, do:
118+
Use Go version 1.11 or higher. To check the version of Go, do:
126119

127120
go version
128121
129-
### Installing NFF dependencies
130-
131-
$GOPATH/src/github.com/intel-go/nff-go/scripts/get-depends.sh
132-
133-
### environment variables
134-
135-
export PATH="$PATH:$GOPATH/bin"
136-
137122
## Building NFF-GO
138123

139124
cd $GOPATH/src/github.com/intel-go/nff-go
@@ -148,6 +133,7 @@ Use Go version 1.9 or higher. To check the version of Go, do:
148133
## Documentation
149134

150135
Use:
136+
151137
make doc
152138

153139
to generate full documentation. Alternatively, you can do:

devices/consts.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
const (
1515
DriverHvNetvcs = "hv_netvcs"
1616
DriverUioPciGeneric = "uio_pci_generic"
17-
DriverIgUio = "ig_uio"
17+
DriverIgbUio = "igb_uio"
1818
DriverVfioPci = "vfio-pci"
1919
DriverUioHvGeneric = "uio_hv_generic"
2020
)
@@ -46,8 +46,8 @@ var (
4646
// DPDK related drivers
4747
var (
4848
DefaultDpdkDriver = DriverUioPciGeneric
49-
DpdkDrivers = [...]string{DriverUioPciGeneric, DriverIgUio, DriverVfioPci, DriverUioHvGeneric}
50-
DpdkPciDrivers = [...]string{DriverUioPciGeneric, DriverIgUio, DriverVfioPci}
49+
DpdkDrivers = [...]string{DriverUioPciGeneric, DriverIgbUio, DriverVfioPci, DriverUioHvGeneric}
50+
DpdkPciDrivers = [...]string{DriverUioPciGeneric, DriverIgbUio, DriverVfioPci}
5151
DpdkVmbusDrivers = [...]string{DriverUioHvGeneric}
5252
)
5353

dpdk/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pktgen
22
Pktgen.lua
33
dpdk-*
4-
pktgen-*
54
*.pg

dpdk/Makefile

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ IMAGENAME = nff-go-pktgen
88
# Pktgen variables
99
NOCHECK_PKTGEN = yes
1010

11-
include $(PATH_TO_MK)/leaf.mk
12-
1311
# Main DPDK variables
1412
DPDK_INSTALL_DIR=$(RTE_TARGET)-install
1513
export WORKDIR=/workdir
@@ -20,26 +18,26 @@ ifdef NFF_GO_DEBUG
2018
export EXTRA_CFLAGS += -g -O0
2119
endif
2220

21+
.PHONY: dpdk
22+
dpdk: all
23+
2324
all: pktgen
2425
cp $(PKTGEN_DIR)/Pktgen.lua .
2526

26-
$(DPDK_DIR):
27-
curl -L -s $(DPDK_URL) | tar xJ
28-
29-
$(DPDK_DIR)/$(DPDK_INSTALL_DIR): $(DPDK_DIR)
27+
$(DPDK_DIR)/$(DPDK_INSTALL_DIR):
3028
$(MAKE) -C $(DPDK_DIR) config T=$(RTE_TARGET)
3129
$(MAKE) -C $(DPDK_DIR) install T=$(RTE_TARGET) DESTDIR=$(DPDK_INSTALL_DIR)
3230

33-
$(PKTGEN_DIR):
34-
curl -L -s $(PKTGEN_URL) | tar xJ
35-
36-
$(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen: $(DPDK_DIR)/$(DPDK_INSTALL_DIR) $(PKTGEN_DIR)
37-
$(MAKE) -j1 -C $(PKTGEN_DIR)
31+
$(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen: $(DPDK_DIR)/$(DPDK_INSTALL_DIR)
32+
$(MAKE) -C $(PKTGEN_DIR)
3833

3934
pktgen: $(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen
4035
cp $(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen .
4136

4237
clean:
4338
-rm pktgen Pktgen.lua
44-
-rm -rf $(DPDK_DIR)
45-
-rm -rf $(PKTGEN_DIR)
39+
-$(MAKE) -C $(DPDK_DIR) clean
40+
-rm -rf $(DPDK_DIR)/$(DPDK_INSTALL_DIR) $(DPDK_DIR)/build $(DPDK_DIR)/$(RTE_TARGET)
41+
-$(MAKE) -C $(PKTGEN_DIR) realclean
42+
43+
include $(PATH_TO_MK)/leaf.mk

dpdk/dpdk

Submodule dpdk added at 0da7f44

dpdk/pktgen-dpdk

Submodule pktgen-dpdk added at 6a78a5b

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ require (
1212
github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect
1313
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 // indirect
1414
golang.org/x/sys v0.0.0-20181004145325-8469e314837c // indirect
15-
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e // indirect
15+
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 // indirect
1616
)

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ golang.org/x/sys v0.0.0-20181004145325-8469e314837c h1:SJ7JoQNVl3mC7EWkkONgBWgCn
3131
golang.org/x/sys v0.0.0-20181004145325-8469e314837c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
3232
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e h1:x8cnE8uLkl6ATwMpvL/N/wYBk/53BdeePq1JaYt1zuo=
3333
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
34+
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 h1:bsEj/LXbv3BCtkp/rBj9Wi/0Nde4OMaraIZpndHAhdI=
35+
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

mk/include.mk

+6-12
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@
66

77
PROJECT_ROOT := $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/..)
88

9-
DPDK_VERSION = 18.08
10-
DPDK_DIR = dpdk-$(DPDK_VERSION)
11-
ifndef DPDK_URL
12-
DPDK_URL=http://fast.dpdk.org/rel/dpdk-$(DPDK_VERSION).tar.xz
13-
endif
14-
PKTGEN_VERSION=3.5.2
15-
PKTGEN_DIR=pktgen-dpdk-pktgen-$(PKTGEN_VERSION)
16-
ifndef PKTGEN_URL
17-
PKTGEN_URL=http://git.dpdk.org/apps/pktgen-dpdk/snapshot/pktgen-dpdk-pktgen-$(PKTGEN_VERSION).tar.xz
18-
endif
19-
export RTE_SDK = $(PROJECT_ROOT)/dpdk/$(DPDK_DIR)
20-
export RTE_TARGET = x86_64-native-linuxapp-gcc
9+
DPDK_VERSION=18.11
10+
DPDK_DIR=dpdk
11+
PKTGEN_VERSION=3.5.8
12+
PKTGEN_DIR=pktgen-dpdk
13+
export RTE_SDK=$(PROJECT_ROOT)/dpdk/$(DPDK_DIR)
14+
export RTE_TARGET=x86_64-native-linuxapp-gcc
2115

2216
# Configure flags for native code. Disable FSGSBASE and F16C to run in
2317
# VMs and Docker containers.

nff-go-base/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ Dockerfile: Makefile
1919
echo 'RUN dnf -y install numactl-libs.x86_64; dnf clean all' >> Dockerfile
2020
echo 'CMD ["/bin/bash"]' >> Dockerfile
2121

22+
.PHONY: dpdk
23+
dpdk:
24+
2225
include $(PATH_TO_MK)/leaf.mk

test/framework/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
*_string.go

test/framework/apptype_string.go

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vagrant/scripts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export DPDK_VERSION=18.08
1+
export DPDK_VERSION=18.11
22
export GOPATH="$HOME"/go
33
export GOROOT=/opt/go
44
export NFF_GO="$GOPATH"/src/github.com/intel-go/nff-go

0 commit comments

Comments
 (0)