Commit Graph

173 Commits

Author SHA1 Message Date
Bruce Richardson
5a19633079 examples: warn about broken pkg-config
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 <bruce.richardson@intel.com>
2021-01-30 01:27:28 +01:00
Harman Kalra
88256ed853 examples/l3fwd: remove limitation on Tx queue count
In l3fwd no of transmit queues is calculated based on no of
lcores with which it is launched. Hence maximum no of tx
queues possible per port should depend on RTE_MAX_LCORE value.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-19 13:12:59 +01:00
Stephen Hemminger
cb056611a8 eal: rename lcore master and slave
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 <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-10-20 13:17:08 +02:00
Ivan Ilchenko
b55efbabe4 examples: check stop call status
rte_eth_dev_stop() return value was changed from void to int,
so this patch modify usage of this function across examples
according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 22:26:41 +02:00
Michael Pfeiffer
9863627f52 net: add function to calculate IPv4 header length
Add a function to calculate the length of an IPv4 header as suggested
on the mailing list [1]. Call where appropriate.

[1] https://mails.dpdk.org/archives/dev/2020-October/184471.html

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-10-16 19:48:17 +02:00
Timothy McDaniel
75d113136f eventdev: express DLB/DLB2 PMD constraints
This commit implements the eventdev ABI changes required by
the DLB/DLB2 PMDs.  Several data structures and constants are modified
or added in this patch, thereby requiring modifications to the
dependent apps and examples.

The DLB/DLB2 hardware does not conform exactly to the eventdev interface.
1) It has a limit on the number of queues that may be linked to a port.
2) Some ports a further restricted to a maximum of 1 linked queue.
3) DLB does not have the ability to carry the flow_id as part
   of the event (QE) payload. Note that the DLB2 hardware is capable of
   carrying the flow_id.

Following is a detailed description of the changes that have been made.

1) Add new fields to the rte_event_dev_info struct. These fields allow
the device to advertise its capabilities so that applications can take
the appropriate actions based on those capabilities.

    struct rte_event_dev_info {
	uint32_t max_event_port_links;
	/**< Maximum number of queues that can be linked to a single event
	 * port by this device.
	 */

	uint8_t max_single_link_event_port_queue_pairs;
	/**< Maximum number of event ports and queues that are optimized for
	 * (and only capable of) single-link configurations supported by this
	 * device. These ports and queues are not accounted for in
	 * max_event_ports or max_event_queues.
	 */
    }

2) Add a new field to the rte_event_dev_config struct. This field allows
the application to specify how many of its ports are limited to a single
link, or will be used in single link mode.

    /** Event device configuration structure */
    struct rte_event_dev_config {
	uint8_t nb_single_link_event_port_queues;
	/**< Number of event ports and queues that will be singly-linked to
	 * each other. These are a subset of the overall event ports and
	 * queues; this value cannot exceed *nb_event_ports* or
	 * *nb_event_queues*. If the device has ports and queues that are
	 * optimized for single-link usage, this field is a hint for how many
	 * to allocate; otherwise, regular event ports and queues can be used.
	 */
    }

3) Replace the dedicated implicit_release_disabled field with a bit field
of explicit port capabilities. The implicit_release_disable functionality
is assigned to one bit, and a port-is-single-link-only  attribute is
assigned to other, with the remaining bits available for future assignment.

	* Event port configuration bitmap flags */
	#define RTE_EVENT_PORT_CFG_DISABLE_IMPL_REL    (1ULL << 0)
	/**< Configure the port not to release outstanding events in
	 * rte_event_dev_dequeue_burst(). If set, all events received through
	 * the port must be explicitly released with RTE_EVENT_OP_RELEASE or
	 * RTE_EVENT_OP_FORWARD. Must be unset if the device is not
	 * RTE_EVENT_DEV_CAP_IMPLICIT_RELEASE_DISABLE capable.
	 */
	#define RTE_EVENT_PORT_CFG_SINGLE_LINK         (1ULL << 1)

	/**< This event port links only to a single event queue.
	 *
	 *  @see rte_event_port_setup(), rte_event_port_link()
	 */

	#define RTE_EVENT_PORT_ATTR_IMPLICIT_RELEASE_DISABLE 3
	/**
	 * The implicit release disable attribute of the port
	 */

	struct rte_event_port_conf {
		uint32_t event_port_cfg;
		/**< Port cfg flags(EVENT_PORT_CFG_) */
	}

