Skip to content

Commit bba9608

Browse files
committed
Update to 40G VF version
1 parent 1089d64 commit bba9608

File tree

231 files changed

+77512
-28670
lines changed

Some content is hidden

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

231 files changed

+77512
-28670
lines changed

CHANGELOG

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
v4.2.3 HPCAP Version 4.2.3
2+
Maintainer: Guillermo Julián <[email protected]>
3+
Date: 27/11/2015
4+
5+
This is a version with minor bugfixes.
6+
7+
- [Fix] Fix issues in systems with autorenaming of interfaces.
8+
- [Fix] Fix build bugs in CentOS and in the 3.11 and 3.13 Ubuntu kernels.
9+
- [Fix] Add a header that was causing errors when compiling the library.
10+
- [Fix] Fix hugepage mappints when not using the default hugepage path.
11+
12+
v4.2.2 HPCAP Version 4.2.2
13+
Maintainer: Guillermo Julián <[email protected]>
14+
Date: 17/10/2015
15+
16+
This is a version with minor bugfixes and some nice small features.
17+
18+
- [Fix] Avoid ixgbe/hpcap driver conflicts when installing to the system.
19+
- [Scripts] The hpcap-status script gives a quick glance at the status of the
20+
HPCAP driver (install status, hugepage usage, traffic/losses rate).
21+
- [Fix] Minor fixes on packing
22+
23+
v4.2.1 HPCAP Version 4.2.1
24+
Maintainer: Guillermo Julián <[email protected]>
25+
Date: 30/9/2015
26+
27+
Changelog:
28+
29+
- [Fix] Fix install error that happened when the first interface (index 0)
30+
was not in HPCAP mode.
31+
- [Fix] Other minor fixes in the Makefile (not critical).
32+
33+
v4.2.0 HPCAP Version 4.2.0
34+
Maintainer: Guillermo Julián <[email protected]>
35+
Date: 21/09/2015
36+
37+
Changelog:
38+
39+
- [Features] Added hugepages support (see doc/HPCAP_UserGuide.pdf, section Hugepages)
40+
- [Features] The driver can now be installed to the system.
41+
- [Features] The interface numbers now are based on PCI bus, device and function of the corresponding adapter. This should make them always the same over reboots and driver reinstalls.
42+
- [Docs] Added documentation for developers.
43+
- [Build] The driver can be built in different configurations (debug, release) simultaneously.
44+
- [Build] Added a debug configuration that outputs more information to the kernel log.
45+
- [Build] Added support for the 3.11.0 kernel.
46+
- [Scripts] Added the parse_hpcap_log script to help in the parsing of hpcap monitor logs.
47+
- [Fix] Fixed a bug where a listener would magically disappear from the driver registers and crash the client application (the error that appeared in the kernel log was "No se ha encontrado listener...").
48+
49+
v4.1.0
50+
- Version date: 16/04/2015
51+
- Author: Victor Moreno ([email protected])
52+
- Features:
53+
- Stable version
54+
- Minor bugs fixed
55+
- Supports physical (HPCAP) and virtual (HPCAPvf) scenarios
56+
- Merged with detect-pro / m3omon
57+
- Added feature for resizing interfaces' buffer in terms of #pages

Makefile

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ KERN_DEBUG_ENVVARS = CONFIG_DEBUG_INFO=1
77
RELEASE_CFLAGS = -O3 -march=native
88
KERN_RELEASE_CFLAGS = -O3
99
KERN_RELEASE_ENVVARS =
10-
LDFLAGS = -lhpcap -lnuma -lpcap -lpthread -lm -lmgmon
10+
LDFLAGS = -lhpcap -lpcap -lpthread -lm -lmgmon
1111
DEBUG_LDFLAGS = -Llib/debug
1212
RELEASE_LDFLAGS = -Llib/release
1313
LATEXFLAGS = -pdf -silent -synctex=1 -shell-escape
14+
VERBOSE = 0
1415

1516
# Uncomment to build the driver for a specific kernel version
16-
# BUILD_KERNEL=3.2.0-23-generic
17+
# BUILD_KERNEL=4.8.0-32-generic
1718

