Update the coding style document to include a policy against
introducing new master/slave usage. This is taken from the similar
place in the Linux kernel coding style.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
app/procinfo: provide way to request info on owned ports
There are cases where a port maybe owned by another (failsafe, netvsc,
bond); but currently proc-info has no way to look at stats of those
ports. This patch provides way for the user to explicitly ask for these
ports.
If no portmask is given the output is unchanged; it only shows the
top level ports. If portmask requests a specific port it will be
shown even if owned.
Increase the size of port mask variable to unsigned long to
allow up to 64 ports to be handled on 64 bit architecture.
The device owner is also a useful thing to show in port info.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Revise the display of port information to include more data
and be more human friendly.
* Show driver and device information
* Show MAC address
* Show flow control information
* Combine lines if possible
* Show all multicast mode
* Show queue mempool name
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Ophir Munk [Sun, 18 Oct 2020 14:21:47 +0000 (14:21 +0000)]
app/regex: fix crash in options parsing
getopt_long() parses command-line arguments. One of its arguments
'longopts' is a pointer to the first element of an array of struct
option. The last element of the array has to be filled with zeros
to mark the end of options. For example:
This commit adds the last element. Prior to this commit getopt_long()
continued parsing beyond the longopts[] array which occasionally caused
segmentation faults.
Fixes: de06137cb295 ("app/regex: add RegEx test application") Cc: stable@dpdk.org Signed-off-by: Ophir Munk <ophirmu@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com> Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Bruce Richardson [Thu, 15 Oct 2020 15:05:53 +0000 (16:05 +0100)]
build: standardize component names and defines
As discussed on the dpdk-dev mailing list[1], we can make some easy
improvements in standardizing the naming of the various components in DPDK,
and their associated feature-enabled macros.
Following this patch, each library will have the name in format,
'librte_<name>.so', and the macro indicating that library is enabled in the
build will have the form 'RTE_LIB_<NAME>'.
Similarly, for libraries, the equivalent name formats and macros are:
'librte_<class>_<name>.so' and 'RTE_<CLASS>_<NAME>', where class is the
device type taken from the relevant driver subdirectory name, i.e. 'net',
'crypto' etc.
To avoid too many changes at once for end applications, the old macro names
will still be provided in the build in this release, but will be removed
subsequently.
Bruce Richardson [Thu, 15 Oct 2020 15:05:52 +0000 (16:05 +0100)]
devtools: load all drivers in null test
Rather than specifying specific drivers in the driver directory to load, we
can just pass in the whole driver directory to the "-d" EAL flag, causing
all drivers to load. This makes the load of driver independent of any
specific driver names.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Bruce Richardson [Thu, 15 Oct 2020 15:05:51 +0000 (16:05 +0100)]
build: remove library name from version map file name
Since each version map file is contained in the subdirectory of the library
it refers to, there is no need to include the library name in the filename.
This makes things simpler in case of library renaming.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Rosen Xu <rosen.xu@intel.com>
Bruce Richardson [Thu, 15 Oct 2020 15:05:50 +0000 (16:05 +0100)]
common/qat: build drivers from common folder
Since the drivers in the common directory can be processed out of order, in
this case following the "bus" directory, we can simplify somewhat the build
of the QAT driver to be done entirely from the "common/qat" folder rather
than having it's build distributed across 3 folders.
This also opens up the possibility of building the QAT driver with crypto
only and the compression part disabled. It further allows more sensible
naming of the resulting shared library in case of standardizing library
names based on device class; i.e. common_qat is more descriptive for a
combined crypto/compression driver than either of the other two prefixes
individually.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Bruce Richardson [Thu, 15 Oct 2020 15:05:49 +0000 (16:05 +0100)]
build: add defines for compatibility with make build
The defines used to indicate what crypto, compression and eventdev drivers
were being built were different to those used in the make build, with meson
defining them with "_PMD" at the end, while make defined them with "_PMD"
in the middle and the specific driver name at the end. This might cause
compatibility issues for applications which used the older defines, which
switching to build against new DPDK releases.
As well as changing the default to match that of make, meson also
special-cases the crypto/compression/event drivers to have both defines
provided. This ensures compatibility for these macros with both meson and
make from older versions.
For a selection of other libraries and drivers, there were other
incompatibilities between the meson and make-defined macros which were not
previously highlighted in a deprecation notice, so we add per-macro
compatibility defines for these to ease the transition from make to meson.
Fixes: 5b9656b157d3 ("lib: build with meson") Fixes: 9314afb68a53 ("drivers: add infrastructure for meson build") Fixes: dcadbbde8e61 ("crypto/null: build with meson") Fixes: 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression PMD") Fixes: eca504f318db ("drivers/event: build skeleton and SW drivers with meson") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Bruce Richardson [Thu, 15 Oct 2020 15:05:47 +0000 (16:05 +0100)]
app: fix missing dependencies
A number of lib and driver dependencies for various apps were missed on
build because the proper macro names for their use were mismatched between
meson and make build systems. Before adding in equivalent compatibility
macros we need to ensure to add the proper dependencies to ensure a valid
build.
Fixes: 16ade738fd0d ("app/testpmd: build with meson") Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test") Fixes: 996ef1176111 ("app: add all remaining apps to meson build") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Bruce Richardson [Thu, 10 Sep 2020 11:32:05 +0000 (12:32 +0100)]
doc: add SPDX license tag header to meson guide
The build-sdk-meson.rst file originates from the short plain-text meson
instructions added in 2018. Add SPDX tag and copyright notice based on the
original commit.
Fixes: 9c3adc289c5e ("doc: add instructions on build using meson") Cc: stable@dpdk.org Reported-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ciara Power [Tue, 13 Oct 2020 15:56:48 +0000 (16:56 +0100)]
test/telemetry: fix socket resource leak
If an error occurred when reading from the socket, the function
returned without closing the socket. This is now fixed to avoid the
resource leak of the sock variable going out of scope.
Coverity issue: 363043 Fixes: bd78cf693ebd ("test/telemetry: add unit tests for data to JSON") Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Ciara Power [Tue, 13 Oct 2020 16:28:20 +0000 (17:28 +0100)]
test/telemetry: fix error handling for socket
When the socket connection failed, an error was printed to screen but
the function did not return an error, and continued to try read from the
socket. This is now corrected to close the socket and return -1 when the
connection fails.
Fixes: bd78cf693ebd ("test/telemetry: add unit tests for data to JSON") Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Ciara Power [Mon, 19 Oct 2020 13:48:58 +0000 (15:48 +0200)]
acl: check max SIMD bitwidth
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path. These checks are added in the check alg helper functions.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Ciara Power [Mon, 19 Oct 2020 13:48:57 +0000 (15:48 +0200)]
node: choose vector path at runtime
When choosing the vector path, max SIMD bitwidth is now checked to
ensure the vector path is suitable. To do this, the scalar function is
chosen by default in the struct, but at node initialisation time, this
function pointer is updated to the vector version if supported, and
if it is within the max SIMD bitwidth limit.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Ciara Power [Mon, 19 Oct 2020 13:48:56 +0000 (15:48 +0200)]
net: check max SIMD bitwidth
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path.
The vector path was initially chosen in RTE_INIT, however this is no
longer suitable as we cannot check the max SIMD bitwidth at that time.
Default handlers are now chosen on initialisation, these default
handlers are used the first time the crc calc is called, and they set
the suitable handlers to be used going forward.
Ciara Power [Mon, 19 Oct 2020 13:48:50 +0000 (15:48 +0200)]
net/ixgbe: check max SIMD bitwidth
When choosing a vector path to take, an extra condition must be
satisfied to ensure the max SIMD bitwidth allows for the CPU enabled
path.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Ciara Power [Mon, 19 Oct 2020 13:48:41 +0000 (15:48 +0200)]
eal: control max SIMD bitwidth
This patch adds a max SIMD bitwidth EAL configuration. The API allows
for an app to set this value. It can also be set using EAL argument
--force-max-simd-bitwidth, which will lock the value and override any
modifications made by the app.
Each arch has a define for the default SIMD bitwidth value, this is used
on EAL init to set the config max SIMD bitwidth.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Acked-by: Ray Kinsella <mdr@ashroe.eu>
Gagandeep Singh [Mon, 19 Oct 2020 09:48:01 +0000 (17:48 +0800)]
crypto/caam_jr: fix device tree parsing for SEC_ERA
Previously, SEC_ERA was hardcoded and it was removed in [1].
Now when that hardcoded was removed, it is supposed to be
read from the device tree but it is not done correctly.
This patch calls a necessary API of_init() before using any
of_* APIs to retrieve information from the device tree and
if reading integer value that must be converted to cpu endianness
before using it.
[1] eef9e0412a84 ("drivers/crypto: fix build with -fno-common")
Jun Yang [Thu, 15 Oct 2020 09:47:06 +0000 (17:47 +0800)]
raw/dpaa2_qdma: support scatter gather in enqueue
This patch add support to add Scatter Gather support
for different jobs for qdma queues.
It also supports gathering multiple enqueue jobs into SG enqueue job(s).
Jun Yang [Thu, 15 Oct 2020 09:47:04 +0000 (17:47 +0800)]
raw/dpaa2_qdma: refactor the code
This patch moves qdma queue specific configurations from driver
global configuration to per-queue setup. This is required
as each queue can be configured differently.
eal/linux: add function to allow interruptible epoll
The existing definition of rte_epoll_wait retries if interrupted
by a signal. This behavior makes it hard to use rte_epoll_wait
for applications that want to use signals do do things like
exit polling loop and shutdown.
Since changing existing semantic might break applications, add
a new rte_epoll_wait_interruptible() function that does the
same thing as rte_epoll_wait but will return -1 and errno of EINTR
if it receives a signal.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Harman Kalra <hkalra@marvell.com>
Sarosh Arif [Tue, 8 Sep 2020 10:22:04 +0000 (15:22 +0500)]
test/distributor: fix mbuf leak on failure
rte_mempool_get_bulk is used to get bufs/many_bufs from the pool,
but at some locations when test fails the bufs/many_bufs are
not returned back to the pool.
Due to this, multiple executions of distributor_autotest gives the
following error message: Error getting mbufs from pool.
To resolve this issue rte_mempool_put_bulk is used whenever the test
fails and returns.
Fixes: c3eabff124e6 ("distributor: add unit tests") Cc: stable@dpdk.org Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com> Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Reviewed-by: David Hunt <david.hunt@intel.com>
test/distributor: fix quitting workers in burst mode
Sending number of packets equal to number of workers isn't enough
to stop all workers in burst version of distributor as more than
one packet can be matched and consumed by a single worker. This way
some of workers might not be awaken from rte_distributor_get_pkt().
This patch fixes it by sending packets one by one. Each sent packet
causes exactly one worker to quit.
test/distributor: ensure all packets are delivered
In all distributor tests there is a chance that tests
will send packets to distributor with rte_distributor_process()
before workers are started and requested for packets.
This patch ensures that all packets are delivered to workers
by calling rte_distributor_process() in loop until number
of successfully processed packets reaches required by test.
Change is applied to every first call in test case.
Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
rte_distributor_flush() is using total_outstanding()
function to calculate if it should still wait
for processing packets. However in burst mode
only backlog packets were counted.
This patch fixes that issue by counting also in flight
packets. There are also sum fixes to properly keep
count of in flight packets for each worker in bufs[].count.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
All of the former tests analyzed only statistics
of packets processed by all workers.
The new test verifies also if packets are processed
on workers as expected.
Every packets processed by the worker is marked
and analyzed after it is returned to distributor.
This test allows finding issues in matching algorithms.
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
Fix improper indexes while comparing tags.
In the find_match_scalar() function:
* j iterates over flow tags of following packets;
* w iterates over backlog or in flight tags positions.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
Instead of making delays in test code and waiting
for worker hopefully to reach proper states,
synchronize worker shutdown test cases with spin lock
on atomic variable.
Fixes: c0de0eb82e40 ("distributor: switch over to new API") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
After introducing burst API there were some artefacts in the
API documentation from legacy single API.
Also the rte_distributor_poll_pkt() function return values
mismatched the implementation.
Fixes: c0de0eb82e40 ("distributor: switch over to new API") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
During quit_workers function distributor's main core processes
some packets to wake up pending worker cores so they can quit.
As quit_workers acts also as a cleanup procedure for next test
case it should also collect these packets returned by workers'
handlers, so the cyclic buffer with returned packets
in distributor remains empty.
Fixes: c3eabff124e6 ("distributor: add unit tests") Fixes: c0de0eb82e40 ("distributor: switch over to new API") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
Sanity tests with mbuf alloc and shutdown tests assume that
mbufs passed to worker cores are freed in handlers.
Such packets should not be returned to the distributor's main
core. The only packets that should be returned are the packets
send after completion of the tests in quit_workers function.
This patch stops returning mbufs to distributor's core.
In case of shutdown tests it is impossible to determine
how worker and distributor threads would synchronize.
Packets used by tests should be freed and packets used during
quit_workers() shouldn't. That's why returning mbufs to mempool
is moved to test procedure run on distributor thread
from worker threads.
Additionally this patch cleans up unused variables.
Fixes: c0de0eb82e40 ("distributor: switch over to new API") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
In the single legacy version of the distributor synchronization
requires continues exchange of buffers between distributor
and workers. Empty buffers are sent if only handshake
synchronization is required.
However calls to the rte_distributor_return_pkt()
with 0 buffers in single mode were ignored and not passed to the
legacy algorithm implementation causing lack of synchronization.
This patch fixes this issue by passing NULL as buffer which is
a valid way of sending just synchronization handshakes
in single mode.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
The sanity test with worker shutdown delegates all bufs
to be processed by a single lcore worker, then it freezes
one of the lcore workers and continues to send more bufs.
The freezed core shuts down first by calling
rte_distributor_return_pkt().
The test intention is to verify if packets assigned to
the shut down lcore will be reassigned to another worker.
However the shutdown core was not always the one, that was
processing packets. The lcore processing mbufs might be different
every time test is launched. This is caused by keeping the value
of wkr static variable in rte_distributor_process() function
between running test cases.
Test freezed always lcore with 0 id. The patch stores the id
of worker that is processing the data in zero_idx global atomic
variable. This way the freezed lcore is always the proper one.
Fixes: c3eabff124e6 ("distributor: add unit tests") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Tested-by: David Hunt <david.hunt@intel.com>
The burst version of distributor implementation was missing proper
handling of worker shutdown. A worker processing packets received
from distributor can call rte_distributor_return_pkt() function
informing distributor that it want no more packets. Further calls to
rte_distributor_request_pkt() or rte_distributor_get_pkt() however
should inform distributor that new packets are requested again.
Lack of the proper implementation has caused that even after worker
informed about returning last packets, new packets were still sent
from distributor causing deadlocks as no one could get them on worker
side.
This patch adds handling shutdown of the worker in following way:
1) It fixes usage of RTE_DISTRIB_VALID_BUF handshake flag. This flag
was formerly unused in burst implementation and now it is used
for marking valid packets in retptr64 replacing invalid use
of RTE_DISTRIB_RETURN_BUF flag.
2) Uses RTE_DISTRIB_RETURN_BUF as a worker to distributor handshake
in retptr64 to indicate that worker has shutdown.
3) Worker that shuts down blocks also bufptr for itself with
RTE_DISTRIB_RETURN_BUF flag allowing distributor to retrieve any
in flight packets.
4) When distributor receives information about shutdown of a worker,
it: marks worker as not active; retrieves any in flight and backlog
packets and process them to different workers; unlocks bufptr64
by clearing RTE_DISTRIB_RETURN_BUF flag and allowing use in
the future if worker requests any new packets.
5) Do not allow to: send or add to backlog any packets for not
active workers. Such workers are also ignored if matched.
6) Adjust calls to handle_returns() and tags matching procedure
to react for possible activation deactivation of workers.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
rte_distributor_request_pkt and rte_distributor_get_pkt dereferenced
oldpkt parameter when in RTE_DIST_ALG_SINGLE even if number
of returned buffers from worker to distributor was 0.
This patch passes NULL to the legacy API when number of returned
buffers is 0. This allows passing NULL as oldpkt parameter.
Distributor tests are also updated passing NULL as oldpkt and
0 as number of returned packets, where packets are not returned.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
Synchronization of data exchange between distributor and worker cores
is based on 2 handshakes: retptr64 for returning mbufs from workers
to distributor and bufptr64 for passing mbufs to workers.
Without proper order of verifying those 2 handshakes a deadlock may
occur. This can happen when worker core wants to return back mbufs
and waits for retptr handshake to be cleared while distributor core
waits for bufptr to send mbufs to worker.
This can happen as worker core first returns mbufs to distributor
and later gets new mbufs, while distributor first releases mbufs
to worker and later handle returning packets.
This patch fixes possibility of the deadlock by always taking care
of returning packets first on the distributor side and handling
packets while waiting to release new.
Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com> Acked-by: David Hunt <david.hunt@intel.com>
rte_distributor_return_pkt function which is run on worker cores
must wait for distributor core to clear handshake on retptr64
before using those buffers. While the handshake is set distributor
core controls buffers and any operations on worker side might overwrite
buffers which are unread yet.
Same situation appears in the legacy single distributor. Function
rte_distributor_return_pkt_single shouldn't modify the bufptr64 until
handshake on it is cleared by distributor lcore.
Kevin Laatz [Wed, 14 Oct 2020 10:09:48 +0000 (11:09 +0100)]
raw/ioat: fix kvlist free
There is a null pointer check in 'idxd_vdev_parse_params()' which is
causing a coverity issue. This check is redundant as the same check is
being done in 'rte_kvargs_free()', so it is simply removed in this patch.
In addition, kvlist was only being free'd on one path in this function.
This is fixed by always free'ing kvlist before returning.
Coverity issue: 363049 Fixes: 777edf43ae4f ("raw/ioat: introduce vdev probe for DSA/idxd device") Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Kevin Laatz [Wed, 14 Oct 2020 10:11:10 +0000 (11:11 +0100)]
raw/ioat: fix dereference before null check
The 'idxd' pointer in 'idxd_rawdev_destroy()' is being dereferenced before
it is checked. To fix this, the null pointer check was moved to occur
earlier in the code.
Coverity issue: 363040 Fixes: ff06fa2cf3ba ("raw/ioat: probe idxd PCI") Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Akhil Goyal [Sun, 18 Oct 2020 09:40:41 +0000 (15:10 +0530)]
security: update session create API
The API ``rte_security_session_create`` takes only single
mempool for session and session private data. So the
application need to create mempool for twice the number of
sessions needed and will also lead to wastage of memory as
session private data need more memory compared to session.
Hence the API is modified to take two mempool pointers
- one for session and one for private data.
This is very similar to crypto based session create APIs.
Replace '--scalar' command-line option with new one: --alg=<algname>
to allow user explicitly select desired classify method.
This is an optional parameter, if not specified default classify
algorithm will be used.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Introduces two changes into l3fwd-acl behaviour to make
it behave in the same way as l3fwd:
- Add a command-line parameter to allow the user to specify the
destination mac address for each ethernet port used.
- While forwarding the packet update source and destination mac
addresses.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Ferruh Yigit [Wed, 14 Oct 2020 02:26:48 +0000 (03:26 +0100)]
doc: announce queue stats moving to xstats
Queue stats will be removed from basic stats to xstats.
It will be PMDs responsibility to fill queue stats based on number of
queues they have.
Until all PMDs implement the xstats, a temporary
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' device flag created. PMDs switched
to the xstats should clear this flag to bypass the ethdev layer autofill
for queue stats.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Ferruh Yigit [Wed, 14 Oct 2020 02:26:47 +0000 (03:26 +0100)]
ethdev: add device flag to bypass auto-filled queue xstats
Queue stats are stored in 'struct rte_eth_stats' as array and array size
is defined by 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag.
As a result of technical board discussion, decided to remove the queue
statistics from 'struct rte_eth_stats' in the long term.
Instead PMDs should represent the queue statistics via xstats, this
gives more flexibility on the number of the queues supported.
Currently queue stats in the xstats are filled by ethdev layer, using
some basic stats, when queue stats removed from basic stats the
responsibility to fill the relevant xstats will be pushed to the PMDs.
During the switch period, temporary 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS'
device flag is created. Initially all PMDs using xstats set this flag.
The PMDs implemented queue stats in the xstats should clear the flag.
When all PMDs switch to the xstats for the queue stats, queue stats
related fields from 'struct rte_eth_stats' will be removed, as well as
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' flag.
Later 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag also can be
removed.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Xiao Wang <xiao.w.wang@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:45 +0000 (14:30 +0100)]
ethdev: change stop operation callback to return int
Change eth_dev_stop_t return value from void to int.
Make eth_dev_stop_t implementations across all drivers to return
negative errno values if case of error conditions.
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>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:38 +0000 (14:30 +0100)]
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>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:36 +0000 (14:30 +0100)]
test: 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 test/event
according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:43 +0000 (14:30 +0100)]
app/testpmd: 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 app/testpmd
according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:42 +0000 (14:30 +0100)]
app/flow-perf: 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 app/flow-perf
according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:44 +0000 (14:30 +0100)]
net/failsafe: 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 net/failsafe
according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:39 +0000 (14:30 +0100)]
net/bonding: 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 net/bonding
according to new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Ivan Ilchenko [Thu, 15 Oct 2020 13:30:35 +0000 (14:30 +0100)]
ethdev: allow stop function to return an error
Change rte_eth_dev_stop() return value from void to int
and return negative errno values in case of error conditions.
Also update the usage of the function in ethdev according to
the new return type.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Thomas Monjalon [Fri, 16 Oct 2020 13:32:58 +0000 (15:32 +0200)]
ethdev: reset all when releasing a port
The function rte_eth_dev_release_port() is partially resetting
the struct rte_eth_dev. The drivers were completing this reset
with more pointers set to NULL in the close or remove operations.
More pointers are reset at ethdev level,
and some redundant assignments are removed from PMDs.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Haiyue Wang <haiyue.wang@intel.com> Acked-by: Jeff Guo <jia.guo@intel.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Thomas Monjalon [Fri, 16 Oct 2020 13:32:57 +0000 (15:32 +0200)]
ethdev: remove forcing stopped state upon close
When closing a port, it is supposed to be already stopped,
and marked as such with "dev_started" state zeroed by the stop API.
Resetting "dev_started" before calling the driver close operation
was hiding the case of not properly stopped port being closed.
The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
In case the "dev_stop" function is called from "dev_close",
bypassing "rte_eth_dev_stop()" API,
the "dev_started" state must be explicitly reset in the PMD
in order to keep the same behaviour.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Sets the offsets of packet segments from the beginning of the
receiving buffer if split feature is engaged. Affects only the
queues configured with split offloads (currently BUFFER_SPLIT
is supported only).
Add interactive mode command, providing the same:
testpmd> set rxoffs (x[,y]*)
Where x[,y]* represents a CSV list of values, without white space.
Sets the length of segments to scatter packets on receiving if split
feature is engaged. Affects only the queues configured with split
offloads (currently BUFFER_SPLIT is supported only).
Add interactive mode command:
testpmd> set rxpkts (x[,y]*)
Where x[,y]* represents a CSV list of values, without white space.
Sets the length of segments to scatter packets on receiving if split
feature is engaged. Affects only the queues configured with split
offloads (currently BUFFER_SPLIT is supported only). Optionally the
multiple memory pools can be specified with --mbuf-size command line
parameter and the mbufs to receive will be allocated sequentially
from these extra memory pools.