Commit Graph

34011 Commits

Author SHA1 Message Date
Andrew Rybchenko
e6e62f6f55 mempool: flush cache completely on overflow
The cache was still full after flushing. In the opposite direction,
i.e. when getting objects from the cache, the cache is refilled to full
level when it crosses the low watermark (which happens to be zero).
Similarly, the cache should be flushed to empty level when it crosses
the high watermark (which happens to be 1.5 x the size of the cache).
The existing flushing behaviour was suboptimal for real applications,
because crossing the low or high watermark typically happens when the
application is in a state where the number of put/get events are out of
balance, e.g. when absorbing a burst of packets into a QoS queue
(getting more mbufs from the mempool), or when a burst of packets is
trickling out from the QoS queue (putting the mbufs back into the
mempool).
Now, the mempool cache is completely flushed when crossing the flush
threshold, so only the newly put (hot) objects remain in the mempool
cache afterwards.

This bug degraded performance caused by too frequent flushing.

Consider this application scenario:

Either, an lcore thread in the application is in a state of balance,
where it uses the mempool cache within its flush/refill boundaries; in
this situation, the flush method is less important, and this fix is
irrelevant.

Or, an lcore thread in the application is out of balance (either
permanently or temporarily), and mostly gets or puts objects from/to the
mempool. If it mostly puts objects, not flushing all of the objects will
cause more frequent flushing. This is the scenario addressed by this
fix. E.g.:

Cache size=256, flushthresh=384 (1.5x size), initial len=256;
application burst len=32.

If there are "size" objects in the cache after flushing, the cache is
flushed at every 4th burst.

If the cache is flushed completely, the cache is only flushed at every
16th burst.

As you can see, this bug caused the cache to be flushed 4x too
frequently in this example.

And when/if the application thread breaks its pattern of continuously
putting objects, and suddenly starts to get objects instead, it will
either get objects already in the cache, or the get() function will
refill the cache.

The concept of not flushing the cache completely was probably based on
an assumption that it is more likely for an application's lcore thread
to get() after flushing than to put() after flushing.
I strongly disagree with this assumption! If an application thread is
continuously putting so much that it overflows the cache, it is much
more likely to keep putting than it is to start getting. If in doubt,
consider how CPU branch predictors work: When the application has done
something many times consecutively, the branch predictor will expect the
application to do the same again, rather than suddenly do something
else.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-10-26 12:10:33 +02:00
Morten Brørup
459531c958 mempool: fix cache flushing algorithm
Fix the rte_mempool_do_generic_put() caching flushing algorithm to
keep hot objects in cache instead of cold ones.

The algorithm was:
 1. Add the objects to the cache.
 2. Anything greater than the cache size (if it crosses the cache flush
    threshold) is flushed to the backend.

Please note that the description in the source code said that it kept
"cache min value" objects after flushing, but the function actually kept
the cache full after flushing, which the above description reflects.

Now, the algorithm is:
 1. If the objects cannot be added to the cache without crossing the
    flush threshold, flush some cached objects to the backend to
    free up required space.
 2. Add the objects to the cache.

The most recent (hot) objects were flushed, leaving the oldest (cold)
objects in the mempool cache. The bug degraded performance, because
flushing prevented immediate reuse of the (hot) objects already in
the CPU cache.  Now, the existing (cold) objects in the mempool cache
are flushed before the new (hot) objects are added the to the mempool
cache.

Since nearby code is touched anyway fix flush threshold comparison
to do flushing if the threshold is really exceed, not just reached.
I.e. it must be "len > flushthresh", not "len >= flushthresh".
Consider a flush multiplier of 1 instead of 1.5; the cache would be
flushed already when reaching size objects, not when exceeding size
objects. In other words, the cache would not be able to hold "size"
objects, which is clearly a bug. The bug could degraded performance
due to premature flushing.

Since we never exceed flush threshold now, cache size in the mempool
may be decreased from RTE_MEMPOOL_CACHE_MAX_SIZE * 3 to
RTE_MEMPOOL_CACHE_MAX_SIZE * 2. In fact it could be
CALC_CACHE_FLUSHTHRESH(RTE_MEMPOOL_CACHE_MAX_SIZE), but flush
threshold multiplier is internal.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-10-26 12:09:13 +02:00
Naga Harish K S V
75c5bfc320 eventdev/eth_tx: fix queue delete
To delete all the queues of an ethdev device associated with
adapter instance the queue_id can be passed as -1 to the queue
delete API.

