summaryrefslogtreecommitdiffstats
path: root/mk/rte.cpuflags.mk
blob: a813c91f4c9aeaf982d506df614e96050be638ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#   BSD LICENSE
#
#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
#   All rights reserved.
#
#   Redistribution and use in source and binary forms, with or without
#   modification, are permitted provided that the following conditions
#   are met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in
#       the documentation and/or other materials provided with the
#       distribution.
#     * Neither the name of Intel Corporation nor the names of its
#       contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# this makefile is called from the generic rte.vars.mk and is
# used to set the RTE_CPUFLAG_* environment variables giving details
# of what instruction sets the target cpu supports.

AUTO_CPUFLAGS := $(shell $(CC) $(MACHINE_CFLAGS) $(WERROR_FLAGS) $(EXTRA_CFLAGS) -dM -E - < /dev/null)

# adding flags to CPUFLAGS

ifneq ($(filter $(AUTO_CPUFLAGS),__SSE__),)
CPUFLAGS += SSE
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__SSE2__),)
CPUFLAGS += SSE2
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__SSE3__),)
CPUFLAGS += SSE3
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__SSSE3__),)
CPUFLAGS += SSSE3
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__SSE4_1__),)
CPUFLAGS += SSE4_1
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__SSE4_2__),)
CPUFLAGS += SSE4_2
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__AES__),)
CPUFLAGS += AES
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__PCLMUL__),)
CPUFLAGS += PCLMULQDQ
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__AVX__),)
ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
CPUFLAGS += AVX
endif
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__RDRND__),)
CPUFLAGS += RDRAND
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__FSGSBASE__),)
CPUFLAGS += FSGSBASE
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__F16C__),)
CPUFLAGS += F16C
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__AVX2__),)
ifeq ($(CONFIG_RTE_ENABLE_AVX),y)
CPUFLAGS += AVX2
endif
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__AVX512F__),)
ifeq ($(CONFIG_RTE_ENABLE_AVX512),y)
CPUFLAGS += AVX512F
endif
endif

# IBM Power CPU flags
ifneq ($(filter $(AUTO_CPUFLAGS),__PPC64__),)
CPUFLAGS += PPC64
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__PPC32__),)
CPUFLAGS += PPC32
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__vector),)
CPUFLAGS += ALTIVEC
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__builtin_vsx_xvnmaddadp),)
CPUFLAGS += VSX
endif

# ARM flags
ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_NEON),)
CPUFLAGS += NEON
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRC32),)
CPUFLAGS += CRC32
endif

ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRYPTO),)
CPUFLAGS += AES
CPUFLAGS += PMULL
CPUFLAGS += SHA1
CPUFLAGS += SHA2
endif

MACHINE_CFLAGS += $(addprefix -DRTE_MACHINE_CPUFLAG_,$(CPUFLAGS))