This patch also removes the depreciation notice and announce
the new eventdev ABI changes in release note.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-10-15 23:16:07 +02:00
Radu Nicolau
84fb33fec1 build: remove deprecated cpuflag macros
Replace use of RTE_MACHINE_CPUFLAG macros with regular compiler
macros, which are more complete than those provided by DPDK, and as such
it allows new instruction sets to be leveraged without having to do
extra work to set them up in DPDK.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-09-25 11:13:57 +02:00
Ivan Dyukov
db4e81351f examples: use new link status print format
Add usage of rte_eth_link_to_str function to example
applications.

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-09-21 18:05:38 +02:00
Ciara Power
fda34680eb examples: remove legacy sections of makefiles
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 <ciara.power@intel.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2020-09-07 16:53:41 +02:00
Sarosh Arif
ce6b8c3154 examples: fix port mask parsing failure handling
Giving invalid or zero portmask as command line option to
these applications will have an unexpected response.
The reason behind this is that the return value of function
that parses portmask is stored in a variable whose datatype is
unsigned int, hence returning -1 in case of zero or
invalid portmask causes an unexpected behaviour.
If we return 0 instead of -1 this issue can be resolved.
The program already contains the functionality to print
"invalid portmask" and program usage if zero is returned.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-07-30 23:24:40 +02:00
Bruce Richardson
8549295db0 build/pkg-config: improve static linking flags
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 <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Pavan Nikhilesh
c1c48e7636 examples/l3fwd: check service core reset result
Fix unchecked return values reported by coverity.

Coverity issue: 354235
Fixes: 8bd537e9c6 ("examples/l3fwd: add service core setup based on caps")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-19 19:15:14 +02:00
Ivan Dyukov
c81e3f21d1 examples: remove extra new line after link duplex
This patch removes extra 'new line' in few app examples.

Fixes: d3641ae863 ("examples: update link status checks")
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")
Fixes: 204896f8d6 ("examples/l2fwd-jobstats: add new example")
Fixes: c8e6ceeceb ("examples/ioat: add new sample app for ioat driver")
Fixes: cc8f4d020c ("examples/ip_reassembly: initial import")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 39aad0e88c ("examples/flow_distributor: new example to demonstrate EFD")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Fixes: 20c78ac9ee ("examples/vm_power_mgr: add port initialisation")
Fixes: 361b2e9559 ("acl: new sample l3fwd-acl")
Fixes: de3cfa2c98 ("sched: initial import")
Fixes: d7937e2e3d ("power: initial import")
Fixes: 3fc5ca2f63 ("kni: initial import")
Cc: stable@dpdk.org

Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
2020-05-12 04:07:29 +02:00
Sunil Kumar Kori
d52e042850 examples/l3fwd: fix error checking
This patch fixes coverity issues regard to error check.

Coverity issue: 354227, 354232, 354238, 354239, 354240
Fixes: aaf58cb85b ("examples/l3fwd: add event port and queue setup")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-01 19:37:17 +02:00
Sunil Kumar Kori
78d44153de ethdev: add tracepoints
Add tracepoints at important and mandatory APIs for tracing support.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-04-23 15:40:06 +02:00
Thomas Monjalon
f2fc83b40f replace unused attributes
There is a common macro __rte_unused, avoiding warnings,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
ef5baf3486 replace packed attributes
There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Stephen Hemminger
16f80fd115 examples/l3fwd: improve destination lookup readability
The functions to lookup IPv4 and IPv6 were both using opaque
pointers (void *) when they should use a typed pointer instead.
The IP headers are not modified during lookup.

