[RFC PATCH v15] mempool: fix mempool cache size

2024-10-02 Thread Morten Brørup
This patch refactors the mempool cache to fix two bugs: 1. When a mempool is created with a per-lcore cache size of N objects, the per-lcore caches were actually created with a size of 1.5 * N objects. 2. The mempool cache field names did not reflect their purpose; the "flushthresh" field held the

RE: [PATCH v2 1/3] net: add thread-safe crc api

2024-10-02 Thread Kusztal, ArkadiuszX
> -Original Message- > From: Stephen Hemminger > Sent: Tuesday, October 1, 2024 11:44 PM > To: Kusztal, ArkadiuszX > Cc: dev@dpdk.org; ferruh.yi...@amd.com; Ji, Kai ; Dooley, > Brian > Subject: Re: [PATCH v2 1/3] net: add thread-safe crc api > > On Tue, 1 Oct 2024 19:11:48 +0100 > A

RE: [PATCH] maintainers: update ena maintainers list

2024-10-02 Thread Raisman, Yosef
> -Original Message- > From: shaib...@amazon.com > Sent: Wednesday, October 2, 2024 11:22 AM > To: tho...@monjalon.net > Cc: dev@dpdk.org; Brandes, Shai > Subject: [PATCH] maintainers: update ena maintainers list > > From: Shai Brandes > > Added a new ena team member. > > Signed-off-b

RE: [PATCH v2 1/3] net: add thread-safe crc api

2024-10-02 Thread Kusztal, ArkadiuszX
> -Original Message- > From: David Marchand > Sent: Wednesday, October 2, 2024 9:42 AM > To: Kusztal, ArkadiuszX > Cc: dev@dpdk.org; ferruh.yi...@amd.com; Ji, Kai ; Dooley, > Brian > Subject: Re: [PATCH v2 1/3] net: add thread-safe crc api > > On Tue, Oct 1, 2024 at 9:27 PM Arkadiusz

Re: [PATCH v5 17/17] eal: add function attributes for allocation functions

2024-10-02 Thread David Marchand
On Tue, Oct 1, 2024 at 6:39 PM Stephen Hemminger wrote: > diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h > index eec0400dad..595cadd5b8 100644 > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -228,6 +228,40 @@ typedef uint16_t unaligned_uint1

Re: [PATCH v4 0/2] bbdev: dump debug information

2024-10-02 Thread Maxime Coquelin
On 9/27/24 02:31, Nicolas Chautru wrote: v4: updated to remove device error logging part which may use different mechanism in the future, possibly rte trace point. v3: updated based on Maxime comments related to passing string through function prototype. Thanks v2: updated with comments from

Re: [PATCH v3 2/2] timer/linux/x86: override TSC freq if no tsc_known_freq

2024-10-02 Thread Bruce Richardson
On Wed, Oct 02, 2024 at 12:59:58AM +0300, Isaac Boukris wrote: > On Tue, Oct 1, 2024 at 11:01 PM Bruce Richardson > wrote: > > > > On Tue, Oct 01, 2024 at 03:22:51AM +0300, Isaac Boukris wrote: > > > If the tsc_known_freq cpu flag is missing, it means the kernel doesn't > > > trust it and calculat

[PATCH] maintainers: update ena maintainers list

2024-10-02 Thread shaibran
From: Shai Brandes Added a new ena team member. Signed-off-by: Shai Brandes --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 812463fe9f..01b1c2cb7f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -663,6 +663,7 @@ M: Shai Brandes M: Evgeny Sche

[PATCH 5/7] dts: add support for externally compiled DPDK

2024-10-02 Thread Tomáš Ďurovec
Add support for using DPDK source tree directory as well as DPDK tarball with the pre-build directory that can user specify and type of location, it can be stored in the local filesystem or SUT node. Additionally, this can be set up with the config file or cmd arguments/environment variables. Sign

[PATCH 1/7] dts: rename build target to DPDK build

2024-10-02 Thread Tomáš Ďurovec
Since the DPDK may already be built, some more general name is needed that includes both the DPDK location and the build config (if we are going to build). Signed-off-by: Tomáš Ďurovec --- dts/conf.yaml | 2 +- dts/framework/config/__init__.py | 26 ++---

[PATCH 2/7] dts: one dpdk build per test run

2024-10-02 Thread Tomáš Ďurovec
When the DPDK build can be already pre-build, there is not a need for defining multiple build targets. To make it cleaner we decide to use one DPDK build wheater can be pre-build or DTS will build it. Signed-off-by: Tomáš Ďurovec --- dts/conf.yaml | 14 +-- dts/fram

