docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
fi
-# Check for DPDK support, defualt no.
+# Check for DPDK support, defualt no. --enable-dpdk shall be setted explicitly.
# Check whether --enable-dpdk was given.
if test "${enable_dpdk+set}" = set; then :
enableval=$enable_dpdk; enable_dpdk=$enableval
if test "${with_dpdk_includes+set}" = set; then :
withval=$with_dpdk_includes;
# User wants DPDK support and has specified a header directory, so use the provided value.
- enable_dpdk=yes
dpdk_include_dir=$withval
fi
if test "${with_dpdk_libraries+set}" = set; then :
withval=$with_dpdk_libraries;
# User wants DPDK support and has specified a library directory, so use the provided value.
- enable_dpdk=yes
dpdk_lib_dir=$withval
fi
if test "x$enable_dpdk" != "xno" ; then
# If necessary, set default paths for DPDK API headers and libraries.
- if test -z "$dpdk_root"; then
- dpdk_root=/usr/local
- fi
-
if test -z "$dpdk_include_dir"; then
- dpdk_include_dir="$dpdk_root/include/dpdk"
+ dpdk_include_dir="$RTE_SDK/$RTE_TARGET/include"
fi
if test -z "$dpdk_lib_dir"; then
- dpdk_lib_dir="$dpdk_root/lib"
+ dpdk_lib_dir="$RTE_SDK/$RTE_TARGET/lib"
fi
DPDK_MACHINE_CFLAGS="-march=native"
DPDK_CFLAGS="$DPDK_MACHINE_CFLAGS -I$dpdk_include_dir"
AC_SUBST(NETMAP_SRC)
fi
-# Check for DPDK support, defualt no.
+# Check for DPDK support, defualt no. --enable-dpdk shall be setted explicitly.
AC_ARG_ENABLE([dpdk],
[AC_HELP_STRING([--enable-dpdk],[enable dpdk support @<:@default=no@:>@])],
[enable_dpdk=$enableval],
AC_HELP_STRING([--with-dpdk-includes=IDIR],[Endace DPDK include directory, if not DIR/include]),
[
# User wants DPDK support and has specified a header directory, so use the provided value.
- enable_dpdk=yes
dpdk_include_dir=$withval
],[])
AC_HELP_STRING([--with-dpdk-libraries=LDIR],[Endace DPDK library directory, if not DIR/lib]),
[
# User wants DPDK support and has specified a library directory, so use the provided value.
- enable_dpdk=yes
dpdk_lib_dir=$withval
],[])
if test "x$enable_dpdk" != "xno" ; then
# If necessary, set default paths for DPDK API headers and libraries.
- if test -z "$dpdk_root"; then
- dpdk_root=/usr/local
- fi
-
if test -z "$dpdk_include_dir"; then
- dpdk_include_dir="$dpdk_root/include/dpdk"
+ dpdk_include_dir="$RTE_SDK/$RTE_TARGET/include"
fi
if test -z "$dpdk_lib_dir"; then
- dpdk_lib_dir="$dpdk_root/lib"
+ dpdk_lib_dir="$RTE_SDK/$RTE_TARGET/lib"
fi
DPDK_MACHINE_CFLAGS="-march=native"
DPDK_CFLAGS="$DPDK_MACHINE_CFLAGS -I$dpdk_include_dir"
Date: Dec 16, 2018
Description:
-1. Pcap-dpdk provides libpcap the ability to use DPDK with the device name as dpdk:[portid], such as dpdk:0.
+1. Pcap-dpdk provides libpcap the ability to use DPDK with the device name as dpdk:{portid}, such as dpdk:0.
2. DPDK is a set of libraries and drivers for fast packet processing. (https://www.dpdk.org/)
+3. The testprogs/capturetest provides 6.4Gbps/800,000 pps on Intel 10-Gigabit X540-AT2 with DPDK 18.11.
Limitations:
-1. By default enable_dpdk is no, unless you set inlcudes and lib dir
-by --with-dpdk-includes= --with-dpdk-libraries=
+1. By default DPDK support is no, unless you explicitly set --enable-dpdk with ./configure or -DDISABLE_DPDK=OFF with cmake.
2. Only support link libdpdk.so dynamicly, because the libdpdk.a will not work correctly.
3. Only support read operation, and packet injection has not been supported yet.
-4. I have tested on DPDK v18.11.
+
Usage:
1. compile DPDK as shared library and install.(https://github.com/DPDK/dpdk.git)
You shall modify the file $RTE_SDK/$RTE_TARGET/.config and set:
CONFIG_RTE_BUILD_SHARED_LIB=y
+By the following command:
+sed -i 's/CONFIG_RTE_BUILD_SHARED_LIB=n/CONFIG_RTE_BUILD_SHARED_LIB=y/' $RTE_SDK/$RTE_TARGET/.config
2. launch l2fwd that is one of DPDK examples correctly, and get device information.
3. compile libpcap with dpdk options.
-you shall run the following command to generate a new configure
+In order to find inlucde and lib automatically, you shall export DPDK envionment variable which are used for compiling DPDK.
+
+export RTE_SDK={your DPDK base directory}
+export RTE_TARGET={your target name}
+
+3.1 with configure
+
+./configure --enable-dpdk --with-dpdk-includes=$RTE_SDK/$RTE_TARGET/include --with-dpdk-libraries=$RTE_SDK/$RTE_TARGET/lib && make -s all && make -s testprogs && make install
-make clean
-autoreconf
+3.2 with cmake
-Then, run configure with dpdk options.
-For Ubuntu, they are --with-dpdk-includes=/usr/local/include/dpdk/ --with-dpdk-libraries=/usr/local/lib
+mkdir -p build && cd build && cmake -DDISABLE_DPDK=OFF -DDPDK_INC_DIR=$RTE_SDK/$RTE_TARGET/include -DDPDK_LIB_DIR=$RTE_SDK/$RTE_TARGET/lib" ../ && make -s all && make -s testprogs && make install
4. link your own program with libpcap, and use DPDK with the device name as dpdk:{portid}, such as dpdk:0.
And you shall set DPDK configure options by environment variable DPDK_CFG