[PATCH v2] eal/linux: fix fbarray name with multiple secondary processes

2024-11-14 Thread Congjie Zhou
add the tsc into the name. Suggested-by: Stephen Hemminger Signed-off-by: Congjie Zhou --- When multiple secondary processes run in different containers, names identified by PIDs are not unique due to the pid namespace. So Add tsc to redefine a unique name. v1: use monotonic time to redefine

Re: [RFC 09/10] app/test-dma-perf: fix parsing of dma address

2024-11-14 Thread fengchengwen
On 2024/11/14 8:12, Stephen Hemminger wrote: > There was useless loop when looking at the DMA address. > It looks like it was meant to skip whitespace before > calling strtok. > > Good time to replace strtok with strtok_r as well. Incomplete modification for strtok, I suggest the strtok adopt Hai

[PATCH 12/16] crypto/dpaa2_sec: fix bitmask truncation

2024-11-14 Thread Stephen Hemminger
The dqrr_held mask is 64 bit but updates were getting truncated because 1 is of type int (32 bit) and the result shift of int is of type int (32 bit); therefore any value >= 32 would get truncated. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: a77db24643b7 ("crypto/dpaa2_sec: suppor

[PATCH 02/16] net/cpfl: avoid calling log (printf) with null

2024-11-14 Thread Stephen Hemminger
The log message would always refer to str variable which is NULL here. Looks like author intended to print original parameter. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger --- drivers/net/cpfl/cpfl_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH 01/16] common/cnxk: remove duplicate condition

2024-11-14 Thread Stephen Hemminger
The same condition is checked twice in an if statement. Harmless, but redundant. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger --- drivers/common/cnxk/cnxk_security.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dr

[PATCH 11/16] net/hinic: fix flow type bitmask overflow

2024-11-14 Thread Stephen Hemminger
The type mask is 64 bit value, doing a shift of literal 1 (32 bit) will result in int type (32 bit) and cause truncation. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: f4ca3fd54c4d ("net/hinic: create and destroy flow director filter") Cc: cloud.wangxiao...@huawei.com Cc: sta...@dpdk

[PATCH 14/16] event/dpaa: fix bitmask truncation

2024-11-14 Thread Stephen Hemminger
More bitmask truncation from mask computation. Fixes: 0ee17f79ebd0 ("event/dpaa: add enqueue/dequeue") Cc: sunil.k...@nxp.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/event/dpaa/dpaa_eventdev.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

RE: [EXTERNAL] [PATCH 01/16] common/cnxk: remove duplicate condition

2024-11-14 Thread Anoob Joseph
> The same condition is checked twice in an if statement. > Harmless, but redundant. > > Link: > https://urldefense.proofpoint.com/v2/url?u=https-3A__pvs-2Dstudio.com_en_blog_posts_cpp_1183_&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=jPfB8rwwviRSxyLWs2n6B- > WYLn1v9SyTMrT5EQqh2TU&m=tCMuFtN3iZvm6NW4QbOzKC

[PATCH 03/16] raw/cnxk_gpio: fix file descriptor leak

2024-11-14 Thread Stephen Hemminger
The function would leak file if fscanf failed. There is a working version in other file, clone that. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 0e6557b448fa ("raw/cnxk_gpio: add self test") Cc: tduszyn...@marvell.com Signed-off-by: Stephen Hemminger --- drivers/raw/cnxk_gpio/c

[PATCH 16/16] net/dpaa2: fix bitmask truncation

