Skip to content

Commit 2852d15

Browse files
committed
Refine reporting of DPDK-related build messages.
As far as the two current build systems go, most optional modules print a one-line message to stdout if the user did not specifically request enabling the module and the module could not be detected automatically. DPDK in this case prints a multi-line message to stderr, which draws attention from more severe problems. Make this behaviour consistent with other modules, also make sure that in all cases the output indicates whether pkg-config was used, and what the final outcome of the process is. While at it, remove the QUIET option from pkg-config detection to make it easier to understand why pkg-config was used (or not).
1 parent 3f32df1 commit 2852d15

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ pcap and pcapng files, run cmake with -DPCAP_TYPE=null.")
20492049
endif(WIN32)
20502050
message(STATUS "Packet capture mechanism type: ${PCAP_TYPE}")
20512051

2052-
find_package(PkgConfig QUIET)
2052+
find_package(PkgConfig)
20532053

20542054
#
20552055
# Do capture-mechanism-dependent tests.
@@ -2476,12 +2476,18 @@ if(NOT DISABLE_DPDK)
24762476
set(CMAKE_EXTRA_INCLUDE_FILES rte_ether.h)
24772477
check_type_size("struct rte_ether_addr" STRUCT_RTE_ETHER_ADDR)
24782478
cmake_pop_check_state()
2479+
2480+
#
2481+
# Same as in Autoconf.
2482+
#
2483+
message(STATUS "building with DPDK")
2484+
else()
2485+
#
2486+
# Same as in Autoconf.
2487+
#
2488+
message(STATUS "building without DPDK (present, but cannot be used)")
24792489
endif()
2480-
else()
2481-
message(WARNING,
2482-
"We couldn't find DPDK with pkg-config. If you want DPDK support,
2483-
make sure that pkg-config is installed, that DPDK 18.02.2 or later is
2484-
installed, and that DPDK provides a .pc file.")
2490+
# Else: Finddpdk.cmake has already printed the diagnostics.
24852491
endif()
24862492
endif()
24872493

cmake/Modules/Finddpdk.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
# to PKG_CONFIG_PATH, so we look for the .pc file there,
3333
# first.
3434
#
35+
36+
#
37+
# If pkg-config is not available; the last line of the output is:
38+
# "-- Could NOT find dpdk (missing: dpdk_INCLUDE_DIRS dpdk_LIBRARIES)"
39+
# More than 20 lines before that there is the root cause:
40+
# "-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)"
41+
# Print a message to make the cause and the effect easier to relate,
42+
# whether the attempt fails or not.
43+
#
44+
message(STATUS "Using pkg-config to find DPDK: ${PKG_CONFIG_FOUND}")
45+
3546
if(PKG_CONFIG_FOUND)
3647
set(save_PKG_CONFIG_PATH $ENV{PKG_CONFIG_PATH})
3748
if(dpdk_ROOT)

configure.ac

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,13 +2620,19 @@ if test "$want_dpdk" != no; then
26202620
if test $V_PCAP != dpdk ; then
26212621
MODULE_C_SRC="$MODULE_C_SRC pcap-dpdk.c"
26222622
fi
2623+
2624+
#
2625+
# The last line of the output is:
2626+
# "checking for struct rte_ether_addr... yes"
2627+
# Make it clear what it means for the final result.
2628+
#
2629+
AC_MSG_NOTICE([building with DPDK])
26232630
else
26242631
#
26252632
# We didn't find a usable DPDK.
26262633
# If we required it (with --with-dpdk or --with-pcap=dpdk),
26272634
# fail with an appropriate message telling the user what
2628-
# the problem was, otherwise note the problem with a
2629-
# warning.
2635+
# the problem was.
26302636
#
26312637
if test "$found_dpdk" != yes; then
26322638
#
@@ -2659,13 +2665,13 @@ DPDK provides .pc file.])
26592665

26602666
#
26612667
# User didn't indicate whether they wanted DPDK
2662-
# or not; just warn why we didn't find it.
2668+
# or not; the last line of the output is one of:
2669+
# "checking for libdpdk with pkg-config... pkg-config not found"
2670+
# "checking for libdpdk with pkg-config... not found"
2671+
# This conveys the point and is the right amount of
2672+
# output when auto-detecting an optional module, so do
2673+
# not print anything else.
26632674
#
2664-
AC_MSG_WARN(
2665-
[We couldn't find DPDK with pkg-config. If
2666-
you want DPDK support, make sure that pkg-config is installed,
2667-
that DPDK 18.02.2 or later is installed, and that DPDK provides a
2668-
.pc file.])
26692675
elif test "$ac_cv_func_rte_eth_dev_count_avail" != yes; then
26702676
#
26712677
# Found with pkg-config, but we couldn't compile
@@ -2698,11 +2704,11 @@ or later is DPDK is installed.])
26982704

26992705
#
27002706
# User didn't indicate whether they wanted DPDK
2701-
# or not; just warn why we didn't find it.
2707+
# or not; the last line of the output is:
2708+
# "checking for rte_eth_dev_count_avail... no"
2709+
# Make it clear what it means for the final result.
27022710
#
2703-
AC_MSG_WARN(
2704-
[DPDK was found, but we can't compile libpcap with it.
2705-
Make sure that DPDK 18.02.2 or later is installed.])
2711+
AC_MSG_NOTICE([building without DPDK (present, but cannot be used)])
27062712
fi
27072713
fi
27082714
fi

0 commit comments

Comments
 (0)