Skip to content

Commit

Permalink
Merge pull request #500 from intel-go/develop
Browse files Browse the repository at this point in the history
New release 0.7.0. DPDK updated to version 18.11, switch to go.mod for dependencies.
  • Loading branch information
aregm committed Nov 28, 2018
2 parents 394f218 + 1f6062b commit 7d8e13e
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 67 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
@@ -0,0 +1,6 @@
[submodule "dpdk/dpdk"]
path = dpdk/dpdk
url = http://dpdk.org/git/dpdk
[submodule "dpdk/pktgen-dpdk"]
path = dpdk/pktgen-dpdk
url = http://dpdk.org/git/apps/pktgen-dpdk
7 changes: 3 additions & 4 deletions .travis.yml
Expand Up @@ -12,12 +12,11 @@ services:

before_script:
- sudo apt-get install -y linux-headers-$(uname -r)
- docker pull ubuntu:bionic
- docker build -t test-bionic .
- 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
- docker pull ubuntu:cosmic
- docker build --build-arg https_proxy=${https_proxy} -t test-cosmic .
- 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

script:
- docker exec -i test-nff-go ./scripts/get-depends.sh
- docker exec -i test-nff-go make
# Build standalone examples
- docker exec -i test-nff-go bash -c "cd examples && make gopacketParserExample && cd .."
Expand Down
22 changes: 11 additions & 11 deletions Dockerfile
@@ -1,13 +1,10 @@
FROM ubuntu:bionic
FROM ubuntu:cosmic

ENV GO_VERSION 1.9
ENV GOPATH /gopath
ENV GOROOT /usr/lib/go-${GO_VERSION}
ARG MAKEFLAGS=-j2

ENV GOROOT /opt/go
ENV PATH ${GOROOT}/bin:${GOPATH}/bin:${PATH}
ENV NFF_GO_DIR /gopath/src/github.com/intel-go/nff-go

ARG MAKEFLAGS=-j2
ENV NFF_GO /nff-go

RUN apt-get -q update && apt-get -q -y install \
make \
Expand All @@ -19,9 +16,12 @@ RUN apt-get -q update && apt-get -q -y install \
libelf-dev \
hugepages \
libnuma-dev \
libhyperscan-dev
libhyperscan-dev \
liblua5.3-dev

RUN cd /opt && curl -L -s https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz | tar zx

RUN mkdir -p ${NFF_GO_DIR}
COPY . ${NFF_GO_DIR}
RUN mkdir -p ${NFF_GO}
COPY . ${NFF_GO}

WORKDIR ${NFF_GO_DIR}
WORKDIR ${NFF_GO}
26 changes: 6 additions & 20 deletions README.md
Expand Up @@ -69,17 +69,11 @@ available in the *_develop_* branch. master branch provides the latest stable re

## Getting NFF-GO

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

export GOPATH=/my/local/directory
go get -v -d github.com/intel-go/nff-go

Go will download the sources into $GOPATH/src. It will try to build NFF-GO and
fail with a message:

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
Ignore the message for now. We need to install some dependencies before you can
build.
git clone --recurse-submodules http://github.com/intel-go/nff-go

### Working with a github fork

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


### Go

Use Go version 1.9 or higher. To check the version of Go, do:
Use Go version 1.11 or higher. To check the version of Go, do:

go version
### Installing NFF dependencies

$GOPATH/src/github.com/intel-go/nff-go/scripts/get-depends.sh

### environment variables

export PATH="$PATH:$GOPATH/bin"

## Building NFF-GO

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

Use:

make doc

