Skip to content

Commit 8ab691c

Browse files
authored
Merge pull request #625 from intel-go/develop
New release 0.8.1
2 parents 048b92a + 66385c6 commit 8ab691c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1169
-224
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:cosmic
1+
FROM ubuntu:disco
22

33
ARG MAKEFLAGS=-j2
44

@@ -11,7 +11,6 @@ RUN apt-get -q update && apt-get -q -y install \
1111
git \
1212
curl \
1313
wget \
14-
golang-${GO_VERSION} \
1514
libpcap-dev \
1615
libelf-dev \
1716
hugepages \
@@ -21,7 +20,7 @@ RUN apt-get -q update && apt-get -q -y install \
2120
libmnl-dev \
2221
libibverbs-dev
2322

24-
RUN cd /opt && curl -L -s https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz | tar zx
23+
RUN cd /opt && curl -L -s https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz | tar zx
2524

2625
RUN mkdir -p ${NFF_GO}
2726
COPY . ${NFF_GO}

Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
PATH_TO_MK = mk
66
SUBDIRS = nff-go-base dpdk test examples
7-
DOC_TARGETS = flow packet
8-
CI_TESTING_TARGETS = packet low common
7+
CI_TESTING_TARGETS = packet internal/low common
98
TESTING_TARGETS = $(CI_TESTING_TARGETS) test/stability
109

1110
all: $(SUBDIRS)
@@ -33,9 +32,4 @@ citesting: $(CI_TESTING_TARGETS)
3332
$(TESTING_TARGETS):
3433
$(MAKE) -C $@ testing
3534

36-
.PHONY: doc
37-
doc: $(DOC_TARGETS)
38-
mkdir doc
39-
$(foreach package,$(DOC_TARGETS),godoc -analysis=type -analysis=pointer -html github.com/intel-go/nff-go/$(package) > doc/$(package).html;)
40-
4135
include $(PATH_TO_MK)/intermediate.mk