When a subset of queues of a ethdev device are associated,
the queue delete logic is exiting without deleting the queues
in some cases (higher numbered associated queues) for above
scenario as the queue delete logic is not checking all the
queue association status.

This patch fixes this issue by checking the queue association
status of all the queues of the ethernet device.

Fixes: 741b499e64 ("eventdev/eth_tx: fix queue delete logic")
Cc: stable@dpdk.org

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
2022-10-21 11:42:08 +02:00
Abdullah Sevincer
728717ebb8 event/dlb2: fix port COS range allocation
Fix the allocation of port COS when the application requested port
COS exceeds (e.g. beyond 0-15) the number of LDB ports for
the domain.

Driver limits application specified ports from a COS to the
max ports allocated for the COS so that the rest of the
ports can be allocated from default(best) COS.

Fixes: bec8901bfe ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
2022-10-21 11:42:08 +02:00
Ganapati Kundapura
8f4ff7de39 eventdev/crypto: fix multi-process
Secondary process is not able to call the crypto adapter
APIs stats get/reset as crypto adapter memzone memory
is not accessible by secondary process.

Added memzone lookup so that secondary process can call the
crypto adapter APIs(stats_get etc)

Fixes: 7901eac340 ("eventdev: add crypto adapter implementation")
Cc: stable@dpdk.org

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2022-10-21 11:42:08 +02:00
Olivier Matz
05d22d4e06 event/sw: fix log in self test
The log should display the value, not the ID.

Fixes: e21df4b062 ("test/eventdev: add SW xstats tests")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2022-10-21 11:42:08 +02:00
Olivier Matz
ab059e82e1 event/sw: fix flow ID init in self test
The issue is seen by unit tests:

MALLOC_PERTURB_=204 \
DPDK_TEST=eventdev_selftest_sw \
/root/dpdk/x86_64-native-linuxapp-gcc/app/test/dpdk-test -c 0xff
(...)
*** Running XStats ID Reset test...
12: 1761: qid_0_port_2_pinned_flows value , expected 1 got 7
1778: qid_0_port_2_pinned_flows value incorrect, expected 1 got 7
ERROR - XStats ID Reset test FAILED.
SW Eventdev Selftest Failed.
Test Failed

The flow ID is not set in the event, which results in an undefined
flow, whose value depends on what was previously in stack. Having
different flows for the packets makes the test to fail, since only one
flow is expected.

This only happens in -O3, where the same stack area is shared by the
event object and the address of the mbuf allocated in rte_gen_arp().

Fix this by properly initializing the flow id.

Bugzilla ID: 1101
Fixes: e21df4b062 ("test/eventdev: add SW xstats tests")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-10-21 11:42:08 +02:00
Pavan Nikhilesh
1bdfe4d76e eventdev: increase xstats ID width to 64 bits
Increase xstats ID width from 32 to 64 bits. This also
fixes the xstats ID datatype discrepancy between reset and
rest of the xstats family.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-10-21 11:42:08 +02:00
Pavan Nikhilesh
922e71b52d doc: fix eventdev guide and release notes
Fixed release notes for changes made in eventdev library.
Also updated the eventdev guide had got the type of the
rte_event_vector struct's u64s union field wrong.

Fixes: 5fa63911e4 ("eventdev: replace padding type in event vector")
Fixes: 0fbb55efa5 ("eventdev: add element offset to event vector")
Fixes: d986276f9b ("eventdev: add prefix to public symbol")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-10-21 11:42:05 +02:00
Mattias Rönnblom
ed88c5a5e4 eventdev/timer: support appropriately report idle
Update the Event Timer Adapter's service function to report as idle
(i.e., return -EAGAIN) in case no timer events were enqueued to the
event device.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2022-10-21 11:34:42 +02:00
Mattias Rönnblom
35d052356b eventdev/eth_tx: support appropriately report idle
Update the Event Ethernet Tx Adapter's service function to report as
idle (i.e., return -EAGAIN) in case no events were dequeued from the
event device and no Ethernet frames were sent out on the wire.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2022-10-21 11:34:41 +02:00
Mattias Rönnblom
7f33abd49b eventdev/eth_rx: support appropriately report idle
Update the Event Ethernet Rx Adapter's service function to report as
idle (i.e., return -EAGAIN) in case no Ethernet frames were received
from the ethdev and no events were enqueued to the event device.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2022-10-21 11:34:41 +02:00
Mattias Rönnblom
34d785571f eventdev/crypto: support appropriately report idle
Update the event crypto adapter's service function to report as idle
(i.e., return -EAGAIN) in case no crypto operations were performed.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2022-10-21 11:34:41 +02:00
Abdullah Sevincer
b828e0dade event/dlb2: fix port COS override calculation
Fix the calculation error of the total number of LDB ports
during port COS override from dlb2 event structure.

