[PATCH 0/2] add missing local symbols catch-all

2022-03-06 Thread Thomas Monjalon
The libraries (and driver) regexdev, gpudev and auxiliary bus
were missing "local:*" in their version.map linker script
which catch all non-listed functions to be hidden in shared libraries.

Thomas Monjalon (2):
  regexdev: fix section attribute of symbols
  build: hide local symbols in shared libraries

 devtools/libabigail.abignore   | 12 
 drivers/bus/auxiliary/version.map  |  2 ++
 lib/gpudev/version.map |  2 ++
 lib/regexdev/rte_regexdev.h|  4 
 lib/regexdev/rte_regexdev_driver.h |  3 +++
 lib/regexdev/version.map   | 11 +++
 6 files changed, 34 insertions(+)

-- 
2.34.1



[PATCH 1/2] regexdev: fix section attribute of symbols

2022-03-06 Thread Thomas Monjalon
The functions used by the drivers must be internal,
while the function and variables used in inline functions
must be experimental.

These are the changes done in the shared libraries:
- DF .text  Base  rte_regexdev_get_device_by_name
+ DF .text  INTERNAL  rte_regexdev_get_device_by_name
- DF .text  Base  rte_regexdev_register
+ DF .text  INTERNAL  rte_regexdev_register
- DF .text  Base  rte_regexdev_unregister
+ DF .text  INTERNAL  rte_regexdev_unregister
- DF .text  Base  rte_regexdev_is_valid_dev
+ DF .text  EXPERIMENTAL  rte_regexdev_is_valid_dev
- DO .bss   Base  rte_regex_devices
+ DO .bss   EXPERIMENTAL  rte_regex_devices
- DO .bss   Base  rte_regexdev_logtype
+ DO .bss   EXPERIMENTAL  rte_regexdev_logtype

Because these symbols were exported in the default section in DPDK 21.11,
any change in these functions would be seen as incompatible
by the ABI compatibility check.
An exception rule is added for this experimental library,
so the ABI check will skip it until the next ABI version.

Fixes: bab9497ef78b ("regexdev: introduce API")
Cc: sta...@dpdk.org

Signed-off-by: Thomas Monjalon 
---
 devtools/libabigail.abignore   | 4 
 lib/regexdev/rte_regexdev.h| 4 
 lib/regexdev/rte_regexdev_driver.h | 3 +++
 lib/regexdev/version.map   | 9 +
 4 files changed, 20 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 301b3dacb8..cff7a293ae 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -21,6 +21,10 @@
 [suppress_type]
 name = rte_crypto_asym_op
 
+; Ignore section attribute fixes in experimental regexdev library
+[suppress_file]
+soname_regexp = ^librte_regexdev\.
+
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
 soname_regexp = ^librte_common_mlx5\.
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 4ba67b0c25..3bce8090f6 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -225,6 +225,9 @@ extern int rte_regexdev_logtype;
 } while (0)
 
 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
  * Check if dev_id is ready.
  *
  * @param dev_id
@@ -234,6 +237,7 @@ extern int rte_regexdev_logtype;
  *   - 0 if device state is not in ready state.
  *   - 1 if device state is ready state.
  */
+__rte_experimental
 int rte_regexdev_is_valid_dev(uint16_t dev_id);
 
 /**
diff --git a/lib/regexdev/rte_regexdev_driver.h 
b/lib/regexdev/rte_regexdev_driver.h
index 64742016c0..6246b144a6 100644
--- a/lib/regexdev/rte_regexdev_driver.h
+++ b/lib/regexdev/rte_regexdev_driver.h
@@ -32,6 +32,7 @@ extern "C" {
  *   A pointer to the RegEx device slot case of success,
  *   NULL otherwise.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_register(const char *name);
 
 /**
@@ -41,6 +42,7 @@ struct rte_regexdev *rte_regexdev_register(const char *name);
  * @param dev
  *   Device to be released.
  */
+__rte_internal
 void rte_regexdev_unregister(struct rte_regexdev *dev);
 
 /**
@@ -50,6 +52,7 @@ void rte_regexdev_unregister(struct rte_regexdev *dev);
  * @param name
  *   The device name.
  */
