From: Krzysztof Matczak Date: Thu, 15 Dec 2016 12:23:31 +0000 (+0000) Subject: PR review comments addressed X-Git-Tag: collectd-5.8.0~244^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6afa9f179a95e0d75ed9c277e864ad47e87477ef;p=collectd.git PR review comments addressed Adressed comments raised during PR review. Removed documentation chapter related with static linking since it was outdated and there's no single universal solution for all supported DPDK releases. Static linking of external libraries into plugins is not supported in collectd. Change-Id: I35f7decb0fdacaaaad50fa2bf35f7ba6aa96c3f0 Signed-off-by: Krzysztof Matczak --- diff --git a/docs/BUILD.dpdkstat.md b/docs/BUILD.dpdkstat.md index 33cd8e8c..fe9f0e68 100644 --- a/docs/BUILD.dpdkstat.md +++ b/docs/BUILD.dpdkstat.md @@ -148,34 +148,6 @@ instruction set manually: * Run `ldconfig` to update the shared library cache. -### Static library - -To build static DPDK library for use with collectd: - - * To configure DPDK to build the combined static library `libdpdk.a` ensure - that `CONFIG_RTE_BUILD_SHARED_LIB` is set to “n” in `config/common_base` in - your DPDK as follows: - - # - # Compile to share library - # - CONFIG_RTE_BUILD_SHARED_LIB=n - - * Prepare the configuration for the appropriate target as specified at: - http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html. - - For example: - - make config T=x86_64-native-linuxapp-gcc - - * Build the target using `-fPIC`: - - make EXTRA_CFLAGS=-fPIC -j - - * Install DPDK to `/usr`: - - sudo make install prefix=/usr - ## Build collectd with DPDK **Note:** DPDK 16.04 is the minimum version and currently supported version of @@ -199,23 +171,18 @@ implications. See also: http://dpdk.org/doc/guides/prog_guide/multi_proc_support.html * Generate the build script as specified below. (i.e. run `build.sh`). - * Configure collectd with the DPDK shared library: - - ./configure LIBDPDK_CPPFLAGS="-I/usr/include/dpdk" LIBDPDK_LDFLAGS="-L/usr/lib" - -**Note:** Modify these flags according to specific environment setup. -LIBDPDK_CPPFLAGS should contain path to dpdk headers and LIBDPDK_LDFLAGS should -point out to dpdk libraries location. - -### Build with the static DPDK library + * Configure collectd with the DPDK shared library. If DPDK is installed in + custom installation path you can specify headers include path using + LIBDPDK_CPPFLAGS variable and libraries path with LIBDPDK_LDFLAGS. + Example: -To configure collectd with the DPDK static library: + ./configure - * Run *configure* with the following CFLAGS: + or for custom DPKD installation: - ./configure LIBDPDK_CPPFLAGS="-I/usr/include/dpdk" LIBDPDK_LDFLAGS="-L/usr/lib" CFLAGS=" -lpthread -Wl,--whole-archive -Wl,-ldpdk -Wl,-lm -Wl,-lrt -Wl,-lpcap -Wl,-ldl -Wl,--no-whole-archive" + ./configure LIBDPDK_CPPFLAGS="-I/home/joe/include/dpdk" LIBDPDK_LDFLAGS="-L/home/joe/usr/lib" - * Make sure that dpdk and dpdkstat are enabled in the *configure* output. + * Make sure that libdpdk and dpdkstat are enabled in the *configure* output. Expected output: @@ -229,7 +196,7 @@ To configure collectd with the DPDK static library: * Build collectd: - make -j && make -j install. + make -j && make -j install **Note:** As mentioned above, if you are building on Ubuntu 14.04 with GCC <= 4.8.X, you need to use: diff --git a/src/utils_dpdk.c b/src/utils_dpdk.c index f9636ac5..51aa91ac 100644 --- a/src/utils_dpdk.c +++ b/src/utils_dpdk.c @@ -1,15 +1,15 @@ -/** +/* * collectd - src/utils_dpdk.c * MIT License * * Copyright(c) 2016 Intel Corporation. All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. @@ -18,15 +18,17 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. * * Authors: * Maryam Tahhan * Harry van Haaren + * Taras Chornyi * Serhiy Pshyk - **/ + * Krzysztof Matczak + */ #include "collectd.h" diff --git a/src/utils_dpdk.h b/src/utils_dpdk.h index 55ce1807..a4731d03 100644 --- a/src/utils_dpdk.h +++ b/src/utils_dpdk.h @@ -1,15 +1,15 @@ -/** +/* * collectd - src/utils_dpdk.h * MIT License * * Copyright(c) 2016 Intel Corporation. All rights reserved. * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. @@ -18,15 +18,17 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. * * Authors: * Maryam Tahhan * Harry van Haaren + * Taras Chornyi * Serhiy Pshyk - **/ + * Krzysztof Matczak + */ #ifndef UTILS_DPDK_H #define UTILS_DPDK_H