Get rid of unnecessary cast on the return from the function.
Replace complex trigraph expression with simple if to improve
readability.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:55 +01:00
Stephen Hemminger
6e228d781c examples/l3fwd: make route array constant
The initial route setup array is unmodified by the lpm code
and can be made constant. This depends on earlier patch to
fix the rte_lpm6 to use const.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:52 +01:00
Stephen Hemminger
63e5e1f902 examples/l3fwd: make lookup struct static
The lookup structure is only used in the lpm code and does
not have to be global.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-16 21:07:45 +01:00
Pavan Nikhilesh
7efe28bd07 examples: use common macro RTE_DIM
Use RTE_DIM macro to calculate array size.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-02-05 14:37:41 +01:00
Pavan Nikhilesh
af76ee5043 examples/l3fwd: add graceful teardown for eventdev
Add graceful teardown that addresses both event mode and poll mode.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:22 +01:00
Pavan Nikhilesh
a434a02d5c examples/l3fwd: add event em main loop
Add em main loop for handling events based on capabilities of the
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:19 +01:00
Pavan Nikhilesh
99fc91d180 examples/l3fwd: add event lpm main loop
Add lpm main loop for handling events based on capabilities of the
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:16 +01:00
Pavan Nikhilesh
8bd537e9c6 examples/l3fwd: add service core setup based on caps
Add service core setup when eventdev and Rx/Tx adapter don't have
internal port capability.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:13 +01:00
Pavan Nikhilesh
4eaf90cc18 examples/l3fwd: add event eth Rx/Tx adapter setup
Add event eth Rx/Tx adapter setup for both generic and internal port
event device pipelines.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:10 +01:00
Sunil Kumar Kori
aaf58cb85b examples/l3fwd: add event port and queue setup
Add event device queue and port setup based on event eth Tx adapter
capabilities.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:04 +01:00
Sunil Kumar Kori
a65bf3d724 examples/l3fwd: add ethdev setup based on eventdev
Add ethernet port Rx/Tx queue setup for event device which are later
used for setting up event eth Rx/Tx adapters.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:05:00 +01:00
Pavan Nikhilesh
ebc88e4e7f examples/l3fwd: add event device configuration
Add event device configuration based on the capabilities of the
probed event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:04:51 +01:00
Sunil Kumar Kori
9176e1fceb examples/l3fwd: split pipelines based on capability
Add infra to split eventdev framework based on event Tx adapter
capability.
If event Tx adapter has internal port capability then we use
`rte_event_eth_tx_adapter_enqueue` to transmitting packets else
we use a SINGLE_LINK event queue to enqueue packets to a service
core which is responsible for transmitting packets.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:04:44 +01:00
Sunil Kumar Kori
e2de1f7bb9 examples/l3fwd: add framework for event device
Add framework to enable event device as a producer of packets.
To switch between event mode and poll mode the following options
have been added:
	`--mode="eventdev"` or `--mode="poll"`
Allow the user to select the schedule type to be either
RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_PARALLEL
through:
	`--eventq-sched="ordered"` or `--eventq-sched="atomic"` or
		`--eventq-sched="parallel"`
Allow the user to specify the number of Rx queues to be connected to
event queue using:
	`--event-eth-rxqs`