[PATCH 4/7] dts: add the ability to copy directories via remote

2024-10-02 Thread Tomáš Ďurovec
Before, the remote session did't allows to copy directories, only files. This feature will be used in future commit. Signed-off-by: Tomáš Ďurovec --- dts/framework/testbed_model/os_session.py| 120 ++- dts/framework/testbed_model/posix_session.py | 88 +- dts/fra

[PATCH 3/7] dts: fix remote session file transfer vars

2024-10-02 Thread Tomáš Ďurovec
The OSSession (and its subclasses) should accept PurePaths for remote paths to translate from OS-unaware (PurePath) to OS-aware (Path) only on the remote side. For local paths, they should accept Paths, as Python is OS-aware locally. Signed-off-by: Tomáš Ďurovec --- .../remote_session/remote_ses

[PATCH 6/7] doc: update argument options for external DPDK build

2024-10-02 Thread Tomáš Ďurovec
By adding support for external build, we extend the argument documentation for supported options. Signed-off-by: Tomáš Ďurovec --- doc/guides/tools/dts.rst | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/guides/tools/dts.rst b/doc/guides/tools/dts.rst index 65cce

[PATCH 7/7] dts: remove git ref option

2024-10-02 Thread Tomáš Ďurovec
In the previous commits we're adding the support for copying the whole local DPDK tree directory and git-ref option was meant to do the same thing. Signed-off-by: Tomáš Ďurovec --- doc/guides/tools/dts.rst | 9 --- dts/framework/settings.py | 51 +++- dts/framework/utils.py|

Re: [PATCH v4 2/2] timer: allow platform to override cpu TSC frequency

2024-10-02 Thread Bruce Richardson
On Wed, Oct 02, 2024 at 07:56:36PM +0300, Isaac Boukris wrote: > The CPU value is often not accurate, allow overriding it based > on info from the host OS. > > On Linux X86, if the tsc_known_freq cpu flag is missing, it means > the kernel doesn't trust it and calculates its own. We should do > the

Re: [PATCH v4 0/2] Improve TSC frequency accuracy

2024-10-02 Thread Bruce Richardson
On Wed, Oct 02, 2024 at 07:56:34PM +0300, Isaac Boukris wrote: > Changes in V4: > - lower ronding on Windows too > - on freebsd prefer system tsc_hz > > Isaac Boukris (2): > timer: lower rounding of TSC estimation to 100KHz > timer: allow platform to override cpu TSC frequency > > lib/eal/

[PATCH v7 09/16] net/sfc: fix use-after-free warning messages

2024-10-02 Thread Stephen Hemminger
If compiler detection of use-after-free is enabled then this drivers debug messages will cause warnings. Change to move debug message before the object is freed. Bugzilla ID: 1551 Fixes: 55c1238246d5 ("net/sfc: add more debug messages to transfer flows") Signed-off-by: Stephen Hemminger Reviewed-

[PATCH v7 10/16] net/cpfl: fix free of nonheap object

2024-10-02 Thread Stephen Hemminger
With proper annotation, GCC discovers that this driver is calling rte_free() on an object that was not allocated (it is part of array in another object). In function ‘cpfl_flow_js_mr_layout’, inlined from ‘cpfl_flow_js_mr_action’ at ../drivers/net/cpfl/cpfl_flow_parser.c:848:9, inlined fr

[PATCH v7 07/16] bpf: fix free mismatch if convert fails

2024-10-02 Thread Stephen Hemminger
If conversion of cBF to eBPF fails then an object allocated with rte_malloc() would be passed to free(). [908/3201] Compiling C object lib/librte_bpf.a.p/bpf_bpf_convert.c.o ../lib/bpf/bpf_convert.c: In function ‘rte_bpf_convert’: ../lib/bpf/bpf_convert.c:559:17: warning: ‘free’ called on pointer

[PATCH v7 06/16] net/cnxk: fix use-after-free

2024-10-02 Thread Stephen Hemminger
The driver would refer to the mempool object after it was freed. Bugzilla ID: 1554 Fixes: 7ea187184a51 ("common/cnxk: support 1-N pool-aura per NIX LF") Cc: rbhans...@marvell.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/cnxk/cnxk_ethdev_sec.c | 2 +- 1 file changed,

[PATCH v7 08/16] net/e1000: fix use-after-free

2024-10-02 Thread Stephen Hemminger
The driver cleanup code was freeing the filter object then dereferencing it. Bugzilla ID: 1550 Fixes: 6a4d050e2855 ("net/igb: flush all the filter") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/e1000/igb_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v7 11/16] net/nfp: fix duplicate call to rte_free