README.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![Go Report Card](https://goreportcard.com/badge/github.com/intel-go/yanff)](https://goreportcard.com/report/github.com/intel-go/yanff)
2-
[![GoDoc](https://godoc.org/github.com/intel-go/yanff?status.svg)](https://godoc.org/github.com/intel-go/yanff)
1+
[![Go Report Card](https://goreportcard.com/badge/github.com/intel-go/nff-go)](https://goreportcard.com/report/github.com/intel-go/nff-go)
2+
[![GoDoc](https://godoc.org/github.com/intel-go/nff-go?status.svg)](https://godoc.org/github.com/intel-go/nff-go)
33
[![Dev chat at https://gitter.im/intel-yanff/Lobby](https://img.shields.io/badge/gitter-developer_chat-46bc99.svg)](https://gitter.im/intel-yanff/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/intel-go/nff-go.svg?branch=develop)](https://travis-ci.org/intel-go/nff-go)
55
# Network Function Framework for Go (former YANFF)
@@ -84,9 +84,15 @@ Requirements in the DPDK Getting Started Guide for
8484
Linux](http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html) for more
8585
information.
8686

87-
Since NFF-Go is build with Mellanox cards support out of the box you
87+
By default NFF-Go is build with Mellanox cards support out of the box you
8888
need to install additional dependencies required for MLX network
89-
drivers. On Ubuntu they are called `libmnl-dev` and `libibverbs-dev`.
89+
drivers. On Ubuntu they are called `libmnl-dev` and
90+
`libibverbs-dev`. For more details see MLX drivers respective pages
91+
for [MLX4](https://doc.dpdk.org/guides/nics/mlx4.html) and
92+
[MLX5](https://doc.dpdk.org/guides/nics/mlx5.html). If these
93+
dependencies cannot be satisfied, and Mellanox drivers are not needed,
94+
you can set variable `NFF_GO_NO_MLX_DRIVERS` to some unempty value to
95+
disable MLX drivers compilation.
9096

9197
Additional dependencies are required for pktgen, especially if you are
9298
running RedHat or CentOS Linux distributions. See [this
@@ -133,18 +139,9 @@ when it is run for the first time, but may be quite slow.
133139

134140
## Documentation
135141

136-
Use:
137-
138-
make doc
139-
140-
to generate full documentation. Alternatively, you can do:
141-
142-
godoc -http=:6060
143-
144-
and browse the following URLs:
145-
146-
* http://localhost:6060/pkg/nff-go/flow/
147-
* http://localhost:6060/pkg/nff-go/packet/
142+
Online API documentation is available on [godoc.org
143+
site](https://godoc.org/github.com/intel-go/nff-go). API usage is
144+
explained on our [Wiki pages](https://github.com/intel-go/nff-go/wiki).
148145

149146
## Tests
150147

@@ -187,7 +184,7 @@ deployed images listed in NFF_GO_HOSTS, use the **make cleanall** command.
187184
## Contributing
188185

189186
If you want to contribute to NFF-Go, check our [Contributing
190-
guide](https://github.com/intel-go/yanff/blob/master/CONTRIBUTING.md). We also
187+
guide](https://github.com/intel-go/nff-go/blob/master/CONTRIBUTING.md). We also
191188
recommend checking the bugs with 'help-wanted' or 'easyfix' in our list of open issues; these bugs
192189
can be solved without an extensive knowledge of NFF-Go. We would love to help
193190
you start contributing.

devices/consts.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var (
7575

7676
var (
7777
pathSysClassNetDeviceDriver stringBuilder = PathSysClassNet + "/%s/device/driver"
78-
pathSysClassNetDevice stringBuilder = PathSysClassNet + "/%s/device"
78+
pathSysClassNetDevice stringBuilder = PathSysClassNet + "/%s"
7979
)
8080

8181
var (
@@ -107,6 +107,7 @@ func init() {
107107

108108
rVmbusDriver = regexp.MustCompile("/sys/bus/vmbus/drivers/(\\S+)/")
109109

110-
IsPciID = regexp.MustCompile("^\\d{4}:\\d{2}:\\d{2}.\\d$")
110+
// domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7)
111+
IsPciID = regexp.MustCompile("^[[:xdigit:]]{4}:[[:xdigit:]]{2}:[0-1][[:xdigit:]].[0-7]$")
111112
IsUUID = regexp.MustCompile("^[[:xdigit:]]{8}-[[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$")
112113
}

devices/misc.go

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,18 @@ func FindDefaultDpdkDriver(nicName string) string {
3434

3535
// GetDeviceID returns the device ID of given NIC name.
3636
func GetDeviceID(nicName string) (string, error) {
37-
// DEV_ID=$(basename $(readlink /sys/class/net/<nicName>/device))
38-
return readlinkBaseCmd(pathSysClassNetDevice.With(nicName))
37+
// DEV_ID=$(basename $(readlink /sys/class/net/<nicName>))
38+
raw, err := readlinkCmd(pathSysClassNetDevice.With(nicName))
39+
if err != nil {
40+
return "", err
41+
}
42+
// raw should be like /sys/devices/pci0002:00/0000:00:08.0/virtio2/net/ens8
43+
raws := strings.Split(raw, "/")
44+
if len(raws) < 5 {
45+
return "", fmt.Errorf("path not correct")
46+
}
47+
return raws[4], nil
48+
3949
}
4050

4151
// IsModuleLoaded checks if the kernel has already loaded the driver or not.
@@ -69,12 +79,20 @@ func writeToTargetWithData(sysfs string, flag int, mode os.FileMode, data string
6979
return nil
7080
}
7181

72-
func readlinkBaseCmd(path string) (string, error) {
73-
output, err := cmdOutputWithTimeout(defaultTimeoutLimitation, "readlink", path)
82+
func readlinkCmd(path string) (string, error) {
83+
output, err := cmdOutputWithTimeout(defaultTimeoutLimitation, "readlink", "-f", path)
7484
if err != nil {
7585
return "", fmt.Errorf("Cmd Execute readlink failed: %s", err.Error())
7686
}
7787
outputStr := strings.Trim(string(output), "\n")
88+
return outputStr, nil
89+
}
90+
91+
func readlinkBaseCmd(path string) (string, error) {
92+
outputStr, err := readlinkCmd(path)
93+
if err != nil {
94+
return "", fmt.Errorf("Cmd Execute readlink failed: %s", err.Error())
95+
}
7896
result := filepath.Base(outputStr)
7997
return result, nil
8098
}

dpdk/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ all: pktgen
2323

2424
$(DPDK_DIR)/$(DPDK_INSTALL_DIR):
2525
$(MAKE) -C $(DPDK_DIR) config T=$(RTE_TARGET)
26-
sed -ri 's,(MLX._PMD=)n,\1y,' $(DPDK_DIR)/build/.config
26+
@if [ -z '${NFF_GO_NO_MLX_DRIVERS}' ]; then \
27+
echo BUILDING DPDK WITH MLX DRIVERS; \
28+
sed -ri 's,(MLX._PMD=)n,\1y,' $(DPDK_DIR)/build/.config; \
29+
else \
30+
echo BUILDING DPDK WITHOUT MLX DRIVERS; \
31+
fi
2732
$(MAKE) -C $(DPDK_DIR)
2833
$(MAKE) -C $(DPDK_DIR) install DESTDIR=$(DPDK_INSTALL_DIR)
2934

dpdk/dpdk

Submodule dpdk updated from 8b937ba to 07efd6d

dpdk/pktgen-dpdk

Submodule pktgen-dpdk updated from 4199555 to ae5a88b

examples/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ netlink
1313
devbind
1414
OSforwarding
1515
generate
16+
jumbo
17+
decrementTTL

examples/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ COPY timer .
2121
COPY netlink .
2222
COPY generate .
2323
COPY OSforwarding .
24+
COPY jumbo .
25+
COPY decrementTTL .

0 commit comments

Comments
 (0)