Skip to content

Commit 6184db3

Browse files
Sergio Gonzalez MonroyDamjan Marion
Sergio Gonzalez Monroy
authored and
Damjan Marion
committed
dpdk: build nasm from source
As not all distros have the minimum required nasm version (2.12.01) available, build nasm from sources when building Intel IPsec MB library. Change-Id: Iaa9da87f612c0f84da5704162c3bf430b3351076 Signed-off-by: Sergio Gonzalez Monroy <[email protected]>
1 parent 37d3967 commit 6184db3

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

Makefile

+1-14
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ PLATFORM?=vpp
1919
SAMPLE_PLUGIN?=no
2020
MACHINE=$(shell uname -m)
2121

22-
ifeq ($(MACHINE),$(filter $(MACHINE),x86_64))
23-
export AESNI?=y
24-
else
25-
export AESNI?=N
26-
endif
27-
2822
,:=,
2923
define disable_plugins
3024
$(if $(1), \
@@ -67,7 +61,7 @@ endif
6761
DEB_DEPENDS = curl build-essential autoconf automake bison ccache
6862
DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd
6963
DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
70-
DEB_DEPENDS += lcov chrpath autoconf nasm indent clang-format libnuma-dev
64+
DEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev
7165
DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 check
7266
DEB_DEPENDS += libboost-all-dev
7367
ifeq ($(OS_VERSION_ID),14.04)
@@ -113,11 +107,6 @@ endif
113107
# +ganglia-devel if building the ganglia plugin
114108

115109
RPM_DEPENDS += chrpath libffi-devel rpm-build
116-
ifeq ($(OS_ID),fedora)
117-
RPM_DEPENDS += nasm
118-
else ifeq ($(findstring y,$(AESNI)),y)
119-
RPM_DEPENDS += https://kojipkgs.fedoraproject.org//packages/nasm/2.12.02/2.fc26/x86_64/nasm-2.12.02-2.fc26.x86_64.rpm
120-
endif
121110

122111
SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
123112
RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake bison ccache check-devel chrpath clang indent libtool make
@@ -129,11 +118,9 @@ ifeq ($(OS_ID),opensuse)
129118
ifneq ($(SUSE_NAME),Tumbleweed)
130119
RPM_SUSE_DEVEL_DEPS += boost_1_61-devel gcc6
131120
RPM_SUSE_PYTHON_DEPS += python-virtualenv
132-
RPM_SUSE_BUILDTOOL_DEPS += https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/nasm-2.13.01-2.2.x86_64.rpm
133121
else
134122
RPM_SUSE_DEVEL_DEPS += boost_1_65-devel gcc
135123
RPM_SUSE_PYTHON_DEPS += python2-virtualenv
136-
RPM_SUSE_BUILDTOOL_DEPS += nasm
137124
endif
138125
endif
139126

dpdk/Makefile

+21-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ DPDK_17.08_TARBALL_MD5_CKSUM := 0641f59ea8ea98afefa7cfa2699f6241
3434
DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION)
3535
MACHINE=$(shell uname -m)
3636

37+
NASM_BASE_URL := http://www.nasm.us/pub/nasm/releasebuilds
38+
NASM_VER := 2.13.01
39+
NASM_TARBALL := nasm-$(NASM_VER).tar.xz
40+
NASM_TAR_URL := $(NASM_BASE_URL)/$(NASM_VER)/$(NASM_TARBALL)
41+
NASM_SOURCE := $(B)/nasm-$(NASM_VER)
42+
3743
ISA_L_CRYPTO_LIB := n
3844

3945
IPSEC_MB_VER ?= 0.46
@@ -225,6 +231,12 @@ $(CURDIR)/$(DPDK_TARBALL):
225231
fi
226232
@rm -f $(B)/.download.ok
227233