2024-10-02 Thread Stephen Hemminger
Calling rte_free twice on same object will corrupt the heap. Warning is: In function 'nfp_pre_tun_table_check_del', inlined from 'nfp_flow_destroy' at ../drivers/net/nfp/flower/nfp_flower_flow.c:5143:9: ../drivers/net/nfp/flower/nfp_flower_flow.c:3830:9: error: pointer 'entry' used after 'rte_fre

[PATCH v7 12/16] raw/ifpga/base: fix use after free

2024-10-02 Thread Stephen Hemminger
The TAILQ_FOREACH() macro would refer to info after it had been freed. Fix by introducing TAILQ_FOREACH_SAFE here. Fixes: 4a19f89104f8 ("raw/ifpga/base: support multiple cards") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/raw/ifpga/base/opae_intel_max10.c | 11 +--

[PATCH v7 15/16] baseband/la12xx: prevent use after free

2024-10-02 Thread Stephen Hemminger
It is possible that the info pointer (hp) could get freed twice. Fix by nulling after free. In function 'setup_la12xx_dev', inlined from 'la12xx_bbdev_create' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1029:8, inlined from 'la12xx_bbdev_probe' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1075:

[PATCH v7 16/16] common/idpf: fix use after free due

2024-10-02 Thread Stephen Hemminger
The macro in this driver was redefining LIST_FOR_EACH_ENTRY_SAFE as a simple LIST_FOR_EACH macro. But they are not the same the _SAFE variant guarantees that there will not be use after free. Fixes: fb4ac04e9bfa ("common/idpf: introduce common library") Cc: junfeng@intel.com Signed-off-by: Ste

[PATCH v7 13/16] common/qat: fix use after free

2024-10-02 Thread Stephen Hemminger
Checking return value of rte_memzone_free() is pointless and if it failed then it was because the pointer was null. Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process") Cc: arkadiuszx.kusz...@intel.com Signed-off-by: Stephen Hemminger --- drivers/common/qat/qat_device.c |

[PATCH v7 14/16] drivers/ifpga: fix free function mismatch

