[PATCH] net/bonding: check return value when enable/disable promisc mode

2024-12-19 Thread Sunyang Wu
Add validation for the return value of rte_eth_promiscuous_enable and rte_eth_promiscuous_disable. Signed-off-by: Sunyang Wu --- drivers/net/bonding/rte_eth_bond_pmd.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c

Re: [PATCH] net/virtio: check return value when calling pthread_mutex_init

2024-12-19 Thread Stephen Hemminger
On Fri, 20 Dec 2024 09:53:26 +0800 Sunyang Wu wrote: > Add validation for the return value of the pthread_mutex_init. > > Signed-off-by: Sunyang Wu > --- > drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/n

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Stephen Hemminger
On Fri, 20 Dec 2024 02:17:12 + "Wangyunjian(wangyunjian,TongTu)" wrote: > > -Original Message- > > From: Stephen Hemminger [mailto:step...@networkplumber.org] > > Sent: Friday, December 20, 2024 12:16 AM > > To: Wangyunjian(wangyunjian,TongTu) > > Cc: dev@dpdk.org; maxime.coque...@re

[PATCH v2 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Yunjian Wang
The hdr->csum_start does two successive reads from user space to read a variable length data structure. The result overflow if the data structure changes between the two reads. To fix this, we can prevent double fetch issue by copying virtio_hdr to the temporary variable. Fixes: 4dc4e33ffa10 ("ne

[PATCH 1/1] vhost: fix missing gso_size validity check

2024-12-19 Thread Yunjian Wang
The value of tso_segsz cannot be 0, instead check that value of gso_size was set. Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities") Cc: sta...@dpdk.org Signed-off-by: Yunjian Wang --- lib/vhost/virtio_net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/vhost/virtio_net.c b

RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Wangyunjian(wangyunjian,TongTu)
> -Original Message- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Friday, December 20, 2024 12:16 AM > To: Wangyunjian(wangyunjian,TongTu) > Cc: dev@dpdk.org; maxime.coque...@redhat.com; chen...@nvidia.com; > Lilijun (Jerry) ; xiawei (H) ; > wangzengyuan ; sta...@d

[PATCH v6] graph: mcore: optimize graph search

2024-12-19 Thread Huichao Cai
Hi David, does "has_data_member_inserted_between = {offset_of(total_sched_fail), offset_of(xstat_off)}" need to be on the same line?

Re: [PATCH v4] net/zxdh: Provided zxdh basic init

2024-12-19 Thread Junlong Wang
In the latest v4 version I submitted on December 18th, when I opened the -Wanalyzer-out-of-bounds and compiled it on the gcc14.2 environment, '' C compiler for the host machine: cc (gcc 14.2.1 "cc (GCC) 14.2.1 20241104 (Red Hat 14.2.1-6)") Compiler for C supports arguments -Wanalyzer-out-of-b

[PATCH] net/virtio: check return value when calling pthread_mutex_init

2024-12-19 Thread Sunyang Wu
Add validation for the return value of the pthread_mutex_init. Signed-off-by: Sunyang Wu --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_us

Re: [PATCH] net/gve: Allocate qpl pages using malloc if memzone allocation fails

2024-12-19 Thread Stephen Hemminger
On Thu, 19 Dec 2024 12:53:14 -0800 Praveen Kaligineedi wrote: > The TX queue requires IOVA contiguous QPL memory. So, we still need > memzone code for TX queues. > > Regards, > Praveen > > On Wed, Dec 18, 2024 at 7:51 PM Stephen Hemminger > wrote: > > > > On Wed, 18 Dec 2024 15:46:35 -0800 >

[PATCH] pdump: clear statistics when enabled

2024-12-19 Thread Stephen Hemminger
The pdump statistics are used to keep track of the number of packets captured, filtered, etc. These need not be cumalative and instead should be start counting when capture starts. This fixes the issue where multiple invocations of dumpcap would include counts from previous invocations. Bugzilla

[PATCH v2 3/5] net/bnx2x: use RTE_BIT32

2024-12-19 Thread Stephen Hemminger
The expression "0x1 << 31" is actually undefined since 0x1 is an integer not unsigned. Fix the general problem by using the existing RTE_BIT32() macros instead. Shows up as a cryptic warning when building with -Dbsanitize=undefined. ../drivers/net/bnx2x/bnx2x.c:3362:25: error: case label does not

[PATCH v2 4/5] net/qede: fix use after free

2024-12-19 Thread Stephen Hemminger
The loop cleaning up flowdir resources was using SLIST_FOREACH but the inner loop would call rte_free. Found by building with address sanitizer undefined check. Also remove needless initialization, and null check. Fixes: f5765f66f9bb ("net/qede: refactor flow director into generic aRFS") Cc: shah

[PATCH v2 5/5] vhost: use strlcpy instead of strncpy

2024-12-19 Thread Stephen Hemminger
Some tools such as gcc address sanitizer will complain if strncpy is used to completely fill a string since it will not be null terminated. Since the previous code forced as null at end, use strlcpy() to get the same effect. Signed-off-by: Stephen Hemminger --- lib/vhost/socket.c | 3 +-- 1 file

[PATCH v2 2/5] net/bnxt: fix use after free

2024-12-19 Thread Stephen Hemminger
The filter cleanup loop was using STAILQ_FOREACH and rte_free and would dereference the filter after free. Found by build with -Dbsanitize=address,undefined Fixes: e8fe0e067b68 ("net/bnxt: fix allocation of PF info struct") Cc: ajit.khapa...@broadcom.com Cc: sta...@dpdk.org Signed-off-by: Stephe

[PATCH v2 1/5] bus/fslmc: fix use after rte_free

2024-12-19 Thread Stephen Hemminger
The cleanup loop would deference the dpio_dev after freeing. Use TAILQ_FOREACH_SAFE to fix that. Found by building with sanitizer undefined flag. Fixes: e55d0494ab98 ("bus/fslmc: support secondary process") Cc: shreyansh.j...@nxp.com Cc: sta...@dpdk.org Signed-off-by: Stephen Hemminger --- drive

[PATCH v2 0/5] Fixes for build with -Dsanitize=undefined

2024-12-19 Thread Stephen Hemminger
Recent bug report https://bugs.dpdk.org/show_bug.cgi?id=1605 highlighted that no build is done with -Dsanitize=address,undefined. Doing a test build showed some new issues that were not being reported. Note: a couple of these required introducing the equivalent _FOREACH_SAFE variant macros. These

Re: [PATCH v4] net/zxdh: Provided zxdh basic init

2024-12-19 Thread Stephen Hemminger
On Tue, 10 Sep 2024 20:00:20 +0800 Junlong Wang wrote: > provided zxdh initialization of zxdh PMD driver. > include msg channel, np init and etc. > > Signed-off-by: Junlong Wang > --- > V4: Resolve compilation issues > V3: Resolve compilation issues > V2: Resolve compilation issues and modify d

Re: [PATCH] net/gve: Allocate qpl pages using malloc if memzone allocation fails

2024-12-19 Thread Stephen Hemminger
On Thu, 19 Dec 2024 12:53:14 -0800 Praveen Kaligineedi wrote: > The TX queue requires IOVA contiguous QPL memory. So, we still need > memzone code for TX queues. > > Regards, > Praveen > > On Wed, Dec 18, 2024 at 7:51 PM Stephen Hemminger > wrote: > > > > On Wed, 18 Dec 2024 15:46:35 -0800 >

Re: rte_event_eth_tx_adapter_enqueue() short enqueue

2024-12-19 Thread Bruce Richardson
On Thu, Dec 19, 2024 at 04:59:33PM +0100, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richard...@intel.com] > > Sent: Wednesday, 27 November 2024 12.07 > > > > On Wed, Nov 27, 2024 at 11:53:50AM +0100, Mattias Rönnblom wrote: > > > On 2024-11-27 11:38, Bruce Richardson wrote: > >

[PATCH] cryptodev: allow use of global variables from C++

2024-12-19 Thread Mattias Rönnblom
Avoid C++ name mangling of the two global variables being exported from . Suggested-by: David Marchand Signed-off-by: Mattias Rönnblom --- lib/cryptodev/rte_crypto_asym.h | 8 1 file changed, 8 insertions(+) diff --git a/lib/cryptodev/rte_crypto_asym.h b/lib/cryptodev/rte_crypto_asym.

Re: [PATCH v2] cryptodev: fix C++ include

2024-12-19 Thread Mattias Rönnblom
On 2024-12-19 16:37, David Marchand wrote: On Thu, Dec 19, 2024 at 2:31 PM Thomas Monjalon wrote: Some cryptodev functions were not included in an extern "C" block. There are 2 blocks, the second one being fast path inline functions, preceded with an include of the required rte_cryptodev_core

Re: [PATCH v2] cryptodev: fix C++ include

2024-12-19 Thread Mattias Rönnblom
On 2024-12-19 14:30, Thomas Monjalon wrote: Some cryptodev functions were not included in an extern "C" block. There are 2 blocks, the second one being fast path inline functions, preceded with an include of the required rte_cryptodev_core.h file. Fixes: 719834a6849e ("use C linkage where appro

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Stephen Hemminger
On Thu, 19 Dec 2024 14:38:28 +0800 Yunjian Wang wrote: > - hdr = (struct virtio_net_hdr > *)((uintptr_t)buf_vec[0].buf_addr); > + rte_memcpy((void *)(uintptr_t)&tmp_hdr, > + (void *)(uintptr_t)buf_vec[0].buf_addr, > +

[PATCH v2] net/mlx5/hws: fix fragmented ptype match

2024-12-19 Thread Alexander Kozyrev
Fragmented PTYPE matching requires setting the mask to the exact RTE_PTYPE_L4_FRAG value to avoid conflicts with other L4 types. Adding L2 or L3 types to the same mask should be allowed, but there is a check for the exact value for setting the definer. This prevents the fragmented packets from matc

[PATCH] net/mlx5: fix fragmented ptype match

2024-12-19 Thread Alexander Kozyrev
Fragmented PTYPE macthing requires the setting the mask to the exact RTE_PTYPE_L4_FRAG value to avoid conflicts with other L4 types. Adding L2 or L3 types to the same mask should be allowed, but there is a check for the exact value for setting the definer. This prevents the fragmented packets from

RE: rte_event_eth_tx_adapter_enqueue() short enqueue

2024-12-19 Thread Morten Brørup
> From: Bruce Richardson [mailto:bruce.richard...@intel.com] > Sent: Wednesday, 27 November 2024 12.07 > > On Wed, Nov 27, 2024 at 11:53:50AM +0100, Mattias Rönnblom wrote: > > On 2024-11-27 11:38, Bruce Richardson wrote: > > > On Wed, Nov 27, 2024 at 11:03:31AM +0100, Mattias Rönnblom wrote: > >

RE: [RFC 0/8] ioring: network driver

2024-12-19 Thread Morten Brørup
> From: Konstantin Ananyev [mailto:konstantin.anan...@huawei.com] > > > > > This is first draft of new simplified TAP device that uses > > > > the Linux kernel ioring API to provide a read/write ring > > > > with kernel. > > > > > > > > This is split from tap device because there are so many > > >

Re: [PATCH v2] cryptodev: fix C++ include

2024-12-19 Thread David Marchand
On Thu, Dec 19, 2024 at 2:31 PM Thomas Monjalon wrote: > > Some cryptodev functions were not included in an extern "C" block. > > There are 2 blocks, the second one being fast path inline functions, > preceded with an include of the required rte_cryptodev_core.h file. > > Fixes: 719834a6849e ("use

[RFC v2 1/1] eventdev: add atomic queue to test-eventdev app

2024-12-19 Thread Luka Jankovic
From 2e55ecd0e522f50cbb3635f53b025e165db7cf3e Mon Sep 17 00:00:00 2001 In-Reply-To: <228d44a6f2f1f6a4fb5519d9a91c99973f8d7352.ca...@ericsson.com> References: <228d44a6f2f1f6a4fb5519d9a91c99973f8d7352.ca...@ericsson.com> From: Luka Jankovic Date: Thu, 19 Dec 2024 13:31:26 + Subject: [RFC v2 1/1

[PATCH v2] cryptodev: fix C++ include

2024-12-19 Thread Thomas Monjalon
Some cryptodev functions were not included in an extern "C" block. There are 2 blocks, the second one being fast path inline functions, preceded with an include of the required rte_cryptodev_core.h file. Fixes: 719834a6849e ("use C linkage where appropriate in headers") Cc: sta...@dpdk.org Repor

Re: [RFC] eventdev: add atomic queue to test-eventdev app

2024-12-19 Thread Luka Jankovic
On Tue, 2024-12-10 at 11:37 +0100, Mattias Rönnblom wrote: > > > +{ > > + struct rte_event_dev_info dev_info; > > + > > + rte_event_dev_info_get(dev_id, &dev_info); > > + return (dev_info.event_dev_cap & > > RTE_EVENT_DEV_CAP_MAINTENANCE_FREE) ? > > + true :

Re: [EXTERNAL] [PATCH] cryptodev: fix C++ include

2024-12-19 Thread Thomas Monjalon
19/12/2024 13:24, Akhil Goyal: > > Some cryptodev functions were not included in the extern "C" block, > > so it is moved to start before. > > > > An include is also moved to avoid being part of this block. [...] > > --- a/lib/cryptodev/rte_cryptodev.h > > +++ b/lib/cryptodev/rte_cryptodev.h > > @

RE: [EXTERNAL] [PATCH] cryptodev: fix C++ include

2024-12-19 Thread Akhil Goyal
> Some cryptodev functions were not included in the extern "C" block, > so it is moved to start before. > > An include is also moved to avoid being part of this block. > > Fixes: 719834a6849e ("use C linkage where appropriate in headers") > Cc: sta...@dpdk.org > > Reported-by: Zhigang Hu > Sign

Re: The question for the modification against (lib/cryptodev/rte_cryptodev.h) in commit 719834a6

2024-12-19 Thread Thomas Monjalon
19/12/2024 11:41, Hu, Zhigang: > Hi, experts, > > My C++ program calls some functions defined in lib/cryptodev/rte_cryptodev.h. > After upgrading dpdk from 23.11 to 24.11, my C++ program failed to be > complied. It looks like that the cimmit 719834a6 caused my issue. Yes, you're right. Thanks

[PATCH] cryptodev: fix C++ include

2024-12-19 Thread Thomas Monjalon
Some cryptodev functions were not included in the extern "C" block, so it is moved to start before. An include is also moved to avoid being part of this block. Fixes: 719834a6849e ("use C linkage where appropriate in headers") Cc: sta...@dpdk.org Reported-by: Zhigang Hu Signed-off-by: Thomas Mo

The question for the modification against (lib/cryptodev/rte_cryptodev.h) in commit 719834a6

2024-12-19 Thread Hu, Zhigang
Hi, experts, My C++ program calls some functions defined in lib/cryptodev/rte_cryptodev.h. After upgrading dpdk from 23.11 to 24.11, my C++ program failed to be complied. It looks like that the cimmit 719834a6 caused my issue. It seems that the commit 719834a6 intends to exclude all head files

RE: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread Wangyunjian(wangyunjian,TongTu)
> -Original Message- > From: David Marchand [mailto:david.march...@redhat.com] > Sent: Thursday, December 19, 2024 4:24 PM > To: Wangyunjian(wangyunjian,TongTu) ; > maxime.coque...@redhat.com > Cc: dev@dpdk.org; chen...@nvidia.com; Lilijun (Jerry) > ; xiawei (H) ; > wangzengyuan ; sta...@d

Re: [PATCH 1/1] vhost: fix a double fetch when dequeue offloading

2024-12-19 Thread David Marchand
On Thu, Dec 19, 2024 at 7:38 AM Yunjian Wang wrote: > > The hdr->csum_start does two successive reads from user space to read a > variable length data structure. The result overflow if the data structure > changes between the two reads. > > To fix this, we can prevent double fetch issue by copying

[PATCH] power: use hugepage memory for queue list entry structure

2024-12-19 Thread Huisong Li
The queue_list_entry structure data is used in rx_callback of io path when enable PMD Power Management. However its memory is currently from normal heap memory. For better performance, use hugepage memory to replace it. Signed-off-by: Huisong Li --- lib/power/rte_power_pmd_mgmt.c | 10 +-