[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 3/5] dts: add class for virtual functions

2024-11-14 Thread Luca Vizzarro
+1

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

[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 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.

[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

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. +

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 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")

[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

[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 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

[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:

[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 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 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

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: > 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

[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 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

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.

[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] 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.

[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

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()

[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 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

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 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

[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

[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 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 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 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 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 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 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 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

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 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

[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

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 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 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 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

[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 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

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 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 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 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

[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 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 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 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 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 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 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 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 ---

[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.

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

2024-11-14 Thread Congjie Zhou
add the current time into the name 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. Add current time to redefine a unique name. lib/eal/linux/eal_memalloc.c | 16 ++-- 1

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

2024-11-14 Thread Congjie Zhou
add the current time into the name 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. Add current time to redefine a unique name. lib/eal/linux/eal_memalloc.c | 17 +++-- 1

[v5,2/5] raw/gdtc: add support for queue setup operation

2024-11-14 Thread Yong Zhang
Add queue initialization and release interface. Signed-off-by: Yong Zhang --- drivers/raw/gdtc/gdtc_rawdev.c | 244 + drivers/raw/gdtc/gdtc_rawdev.h | 19 +++ 2 files changed, 263 insertions(+) diff --git a/drivers/raw/gdtc/gdtc_rawdev.c b/drivers/raw/gdtc/gdtc_

[v5,1/5] raw/gdtc: introduce gdtc raw device driver

2024-11-14 Thread Yong Zhang
Introduce rawdev driver support for GDTC which can help to connect two separate hosts with each other. Signed-off-by: Yong Zhang --- .mailmap | 1 + MAINTAINERS| 5 + doc/guides/rawdevs/gdtc.rst| 35 ++ doc/guides/rawdevs/index.rst | 1 +

DPDK Release Status Meeting 2024-11-14

2024-11-14 Thread Mcnamara, John
Release status meeting minutes 2024-11-14 = Agenda: * Release Dates * Subtrees * Roadmaps * LTS * Defects * Opens Participants: * AMD * ARM * Debian/Microsoft * Intel * Marvell * Nvidia * Red Hat Release Dates - The following are the current/up

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 2:15 PM > To: Jerin Jacob ; Kiran Kumar Kokkilagadda > ; Nithin Kumar Dabilpuram > ; yanzhirun_...@163.com > Cc: dev@dpdk.org > Subject: [EXTERNAL] [PATCH v4 2/2] graph: add alignment to the member of > rte_nod

RE: [EXTERNAL] Re: [PATCH] maintainers: update for DMA perf app

2024-11-14 Thread Gowrishankar Muthukrishnan
Hi, > wrote: > > > > Add co-maintainer for DMA perf app. > > > > Signed-off-by: Gowrishankar Muthukrishnan > > Good to have more maintainers. > > Acked-by: Jerin Jacob > > Could this patch be applied ?. Thanks, Gowrishankar > > > > --- > > MAINTAINERS | 1 + > > 1 file changed, 1 insert

[PATCH] net/ice: add check for null-pointer dereference

2024-11-14 Thread Bruce Richardson
Although it should never occur that the teid (scheduler node id) value for a txq is incorrect, put in a check for null following the scheduler node lookup in ice_tm_setup_txq_node. This provides some additional safety and should eliminate a coverity issue too. Coverity issue: 448957 Fixes: 715d449

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 {

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: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

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

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

2024-11-14 Thread kirankumark
From: Kiran Kumar K Add support for rte_node_free API to free the node and its memory, if node is not part of any of the created graphs. Signed-off-by: Kiran Kumar K --- lib/graph/graph.c | 16 lib/graph/graph_private.h | 13 + lib/graph/node.c | 2

Re: rte_fib network order bug

2024-11-14 Thread Robin Jarry
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 way. Also, prefix is an address + prefix length (not the mask), so it is more natural if address is in cpu

[v5,5/5] raw/gdtc: add support for dequeue operation

2024-11-14 Thread Yong Zhang
Add rawdev dequeue operation for gdtc devices. Signed-off-by: Yong Zhang --- drivers/raw/gdtc/gdtc_rawdev.c | 168 - 1 file changed, 147 insertions(+), 21 deletions(-) diff --git a/drivers/raw/gdtc/gdtc_rawdev.c b/drivers/raw/gdtc/gdtc_rawdev.c index f58b034e58..

[PATCH v2 1/2] common/cnxk: fix mailbox timeout issues

2024-11-14 Thread Harman Kalra
Found couple of reasons causing mailbox timeout: * msgs_acked value by interrupt thread was not getting synced to thread polling it. * mbox_data value sent by AF was seen 0 causing neither down nor up msg processing. Fixes: 9bd368ca311a ("common/cnxk: enable PF VF mailbox") Fixes: 61deac72abbf ("c

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

2024-11-14 Thread Harman Kalra
Implementing mailbox debug trace points to trace function calls. Signed-off-by: Harman Kalra --- V2: * Fixed line length exceeding 100 columns drivers/common/cnxk/roc_dev.c | 87 -- drivers/common/cnxk/roc_mbox.c | 34 drivers/common/cnxk/roc_

[v5,3/5] raw/gdtc: add support for standard rawdev operations

2024-11-14 Thread Yong Zhang
Add support for rawdev operations such as dev_start and dev_stop. Signed-off-by: Yong Zhang --- drivers/raw/gdtc/gdtc_rawdev.c | 136 - drivers/raw/gdtc/gdtc_rawdev.h | 10 +++ 2 files changed, 145 insertions(+), 1 deletion(-) diff --git a/drivers/raw/gdtc/gdtc_

Re: [PATCH] raw/gdtc: introduce gdtc raw device driver

2024-11-14 Thread zhang.yong25
Hi Thomas, >> I submitted a patch on October 29 and haven't received response.>> Wondering >> if any modifications are needed? Could you provide an update on the >> review?>> Thanks. Looking forward to hearing from you.>>I cannot apply your >> patches because the format looks wrong.>It looks th

[PATCH] net/cnxk: toggle link status for representors

2024-11-14 Thread Harman Kalra
Representor port link status should be toggled based on representee state i.e. if representee comes up representor link status should be up while when representee goes down representor port should indicate the same. Signed-off-by: Harman Kalra --- drivers/net/cnxk/cnxk_rep_ops.c | 26 +++

[PATCH v4 1/3] graph: avoid global node ID counter

2024-11-14 Thread kirankumark
From: Kiran Kumar K The node id is determined based on a global variable that is incremented every time a node is created. Adding changes to remove the global counter. Make sure that the node list is always ordered by increasing node ids. When creating a new node, pick a free id which is not allo

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

2024-11-14 Thread kirankumark
From: Kiran Kumar K Add support for rte_node_free API to free the node and its memory, if node is not part of any of the created graphs. Signed-off-by: Kiran Kumar K --- lib/graph/graph.c | 16 lib/graph/graph_private.h | 13 + lib/graph/node.c | 2

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

2024-11-14 Thread kirankumark
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") Signed-off-by: Kiran Kumar K --- app/test/test_graph.c

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

2024-11-14 Thread Bruce Richardson
On Wed, Nov 13, 2024 at 04:36:13PM -0800, Stephen Hemminger wrote: > 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/

[PATCH v4 1/2] graph: mcore: optimize graph search

2024-11-14 Thread Huichao Cai
In the function __rte_graph_mcore_dispatch_sched_node_enqueue, use a slower loop to search for the graph, modify the search logic to record the result of the first search, and use this record for subsequent searches to improve search speed. Due to the addition of a "graph" field in the "rte_node"

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

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. Due to the modification of the alignment of some members of the rte_node structure, update file release_24_1

Re: [RFC 0/5] Fix memset usage

2024-11-14 Thread Bruce Richardson
On Wed, Nov 13, 2024 at 10:55:59AM -0800, Stephen Hemminger wrote: > Bruce mentioned recent security scan of DPDK > https://pvs-studio.com/en/blog/posts/cpp/1183/ > > There are some low hanging fruit things that can be easily addressed. > > Stephen Hemminger (5): > crypto/qat: fix memset

[v5,4/5] raw/gdtc: add support for enqueue operation

2024-11-14 Thread Yong Zhang
Add rawdev enqueue operation for gdtc devices. Signed-off-by: Yong Zhang --- drivers/raw/gdtc/gdtc_rawdev.c | 220 + drivers/raw/gdtc/gdtc_rawdev.h | 19 +++ 2 files changed, 239 insertions(+) diff --git a/drivers/raw/gdtc/gdtc_rawdev.c b/drivers/raw/gdtc/gdtc_r

  1   2   >