to generate full documentation. Alternatively, you can do:
Expand Down
6 changes: 3 additions & 3 deletions devices/consts.go
Expand Up @@ -14,7 +14,7 @@ import (
const (
DriverHvNetvcs = "hv_netvcs"
DriverUioPciGeneric = "uio_pci_generic"
DriverIgUio = "ig_uio"
DriverIgbUio = "igb_uio"
DriverVfioPci = "vfio-pci"
DriverUioHvGeneric = "uio_hv_generic"
)
Expand Down Expand Up @@ -46,8 +46,8 @@ var (
// DPDK related drivers
var (
DefaultDpdkDriver = DriverUioPciGeneric
DpdkDrivers = [...]string{DriverUioPciGeneric, DriverIgUio, DriverVfioPci, DriverUioHvGeneric}
DpdkPciDrivers = [...]string{DriverUioPciGeneric, DriverIgUio, DriverVfioPci}
DpdkDrivers = [...]string{DriverUioPciGeneric, DriverIgbUio, DriverVfioPci, DriverUioHvGeneric}
DpdkPciDrivers = [...]string{DriverUioPciGeneric, DriverIgbUio, DriverVfioPci}
DpdkVmbusDrivers = [...]string{DriverUioHvGeneric}
)

Expand Down
1 change: 0 additions & 1 deletion dpdk/.gitignore
@@ -1,5 +1,4 @@
pktgen
Pktgen.lua
dpdk-*
pktgen-*
*.pg
24 changes: 11 additions & 13 deletions dpdk/Makefile
Expand Up @@ -8,8 +8,6 @@ IMAGENAME = nff-go-pktgen
# Pktgen variables
NOCHECK_PKTGEN = yes

include $(PATH_TO_MK)/leaf.mk

# Main DPDK variables
DPDK_INSTALL_DIR=$(RTE_TARGET)-install
export WORKDIR=/workdir
Expand All @@ -20,26 +18,26 @@ ifdef NFF_GO_DEBUG
export EXTRA_CFLAGS += -g -O0
endif

.PHONY: dpdk
dpdk: all

all: pktgen
cp $(PKTGEN_DIR)/Pktgen.lua .

$(DPDK_DIR):
curl -L -s $(DPDK_URL) | tar xJ

$(DPDK_DIR)/$(DPDK_INSTALL_DIR): $(DPDK_DIR)
$(DPDK_DIR)/$(DPDK_INSTALL_DIR):
$(MAKE) -C $(DPDK_DIR) config T=$(RTE_TARGET)
$(MAKE) -C $(DPDK_DIR) install T=$(RTE_TARGET) DESTDIR=$(DPDK_INSTALL_DIR)

$(PKTGEN_DIR):
curl -L -s $(PKTGEN_URL) | tar xJ

$(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen: $(DPDK_DIR)/$(DPDK_INSTALL_DIR) $(PKTGEN_DIR)
$(MAKE) -j1 -C $(PKTGEN_DIR)
$(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen: $(DPDK_DIR)/$(DPDK_INSTALL_DIR)
$(MAKE) -C $(PKTGEN_DIR)

pktgen: $(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen
cp $(PKTGEN_DIR)/app/$(RTE_TARGET)/pktgen .

clean:
-rm pktgen Pktgen.lua
-rm -rf $(DPDK_DIR)
-rm -rf $(PKTGEN_DIR)
-$(MAKE) -C $(DPDK_DIR) clean
-rm -rf $(DPDK_DIR)/$(DPDK_INSTALL_DIR) $(DPDK_DIR)/build $(DPDK_DIR)/$(RTE_TARGET)
-$(MAKE) -C $(PKTGEN_DIR) realclean

include $(PATH_TO_MK)/leaf.mk
1 change: 1 addition & 0 deletions dpdk/dpdk
Submodule dpdk added at 0da7f4
1 change: 1 addition & 0 deletions dpdk/pktgen-dpdk
Submodule pktgen-dpdk added at 6a78a5
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -12,5 +12,5 @@ require (
github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect
golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3 // indirect
golang.org/x/sys v0.0.0-20181004145325-8469e314837c // indirect
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e // indirect
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -31,3 +31,5 @@ golang.org/x/sys v0.0.0-20181004145325-8469e314837c h1:SJ7JoQNVl3mC7EWkkONgBWgCn
golang.org/x/sys v0.0.0-20181004145325-8469e314837c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e h1:x8cnE8uLkl6ATwMpvL/N/wYBk/53BdeePq1JaYt1zuo=
golang.org/x/tools v0.0.0-20181002223833-cd09f19c2f7e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1 h1:bsEj/LXbv3BCtkp/rBj9Wi/0Nde4OMaraIZpndHAhdI=
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
18 changes: 6 additions & 12 deletions mk/include.mk
Expand Up @@ -6,18 +6,12 @@

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

DPDK_VERSION = 18.08
DPDK_DIR = dpdk-$(DPDK_VERSION)
ifndef DPDK_URL
DPDK_URL=http://fast.dpdk.org/rel/dpdk-$(DPDK_VERSION).tar.xz
endif
PKTGEN_VERSION=3.5.2
PKTGEN_DIR=pktgen-dpdk-pktgen-$(PKTGEN_VERSION)
ifndef PKTGEN_URL
PKTGEN_URL=http://git.dpdk.org/apps/pktgen-dpdk/snapshot/pktgen-dpdk-pktgen-$(PKTGEN_VERSION).tar.xz
endif
export RTE_SDK = $(PROJECT_ROOT)/dpdk/$(DPDK_DIR)
export RTE_TARGET = x86_64-native-linuxapp-gcc
DPDK_VERSION=18.11
DPDK_DIR=dpdk
PKTGEN_VERSION=3.5.8
PKTGEN_DIR=pktgen-dpdk
export RTE_SDK=$(PROJECT_ROOT)/dpdk/$(DPDK_DIR)
export RTE_TARGET=x86_64-native-linuxapp-gcc

# Configure flags for native code. Disable FSGSBASE and F16C to run in
# VMs and Docker containers.
Expand Down
3 changes: 3 additions & 0 deletions nff-go-base/Makefile
Expand Up @@ -19,4 +19,7 @@ Dockerfile: Makefile
echo 'RUN dnf -y install numactl-libs.x86_64; dnf clean all' >> Dockerfile
echo 'CMD ["/bin/bash"]' >> Dockerfile

.PHONY: dpdk
dpdk:

include $(PATH_TO_MK)/leaf.mk
1 change: 0 additions & 1 deletion test/framework/.gitignore
@@ -1 +0,0 @@
*_string.go
38 changes: 38 additions & 0 deletions test/framework/apptype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vagrant/scripts.sh
@@ -1,4 +1,4 @@
export DPDK_VERSION=18.08
export DPDK_VERSION=18.11
export GOPATH="$HOME"/go
export GOROOT=/opt/go
export NFF_GO="$GOPATH"/src/github.com/intel-go/nff-go
Expand Down

0 comments on commit 7d8e13e

Please sign in to comment.