@@ -89,14 +89,13 @@ def cmd(cmd, quiet=False, shell=False):
8989DEPS_DIR = '%s/deps' % BESS_DIR
9090
9191DPDK_URL = 'https://fast.dpdk.org/rel'
92- DPDK_VER = 'dpdk-19 .11.4 '
92+ DPDK_VER = 'dpdk-20 .11'
9393DPDK_TARGET = 'x86_64-native-linuxapp-gcc'
9494
9595kernel_release = cmd ('uname -r' , quiet = True ).strip ()
9696
9797DPDK_DIR = '%s/%s' % (DEPS_DIR , DPDK_VER )
98- DPDK_CFLAGS = '"-g -w"'
99- DPDK_CONFIG = '%s/build/.config' % DPDK_DIR
98+ DPDK_BUILD = '%s/build' % DPDK_DIR
10099
101100extra_libs = set ()
102101cxx_flags = []
@@ -213,46 +212,6 @@ def is_kernel_header_installed():
213212 return os .path .isdir ("/lib/modules/%s/build" % kernel_release )
214213
215214
216- def check_kernel_headers ():
217- # If kernel header is not available, do not attempt to build
218- # any components that require kernel.
219- if not is_kernel_header_installed ():
220- set_config (DPDK_CONFIG , 'CONFIG_RTE_EAL_IGB_UIO' , 'n' )
221- set_config (DPDK_CONFIG , 'CONFIG_RTE_KNI_KMOD' , 'n' )
222- set_config (DPDK_CONFIG , 'CONFIG_RTE_LIBRTE_KNI' , 'n' )
223- set_config (DPDK_CONFIG , 'CONFIG_RTE_LIBRTE_PMD_KNI' , 'n' )
224-
225-
226- def check_bnx ():
227- if check_header ('zlib.h' , 'gcc' ) and check_c_lib ('z' ):
228- extra_libs .add ('z' )
229- else :
230- print (' - "zlib1g-dev" is not available. Disabling BNX2X PMD...' )
231- set_config (DPDK_CONFIG , 'CONFIG_RTE_LIBRTE_BNX2X_PMD' , 'n' )
232-
233-
234- def check_mlx ():
235- if check_header ('infiniband/ib.h' , 'gcc' ) and check_c_lib ('mlx4' ) and \
236- check_c_lib ('mlx5' ):
237- extra_libs .add ('ibverbs' )
238- extra_libs .add ('mlx4' )
239- extra_libs .add ('mlx5' )
240- else :
241- print (' - "Mellanox OFED" is not available. '
242- 'Disabling MLX4 and MLX5 PMDs...' )
243- if check_header ('infiniband/verbs.h' , 'gcc' ):
244- print (' NOTE: "libibverbs-dev" does exist, but it does not '
245- 'work with MLX PMDs. Instead download OFED from '
246- 'http://www.melloanox.com' )
247- set_config (DPDK_CONFIG , 'CONFIG_RTE_LIBRTE_MLX4_PMD' , 'n' )
248- set_config (DPDK_CONFIG , 'CONFIG_RTE_LIBRTE_MLX5_PMD' , 'n' )
249-
250-
251- def generate_dpdk_extra_mk ():
252- with open ('core/extra.dpdk.mk' , 'w' ) as fp :
253- fp .write ('LIBS += %s\n ' % ' ' .join (['-l' + lib for lib in extra_libs ]))
254-
255-
256215def find_current_plugins ():
257216 "return list of existing plugins"
258217 result = []
@@ -293,16 +252,14 @@ def download_dpdk(quiet=False):
293252
294253def configure_dpdk ():
295254 print ('Configuring DPDK...' )
296- cmd ('make -C %s config T=%s' % (DPDK_DIR , DPDK_TARGET ))
297-
298- check_kernel_headers ()
299- check_mlx ()
300- generate_dpdk_extra_mk ()
255+ meson_opts = '--buildtype=debugoptimized'
301256
302257 arch = os .getenv ('CPU' )
303258 if arch :
304259 print (' - Building DPDK with -march=%s' % arch )
305- set_config (DPDK_CONFIG , "CONFIG_RTE_MACHINE" , arch )
260+ meson_opts += ' -Dmachine=%s' % arch
261+
262+ cmd ('meson %s %s %s' % (meson_opts , DPDK_BUILD , DPDK_DIR ))
306263
307264
308265def makeflags ():
@@ -342,10 +299,7 @@ def build_dpdk():
342299 cmd ('patch -d %s -N -p1 < %s || true' % (DPDK_DIR , f ), shell = True )
343300
344301 print ('Building DPDK...' )
345- nproc = int (cmd ('nproc' , quiet = True ))
346- cmd ('make -C %s EXTRA_CFLAGS=%s %s' % (DPDK_DIR ,
347- DPDK_CFLAGS ,
348- makeflags ()))
302+ cmd ('ninja -C %s install' % DPDK_BUILD )
349303
350304
351305def generate_protobuf_files ():
0 commit comments