# To strip whitespace
comma:= ,
empty:=
space:= $(empty) $(empty)
CPUFLAGSTMP1 := $(addprefix RTE_CPUFLAG_,$(CPUFLAGS))
CPUFLAGSTMP2 := $(subst $(space),$(comma),$(CPUFLAGSTMP1))
CPUFLAGS_LIST := -DRTE_COMPILE_TIME_CPUFLAGS=$(CPUFLAGSTMP2)
RONTEND=noninteractive sudo apt-get -y update sudo apt-get -y install libpython2.7-dev python-virtualenv function ssh_do() { echo echo "### " ssh $@ ssh -i priv_key -o StrictHostKeyChecking=no $@ } VIRL_SERVER=10.30.51.28 VIRL_USERNAME=jenkins-in VIRL_PKEY=priv_key rm -f ${VIRL_PKEY} cat > ${VIRL_PKEY} <<EOF -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEA+IHXq87G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Z/R/K32hAsikBC8SVPQTPniyaifFWx81diblalff2hX4ipTf7Yx24I wMIMZuW7Im/R7QMef4+94G3Bad7p7JuE/qnAEHJ2OBnu+eYfxaK35XDsrq6XMazS NqHE7hOq3giVfgg+C12hCKMCgYEAtu9dbYcG5owbehxzfRI2/OCRsjz/t1bv1seM xVMND4XI6xb/apBWAZgZpIFrqrWoIBM3ptfsKipZe91ngBPUnL9s0Dolx452RVAj yctHB8uRxWYgqDkjsxtzXf1HnZBBkBS8CUzYj+hdfuddoeKLaY3invXLCiV+PpXS U4KAK9kCgYEAtSv0m5+Fg74BbAiFB6kCh11FYkW94YI6B/E2D/uVTD5dJhyEUFgZ cWsudXjMki8734WSpMBqBp/J8wG3C9ZS6IpQD+U7UXA+roB7Qr+j4TqtWfM+87Rh maOpG56uAyR0w5Z9BhwzA3VakibVk9KwDgZ29WtKFzuATLFnOtCS46E= -----END RSA PRIVATE KEY----- EOF chmod 600 priv_key # Temporarily download VPP packages from nexus.fd.io rm -f *.deb if [ "${#}" -ne "0" ]; then arr=(${@}) echo ${arr[0]} else # Download the latest VPP build .deb install packages bash ./resources/tools/download_install_vpp_pkgs.sh --skip-install fi VPP_DEBS=(*.deb) echo ${VPP_DEBS[@]} VIRL_DIR_LOC="/tmp" VPP_DEBS_FULL=(${VPP_DEBS[@]}) # Prepend directory location at remote host to deb file list for index in "${!VPP_DEBS_FULL[@]}"; do VPP_DEBS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_FULL[${index}]} done echo "Updated file names: " ${VPP_DEBS_FULL[@]} # Copy the files to VIRL host scp -i ${VIRL_PKEY} -o StrictHostKeyChecking=no *.deb \ ${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/ result=$? if [ "${result}" -ne "0" ]; then echo "Failed to copy vpp deb files to virl host" echo ${result} exit ${result} fi # Start a simulation on VIRL server echo "Starting simulation on VIRL server" function stop_virl_simulation { ssh -i priv_key -o StrictHostKeyChecking=no ${VIRL_USERNAME}@${VIRL_SERVER}\ "/home/jenkins-in/testcase-infra/bin/stop-testcase ${VIRL_SID}" } VIRL_SID=$(ssh -i priv_key -o StrictHostKeyChecking=no \ ${VIRL_USERNAME}@${VIRL_SERVER} \ "/home/jenkins-in/testcase-infra/bin/start-testcase -c double-ring-nested ${VPP_DEBS_FULL[@]}") retval=$? if [ "$?" -ne "0" ]; then echo "VIRL simulation start failed" exit ${retval} fi if [[ ! "${VIRL_SID}" =~ session-[a-zA-Z0-9_]{6} ]]; then echo "No VIRL session ID reported." exit 127 fi # Upon script exit, cleanup the simulation execution trap stop_virl_simulation EXIT echo ${VIRL_SID} ssh_do ${VIRL_USERNAME}@${VIRL_SERVER} cat /scratch/${VIRL_SID}/topology.yaml # Download the topology file from virl session scp -i ${VIRL_PKEY} -o StrictHostKeyChecking=no \ ${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/topology.yaml \ topologies/enabled/topology.yaml retval=$? if [ "$?" -ne "0" ]; then echo "Failed to copy topology file from VIRL simulation" exit ${retval} fi virtualenv env . env/bin/activate echo pip install pip install -r requirements.txt # There are used three iterations of tests there to check # the stability and reliability of the results for test_set in 1 2 3 do echo echo ${test_set}. test loop PYTHONPATH=`pwd` pybot -L TRACE \ -v TOPOLOGY_PATH:topologies/enabled/topology.yaml \ --include vm_envAND3_node_single_link_topo \ --include vm_envAND3_node_double_link_topo \ --exclude PERFTEST \ --noncritical EXPECTED_FAILING \ --output log_test_set${test_set} \ tests/ done rebot --output output.xml ./log_test_set1.xml ./log_test_set2.xml ./log_test_set3.xml rm -f ./log_test_set1.xml ./log_test_set2.xml ./log_test_set3.xml