Fixes: bec8901bfe ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
2022-10-21 11:34:41 +02:00
Abdullah Sevincer
d5b77fa06e event/dlb2: remove COS from devargs
Since COS is now per port specific only and supported through
port_cos in dev_args, there is no need to have a COS
argument in dev_args.

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
2022-10-21 11:34:41 +02:00
Abdullah Sevincer
c788af960b event/dlb2: validate producer coremask
Add checks during port probing for validating producer
core masks if they are a subset of EAL coremask.
Error is returned if producer coremask is not a subset
of EAL coremask.

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
2022-10-21 11:34:41 +02:00
Abdullah Sevincer
e3191f1078 event/dlb2: remove COS from port probing
Remove COS (class of service) from port probing criteria and
apply enhancements for selection of ports from best
COS when default COS (255) is used.

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
2022-10-21 11:34:41 +02:00
Olivier Matz
011c617ca2 test/pmd_perf: fix test on devices with no socket ID
If the socket ID of a device is unknown, rte_eth_dev_socket_id(portid)
now returns -1 instead of 0 since commit 7dcd73e379 ("drivers/bus: set
device NUMA node to unknown by default").

This change breaks the pmd_perf test on environment where the device
socket ID is unknown. The test fails with the following error, because
it does not find a lcore on socket -1:

> No avail lcore to run test

Take the new behavior in account in the pmd_perf test: in this
environment, the test can now run on any lcore, and not only those from
socket 0 (this was the old behavior).

Bugzilla ID: 1105
Fixes: 7dcd73e379 ("drivers/bus: set device NUMA node to unknown by default")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Lingli Chen <linglix.chen@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-10-24 13:33:49 +02:00
Conor Walsh
269f027453 doc: fix reference to dma application example
When the dpdk-ioat app was renamed to dpdk-dma this example command
was missed, this patch corrects that issue.

Fixes: bb4141dbe5 ("examples/dma: rename ioat application example")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
2022-10-21 15:50:25 +02:00
Stephen Hemminger
eeb6cad431 app/dumpcap: add file-prefix option
When using dumpcap in container environment or with multiple
DPDK processes, it is useful to be able to specify file prefix.

This version only accepts the long format option used by
other commands. If no prefix is specified then the default
is used.

Suggested-by: Arshdeep Kaur <arshdeep.kaur@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Arshdeep Kaur <arshdeep.kaur@intel.com>
2022-10-21 15:13:25 +02:00
Arshdeep Kaur
7f3623a17e app/dumpcap: fix select interface
The change to do argument process before EAL init broke
the support of select-interface option. Fix by setting flag
and doing select-interface later.

Fixes: a8dde09f97 ("app/dumpcap: allow help/version without primary process")
Cc: stable@dpdk.org

Signed-off-by: Arshdeep Kaur <arshdeep.kaur@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-21 14:54:26 +02:00
Stephen Hemminger
117e3b6492 app/dumpcap: fix pathname for output file
When dumpcap is run with a longer path name such as when
testing, the file prefix would be computed incorrectly.

Also, print out the resulting filename which is similar to
what wireshark program does.

Fixes: cbb44143be ("app/dumpcap: add new packet capture application")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-21 14:54:26 +02:00
Stephen Hemminger
1835ea9905 app/dumpcap: fix crash on cleanup
At end of program there is call to rte_free() which is passing
a bogus value. There is no "bpf_filter" defined in this application;
it ends up being a text address inside pcap library.

Fixes: cbb44143be ("app/dumpcap: add new packet capture application")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-21 14:54:26 +02:00
Erik Gabriel Carrillo
329280c53e service: fix early move to inactive status
Assume thread T2 is a service lcore that is in the middle of executing
a service function.  Also, assume thread T1 concurrently calls
rte_service_lcore_stop(), which will set the "service_active_on_lcore"
state to false.  If thread T1 then calls rte_service_may_be_active(),
it can return zero even though T2 is still running the service function.
If T1 then proceeds to free data being used by T2, a crash can ensue.

Move the logic that clears the "service_active_on_lcore" state from the
rte_service_lcore_stop() function to the service_runner_func() to
ensure that we:
- don't let the "service_active_on_lcore" state linger as 1
- don't clear the state early

Fixes: 6550113be6 ("service: fix lingering active status")
Cc: stable@dpdk.org

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2022-10-21 14:54:26 +02:00
Stephen Hemminger
8a0cf0c455 pdump: do not allow enable/disable in primary process
Attempts to enable or disable pdump in primary process
will fail with core dump because it is not valid to call
rte_mp_request_sync() unless in a secondary process.

Trap the error in the common code used for both enable
and disable requests.

Fixes: 660098d61f ("pdump: use generic multi-process channel")
Cc: stable@dpdk.org

Reported-by: Sylvia Grundwürmer <sylvia.grundwuermer@b-plus.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-21 14:54:26 +02:00
David Marchand
eb870201b4 trace: remove limitation on directory
Remove arbitrary limit on 12 characters of the file prefix used for the
directory where to store the traces.
Simplify the code by relying on dynamic allocations.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
477cc313a2 trace: remove limitation on trace point name
The name of a trace point is provided as a constant string via the
RTE_TRACE_POINT_REGISTER macro.
We can rely on an explicit constant string in the binary and simply point
at it.
There is then no need for a (fixed size) copy.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
d4cbbee345 trace: fix metadata dump
The API does not describe that metadata dump is conditioned to enabling
any trace points.

While at it, merge dump unit tests into the generic trace_autotest to
enhance coverage.

Fixes: f6b2d65dcd ("trace: implement debug dump")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
782dbf1791 trace: fix race in debug dump
trace->nb_trace_mem_list access must be under trace->lock to avoid
races with threads allocating/freeing their trace buffers.

Fixes: f6b2d65dcd ("trace: implement debug dump")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
d6fd5a018e trace: fix dynamically enabling trace points
Enabling trace points at runtime was not working if no trace point had
been enabled first at rte_eal_init() time. The reason was that
trace.args reflected the arguments passed to --trace= EAL option.

To fix this:
- the trace subsystem initialisation is updated: trace directory
  creation is deferred to when traces are dumped (to avoid creating
  directories that may not be used),
- per lcore memory allocation still relies on rte_trace_is_enabled() but
  this helper now tracks if any trace point is enabled. The
  documentation is updated accordingly,
- cleanup helpers must always be called in rte_eal_cleanup() since some
  trace points might have been enabled and disabled in the lifetime of
  the DPDK application,

With this fix, we can update the unit test and check that a trace point
callback is invoked when expected.

Note:
- the 'trace' global variable might be shadowed with the argument
  passed to the functions dealing with trace point handles.
  'tp' has been used for referring to trace_point object.
  Prefer 't' for referring to handles,

Fixes: 84c4fae462 ("trace: implement operation APIs")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
3ee927d3e4 trace: rework loop on trace points
Directly skip the block when a trace point does not match the user
criteria.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
b980ced067 trace: fix leak with regexp
The precompiled buffer initialised in regcomp must be freed before
leaving rte_trace_regexp.

Fixes: 84c4fae462 ("trace: implement operation APIs")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
1559663872 trace: fix mode change
The API does not state that changing mode should be refused if no trace
point is enabled. Remove this limitation.

Fixes: 84c4fae462 ("trace: implement operation APIs")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
David Marchand
12b627bf77 trace: fix mode for new trace point
If an application registers trace points later than rte_eal_init(),
changes in the trace point mode were not applied.

Fixes: 84c4fae462 ("trace: implement operation APIs")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
2022-10-20 13:34:19 +02:00
Zhangfei Gao
3f27defe0c bus/vdev: fix crash in device cleanup
vdev_probe calls driver->probe and set dev->device.driver,
which will be NULL if the probe fails.

In vdev_cleanup, drv = container_of(dev->device.driver)
drv will be !NULL in this case, causing drv->remove
Segmentation fault.

Fixed by checking dev->device.driver before.

Log:
$ sudo dpdk-test --vdev=crypto_uadk --log-level=6
vdev_probe(): failed to initialize crypto_uadk device
EAL: Bus (vdev) probe failed.
RTE>>quit
Segmentation fault

Fixes: 1cab1a40ea ("bus: cleanup devices on shutdown")

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-10-20 11:35:07 +02:00
Kevin Laatz
d5c398741d bus/pci: fix memory leak in device cleanup
During PCI bus device cleanup some interrupt handle pointers and the
bus_info pointer are not being free'd, leading to memory leaks.
This patch fixes the memory leaks by ensuring they are free'd during
device cleanup on exit.

Fixes: 1cab1a40ea ("bus: cleanup devices on shutdown")

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-10-20 11:34:55 +02:00
Thomas Monjalon
a74b1b2513 version: 22.11-rc1
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2022-10-11 02:39:28 +02:00
Ray Kinsella
168a07eb97 maintainers: update for ABI management
Developer tools associated with ABI are maintained with as part of
developer tooling, EAL ABI headers are maintained with EAL,
ABI build scripts are maintained with the build system
and ABI policy and version documents along with rest of the documentation.

Major change is that individual components maintainers become
responsible for ensuring correctness of their map file(s).

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
2022-10-11 02:30:06 +02:00
Henning Schild
431a60f781 devtools: guess checkpatch.pl path
Try and find the script in the sources of the currently running kernel
so that users do not have to specify DPDK_CHECKPATCH_PATH which might
well be the same location found by the educated guess.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
2022-10-11 02:18:48 +02:00
Peng Zhang
9d4efc5cc6 buildtools: fix NUMA nodes count
The method to fetch, sort and read the last entry of a list to figure
out the total number of NUMA nodes in the system fails with 10 or more
nodes. The reason being the usage of string compare while sorting, hence
node 'node10' will be sorted before 'node2'.

Solve this by sorting the list based on integer comparison of the
numerical part of the node name.

Before this change on a system with 16 NUMA nodes,

    EAL: Detected CPU lcores: 128
    EAL: Detected NUMA nodes: 10
    EAL: Static memory layout is selected, amount of reserved memory can
	 be adjusted with -m or --socket-mem
    EAL: Detected static linkage of DPDK
    EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
    EAL: Selected IOVA mode 'VA'
    EAL: VFIO support initialized

With this change on the same system,

    EAL: Detected CPU lcores: 128
    EAL: Detected NUMA nodes: 16
    EAL: Static memory layout is selected, amount of reserved memory can
	 be adjusted with -m or --socket-mem
    EAL: Detected static linkage of DPDK
    EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
    EAL: Selected IOVA mode 'VA'
    EAL: VFIO support initialized

Fixes: 8ef09fdc50 ("build: add optional NUMA and CPU counts detection")
Cc: stable@dpdk.org

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-10-11 02:13:52 +02:00
Robin Jarry
0ce3cf4afd usertools/pmdinfo: rewrite simpler script
dpdk-pmdinfo.py does not produce any parseable output. The -r/--raw flag
merely prints multiple independent JSON lines which cannot be fed
directly to any JSON parser. Moreover, the script complexity is rather
high for such a simple task: extracting PMD_INFO_STRING from .rodata ELF
sections. Rewrite it so that it can produce valid JSON.

Remove the PCI database parsing for PCI-ID to Vendor-Device names
conversion. This should be done by external scripts (if really needed).

The script passes flake8, black, isort and pylint checks.

I have tested this with a matrix of python/pyelftools versions:

                                 pyelftools
               0.22  0.23  0.24  0.25  0.26  0.27  0.28  0.29
        3.6      ok    ok    ok    ok    ok    ok    ok    ok
        3.7      ok    ok    ok    ok    ok    ok    ok    ok
 Python 3.8      ok    ok    ok    ok    ok    ok    ok    ok
        3.9      ok    ok    ok    ok    ok   *ok    ok    ok
        3.10   fail  fail  fail  fail    ok    ok    ok    ok

                                     * Also tested on FreeBSD

All failures with python 3.10 are related to the same issue:

  File "elftools/construct/lib/container.py", line 5, in <module>
    from collections import MutableMapping
  ImportError: cannot import name 'MutableMapping' from 'collections'

Python 3.10 support is only available since pyelftools 0.26. The script
will only work with Python 3.6 and later.

Update the minimal system requirements, docs and release notes.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2022-10-11 02:11:33 +02:00
Nithin Dabilpuram
3f04555589 examples/l3fwd: fix MTU configuration with event mode
MTU configuration is missing for ethdev when using eventmode
when user provides it via "--max-pkt-len" config. It is only
done in poll mode setup. Fix the event mode setup code to
do the same.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-10-11 01:34:07 +02:00
Sean Morrissey
8bcfa9cba3 examples/l3fwd: fix crash after packet match
This patch fixes a core dump which occurs on 32-bit-builds
after sending a matched packet due to overrunning an array.

Fixes: 6de0ea50e9 ("examples/l3fwd: merge l3fwd-acl example")
Cc: stable@dpdk.org

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Tested-by: Lingli Chen <linglix.chen@intel.com>
2022-10-11 01:34:07 +02:00
Nicolas Chautru
a53a025b45 bbdev: fix build with clang 3.4.2
Casting explicitly from enum to uint8_t to avoid compilation
warning with clang 3.4.2:

  rte_bbdev.c:1179:13: error:
  comparison of constant 4 with expression
  of type 'enum rte_bbdev_enqueue_status' is always true
  [-Werror,-Wtautological-constant-out-of-range-compare]

Bugzilla ID: 1095
Fixes: 1be86f2e94 ("bbdev: add device status info")
Fixes: 4f08028c5e ("bbdev: expose queue related warning and status")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
2022-10-11 01:34:07 +02:00
Thomas Monjalon
df1982df8b net/mana: fix dependencies
The reason for not building is updated
to be consistent with other drivers.

The libibverbs was not detected through pkg-config.
The method dependency() needs to be used first.

The support in rdma-core and Linux is not released yet,
so the documentation is updated.

Fixes: 517ed6e2d5 ("net/mana: add basic driver with build environment")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2022-10-11 01:34:07 +02:00
Ruifeng Wang
98402eb989 config/arm: add Graviton3
Add meson build configuration for Graviton3 platform
with 64-bit ARM Neoverse V1 cores.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2022-10-10 21:59:20 +02:00
David Marchand
f13604fad1 bus/pci: remove VFIO status log in scan
Linux EAL triggers a scan on all buses, PCI included.
Once done, it configures VFIO.
Checking for VFIO status in the PCI bus scan is pointless.

Signed-off-by: David Marchand <david.marchand@redhat.com>
2022-10-10 17:54:46 +02:00
Shiqi Liu
390c482276 dma/idxd: check DSA device allocation
As the possible failure of the malloc(), the not_checked and
checked could be NULL pointer.
Therefore, it should be better to check it in order to avoid
the dereference of the NULL pointer.

Fixes: b7aaf417f9 ("raw/ioat: add bus driver for device scanning automatically")
Cc: stable@dpdk.org

Signed-off-by: Shiqi Liu <835703180@qq.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2022-10-10 17:53:18 +02:00
Shiqi Liu
d914c01036 node: check Rx element allocation
As the possible failure of the malloc(), the not_checked and
checked could be NULL pointer.
Therefore, it should be better to check it in order to avoid
the dereference of the NULL pointer.

Fixes: fa8054c8c8 ("examples/eventdev: add thread safe Tx worker pipeline")
Cc: stable@dpdk.org

Signed-off-by: Shiqi Liu <835703180@qq.com>
2022-10-10 17:53:12 +02:00
Zhirun Yan
afe67d1414 graph: fix node objects allocation
For __rte_node_enqueue_prologue(), if the number of objs is more than
the node->size * 2, the extra objs will write out of bounds memory.
It should use __rte_node_stream_alloc_size() to request enough memory.

And for rte_node_next_stream_put(), it will re-allocate a small size,
when the node free space is small and new objs is less than the current
node->size. Some objs pointers behind new size may be lost. And it will
cause memory leak. It should request enough size of memory, containing
the original objs and new objs at least.

Fixes: 40d4f51403 ("graph: implement fastpath routines")
Cc: stable@dpdk.org

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-10-10 17:30:39 +02:00