234+
$(CURDIR)/$(NASM_TARBALL):
235+
@if [ -e $(DPDK_DOWNLOAD_DIR)/$(NASM_TARBALL) ] ; \
236+
then cp $(DPDK_DOWNLOAD_DIR)/$(NASM_TARBALL) $(CURDIR) ; \
237+
else curl -o $(CURDIR)/$(NASM_TARBALL) -LO $(NASM_TAR_URL) ; \
238+
fi
239+
228240
$(CURDIR)/$(AESNIMB_LIB_TARBALL):
229241
@if [ -e $(DPDK_DOWNLOAD_DIR)/$(AESNIMB_LIB_TARBALL) ] ; \
230242
then cp $(DPDK_DOWNLOAD_DIR)/$(AESNIMB_LIB_TARBALL) $(CURDIR) ; \
@@ -239,6 +251,7 @@ $(CURDIR)/$(ISA_L_CRYPTO_LIB_TARBALL):
239251

240252
DPDK_DOWNLOADS = $(CURDIR)/$(DPDK_TARBALL)
241253
ifeq ($(AESNI),y)
254+
DPDK_DOWNLOADS += $(CURDIR)/$(NASM_TARBALL)
242255
DPDK_DOWNLOADS += $(CURDIR)/$(AESNIMB_LIB_TARBALL)
243256
endif
244257
ifeq ($(ISA_L_CRYPTO_LIB),y)
@@ -260,6 +273,8 @@ $(B)/.extract.ok: $(B)/.download.ok
260273
@echo --- extracting $(DPDK_TARBALL) ---
261274
@tar --directory $(B) --extract --file $(CURDIR)/$(DPDK_TARBALL)
262275
ifeq ($(AESNI),y)
276+
@echo --- extracting $(NASM_TARBALL) ---
277+
@tar --directory $(B) --extract --file $(CURDIR)/$(NASM_TARBALL)
263278
@echo --- extracting $(AESNIMB_LIB_TARBALL) ---
264279
@tar --directory $(B) --extract --file $(CURDIR)/$(AESNIMB_LIB_TARBALL)
265280
endif
@@ -292,12 +307,16 @@ $(B)/.config.ok: $(B)/.patch.ok $(B)/custom-config
292307
.PHONY: config
293308
config: $(B)/.config.ok
294309

310+
.PHONY: build-nasm
311+
build-nasm:
312+
cd $(NASM_SOURCE) && sh configure && make -j
313+
295314
.PHONY: build-ipsec-mb
296315
build-ipsec-mb:
297316
mkdir -p $(I)/lib/
298317
# Do not build GCM stuff if we are building ISA_L
299318
make -C $(AESNIMB_LIB_SOURCE) -j NO_GCM=$(ISA_L_CRYPTO_LIB) \
300-
DEBUG=$(DPDK_DEBUG) EXTRA_CFLAGS=-fPIC
319+
DEBUG=$(DPDK_DEBUG) EXTRA_CFLAGS=-fPIC NASM=$(NASM_SOURCE)/nasm
301320
cp $(AESNIMB_LIB_SOURCE)/libIPSec_MB.a $(I)/lib/
302321

303322
.PHONY: build-isal-crypto
@@ -316,6 +335,7 @@ build-dpdk:
316335

317336
# Order matters
318337
ifeq ($(AESNI),y)
338+
BUILD_TARGETS += build-nasm
319339
BUILD_TARGETS += build-ipsec-mb
320340
endif
321341
ifeq ($(ISA_L_CRYPTO_LIB),y)

extras/rpm/vpp.spec

-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ BuildRequires: python-devel, python-virtualenv
5050
BuildRequires: libffi-devel
5151
BuildRequires: glibc-static, java-1.8.0-openjdk, java-1.8.0-openjdk-devel yum-utils, redhat-lsb
5252
BuildRequires: apr-devel
53-
%if %{with aesni}
54-
BuildRequires: nasm
55-
%endif
5653
BuildRequires: numactl-devel
5754
BuildRequires: autoconf automake libtool byacc bison flex
5855

extras/vagrant/update.sh

-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,4 @@ elif [ "$OS_ID" == "centos" ]; then
4444
# Standard update + upgrade dance
4545
yum check-update
4646
yum update -y
47-
elif [ "$OS_ID" == "opensuse" ]; then
48-
zypper update -y
49-
# NASM >= 2.12 is not available in previous openSUSE release; need to install it from TW
50-
zypper install -y https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/nasm-2.13.01-2.1.x86_64.rpm
5147
fi

0 commit comments

Comments
 (0)