summaryrefslogtreecommitdiff
path: root/examples/cmdline
AgeCommit message (Collapse)Author
2019-11-20examples: hide error for missing pkg-config path flagBruce Richardson
Some versions of pkg-config don't support the --path flag, which is not a fatal error when building the apps. Without the flag, the makefile just cannot track the .pc file of DPDK as a dependency of the build. Therefore, we can ignore the error and suppress it by redirecting to /dev/null the stderr from that call to pkg-config. Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20examples: fix build with old pkg-configBruce Richardson
Not all versions of pkg-config in distros have support for the --define-prefix flag [1], causing errors when building examples manually or with test-meson-builds.sh script [2]. For the former case, we need to remove the hard-coded use of the flag in the Makefiles. For the latter case, the flag is necessary for builds to succeed, so we skip the tests when it's not present, passing it as part of the pkg-config command if it is supported. [1] CentOS Linux release 7.7.1908 (Core) pkg-config version 0.27.1 [2] ## Building cmdline Unknown option --define-prefix gmake: Entering directory `...ild-x86-default/install-root/usr/local/share/dpdk/examples/cmdline' rm -f build/cmdline build/cmdline-static build/cmdline-shared test -d build && rmdir -p build || true Unknown option --define-prefix Unknown option --define-prefix gcc -O3 main.c commands.c parse_obj_list.c -o build/cmdline-shared main.c:14:28: fatal error: cmdline_rdline.h: No such file or directory Fixes: ca9268529d2b ("examples: support relocated DPDK install") Fixes: 7f80a2102bbb ("devtools: test pkg-config file") Cc: stable@dpdk.org Reported-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-08cmdline: replace FreeBSD ifdef for IP address parsingThomas Monjalon
The constants like AF_INET are in sys/socket.h in FreeBSD. The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD in order to be consistent across DPDK files, and allow to grep for EXEC_ENV among other benefits. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-10-21clean bare metal support tracesDavid Marchand
Bare metal support has been gone for quite some time but we still had some checks on system includes. Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-07-03examples: fix pkg-config detection with older makeBruce Richardson
Make versions before 4.2 did not have support for the .SHELLSTATUS variable, so use another method to detect shell success. Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2019-07-02examples: support relocated DPDK installBruce Richardson
For testing of DPDK, we want to override the prefix given by the pkg-config file, so that we can get correct paths for DPDK installed in an unusual location. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20examples: fix make clean when using pkg-configBruce Richardson
The "make clean" command had a number of issues: - the "--ignore-fail-on-non-empty" flag is not present on BSD - the call to remove the build folder would fail if there was no build folder present. These are fixed by only removing the build folder if it exists, and by using -p flag to rmdir in place of --ignore-fail-on-non-empty Fixes: 22119c4591a0 ("examples: use pkg-config in makefiles") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-04replace snprintf with strlcpy without adding extra includeBruce Richardson
For files that already have rte_string_fns.h included in them, we can do a straight replacement of snprintf(..."%s",...) with strlcpy. The changes in this patch were auto-generated via command: spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-03-30examples: detect default build directoryBruce Richardson
Most examples have in their makefiles a default RTE_TARGET directory to be used in case RTE_TARGET is not set. Rather than just using a hard-coded default, we can instead detect what the build directory is relative to RTE_SDK directory. This fixes a potential issue for anyone who continues to build using "make install T=x86_64-native-linuxapp-gcc" and skips setting RTE_TARGET explicitly, instead relying on the fact that they were building in a directory which corresponded to the example default path - which was changed to "x86_64-native-linux-gcc" by commit 218c4e68c1d9 ("mk: use linux and freebsd in config names"). Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-03-12mk: use linux and freebsd in config namesBruce Richardson
Rather than using linuxapp and bsdapp everywhere, we can change things to use the, more readable, terms "linux" and "freebsd" in our build configs. Rather than renaming the configs we can just duplicate the existing ones with the new names using symlinks, and use the new names exclusively internally. ["make showconfigs" also only shows the new names to keep the list short] The result is that backward compatibility is kept fully but any new builds or development can be done using the newer names, i.e. both "make config T=x86_64-native-linuxapp-gcc" and "T=x86_64-native-linux-gcc" work. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-10-22mk: build with _GNU_SOURCE defined by defaultAnatoly Burakov
We use _GNU_SOURCE all over the place, but often times we miss defining it, resulting in broken builds on musl. Rather than fixing every library's and driver's and application's makefile, fix it by simply defining _GNU_SOURCE by default for all builds. Remove all usages of _GNU_SOURCE in source files and makefiles, and also fixup a couple of instances of using __USE_GNU instead of _GNU_SOURCE. Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-02-13examples/cmdline: convert to SPDX license tagLee Daly
This updates the license on files in examples to be the standard BSD-3-Clause license used for the rest of DPDK, bringing the files in compliance with the DPDK licensing policy. Signed-off-by: Lee Daly <lee.daly@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-30build: replace license text with SPDX tagBruce Richardson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30examples: enable linking both static and sharedBruce Richardson
Since the DPDK build now includes both static and shared libraries, we need a new way to enable building the examples using either method from the one installation. To do this, we add in a default "shared" target, and a separate "static" target which links in the DPDK static libraries. In both cases, the final application name is symlinked to the last-built static or shared target, with both binaries able to co-exist in the build directory. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2018-01-30examples: use pkg-config in makefilesBruce Richardson
Change the example app Makefiles to query if DPDK is installed and registered using pkg-config. If so, build directly using pkg-config info, otherwise fall back to using the original build system with RTE_SDK and RTE_TARGET This commit changes the makefiles for the basic examples, i.e. those which do not have multiple subdirectories underneath the main examples dir. Examples not covered are: * ethtool * multi_process * performance-thread * quota_watermark * netmap_compat * server_node_efd * vm_power_manager Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30examples: put app name and sources at top of makefilesBruce Richardson
Reorder the text in the makefiles, so that the app name and the source files are listed first. This then will allow them to be shared later in a combined makefile building with pkg-config and RTE_SDK-based build system. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30examples: build some samples with mesonBruce Richardson
Add support for having selected example apps built as part of a meson, ninja build. By default none are built, and those to be built should be named directly in the -Dexamples='' meson configuration argument. This is useful for developers working on a feature who want to use a suitable example, or examples, to test that feature, as they can compile everything up in one go, and run the example without having to do a ninja install first. This commit adds examples which don't consist of multiple apps in subdirectories to the meson build, so they can be built by default by passing -Dexamples parameter to meson. Not included are the following examples: * ethtool * multi-process * netmap_compat * performance-thread * quota_watermark * server_node_efd * vm_power_manager To test the apps added here, use the following command, merged to one line, to add them to your meson build (command to be run inside the build directory): meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\ eventdev_pipeline_sw_pmd, exception_path,helloworld,\ ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\ ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\ l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\ link_status_interrupt,load_balancer,packet_ordering,ptpclient,\ qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\ timer,vhost,vhost_scsi,vmdq,vmdq_dcb Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-04examples: use SPDX tag for Intel copyright filesBruce Richardson
Replace the BSD license header with the SPDX tag for files with only an Intel copyright on them. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-11-06remove useless memzone includesThomas Monjalon
The memzone header is often included without good reason. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-06-14fix typos using codespell utilityJerin Jacob
Fixing typos across dpdk source code using codespell utility. Skipped the ethdev driver's base code fixes to keep the base code intact. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: John McNamara <john.mcnamara@intel.com>
2015-06-12examples: fix whitespaceStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2015-03-10tailq: remove unneeded inclusionsDavid Marchand
Only keep inclusion where really needed. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-12-05cmdline: fix overflow on bsdAlan Carew
When using test-pmd with flow director in FreeBSD, the application will segfault/Bus error while parsing the command-line. This is due to how each commands result structure is represented during parsing, where the offsets for each tokens value is stored in a character array(char result_buf[BUFSIZ]) in cmdline_parse()(./lib/librte_cmdline/cmdline_parse.c). The overflow occurs where BUFSIZ is less than the size of a commands result structure, in this case "struct cmd_pkt_filter_result" (app/test-pmd/cmdline.c) is 1088 bytes and BUFSIZ on FreeBSD is 1024 bytes as opposed to 8192 bytes on Linux. The problem can be reproduced by running test-pmd on FreeBSD: ./testpmd -c 0x3 -n 4 -- -i --portmask=0x3 --pkt-filter-mode=perfect And adding a filter: add_perfect_filter 0 udp src 192.168.0.0 1024 dst 192.168.0.0 1024 flexbytes 0x800 vlan 0 queue 0 soft 0x17 This patch removes the OS dependency on BUFSIZ and defines and uses a library #define CMDLINE_PARSE_RESULT_BUFSIZE 8192 Added boundary checking to ensure this buffer size cannot overflow, with an error message being produced. Suggested-by: Olivier Matz <olivier.matz@6wind.com> http://git.droids-corp.org/?p=libcmdline.git;a=commitdiff;h=b1d5b169352e57df3fc14c51ffad4b83f3e5613f Signed-off-by: Alan Carew <alan.carew@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2014-11-27examples: no more bare metal environmentDavid Marchand
Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-06-27eal: deprecate rte_snprintfStephen Hemminger
The function rte_snprintf serves no useful purpose. It is the same as snprintf() for all valid inputs. Deprecate it and replace all uses in current code. Leave the tests for the deprecated function in place. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-11remove trailing whitespacesBruce Richardson
This commit removes trailing whitespace from lines in files. Almost all files are affected, as the BSD license copyright header had trailing whitespace on 4 lines in it [hence the number of files reporting 8 lines changed in the diffstat]. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> [Thomas: remove spaces before tabs in libs] [Thomas: remove more trailing spaces in non-C files] Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-05-21config: rename "default" configurations as "native"David Marchand
The "default" part in configuration filenames is misleading. Rename this as "native", as this is the RTE_MACHINE that is set in these files. This should make it clearer for people who build DPDK on a system then run it on another one. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-25mk: compilation fixesBruce Richardson
Missing _GNU_SOURCE define for compilation of a number of files. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-25add FreeBSD supportBruce Richardson
Changes to allow compilation and use on FreeBSD. Includes: * contigmem and nic_uio driver for FreeBSD * new EAL instance * new "bsdapp" compilation target * various compilation fixes due to differences between linux and freebsd Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-25update Intel copyright years to 2014Bruce Richardson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2013-10-09doc: whitespace changes in licensesIntel
Signed-off-by: Intel
2013-07-25update copyright date to 2013Intel
Signed-off-by: Intel
2013-07-05doc: remove all pdf filesIntel
The doc location is http://dpdk.org/doc Signed-off-by: Intel
2013-07-05remove version in all filesIntel
Signed-off-by: Intel
2013-03-11first public releasev1.2.3r0Intel
version 1.2.3 Signed-off-by: Intel