+__rte_internal
 struct rte_regexdev *rte_regexdev_get_device_by_name(const char *name);
 
 #ifdef __cplusplus
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 8db9b17018..988b909638 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -1,6 +1,7 @@
 EXPERIMENTAL {
global:
 
+   rte_regex_devices;
rte_regexdev_attr_get;
rte_regexdev_attr_set;
rte_regexdev_close;
@@ -11,6 +12,8 @@ EXPERIMENTAL {
rte_regexdev_enqueue_burst;
rte_regexdev_get_dev_id;
rte_regexdev_info_get;
+   rte_regexdev_is_valid_dev;
+   rte_regexdev_logtype;
rte_regexdev_queue_pair_setup;
rte_regexdev_rule_db_compile_activate;
rte_regexdev_rule_db_export;
@@ -24,3 +27,9 @@ EXPERIMENTAL {
rte_regexdev_xstats_names_get;
rte_regexdev_xstats_reset;
 };
+
+INTERNAL {
+   rte_regexdev_get_device_by_name;
+   rte_regexdev_register;
+   rte_regexdev_unregister;
+};
-- 
2.34.1



[PATCH 2/2] build: hide local symbols in shared libraries

2022-03-06 Thread Thomas Monjalon
The symbols which are not listed in the version script
are exported by default.
Adding a local section with a wildcard make non-listed functions
and variables as hidden, as it should be in all version.map files.

These are the changes done in the shared libraries:
- DF .text  Base  auxiliary_add_device
- DF .text  Base  auxiliary_dev_exists
- DF .text  Base  auxiliary_dev_iterate
- DF .text  Base  auxiliary_insert_device
- DF .text  Base  auxiliary_is_ignored_device
- DF .text  Base  auxiliary_match
- DF .text  Base  auxiliary_on_scan
- DF .text  Base  auxiliary_scan
- DO .bss   Base  auxiliary_bus_logtype
- DO .data  Base  auxiliary_bus
- DO .bss   Base  gpu_logtype

There is no impact on regexdev library.

Because these local symbols were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
Exception rules are added for these experimental libraries,
so the ABI check will skip them until the next ABI version.

Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")
Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")
Cc: sta...@dpdk.org

Signed-off-by: Thomas Monjalon 
---
 devtools/libabigail.abignore  | 8 
 drivers/bus/auxiliary/version.map | 2 ++
 lib/gpudev/version.map| 2 ++
 lib/regexdev/version.map  | 2 ++
 4 files changed, 14 insertions(+)

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index cff7a293ae..d698d8199d 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -28,3 +28,11 @@
 ; Ignore changes in common mlx5 driver, should be all internal
 [suppress_file]
 soname_regexp = ^librte_common_mlx5\.
+
+; Ignore visibility fix of local functions in experimental auxiliary driver
+[suppress_file]
+soname_regexp = ^librte_bus_auxiliary\.
+
+; Ignore visibility fix of local functions in experimental gpudev library
+[suppress_file]
+soname_regexp = ^librte_gpudev\.
diff --git a/drivers/bus/auxiliary/version.map 
b/drivers/bus/auxiliary/version.map
index a52260657c..dc993e84ff 100644
--- a/drivers/bus/auxiliary/version.map
+++ b/drivers/bus/auxiliary/version.map
@@ -4,4 +4,6 @@ EXPERIMENTAL {
# added in 21.08
rte_auxiliary_register;
rte_auxiliary_unregister;
+
+   local: *;
 };
diff --git a/lib/gpudev/version.map b/lib/gpudev/version.map
index b23e3fd6eb..a2c8ce5759 100644
--- a/lib/gpudev/version.map
+++ b/lib/gpudev/version.map
@@ -39,4 +39,6 @@ INTERNAL {
rte_gpu_get_by_name;
rte_gpu_notify;
rte_gpu_release;
+
+   local: *;
 };
diff --git a/lib/regexdev/version.map b/lib/regexdev/version.map
index 988b909638..3c6e9fffa1 100644
--- a/lib/regexdev/version.map
+++ b/lib/regexdev/version.map
@@ -26,6 +26,8 @@ EXPERIMENTAL {
rte_regexdev_xstats_get;
rte_regexdev_xstats_names_get;
rte_regexdev_xstats_reset;
+
+   local: *;
 };
 
 INTERNAL {
-- 
2.34.1



Re: mlx5_pci Decompression Error

2022-03-06 Thread Matan Azrad
Hi Shafiqul

Your compressed data for decompress OP doesn't include b-final bit in the last 
block.

May point to memory issue: cutting/garbage...

השג את ‏Outlook עבור Android‏


מאת: Shafiqul Abedin 
נשלח: יום חמישי, 3 במרץ 2022, 02:32
אל: dev@dpdk.org 
נושא: mlx5_pci Decompression Error

External email: Use caution opening links or attachments


Hi,
I am new to dpdk development in general and have been trying some development 
on Nvidia BF2 but ran into some problems. I am using Compress device: mlx5_pci 
to do compression/decompression and it appears that compression is fine but 
when I try to decompress, I get the following error:

mlx5_compress: Error cqe:
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:  029D0011 D90E002F D25B0100
mlx5_compress:
Error wqe:
mlx5_compress: 2F010003 04D90E00 0800 
mlx5_compress:  D60D0600 0100 00753D00
mlx5_compress: 6203 D70E0600 0100 00C33C00
mlx5_compress: 6203 D70E0600 0100 40243C00
mlx5_compress:
Error opaq:
mlx5_compress: 1101  6203 
mlx5_compress: 85E04AE1 D9AEF314 DC727887 EE0BFC72
mlx5_compress: D062FF2C 692749AE  
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    
mlx5_compress:    

Decompress OP status is 3 and the debug_status is 273. Not sure how to 
interpret this error. Any help in deciphering this would be greatly 
appreciated. I apologize for missing any critical information.

Shafiq

p.s.
MLNX_OFED_LINUX-5.5-0.5.0 (OFED-5.5-0.5.0)
mlnx-dpdk  20.11.0-3.1.14.550500





Re: [PATCH v2] ci: remove redundant drivers enabling

2022-03-06 Thread Thomas Monjalon
01/03/2022 11:57, David Marchand:
> On Tue, Mar 1, 2022 at 11:05 AM Thomas Monjalon  wrote:
> >
> > No need to explicitly enable drivers bus/vdev and mempool/ring.
> >
> > bus/vdev is always enabled since
> > commit 2e33309ebe03 ("config: enable/disable drivers in Arm builds")
> >
> > mempool/ring is always enabled since
> > commit 81c2337e044d ("build: make ring mempool driver mandatory")
> >
> > The driver net/null is kept to allow running test-null.sh.
> >
> > Signed-off-by: Thomas Monjalon 
> > Acked-by: Bruce Richardson 
> Acked-by: David Marchand 

Applied





Re: [PATCH v2] ci: remove outdated default versions for ABI check

2022-03-06 Thread Thomas Monjalon
01/03/2022 11:07, David Marchand:
> On Tue, Mar 1, 2022 at 10:57 AM Thomas Monjalon  wrote:
> >
> > The variables REF_GIT_TAG and LIBABIGAIL_VERSION are set
> > in the CI configuration like .travis.yml or .github/workflows/build.yml.
> > The default values are outdated and probably unused.
> >
> > The default values are removed completely
> > to avoid forgetting an update in future.
> >
> > The use of the variables is quoted to make sure
> > a missing value will trigger an appropriate failure.
> >
> > Signed-off-by: Thomas Monjalon 
> > Acked-by: Aaron Conole 
> Acked-by: David Marchand 

Applied





DPDK Release Status Meeting 2022-03-03

2022-03-06 Thread Mcnamara, John
Release status meeting minutes 2022-03-03
=

Agenda:
* Release Dates
* Subtrees
* Roadmaps
* LTS
* Defects
* Opens

Participants:
* ARM
* Debian
* Intel
* Marvell
* Nvidia
* Red Hat


Release Dates
-

The following are the proposed dates for 22.03:

* 22.03 RC32022-03-07
* 22.03 Release2022-03-11

Updated dates are posted shortly after they are changed at:
http://core.dpdk.org/roadmap/#dates

Here are some provisional dates for the subsequent releases:

* 22.07 V1 2022-04-10
* 22.07 Merge  2022-05-30
* 22.07 Release2022-07-13

* 22.11 V1 2022-09-14
* 22.11 Merge  2022-10-03
* 22.11 Release2022-11-16


Subtrees


* next-net
  * Mainly complete. Not many patches left in the backlog
  * Some GCC12 build issues

* next-net-intel
  * Mostly complete

* next-net-mlx
  * Some fixes to be submitted for RC3

* next-net-brcm
  * No update

* next-net-mrvl
  * Majority of patches merged

* next-eventdev
  * Majority of patches merged
  * 2-3 other patches for RC3

* next-virtio
  * PR ready

* next-crypto
  * ~15 patches remaining, mainly fixes
  * Some work going on around FIPS



* main

  * EAL series  on fast restart with many hugepages merged

  * Some work going on around sample apps

  * RC3 likely on or before Monday 7 March


LTS
---



* 21.11.1
  * Backporting progressing

* 20.11.5
  * Backporting progressing

* 19.11.12
  * Backporting progressing


* Distros
  * v20.11 in Debian 11
  * 22.04 will contain 21.11

Defects
---

* Bugzilla links, 'Bugs',  added for hosted projects
  * https://www.dpdk.org/hosted-projects/


Opens
-

* None


DPDK Release Status Meetings


The DPDK Release Status Meeting is intended for DPDK Committers to discuss the 
status of the master tree and sub-trees, and for project managers to track 
progress or milestone dates.

The meeting occurs on every Thursday at 9:30 UTC. on https://meet.jit.si/DPDK

If you wish to attend just send an email to "John McNamara 
john.mcnam...@intel.com" for the invite.


[PATCH] net/sfc: do not spam logs on tunnel restore info errors

2022-03-06 Thread Ivan Malov
OvS might invoke this API on its data path, out of sync
with its control plane. If the control path has already
deactivated the tunnel context entry, these invocations
will produce quite a few error printouts. Suppress that.

Fixes: 7e5b479803c3 ("net/sfc: implement control path operations in tunnel 
offload")
Cc: sta...@dpdk.org

Signed-off-by: Ivan Malov 
Reviewed-by: Andrew Rybchenko 
---
 drivers/net/sfc/sfc_flow_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/sfc_flow_tunnel.c 
b/drivers/net/sfc/sfc_flow_tunnel.c
index e9eca90012..af5941c1ba 100644
--- a/drivers/net/sfc/sfc_flow_tunnel.c
+++ b/drivers/net/sfc/sfc_flow_tunnel.c
@@ -433,7 +433,7 @@ sfc_flow_tunnel_get_restore_info(struct rte_eth_dev *dev,
ft = &sa->flow_tunnels[ft_id];
 
if (ft->refcnt == 0) {
-   sfc_err(sa, "tunnel offload: get_restore_info: tunnel=%u does 
not exist",
+   sfc_dbg(sa, "tunnel offload: get_restore_info: tunnel=%u does 
not exist",
ft_id);
rc = ENOENT;
goto fail;
-- 
2.30.2



Re: [PATCH v4 1/3] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs

2022-03-06 Thread Thomas Monjalon
01/03/2022 12:18, Zhang, Qi Z:
> From: Wang, Haiyue 
> > From: Jeff Daly 
> > > From: Stephen Douthit 
> > >
> > > Currently all X500EM* MAC types fallthrough to the default case and
> > > get reported as non-SFP regardless of media type, which isn't correct.
> > >
> > > Fixes: 0790adeb567 ("ixgbe/base: support X550em_a device")
> > > Cc: sta...@dpdk.org
> > >
> > > Signed-off-by: Stephen Douthit 
> > > Signed-off-by: Jeff Daly 
> > 
> > Acked-by: Haiyue Wang 
> 
> Applied to dpdk-next-net-intel after renaming the title to "fix FSP check for 
> X550EM devices" to fix check-git-log error.

It seems you have applied only the first patch of the series. Why?
Is there a good reason to split a series without any justification?
What about the two other patches?




Re: [PATCH v5] app/testpmd: add help messages for multi-process

2022-03-06 Thread Thomas Monjalon
04/03/2022 16:35, Ferruh Yigit:
> On 3/4/2022 9:11 AM, Zhang, Yuying wrote:
> > From: Min Hu (Connor) 
> >> From: Huisong Li 
> >>
> >> This patch adds help messages for multi-process.
> >> --num-procs , where N is the total number of symmetric_mp instances
> >> that will be run side-by-side to perform packet processing. This parameter 
> >> is
> >> used to configure the appropriate number of receive queues on each
> >> network port.
> >>
> >> --proc-id , where n is a numeric value in the range 0 <= n < N (number 
> >> of
> >> processes, specified above). This identifies which symmetric_mp instance is
> >> being run, so that each process can read a unique receive queue on each
> >> network port.
> >>
> >> Fixes: a550baf24af9 ("app/testpmd: support multi-process")
> >> Cc: sta...@dpdk.org
> >>
> >> Signed-off-by: Huisong Li 
> >> Signed-off-by: Min Hu (Connor) 
> > 
> > Acked-by: Yuying Zhang 
> > 
> 
> Updated 'symmetric_mp' -> 'multi-process', with this change
> Reviewed-by: Ferruh Yigit 
> 
> Applied to dpdk-next-net/main, thanks.

Why not reusing these defines?

#define PARAM_PROC_ID "proc-id"
#define PARAM_NUM_PROCS "num-procs"

Why not having "N" in the help messages like others?

I won't pull it in main.
Please rework and try to improve the description to make it shorter
and easier to understand.




[PATCH v2 0/2] app/testpmd: skip stopped queues when forwarding

2022-03-06 Thread Dmitry Kozlyuk
It was unspecified what happens of a stopped queue is polled.
Declare that polling is prohibited and modify testpmd to follow this.
Rationale is described i nthe commit log; it follows the discussion:
http://inbox.dpdk.org/dev/bl1pr12mb594551a71273709e1c04a8bab9...@bl1pr12mb5945.namprd12.prod.outlook.com/

v2:
  * Do not try to change forwarding mode partially,
disable individual flows that need stopped queues instead.
  * Do not store queue status in testpmd,
query it as needed instead.

Dmitry Kozlyuk (2):
  ethdev: prohibit polling of a stopped queue
  app/testpmd: do not poll stopped queues

 app/test-pmd/5tswap.c | 13 
 app/test-pmd/csumonly.c   | 13 
 app/test-pmd/flowgen.c| 13 
 app/test-pmd/icmpecho.c   | 13 
 app/test-pmd/ieee1588fwd.c| 13 
 app/test-pmd/iofwd.c  | 13 
 app/test-pmd/macfwd.c | 13 
 app/test-pmd/noisy_vnf.c  | 13 
 app/test-pmd/rxonly.c | 13 
 app/test-pmd/shared_rxq_fwd.c | 13 
 app/test-pmd/testpmd.c| 57 ++-
 app/test-pmd/testpmd.h|  4 +++
 app/test-pmd/txonly.c | 13 
 lib/ethdev/rte_ethdev.h   |  2 +-
 14 files changed, 204 insertions(+), 2 deletions(-)

-- 
2.25.1



[PATCH v2 2/2] app/testpmd: do not poll stopped queues

2022-03-06 Thread Dmitry Kozlyuk
Calling Rx/Tx functions on a stopped queue is not supported.
Do not run packet forwarding for streams that use stopped queues.

Each stream has a read-only "disabled" field,
so that lcore function can skip such streams.
Forwarding engines can set this field
using a new "stream_init" callback function
by checking relevant queue states.
A helper function is provided to check if a given
Rx queue, Tx queue, or both of them are stopped.

Fixes: 5f4ec54f1d16 ("testpmd: queue start and stop")
Cc: sta...@dpdk.org

Signed-off-by: Dmitry Kozlyuk 
Acked-by: Matan Azrad 
---
 app/test-pmd/5tswap.c | 13 
 app/test-pmd/csumonly.c   | 13 
 app/test-pmd/flowgen.c| 13 
 app/test-pmd/icmpecho.c   | 13 
 app/test-pmd/ieee1588fwd.c| 13 
 app/test-pmd/iofwd.c  | 13 
 app/test-pmd/macfwd.c | 13 
 app/test-pmd/noisy_vnf.c  | 13 
 app/test-pmd/rxonly.c | 13 
 app/test-pmd/shared_rxq_fwd.c | 13 
 app/test-pmd/testpmd.c| 57 ++-
 app/test-pmd/testpmd.h|  4 +++
 app/test-pmd/txonly.c | 13 
 13 files changed, 203 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/5tswap.c b/app/test-pmd/5tswap.c
index 629d3e0d31..2aa1f1843b 100644
--- a/app/test-pmd/5tswap.c
+++ b/app/test-pmd/5tswap.c
@@ -185,9 +185,22 @@ pkt_burst_5tuple_swap(struct fwd_stream *fs)
get_end_cycles(fs, start_tsc);
 }
 
+static int
+stream_init_5tuple_swap(struct fwd_stream *fs)
+{
+   bool rx_stopped, tx_stopped;
+   int ret;
+
+   ret = fwd_stream_get_stopped_queues(fs, &rx_stopped, &tx_stopped);
+   if (ret == 0)
+   fs->disabled = rx_stopped || tx_stopped;
+   return ret;
+}
+
 struct fwd_engine five_tuple_swap_fwd_engine = {
.fwd_mode_name  = "5tswap",
.port_fwd_begin = NULL,
.port_fwd_end   = NULL,
+   .stream_init= stream_init_5tuple_swap,
.packet_fwd = pkt_burst_5tuple_swap,
 };
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5274d498ee..a031cae2ca 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -1178,9 +1178,22 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
get_end_cycles(fs, start_tsc);
 }
 
+static int
+stream_init_checksum_forward(struct fwd_stream *fs)
+{
+   bool rx_stopped, tx_stopped;
+   int ret;
+
+   ret = fwd_stream_get_stopped_queues(fs, &rx_stopped, &tx_stopped);
+   if (ret == 0)
+   fs->disabled = rx_stopped || tx_stopped;
+   return ret;
+}
+
 struct fwd_engine csum_fwd_engine = {
.fwd_mode_name  = "csum",
.port_fwd_begin = NULL,
.port_fwd_end   = NULL,
+   .stream_init= stream_init_checksum_forward,
.packet_fwd = pkt_burst_checksum_forward,
 };
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 9ceef3b54a..e2c1bfd82c 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -207,9 +207,22 @@ flowgen_begin(portid_t pi)
return 0;
 }
 
+static int
+flowgen_stream_init(struct fwd_stream *fs)
+{
+   bool rx_stopped, tx_stopped;
+   int ret;
+
+   ret = fwd_stream_get_stopped_queues(fs, &rx_stopped, &tx_stopped);
+   if (ret == 0)
+   fs->disabled = rx_stopped || tx_stopped;
+   return ret;
+}
+
 struct fwd_engine flow_gen_engine = {
.fwd_mode_name  = "flowgen",
.port_fwd_begin = flowgen_begin,
.port_fwd_end   = NULL,
+   .stream_init= flowgen_stream_init,
.packet_fwd = pkt_burst_flow_gen,
 };
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index 99c94cb282..dd3699ff3b 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -512,9 +512,22 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
get_end_cycles(fs, start_tsc);
 }
 
+static int
+icmpecho_stream_init(struct fwd_stream *fs)
+{
+   bool rx_stopped, tx_stopped;
+   int ret;
+
+   ret = fwd_stream_get_stopped_queues(fs, &rx_stopped, &tx_stopped);
+   if (ret == 0)
+   fs->disabled = rx_stopped || tx_stopped;
+   return ret;
+}
+
 struct fwd_engine icmp_echo_engine = {
.fwd_mode_name  = "icmpecho",
.port_fwd_begin = NULL,
.port_fwd_end   = NULL,
+   .stream_init= icmpecho_stream_init,
.packet_fwd = reply_to_icmp_echo_rqsts,
 };
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 9ff817aa68..f9f73f2c14 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -211,9 +211,22 @@ port_ieee1588_fwd_end(portid_t pi)
rte_eth_timesync_disable(pi);
 }
 
+static int
+port_ieee1588_stream_init(struct fwd_stream *fs)
+{
+   bool rx_stopped, tx_stopped;
+   int ret;
+
+   ret = fwd_stream_get_stopped_queues(fs, &rx_stopped, &tx_stopped);
+   if (ret == 0)
+   fs->disabled = rx_stopped || tx_stopped;
+ 

[PATCH v2 1/2] ethdev: prohibit polling of a stopped queue

2022-03-06 Thread Dmitry Kozlyuk
Whether it is allowed to call Rx/Tx functions for a stopped queue
was undocumented. Some PMDs make this behavior a no-op
either by explicitly checking the queue state
or by the way how their routines are implemented or HW works.

No-op behavior may be convenient for application developers.
But it also means that pollers of stopped queues
would go all the way down to PMD Rx/Tx routines, wasting cycles.
Some PMDs would do a check for the queue state on data path,
even though it may never be needed for a particular application.
Also, use cases for stopping queues or starting them deferred
do not logically require polling stopped queues.

Use case 1: a secondary that was polling the queue has crashed,
the primary is doing a recovery to free all mbufs.
By definition the queue to be restarted is not polled.

Use case 2: deferred queue start or queue reconfiguration.
The polling thread must be synchronized anyway,
because queue start and stop are non-atomic.

Prohibit calling Rx/Tx functions on stopped queues.

Fixes: 0748be2cf9a2 ("ethdev: queue start and stop")
Cc: sta...@dpdk.org

Signed-off-by: Dmitry Kozlyuk 
Acked-by: Matan Azrad 
---
 lib/ethdev/rte_ethdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index c2d1f9a972..9f12a6043c 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -74,7 +74,7 @@
  * rte_eth_rx_queue_setup()), it must call rte_eth_dev_stop() first to stop the
  * device and then do the reconfiguration before calling rte_eth_dev_start()
  * again. The transmit and receive functions should not be invoked when the
- * device is stopped.
+ * device is stopped or when the queue is stopped (for that queue).
  *
  * Please note that some configuration is not stored between calls to
  * rte_eth_dev_stop()/rte_eth_dev_start(). The following configuration will
-- 
2.25.1



[PATCH] examples/kni: add CR character at print log

2022-03-06 Thread Tianli Lai
add CR character at print link state information

Signed-off-by: Tianli Lai 
---
 examples/kni/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index f5b20a7b62..e99ef5c38a 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -719,7 +719,7 @@ log_link_state(struct rte_kni *kni, int prev, struct 
rte_eth_link *link)
 
rte_eth_link_to_str(link_status_text, sizeof(link_status_text), link);
if (prev != link->link_status)
-   RTE_LOG(INFO, APP, "%s NIC %s",
+   RTE_LOG(INFO, APP, "%s NIC %s\n",
rte_kni_get_name(kni),
link_status_text);
 }
-- 
2.27.0



[PATCH] net/mlx5: fix the port match in sample flow

2022-03-06 Thread Jiawei Wang
If there are an explicit port match and sample action in the same flow,
mlx5 PMD pushes the explicit port match in the prefix subflow, and
uses the tag item match in the suffix subflow.

The explicit port match was translated into source vport match so
the sample suffix subflow lost this match after flow split.

This patch copies the explicit port match to the sample suffix subflow,
and the latter gets the correct source vport value in the flow matcher.

Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows")
Cc: sta...@dpdk.org

Signed-off-by: Jiawei Wang 
---
 drivers/net/mlx5/mlx5_flow.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 179cc3b303..34b8f97a14 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5543,7 +5543,7 @@ flow_check_match_action(const struct rte_flow_action 
actions[],
return flag ? actions_n + 1 : 0;
 }
 
-#define SAMPLE_SUFFIX_ITEM 2
+#define SAMPLE_SUFFIX_ITEM 3
 
 /**
  * Split the sample flow.
@@ -5584,6 +5584,7 @@ flow_check_match_action(const struct rte_flow_action 
actions[],
 static int
 flow_sample_split_prep(struct rte_eth_dev *dev,
   int add_tag,
+  const struct rte_flow_item items[],
   struct rte_flow_item sfx_items[],
   const struct rte_flow_action actions[],
   struct rte_flow_action actions_sfx[],
@@ -5650,6 +5651,12 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
.data = tag_id,
};
/* Prepare the suffix subflow items. */
+   for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
+   if (items->type == RTE_FLOW_ITEM_TYPE_PORT_ID) {
+   memcpy(sfx_items, items, sizeof(*sfx_items));
+   sfx_items++;
+   }
+   }
tag_spec = (void *)(sfx_items + SAMPLE_SUFFIX_ITEM);
tag_spec->data = tag_id;
tag_spec->id = set_tag->id;
@@ -6257,7 +6264,7 @@ flow_create_split_sample(struct rte_eth_dev *dev,
jump_table = attr->group * MLX5_FLOW_TABLE_FACTOR +
 next_ft_step;
pre_actions = sfx_actions + actions_n;
-   tag_id = flow_sample_split_prep(dev, add_tag, sfx_items,
+   tag_id = flow_sample_split_prep(dev, add_tag, items, sfx_items,
actions, sfx_actions,
pre_actions, actions_n,
sample_action_pos,
-- 
2.18.1



RE: [PATCH] examples/l3fwd: resolve stack buffer overflow issue

2022-03-06 Thread Rahul Bhansali
Hi Thomas,

Below patch is pending for review and merge. Can you please check it ?
http://patches.dpdk.org/project/dpdk/list/?series=21124

Regards,
Rahul


-Original Message-
From: Rahul Bhansali  
Sent: Tuesday, January 11, 2022 6:20 PM
To: dev@dpdk.org; conor.wa...@intel.com; david.march...@redhat.com
Cc: Rahul Bhansali 
Subject: [PATCH] examples/l3fwd: resolve stack buffer overflow issue

This patch fixes the stack buffer overflow error reported from AddressSanitizer.
Function send_packetsx4() tries to access out of bound data from rte_mbuf and 
fill it into TX buffer even in the case where no pending packets (len = 0).
Performance impact:- No

ASAN error report:-
==819==ERROR: AddressSanitizer: stack-buffer-overflow on address
0xe2c0dcf0 at pc 0x005e791c bp 0xe2c0d7e0 sp 0xe2c0d800 READ of 
size 8 at 0xe2c0dcf0 thread T0
 #0 0x5e7918 in send_packetsx4 ../examples/l3fwd/l3fwd_common.h:251
 #1 0x5e7918 in send_packets_multi ../examples/l3fwd/l3fwd_neon.h:226

Signed-off-by: Rahul Bhansali 
---
 examples/l3fwd/l3fwd_common.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h 
index 7d83ff641a..de77711f88 100644
--- a/examples/l3fwd/l3fwd_common.h
+++ b/examples/l3fwd/l3fwd_common.h
@@ -236,6 +236,9 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, 
struct rte_mbuf *m[],
 
/* copy rest of the packets into the TX buffer. */
len = num - n;
+   if (len == 0)
+   goto exit;
+
j = 0;
switch (len % FWDSTEP) {
while (j < len) {
@@ -258,6 +261,7 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, 
struct rte_mbuf *m[],
}
}
 
+exit:
qconf->tx_mbufs[port].len = len;
 }
 
--
2.25.1



Re: [PATCH] net/bnxt: fix a null dereference in cleanup label

2022-03-06 Thread Ajit Khaparde
On Thu, Feb 24, 2022 at 7:54 AM Weiguo Li  wrote:
>
> Fixes: a46bbb57605b4 ("net/bnxt: update multi device design")
>
> In tf_session_create(), there is a case that with 'tfp->session' still
> be NULL and run 'goto cleanup', which will leads to a null dereference
> by 'tfp_free(tfp->session->core_data)' in the cleanup.
>
> Signed-off-by: Weiguo Li 
Patch applied to dpdk-next-net-brcm.
Thanks

> ---
>  drivers/net/bnxt/tf_core/tf_session.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bnxt/tf_core/tf_session.c 
> b/drivers/net/bnxt/tf_core/tf_session.c
> index 9f849a0a76..c30c0e7029 100644
> --- a/drivers/net/bnxt/tf_core/tf_session.c
> +++ b/drivers/net/bnxt/tf_core/tf_session.c
> @@ -230,10 +230,12 @@ tf_session_create(struct tf *tfp,
> "FW Session close failed, rc:%s\n",
> strerror(-rc));
> }
> +   if (tfp->session) {
> +   tfp_free(tfp->session->core_data);
> +   tfp_free(tfp->session);
> +   tfp->session = NULL;
> +   }
>
> -   tfp_free(tfp->session->core_data);
> -   tfp_free(tfp->session);
> -   tfp->session = NULL;
> return rc;
>  }
>
> --
> 2.25.1
>


smime.p7s
Description: S/MIME Cryptographic Signature


RE: [PATCH 2/2] net/mlx5: fix INET IPIP protocol type

2022-03-06 Thread Gregory Etelson
Hello Ferruh,

::snip::

> > Fixes: f3f1f576f438 ("net/mlx5: fix RSS
> expansion with explicit next protocol")
> > Signed-off-by: Gregory Etelson
> 
> > Acked-by: Matan Azrad 
> > ---
> >   drivers/net/mlx5/mlx5_flow.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow.c
> b/drivers/net/mlx5/mlx5_flow.c
> > index 0d774cfd19..efb988a9bb 100644
> > --- a/drivers/net/mlx5/mlx5_flow.c
> > +++ b/drivers/net/mlx5/mlx5_flow.c
> > @@ -208,7 +208,7 @@
> mlx5_inet_proto_to_item_type(uint8_t
> proto_spec, uint8_t proto_mask)
> >   case IPPROTO_TCP:
> >   type = RTE_FLOW_ITEM_TYPE_TCP;
> >   break;
> > - case IPPROTO_IP:
> > + case IPPROTO_IPIP:
> 
> Hi Gregory, Matan,
> 
> Are you sure about this change?
> 
> In linux header (include/uapi/linux/in.h) it is
> defined as:
> IPPROTO_IPIP = 4,   /* IPIP tunnels (older
> KA9Q tunnels use 94) */
> 
> And IPIP tunnels as far as I can found [1]:
> IPIP tunnel, just as the name suggests, is an IP
> over IP tunnel, defined in RFC 2003.
> 
> 
> Since type set to 'RTE_FLOW_ITEM_TYPE_IPV4'
> in this case
> statement, I would like to double check if this is
> correct.
> 

That code is part of MLX5 PMD RSS expansion model.
The code returns RTE flow pattern type of the next network header.
In case of IPv4 in IPv4 tunnel, next header for the outer IPv4 is also IPv4.
Therefore, the code returns 'RTE_FLOW_ITEM_TYPE_IPV4'.

Regards,
Gregory




RE: [PATCH] examples/l3fwd: resolve stack buffer overflow issue

2022-03-06 Thread Rahul Bhansali
Ping..

-Original Message-
From: Rahul Bhansali  
Sent: Tuesday, January 11, 2022 6:20 PM
To: dev@dpdk.org; conor.wa...@intel.com; david.march...@redhat.com
Cc: Rahul Bhansali 
Subject: [PATCH] examples/l3fwd: resolve stack buffer overflow issue

This patch fixes the stack buffer overflow error reported from AddressSanitizer.
Function send_packetsx4() tries to access out of bound data from rte_mbuf and 
fill it into TX buffer even in the case where no pending packets (len = 0).
Performance impact:- No

ASAN error report:-
==819==ERROR: AddressSanitizer: stack-buffer-overflow on address
0xe2c0dcf0 at pc 0x005e791c bp 0xe2c0d7e0 sp 0xe2c0d800 READ of 
size 8 at 0xe2c0dcf0 thread T0
 #0 0x5e7918 in send_packetsx4 ../examples/l3fwd/l3fwd_common.h:251
 #1 0x5e7918 in send_packets_multi ../examples/l3fwd/l3fwd_neon.h:226

Signed-off-by: Rahul Bhansali 
---
 examples/l3fwd/l3fwd_common.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h 
index 7d83ff641a..de77711f88 100644
--- a/examples/l3fwd/l3fwd_common.h
+++ b/examples/l3fwd/l3fwd_common.h
@@ -236,6 +236,9 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, 
struct rte_mbuf *m[],
 
/* copy rest of the packets into the TX buffer. */
len = num - n;
+   if (len == 0)
+   goto exit;
+
j = 0;
switch (len % FWDSTEP) {
while (j < len) {
@@ -258,6 +261,7 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, 
struct rte_mbuf *m[],
}
}
 
+exit:
qconf->tx_mbufs[port].len = len;
 }
 
--
2.25.1



RE: [PATCH] net/cnxk: fix error when compiled for x86

2022-03-06 Thread Gao, DaxueX
> -Original Message-
> From: Rakesh Kudurumalla 
> Sent: 2022年3月4日 22:24
> To: Nithin Dabilpuram ; Kiran Kumar K
> ; Sunil Kumar Kori ; Satha
> Rao 
> Cc: dev@dpdk.org; jer...@marvell.com; Rakesh Kudurumalla
> ; sta...@dpdk.org; Yigit, Ferruh
> 
> Subject: [PATCH] net/cnxk: fix error when compiled for x86
> 
> fix error when compiled for x86 platform when compiled with optimization flag
> enabled
> error: ‘str’ may be used uninitialized in this function
> error: ‘frag_ptr’ may be used uninitialized in this function
> 
> Bugzilla ID: 939
> Fixes: b526599020ef ("net/cnxk: fix build with GCC 12")
> Cc: sta...@dpdk.org
> 
> Reported-by: Ferruh Yigit 
> Signed-off-by: Rakesh Kudurumalla 
> ---

Tested-by: Daxue Gao 


[PATCH v1] graph: remove the useless duplicate name check

2022-03-06 Thread Haiyue Wang
The node clone API parameter 'name' is the new node's postfix name, not
the final node name, so it makes no sense to check it. And the new name
will be checked duplicate when calling API '__rte_node_register'.

Signed-off-by: Haiyue Wang 
---
 lib/graph/node.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/lib/graph/node.c b/lib/graph/node.c
index 79230035a2..ae6eadb260 100644
--- a/lib/graph/node.c
+++ b/lib/graph/node.c
@@ -150,10 +150,6 @@ node_clone(struct node *node, const char *name)
goto fail;
}
 
