summaryrefslogtreecommitdiff
path: root/examples/helloworld
AgeCommit message (Collapse)Author
2021-07-31doc: use code snippets in sample app guidesConor Fogarty
Currently the sample app user guides use hard coded code snippets, this patch changes these to use literalinclude which will dynamically update the snippets as changes are made to the code. This was introduced in commit 413c75c33c40 ("doc: show how to include code in guides"). Comments within the sample apps were updated to accommodate this as part of this patch. This will help to ensure that the code within the sample app user guides is up to date and not out of sync with the actual code. Signed-off-by: Conor Fogarty <[email protected]> Signed-off-by: Conor Walsh <[email protected]> Acked-by: John McNamara <[email protected]>
2021-05-05examples: fix pkg-config overrideJerin Jacob
Move pkg-config override to beginning in the Makefile to allow use PKGCONF variable to detect the libdpdk availability. Fixes: fda34680eb9a ("examples: remove legacy sections of makefiles") Cc: [email protected] Signed-off-by: Jerin Jacob <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2021-04-21examples: add eal cleanup to examplesChengchang Tang
According to the programming guide, the rte_eal_init should be used pairs with rte_eal_cleanup. This patch add rte_eal_cleanup to examples to encourage new users of DPDK to use it. Fixes: aec9c13c5257 ("eal: add function to release internal resources") Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application") Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver") Fixes: 4ff457986f76 ("examples/l2fwd-event: add default poll mode routines") Fixes: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton") Fixes: c5eebf85badc ("examples/ntb: add example for NTB") Fixes: b77f66002812 ("examples/pipeline: add new example application") Fixes: edbed86d1cc3 ("examples/vdpa: introduce a new sample for vDPA") Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Fixes: f5188211c721 ("examples/vhost_crypto: add sample application") Cc: [email protected] Signed-off-by: Chengchang Tang <[email protected]>
2021-04-21examples: reduce indentation in build filesBruce Richardson
As with the lib and drivers directories, we can use "continue" keyword to reduce the indentation level of the majority of the foreach block. At the same time, we can also replace tab indentation with spaces. Signed-off-by: Bruce Richardson <[email protected]>
2021-01-30examples: warn about broken pkg-configBruce Richardson
Since the examples are designed to be built by end-users using Make, we can detect and warn about broken pkg-config on the user's system as part of the build process. Signed-off-by: Bruce Richardson <[email protected]>
2020-11-15examples: restore trace pointDavid Marchand
Before make removal, those examples were built with experimental flag for tracepoints to be compiled in but the pkg-config part of those makefiles were missed. Fixes: 78d44153de8f ("ethdev: add tracepoints") Cc: [email protected] Signed-off-by: David Marchand <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2020-10-20eal: rename lcore master and slaveStephen Hemminger
Replace master lcore with main lcore and replace slave lcore with worker lcore. Keep the old functions and macros but mark them as deprecated for this release. The "--master-lcore" command line option is also deprecated and any usage will print a warning and use "--main-lcore" as replacement. Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Anatoly Burakov <[email protected]>
2020-09-07examples: remove legacy sections of makefilesCiara Power
The example app makefiles contained sections using the legacy method of compiling with make. These are no longer needed, and are removed, leaving only the section that uses pkg-config for the make build. Signed-off-by: Ciara Power <[email protected]> Acked-by: Nicolas Chautru <[email protected]>
2020-07-01build/pkg-config: improve static linking flagsBruce Richardson
Rather than setting -Bstatic in the linker flags when doing a static link, and then having to explicitly set -Bdynamic again afterwards, we can update the pkg-config file to use -l:libfoo.a syntax to explicitly refer to the static library in question. Since this syntax is not supported by meson's pkg-config module directly, we can post-process the .pc files instead to adjust them. Once done, we can simplify the examples' makefiles and the docs by removing the explicit static flag. Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Luca Boccassi <[email protected]> Acked-by: Sunil Pai G <[email protected]> Signed-off-by: Thomas Monjalon <[email protected]>
2020-04-23ethdev: add tracepointsSunil Kumar Kori
Add tracepoints at important and mandatory APIs for tracing support. Signed-off-by: Sunil Kumar Kori <[email protected]> Acked-by: David Marchand <[email protected]>
2020-04-16replace unused attributesThomas Monjalon
There is a common macro __rte_unused, avoiding warnings, which is now used where appropriate for consistency. Signed-off-by: Thomas Monjalon <[email protected]>
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: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Tested-by: Ferruh Yigit <[email protected]>
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: [email protected] Reported-by: Ferruh Yigit <[email protected]> Signed-off-by: Bruce Richardson <[email protected]> Tested-by: Ferruh Yigit <[email protected]>
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: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Luca Boccassi <[email protected]>
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 <[email protected]> Acked-by: Luca Boccassi <[email protected]>
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: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Luca Boccassi <[email protected]>
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 <[email protected]> Acked-by: Ferruh Yigit <[email protected]>
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 <[email protected]>
2018-01-30build: replace license text with SPDX tagBruce Richardson
Signed-off-by: Bruce Richardson <[email protected]> Reviewed-by: Luca Boccassi <[email protected]>
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 <[email protected]> Acked-by: Luca Boccassi <[email protected]>
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 <[email protected]> Reviewed-by: Luca Boccassi <[email protected]>
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 <[email protected]> Reviewed-by: Luca Boccassi <[email protected]>
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 <[email protected]> Reviewed-by: Luca Boccassi <[email protected]>
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 <[email protected]>
2017-11-06remove useless memzone includesThomas Monjalon
The memzone header is often included without good reason. Signed-off-by: Thomas Monjalon <[email protected]> Acked-by: Bruce Richardson <[email protected]>
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 <[email protected]> Acked-by: John McNamara <[email protected]>
2015-03-10tailq: remove unneeded inclusionsDavid Marchand
Only keep inclusion where really needed. Signed-off-by: David Marchand <[email protected]> Acked-by: Neil Horman <[email protected]>
2014-11-27examples: no more bare metal environmentDavid Marchand
Signed-off-by: David Marchand <[email protected]> Signed-off-by: Thomas Monjalon <[email protected]> Acked-by: Neil Horman <[email protected]>
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 <[email protected]> Acked-by: Neil Horman <[email protected]> [Thomas: remove spaces before tabs in libs] [Thomas: remove more trailing spaces in non-C files] Signed-off-by: Thomas Monjalon <[email protected]>
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 <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2014-02-25update Intel copyright years to 2014Bruce Richardson
Signed-off-by: Bruce Richardson <[email protected]>
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