2024-10-02 Thread Stephen Hemminger
The raw ifpga driver redefines malloc to be opae_malloc and free to be opae_free; which is a bad idea. This leads to case where interrupt efd array is allocated with calloc() and then passed to rte_free. The workaround is to allocate the array with rte_calloc() instead. Fixes: d61138d4f0e2 ("driv

Re: [PATCH v2] service: extend service function call statistics

2024-10-02 Thread Mattias Rönnblom
On 2024-10-02 20:26, David Marchand wrote: Hello Mattias, On Mon, Sep 9, 2024 at 9:28 PM Mattias Rönnblom wrote: @@ -46,9 +49,21 @@ testsuite_teardown(void) static int32_t dummy_cb(void *args) { RTE_SET_USED(args); - service_tick++; + + service_calls++; + + switc

Re: [PATCH v4 17/17] eal: add function attributes for allocation functions

2024-10-02 Thread Burakov, Anatoly
On 10/1/2024 5:25 PM, Stephen Hemminger wrote: On Tue, 1 Oct 2024 14:25:46 +0200 David Marchand wrote: On Tue, Oct 1, 2024 at 2:21 PM Burakov, Anatoly wrote: + +/** + * Frees the memory space pointed to by the provided pointer. + * + * This pointer must have been returned by a previous call

Re: [PATCH v2 1/3] net: add thread-safe crc api

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 10:42 AM Kusztal, ArkadiuszX wrote: > > Exporting internals but not using them out of the library makes no sense. > > > So there must have been a misunderstanding on my part, the initial idea was > to prevent the user from calling these functions. net_crc.h is an internal

[PATCH] service: reintroduce test dummy service delay

2024-10-02 Thread Mattias Rönnblom
Eliminate unreachable code and have dummy service function perform a short delay again, mimicking previous service core test behavior. Fixes: a37e053b2364 ("service: extend service function call statistics") Signed-off-by: Mattias Rönnblom --- app/test/test_service_cores.c | 12 +--- 1

Re: [PATCH v2] service: extend service function call statistics

2024-10-02 Thread Mattias Rönnblom
On 2024-10-02 21:08, David Marchand wrote: On Wed, Oct 2, 2024 at 8:57 PM Mattias Rönnblom wrote: Coverity flagged this patch with issue #445158. rte_delay_ms() is now unreachable. I suppose this delay is not that important for the unit test and we can remove it, but as I am not sure I'll let

Re: [PATCH] MAINTAINERS: remove Raveendra Padasalagi

2024-10-02 Thread David Marchand
On Sun, Sep 29, 2024 at 8:25 PM Ajit Khaparde wrote: > On Sat, Sep 28, 2024 at 12:18 PM Thomas Monjalon wrote: > > > This email address is bouncing remove from MAINTAINERS. > > > > > > Signed-off-by: Stephen Hemminger > Acked-by: Ajit Khaparde Applied, thanks. -- David Marchand

Re: [PATCH v2 1/3] net: add thread-safe crc api

2024-10-02 Thread David Marchand
On Tue, Oct 1, 2024 at 9:27 PM Arkadiusz Kusztal wrote: > > The current net CRC API is not thread-safe, this patch > solves this by adding another, thread-safe API functions. > This API is also safe to use across multiple processes, > yet with limitations on max-simd-bitwidth, which will be checke

RE: [PATCH v2 1/3] net: add thread-safe crc api

2024-10-02 Thread Kusztal, ArkadiuszX
> -Original Message- > From: David Marchand > Sent: Wednesday, October 2, 2024 11:02 AM > To: Kusztal, ArkadiuszX > Cc: dev@dpdk.org; ferruh.yi...@amd.com; Ji, Kai ; Dooley, > Brian > Subject: Re: [PATCH v2 1/3] net: add thread-safe crc api > > On Wed, Oct 2, 2024 at 10:42 AM Kusztal,

[PATCH v6 01/17] memzone: fix use after free in tracing

2024-10-02 Thread Stephen Hemminger
Using the freed value for tracing is not a good idea. Although it is harmless for tracing, it will cause analyzers to flag this as unsafe. Signed-off-by: Stephen Hemminger Acked-by: Chengwen Feng Acked-by: Anatoly Burakov --- lib/eal/common/eal_common_memzone.c | 3 ++- 1 file changed, 2 inser

[PATCH v6 02/17] cryptodev/bcmfs: fix mis-matched free

2024-10-02 Thread Stephen Hemminger
The device structure is allocated with rte_malloc() and then incorrectly freed with free(). This will lead to corrupt malloc pool. Bugzilla ID: 1552 Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Ajit Khaparde --- dri

[PATCH v6 00/17] Fix allocation related bugs and catch future bugs

2024-10-02 Thread Stephen Hemminger
Recent versions of GCC have some additional function attributes that can help with DPDK performance and stability. The alloc_align attribute tells the compiler what the alignment of the allocation will be, and the optimizer can use this to produce better code (especially memcpy and structure copie

[PATCH v6 05/17] examples/vhost: fix free function mismatch

2024-10-02 Thread Stephen Hemminger
The pointer bdev is allocated with rte_zmalloc() and then incorrectly freed with free() which will lead pool corruption. Bugzilla ID: 1553 Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Chengwen Feng ---

[PATCH v6 07/17] bpf: fix free mismatch if convert fails

2024-10-02 Thread Stephen Hemminger
If conversion of cBF to eBPF fails then an object allocated with rte_malloc() would be passed to free(). [908/3201] Compiling C object lib/librte_bpf.a.p/bpf_bpf_convert.c.o ../lib/bpf/bpf_convert.c: In function ‘rte_bpf_convert’: ../lib/bpf/bpf_convert.c:559:17: warning: ‘free’ called on pointer

[PATCH v6 06/17] net/cnxk: fix use-after-free

2024-10-02 Thread Stephen Hemminger
The driver would refer to the mempool object after it was freed. Bugzilla ID: 1554 Fixes: 7ea187184a51 ("common/cnxk: support 1-N pool-aura per NIX LF") Cc: rbhans...@marvell.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/cnxk/cnxk_ethdev_sec.c | 2 +- 1 file changed,

[PATCH v6 04/17] event/cnxk: fix pointer mismatch in cleanup

2024-10-02 Thread Stephen Hemminger
The code to cleanup in case of error was passing incorrect value to rte_free. The ports[] entry was allocated with rte_malloc and that should be used instead of the offset in that object. Fixes: 97a05c1fe634 ("event/cnxk: add port config") Cc: sthot...@marvell.com Cc: sta...@dpdk.org Signed-off-b

[PATCH v6 09/17] net/sfc: fix use-after-free warning messages

2024-10-02 Thread Stephen Hemminger
If compiler detection of use-after-free is enabled then this drivers debug messages will cause warnings. Change to move debug message before the object is freed. Bugzilla ID: 1551 Fixes: 55c1238246d5 ("net/sfc: add more debug messages to transfer flows") Signed-off-by: Stephen Hemminger Reviewed-

[PATCH v6 08/17] net/e1000: fix use-after-free

2024-10-02 Thread Stephen Hemminger
The driver cleanup code was freeing the filter object then dereferencing it. Bugzilla ID: 1550 Fixes: 6a4d050e2855 ("net/igb: flush all the filter") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/e1000/igb_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v6 03/17] dma/ixd: fix incorrect free function in cleanup

2024-10-02 Thread Stephen Hemminger
The data structure is allocated with rte_malloc and incorrectly freed in cleanup logic using free. Bugzilla ID: 1549 Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe") Cc: kevin.la...@intel.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Reviewed-by: Bruce Richardson

[PATCH v6 10/17] net/cpfl: fix free of nonheap object

2024-10-02 Thread Stephen Hemminger
With proper annotation, GCC discovers that this driver is calling rte_free() on an object that was not allocated (it is part of array in another object). In function ‘cpfl_flow_js_mr_layout’, inlined from ‘cpfl_flow_js_mr_action’ at ../drivers/net/cpfl/cpfl_flow_parser.c:848:9, inlined fr

[PATCH v6 11/17] net/nfp: fix duplicate call to rte_free

2024-10-02 Thread Stephen Hemminger
Calling rte_free twice on same object will corrupt the heap. Warning is: In function 'nfp_pre_tun_table_check_del', inlined from 'nfp_flow_destroy' at ../drivers/net/nfp/flower/nfp_flower_flow.c:5143:9: ../drivers/net/nfp/flower/nfp_flower_flow.c:3830:9: error: pointer 'entry' used after 'rte_fre

[PATCH v6 12/17] raw/ifpga/base: fix use after free

2024-10-02 Thread Stephen Hemminger
The TAILQ_FOREACH() macro would refer to info after it had been freed. Fix by introducing TAILQ_FOREACH_SAFE here. Fixes: 4a19f89104f8 ("raw/ifpga/base: support multiple cards") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/raw/ifpga/base/opae_intel_max10.c | 11 +--

[PATCH] usertools/devbind: add support for non-IOMMU mode

2024-10-02 Thread Stephen Hemminger
From: Fidaullah Noonari This patch adds noiommu option to dpdk-devbind. If the no IOMMU is detected, then if noiommu flag is set the vfio-pci unsafe_noiommu_mode flag is set. Signed-off-by: Fidaullah Noonari Signed-off-by: Stephen Hemminger --- v2 - rebase patch and fix some minor stuff r

Re: [PATCH v2] service: extend service function call statistics

2024-10-02 Thread David Marchand
Hello Mattias, On Mon, Sep 9, 2024 at 9:28 PM Mattias Rönnblom wrote: > @@ -46,9 +49,21 @@ testsuite_teardown(void) > static int32_t dummy_cb(void *args) > { > RTE_SET_USED(args); > - service_tick++; > + > + service_calls++; > + > + switch (rte_rand_max(3)) { > +

Re: [PATCH 1/2] eal/linux: fix VFIO hotplug with multiprocess

2024-10-02 Thread David Marchand
On Tue, Sep 17, 2024 at 10:20 AM Maxime Coquelin wrote: > On 9/16/24 14:30, David Marchand wrote: > > At the moment, if VFIO is not available at DPDK init, it won't be > > available unless a subsequent rte_vfio_enable() is done. > > > > Yet, even if rte_vfio_enable() is called again in primary and

Re: [PATCH v6 17/17] eal: add function attributes for allocation functions

2024-10-02 Thread Ajit Khaparde
On Wed, Oct 2, 2024 at 9:45 AM Wathsala Wathawana Vithanage wrote: > > > > > -Original Message- > > Subject: [PATCH v6 17/17] eal: add function attributes for allocation > > functions > > > > The allocation functions take a alignment argument that can be useful to > > hint > > the compil

[PATCH v7 03/16] dma/ixd: fix incorrect free function in cleanup

2024-10-02 Thread Stephen Hemminger
The data structure is allocated with rte_malloc and incorrectly freed in cleanup logic using free. Bugzilla ID: 1549 Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe") Cc: kevin.la...@intel.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Reviewed-by: Bruce Richardson

[PATCH v7 00/16] Fix allocation bugs and prevent future ones

2024-10-02 Thread Stephen Hemminger
Recent versions of GCC have some additional function attributes that can help with DPDK performance and stability. The alloc_align attribute tells the compiler what the alignment of the allocation will be, and the optimizer can use this to produce better code (especially memcpy and structure copie

[PATCH v7 05/16] examples/vhost: fix free function mismatch

2024-10-02 Thread Stephen Hemminger
The pointer bdev is allocated with rte_zmalloc() and then incorrectly freed with free() which will lead pool corruption. Bugzilla ID: 1553 Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Chengwen Feng ---

[PATCH v7 04/16] event/cnxk: fix pointer mismatch in cleanup

2024-10-02 Thread Stephen Hemminger
The code to cleanup in case of error was passing incorrect value to rte_free. The ports[] entry was allocated with rte_malloc and that should be used instead of the offset in that object. Fixes: 97a05c1fe634 ("event/cnxk: add port config") Cc: sthot...@marvell.com Cc: sta...@dpdk.org Signed-off-b

[PATCH v7 01/16] memzone: fix use after free in tracing

2024-10-02 Thread Stephen Hemminger
Using the freed value for tracing is not a good idea. Although it is harmless for tracing, it will cause analyzers to flag this as unsafe. Signed-off-by: Stephen Hemminger Acked-by: Chengwen Feng Acked-by: Anatoly Burakov --- lib/eal/common/eal_common_memzone.c | 3 ++- 1 file changed, 2 inser

[PATCH v7 02/16] cryptodev/bcmfs: fix mis-matched free

2024-10-02 Thread Stephen Hemminger
The device structure is allocated with rte_malloc() and then incorrectly freed with free(). This will lead to corrupt malloc pool. Bugzilla ID: 1552 Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Ajit Khaparde --- dri

Re: [PATCH v2] service: extend service function call statistics

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 8:57 PM Mattias Rönnblom wrote: > > Coverity flagged this patch with issue #445158. > > rte_delay_ms() is now unreachable. > > > > I suppose this delay is not that important for the unit test and we > > can remove it, but as I am not sure I'll let you have a look and send >

Re: [PATCH v4 2/2] timer: allow platform to override cpu TSC frequency

2024-10-02 Thread Isaac Boukris
On Wed, Oct 2, 2024 at 8:11 PM Bruce Richardson wrote: > > On Wed, Oct 02, 2024 at 07:56:36PM +0300, Isaac Boukris wrote: > > The CPU value is often not accurate, allow overriding it based > > on info from the host OS. > > > > On Linux X86, if the tsc_known_freq cpu flag is missing, it means > > t

Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 6:27 PM Bruce Richardson wrote: > > On Wed, Oct 02, 2024 at 05:57:08PM +0200, David Marchand wrote: > > While invoking telemetry commands (which may happen at any time, > > out of control of the application), an application thread may > > concurrently add/remove ports. > > T

Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread Robin Jarry
David Marchand, Oct 02, 2024 at 21:06: On Wed, Oct 2, 2024 at 6:27 PM Bruce Richardson wrote: On Wed, Oct 02, 2024 at 05:57:08PM +0200, David Marchand wrote: > While invoking telemetry commands (which may happen at any time, > out of control of the application), an application thread may > con

Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 9:09 PM Robin Jarry wrote: > >> An alternative to this macro-fu, is to just define a single ethdev > >> telemetry function, and within that, take the lock and then dispatch to the > >> appropriate subfunction based upon the actual command coming in. The > >> dispatch may be

Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread Robin Jarry
David Marchand, Oct 02, 2024 at 21:18: On Wed, Oct 2, 2024 at 9:09 PM Robin Jarry wrote: I was going to suggest adding a rte_spinlock_t* parameter to a new telemetry register function that would need to be held while the callback is invoked. Or if we want to keep doors open to other kinds of lo

[PATCH 0/2] Fix race in ethdev telemetry

2024-10-02 Thread David Marchand
Following a discussion we had during the summit, here is one series to fix a race between an application thread and the telemetry thread handling requests on ethdev ports. The problem may be generic to other device classes providing telemetry callbacks, but for now, this series goes with a simple a

Re: [PATCH v4] eal: add build-time option to omit trace

2024-10-02 Thread Jerin Jacob
On Tue, Oct 1, 2024 at 9:45 PM Morten Brørup wrote: > > > From: Jerin Jacob [mailto:jerinjac...@gmail.com] > > Sent: Tuesday, 1 October 2024 18.06 > > > > On Tue, Oct 1, 2024 at 9:32 PM Morten Brørup > > wrote: > > > > > > > From: Jerin Jacob [mailto:jerinjac...@gmail.com] > > > > Sent: Tuesday,

Re: [PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread Bruce Richardson
On Wed, Oct 02, 2024 at 05:57:08PM +0200, David Marchand wrote: > While invoking telemetry commands (which may happen at any time, > out of control of the application), an application thread may > concurrently add/remove ports. > The telemetry callbacks may then access partially > initialised/unini

RE: [PATCH v6 17/17] eal: add function attributes for allocation functions

2024-10-02 Thread Wathsala Wathawana Vithanage
> -Original Message- > Subject: [PATCH v6 17/17] eal: add function attributes for allocation > functions > > The allocation functions take a alignment argument that can be useful to hint > the compiler optimizer. This is supported by GCC and Clang but only useful > with > GCC because

Re: [PATCH] config/riscv: name the cross file properly

2024-10-02 Thread Stephen Hemminger
On Tue, 21 Jun 2022 14:29:23 +0200 Stanislaw Kardach wrote: > Since the riscv64_linux_gcc was in fact a Ubuntu-specific cross-file, > rename it. > > Signed-off-by: Stanislaw Kardach > --- Patch is out dated, and needs to be rebased. Best to avoid OS variant specific cross files.

[PATCH v4 2/2] timer: allow platform to override cpu TSC frequency

2024-10-02 Thread Isaac Boukris
The CPU value is often not accurate, allow overriding it based on info from the host OS. On Linux X86, if the tsc_known_freq cpu flag is missing, it means the kernel doesn't trust it and calculates its own. We should do the same to avoid drift. On freebsd we have access to the kernel tsc_hz value

[PATCH v4 1/2] timer: lower rounding of TSC estimation to 100KHz

2024-10-02 Thread Isaac Boukris
In practice, the frequency is often not a nice round number, while the estimation results are rather accurate, just a couple of KHz away from the kernel's tsc_khz value, so it should suffice. Rounding to 10MHz can cause a significant drift from real time, up to a second per 10 minutes. See also b

[PATCH v4 0/2] Improve TSC frequency accuracy

2024-10-02 Thread Isaac Boukris
Changes in V4: - lower ronding on Windows too - on freebsd prefer system tsc_hz Isaac Boukris (2): timer: lower rounding of TSC estimation to 100KHz timer: allow platform to override cpu TSC frequency lib/eal/common/eal_common_timer.c | 3 +- lib/eal/common/eal_private.h | 2 +- lib

[RFC PATCH v16] mempool: fix mempool cache size

2024-10-02 Thread Morten Brørup
This patch refactors the mempool cache to fix two bugs: 1. When a mempool is created with a per-lcore cache size of N objects, the per-lcore caches were actually created with a size of 1.5 * N objects. 2. The mempool cache field names did not reflect their purpose; the "flushthresh" field held the

[PATCH] vhost: restrict set max queue pair API to VDUSE

2024-10-02 Thread Maxime Coquelin
In order to avoid breaking Vhost-user live-migration, we want the rte_vhost_driver_set_max_queue_num API to only be effective with VDUSE. Furthermore, this API is only really needed for VDUSE where the device number of queues is defined by the backend. For Vhost-user, this is defined by the fronte

[RFC PATCH v17] mempool: fix mempool cache size

2024-10-02 Thread Morten Brørup
This patch refactors the mempool cache to fix two bugs: 1. When a mempool is created with a per-lcore cache size of N objects, the per-lcore caches were actually created with a size of 1.5 * N objects. 2. The mempool cache field names did not reflect their purpose; the "flushthresh" field held the

Re: [PATCH] service: avoid worker lcore exit deadlock

2024-10-02 Thread Tyler Retzlaff
On Tue, Oct 01, 2024 at 06:26:03PM +0200, Mattias Rönnblom wrote: > Calling rte_exit() from a worker lcore thread causes a deadlock in > rte_service_finalize(). > > This patch makes rte_service_finalize() deadlock-free by avoiding the > need to synchronize with service lcore threads, which in turn

[PATCH v6 17/17] eal: add function attributes for allocation functions

2024-10-02 Thread Stephen Hemminger
The allocation functions take a alignment argument that can be useful to hint the compiler optimizer. This is supported by GCC and Clang but only useful with GCC because Clang gives warning if alignment is 0. Newer versions of GCC have a malloc attribute that can be used to find mismatches between

[PATCH v6 16/17] common/idpf: fix use after free due

2024-10-02 Thread Stephen Hemminger
The macro in this driver was redefining LIST_FOR_EACH_ENTRY_SAFE as a simple LIST_FOR_EACH macro. But they are not the same the _SAFE variant guarantees that there will not be use after free. Fixes: fb4ac04e9bfa ("common/idpf: introduce common library") Cc: junfeng@intel.com Signed-off-by: Ste

[PATCH v6 14/17] drivers/ifpga: fix free function mismatch

2024-10-02 Thread Stephen Hemminger
The raw ifpga driver redefines malloc to be opae_malloc and free to be opae_free; which is a bad idea. This leads to case where interrupt efd array is allocated with calloc() and then passed to rte_free. The workaround is to allocate the array with rte_calloc() instead. Fixes: d61138d4f0e2 ("driv

[PATCH v6 15/17] baseband/la12xx: prevent use after free

2024-10-02 Thread Stephen Hemminger
It is possible that the info pointer (hp) could get freed twice. Fix by nulling after free. In function 'setup_la12xx_dev', inlined from 'la12xx_bbdev_create' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1029:8, inlined from 'la12xx_bbdev_probe' at ../drivers/baseband/la12xx/bbdev_la12xx.c:1075:

[PATCH v6 13/17] common/qat: fix use after free

2024-10-02 Thread Stephen Hemminger
Checking return value of rte_memzone_free() is pointless and if it failed then it was because the pointer was null. Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process") Cc: arkadiuszx.kusz...@intel.com Signed-off-by: Stephen Hemminger --- drivers/common/qat/qat_device.c |

[PATCH 1/2] ethdev: expose telemetry dump command for Windows

2024-10-02 Thread David Marchand
A next commit will protect all telemetry commands. Prefer exposing all commands regardless of OS, and return an error when invoked on Windows. Signed-off-by: David Marchand --- lib/ethdev/rte_ethdev_telemetry.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib

[PATCH 2/2] ethdev: fix race on ports for telemetry commands

2024-10-02 Thread David Marchand
While invoking telemetry commands (which may happen at any time, out of control of the application), an application thread may concurrently add/remove ports. The telemetry callbacks may then access partially initialised/uninitialised ethdev data. Reuse the ethdev lock that protects port allocation

RE: [PATCH v3 6/6] app/crypto-perf: support EDDSA

2024-10-02 Thread Akhil Goyal
Hi Gowri, Can you fix the CI issues reported. http://mails.dpdk.org/archives/test-report/2024-September/798079.html openssl asym autotest is also failing. http://mails.dpdk.org/archives/test-report/2024-September/798209.html > Subject: [PATCH v3 6/6] app/crypto-perf: support EDDSA > > Added

Re: [PATCH] service: reintroduce test dummy service delay

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 9:40 PM Mattias Rönnblom wrote: > > Eliminate unreachable code and have dummy service function perform a > short delay again, mimicking previous service core test behavior. > Coverity issue: 445158 > Fixes: a37e053b2364 ("service: extend service function call statistics") >

Re: [PATCH] vhost: restrict set max queue pair API to VDUSE

2024-10-02 Thread David Marchand
On Wed, Oct 2, 2024 at 4:42 PM Maxime Coquelin wrote: > > In order to avoid breaking Vhost-user live-migration, we want the > rte_vhost_driver_set_max_queue_num API to only be effective with > VDUSE. > > Furthermore, this API is only really needed for VDUSE where the > device number of queues is d

[PATCH v2] service: fix deadlock on worker lcore exit

2024-10-02 Thread David Marchand
From: Mattias Rönnblom Calling rte_exit() from a worker lcore thread causes a deadlock in rte_service_finalize(). This patch makes rte_service_finalize() deadlock-free by avoiding the need to synchronize with service lcore threads, which in turn is achieved by moving service and per-lcore state

RE: [EXTERNAL] Re: [PATCH v4 0/6] Introduce event pre-scheduling

2024-10-02 Thread Pavan Nikhilesh Bhagavatula
> > From: Pavan Nikhilesh > > > > Event pre-scheduling improves scheduling performance by assigning events > > to event ports in advance when dequeues are issued. > > This series introduces various types and levels of pre-scheduling to the > > eventdev library. > > Any numbers on how much this im

RE: [EXTERNAL] [PATCH v7 04/16] event/cnxk: fix pointer mismatch in cleanup

2024-10-02 Thread Pavan Nikhilesh Bhagavatula
> The code to cleanup in case of error was passing incorrect > value to rte_free. The ports[] entry was allocated with > rte_malloc and that should be used instead of the offset > in that object. > > Fixes: 97a05c1fe634 ("event/cnxk: add port config") > Cc: sthot...@marvell.com > Cc: sta...@dpdk.o