2024-11-14 Thread Stephen Hemminger
The dqrr_held mask is 64 bit but updates were getting truncated because 1 is of type int (32 bit) and the result shift of int is of type int (32 bit); therefore any value >= 32 would get truncated. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 2d3788631862 ("net/dpaa2: support atomi

[PATCH 15/16] net/dpaa: fix bitmask truncation

2024-11-14 Thread Stephen Hemminger
The dqrr_held mask is 64 bit but updates were getting truncated because 1 is of type int (32 bit) and the result shift of int is of type int (32 bit); therefore any value >= 32 would get truncated. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 5e7455931442 ("net/dpaa: support Rx que

[PATCH 13/16] crypto/dpaa_sec: fix bitmask truncation

2024-11-14 Thread Stephen Hemminger
The dqrr_held mask is 64 bit but updates were getting truncated because 1 is of type int (32 bit) and the result shift of int is of type int (32 bit); therefore any value >= 32 would get truncated. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: fe3688ba7950 ("crypto/dpaa_sec: support

[PATCH 09/16] examples/ptpclient: fix self memcmp

2024-11-14 Thread Stephen Hemminger
Calling memcmp on same structure will always be true. Replace with same conditional used elsewhere. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client") Cc: danielx.t.mrzyg...@intel.com Cc: sta...@dpdk.org Signed-off-by: Stephen

[PATCH 10/16] net/octeon_ep: remove duplicate code

2024-11-14 Thread Stephen Hemminger
Both sides of the if in uninit are using same code. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger --- drivers/net/octeon_ep/otx_ep_ethdev.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c

[PATCH 07/16] net/qede: fix missing debug string

2024-11-14 Thread Stephen Hemminger
The array of debug status strings did not match possible enum values. Add the missing element and a static assert to make sure the table has all possible values. For more complete description see. Link: https://pvs-studio.com/en/blog/posts/cpp/1176/ Fixes: ec55c118792b ("net/qede: add infrastruct

[PATCH 08/16] examples/ptpclient: replace rte_memcpy with assignment

2024-11-14 Thread Stephen Hemminger
Don't use rte_memcpy() when not necessary. Structure assignment is as fast and type safe. Signed-off-by: Stephen Hemminger --- examples/ptpclient/ptpclient.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.

[PATCH 06/16] eal: fix out of bounds access in devargs

2024-11-14 Thread Stephen Hemminger
The code for parsing layers in devargs could reference past the end of layers[] array on stack. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: 9a1a9e4a2ddd ("devargs: support path value with global device syntax") Cc: xuemi...@nvidia.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hem

[PATCH 05/16] net/i40e: remove duplicate code

2024-11-14 Thread Stephen Hemminger
There are two branches in the cascading if/else that have same condition and code; remove one. Update the code to follow DPDK style where all statements in if should have brackets if any leg requires them. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger ---

[PATCH 04/16] net/ntnic: remove dead code

2024-11-14 Thread Stephen Hemminger
The loop to update speed would not work because num_port_speeds was always zero so it did nothing. And the array of pls_mbps was only used inside the loop but never set. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Signed-off-by: Stephen Hemminger --- drivers/net/ntnic/ntnic_ethdev.c |

[PATCH 00/16] small bug fixes from PVS studio bug list

2024-11-14 Thread Stephen Hemminger
More bug fixes from PVS studio bug reports. And one other fix to ptpclient. Stephen Hemminger (16): common/cnxk: remove duplicate condition net/cpfl: avoid calling log (printf) with null raw/cnxk_gpio: fix file descriptor leak net/ntnic: remove dead code net/i40e: remove duplicate code

Re: [PATCH v4 06/12] bus/uacce: remove memset before free

2024-11-14 Thread fengchengwen
There is no sensitive information in dev, so Acked-by: Chengwen Feng On 2024/11/15 2:43, Stephen Hemminger wrote: > Doing memset before free maybe removed by compiler, and > is flagged by security scanning tools as potential problem. > In this case the memset is unnecessary. > > Signed-off-by: S

Re: [PATCH v6 00/14] use rte_strerror() for rte_errno

2024-11-14 Thread fengchengwen
Series-acked-by: Chengwen Feng On 2024/11/14 19:39, Dengdui Huang wrote: > Whether strerror() needs to be replaced needs further discussion, > but rte_error should not be used by strerror() because rte_errno > may be an RTE-specific error code. > > This patchset use rte_strerror() instead of st

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Stephen Hemminger
On Fri, 15 Nov 2024 10:26:00 +0800 Zhou congjie wrote: > On Thu, 14 Nov 2024, Stephen Hemminger wrote: > > > Date: Fri, 15 Nov 2024 01:06:27 > > From: Stephen Hemminger > > To: zcjie0802 > > Cc: dev , anatoly.burakov > > Subject: Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

[DPDK/ethdev Bug 1581] net/txgbe: duplicate legs of if statement

2024-11-14 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1581 Bug ID: 1581 Summary: net/txgbe: duplicate legs of if statement Product: DPDK Version: 24.11 Hardware: All OS: All Status: UNCONFIRMED Severity: major P

[DPDK/ethdev Bug 1580] Nthw: array overrun

2024-11-14 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1580 Bug ID: 1580 Summary: Nthw: array overrun Product: DPDK Version: 24.11 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal

[DPDK/meson Bug 1579] [dpdk-24.11-rc2] meson_tests/fasts malloc_autotest test failed on i40e

2024-11-14 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1579 Bug ID: 1579 Summary: [dpdk-24.11-rc2] meson_tests/fasts malloc_autotest test failed on i40e Product: DPDK Version: 24.11 Hardware: All OS: All Status:

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Zhou congjie
On Thu, 14 Nov 2024, Stephen Hemminger wrote: > Date: Fri, 15 Nov 2024 01:06:27 > From: Stephen Hemminger > To: zcjie0802 > Cc: dev , anatoly.burakov > Subject: Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init() > > What about using thread id instead? > > From d1687ffbf865ba0b2d6

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Zhou congjie
On Thu, 14 Nov 2024, Stephen Hemminger wrote: > > In general DPDK uses tsc instead of monotonic time, since it is faster and > platform > independent (ie Windows). > > Why not use use a global counter instead? > I have tried tsc, but it only works on x86 and does not function on other archi

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Zhou congjie
On Thu, 14 Nov 2024, Stephen Hemminger wrote: > > In general DPDK uses tsc instead of monotonic time, since it is faster and > platform > independent (ie Windows). > > Why not use use a global counter instead? > I have tried tsc, but it only works on x86 and does not function on other archs.

[PATCH v5 1/1] graph: improve node layout

2024-11-14 Thread Huichao Cai
The members "dispatch" and "xstat_off" of the structure "rte_node" can be min cache aligned to make room for future expansion and to make sure have better performance. Add corresponding comments. Signed-off-by: Huichao Cai --- doc/guides/rel_notes/release_24_11.rst | 2 ++ lib/graph/rte_graph_w

Re: [PATCH v9 1/3] dts: add methods for setting mac and multicast addresses

2024-11-14 Thread Patrick Robb
Applied to next-dts with commit message updated, thanks.

Re: [PATCH v9 2/3] dts: add capability check for multicast filtering

2024-11-14 Thread Patrick Robb
Applied to next-dts with commit message updated, thanks.

Re: [PATCH v9 3/3] dts: mac filter test suite refactored for new dts

2024-11-14 Thread Patrick Robb
Applied to next-dts with commit message updated, thanks.

[DPDK/ethdev Bug 1578] Observed Inconsistencies In Device Allow-list Pools.

2024-11-14 Thread bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1578 Bug ID: 1578 Summary: Observed Inconsistencies In Device Allow-list Pools. Product: DPDK Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity:

Re: [PATCH v2 2/2] dts: add blocklist test suite

2024-11-14 Thread Patrick Robb
Applied to next-dts, thanks.

Re: [PATCH v1 0/2] Testpmd flow update/destroy fixes

2024-11-14 Thread Thomas Monjalon
14/11/2024 15:12, Serhii Iliushyk: > >On 11.11.2024, 15:35, "Ferruh Yigit" wrote: > > > > > >On 10/31/2024 3:00 PM, Danylo Vodopianov wrote: > >> These patches provide next fixes: > >> 1. The testpmd command “flow update…“ provides a nullptr as the > >> context variable. > >> 2. Avoid removal of ad

[PATCH v4 07/12] compress/octeontx: remove unnecessary memset

2024-11-14 Thread Stephen Hemminger
Calling memset before rte_free not necessary, and could be removed by the compiler. In this case, the data is not security sensitive so the memset can be removed. Some security scanning tools will flag this. Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- drivers/compress/octeon

Re: [PATCH v4 2/5] dts: parameterize what ports the TG sends packets to

2024-11-14 Thread Luca Vizzarro
Hi there, once again I am in agreement with Juraj, this approach may risk to complicate things further. As he mentioned, we should allow TestSuite to be marked for VFs and they should be able to automate the setup behind the scenes. If we wanted to distinguish VF and PF test cases, I think th

[PATCH v4 08/12] test: remove unneeded memset

2024-11-14 Thread Stephen Hemminger
Since tmp is not used later in the function, this memset is unnecessary. Even though this is harmless, it causes tools that look for security issues around memset to flag this a bug. Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- app/test/test_cmdline_cirbuf.c | 2 -- 1 file ch

Re: [PATCH v2 08/10] app/test-pmd: remove redundant condition

2024-11-14 Thread Ajit Khaparde
On Thu, Nov 14, 2024 at 11:26 AM Stephen Hemminger wrote: > > The loop over policy actions will always exit when it sees > the flow end action, so the next check is redundant. > > Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ > > Fixes: f29fa2c59b85 ("app/testpmd: support policy actions per

[PATCH v2 06/10] app/test: fix operator precedence bug

2024-11-14 Thread Stephen Hemminger
The test loop was much shorter than desired because when MAX_NUM is defined with out paren's the divide operator / takes precedence over shift. But when MAX_NUM is fixed, some tests take too long and have to modified to avoid running over full N^2 space of 1<<20. Note: this is a very old bug, goe

[PATCH v2 01/10] app/test: do not duplicated loop variable

2024-11-14 Thread Stephen Hemminger
Do not use same variable for outer and inner loop in bonding test. Since the loop is just freeing the resulting burst use bulk free. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 92073ef961ee ("bond: unit tests") Cc: declan.dohe...@intel.com Cc: sta...@dpdk.org Signed-off-by: Steph

[PATCH v2 09/10] app/test-pmd: avoid potential outside of array reference

2024-11-14 Thread Stephen Hemminger
The order of comparison is wrong, and potentially allows referencing past the array. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 3e3edab530a1 ("ethdev: add flow quota") Cc: getel...@nvidia.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- app/test-pmd/cmdline_flow.c

[PATCH v2 08/10] app/test-pmd: remove redundant condition

2024-11-14 Thread Stephen Hemminger
The loop over policy actions will always exit when it sees the flow end action, so the next check is redundant. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: f29fa2c59b85 ("app/testpmd: support policy actions per color") Cc: haif...@nvidia.com Signed-off-by: Stephen Hemminger ---

[PATCH v2 10/10] app/test-dma-perf: fix parsing of DMA address

2024-11-14 Thread Stephen Hemminger
There was useless loop when looking at the DMA address. It looks like it was meant to skip whitespace before calling strtok. Good time to replace strtok with strtok_r as well. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test"

[PATCH v2 07/10] test/eal: fix core check in c flag test

2024-11-14 Thread Stephen Hemminger
The expression for checking which lcore is enabled for 0-7 was wrong (missing case for 6). Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: b0209034f2bb ("test/eal: check number of cores before running subtests") Cc: msant...@redhat.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemmi

[PATCH v2 05/10] app/test: fix TLS zero length record

2024-11-14 Thread Stephen Hemminger
The code was duplicating the same condition three times? Reading the commit message, the intention was: Add unit tests to verify the zero len TLS records. Zero len packets are allowed when content type is app data while zero packet length with other content type (such as handshake) wou

[PATCH v2 04/10] app/test: avoid duplicate initialization

2024-11-14 Thread Stephen Hemminger
The event_dev_config initialization had duplicate assignments to the same element. Change to use structure initialization so that compiler will catch this type of bug. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: f8f9d233ea0e ("test/eventdev: add unit tests") Cc: jerin.ja...@cavium

[PATCH v2 02/10] app/test: fix typo in address compare

2024-11-14 Thread Stephen Hemminger
The first argument of 'memcmp' function was equal to the second argument. Therefore ASSERT would always be true. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 92073ef961ee ("bond: unit tests") Cc: declan.dohe...@intel.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- a

[PATCH v2 03/10] app/test: fix paren typo

2024-11-14 Thread Stephen Hemminger
The parenthesis were in the wrong place so that comparison took precedence over assignment in handling IPv6 extension headers. Break up the loop condition to avoid the problem. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 15ccc647526e ("test/security: test inline reassembly with m

[PATCH v2 00/10] Bug fixes for unit tests

2024-11-14 Thread Stephen Hemminger
Recent blog post from PVS studio referenced lots bugs found by their analyzer against DPDK. This set addresses the ones in the test suite. v2 - fix dma address parsing - add stable where needed Stephen Hemminger (10): app/test: do not duplicated loop variable app/test: fix typo in address

[PATCH v4 05/12] crypto/qat: use secure memset

2024-11-14 Thread Stephen Hemminger
Regular memset maybe removed by compiler if done before a free function. Use new rte_free_sensitive instead. Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- drivers/crypto/qat/qat_asym.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/crypto/qat/q

[PATCH v4 06/12] bus/uacce: remove memset before free

2024-11-14 Thread Stephen Hemminger
Doing memset before free maybe removed by compiler, and is flagged by security scanning tools as potential problem. In this case the memset is unnecessary. Signed-off-by: Stephen Hemminger --- drivers/bus/uacce/uacce.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/bus/uacce/uacce.c

[PATCH v4 01/12] eal: introduce new secure memory fill

2024-11-14 Thread Stephen Hemminger
When memset() is used before a release function such as free, the compiler if allowed to optimize the memset away under the as-if rules. This is normally ok, but in certain cases such as passwords or security keys it is problematic. Introduce a DPDK wrapper which is equivalent to the C++ memset_s

[PATCH v4 12/12] devtools/cocci: add script to find problematic memset

2024-11-14 Thread Stephen Hemminger
Script that converts memset before free into rte_memset_sensitive and memset before rte_free into rte_free_sensitive Signed-off-by: Stephen Hemminger --- devtools/cocci/memset_free.cocci | 20 1 file changed, 20 insertions(+) create mode 100644 devtools/cocci/memset_free.co

[PATCH v4 11/12] net/ntnic: remove unnecessary memset

2024-11-14 Thread Stephen Hemminger
Calling memset before free() has no effect and will be flagged by security parsing tools as a potential bug. None of these data structures have sensitive information. Signed-off-by: Stephen Hemminger --- drivers/net/ntnic/nthw/core/nthw_hif.c| 5 + drivers/net/ntnic/nthw/core

[PATCH v4 10/12] net/ntnic: check result of malloc

2024-11-14 Thread Stephen Hemminger
Need to check the result of malloc() before calling memset. This is only place in this driver that forgot, other code does check. Signed-off-by: Stephen Hemminger --- drivers/net/ntnic/nthw/nthw_rac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ntnic/nthw/n

[PATCH v4 09/12] net/ntnic: remove unnecessary void cast

2024-11-14 Thread Stephen Hemminger
There is no need to cast memset to void. Signed-off-by: Stephen Hemminger --- drivers/net/ntnic/nim/i2c_nim.c | 2 +- drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c| 4 ++-- drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c| 4 ++-- drivers/net/ntnic/nthw/flow_

[PATCH v4 04/12] crypto/qat: fix size calculation for memset

2024-11-14 Thread Stephen Hemminger
The memset was always doing 0 bytes since size computed later. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 3a80d7fb2ecd ("crypto/qat: support SHA3 plain hash") Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- drivers/crypto/qat/qat_sym_sessio

[PATCH v4 03/12] crypto/qat: force zero of keys

2024-11-14 Thread Stephen Hemminger
Just doing memset() on keys is not enough, compiler can optimize it away. Need something with a barrier. Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson --- drivers/crypto/qat/qat_sym_session.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dri

[PATCH v4 02/12] eal: add new secure free function

2024-11-14 Thread Stephen Hemminger
Although internally rte_free does poison the buffer in most cases, it is useful to have function that explicitly does this to avoid any security issues. Signed-off-by: Stephen Hemminger --- lib/eal/common/rte_malloc.c | 30 -- lib/eal/include/rte_malloc.h | 18 ++

[PATCH v4 00/12] memset security fixes

2024-11-14 Thread Stephen Hemminger
This series handles memset related bugs indentified by PVS Studio. The root cause is that Gcc and other compilers are free to optimize away memset called before free. Most of the places memset was being used like this were bogus; probably some developer debug habit, and can be safely removed. v4

Re: [PATCH v4 3/3] test/graph: fix graph autotest second run test failure

2024-11-14 Thread Stephen Hemminger
On Thu, 14 Nov 2024 14:38:06 +0530 wrote: > From: Kiran Kumar K > > The graph autotest second run test is failing due to the > node name is already present in the node list. Adding changes > to free nodes at the time of test cleanup. > > Fixes: 6b89650418fe ("test/graph: add functional tests")

Re: [PATCH v4 5/5] dts: add functions for managing VFs to Node

2024-11-14 Thread Luca Vizzarro
On 23/09/2024 19:42, jspew...@iol.unh.edu wrote: + +def get_vfs_on_port(self, pf_port: Port) -> list[VirtualFunction]: +"""Get all virtual functions (VFs) that DTS is aware of on `pf_port`. + +Args: +pf_port: The port to search for the VFs on. + +Returns: +

Re: [PATCH v4 4/5] dts: add OS abstractions for creating virtual functions

2024-11-14 Thread Luca Vizzarro
Usual problem with the commit subject. On 23/09/2024 19:42, jspew...@iol.unh.edu wrote: +def set_num_virtual_functions(self, num: int, pf_port: Port) -> bool: I'd call this set_num_of_virtual_functions, set_virtual_functions_num, or set_number_of_vfs. I think I prefer the last one. +

[PATCH v2 2/2] net/e1000: fix incorrect fallthrough in switch

2024-11-14 Thread Stephen Hemminger
There is an incorrect fallthrough identified by PVS studio. Even though this is in base code it should be fixed, and the warning should be re-enabled to prevent future bugs. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: f2553cb9eba6 ("net/e1000/base: add new I219 devices") Cc: qimin

[PATCH v2 1/2] common/dpaax: do not disable fallthrough warnings

2024-11-14 Thread Stephen Hemminger
Fallthrough warnings catch real bugs and should not be disabled. There are warnings in this driver in current build. The commit that added the disable is old, and the problematic code appears to have been already removed. Fixes: 2ab9a9483196 ("crypto/dpaa2_sec: fix build with GCC 7") Cc: tho...@m

[PATCH v2 0/2] re-enable implicit fallthrough checks

2024-11-14 Thread Stephen Hemminger
Fix bug detected from bad fallthroug in E1000 code. And re-enable compiler flag in both e1000 and dpaax v2 - minor comment fix Stephen Hemminger (2): common/dpaax: do not disable fallthrough warnings net/e1000: fix incorrect fallthrough in switch drivers/common/dpaax/caamflib/rta/operation_

Re: [PATCH v4 3/5] dts: add class for virtual functions

2024-11-14 Thread Luca Vizzarro
+1

[PATCH] eal: fix lcore variables documentation

2024-11-14 Thread Thomas Monjalon
The lcore variables API is new in DPDK 24.11, that's why the function rte_lcore_var_alloc() was marked experimental. To be clearer, the whole header file (including all macros) is marked experimental. A change decreased the default buffer size from 1 MB to 128 kB, missing to update the documentati

Re: [PATCH v4 2/3] graph: add support for node free API

2024-11-14 Thread Stephen Hemminger
On Thu, 14 Nov 2024 14:38:05 +0530 wrote: > > +uint8_t > +graph_is_node_active_in_graph(struct node *node) For true/false functions bool type is preferred. It prevents cases where function accidentally returns 2.

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Stephen Hemminger
What about using thread id instead? From d1687ffbf865ba0b2d64c35acd602ca43329691e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Nov 2024 08:48:54 -0800 Subject: [PATCH] eal: fix fbarray name with multiple secondary processes When multiple secondary processes run in different con

Re: [PATCH v4 1/5] dts: allow binding only a single port to a different driver

2024-11-14 Thread Luca Vizzarro
Hi there, I agree with Juraj's comments on the typo and running dpdk-devbind once. Also noticed the commit subject is way too long, should be max 50 characters. Is it possible to make this more concise? Best, Luca

Re: [PATCH 2/2] common/cnxk: add mailbox debug trace

2024-11-14 Thread Stephen Hemminger
On Mon, 4 Nov 2024 18:38:00 +0530 Harman Kalra wrote: > Implementing mailbox debug trace points to trace function calls. > > Signed-off-by: Harman Kalra Missing use of RTE_ATOMIC() to flag atomic variables. ---Summary of failed steps--- "ubuntu-22.04-cl

Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init()

2024-11-14 Thread Stephen Hemminger
On Thu, 14 Nov 2024 16:37:10 +0800 Congjie Zhou wrote: > > +static uint64_t > +current_time(void) > +{ > + struct timespec ts; > + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) { > + EAL_LOG(ERR, "Fail to get current time"); > + return -1ULL; > + } > +

Re: [RFC 09/10] app/test-dma-perf: fix parsing of dma address

2024-11-14 Thread Stephen Hemminger
On Thu, 14 Nov 2024 08:00:52 +0100 Morten Brørup wrote: > > + while (*addrs == '\0' && isspace(*addrs)) > > addrs++; > > This is never going to happen. Did you mean ||? Good catch.

bug in cryptodev enqueue/dequeue callbacks?

2024-11-14 Thread Konstantin Ananyev
Hi everyone, Looking at implementation of cryptodev callbacks (it uses DPDK RCU), it seems like there is a bug here: at init time we don't call rte_rcu_qsbr_thread_register(). As I understand without it rte_rcu_qsbr_check() wouldn't work properly for that thread. Probably need to add: static int

RE: rte_fib network order bug

2024-11-14 Thread Morten Brørup
> From: Robin Jarry [mailto:rja...@redhat.com] > Sent: Thursday, 14 November 2024 11.19 > > Hi folks, > > Morten Brørup, Nov 14, 2024 at 08:43: > > Medvedkin, Vladimir: > >> I think control plane API should work with prefix addresses in CPU > >> byte order. At least our RTE_IPV4 macro works this

Re: [PATCH v1 0/2] Testpmd flow update/destroy fixes

2024-11-14 Thread Serhii Iliushyk
>On 11.11.2024, 15:35, "Ferruh Yigit" wrote: > > >On 10/31/2024 3:00 PM, Danylo Vodopianov wrote: >> These patches provide next fixes: >> 1. The testpmd command “flow update…“ provides a nullptr as the >> context variable. >> 2. Avoid removal of additional flows after requested number of flows has

Re: [PATCH v2 2/2] ci: install libvirt

2024-11-14 Thread Aaron Conole
David Marchand writes: > Install libvirt so that vm_power_manager example compilation is tested. > > Signed-off-by: David Marchand > --- LGTM Acked-by: Aaron Conole > .github/workflows/build.yml | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/.github/work

RE: Re:RE: [EXTERNAL] [PATCH v4 2/2] graph: add alignment to the member of rte_node

2024-11-14 Thread Jerin Jacob
> -Original Message- > From: Huichao Cai > Sent: Thursday, November 14, 2024 5:37 PM > To: Jerin Jacob > Cc: Kiran Kumar Kokkilagadda ; Nithin Kumar > Dabilpuram ; yanzhirun_...@163.com; > david.march...@redhat.com; dev@dpdk.org > Subject: Re:RE: [EXTERNAL] [PATCH v4 2/2] graph: add al

Re: [PATCH v3 3/4] dts: add per-test-suite configuration

2024-11-14 Thread Luca Vizzarro
Hi Dean! Thank you for your review! On 13/11/2024 21:44, Dean Marx wrote: I like the idea of mapping the suite to specific test cases, and for the most part the custom configuration option as well. The only thing that I feel should be different is the way the code generation is documented, I th

[PATCH] eventdev: fix possible array underflow/overflow

2024-11-14 Thread Bruce Richardson
If the number of interrupts is zero, then indexing an array by "nb_rx_intr - 1" will cause an out-of-bounds write Fix this by putting in a check that nb_rx_intr > 0 before doing the array write. Coverity issue: 448870 Fixes: 3810ae435783 ("eventdev: add interrupt driven queues to Rx adapter") Cc:

Re: [PATCH v4] dts: add flow rule dataclass to testpmd shell

2024-11-14 Thread Luca Vizzarro
Hi Dean, This looks fine for most of it, but some of Juraj's prior comments still apply. See comments in line. On 10/10/2024 22:06, Dean Marx wrote: +@dataclass I'd make this kw_only=True: @dataclass(kw_only=True) this enforces the construction to include field names for the sake of re

Re:RE: [EXTERNAL] [PATCH v4 2/2] graph: add alignment to the member of rte_node

2024-11-14 Thread Huichao Cai
Hi, Jerin. Like this? diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h index a518af2b2a..f9ff7dd8c9 100644 --- a/lib/graph/rte_graph_worker_common.h +++ b/lib/graph/rte_graph_worker_common.h @@ -104,15 +104,19 @@ struct __rte_cache_aligned rte_node {

[PATCH v6 14/14] test: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- app/test/test_bpf.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c index 90e10d7d2c..2f9412e28c 10

[PATCH v6 13/14] app/dumpcap: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- app/dumpcap/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 3d3c0dbc66..6b122862af 100644 --- a/app

[PATCH v6 05/14] common/mlx5: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/common/mlx5/linux/mlx5_nl.c | 10 +- drivers/common/mlx5/mlx5_common.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers

[PATCH v6 09/14] net/memif: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/memif/rte_eth_memif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c

[PATCH v6 12/14] net/tap: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/tap/rte_eth_tap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 65

[PATCH v6 11/14] net/mlx5: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 22 +++--- drivers/net/mlx5/linux/mlx5_os.c | 16 +++

[PATCH v6 07/14] net/bonding: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/bonding/rte_eth_bond_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bondi

[PATCH v6 08/14] net/failsafe: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/failsafe/failsafe_eal.c | 2 +- drivers/net/failsafe/failsafe_flow.c | 4 ++-- 3 files changed, 4 insertions(+), 4

[PATCH v6 03/14] pdump: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- lib/pdump/rte_pdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c index 679c3dd0b5..55c6eeaa36 100644

[PATCH v6 06/14] net/af_xdp: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af

[PATCH v6 04/14] bus/vdev: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/bus/vdev/vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index ec7abe7cda..299f8c2873 1

[PATCH v6 10/14] net/mlx4: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- drivers/net/mlx4/mlx4.c| 2 +- drivers/net/mlx4/mlx4_ethdev.c | 18 +- drivers/net/mlx4/mlx4_rxq.c| 4 ++-- drivers/net/mlx4/mlx4_txq.c| 1

[PATCH v6 00/14] use rte_strerror() for rte_errno

2024-11-14 Thread Dengdui Huang
Whether strerror() needs to be replaced needs further discussion, but rte_error should not be used by strerror() because rte_errno may be an RTE-specific error code. This patchset use rte_strerror() instead of strerror() for rte_errno. Also, I tried to add it to checkpatch, but rte_errno can be u

[PATCH v6 01/14] eal: fix use rte errno for libc function

2024-11-14 Thread Dengdui Huang
In the libc function, rte_errno is not assigned a value. Therefore, errno should be used instead of it. Fixes: c4b89ecb64ea ("eal: introduce memory management wrappers") Cc: sta...@dpdk.org Signed-off-by: Dengdui Huang --- lib/eal/unix/eal_unix_memory.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v6 02/14] eal: use rte strerror

2024-11-14 Thread Dengdui Huang
The rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang --- lib/eal/linux/eal_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index e63f24d108..95b1d02c9f 1

  1   2   >