1819
# Directory variables
1920
BINDIR = bin
@@ -78,8 +79,6 @@ all: $(ALL_TARGETS)
7879
libs: $(LIB_NAMES)
7980
samples: $(SAMPLES)
8081

81-
.FORCE:
82-
8382
# For debugging
8483
print-%: ; @echo $*=$($*)
8584

@@ -102,6 +101,8 @@ help:
102101
@echo "- uninstall: Uninstall the driver from the system."
103102
@echo "- pack: Pack the source code in a .tar.gz file in the current directory."
104103
@echo "- dist: Pack the source code and binaries in a ready-to-install package."
104+
@echo "- format: Run the astyle formatter"
105+
@echo "- check: Check the folder structure is correct and output readable errors"
105106
@echo ""
106107
@echo "Apart from those generic rules, you can use specific rules, such as bin/[conf]/[binary]"
107108
@echo "or lib/[conf]/[library] to build just one file in one given configuration. Drivers are"
@@ -113,6 +114,9 @@ help:
113114
@echo "Drivers: $(DRIV_TARGETS)"
114115
@echo "Sample applications: $(SAMPLES)"
115116
@echo "Libraries: $(LIB_NAMES)"
117+
@echo ""
118+
@echo "Note: If some target gives Makefile errors, first try to run make clean, rm -rf obj, and/or run make check"
119+
@echo " to see if it is some common error (like not having the correct folder structure)."
116120

117121
####################################
118122
## Build configuration management ##
@@ -139,6 +143,14 @@ ALL_DEPS = $(SAMPLE_DEPS) $(LIB_DEPS)
139143
config: $(ALL_CONFS)
140144
depend: $(ALL_DEPS)
141145

146+
check:
147+
@for driver in $(DRIV_NAMES); do \
148+
if [ ! -d $(DRIVDIR)/$$driver/driver ]; then \
149+
echo "Error: Cannot build $$driver: folder $(DRIVDIR)/$$driver/driver does not exist"; \
150+
fi; \
151+
done; \
152+
153+
142154
# If the kernel version is fixed, we have to add it to the kernel environment variables
143155
ifneq (,$(BUILD_KERNEL))
144156
KERN_DEBUG_ENVVARS += BUILD_KERNEL=$(BUILD_KERNEL)
@@ -189,7 +201,10 @@ generate_deps = \
189201
done; \
190202
mv "$(1).0" $(1)
191203

192-
drivname = $(shell echo $(1) | sed -E 's/hpcap_(ixgbe)?([a-zA-Z]*).*/hpcap\2/')
204+
# This function is just a regex that constructs the hpcap driver name from the folder name
205+
# E.g., hpcap_i40e-1.4.25 is converted to hpcapi, hpcap_ixgbevf-2.14.2 is converted to
206+
# hpcapvf, etc.
207+
drivname = $(shell echo $(1) | sed -E 's/hpcap_(ixgbe)?([a-zA-Z]*)[0-9e]*(vf)?.*/hpcap\2\3/')
193208