Poll mode is still the default operation mode.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-28 10:04:25 +01:00
Bruce Richardson
69b1bb49ed examples: hide error for missing pkg-config path flag
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: 22119c4591 ("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-20 22:48:32 +01:00
Bruce Richardson
12a652a02b examples: fix build with old pkg-config
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: ca9268529d ("examples: support relocated DPDK install")
Fixes: 7f80a2102b ("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-20 22:47:15 +01:00
Stephen Hemminger
7cc1bd4613 examples/l3fwd: fix IP reserved address range
The original patch used incorrect subnet range for testing.

Fixes: 37afe381bd ("examples/l3fwd: use reserved IP addresses")
Cc: stable@dpdk.org

Reported-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-11-08 15:34:10 +01:00
Feifei Wang
39d21077e5 examples/l3fwd: prefetch the content of the next packet
The cache-misses problem is very serious when the function
lpm_cb_parse_ptype is called to read the content of packets. That is
because the contents of packages previously stored in the cache are
overwritten by the following instructions or variables.
Thus the prefetch order can be used to prefetch the next packet into
the cache to avoid CPU spending too much time on it.

On Octeon TX platform with built-in NIC, 12% performance gain was
measured by running RFC2544 NDR test with l3fwd. Furthermore, the
cache-misses event of the function lpm_cb_parse_ptype was reduced by
20%, and the CPU task-clock of it dropped from 16.49% to 11.3%, based
on the forwarding test for one minute with the 64B packet.
On the dpaa2 platform, no performance improvement nor drop were seen
with this patch by running RFC2544 NDR test with l3fwd.
On the x86 platform, 15.7% performance gain was measured by running
RFC2544 NDR test with l3fwd.

Signed-off-by: Feifei Wang <feifei.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
2019-10-27 18:21:16 +01:00
Igor Romanov
70febdcfd6 examples: check status of getting MAC address
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-07 15:00:55 +02:00
Igor Romanov
22e5c73bd1 examples: check status of getting link info
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-07 15:00:54 +02:00
Ivan Ilchenko
f430bbcecf examples: take promiscuous mode switch result into account
rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return
value was changed from void to int, so this patch modify usage
of these functions across examples according to new return type.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-10-07 15:00:54 +02:00
Ivan Ilchenko
089e5ed727 examples: check status of getting ethdev info
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-10-07 14:45:35 +02:00
Hariprasad Govindharajan
d7f936190e examples/l3fwd: fix unaligned memory access on x86
Fix unaligned memory access when reading IPv6 header which
leads to segmentation fault by changing aligned memory read
to unaligned memory read.

Bugzilla ID: 279
Fixes: 64d3955de1 ("examples/l3fwd: fix ARM build")
Cc: stable@dpdk.org

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Tested-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
2019-07-30 22:05:00 +02:00
Marcin Zapolski
5c5c1f99a9 examples: fix use of ethdev internal device array
Modify l3fwd and related example apps to use locally defined port_conf
instead of global rte_eth_devices which is not a part of public API.
Apps should not be using internal DPDK data structures directly.

Fixes: 1ef9600b2d ("examples/l3fwd: convert to ethdev offloads API")
Fixes: ba8c103d24 ("examples/l3fwd-acl: convert to new ethdev offloads API")
Fixes: 40df1d7a69 ("examples/l3fwd-power: convert to new ethdev offloads API")
Fixes: 43fc038262 ("examples/l3fwd-vf: convert to new ethdev offloads API")
Fixes: 373149c631 ("examples/performance-thread: convert to new offloads API")
Cc: stable@dpdk.org

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
2019-07-18 22:32:45 +02:00
Bruce Richardson
4131ad5db7 examples: fix pkg-config detection with older make
Make versions before 4.2 did not have support for the .SHELLSTATUS
variable, so use another method to detect shell success.

Fixes: 22119c4591 ("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-03 23:10:23 +02:00
Bruce Richardson
ca9268529d examples: support relocated DPDK install
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-07-02 18:07:46 +02:00
David Marchand
0c9da7555d net: replace IPv4/v6 constants with uppercase name
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-06-03 16:54:54 +02:00
Olivier Matz
24ac604ef7 net: add rte prefix to IP defines
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-24 13:34:46 +02:00
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
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-24 13:34:46 +02:00
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
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-24 13:34:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
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-24 13:34:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
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-24 13:34:45 +02:00
Bruce Richardson
7e9562a107 examples: fix make clean when using pkg-config
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: 22119c4591 ("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-05-20 23:57:47 +02:00