-   /* Check for duplicate name */
-   if (node_has_duplicate_entry(name))
-   goto fail;
-
reg = calloc(1, sizeof(*reg) + (sizeof(char *) * node->nb_edges));
if (reg == NULL) {
rte_errno = ENOMEM;
-- 
2.35.1



Re: [PATCH v1] graph: remove the useless duplicate name check

2022-03-06 Thread Jerin Jacob
On Mon, Mar 7, 2022 at 12:47 PM Haiyue Wang  wrote:
>
> The node clone API parameter 'name' is the new node's postfix name, not
> the final node name, so it makes no sense to check it. And the new name
> will be checked duplicate when calling API '__rte_node_register'.
>
> Signed-off-by: Haiyue Wang 

Could you check the test failure with this change?
Reproducer:

echo "graph_autotest" | ./build/app/test/dpdk-test -c 0x30 --no-huge

> ---
>  lib/graph/node.c | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/lib/graph/node.c b/lib/graph/node.c
> index 79230035a2..ae6eadb260 100644
> --- a/lib/graph/node.c
> +++ b/lib/graph/node.c
> @@ -150,10 +150,6 @@ node_clone(struct node *node, const char *name)
> goto fail;
> }
>
> -   /* Check for duplicate name */
> -   if (node_has_duplicate_entry(name))
> -   goto fail;
> -
> reg = calloc(1, sizeof(*reg) + (sizeof(char *) * node->nb_edges));
> if (reg == NULL) {
> rte_errno = ENOMEM;
> --
> 2.35.1
>


RE: [PATCH v1] graph: remove the useless duplicate name check

2022-03-06 Thread Wang, Haiyue
> -Original Message-
> From: Jerin Jacob 
> Sent: Monday, March 7, 2022 15:45
> To: Wang, Haiyue 
> Cc: dpdk-dev ; Jerin Jacob ; Kiran Kumar K 
> ;
> Nithin Dabilpuram 
> Subject: Re: [PATCH v1] graph: remove the useless duplicate name check
> 
> On Mon, Mar 7, 2022 at 12:47 PM Haiyue Wang  wrote:
> >
> > The node clone API parameter 'name' is the new node's postfix name, not
> > the final node name, so it makes no sense to check it. And the new name
> > will be checked duplicate when calling API '__rte_node_register'.
> >
> > Signed-off-by: Haiyue Wang 
> 
> Could you check the test failure with this change?
> Reproducer:
> 
> echo "graph_autotest" | ./build/app/test/dpdk-test -c 0x30 --no-huge

I see, so the API not want "test_node00-test_node00".
LGTM, if so, I will drop this patch. ;-)

> 
> > ---
> >  lib/graph/node.c | 4 
> >  1 file changed, 4 deletions(-)
> >
> > diff --git a/lib/graph/node.c b/lib/graph/node.c
> > index 79230035a2..ae6eadb260 100644
> > --- a/lib/graph/node.c
> > +++ b/lib/graph/node.c
> > @@ -150,10 +150,6 @@ node_clone(struct node *node, const char *name)
> > goto fail;
> > }
> >
> > -   /* Check for duplicate name */
> > -   if (node_has_duplicate_entry(name))
> > -   goto fail;
> > -
> > reg = calloc(1, sizeof(*reg) + (sizeof(char *) * node->nb_edges));
> > if (reg == NULL) {
> > rte_errno = ENOMEM;
> > --
> > 2.35.1
> >