194209
DRIV_TARGETS := $(foreach driver, $(DRIV_NAMES), $(call drivname, $(driver)))
195210
DRIV_BINARIES := $(foreach conf, $(CONFS), $(wildcard $(BINDIR)/$(conf)/*.ko))
@@ -282,30 +297,38 @@ $(OBJDIR)/.lib-%-deps.mk: $(LIBSRCDIR)/%/*.c Makefile | $(OBJDIR)
282297
####################################
283298
SOURCES_AFFECTING_VERSION := $(filter-out $(COMMON_DIR)/hpcap_version.h, $(ALL_SRCS))
284299

285-
VERSION_FILE = .svnversion
286-
DEFAULT_BRANCH = trunk
287-
BRANCH = $(shell svn info 2> /dev/null | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' || echo "$(DEFAULT_BRANCH)")
288-
REVISION = $(shell svnversion -n 2>/dev/null || cat $(VERSION_FILE) 2>/dev/null || echo "no-cvs-info")
300+
# Use "wildcard" to avoid errors due to unexisting files when not running without the .git
301+
# directory. If the .git directory is not present, GIT_INFO_FILES will be empty.
302+
GIT_INFO_FILES := $(wildcard .git/index) $(wildcard .git/HEAD)
303+
VERSION_FILE = .gitversion
304+
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "master")
305+
GIT_COMMIT = $(shell git describe --dirty --tags --always --abbrev=7 --match="v*" || cat $(VERSION_FILE) 2>/dev/null || echo "no-git-info")
289306

290-
VERSION_BRANCH_INFO = from $(BRANCH)
307+
ifeq (master,$(GIT_BRANCH))
308+
VERSION_BRANCH_INFO =
309+
else
310+
VERSION_BRANCH_INFO = , branch $(GIT_BRANCH)
311+
endif
291312

292-
# hpcap_version.h should be regenerated also when the SVN revision changes.
293-
# However, SVN is not like git where we have a nice file that changes when
294-
# the revision or HEAD pointer changes, so I can't do that. I can't neither
295-
# make this file depend on VERSION_FILE because it hangs the build process.
296-
$(COMMON_DIR)/hpcap_version.h: $(SOURCES_AFFECTING_VERSION)
313+
# Only overwrite the version file if we can extract significant info (that is, the .git directory)
314+
# is present.
315+
$(COMMON_DIR)/hpcap_version.h: $(SOURCES_AFFECTING_VERSION) $(GIT_INFO_FILES)
316+
ifneq (,$(GIT_INFO_FILES))
297317
@echo "#ifndef HPCAP_VERSION_H" > $@
298318
@echo "#define HPCAP_VERSION_H" >> $@
299-
@echo "#define HPCAP_REVISION \"$(REVISION) $(VERSION_BRANCH_INFO)\"" >> $@
319+
@echo "#define HPCAP_REVISION \"$(GIT_COMMIT)$(VERSION_BRANCH_INFO)\"" >> $@
300320
@echo "#define HPCAP_BUILD_DATE \"$(shell date +"%d %b %Y %R %Z")\"" >> $@
301-
@echo "#define HPCAP_BUILD_INFO \"rev \" HPCAP_REVISION \" built \" HPCAP_BUILD_DATE" >> $@
321+
@echo "#define HPCAP_BUILD_INFO HPCAP_REVISION \" built \" HPCAP_BUILD_DATE" >> $@
302322
@echo "#endif" >> $@
323+
else
324+
@touch $@
325+
endif
303326

304-
$(VERSION_FILE): .FORCE
305-
ifneq (,$(shell which svnversion 2>/dev/null))
306-
@echo $(shell svnversion 2>/dev/null || echo "no-svn-info") > $@
327+
$(VERSION_FILE): $(GIT_INFO_FILES)
328+
ifneq (,$(GIT_INFO_FILES))
329+
@echo $(shell git describe --dirty --tags --always --abbrev=7) > $@
307330
else
308-
@[ -e $@ ] || echo "no-svn-info" > $@
331+
@touch $@
309332
endif
310333

311334
version-info: $(COMMON_DIR)/hpcap_version.h $(VERSION_FILE)
@@ -410,11 +433,22 @@ TAR_EXCLUDES_SRC = $(TAR_EXCLUDES_DIST) bin lib
410433
TAR_EXCLUDES_DIST_ARG = $(addprefix --exclude=, $(TAR_EXCLUDES_DIST))
411434
TAR_EXCLUDES_SRC_ARG = $(addprefix --exclude=, $(TAR_EXCLUDES_SRC))
412435

413-
TAR_BRANCH = _$(shell echo $(BRANCH) | tr '/' '-' | sed 's/release/pre-release/')
436+
# Only show the git branch if we're not on master
437+
ifeq (master,$(GIT_BRANCH))
438+
TAR_GITBRANCH =
439+
else
440+
TAR_GITBRANCH = _$(shell echo $(GIT_BRANCH) | tr '/' '-' | sed 's/release/pre-release/')
441+
endif
442+
443+
TAR_TARGET = HPCAP$(TAR_GITBRANCH)_$(shell date +"%F")_$(shell git describe --tags --always --match="v*")
444+
445+
CHANGELOG: $(GIT_INFO_FILES)
446+
@git tag -l -n99 "v*" > CHANGELOG
414447

415-
TAR_TARGET = HPCAP$(TAR_BRANCH)_$(shell date +"%F")_rev$(subst :,-,$(REVISION))
448+
VERSION.txt: $(GIT_INFO_FILES)
449+
@git tag -l $(shell git describe) -n99 > VERSION.txt
416450

417-
changes: version-info
451+
changes: CHANGELOG VERSION.txt version-info
418452

419453
pack: docs changes
420454
@cd ..; COPYFILE_DISABLE=1 tar $(TAR_EXCLUDES_SRC_ARG) -czf $(TAR_TARGET).tar.gz $(lastword $(notdir $(CURDIR)))
@@ -425,3 +459,10 @@ dist: release docs changes
425459
@cd ..; COPYFILE_DISABLE=1 tar $(TAR_EXCLUDES_DIST_ARG) -czf $(TAR_TARGET)_dist.tar.gz $(lastword $(notdir $(CURDIR)))
426460
@mv ../$(TAR_TARGET)_dist.tar.gz .
427461
@echo "Packed $(TAR_TARGET).tar.gz."
462+
463+
####################################
464+
## Some misc scripts ##
465+
####################################
466+
467+
format:
468+
astyle --options=.astylerc --recursive "driver/*.c" "driver/*.h" "samples/*.c" "samples/*.h" "include/*.h" "srclib/*.c"

Makefile-driver-vars.mk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@ ifeq (,$(BUILD_KERNEL))
22
BUILD_KERNEL=$(shell uname -r)
33
endif
44

5-
PRE_EXCLUDED_CFILES = hpcap_params_1.c hpcap_params_2.c kcompat_ethtool.c i40e_fcoe.c
5+
PRE_EXCLUDED_CFILES = hpcap_params_1.c hpcap_params_2.c kcompat_ethtool.c i40e_fcoe.c ixgbe_hv_vf.c ixgbe_cna.c
66
EXTRA_HFILES =
77

88
DRIV_SUFFIX = $(shell echo $(DRIVER_NAME) | sed -E 's/hpcap(\w*)/\1/' | tr '[:lower:]' '[:upper:]')
99

1010
ifeq ($(DRIV_SUFFIX),MLX)
1111
DRIV_MACRO_ID = "HPCAP_MLNX"
12+
$(info HPCAP_MLNX)
1213
else
1314
ifeq ($(DRIV_SUFFIX),I)
1415
DRIV_MACRO_ID = "HPCAP_I40E"
1516
else
17+
ifeq ($(DRIV_SUFFIX),IVF)
18+
DRIV_MACRO_ID = "HPCAP_I40EVF"
19+
else
1620
DRIV_MACRO_ID = "HPCAP_IXGBE$(DRIV_SUFFIX)"
1721
endif
1822
endif
23+
endif
24+
1925

2026
###########################################################################
2127
# Environment tests
@@ -28,7 +34,9 @@ KSP := /lib/modules/$(BUILD_KERNEL)/build \
2834
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \
2935
/usr/src/kernel-headers-$(BUILD_KERNEL) \
3036
/usr/src/kernel-source-$(BUILD_KERNEL) \
37+
/usr/src/kernels/$(BUILD_KERNEL) \
3138
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
39+
/usr/src/kernels/$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
3240
/usr/src/linux
3341

3442
# prune the list down to only values that exist
@@ -128,6 +136,7 @@ EXTRA_CFLAGS += -I$(KSRC)/include -I.
128136
EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
129137
echo "-DMODVERSIONS -DEXPORT_SYMTAB \
130138
-include $(KSRC)/include/linux/modversions.h")
139+
EXTRA_CFLAGS += -fno-pie
131140

132141
ifneq (,$(DRIV_MACRO_ID))
133142
EXTRA_CFLAGS += -D$(DRIV_MACRO_ID)

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
HPCAP
22
=====
33

4-
High-performance 40G network capture engine.
5-
6-
Refer to the documentation folder for an [installation guide](https://github.com/hpcn-uam/hpcap40g/blob/master/doc/HPCAP_UserGuide.pdf).
4+
High-performance 10G network capture engine

doc/.latexmkrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
add_cus_dep('gp', 'tex', 0, 'makegpi2tex');
2+
3+
sub makegpi2tex {
4+
system("gnuplot \"$_[0].gp\"") ;
5+
}

doc/HPCAP_DevGuide.pdf

48.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)