summaryrefslogtreecommitdiff
path: root/examples/ipv4_multicast
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-10-07examples/ipv4_multicast: check allmulticast enable statusIvan Ilchenko
rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return value was changed from void to int, so this patch modify usage of these functions across examples/ipv4_multicast according to new return type. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07examples: check status of getting MAC addressIgor Romanov
The return value of rte_eth_macaddr_get() was changed from void to int. Update the usage of the functions according to the new return type. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07examples: check status of getting link infoIgor Romanov
The return value of rte_eth_link_get() and rte_eth_link_get_nowait() was changed from void to int. Update the usage of the functions according to the new return type. Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07examples: check status of getting ethdev infoIvan Ilchenko
rte_eth_dev_info_get() return value was changed from void to int, so this patch modify rte_eth_dev_info_get() usage across examples according to its new return type. Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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-06-03net: replace IPv4/v6 constants with uppercase nameDavid Marchand
Since we change these macros, we might as well avoid triggering complaints from checkpatch because of mixed case. old=RTE_IPv4 new=RTE_IPV4 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" old=RTE_ETHER_TYPE_IPv4 new=RTE_ETHER_TYPE_IPV4 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" old=RTE_ETHER_TYPE_IPv6 new=RTE_ETHER_TYPE_IPV6 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2019-05-24net: add rte prefix to IP definesOlivier Matz
Add 'RTE_' prefix to defines: - rename IPv4( as RTE_IPv4(. - rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN. - rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK. - rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER. - rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT. - rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT. - rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT. - rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG. - rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG. - rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK. - rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS. - rename IPV4_ANY as RTE_IPV4_ANY. - rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK. - rename IPV4_BROADCAST as RTE_IPV4_BROADCAST. - rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP. - rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP. - rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP. - rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST. - rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST. - rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST. - rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT. - rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT. - rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK. - rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to IP structureOlivier Matz
Add 'rte_' prefix to structures: - rename struct ipv4_hdr as struct rte_ipv4_hdr. - rename struct ipv6_hdr as struct rte_ipv6_hdr. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether definesOlivier Matz
Add 'RTE_' prefix to defines: - rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN. - rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN. - rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN. - rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN. - rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN. - rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN. - rename ETHER_MTU as RTE_ETHER_MTU. - rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN. - rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID. - rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN. - rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU. - rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR. - rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR. - rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4. - rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6. - rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP. - rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN. - rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP. - rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ. - rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG. - rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588. - rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW. - rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB. - rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP. - rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS. - rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM. - rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN. - rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE. - rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4. - rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6. - rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH. - rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH. - rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS. - rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP. - rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG. - rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether functionsOlivier Matz
Add 'rte_' prefix to functions: - rename is_same_ether_addr() as rte_is_same_ether_addr(). - rename is_zero_ether_addr() as rte_is_zero_ether_addr(). - rename is_unicast_ether_addr() as rte_is_unicast_ether_addr(). - rename is_multicast_ether_addr() as rte_is_multicast_ether_addr(). - rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr(). - rename is_universal_ether_addr() as rte_is_universal_ether_addr(). - rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr(). - rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr(). - rename eth_random_addr() as rte_eth_random_addr(). - rename ether_addr_copy() as rte_ether_addr_copy(). - rename ether_format_addr() as rte_ether_format_addr(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24net: add rte prefix to ether structuresOlivier Matz
Add 'rte_' prefix to structures: - rename struct ether_addr as struct rte_ether_addr. - rename struct ether_hdr as struct rte_ether_hdr. - rename struct vlan_hdr as struct rte_vlan_hdr. - rename struct vxlan_hdr as struct rte_vxlan_hdr. - rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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-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-12-19examples/ipv4_multicast: remove useless mbuf info copyWei Zhao
There is no need for these useless information and it had better be removed in order to not confuse users. Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
2018-11-18examples/ipv4_multicast: fix leak of cloned packetsHerakliusz Lipiec
The ipv4_multicast sample application was dropping packets when using mbuf clone. When creating an L2 header and copying metadata from the source packet, the ol_flags were also copied along with all the other metadata. Because the cloned packet had IND_ATTACHED_MBUF flag set in its ol_flags, this caused the packets to never be freed when using rte_pktmbuf_free. Since copying ol_flags from the cloned packet is not necessary in the first place, just don't do it. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Reported-by: Dong Wang <dong1.wang@intel.com> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Dong Wang <dong1.wang@intel.com>
2018-10-29examples/ipv4_multicast: enable multicast promiscuousWei Zhao
This example has not been enable for receiving multicast packet, so it will drop multicast packet. Users must send packet with ether MAC destination address the same as pf port MAC address, in order to forward packet successfully, but this is an example for forwarding ipv4 multicastpacket. So calling function rte_eth_promiscuous_enable() or rte_eth_allmulticast_enable() can enable promiscuous mode of all multicast packet. And also, DPDK has rte API function of rte_eth_dev_set_mc_addr_list() for setting specific multicast filter table for specific multicast IP address, but this example do not support this configuration, so it need to be enable multicast promiscuous mode instead. Signed-off-by: Wei Zhao <wei.zhao1@intel.com> Tested-by: Dong Wang <dong1.wang@intel.com>
2018-09-14ethdev: make default behavior CRC strip on RxFerruh Yigit
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag. Without any specific Rx offload flag, default behavior by PMDs is to strip CRC. PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC Rx offload capability. Applications that require keeping CRC should check PMD capability first and if it is supported can enable this feature by setting DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure() Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Tomasz Duszynski <tdu@semihalf.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Jan Remes <remes@netcope.com> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-07-04ethdev: remove old offload APIFerruh Yigit
In DPDK 17.11, the ethdev offloads API has changed: commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") The new API is documented in the programmer's guide: http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html#hardware-offload For reminder, the main concepts in the new API were: - All offloads are disabled by default - Distinction between per port and per queue offloads. The transition bits are now removed: - Translation of the old API in ethdev - rte_eth_conf.rxmode.ignore_offload_bitfield - ETH_TXQ_FLAGS_IGNORE The old API bits are now removed: - Rx per-port rte_eth_conf.rxmode.[bit-fields] - Tx per-queue rte_eth_txconf.txq_flags - ETH_TXQ_FLAGS_NO* Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>
2018-04-27ethdev: remove experimental flag of ports enumerationThomas Monjalon
The basic operations for ports enumeration should not be considered as experimental in DPDK 18.05. The iterator RTE_ETH_FOREACH_DEV was introduced in DPDK 17.05. It uses the function the rte_eth_find_next_owned_by() to get only ownerless ports. Its API can be considered stable. So the flag experimental is removed from rte_eth_find_next_owned_by(). The flag experimental is removed from rte_eth_dev_count_avail() which is the new name of the old function rte_eth_dev_count(). The flag experimental is set to rte_eth_dev_count_total() in the .c file for consistency with the declaration in the .h file. A lot of internal applications are fixed to not allow experimental API. Fixes: 8728ccf37615 ("fix ethdev ports enumeration") Fixes: d9a42a69febf ("ethdev: deprecate port count function") Fixes: e70e26861eaf ("net/mvpp2: fix build") Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Tested-by: David Marchand <david.marchand@6wind.com>
2018-04-18ethdev: deprecate port count functionThomas Monjalon
Some DPDK applications wrongly assume these requirements: - no hotplug, i.e. ports are never detached - all allocated ports are available to the application Such application iterates over ports by its own mean. The most common pattern is to request the port count and assume ports with index in the range [0..count[ can be used. In order to fix this common mistake in all external applications, the function rte_eth_dev_count is deprecated, while introducing the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total. Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-04-18fix ethdev ports enumerationThomas Monjalon
Some DPDK applications wrongly assume these requirements: - no hotplug, i.e. ports are never detached - all allocated ports are available to the application Such application iterates over ports by its own mean. The most common pattern is to request the port count and assume ports with index in the range [0..count[ can be used. There are three consequences when using such wrong design: - new ports having an index higher than the port count won't be seen - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application Such mistake will be less common with growing hotplug awareness. All applications and examples inside this repository - except testpmd - must be fixed to use the iterator RTE_ETH_FOREACH_DEV. Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-02-01examples: increase default ring sizes to 1024Kevin Laatz
Increase the default RX/TX ring sizes to 1024/1024 to accommodate for NICs with higher throughput (25G, 40G etc) Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@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-16examples/ipv4_multicast: convert to new ethdev offloads APIShahaf Shuler
Ethdev offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") This commit support the new API. Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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-12examples/ipv4_multicast: fix segments number typeIlya V. Matveychikov
Fixes: 97cb466d65c9 ("mbuf: use 2 bytes for port and nb segments") Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
2017-11-07examples: remove dependency on PCIBruce Richardson
All PCI functionality should be hidden from apps via the PCI bus driver, the EAL and individual device drivers. Therefore remove the inclusion of rte_pci.h from sample apps. 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-10-06ethdev: increase port id rangeZhiyong Yang
Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation docs have been updated in this patch. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-07-16examples: remove duplicate includesThomas Monjalon
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-07-08examples: adjust Rx and Tx descriptors to device limitsRoman Zhukov
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.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>
2017-04-21examples: limit max frame sizeAndriy Berestovskyy
Some PMDs do not support 9,5K jumbo frames, so the example fails. Limit the frame size to the maximum supported by the underlying NIC. Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
2017-04-10examples: enable HW CRC strip by defaultJeff Guo
Since VF can not disable/enable HW CRC strip for non-DPDK PF drivers, and kernel driver almost default enable that feature, if disable it in example app's rxmode, VF driver will report the VF launch failure. So this patch default to enable HW CRC strip to let VF launch successful. Cc: stable@dpdk.org Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2017-03-10examples: fix optind resetKeith Wiles
The variable optind should be reset to one not zero. From the man page: "The variable optind is the index of the next element to be processed in argv. The system initializes this value to 1. The caller can reset it to 1 to restart scanning of the same argv, or when scanning a new argument vector.” The problem I saw with my application was trying to parse the wrong option, which can happen as DPDK parses the first part of the command line and the application parses the second part. If you call getopt() multiple times in the same execution, the behavior is not maintained when using zero for optind. Signed-off-by: Keith Wiles <keith.wiles@intel.com>
2016-09-16remove unused ring includesAmine Kherbouche
This patch removes all unused <rte_ring.h> headers. Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com>
2016-05-02eal: add assert macro for debugThomas Monjalon
The macro RTE_VERIFY always checks a condition. It is optimized with "unlikely" hint. While this macro is well suited for test applications, it is preferred in libraries and examples to enable such check in debug mode. That's why the macro RTE_ASSERT is introduced to call RTE_VERIFY only if built with debug logs enabled. A lot of assert macros were duplicated and enabled with a specific flag. Removing these #ifdef allows to test these code branches more easily and avoid dead code pitfalls. The ENA_ASSERT is kept (in debug mode only) because it has more parameters to log. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-04-01ethdev: use constants for link stateThomas Monjalon
Define and use ETH_LINK_UP and ETH_LINK_DOWN where appropriate. Signed-off-by: Marc Sune <marcdevel@gmail.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-02-10remove extra parentheses in return statementHuawei Xie
fix the error reported by checkpatch: "ERROR: return is not a function, parentheses are not required" remove parentheses in return like: "return (logical expressions)" remove parentheses in return a function like: "return (rte_mempool_lookup(...))" Fixes: 6307b909b8e0 ("lib: remove extra parenthesis after return") Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2015-07-07examples/ipv4_multicast: support double vlan stripping and insertionHelin Zhang
The outer vlan should be copied from source packet buffer to support double vlan stripping and insertion, as double vlan can be stripped or inserted by some of NIC hardware. Signed-off-by: Helin Zhang <helin.zhang@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
2015-05-11apps: fix default mbuf sizeKonstantin Ananyev
Latest mbuf changes (priv_size addition and related fixes) exposed small problem with testpmd and few other sample apps: when mbuf size is exaclty 2KB or less, that causes ixgbe PMD to select scattered RX even for configs with 'normal' max packet length (max_rx_pkt_len == ETHER_MAX_LEN). To overcome that problem and unify the code, new macro was created to represent recommended minimal buffer length for mbuf. When appropriate, samples are updated to use that macro. Fixes: dfb03bbe2b ("app/testpmd: use standard functions to initialize mbufs and mbuf pool") Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-04-28apps: use helper to create mbuf poolsOlivier Matz
When it's possible, use the new helper to create the mbuf pools. Most of the patch is trivial, except for the following files that have some specifics (indirect mbufs): - ip_fragmentation - ip_pipeline - ipv4_multicast - vhost Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>