patches for DPDK stable branches
 help / color / mirror / Atom feed
* patches have been queued to stable release 23.11.1
@ 2024-03-05  9:45 Xueming Li
  2024-03-05  9:45 ` patch 'buildtools/cmdline: fix generated code for IP addresses' has " Xueming Li
                   ` (136 more replies)
  0 siblings, 137 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 05bea47b81f3f38d07cb3aedc6fc2a578c3caae8 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@nvidia.com>
Date: Tue, 5 Mar 2024 17:39:30 +0800
Subject: [PATCH] patch list
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

*** BLURB HERE ***

Ajit Khaparde (2):
  net/bnxt: fix array overflow
  net/bnxt: modify locking for representor Tx

Akhil Goyal (1):
  common/cnxk: fix memory leak in CPT init

Akshay Dorwat (1):
  net/ionic: fix RSS query

Alan Elder (2):
  net: add macros for VLAN metadata parsing
  net/netvsc: fix VLAN metadata parsing

Andrew Boyer (1):
  net/ionic: fix device close

Anoob Joseph (1):
  examples/ipsec-secgw: fix width of variables

Anup Prabhu (1):
  ml/cnxk: fix xstats calculation

Bruce Richardson (5):
  buildtools/cmdline: fix generated code for IP addresses
  buildtools/cmdline: fix IP address initializer
  kernel/freebsd: fix module build on FreeBSD 14
  build: fix linker warnings about undefined symbols
  net/vmxnet3: fix initialization on FreeBSD

Chaoyong He (9):
  net/nfp: fix resource leak for device initialization
  net/nfp: fix resource leak for CoreNIC firmware
  net/nfp: fix resource leak for PF initialization
  net/nfp: fix resource leak for flower firmware
  net/nfp: fix resource leak for exit of CoreNIC firmware
  net/nfp: fix resource leak for exit of flower firmware
  net/nfp: fix resource leak for VF
  net/nfp: fix NFD3 metadata process
  net/nfp: fix NFDk metadata process

Chengwen Feng (17):
  eal: verify strdup return
  bus/dpaa: verify strdup return
  bus/fslmc: verify strdup return
  bus/vdev: verify strdup return
  dma/idxd: verify strdup return
  event/cnxk: verify strdup return
  net/failsafe: fix memory leak in args parsing
  net/nfp: verify strdup return
  app/dumpcap: verify strdup return
  app/pdump: verify strdup return
  app/crypto-perf: verify strdup return
  app/dma-perf: verify strdup return
  app/testpmd: verify strdup return
  test: verify strdup return
  examples/qos_sched: fix memory leak in args parsing
  examples/vhost: verify strdup return
  net/hns3: remove QinQ insert support for VF

Cristian Dumitrescu (1):
  net/softnic: fix include of log library

David Marchand (13):
  hash: remove some dead code
  regexdev: fix logtype register
  lib: use dedicated logtypes and macros
  lib: add newline in logs
  lib: remove redundant newline from logs
  dma/dpaa2: fix logtype register
  build: fix reasons conflict
  app/graph: fix build reason
  ci: update versions of actions in GHA
  vhost: fix virtqueue access check in datapath
  vhost: fix virtqueue access check in VDUSE setup
  vhost: fix virtqueue access check in vhost-user setup
  test/event: skip test if no driver is present

Dengdui Huang (8):
  net/hns3: refactor VF mailbox message struct
  net/hns3: refactor PF mailbox message struct
  net/hns3: refactor send mailbox function
  net/hns3: refactor handle mailbox function
  net/hns3: fix VF multiple count on one reset
  net/hns3: fix disable command with firmware
  net/hns3: fix reset level comparison
  app/testpmd: fix crash in multi-process forwarding

Edwin Brossette (1):
  net/virtio: remove duplicate queue xstats

Ferruh Yigit (8):
  pipeline: fix calloc parameters
  eventdev: fix calloc parameters
  dmadev: fix calloc parameters
  rawdev: fix calloc parameters
  common/mlx5: fix calloc parameters
  net/bnx2x: fix calloc parameters
  net/nfp: fix calloc parameters
  net/sfc: fix calloc parameters

Gowrishankar Muthukrishnan (1):
  crypto/cnxk: fix CN9K ECDH public key verification

Hanumanth Pothula (1):
  net/thunderx: fix DMAC control register update

Hao Chen (1):
  vhost: fix deadlock during vDPA SW live migration

Harman Kalra (2):
  common/cnxk: fix mbox region copy
  common/cnxk: fix VLAN check for inner header

Honnappa Nagarahalli (2):
  rcu: use atomic operation on acked token
  rcu: fix acked token in debug log

Jonathan Erb (1):
  telemetry: fix empty JSON dictionaries

Joyce Kong (1):
  net/memif: fix crash with Tx burst larger than 255

Kaiwen Deng (3):
  net/i40e: remove redundant judgment in flow parsing
  net/ice: fix tunnel TSO capabilities
  net: fix TCP/UDP checksum with padding data

Kalesh AP (3):
  net/bnxt: fix 50G and 100G forced speed
  net/bnxt: fix speed change from 200G to 25G on Thor
  net/bnxt: fix backward firmware compatibility

Kiran Kumar K (1):
  net/cnxk: fix flow RSS configuration

Kumara Parameshwaran (2):
  gro: fix reordering of packets
  app/testpmd: fix GRO packets flush on timeout

Long Li (3):
  net/mana: prevent values overflow returned from RDMA layer
  net/mana: fix memory leak on MR allocation
  net/mana: handle MR cache expansion failure

Long Wu (5):
  net/nfp: fix Rx memory leak
  net/nfp: fix Rx descriptor
  net/nfp: fix device close
  net/nfp: fix device resource freeing
  net/nfp: free switch domain ID on close

Maxime Coquelin (1):
  vhost: fix memory leak in Virtio Tx split path

Michael Baum (8):
  net/mlx5: fix jump action validation
  net/mlx5: fix flow tag modification
  net/mlx5/hws: fix ESP flow matching validation
  net/mlx5: fix GENEVE TLV option management
  common/mlx5: fix duplicate read of general capabilities
  common/mlx5: fix query sample info capability
  net/mlx5: remove GENEVE options length limitation
  net/mlx5: fix GENEVE option item translation

Mingjin Ye (1):
  net/iavf: fix no polling mode switching

Mário Kuka (1):
  net/bonding: fix flow count query

Neel Patel (1):
  net/ionic: fix missing volatile type for cqe pointers

Pavan Nikhilesh (2):
  event/cnxk: fix dequeue timeout configuration
  doc: fix commands in eventdev test tool guide

Qi Zhang (2):
  net/ice: fix link update
  net/ice: fix memory leaks

Robin Jarry (1):
  build: link static libs with whole-archive in subproject

Rongwei Liu (1):
  net/mlx5: fix stats query crash in secondary process

Rushil Gupta (1):
  net/gve: fix DQO for chained descriptors

Satheesh Paul (1):
  net/cnxk: fix aged flow query

Shaowei Sun (1):
  telemetry: fix connected clients count

Shiyang He (1):
  net/iavf: fix crash on VF start

Sivaprasad Tummala (1):
  eal/x86: add AMD vendor check for TSC calibration

Sivaramakrishnan Venkat (1):
  drivers/net: fix buffer overflow for packet types list

Stephen Hemminger (5):
  doc: remove cmdline polling mode deprecation notice
  cryptodev: remove unused extern variable
  doc: add --latencystats option in testpmd guide
  app/testpmd: hide --bitrate-stats in help if disabled
  common/sfc_efx/base: use C11 static assert

Suanming Mou (3):
  app/crypto-perf: fix next segment mbuf
  app/crypto-perf: fix data comparison
  app/crypto-perf: fix encrypt operation verification

Sunyang Wu (1):
  ethdev: fix NVGRE encap flow action description

Wathsala Vithanage (1):
  net/memif: fix extra mbuf refcnt update in zero copy Tx

Weiguo Li (1):
  net/bnxt: fix deadlock in ULP timer callback

Yajun Wu (1):
  vdpa/mlx5: fix queue enable drain CQ

Yunjian Wang (3):
  net/iavf: fix memory leak on security context error
  net/ixgbe: fix memoy leak after device init failure
  net/af_xdp: fix memzone leak on config failure

 .github/workflows/build.yml                   |  20 +-
 .mailmap                                      |   8 +-
 app/dumpcap/main.c                            |   5 +
 app/graph/meson.build                         |   1 +
 app/meson.build                               |   2 +-
 app/pdump/main.c                              |   3 +
 app/test-crypto-perf/cperf_options_parsing.c  |   4 +
 app/test-crypto-perf/cperf_test_common.c      |  15 +-
 app/test-crypto-perf/cperf_test_verify.c      |  59 +++--
 app/test-dma-perf/main.c                      |   2 +
 app/test-pmd/cmdline.c                        |   2 +
 app/test-pmd/config.c                         |   6 +-
 app/test-pmd/csumonly.c                       |  21 +-
 app/test-pmd/parameters.c                     |  10 +-
 app/test/process.h                            |   5 +-
 app/test/test_eventdev.c                      |  10 +-
 buildtools/dpdk-cmdline-gen.py                |   4 +-
 buildtools/subproject/meson.build             |   3 +-
 config/meson.build                            |   3 +
 doc/guides/rel_notes/deprecation.rst          |   4 -
 doc/guides/testpmd_app_ug/run_app.rst         |   4 +
 doc/guides/tools/testeventdev.rst             |  24 +-
 drivers/bus/dpaa/dpaa_bus.c                   |   4 +
 drivers/bus/fslmc/fslmc_bus.c                 |   4 +
 drivers/bus/vdev/vdev.c                       |   4 +
 drivers/common/cnxk/roc_cpt.c                 |   3 +-
 drivers/common/cnxk/roc_dev.c                 |   5 +-
 drivers/common/cnxk/roc_npc_aging.c           |   4 +
 drivers/common/cnxk/roc_npc_parse.c           |  10 +-
 drivers/common/mlx5/mlx5_common_mr.c          |   2 +-
 drivers/common/mlx5/mlx5_devx_cmds.c          |  24 +-
 drivers/common/mlx5/mlx5_devx_cmds.h          |   1 +
 drivers/common/qat/meson.build                |  10 +-
 drivers/common/sfc_efx/base/efx.h             |  14 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c      |  12 +-
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c        |   2 +-
 drivers/dma/dpaa2/dpaa2_qdma.c                |   5 +-
 drivers/dma/idxd/idxd_bus.c                   |  10 +-
 drivers/event/cnxk/cnxk_eventdev.c            |  16 +-
 drivers/meson.build                           |   4 +-
 drivers/ml/cnxk/cn10k_ml_ops.c                |  11 +
 drivers/net/af_xdp/rte_eth_af_xdp.c           |   2 +-
 drivers/net/bnx2x/bnx2x.c                     |   2 +-
 drivers/net/bnxt/bnxt.h                       |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                |  53 +++--
 drivers/net/bnxt/bnxt_hwrm.c                  |  25 +-
 drivers/net/bnxt/bnxt_reps.c                  |   6 +-
 drivers/net/bnxt/bnxt_txq.c                   |   6 +
 drivers/net/bnxt/bnxt_txq.h                   |   1 +
 drivers/net/bnxt/bnxt_txr.c                   |  13 +
 drivers/net/bnxt/bnxt_txr.h                   |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c          |   1 +
 drivers/net/bonding/rte_eth_bond_flow.c       |   6 +
 drivers/net/cnxk/cnxk_flow.c                  |  18 +-
 drivers/net/dpaa/dpaa_ethdev.c                |   3 +-
 drivers/net/failsafe/failsafe_args.c          |   2 +-
 drivers/net/gve/gve_tx_dqo.c                  |  22 +-
 drivers/net/hns3/hns3_common.c                |   2 +-
 drivers/net/hns3/hns3_ethdev.c                |  30 +--
 drivers/net/hns3/hns3_ethdev_vf.c             | 225 ++++++++++--------
 drivers/net/hns3/hns3_mbx.c                   | 165 +++++++------
 drivers/net/hns3/hns3_mbx.h                   |  92 +++++--
 drivers/net/hns3/hns3_rxtx.c                  |  18 +-
 drivers/net/i40e/i40e_flow.c                  |   3 +-
 drivers/net/iavf/iavf.h                       |   6 +-
 drivers/net/iavf/iavf_ethdev.c                |  68 +++++-
 drivers/net/iavf/iavf_ipsec_crypto.c          |   5 +-
 drivers/net/iavf/iavf_vchnl.c                 |  24 +-
 drivers/net/ice/ice_ethdev.c                  |  32 ++-
 drivers/net/ice/ice_ethdev.h                  |   4 +
 drivers/net/ice/ice_rxtx_vec_common.h         |   4 +
 drivers/net/ice/ice_tm.c                      |  12 +
 drivers/net/ionic/ionic_ethdev.c              |  39 +--
 drivers/net/ionic/ionic_rxtx.c                |   4 +-
 drivers/net/ionic/ionic_rxtx_sg.c             |   8 +-
 drivers/net/ionic/ionic_rxtx_simple.c         |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |  17 +-
 drivers/net/mana/mana.c                       |  24 +-
 drivers/net/mana/mana.h                       |   6 +-
 drivers/net/mana/mr.c                         |  60 +++--
 drivers/net/memif/rte_eth_memif.c             |   8 +-
 drivers/net/mlx5/hws/mlx5dr_definer.c         |   5 -
 drivers/net/mlx5/linux/mlx5_os.c              |   8 +-
 drivers/net/mlx5/mlx5_flow_dv.c               |  59 ++---
 drivers/net/mvneta/mvneta_ethdev.c            |   3 +-
 drivers/net/mvpp2/mrvl_ethdev.c               |   3 +-
 drivers/net/netvsc/hn_rxtx.c                  |   8 +-
 drivers/net/nfp/flower/nfp_flower.c           |  78 ++----
 drivers/net/nfp/flower/nfp_flower.h           |   1 +
 .../net/nfp/flower/nfp_flower_representor.c   | 166 ++++++++++++-
 .../net/nfp/flower/nfp_flower_representor.h   |   1 +
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c            |  19 +-
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c            |  27 ++-
 drivers/net/nfp/nfp_ethdev.c                  | 135 ++++++++---
 drivers/net/nfp/nfp_ethdev_vf.c               |  10 +-
 drivers/net/nfp/nfp_ipsec.c                   |   5 +
 drivers/net/nfp/nfp_net_common.c              |   1 +
 drivers/net/nfp/nfp_net_common.h              |   1 +
 drivers/net/nfp/nfp_rxtx.c                    |  18 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c           |   2 +-
 drivers/net/pfe/pfe_ethdev.c                  |   3 +-
 drivers/net/sfc/sfc_mae.c                     |   4 +-
 drivers/net/softnic/rte_eth_softnic_cli.c     |   2 +
 drivers/net/tap/rte_eth_tap.c                 |   1 +
 drivers/net/thunderx/base/nicvf_mbox.c        |  12 +
 drivers/net/thunderx/base/nicvf_mbox.h        |  10 +
 drivers/net/thunderx/nicvf_ethdev.c           |  28 +++
 drivers/net/virtio/virtio_ethdev.c            |   2 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   4 +
 drivers/vdpa/mlx5/mlx5_vdpa_event.c           |  29 ++-
 examples/ipsec-secgw/ipsec-secgw.c            |   5 +-
 examples/ipsec-secgw/ipsec_worker.h           |   4 +-
 examples/pipeline/cli.c                       |   2 +
 examples/qos_sched/args.c                     |   4 +-
 examples/vhost/main.c                         |   3 +
 kernel/freebsd/nic_uio/nic_uio.c              |   8 +-
 lib/bbdev/rte_bbdev.c                         |   6 +-
 lib/cfgfile/rte_cfgfile.c                     |  14 +-
 lib/compressdev/rte_compressdev_pmd.c         |   4 +-
 lib/cryptodev/rte_cryptodev.c                 |   4 +-
 lib/cryptodev/rte_cryptodev.h                 |   2 -
 lib/dispatcher/rte_dispatcher.c               |  12 +-
 lib/dmadev/rte_dmadev.c                       |   4 +-
 lib/eal/common/eal_common_options.c           |  26 +-
 lib/eal/linux/eal_dev.c                       |   2 +
 lib/eal/linux/eal_hugepage_info.c             |   2 +-
 lib/eal/linux/eal_interrupts.c                |   2 +-
 lib/eal/windows/eal_memory.c                  |   2 +-
 lib/eal/x86/rte_cycles.c                      |  16 ++
 lib/ethdev/ethdev_driver.c                    |   4 +-
 lib/ethdev/ethdev_pci.h                       |   2 +-
 lib/ethdev/ethdev_private.c                   |   2 +-
 lib/ethdev/rte_class_eth.c                    |   2 +-
 lib/ethdev/rte_ethdev.c                       |  40 ++--
 lib/ethdev/rte_flow.c                         |   2 +-
 lib/ethdev/rte_flow.h                         |   2 +-
 lib/eventdev/eventdev_pmd.h                   |   6 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  12 +-
 lib/eventdev/rte_event_dma_adapter.c          |  18 +-
 lib/eventdev/rte_event_eth_rx_adapter.c       |  40 ++--
 lib/eventdev/rte_event_eth_tx_adapter.c       |   2 +-
 lib/eventdev/rte_event_timer_adapter.c        |   4 +-
 lib/eventdev/rte_eventdev.c                   |  12 +-
 lib/gro/gro_tcp.h                             |   9 +
 lib/gro/gro_tcp4.c                            |  36 ++-
 lib/gro/gro_tcp_internal.h                    |   2 +-
 lib/gro/gro_vxlan_tcp4.c                      |   5 +-
 lib/hash/rte_cuckoo_hash.h                    |  11 -
 lib/lpm/rte_lpm6.c                            |   6 +-
 lib/mempool/rte_mempool_ops.c                 |   2 +-
 lib/meson.build                               |   2 +-
 lib/metrics/rte_metrics_telemetry.c           |   2 +-
 lib/mldev/rte_mldev.c                         | 102 ++++----
 lib/net/rte_ether.h                           |  14 ++
 lib/net/rte_ip.h                              |  15 +-
 lib/net/rte_net_crc.c                         |   6 +-
 lib/node/ethdev_rx.c                          |   4 +-
 lib/node/ip4_lookup.c                         |   2 +-
 lib/node/ip6_lookup.c                         |   2 +-
 lib/node/kernel_rx.c                          |   8 +-
 lib/node/kernel_tx.c                          |   4 +-
 lib/pipeline/rte_swx_pipeline_spec.c          |   4 +-
 lib/power/guest_channel.c                     |   2 +-
 lib/power/rte_power_pmd_mgmt.c                |   6 +-
 lib/rawdev/rte_rawdev.c                       |   2 +-
 lib/rcu/rte_rcu_qsbr.c                        |   4 +-
 lib/rcu/rte_rcu_qsbr.h                        |  16 +-
 lib/regexdev/rte_regexdev.c                   |   2 +-
 lib/stack/rte_stack.c                         |   8 +-
 lib/telemetry/telemetry.c                     |  11 +-
 lib/vhost/vdpa.c                              |  11 +-
 lib/vhost/vduse.c                             |   4 +
 lib/vhost/vhost_crypto.c                      |   6 +-
 lib/vhost/vhost_user.c                        |   2 +
 lib/vhost/virtio_net.c                        |  84 ++++---
 meson.build                                   |   6 +-
 176 files changed, 1731 insertions(+), 978 deletions(-)

--
2.34.1

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'buildtools/cmdline: fix generated code for IP addresses' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'buildtools/cmdline: fix IP address initializer' " Xueming Li
                   ` (135 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Sunil Kumar Kori, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3cedd8b9e4617682700bc3a712edfb19964cd302

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3cedd8b9e4617682700bc3a712edfb19964cd302 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 5 Dec 2023 11:31:04 +0000
Subject: [PATCH] buildtools/cmdline: fix generated code for IP addresses
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a78b8f11dc1093cd1dc25bb4bcdde63b5dccb4ac ]

The C code generated for the tokens for matching IP addresses in
commandlines was missing the "static" prefix present in the output for
the other data-types.

Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")

Reported-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
---
 buildtools/dpdk-cmdline-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-gen.py
index 49b03bee4a..bf1253d949 100755
--- a/buildtools/dpdk-cmdline-gen.py
+++ b/buildtools/dpdk-cmdline-gen.py
@@ -71,7 +71,7 @@ def process_command(lineno, tokens, comment):
         elif t_type in ["IP", "IP_ADDR", "IPADDR"]:
             result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
             initializers.append(
-                f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
+                f"static cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
                 f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});"
             )
         elif t_type.startswith("(") and t_type.endswith(")"):
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.152339106 +0800
+++ 0001-buildtools-cmdline-fix-generated-code-for-IP-address.patch	2024-03-05 17:39:30.633566488 +0800
@@ -1 +1 @@
-From a78b8f11dc1093cd1dc25bb4bcdde63b5dccb4ac Mon Sep 17 00:00:00 2001
+From 3cedd8b9e4617682700bc3a712edfb19964cd302 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a78b8f11dc1093cd1dc25bb4bcdde63b5dccb4ac ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'buildtools/cmdline: fix IP address initializer' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
  2024-03-05  9:45 ` patch 'buildtools/cmdline: fix generated code for IP addresses' has " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'hash: remove some dead code' " Xueming Li
                   ` (134 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Sunil Kumar Kori, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2c512fe65af23d7d217d8bc5c30617962dfab289

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2c512fe65af23d7d217d8bc5c30617962dfab289 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 5 Dec 2023 14:51:08 +0000
Subject: [PATCH] buildtools/cmdline: fix IP address initializer
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7cd7850a888e5aa112062711107d9417570ca719 ]

The IP address type should be generic for both IPv4 and IPv6 and so use
the cmdline lib's TOKEN_IPADDR_INITIALIZER rather than
TOKEN_IPV4_INITIALIZER.

Fixes: 37666691e9ed ("buildtools: add a tool to generate cmdline boilerplate")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
---
 buildtools/dpdk-cmdline-gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-gen.py
index bf1253d949..30d32ac183 100755
--- a/buildtools/dpdk-cmdline-gen.py
+++ b/buildtools/dpdk-cmdline-gen.py
@@ -72,7 +72,7 @@ def process_command(lineno, tokens, comment):
             result_struct.append(f"\tcmdline_ipaddr_t {t_name};")
             initializers.append(
                 f"static cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n"
-                f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});"
+                f"\tTOKEN_IPADDR_INITIALIZER(struct cmd_{name}_result, {t_name});"
             )
         elif t_type.startswith("(") and t_type.endswith(")"):
             result_struct.append(f"\tcmdline_fixed_string_t {t_name};")
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.174017506 +0800
+++ 0002-buildtools-cmdline-fix-IP-address-initializer.patch	2024-03-05 17:39:30.633566488 +0800
@@ -1 +1 @@
-From 7cd7850a888e5aa112062711107d9417570ca719 Mon Sep 17 00:00:00 2001
+From 2c512fe65af23d7d217d8bc5c30617962dfab289 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7cd7850a888e5aa112062711107d9417570ca719 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'hash: remove some dead code' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
  2024-03-05  9:45 ` patch 'buildtools/cmdline: fix generated code for IP addresses' has " Xueming Li
  2024-03-05  9:45 ` patch 'buildtools/cmdline: fix IP address initializer' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'regexdev: fix logtype register' " Xueming Li
                   ` (133 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand
  Cc: Stephen Hemminger, Tyler Retzlaff, Ruifeng Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=dc0428a5e4734bc7fc73f2b8bf038813fd4b2e75

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dc0428a5e4734bc7fc73f2b8bf038813fd4b2e75 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 21 Nov 2023 16:24:23 +0100
Subject: [PATCH] hash: remove some dead code
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 25e3fe362b3ad7484750eb7134bfca8e3fab5703 ]

This macro is not used.

Fixes: 769b2de7fb52 ("hash: implement RCU resources reclamation")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/hash/rte_cuckoo_hash.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h
index f7afc4dd79..8ea793c66e 100644
--- a/lib/hash/rte_cuckoo_hash.h
+++ b/lib/hash/rte_cuckoo_hash.h
@@ -29,17 +29,6 @@
 #define RETURN_IF_TRUE(cond, retval)
 #endif

-#if defined(RTE_LIBRTE_HASH_DEBUG)
-#define ERR_IF_TRUE(cond, fmt, args...) do { \
-	if (cond) { \
-		RTE_LOG(ERR, HASH, fmt, ##args); \
-		return; \
-	} \
-} while (0)
-#else
-#define ERR_IF_TRUE(cond, fmt, args...)
-#endif
-
 #include <rte_hash_crc.h>
 #include <rte_jhash.h>

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.198667607 +0800
+++ 0003-hash-remove-some-dead-code.patch	2024-03-05 17:39:30.633566488 +0800
@@ -1 +1 @@
-From 25e3fe362b3ad7484750eb7134bfca8e3fab5703 Mon Sep 17 00:00:00 2001
+From dc0428a5e4734bc7fc73f2b8bf038813fd4b2e75 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 25e3fe362b3ad7484750eb7134bfca8e3fab5703 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'regexdev: fix logtype register' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (2 preceding siblings ...)
  2024-03-05  9:45 ` patch 'hash: remove some dead code' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'lib: use dedicated logtypes and macros' " Xueming Li
                   ` (132 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, Tyler Retzlaff, Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f1e3dec4b49c184049d6cbefd3f5ebfecd0d7025

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f1e3dec4b49c184049d6cbefd3f5ebfecd0d7025 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 7 Dec 2023 14:50:41 +0100
Subject: [PATCH] regexdev: fix logtype register
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6351bdeb975dcf4b00ae1319f1d901eb65d4d4d3 ]

This library logtype was not initialized so its logs would end up under
the 0 logtype, iow, RTE_LOGTYPE_EAL.

Fixes: b25246beaefc ("regexdev: add core functions")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 lib/regexdev/rte_regexdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c
index caec069182..d38a85eb0b 100644
--- a/lib/regexdev/rte_regexdev.c
+++ b/lib/regexdev/rte_regexdev.c
@@ -19,7 +19,7 @@ static struct {
 	struct rte_regexdev_data data[RTE_MAX_REGEXDEV_DEVS];
 } *rte_regexdev_shared_data;

-int rte_regexdev_logtype;
+RTE_LOG_REGISTER_DEFAULT(rte_regexdev_logtype, INFO);

 static uint16_t
 regexdev_find_free_dev(void)
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.222372108 +0800
+++ 0004-regexdev-fix-logtype-register.patch	2024-03-05 17:39:30.633566488 +0800
@@ -1 +1 @@
-From 6351bdeb975dcf4b00ae1319f1d901eb65d4d4d3 Mon Sep 17 00:00:00 2001
+From f1e3dec4b49c184049d6cbefd3f5ebfecd0d7025 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6351bdeb975dcf4b00ae1319f1d901eb65d4d4d3 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'lib: use dedicated logtypes and macros' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (3 preceding siblings ...)
  2024-03-05  9:45 ` patch 'regexdev: fix logtype register' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'lib: add newline in logs' " Xueming Li
                   ` (131 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand
  Cc: Stephen Hemminger, Tyler Retzlaff, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e421bcd7085615de38888ea6e4e3e064fe835b93

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e421bcd7085615de38888ea6e4e3e064fe835b93 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 6 Dec 2023 13:51:57 +0100
Subject: [PATCH] lib: use dedicated logtypes and macros
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c07da8e381ef860e972abd90400f134c64f3f77a ]

No printf!
When a dedicated log helper exists, use it.
And no usurpation please: a library should log under its logtype
(see the eventdev rx adapter update for example).

Note: the RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET macro is renamed for
consistency with the rest of eventdev (private) macros.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 lib/cryptodev/rte_cryptodev.c           |  2 +-
 lib/ethdev/ethdev_driver.c              |  4 ++--
 lib/ethdev/ethdev_private.c             |  2 +-
 lib/ethdev/rte_class_eth.c              |  2 +-
 lib/eventdev/rte_event_dma_adapter.c    |  4 ++--
 lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++++------
 lib/eventdev/rte_eventdev.c             |  6 +++---
 lib/mempool/rte_mempool_ops.c           |  2 +-
 8 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index b258827734..d8769f0b8d 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2682,7 +2682,7 @@ rte_cryptodev_driver_id_get(const char *name)
 	int driver_id = -1;

 	if (name == NULL) {
-		RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
+		CDEV_LOG_DEBUG("name pointer NULL");
 		return -1;
 	}

diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c
index fff4b7b4cd..55a9dcc565 100644
--- a/lib/ethdev/ethdev_driver.c
+++ b/lib/ethdev/ethdev_driver.c
@@ -487,7 +487,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)
 		pair = &args.pairs[i];
 		if (strcmp("representor", pair->key) == 0) {
 			if (eth_da->type != RTE_ETH_REPRESENTOR_NONE) {
-				RTE_LOG(ERR, EAL, "duplicated representor key: %s\n",
+				RTE_ETHDEV_LOG(ERR, "duplicated representor key: %s\n",
 					dargs);
 				result = -1;
 				goto parse_cleanup;
@@ -713,7 +713,7 @@ rte_eth_representor_id_get(uint16_t port_id,
 		if (info->ranges[i].controller != controller)
 			continue;
 		if (info->ranges[i].id_end < info->ranges[i].id_base) {
-			RTE_LOG(WARNING, EAL, "Port %hu invalid representor ID Range %u - %u, entry %d\n",
+			RTE_ETHDEV_LOG(WARNING, "Port %hu invalid representor ID Range %u - %u, entry %d\n",
 				port_id, info->ranges[i].id_base,
 				info->ranges[i].id_end, i);
 			continue;
diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c
index e98b7188b0..0e1c7b23c1 100644
--- a/lib/ethdev/ethdev_private.c
+++ b/lib/ethdev/ethdev_private.c
@@ -182,7 +182,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
 		RTE_DIM(eth_da->representor_ports));
 done:
 	if (str == NULL)
-		RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str);
+		RTE_ETHDEV_LOG(ERR, "wrong representor format: %s\n", str);
 	return str == NULL ? -1 : 0;
 }

diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c
index b61dae849d..311beb17cb 100644
--- a/lib/ethdev/rte_class_eth.c
+++ b/lib/ethdev/rte_class_eth.c
@@ -165,7 +165,7 @@ eth_dev_iterate(const void *start,
 			valid_keys = eth_params_keys;
 		kvargs = rte_kvargs_parse(str, valid_keys);
 		if (kvargs == NULL) {
-			RTE_LOG(ERR, EAL, "cannot parse argument list\n");
+			RTE_ETHDEV_LOG(ERR, "cannot parse argument list\n");
 			rte_errno = EINVAL;
 			return NULL;
 		}
diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c
index af4b5ad388..cbf9405438 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -1046,7 +1046,7 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan,
 							sizeof(struct dma_vchan_info),
 							0, adapter->socket_id);
 			if (dev_info->vchanq == NULL) {
-				printf("Queue pair add not supported\n");
+				RTE_EDEV_LOG_ERR("Queue pair add not supported");
 				return -ENOMEM;
 			}
 		}
@@ -1057,7 +1057,7 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan,
 						sizeof(struct dma_vchan_info),
 						0, adapter->socket_id);
 			if (dev_info->tqmap == NULL) {
-				printf("tq pair add not supported\n");
+				RTE_EDEV_LOG_ERR("tq pair add not supported");
 				return -ENOMEM;
 			}
 		}
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index 6db03adf04..82ae31712d 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -314,9 +314,9 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id,
 	} \
 } while (0)

-#define RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(port_id, retval) do { \
+#define RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(port_id, retval) do { \
 	if (!rte_eth_dev_is_valid_port(port_id)) { \
-		RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \
+		RTE_EDEV_LOG_ERR("Invalid port_id=%u", port_id); \
 		ret = retval; \
 		goto error; \
 	} \
@@ -3671,7 +3671,7 @@ handle_rxa_get_queue_conf(const char *cmd __rte_unused,

 	/* Get device ID from parameter string */
 	eth_dev_id = strtoul(token, NULL, 10);
-	RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);
+	RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);

 	token = strtok(NULL, ",");
 	RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1);
@@ -3743,7 +3743,7 @@ handle_rxa_get_queue_stats(const char *cmd __rte_unused,

 	/* Get device ID from parameter string */
 	eth_dev_id = strtoul(token, NULL, 10);
-	RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);
+	RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);

 	token = strtok(NULL, ",");
 	RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1);
@@ -3813,7 +3813,7 @@ handle_rxa_queue_stats_reset(const char *cmd __rte_unused,

 	/* Get device ID from parameter string */
 	eth_dev_id = strtoul(token, NULL, 10);
-	RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);
+	RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);

 	token = strtok(NULL, ",");
 	RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1);
@@ -3868,7 +3868,7 @@ handle_rxa_instance_get(const char *cmd __rte_unused,

 	/* Get device ID from parameter string */
 	eth_dev_id = strtoul(token, NULL, 10);
-	RTE_ETH_VALID_PORTID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);
+	RTE_EVENT_ETH_RX_ADAPTER_PORTID_VALID_OR_GOTO_ERR_RET(eth_dev_id, -EINVAL);

 	token = strtok(NULL, ",");
 	RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, -1);
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 0ca32d6721..ae50821a3f 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1428,8 +1428,8 @@ rte_event_vector_pool_create(const char *name, unsigned int n,
 	int ret;

 	if (!nb_elem) {
-		RTE_LOG(ERR, EVENTDEV,
-			"Invalid number of elements=%d requested\n", nb_elem);
+		RTE_EDEV_LOG_ERR("Invalid number of elements=%d requested",
+			nb_elem);
 		rte_errno = EINVAL;
 		return NULL;
 	}
@@ -1444,7 +1444,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n,
 	mp_ops_name = rte_mbuf_best_mempool_ops();
 	ret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL);
 	if (ret != 0) {
-		RTE_LOG(ERR, EVENTDEV, "error setting mempool handler\n");
+		RTE_EDEV_LOG_ERR("error setting mempool handler");
 		goto err;
 	}

diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c
index ae1d288f27..e871de9ec9 100644
--- a/lib/mempool/rte_mempool_ops.c
+++ b/lib/mempool/rte_mempool_ops.c
@@ -46,7 +46,7 @@ rte_mempool_register_ops(const struct rte_mempool_ops *h)

 	if (strlen(h->name) >= sizeof(ops->name) - 1) {
 		rte_spinlock_unlock(&rte_mempool_ops_table.sl);
-		RTE_LOG(DEBUG, EAL, "%s(): mempool_ops <%s>: name too long\n",
+		RTE_LOG(DEBUG, MEMPOOL, "%s(): mempool_ops <%s>: name too long\n",
 				__func__, h->name);
 		rte_errno = EEXIST;
 		return -EEXIST;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.244469409 +0800
+++ 0005-lib-use-dedicated-logtypes-and-macros.patch	2024-03-05 17:39:30.643566489 +0800
@@ -1 +1 @@
-From c07da8e381ef860e972abd90400f134c64f3f77a Mon Sep 17 00:00:00 2001
+From e421bcd7085615de38888ea6e4e3e064fe835b93 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c07da8e381ef860e972abd90400f134c64f3f77a ]
@@ -14,2 +16,0 @@
-Cc: stable@dpdk.org
-
@@ -32 +33 @@
-index 25e3ec12d1..ead8c9a623 100644
+index b258827734..d8769f0b8d 100644
@@ -35 +36 @@
-@@ -2684,7 +2684,7 @@ rte_cryptodev_driver_id_get(const char *name)
+@@ -2682,7 +2682,7 @@ rte_cryptodev_driver_id_get(const char *name)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'lib: add newline in logs' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (4 preceding siblings ...)
  2024-03-05  9:45 ` patch 'lib: use dedicated logtypes and macros' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'lib: remove redundant newline from " Xueming Li
                   ` (130 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand
  Cc: Stephen Hemminger, Tyler Retzlaff, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ec5e780f093f38199b82f76c0c6aef1155978f1d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ec5e780f093f38199b82f76c0c6aef1155978f1d Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 6 Dec 2023 11:59:59 +0100
Subject: [PATCH] lib: add newline in logs
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8e2407e46782d43f9a1d83d72e279a4f86389bcd ]

Fix places leading to a log message not terminated with a newline.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 lib/eal/common/eal_common_options.c |  2 +-
 lib/eal/linux/eal_hugepage_info.c   |  2 +-
 lib/eal/linux/eal_interrupts.c      |  2 +-
 lib/ethdev/ethdev_pci.h             |  2 +-
 lib/ethdev/rte_ethdev.c             | 40 ++++++++++++++---------------
 lib/lpm/rte_lpm6.c                  |  6 ++---
 lib/power/guest_channel.c           |  2 +-
 lib/power/rte_power_pmd_mgmt.c      |  6 ++---
 8 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index a6d21f1cba..e9ba01fb89 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -2141,7 +2141,7 @@ rte_vect_set_max_simd_bitwidth(uint16_t bitwidth)
 	struct internal_config *internal_conf =
 		eal_get_internal_configuration();
 	if (internal_conf->max_simd_bitwidth.forced) {
-		RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled");
+		RTE_LOG(NOTICE, EAL, "Cannot set max SIMD bitwidth - user runtime override enabled\n");
 		return -EPERM;
 	}

diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index 581d9dfc91..36a495fb1f 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -403,7 +403,7 @@ inspect_hugedir_cb(const struct walk_hugedir_data *whd)
 	struct stat st;

 	if (fstat(whd->file_fd, &st) < 0)
-		RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s",
+		RTE_LOG(DEBUG, EAL, "%s(): stat(\"%s\") failed: %s\n",
 				__func__, whd->file_name, strerror(errno));
 	else
 		(*total_size) += st.st_size;
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index d4919dff45..eabac24992 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1542,7 +1542,7 @@ rte_intr_efd_enable(struct rte_intr_handle *intr_handle, uint32_t nb_efd)
 		/* only check, initialization would be done in vdev driver.*/
 		if ((uint64_t)rte_intr_efd_counter_size_get(intr_handle) >
 		    sizeof(union rte_intr_read_buffer)) {
-			RTE_LOG(ERR, EAL, "the efd_counter_size is oversized");
+			RTE_LOG(ERR, EAL, "the efd_counter_size is oversized\n");
 			return -EINVAL;
 		}
 	} else {
diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h
index 320e3e0093..ddb559aa95 100644
--- a/lib/ethdev/ethdev_pci.h
+++ b/lib/ethdev/ethdev_pci.h
@@ -31,7 +31,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
 	struct rte_pci_device *pci_dev)
 {
 	if ((eth_dev == NULL) || (pci_dev == NULL)) {
-		RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p",
+		RTE_ETHDEV_LOG(ERR, "NULL pointer eth_dev=%p pci_dev=%p\n",
 			(void *)eth_dev, (void *)pci_dev);
 		return;
 	}
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 3858983fcc..b9d99ece15 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -724,7 +724,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)
 	uint16_t pid;

 	if (name == NULL) {
-		RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name");
+		RTE_ETHDEV_LOG(ERR, "Cannot get port ID from NULL name\n");
 		return -EINVAL;
 	}

@@ -2394,41 +2394,41 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 		nb_rx_desc = cap.max_nb_desc;
 	if (nb_rx_desc > cap.max_nb_desc) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu",
+			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu\n",
 			nb_rx_desc, cap.max_nb_desc);
 		return -EINVAL;
 	}
 	if (conf->peer_count > cap.max_rx_2_tx) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for number of peers for Rx queue(=%u), should be: <= %hu",
+			"Invalid value for number of peers for Rx queue(=%u), should be: <= %hu\n",
 			conf->peer_count, cap.max_rx_2_tx);
 		return -EINVAL;
 	}
 	if (conf->use_locked_device_memory && !cap.rx_cap.locked_device_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use locked device memory for Rx queue, which is not supported");
+			"Attempt to use locked device memory for Rx queue, which is not supported\n");
 		return -EINVAL;
 	}
 	if (conf->use_rte_memory && !cap.rx_cap.rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use DPDK memory for Rx queue, which is not supported");
+			"Attempt to use DPDK memory for Rx queue, which is not supported\n");
 		return -EINVAL;
 	}
 	if (conf->use_locked_device_memory && conf->use_rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use mutually exclusive memory settings for Rx queue");
+			"Attempt to use mutually exclusive memory settings for Rx queue\n");
 		return -EINVAL;
 	}
 	if (conf->force_memory &&
 	    !conf->use_locked_device_memory &&
 	    !conf->use_rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to force Rx queue memory settings, but none is set");
+			"Attempt to force Rx queue memory settings, but none is set\n");
 		return -EINVAL;
 	}
 	if (conf->peer_count == 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for number of peers for Rx queue(=%u), should be: > 0",
+			"Invalid value for number of peers for Rx queue(=%u), should be: > 0\n",
 			conf->peer_count);
 		return -EINVAL;
 	}
@@ -2438,7 +2438,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 			count++;
 	}
 	if (count > cap.max_nb_queues) {
-		RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d",
+		RTE_ETHDEV_LOG(ERR, "To many Rx hairpin queues max is %d\n",
 		cap.max_nb_queues);
 		return -EINVAL;
 	}
@@ -2597,41 +2597,41 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 		nb_tx_desc = cap.max_nb_desc;
 	if (nb_tx_desc > cap.max_nb_desc) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for nb_tx_desc(=%hu), should be: <= %hu",
+			"Invalid value for nb_tx_desc(=%hu), should be: <= %hu\n",
 			nb_tx_desc, cap.max_nb_desc);
 		return -EINVAL;
 	}
 	if (conf->peer_count > cap.max_tx_2_rx) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for number of peers for Tx queue(=%u), should be: <= %hu",
+			"Invalid value for number of peers for Tx queue(=%u), should be: <= %hu\n",
 			conf->peer_count, cap.max_tx_2_rx);
 		return -EINVAL;
 	}
 	if (conf->use_locked_device_memory && !cap.tx_cap.locked_device_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use locked device memory for Tx queue, which is not supported");
+			"Attempt to use locked device memory for Tx queue, which is not supported\n");
 		return -EINVAL;
 	}
 	if (conf->use_rte_memory && !cap.tx_cap.rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use DPDK memory for Tx queue, which is not supported");
+			"Attempt to use DPDK memory for Tx queue, which is not supported\n");
 		return -EINVAL;
 	}
 	if (conf->use_locked_device_memory && conf->use_rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to use mutually exclusive memory settings for Tx queue");
+			"Attempt to use mutually exclusive memory settings for Tx queue\n");
 		return -EINVAL;
 	}
 	if (conf->force_memory &&
 	    !conf->use_locked_device_memory &&
 	    !conf->use_rte_memory) {
 		RTE_ETHDEV_LOG(ERR,
-			"Attempt to force Tx queue memory settings, but none is set");
+			"Attempt to force Tx queue memory settings, but none is set\n");
 		return -EINVAL;
 	}
 	if (conf->peer_count == 0) {
 		RTE_ETHDEV_LOG(ERR,
-			"Invalid value for number of peers for Tx queue(=%u), should be: > 0",
+			"Invalid value for number of peers for Tx queue(=%u), should be: > 0\n",
 			conf->peer_count);
 		return -EINVAL;
 	}
@@ -2641,7 +2641,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
 			count++;
 	}
 	if (count > cap.max_nb_queues) {
-		RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d",
+		RTE_ETHDEV_LOG(ERR, "To many Tx hairpin queues max is %d\n",
 		cap.max_nb_queues);
 		return -EINVAL;
 	}
@@ -6716,7 +6716,7 @@ rte_eth_ip_reassembly_capability_get(uint16_t port_id,
 	}

 	if (reassembly_capa == NULL) {
-		RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL");
+		RTE_ETHDEV_LOG(ERR, "Cannot get reassembly capability to NULL\n");
 		return -EINVAL;
 	}

@@ -6752,7 +6752,7 @@ rte_eth_ip_reassembly_conf_get(uint16_t port_id,
 	}

 	if (conf == NULL) {
-		RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL");
+		RTE_ETHDEV_LOG(ERR, "Cannot get reassembly info to NULL\n");
 		return -EINVAL;
 	}

@@ -6780,7 +6780,7 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id,
 	if (dev->data->dev_configured == 0) {
 		RTE_ETHDEV_LOG(ERR,
 			"Device with port_id=%u is not configured.\n"
-			"Cannot set IP reassembly configuration",
+			"Cannot set IP reassembly configuration\n",
 			port_id);
 		return -EINVAL;
 	}
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 8d21aeddb8..79c75d8dfc 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -279,7 +279,7 @@ rte_lpm6_create(const char *name, int socket_id,

 	rules_tbl = rte_hash_create(&rule_hash_tbl_params);
 	if (rules_tbl == NULL) {
-		RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)",
+		RTE_LOG(ERR, LPM, "LPM rules hash table allocation failed: %s (%d)\n",
 				  rte_strerror(rte_errno), rte_errno);
 		goto fail_wo_unlock;
 	}
@@ -289,7 +289,7 @@ rte_lpm6_create(const char *name, int socket_id,
 			sizeof(uint32_t) * config->number_tbl8s,
 			RTE_CACHE_LINE_SIZE);
 	if (tbl8_pool == NULL) {
-		RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)",
+		RTE_LOG(ERR, LPM, "LPM tbl8 pool allocation failed: %s (%d)\n",
 				  rte_strerror(rte_errno), rte_errno);
 		rte_errno = ENOMEM;
 		goto fail_wo_unlock;
@@ -300,7 +300,7 @@ rte_lpm6_create(const char *name, int socket_id,
 			sizeof(struct rte_lpm_tbl8_hdr) * config->number_tbl8s,
 			RTE_CACHE_LINE_SIZE);
 	if (tbl8_hdrs == NULL) {
-		RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)",
+		RTE_LOG(ERR, LPM, "LPM tbl8 headers allocation failed: %s (%d)\n",
 				  rte_strerror(rte_errno), rte_errno);
 		rte_errno = ENOMEM;
 		goto fail_wo_unlock;
diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c
index 7b2ae0b650..c964332011 100644
--- a/lib/power/guest_channel.c
+++ b/lib/power/guest_channel.c
@@ -89,7 +89,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
 	flags |= O_NONBLOCK;
 	if (fcntl(fd, F_SETFL, flags) < 0) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Failed on setting non-blocking mode for "
-				"file %s", fd_path);
+				"file %s\n", fd_path);
 		goto error;
 	}
 	/* QEMU needs a delay after connection */
diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c
index 38f8384085..6f18ed0adf 100644
--- a/lib/power/rte_power_pmd_mgmt.c
+++ b/lib/power/rte_power_pmd_mgmt.c
@@ -686,7 +686,7 @@ int
 rte_power_pmd_mgmt_set_pause_duration(unsigned int duration)
 {
 	if (duration == 0) {
-		RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged");
+		RTE_LOG(ERR, POWER, "Pause duration must be greater than 0, value unchanged\n");
 		return -EINVAL;
 	}
 	pause_duration = duration;
@@ -709,7 +709,7 @@ rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min)
 	}

 	if (min > scale_freq_max[lcore]) {
-		RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency");
+		RTE_LOG(ERR, POWER, "Invalid min frequency: Cannot be greater than max frequency\n");
 		return -EINVAL;
 	}
 	scale_freq_min[lcore] = min;
@@ -729,7 +729,7 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max)
 	if (max == 0)
 		max = UINT32_MAX;
 	if (max < scale_freq_min[lcore]) {
-		RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency");
+		RTE_LOG(ERR, POWER, "Invalid max frequency: Cannot be less than min frequency\n");
 		return -EINVAL;
 	}

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.290195810 +0800
+++ 0006-lib-add-newline-in-logs.patch	2024-03-05 17:39:30.653566489 +0800
@@ -1 +1 @@
-From 8e2407e46782d43f9a1d83d72e279a4f86389bcd Mon Sep 17 00:00:00 2001
+From ec5e780f093f38199b82f76c0c6aef1155978f1d Mon Sep 17 00:00:00 2001
@@ -4,0 +5 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -6 +7 @@
-Fix places leading to a log message not terminated with a newline.
+[ upstream commit 8e2407e46782d43f9a1d83d72e279a4f86389bcd ]
@@ -8 +9 @@
-Cc: stable@dpdk.org
+Fix places leading to a log message not terminated with a newline.
@@ -234 +235 @@
-index 873cc8bc26..24ce7dd022 100644
+index 8d21aeddb8..79c75d8dfc 100644
@@ -237 +238 @@
-@@ -280,7 +280,7 @@ rte_lpm6_create(const char *name, int socket_id,
+@@ -279,7 +279,7 @@ rte_lpm6_create(const char *name, int socket_id,
@@ -246 +247 @@
-@@ -290,7 +290,7 @@ rte_lpm6_create(const char *name, int socket_id,
+@@ -289,7 +289,7 @@ rte_lpm6_create(const char *name, int socket_id,
@@ -255 +256 @@
-@@ -301,7 +301,7 @@ rte_lpm6_create(const char *name, int socket_id,
+@@ -300,7 +300,7 @@ rte_lpm6_create(const char *name, int socket_id,
@@ -265 +266 @@
-index cc05347425..a6f2097d5b 100644
+index 7b2ae0b650..c964332011 100644
@@ -268 +269 @@
-@@ -90,7 +90,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
+@@ -89,7 +89,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'lib: remove redundant newline from logs' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (5 preceding siblings ...)
  2024-03-05  9:45 ` patch 'lib: add newline in logs' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'dma/dpaa2: fix logtype register' " Xueming Li
                   ` (129 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand
  Cc: Stephen Hemminger, Chengwen Feng, Mattias Rönnblom, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fd6f07da946292d1637b7fd4ae42fd08d2c5bb84

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fd6f07da946292d1637b7fd4ae42fd08d2c5bb84 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 17 Nov 2023 14:18:22 +0100
Subject: [PATCH] lib: remove redundant newline from logs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ae282b0611c33aa73a01ee6137d116155053b835 ]

Fix places where two newline characters may be logged.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c  |   2 +-
 lib/bbdev/rte_bbdev.c                   |   6 +-
 lib/cfgfile/rte_cfgfile.c               |  14 ++--
 lib/compressdev/rte_compressdev_pmd.c   |   4 +-
 lib/cryptodev/rte_cryptodev.c           |   2 +-
 lib/dispatcher/rte_dispatcher.c         |  12 +--
 lib/dmadev/rte_dmadev.c                 |   2 +-
 lib/eal/windows/eal_memory.c            |   2 +-
 lib/eventdev/eventdev_pmd.h             |   6 +-
 lib/eventdev/rte_event_crypto_adapter.c |  12 +--
 lib/eventdev/rte_event_dma_adapter.c    |  14 ++--
 lib/eventdev/rte_event_eth_rx_adapter.c |  28 +++----
 lib/eventdev/rte_event_eth_tx_adapter.c |   2 +-
 lib/eventdev/rte_event_timer_adapter.c  |   4 +-
 lib/eventdev/rte_eventdev.c             |   4 +-
 lib/metrics/rte_metrics_telemetry.c     |   2 +-
 lib/mldev/rte_mldev.c                   | 102 ++++++++++++------------
 lib/net/rte_net_crc.c                   |   6 +-
 lib/node/ethdev_rx.c                    |   4 +-
 lib/node/ip4_lookup.c                   |   2 +-
 lib/node/ip6_lookup.c                   |   2 +-
 lib/node/kernel_rx.c                    |   8 +-
 lib/node/kernel_tx.c                    |   4 +-
 lib/rcu/rte_rcu_qsbr.c                  |   4 +-
 lib/rcu/rte_rcu_qsbr.h                  |   8 +-
 lib/stack/rte_stack.c                   |   8 +-
 lib/vhost/vhost_crypto.c                |   6 +-
 27 files changed, 135 insertions(+), 135 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
index 30f919cd40..2a5599b7d8 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
@@ -406,7 +406,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer)
 		resp_param->result = ipsec_mb_qp_release(dev, qp_id);
 		break;
 	default:
-		CDEV_LOG_ERR("invalid mp request type\n");
+		CDEV_LOG_ERR("invalid mp request type");
 	}

 out:
diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
index cfebea09c7..e09bb97abb 100644
--- a/lib/bbdev/rte_bbdev.c
+++ b/lib/bbdev/rte_bbdev.c
@@ -1106,12 +1106,12 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op,

 	intr_handle = dev->intr_handle;
 	if (intr_handle == NULL) {
-		rte_bbdev_log(ERR, "Device %u intr handle unset\n", dev_id);
+		rte_bbdev_log(ERR, "Device %u intr handle unset", dev_id);
 		return -ENOTSUP;
 	}

 	if (queue_id >= RTE_MAX_RXTX_INTR_VEC_ID) {
-		rte_bbdev_log(ERR, "Device %u queue_id %u is too big\n",
+		rte_bbdev_log(ERR, "Device %u queue_id %u is too big",
 				dev_id, queue_id);
 		return -ENOTSUP;
 	}
@@ -1120,7 +1120,7 @@ rte_bbdev_queue_intr_ctl(uint16_t dev_id, uint16_t queue_id, int epfd, int op,
 	ret = rte_intr_rx_ctl(intr_handle, epfd, op, vec, data);
 	if (ret && (ret != -EEXIST)) {
 		rte_bbdev_log(ERR,
-				"dev %u q %u int ctl error op %d epfd %d vec %u\n",
+				"dev %u q %u int ctl error op %d epfd %d vec %u",
 				dev_id, queue_id, op, epfd, vec);
 		return ret;
 	}
diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c
index eefba6e408..2f9cc0722a 100644
--- a/lib/cfgfile/rte_cfgfile.c
+++ b/lib/cfgfile/rte_cfgfile.c
@@ -137,7 +137,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params)
 	unsigned int i;

 	if (!params) {
-		CFG_LOG(ERR, "missing cfgfile parameters\n");
+		CFG_LOG(ERR, "missing cfgfile parameters");
 		return -EINVAL;
 	}

@@ -150,7 +150,7 @@ rte_cfgfile_check_params(const struct rte_cfgfile_parameters *params)
 	}

 	if (valid_comment == 0)	{
-		CFG_LOG(ERR, "invalid comment characters %c\n",
+		CFG_LOG(ERR, "invalid comment characters %c",
 		       params->comment_character);
 		return -ENOTSUP;
 	}
@@ -188,7 +188,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 		lineno++;
 		if ((len >= sizeof(buffer) - 1) && (buffer[len-1] != '\n')) {
 			CFG_LOG(ERR, " line %d - no \\n found on string. "
-					"Check if line too long\n", lineno);
+					"Check if line too long", lineno);
 			goto error1;
 		}
 		/* skip parsing if comment character found */
@@ -209,7 +209,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 			char *end = memchr(buffer, ']', len);
 			if (end == NULL) {
 				CFG_LOG(ERR,
-					"line %d - no terminating ']' character found\n",
+					"line %d - no terminating ']' character found",
 					lineno);
 				goto error1;
 			}
@@ -225,7 +225,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 			split[1] = memchr(buffer, '=', len);
 			if (split[1] == NULL) {
 				CFG_LOG(ERR,
-					"line %d - no '=' character found\n",
+					"line %d - no '=' character found",
 					lineno);
 				goto error1;
 			}
@@ -249,7 +249,7 @@ rte_cfgfile_load_with_params(const char *filename, int flags,
 			if (!(flags & CFG_FLAG_EMPTY_VALUES) &&
 					(*split[1] == '\0')) {
 				CFG_LOG(ERR,
-					"line %d - cannot use empty values\n",
+					"line %d - cannot use empty values",
 					lineno);
 				goto error1;
 			}
@@ -414,7 +414,7 @@ int rte_cfgfile_set_entry(struct rte_cfgfile *cfg, const char *sectionname,
 			return 0;
 		}

-	CFG_LOG(ERR, "entry name doesn't exist\n");
+	CFG_LOG(ERR, "entry name doesn't exist");
 	return -EINVAL;
 }

diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c
index 156bccd972..762b44f03e 100644
--- a/lib/compressdev/rte_compressdev_pmd.c
+++ b/lib/compressdev/rte_compressdev_pmd.c
@@ -100,12 +100,12 @@ rte_compressdev_pmd_create(const char *name,
 	struct rte_compressdev *compressdev;

 	if (params->name[0] != '\0') {
-		COMPRESSDEV_LOG(INFO, "User specified device name = %s\n",
+		COMPRESSDEV_LOG(INFO, "User specified device name = %s",
 				params->name);
 		name = params->name;
 	}

-	COMPRESSDEV_LOG(INFO, "Creating compressdev %s\n", name);
+	COMPRESSDEV_LOG(INFO, "Creating compressdev %s", name);

 	COMPRESSDEV_LOG(INFO, "Init parameters - name: %s, socket id: %d",
 			name, params->socket_id);
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index d8769f0b8d..a3a8fc9c07 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2072,7 +2072,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id,
 	}

 	if (xforms == NULL) {
-		CDEV_LOG_ERR("Invalid xform\n");
+		CDEV_LOG_ERR("Invalid xform");
 		rte_errno = EINVAL;
 		return NULL;
 	}
diff --git a/lib/dispatcher/rte_dispatcher.c b/lib/dispatcher/rte_dispatcher.c
index 10d02edde9..95dd41b818 100644
--- a/lib/dispatcher/rte_dispatcher.c
+++ b/lib/dispatcher/rte_dispatcher.c
@@ -246,7 +246,7 @@ evd_service_register(struct rte_dispatcher *dispatcher)
 	rc = rte_service_component_register(&service, &dispatcher->service_id);
 	if (rc != 0)
 		RTE_EDEV_LOG_ERR("Registration of dispatcher service "
-				 "%s failed with error code %d\n",
+				 "%s failed with error code %d",
 				 service.name, rc);

 	return rc;
@@ -260,7 +260,7 @@ evd_service_unregister(struct rte_dispatcher *dispatcher)
 	rc = rte_service_component_unregister(dispatcher->service_id);
 	if (rc != 0)
 		RTE_EDEV_LOG_ERR("Unregistration of dispatcher service "
-				 "failed with error code %d\n", rc);
+				 "failed with error code %d", rc);

 	return rc;
 }
@@ -279,7 +279,7 @@ rte_dispatcher_create(uint8_t event_dev_id)
 				  RTE_CACHE_LINE_SIZE, socket_id);

 	if (dispatcher == NULL) {
-		RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher\n");
+		RTE_EDEV_LOG_ERR("Unable to allocate memory for dispatcher");
 		rte_errno = ENOMEM;
 		return NULL;
 	}
@@ -483,7 +483,7 @@ evd_lcore_uninstall_handler(struct rte_dispatcher_lcore *lcore,
 	unreg_handler = evd_lcore_get_handler_by_id(lcore, handler_id);

 	if (unreg_handler == NULL) {
-		RTE_EDEV_LOG_ERR("Invalid handler id %d\n", handler_id);
+		RTE_EDEV_LOG_ERR("Invalid handler id %d", handler_id);
 		return -EINVAL;
 	}

@@ -602,7 +602,7 @@ rte_dispatcher_finalize_unregister(struct rte_dispatcher *dispatcher,
 	unreg_finalizer = evd_get_finalizer_by_id(dispatcher, finalizer_id);

 	if (unreg_finalizer == NULL) {
-		RTE_EDEV_LOG_ERR("Invalid finalizer id %d\n", finalizer_id);
+		RTE_EDEV_LOG_ERR("Invalid finalizer id %d", finalizer_id);
 		return -EINVAL;
 	}

@@ -636,7 +636,7 @@ evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state)
 	 */
 	if (rc != 0)
 		RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting "
-				 "service component run state to %d\n", rc,
+				 "service component run state to %d", rc,
 				 state);

 	RTE_VERIFY(rc == 0);
diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index 4e5e420c82..009a21849a 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -726,7 +726,7 @@ rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *
 		return -EINVAL;

 	if (vchan >= dev->data->dev_conf.nb_vchans) {
-		RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan);
+		RTE_DMA_LOG(ERR, "Device %u vchan %u out of range", dev_id, vchan);
 		return -EINVAL;
 	}

diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c
index 31410a41fd..fd39155163 100644
--- a/lib/eal/windows/eal_memory.c
+++ b/lib/eal/windows/eal_memory.c
@@ -110,7 +110,7 @@ eal_mem_win32api_init(void)
 	VirtualAlloc2_ptr = (VirtualAlloc2_type)(
 		(void *)GetProcAddress(library, function));
 	if (VirtualAlloc2_ptr == NULL) {
-		RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")\n",
+		RTE_LOG_WIN32_ERR("GetProcAddress(\"%s\", \"%s\")",
 			library_name, function);

 		/* Contrary to the docs, Server 2016 is not supported. */
diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
index 30bd90085c..2ec5aec0a8 100644
--- a/lib/eventdev/eventdev_pmd.h
+++ b/lib/eventdev/eventdev_pmd.h
@@ -49,14 +49,14 @@ extern "C" {
 /* Macros to check for valid device */
 #define RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, retval) do { \
 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
-		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \
 		return retval; \
 	} \
 } while (0)

 #define RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, errno, retval) do { \
 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
-		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \
 		rte_errno = errno; \
 		return retval; \
 	} \
@@ -64,7 +64,7 @@ extern "C" {

 #define RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id) do { \
 	if (!rte_event_pmd_is_valid_dev((dev_id))) { \
-		RTE_EDEV_LOG_ERR("Invalid dev_id=%d\n", dev_id); \
+		RTE_EDEV_LOG_ERR("Invalid dev_id=%d", dev_id); \
 		return; \
 	} \
 } while (0)
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 1b435c9f0e..d46595d190 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -133,7 +133,7 @@ static struct event_crypto_adapter **event_crypto_adapter;
 /* Macros to check for valid adapter */
 #define EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \
 	if (!eca_valid_id(id)) { \
-		RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d\n", id); \
+		RTE_EDEV_LOG_ERR("Invalid crypto adapter id = %d", id); \
 		return retval; \
 	} \
 } while (0)
@@ -309,7 +309,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id,

 	ret = rte_event_dev_configure(dev_id, &dev_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", dev_id);
+		RTE_EDEV_LOG_ERR("failed to configure event dev %u", dev_id);
 		if (started) {
 			if (rte_event_dev_start(dev_id))
 				return -EIO;
@@ -319,7 +319,7 @@ eca_default_config_cb(uint8_t id, uint8_t dev_id,

 	ret = rte_event_port_setup(dev_id, port_id, port_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("failed to setup event port %u\n", port_id);
+		RTE_EDEV_LOG_ERR("failed to setup event port %u", port_id);
 		return ret;
 	}

@@ -391,7 +391,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,
 					sizeof(struct crypto_device_info), 0,
 					socket_id);
 	if (adapter->cdevs == NULL) {
-		RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices\n");
+		RTE_EDEV_LOG_ERR("Failed to get mem for crypto devices");
 		eca_circular_buffer_free(&adapter->ebuf);
 		rte_free(adapter);
 		return -ENOMEM;
@@ -1403,7 +1403,7 @@ rte_event_crypto_adapter_runtime_params_set(uint8_t id,
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);

 	if (params == NULL) {
-		RTE_EDEV_LOG_ERR("params pointer is NULL\n");
+		RTE_EDEV_LOG_ERR("params pointer is NULL");
 		return -EINVAL;
 	}

@@ -1436,7 +1436,7 @@ rte_event_crypto_adapter_runtime_params_get(uint8_t id,
 	EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);

 	if (params == NULL) {
-		RTE_EDEV_LOG_ERR("params pointer is NULL\n");
+		RTE_EDEV_LOG_ERR("params pointer is NULL");
 		return -EINVAL;
 	}

diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c
index cbf9405438..4196164305 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -20,7 +20,7 @@
 #define EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \
 	do { \
 		if (!edma_adapter_valid_id(id)) { \
-			RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d\n", id); \
+			RTE_EDEV_LOG_ERR("Invalid DMA adapter id = %d", id); \
 			return retval; \
 		} \
 	} while (0)
@@ -313,7 +313,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte

 	ret = rte_event_dev_configure(evdev_id, &dev_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("Failed to configure event dev %u\n", evdev_id);
+		RTE_EDEV_LOG_ERR("Failed to configure event dev %u", evdev_id);
 		if (started) {
 			if (rte_event_dev_start(evdev_id))
 				return -EIO;
@@ -323,7 +323,7 @@ edma_default_config_cb(uint8_t id, uint8_t evdev_id, struct rte_event_dma_adapte

 	ret = rte_event_port_setup(evdev_id, port_id, port_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("Failed to setup event port %u\n", port_id);
+		RTE_EDEV_LOG_ERR("Failed to setup event port %u", port_id);
 		return ret;
 	}

@@ -407,7 +407,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id,
 					       num_dma_dev * sizeof(struct dma_device_info), 0,
 					       socket_id);
 	if (adapter->dma_devs == NULL) {
-		RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices\n");
+		RTE_EDEV_LOG_ERR("Failed to get memory for DMA devices");
 		edma_circular_buffer_free(&adapter->ebuf);
 		rte_free(adapter);
 		return -ENOMEM;
@@ -417,7 +417,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id,
 	for (i = 0; i < num_dma_dev; i++) {
 		ret = rte_dma_info_get(i, &info);
 		if (ret) {
-			RTE_EDEV_LOG_ERR("Failed to get dma device info\n");
+			RTE_EDEV_LOG_ERR("Failed to get dma device info");
 			edma_circular_buffer_free(&adapter->ebuf);
 			rte_free(adapter);
 			return ret;
@@ -1297,7 +1297,7 @@ rte_event_dma_adapter_runtime_params_set(uint8_t id,
 	EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);

 	if (params == NULL) {
-		RTE_EDEV_LOG_ERR("params pointer is NULL\n");
+		RTE_EDEV_LOG_ERR("params pointer is NULL");
 		return -EINVAL;
 	}

@@ -1326,7 +1326,7 @@ rte_event_dma_adapter_runtime_params_get(uint8_t id,
 	EVENT_DMA_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);

 	if (params == NULL) {
-		RTE_EDEV_LOG_ERR("params pointer is NULL\n");
+		RTE_EDEV_LOG_ERR("params pointer is NULL");
 		return -EINVAL;
 	}

diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index 82ae31712d..1b83a55b5c 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -293,14 +293,14 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id,

 #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) do { \
 	if (!rxa_validate_id(id)) { \
-		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \
+		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \
 		return retval; \
 	} \
 } while (0)

 #define RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_GOTO_ERR_RET(id, retval) do { \
 	if (!rxa_validate_id(id)) { \
-		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d\n", id); \
+		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter id = %d", id); \
 		ret = retval; \
 		goto error; \
 	} \
@@ -308,7 +308,7 @@ rxa_event_buf_get(struct event_eth_rx_adapter *rx_adapter, uint16_t eth_dev_id,

 #define RTE_EVENT_ETH_RX_ADAPTER_TOKEN_VALID_OR_GOTO_ERR_RET(token, retval) do { \
 	if ((token) == NULL || strlen(token) == 0 || !isdigit(*token)) { \
-		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token\n"); \
+		RTE_EDEV_LOG_ERR("Invalid eth Rx adapter token"); \
 		ret = retval; \
 		goto error; \
 	} \
@@ -1540,7 +1540,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id,

 	ret = rte_event_dev_configure(dev_id, &dev_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("failed to configure event dev %u\n",
+		RTE_EDEV_LOG_ERR("failed to configure event dev %u",
 						dev_id);
 		if (started) {
 			if (rte_event_dev_start(dev_id))
@@ -1551,7 +1551,7 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id,

 	ret = rte_event_port_setup(dev_id, port_id, port_conf);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("failed to setup event port %u\n",
+		RTE_EDEV_LOG_ERR("failed to setup event port %u",
 					port_id);
 		return ret;
 	}
@@ -1628,7 +1628,7 @@ rxa_create_intr_thread(struct event_eth_rx_adapter *rx_adapter)
 	if (!err)
 		return 0;

-	RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err);
+	RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d", err);
 	rte_free(rx_adapter->epoll_events);
 error:
 	rte_ring_free(rx_adapter->intr_ring);
@@ -1644,12 +1644,12 @@ rxa_destroy_intr_thread(struct event_eth_rx_adapter *rx_adapter)

 	err = pthread_cancel((pthread_t)rx_adapter->rx_intr_thread.opaque_id);
 	if (err)
-		RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d\n",
+		RTE_EDEV_LOG_ERR("Can't cancel interrupt thread err = %d",
 				err);

 	err = rte_thread_join(rx_adapter->rx_intr_thread, NULL);
 	if (err)
-		RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d\n", err);
+		RTE_EDEV_LOG_ERR("Can't join interrupt thread err = %d", err);

 	rte_free(rx_adapter->epoll_events);
 	rte_ring_free(rx_adapter->intr_ring);
@@ -1915,7 +1915,7 @@ rxa_init_service(struct event_eth_rx_adapter *rx_adapter, uint8_t id)
 	if (rte_mbuf_dyn_rx_timestamp_register(
 			&event_eth_rx_timestamp_dynfield_offset,
 			&event_eth_rx_timestamp_dynflag) != 0) {
-		RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf\n");
+		RTE_EDEV_LOG_ERR("Error registering timestamp field in mbuf");
 		return -rte_errno;
 	}

@@ -2445,7 +2445,7 @@ rxa_create(uint8_t id, uint8_t dev_id,
 			    RTE_DIM(default_rss_key));

 	if (rx_adapter->eth_devices == NULL) {
-		RTE_EDEV_LOG_ERR("failed to get mem for eth devices\n");
+		RTE_EDEV_LOG_ERR("failed to get mem for eth devices");
 		rte_free(rx_adapter);
 		return -ENOMEM;
 	}
@@ -2497,12 +2497,12 @@ rxa_config_params_validate(struct rte_event_eth_rx_adapter_params *rxa_params,
 		return 0;
 	} else if (!rxa_params->use_queue_event_buf &&
 		    rxa_params->event_buf_size == 0) {
-		RTE_EDEV_LOG_ERR("event buffer size can't be zero\n");
+		RTE_EDEV_LOG_ERR("event buffer size can't be zero");
 		return -EINVAL;
 	} else if (rxa_params->use_queue_event_buf &&
 		   rxa_params->event_buf_size != 0) {
 		RTE_EDEV_LOG_ERR("event buffer size needs to be configured "
-				 "as part of queue add\n");
+				 "as part of queue add");
 		return -EINVAL;
 	}

@@ -3597,7 +3597,7 @@ handle_rxa_stats(const char *cmd __rte_unused,
 	/* Get Rx adapter stats */
 	if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id,
 					       &rx_adptr_stats)) {
-		RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n");
+		RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats");
 		return -1;
 	}

@@ -3636,7 +3636,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused,

 	/* Reset Rx adapter stats */
 	if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) {
-		RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n");
+		RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats");
 		return -1;
 	}

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index 360d5caf6a..56435be991 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -334,7 +334,7 @@ txa_service_conf_cb(uint8_t __rte_unused id, uint8_t dev_id,

 	ret = rte_event_port_setup(dev_id, port_id, pc);
 	if (ret) {
-		RTE_EDEV_LOG_ERR("failed to setup event port %u\n",
+		RTE_EDEV_LOG_ERR("failed to setup event port %u",
 					port_id);
 		if (started) {
 			if (rte_event_dev_start(dev_id))
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index 27466707bc..3f22e85173 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -106,7 +106,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id,

 	ret = rte_event_dev_configure(dev_id, &dev_conf);
 	if (ret < 0) {
-		EVTIM_LOG_ERR("failed to configure event dev %u\n", dev_id);
+		EVTIM_LOG_ERR("failed to configure event dev %u", dev_id);
 		if (started)
 			if (rte_event_dev_start(dev_id))
 				return -EIO;
@@ -116,7 +116,7 @@ default_port_conf_cb(uint16_t id, uint8_t event_dev_id, uint8_t *event_port_id,

 	ret = rte_event_port_setup(dev_id, port_id, port_conf);
 	if (ret < 0) {
-		EVTIM_LOG_ERR("failed to setup event port %u on event dev %u\n",
+		EVTIM_LOG_ERR("failed to setup event port %u on event dev %u",
 			      port_id, dev_id);
 		return ret;
 	}
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index ae50821a3f..157752868d 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1007,13 +1007,13 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t
 	}

 	if (*dev->dev_ops->port_link == NULL) {
-		RTE_EDEV_LOG_ERR("Function not supported\n");
+		RTE_EDEV_LOG_ERR("Function not supported");
 		rte_errno = ENOTSUP;
 		return 0;
 	}

 	if (profile_id && *dev->dev_ops->port_link_profile == NULL) {
-		RTE_EDEV_LOG_ERR("Function not supported\n");
+		RTE_EDEV_LOG_ERR("Function not supported");
 		rte_errno = ENOTSUP;
 		return 0;
 	}
diff --git a/lib/metrics/rte_metrics_telemetry.c b/lib/metrics/rte_metrics_telemetry.c
index 5be21b2e86..1d133e1f8c 100644
--- a/lib/metrics/rte_metrics_telemetry.c
+++ b/lib/metrics/rte_metrics_telemetry.c
@@ -363,7 +363,7 @@ rte_metrics_tel_stat_names_to_ids(const char * const *stat_names,
 			}
 		}
 		if (j == num_metrics) {
-			METRICS_LOG_WARN("Invalid stat name %s\n",
+			METRICS_LOG_WARN("Invalid stat name %s",
 					stat_names[i]);
 			free(names);
 			return -EINVAL;
diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c
index cc5f2e0cc6..196b1850e6 100644
--- a/lib/mldev/rte_mldev.c
+++ b/lib/mldev/rte_mldev.c
@@ -159,7 +159,7 @@ int
 rte_ml_dev_init(size_t dev_max)
 {
 	if (dev_max == 0 || dev_max > INT16_MAX) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)\n", dev_max, INT16_MAX);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_max = %zu (> %d)", dev_max, INT16_MAX);
 		rte_errno = EINVAL;
 		return -rte_errno;
 	}
@@ -217,7 +217,7 @@ rte_ml_dev_socket_id(int16_t dev_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -232,7 +232,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -241,7 +241,7 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info)
 		return -ENOTSUP;

 	if (dev_info == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, dev_info cannot be NULL", dev_id);
 		return -EINVAL;
 	}
 	memset(dev_info, 0, sizeof(struct rte_ml_dev_info));
@@ -257,7 +257,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config)
 	int ret;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -271,7 +271,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config)
 	}

 	if (config == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, config cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -280,7 +280,7 @@ rte_ml_dev_configure(int16_t dev_id, const struct rte_ml_dev_config *config)
 		return ret;

 	if (config->nb_queue_pairs > dev_info.max_queue_pairs) {
-		RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u\n", dev_id,
+		RTE_MLDEV_LOG(ERR, "Device %d num of queues %u > %u", dev_id,
 			      config->nb_queue_pairs, dev_info.max_queue_pairs);
 		return -EINVAL;
 	}
@@ -294,7 +294,7 @@ rte_ml_dev_close(int16_t dev_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -318,7 +318,7 @@ rte_ml_dev_start(int16_t dev_id)
 	int ret;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -345,7 +345,7 @@ rte_ml_dev_stop(int16_t dev_id)
 	int ret;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -372,7 +372,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id,
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -386,7 +386,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id,
 	}

 	if (qp_conf == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, qp_conf cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -404,7 +404,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -413,7 +413,7 @@ rte_ml_dev_stats_get(int16_t dev_id, struct rte_ml_dev_stats *stats)
 		return -ENOTSUP;

 	if (stats == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, stats cannot be NULL", dev_id);
 		return -EINVAL;
 	}
 	memset(stats, 0, sizeof(struct rte_ml_dev_stats));
@@ -427,7 +427,7 @@ rte_ml_dev_stats_reset(int16_t dev_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return;
 	}

@@ -445,7 +445,7 @@ rte_ml_dev_xstats_names_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, in
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -462,7 +462,7 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -471,12 +471,12 @@ rte_ml_dev_xstats_by_name_get(int16_t dev_id, const char *name, uint16_t *stat_i
 		return -ENOTSUP;

 	if (name == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, name cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (value == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, value cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -490,7 +490,7 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -499,12 +499,12 @@ rte_ml_dev_xstats_get(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_t
 		return -ENOTSUP;

 	if (stat_ids == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, stat_ids cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (values == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, values cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -518,7 +518,7 @@ rte_ml_dev_xstats_reset(int16_t dev_id, enum rte_ml_dev_xstats_mode mode, int32_
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -535,7 +535,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -544,7 +544,7 @@ rte_ml_dev_dump(int16_t dev_id, FILE *fd)
 		return -ENOTSUP;

 	if (fd == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, file descriptor cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -557,7 +557,7 @@ rte_ml_dev_selftest(int16_t dev_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -574,7 +574,7 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t *
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -583,12 +583,12 @@ rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t *
 		return -ENOTSUP;

 	if (params == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, params cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (model_id == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, model_id cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -601,7 +601,7 @@ rte_ml_model_unload(int16_t dev_id, uint16_t model_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -618,7 +618,7 @@ rte_ml_model_start(int16_t dev_id, uint16_t model_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -635,7 +635,7 @@ rte_ml_model_stop(int16_t dev_id, uint16_t model_id)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -652,7 +652,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -661,7 +661,7 @@ rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_inf
 		return -ENOTSUP;

 	if (model_info == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL\n", dev_id,
+		RTE_MLDEV_LOG(ERR, "Dev %d, model_id %u, model_info cannot be NULL", dev_id,
 			      model_id);
 		return -EINVAL;
 	}
@@ -675,7 +675,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer)
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -684,7 +684,7 @@ rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer)
 		return -ENOTSUP;

 	if (buffer == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, buffer cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -698,7 +698,7 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -707,12 +707,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **d
 		return -ENOTSUP;

 	if (dbuffer == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (qbuffer == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -726,7 +726,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg *
 	struct rte_ml_dev *dev;

 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -735,12 +735,12 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg *
 		return -ENOTSUP;

 	if (qbuffer == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, qbuffer cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (dbuffer == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, dbuffer cannot be NULL", dev_id);
 		return -EINVAL;
 	}

@@ -811,7 +811,7 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin

 #ifdef RTE_LIBRTE_ML_DEV_DEBUG
 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}
@@ -823,13 +823,13 @@ rte_ml_enqueue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin
 	}

 	if (ops == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}

 	if (qp_id >= dev->data->nb_queue_pairs) {
-		RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id);
+		RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}
@@ -847,7 +847,7 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin

 #ifdef RTE_LIBRTE_ML_DEV_DEBUG
 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}
@@ -859,13 +859,13 @@ rte_ml_dequeue_burst(int16_t dev_id, uint16_t qp_id, struct rte_ml_op **ops, uin
 	}

 	if (ops == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, ops cannot be NULL", dev_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}

 	if (qp_id >= dev->data->nb_queue_pairs) {
-		RTE_MLDEV_LOG(ERR, "Invalid qp_id %u\n", qp_id);
+		RTE_MLDEV_LOG(ERR, "Invalid qp_id %u", qp_id);
 		rte_errno = -EINVAL;
 		return 0;
 	}
@@ -883,7 +883,7 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error

 #ifdef RTE_LIBRTE_ML_DEV_DEBUG
 	if (!rte_ml_dev_is_valid_dev(dev_id)) {
-		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
 		return -EINVAL;
 	}

@@ -892,12 +892,12 @@ rte_ml_op_error_get(int16_t dev_id, struct rte_ml_op *op, struct rte_ml_op_error
 		return -ENOTSUP;

 	if (op == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, op cannot be NULL", dev_id);
 		return -EINVAL;
 	}

 	if (error == NULL) {
-		RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL\n", dev_id);
+		RTE_MLDEV_LOG(ERR, "Dev %d, error cannot be NULL", dev_id);
 		return -EINVAL;
 	}
 #else
diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c
index a685f9e7bb..900d6de7f4 100644
--- a/lib/net/rte_net_crc.c
+++ b/lib/net/rte_net_crc.c
@@ -179,7 +179,7 @@ avx512_vpclmulqdq_get_handlers(void)
 			max_simd_bitwidth >= RTE_VECT_SIMD_512)
 		return handlers_avx512;
 #endif
-	NET_LOG(INFO, "Requirements not met, can't use AVX512\n");
+	NET_LOG(INFO, "Requirements not met, can't use AVX512");
 	return NULL;
 }

@@ -205,7 +205,7 @@ sse42_pclmulqdq_get_handlers(void)
 			max_simd_bitwidth >= RTE_VECT_SIMD_128)
 		return handlers_sse42;
 #endif
-	NET_LOG(INFO, "Requirements not met, can't use SSE\n");
+	NET_LOG(INFO, "Requirements not met, can't use SSE");
 	return NULL;
 }

@@ -231,7 +231,7 @@ neon_pmull_get_handlers(void)
 			max_simd_bitwidth >= RTE_VECT_SIMD_128)
 		return handlers_neon;
 #endif
-	NET_LOG(INFO, "Requirements not met, can't use NEON\n");
+	NET_LOG(INFO, "Requirements not met, can't use NEON");
 	return NULL;
 }

diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c
index 3e8fac1df4..475eff6abe 100644
--- a/lib/node/ethdev_rx.c
+++ b/lib/node/ethdev_rx.c
@@ -160,13 +160,13 @@ ethdev_ptype_setup(uint16_t port, uint16_t queue)

 	if (!l3_ipv4 || !l3_ipv6) {
 		node_info("ethdev_rx",
-			  "Enabling ptype callback for required ptypes on port %u\n",
+			  "Enabling ptype callback for required ptypes on port %u",
 			  port);

 		if (!rte_eth_add_rx_callback(port, queue, eth_pkt_parse_cb,
 					     NULL)) {
 			node_err("ethdev_rx",
-				 "Failed to add rx ptype cb: port=%d, queue=%d\n",
+				 "Failed to add rx ptype cb: port=%d, queue=%d",
 				 port, queue);
 			return -EINVAL;
 		}
diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c
index 0dbfde64fe..18955971f6 100644
--- a/lib/node/ip4_lookup.c
+++ b/lib/node/ip4_lookup.c
@@ -143,7 +143,7 @@ rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop,
 				  ip, depth, val);
 		if (ret < 0) {
 			node_err("ip4_lookup",
-				 "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d\n",
+				 "Unable to add entry %s / %d nh (%x) to LPM table on sock %d, rc=%d",
 				 abuf, depth, val, socket, ret);
 			return ret;
 		}
diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c
index 6f56eb5ec5..309964f60f 100644
--- a/lib/node/ip6_lookup.c
+++ b/lib/node/ip6_lookup.c
@@ -283,7 +283,7 @@ rte_node_ip6_route_add(const uint8_t *ip, uint8_t depth, uint16_t next_hop,
 		if (ret < 0) {
 			node_err("ip6_lookup",
 				 "Unable to add entry %s / %d nh (%x) to LPM "
-				 "table on sock %d, rc=%d\n",
+				 "table on sock %d, rc=%d",
 				 abuf, depth, val, socket, ret);
 			return ret;
 		}
diff --git a/lib/node/kernel_rx.c b/lib/node/kernel_rx.c
index 2dba7c8cc7..6c20cdbb1e 100644
--- a/lib/node/kernel_rx.c
+++ b/lib/node/kernel_rx.c
@@ -134,7 +134,7 @@ kernel_rx_node_do(struct rte_graph *graph, struct rte_node *node, kernel_rx_node
 			if (len == 0 || len == 0xFFFF) {
 				rte_pktmbuf_free(m);
 				if (rx->idx <= 0)
-					node_dbg("kernel_rx", "rx_mbuf array is empty\n");
+					node_dbg("kernel_rx", "rx_mbuf array is empty");
 				rx->idx--;
 				break;
 			}
@@ -207,20 +207,20 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node)
 	RTE_VERIFY(elem != NULL);

 	if (ctx->pktmbuf_pool == NULL) {
-		node_err("kernel_rx", "Invalid mbuf pool on graph %s\n", graph->name);
+		node_err("kernel_rx", "Invalid mbuf pool on graph %s", graph->name);
 		return -EINVAL;
 	}

 	recv_info = rte_zmalloc_socket("kernel_rx_info", sizeof(kernel_rx_info_t),
 				       RTE_CACHE_LINE_SIZE, graph->socket);
 	if (!recv_info) {
-		node_err("kernel_rx", "Kernel recv_info is NULL\n");
+		node_err("kernel_rx", "Kernel recv_info is NULL");
 		return -ENOMEM;
 	}

 	sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 	if (sock < 0) {
-		node_err("kernel_rx", "Unable to open RAW socket\n");
+		node_err("kernel_rx", "Unable to open RAW socket");
 		return sock;
 	}

diff --git a/lib/node/kernel_tx.c b/lib/node/kernel_tx.c
index 27d1808c71..3a96741622 100644
--- a/lib/node/kernel_tx.c
+++ b/lib/node/kernel_tx.c
@@ -36,7 +36,7 @@ kernel_tx_process_mbuf(struct rte_node *node, struct rte_mbuf **mbufs, uint16_t
 		sin.sin_addr.s_addr = ip4->dst_addr;

 		if (sendto(ctx->sock, buf, len, 0, (struct sockaddr *)&sin, sizeof(sin)) < 0)
-			node_err("kernel_tx", "Unable to send packets: %s\n", strerror(errno));
+			node_err("kernel_tx", "Unable to send packets: %s", strerror(errno));
 	}
 }

@@ -87,7 +87,7 @@ kernel_tx_node_init(const struct rte_graph *graph __rte_unused, struct rte_node

 	ctx->sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
 	if (ctx->sock < 0)
-		node_err("kernel_tx", "Unable to open RAW socket\n");
+		node_err("kernel_tx", "Unable to open RAW socket");

 	return 0;
 }
diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c
index a9f3d6cc98..41a44be4b9 100644
--- a/lib/rcu/rte_rcu_qsbr.c
+++ b/lib/rcu/rte_rcu_qsbr.c
@@ -92,7 +92,7 @@ rte_rcu_qsbr_thread_register(struct rte_rcu_qsbr *v, unsigned int thread_id)
 		return 1;
 	}

-	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n",
+	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u",
 				v->qsbr_cnt[thread_id].lock_cnt);

 	id = thread_id & __RTE_QSBR_THRID_MASK;
@@ -144,7 +144,7 @@ rte_rcu_qsbr_thread_unregister(struct rte_rcu_qsbr *v, unsigned int thread_id)
 		return 1;
 	}

-	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n",
+	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u",
 				v->qsbr_cnt[thread_id].lock_cnt);

 	id = thread_id & __RTE_QSBR_THRID_MASK;
diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 5979fb0efb..6b908e7ee0 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -299,7 +299,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id)

 	RTE_ASSERT(v != NULL && thread_id < v->max_threads);

-	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n",
+	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u",
 				v->qsbr_cnt[thread_id].lock_cnt);

 	/* Copy the current value of token.
@@ -350,7 +350,7 @@ rte_rcu_qsbr_thread_offline(struct rte_rcu_qsbr *v, unsigned int thread_id)
 {
 	RTE_ASSERT(v != NULL && thread_id < v->max_threads);

-	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n",
+	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u",
 				v->qsbr_cnt[thread_id].lock_cnt);

 	/* The reader can go offline only after the load of the
@@ -427,7 +427,7 @@ rte_rcu_qsbr_unlock(__rte_unused struct rte_rcu_qsbr *v,
 				1, rte_memory_order_release);

 	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, WARNING,
-				"Lock counter %u. Nested locks?\n",
+				"Lock counter %u. Nested locks?",
 				v->qsbr_cnt[thread_id].lock_cnt);
 #endif
 }
@@ -481,7 +481,7 @@ rte_rcu_qsbr_quiescent(struct rte_rcu_qsbr *v, unsigned int thread_id)

 	RTE_ASSERT(v != NULL && thread_id < v->max_threads);

-	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u\n",
+	__RTE_RCU_IS_LOCK_CNT_ZERO(v, thread_id, ERR, "Lock counter %u",
 				v->qsbr_cnt[thread_id].lock_cnt);

 	/* Acquire the changes to the shared data structure released
diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 1fabec2bfe..1dab6d6645 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -56,7 +56,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id,
 	int ret;

 	if (flags & ~(RTE_STACK_F_LF)) {
-		STACK_LOG_ERR("Unsupported stack flags %#x\n", flags);
+		STACK_LOG_ERR("Unsupported stack flags %#x", flags);
 		return NULL;
 	}

@@ -65,7 +65,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id,
 #endif
 #if !defined(RTE_STACK_LF_SUPPORTED)
 	if (flags & RTE_STACK_F_LF) {
-		STACK_LOG_ERR("Lock-free stack is not supported on your platform\n");
+		STACK_LOG_ERR("Lock-free stack is not supported on your platform");
 		rte_errno = ENOTSUP;
 		return NULL;
 	}
@@ -82,7 +82,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id,

 	te = rte_zmalloc("STACK_TAILQ_ENTRY", sizeof(*te), 0);
 	if (te == NULL) {
-		STACK_LOG_ERR("Cannot reserve memory for tailq\n");
+		STACK_LOG_ERR("Cannot reserve memory for tailq");
 		rte_errno = ENOMEM;
 		return NULL;
 	}
@@ -92,7 +92,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id,
 	mz = rte_memzone_reserve_aligned(mz_name, sz, socket_id,
 					 0, __alignof__(*s));
 	if (mz == NULL) {
-		STACK_LOG_ERR("Cannot reserve stack memzone!\n");
+		STACK_LOG_ERR("Cannot reserve stack memzone!");
 		rte_mcfg_tailq_write_unlock();
 		rte_free(te);
 		return NULL;
diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index 9bf5ef67b9..7b22281815 100644
--- a/lib/vhost/vhost_crypto.c
+++ b/lib/vhost/vhost_crypto.c
@@ -245,7 +245,7 @@ transform_cipher_param(struct rte_crypto_sym_xform *xform,
 		return ret;

 	if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) {
-		VC_LOG_DBG("Invalid cipher key length\n");
+		VC_LOG_DBG("Invalid cipher key length");
 		return -VIRTIO_CRYPTO_BADMSG;
 	}

@@ -301,7 +301,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms,
 		return ret;

 	if (param->cipher_key_len > VHOST_USER_CRYPTO_MAX_CIPHER_KEY_LENGTH) {
-		VC_LOG_DBG("Invalid cipher key length\n");
+		VC_LOG_DBG("Invalid cipher key length");
 		return -VIRTIO_CRYPTO_BADMSG;
 	}

@@ -321,7 +321,7 @@ transform_chain_param(struct rte_crypto_sym_xform *xforms,
 		return ret;

 	if (param->auth_key_len > VHOST_USER_CRYPTO_MAX_HMAC_KEY_LENGTH) {
-		VC_LOG_DBG("Invalid auth key length\n");
+		VC_LOG_DBG("Invalid auth key length");
 		return -VIRTIO_CRYPTO_BADMSG;
 	}

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.334676812 +0800
+++ 0007-lib-remove-redundant-newline-from-logs.patch	2024-03-05 17:39:30.663566489 +0800
@@ -1 +1 @@
-From ae282b0611c33aa73a01ee6137d116155053b835 Mon Sep 17 00:00:00 2001
+From fd6f07da946292d1637b7fd4ae42fd08d2c5bb84 Mon Sep 17 00:00:00 2001
@@ -7,0 +8 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -9 +10 @@
-Fix places where two newline characters may be logged.
+[ upstream commit ae282b0611c33aa73a01ee6137d116155053b835 ]
@@ -11 +12 @@
-Cc: stable@dpdk.org
+Fix places where two newline characters may be logged.
@@ -48 +49 @@
-index 52d6d010c7..f21f9cc5a0 100644
+index 30f919cd40..2a5599b7d8 100644
@@ -51 +52 @@
-@@ -407,7 +407,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer)
+@@ -406,7 +406,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer)
@@ -175 +176 @@
-index ead8c9a623..b233c0ecd7 100644
+index d8769f0b8d..a3a8fc9c07 100644
@@ -178 +179 @@
-@@ -2074,7 +2074,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id,
+@@ -2072,7 +2072,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id,
@@ -1297 +1298 @@
-index 3e1ef1ac25..6e5443e5f8 100644
+index 9bf5ef67b9..7b22281815 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'dma/dpaa2: fix logtype register' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (6 preceding siblings ...)
  2024-03-05  9:45 ` patch 'lib: remove redundant newline from " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/i40e: remove redundant judgment in flow parsing' " Xueming Li
                   ` (128 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand; +Cc: Stephen Hemminger, Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ec5fe01a283f35268671af1aeaa82127f10e8cbd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ec5fe01a283f35268671af1aeaa82127f10e8cbd Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 18 Dec 2023 16:46:39 +0100
Subject: [PATCH] dma/dpaa2: fix logtype register
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f334b4c0b856e92d678cd09828207a3292e24ac2 ]

This driver logtype was not initialized so its logs would end up under
the 0 logtype, iow, RTE_LOGTYPE_EAL.
This issue comes from a typo on the logtype variable name.

Fixes: 8caf8427f85a ("dma/dpaa2: introduce driver skeleton")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/dma/dpaa2/dpaa2_qdma.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c
index 8968bb853b..2c91ceec13 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma.c
+++ b/drivers/dma/dpaa2/dpaa2_qdma.c
@@ -16,9 +16,6 @@

 #define DPAA2_QDMA_PREFETCH "prefetch"

-/* Dynamic log type identifier */
-int dpaa2_qdma_logtype;
-
 uint32_t dpaa2_coherent_no_alloc_cache;
 uint32_t dpaa2_coherent_alloc_cache;

@@ -1699,4 +1696,4 @@ static struct rte_dpaa2_driver rte_dpaa2_qdma_pmd = {
 RTE_PMD_REGISTER_DPAA2(dpaa2_qdma, rte_dpaa2_qdma_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(dpaa2_qdma,
 	"no_prefetch=<int> ");
-RTE_LOG_REGISTER_DEFAULT(dpaa_qdma2_logtype, INFO);
+RTE_LOG_REGISTER_DEFAULT(dpaa2_qdma_logtype, INFO);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.371239313 +0800
+++ 0008-dma-dpaa2-fix-logtype-register.patch	2024-03-05 17:39:30.663566489 +0800
@@ -1 +1 @@
-From f334b4c0b856e92d678cd09828207a3292e24ac2 Mon Sep 17 00:00:00 2001
+From ec5fe01a283f35268671af1aeaa82127f10e8cbd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f334b4c0b856e92d678cd09828207a3292e24ac2 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/i40e: remove redundant judgment in flow parsing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (7 preceding siblings ...)
  2024-03-05  9:45 ` patch 'dma/dpaa2: fix logtype register' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/iavf: fix memory leak on security context error' " Xueming Li
                   ` (127 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ca47a866b53941ecddfb3735f656f0bc939a2ed2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ca47a866b53941ecddfb3735f656f0bc939a2ed2 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Fri, 24 Nov 2023 15:01:03 +0800
Subject: [PATCH] net/i40e: remove redundant judgment in flow parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e930f8622e05e410a475c6b57dd7edd73b2e1705 ]

if (eth_spec && eth_mask &&
	       next_type == RTE_FLOW_ITEM_TYPE_END) {
            ...
            if (next_type == RTE_FLOW_ITEM_TYPE_VLAN || ...) {
            ...
            }
...
}

Clearly, that condition in the inner "if" is always "false".

This commit will remove the redundant judgment.

Fixes: 7d83c152a207 ("net/i40e: parse flow director filter")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 877e49151e..92165c8422 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1708,8 +1708,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,

 				ether_type = rte_be_to_cpu_16(eth_spec->hdr.ether_type);

-				if (next_type == RTE_FLOW_ITEM_TYPE_VLAN ||
-				    ether_type == RTE_ETHER_TYPE_IPV4 ||
+				if (ether_type == RTE_ETHER_TYPE_IPV4 ||
 				    ether_type == RTE_ETHER_TYPE_IPV6 ||
 				    ether_type == i40e_get_outer_vlan(dev)) {
 					rte_flow_error_set(error, EINVAL,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.399119414 +0800
+++ 0009-net-i40e-remove-redundant-judgment-in-flow-parsing.patch	2024-03-05 17:39:30.663566489 +0800
@@ -1 +1 @@
-From e930f8622e05e410a475c6b57dd7edd73b2e1705 Mon Sep 17 00:00:00 2001
+From ca47a866b53941ecddfb3735f656f0bc939a2ed2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e930f8622e05e410a475c6b57dd7edd73b2e1705 ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/iavf: fix memory leak on security context error' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (8 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/i40e: remove redundant judgment in flow parsing' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/ixgbe: fix memoy leak after device init failure' " Xueming Li
                   ` (126 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3defa10a78b056c43a0ffc585fdac4d4133e6da8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3defa10a78b056c43a0ffc585fdac4d4133e6da8 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 1 Dec 2023 18:46:49 +0800
Subject: [PATCH] net/iavf: fix memory leak on security context error
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ]

In iavf_security_ctx_create() allocated memory for the
'security_ctx', we should free it when memory malloc for
the 'iavf_security_ctx' fails, otherwise it will lead to
memory leak.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ipsec_crypto.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_ipsec_crypto.c b/drivers/net/iavf/iavf_ipsec_crypto.c
index 07a69db540..d6c0180ffd 100644
--- a/drivers/net/iavf/iavf_ipsec_crypto.c
+++ b/drivers/net/iavf/iavf_ipsec_crypto.c
@@ -1518,8 +1518,11 @@ iavf_security_ctx_create(struct iavf_adapter *adapter)
 	if (adapter->security_ctx == NULL) {
 		adapter->security_ctx = rte_malloc("iavf_security_ctx",
 				sizeof(struct iavf_security_ctx), 0);
-		if (adapter->security_ctx == NULL)
+		if (adapter->security_ctx == NULL) {
+			rte_free(adapter->vf.eth_dev->security_ctx);
+			adapter->vf.eth_dev->security_ctx = NULL;
 			return -ENOMEM;
+		}
 	}

 	return 0;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.422786015 +0800
+++ 0010-net-iavf-fix-memory-leak-on-security-context-error.patch	2024-03-05 17:39:30.663566489 +0800
@@ -1 +1 @@
-From 8758ad5f8633ce4197271d41ece0cc7f799d3d6e Mon Sep 17 00:00:00 2001
+From 3defa10a78b056c43a0ffc585fdac4d4133e6da8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8758ad5f8633ce4197271d41ece0cc7f799d3d6e ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ixgbe: fix memoy leak after device init failure' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (9 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/iavf: fix memory leak on security context error' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/ice: fix link update' " Xueming Li
                   ` (125 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c655f20c8f5e55b625dd8f69036d699b821ef3b2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c655f20c8f5e55b625dd8f69036d699b821ef3b2 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Thu, 14 Dec 2023 14:44:41 +0800
Subject: [PATCH] net/ixgbe: fix memoy leak after device init failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd ]

In ixgbe_ipsec_ctx_create() allocated memory for the 'security_ctx',
we should free it when errors occur, otherwise it will lead
to memory leak.

Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d6cf00317e..a32d3a6d7c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1190,7 +1190,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	diag = ixgbe_validate_eeprom_checksum(hw, &csum);
 	if (diag != IXGBE_SUCCESS) {
 		PMD_INIT_LOG(ERR, "The EEPROM checksum is not valid: %d", diag);
-		return -EIO;
+		ret = -EIO;
+		goto err_exit;
 	}

 #ifdef RTE_LIBRTE_IXGBE_BYPASS
@@ -1228,7 +1229,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 		PMD_INIT_LOG(ERR, "Unsupported SFP+ Module");
 	if (diag) {
 		PMD_INIT_LOG(ERR, "Hardware Initialization Failure: %d", diag);
-		return -EIO;
+		ret = -EIO;
+		goto err_exit;
 	}

 	/* Reset the hw statistics */
@@ -1248,7 +1250,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 			     "Failed to allocate %u bytes needed to store "
 			     "MAC addresses",
 			     RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_exit;
 	}
 	/* Copy the permanent MAC address */
 	rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr,
@@ -1263,7 +1266,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 			     RTE_ETHER_ADDR_LEN * IXGBE_VMDQ_NUM_UC_MAC);
 		rte_free(eth_dev->data->mac_addrs);
 		eth_dev->data->mac_addrs = NULL;
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_exit;
 	}

 	/* initialize the vfta */
@@ -1347,6 +1351,11 @@ err_pf_host_init:
 	eth_dev->data->mac_addrs = NULL;
 	rte_free(eth_dev->data->hash_mac_addrs);
 	eth_dev->data->hash_mac_addrs = NULL;
+err_exit:
+#ifdef RTE_LIB_SECURITY
+	rte_free(eth_dev->security_ctx);
+	eth_dev->security_ctx = NULL;
+#endif
 	return ret;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.451848416 +0800
+++ 0011-net-ixgbe-fix-memoy-leak-after-device-init-failure.patch	2024-03-05 17:39:30.673566490 +0800
@@ -1 +1 @@
-From 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd Mon Sep 17 00:00:00 2001
+From c655f20c8f5e55b625dd8f69036d699b821ef3b2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ice: fix link update' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (10 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/ixgbe: fix memoy leak after device init failure' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/ice: fix tunnel TSO capabilities' " Xueming Li
                   ` (124 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=48efa16873357fdac7264853cc6423ad1585a790

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 48efa16873357fdac7264853cc6423ad1585a790 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Thu, 14 Dec 2023 03:40:54 -0500
Subject: [PATCH] net/ice: fix link update
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4e5dc111464e83e9a55fa466d8f682f0027b721e ]

The ice_aq_get_link_info function is not thread-safe. However,
it is possible to simultaneous invocations during both the dev_start
and the LSC interrupt handler, potentially leading to unexpected adminq
errors. This patch addresses the issue by introducing a thread-safe
wrapper that utilizes a spinlock.

Fixes: cf911d90e366 ("net/ice: support link update")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 26 ++++++++++++++++++++------
 drivers/net/ice/ice_ethdev.h |  4 ++++
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 3ccba4db80..1f8ab5158a 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1804,6 +1804,7 @@ ice_pf_setup(struct ice_pf *pf)
 	}

 	pf->main_vsi = vsi;
+	rte_spinlock_init(&pf->link_lock);

 	return 0;
 }
@@ -3621,17 +3622,31 @@ ice_rxq_intr_setup(struct rte_eth_dev *dev)
 	return 0;
 }

+static enum ice_status
+ice_get_link_info_safe(struct ice_pf *pf, bool ena_lse,
+		       struct ice_link_status *link)
+{
+	struct ice_hw *hw = ICE_PF_TO_HW(pf);
+	int ret;
+
+	rte_spinlock_lock(&pf->link_lock);
+
+	ret = ice_aq_get_link_info(hw->port_info, ena_lse, link, NULL);
+
+	rte_spinlock_unlock(&pf->link_lock);
+
+	return ret;
+}
+
 static void
 ice_get_init_link_status(struct rte_eth_dev *dev)
 {
-	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	bool enable_lse = dev->data->dev_conf.intr_conf.lsc ? true : false;
 	struct ice_link_status link_status;
 	int ret;

-	ret = ice_aq_get_link_info(hw->port_info, enable_lse,
-				   &link_status, NULL);
+	ret = ice_get_link_info_safe(pf, enable_lse, &link_status);
 	if (ret != ICE_SUCCESS) {
 		PMD_DRV_LOG(ERR, "Failed to get link info");
 		pf->init_link_up = false;
@@ -3996,7 +4011,7 @@ ice_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 {
 #define CHECK_INTERVAL 50  /* 50ms */
 #define MAX_REPEAT_TIME 40  /* 2s (40 * 50ms) in total */
-	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_link_status link_status;
 	struct rte_eth_link link, old;
 	int status;
@@ -4010,8 +4025,7 @@ ice_link_update(struct rte_eth_dev *dev, int wait_to_complete)

 	do {
 		/* Get link status information from hardware */
-		status = ice_aq_get_link_info(hw->port_info, enable_lse,
-					      &link_status, NULL);
+		status = ice_get_link_info_safe(pf, enable_lse, &link_status);
 		if (status != ICE_SUCCESS) {
 			link.link_speed = RTE_ETH_SPEED_NUM_100M;
 			link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index abe6dcdc23..d607f028e0 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -548,6 +548,10 @@ struct ice_pf {
 	uint64_t rss_hf;
 	struct ice_tm_conf tm_conf;
 	uint16_t outer_ethertype;
+	/* lock prevent race condition between lsc interrupt handler
+	 * and link status update during dev_start.
+	 */
+	rte_spinlock_t link_lock;
 };

 #define ICE_MAX_QUEUE_NUM  2048
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.481020117 +0800
+++ 0012-net-ice-fix-link-update.patch	2024-03-05 17:39:30.673566490 +0800
@@ -1 +1 @@
-From 4e5dc111464e83e9a55fa466d8f682f0027b721e Mon Sep 17 00:00:00 2001
+From 48efa16873357fdac7264853cc6423ad1585a790 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4e5dc111464e83e9a55fa466d8f682f0027b721e ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ice: fix tunnel TSO capabilities' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (11 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/ice: fix link update' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/iavf: fix no polling mode switching' " Xueming Li
                   ` (123 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c321ba6a9d17c218f6e37a4f8600c4911ca29ec6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c321ba6a9d17c218f6e37a4f8600c4911ca29ec6 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Thu, 7 Dec 2023 10:30:51 +0800
Subject: [PATCH] net/ice: fix tunnel TSO capabilities
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit daac90272857812b3da1db95caf5922f03a83343 ]

The Tx offload capabilities doesn't include TSO tunnel which
will result in TSO tunnel setting to not take effect.

The patch adds tunnel TSO offload to ICE_TX_NO_VECTOR_FLAGS.

This commit will add TSO tunnel capabilities in ice_dev_info_get().

Bugzilla ID: 1327
Fixes: d852fec1be63 ("net/ice: fix Tx offload path choice")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_ethdev.c          | 6 +++++-
 drivers/net/ice/ice_rxtx_vec_common.h | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 1f8ab5158a..3c3bc49dc2 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3891,7 +3891,11 @@ ice_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 			RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
 			RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
 			RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
-			RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;
+			RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM |
+			RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
+			RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |
+			RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |
+			RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO;
 		dev_info->flow_type_rss_offloads |= ICE_RSS_OFFLOAD_ALL;
 	}

diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h
index 55840cf170..4b73465af5 100644
--- a/drivers/net/ice/ice_rxtx_vec_common.h
+++ b/drivers/net/ice/ice_rxtx_vec_common.h
@@ -251,6 +251,10 @@ ice_rxq_vec_setup_default(struct ice_rx_queue *rxq)
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |		\
 		RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |	\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
+		RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |    \
+		RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |    \
+		RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |    \
+		RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |    \
 		RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM)

 #define ICE_TX_VECTOR_OFFLOAD (				\
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.511990518 +0800
+++ 0013-net-ice-fix-tunnel-TSO-capabilities.patch	2024-03-05 17:39:30.683566490 +0800
@@ -1 +1 @@
-From daac90272857812b3da1db95caf5922f03a83343 Mon Sep 17 00:00:00 2001
+From c321ba6a9d17c218f6e37a4f8600c4911ca29ec6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit daac90272857812b3da1db95caf5922f03a83343 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/iavf: fix no polling mode switching' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (12 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/ice: fix tunnel TSO capabilities' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/iavf: fix crash on VF start' " Xueming Li
                   ` (122 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0a72821dd9ecd32734257c1a740f37b89c95c601

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0a72821dd9ecd32734257c1a740f37b89c95c601 Mon Sep 17 00:00:00 2001
From: Mingjin Ye <mingjinx.ye@intel.com>
Date: Thu, 14 Dec 2023 10:33:02 +0000
Subject: [PATCH] net/iavf: fix no polling mode switching
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5c8ca9f13c78096589e3fb2f323987df6c973f8d ]

PMD does not switch to no polling mode when the PF triggers a reset event
or the watchdog detects a reset event. In this scenario, data path will
access the freed resources and cause a core dump.

This patch fixes this issue by automatically switching modes on VF reset.

Fixes: 5b3124a0a6ef ("net/iavf: support no polling when link down")

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf.h        |  3 ++-
 drivers/net/iavf/iavf_ethdev.c | 27 +++++++++++++++++++++++----
 drivers/net/iavf/iavf_vchnl.c  | 24 ++++++++++--------------
 3 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 10868f2c30..5bfe85dabd 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -18,7 +18,7 @@

 #define IAVF_AQ_LEN               32
 #define IAVF_AQ_BUF_SZ            4096
-#define IAVF_RESET_WAIT_CNT       500
+#define IAVF_RESET_WAIT_CNT       2000
 #define IAVF_BUF_SIZE_MIN         1024
 #define IAVF_FRAME_SIZE_MAX       9728
 #define IAVF_QUEUE_BASE_ADDR_UNIT 128
@@ -512,4 +512,5 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
 int iavf_handle_hw_reset(struct rte_eth_dev *dev);
+void iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change);
 #endif /* _IAVF_ETHDEV_H_ */
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index d1edb0dd5c..0952998304 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -296,6 +296,7 @@ iavf_dev_watchdog(void *cb_arg)
 			PMD_DRV_LOG(INFO, "VF \"%s\" reset has completed",
 				adapter->vf.eth_dev->data->name);
 			adapter->vf.vf_reset = false;
+			iavf_set_no_poll(adapter, false);
 		}
 	/* If not in reset then poll vfr_inprogress register for VFLR event */
 	} else {
@@ -308,6 +309,7 @@ iavf_dev_watchdog(void *cb_arg)

 			/* enter reset state with VFLR event */
 			adapter->vf.vf_reset = true;
+			iavf_set_no_poll(adapter, false);
 			adapter->vf.link_up = false;

 			iavf_dev_event_post(adapter->vf.eth_dev, RTE_ETH_EVENT_INTR_RESET,
@@ -2916,8 +2918,10 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	 * effect.
 	 */
 out:
-	if (vf->vf_reset && !rte_pci_set_bus_master(pci_dev, true))
+	if (vf->vf_reset && !rte_pci_set_bus_master(pci_dev, true)) {
 		vf->vf_reset = false;
+		iavf_set_no_poll(adapter, false);
+	}

 	/* disable watchdog */
 	iavf_dev_watchdog_disable(adapter);
@@ -2948,6 +2952,8 @@ static int
 iavf_dev_reset(struct rte_eth_dev *dev)
 {
 	int ret;
+	struct iavf_adapter *adapter =
+		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);

@@ -2962,6 +2968,7 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 		return ret;
 	}
 	vf->vf_reset = false;
+	iavf_set_no_poll(adapter, false);

 	PMD_DRV_LOG(DEBUG, "Start dev_reset ...\n");
 	ret = iavf_dev_uninit(dev);
@@ -2977,10 +2984,13 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 int
 iavf_handle_hw_reset(struct rte_eth_dev *dev)
 {
+	struct iavf_adapter *adapter =
+		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	int ret;

 	vf->in_reset_recovery = true;
+	iavf_set_no_poll(adapter, false);

 	ret = iavf_dev_reset(dev);
 	if (ret)
@@ -2998,16 +3008,25 @@ iavf_handle_hw_reset(struct rte_eth_dev *dev)
 	if (ret)
 		goto error;
 	dev->data->dev_started = 1;
-
-	vf->in_reset_recovery = false;
-	return 0;
+	goto exit;

 error:
 	PMD_DRV_LOG(DEBUG, "RESET recover with error code=%d\n", ret);
+exit:
 	vf->in_reset_recovery = false;
+	iavf_set_no_poll(adapter, false);
 	return ret;
 }

+void
+iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change)
+{
+	struct iavf_info *vf = &adapter->vf;
+
+	adapter->no_poll = (link_change & !vf->link_up) ||
+		vf->vf_reset || vf->in_reset_recovery;
+}
+
 static int
 iavf_dcf_cap_check_handler(__rte_unused const char *key,
 			   const char *value, __rte_unused void *opaque)
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 0a3e1d082c..1111d30f57 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -273,20 +273,18 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,
 					iavf_dev_watchdog_enable(adapter);
 			}
 			if (adapter->devargs.no_poll_on_link_down) {
-				if (vf->link_up && adapter->no_poll) {
-					adapter->no_poll = false;
-					PMD_DRV_LOG(DEBUG, "VF no poll turned off");
-				}
-				if (!vf->link_up) {
-					adapter->no_poll = true;
+				iavf_set_no_poll(adapter, true);
+				if (adapter->no_poll)
 					PMD_DRV_LOG(DEBUG, "VF no poll turned on");
-				}
+				else
+					PMD_DRV_LOG(DEBUG, "VF no poll turned off");
 			}
 			PMD_DRV_LOG(INFO, "Link status update:%s",
 					vf->link_up ? "up" : "down");
 			break;
 		case VIRTCHNL_EVENT_RESET_IMPENDING:
 			vf->vf_reset = true;
+			iavf_set_no_poll(adapter, false);
 			PMD_DRV_LOG(INFO, "VF is resetting");
 			break;
 		case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
@@ -462,6 +460,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 		vf->link_up = false;
 		if (!vf->vf_reset) {
 			vf->vf_reset = true;
+			iavf_set_no_poll(adapter, false);
 			iavf_dev_event_post(dev, RTE_ETH_EVENT_INTR_RESET,
 				NULL, 0);
 		}
@@ -485,14 +484,11 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 				iavf_dev_watchdog_enable(adapter);
 		}
 		if (adapter->devargs.no_poll_on_link_down) {
-			if (vf->link_up && adapter->no_poll) {
-				adapter->no_poll = false;
-				PMD_DRV_LOG(DEBUG, "VF no poll turned off");
-			}
-			if (!vf->link_up) {
-				adapter->no_poll = true;
+			iavf_set_no_poll(adapter, true);
+			if (adapter->no_poll)
 				PMD_DRV_LOG(DEBUG, "VF no poll turned on");
-			}
+			else
+				PMD_DRV_LOG(DEBUG, "VF no poll turned off");
 		}
 		iavf_dev_event_post(dev, RTE_ETH_EVENT_INTR_LSC, NULL, 0);
 		break;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.538476919 +0800
+++ 0014-net-iavf-fix-no-polling-mode-switching.patch	2024-03-05 17:39:30.683566490 +0800
@@ -1 +1 @@
-From 5c8ca9f13c78096589e3fb2f323987df6c973f8d Mon Sep 17 00:00:00 2001
+From 0a72821dd9ecd32734257c1a740f37b89c95c601 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5c8ca9f13c78096589e3fb2f323987df6c973f8d ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/iavf: fix crash on VF start' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (13 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/iavf: fix no polling mode switching' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'net/ice: fix memory leaks' " Xueming Li
                   ` (121 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Shiyang He; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9aa2da4c022425461eb21ffbfef889edae9bd881

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9aa2da4c022425461eb21ffbfef889edae9bd881 Mon Sep 17 00:00:00 2001
From: Shiyang He <shiyangx.he@intel.com>
Date: Wed, 3 Jan 2024 10:42:07 +0000
Subject: [PATCH] net/iavf: fix crash on VF start
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 80fb3c92045824da18af333ee8a758145b54b19f ]

When the VF starts to request multiple queues, the PF sends a reset
command to the VF. During the reset process, adminq sends an abnormal
message to PF for an unknown reason, and the resource request fails
resulting in a coredump.

This patch fixes the issue by checking the reset state before resetting.

Fixes: 3e6a5d2d310a ("net/iavf: add devargs to enable VF auto-reset")

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf.h        |  3 ++-
 drivers/net/iavf/iavf_ethdev.c | 45 +++++++++++++++++++++++++++-------
 2 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 5bfe85dabd..d273d884f5 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -19,6 +19,7 @@
 #define IAVF_AQ_LEN               32
 #define IAVF_AQ_BUF_SZ            4096
 #define IAVF_RESET_WAIT_CNT       2000
+#define IAVF_RESET_DETECTED_CNT   500
 #define IAVF_BUF_SIZE_MIN         1024
 #define IAVF_FRAME_SIZE_MAX       9728
 #define IAVF_QUEUE_BASE_ADDR_UNIT 128
@@ -511,6 +512,6 @@ int iavf_flow_sub_check(struct iavf_adapter *adapter,
 			struct iavf_fsub_conf *filter);
 void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
 void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
-int iavf_handle_hw_reset(struct rte_eth_dev *dev);
+void iavf_handle_hw_reset(struct rte_eth_dev *dev);
 void iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change);
 #endif /* _IAVF_ETHDEV_H_ */
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 0952998304..32a1626420 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1088,9 +1088,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)

 	PMD_INIT_FUNC_TRACE();

-	if (vf->vf_reset)
-		return 0;
-
 	if (adapter->closed)
 		return -1;

@@ -2955,7 +2952,6 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 	struct iavf_adapter *adapter =
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);

 	/*
 	 * Check whether the VF reset has been done and inform application,
@@ -2967,7 +2963,6 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 		PMD_DRV_LOG(ERR, "Wait too long for reset done!\n");
 		return ret;
 	}
-	vf->vf_reset = false;
 	iavf_set_no_poll(adapter, false);

 	PMD_DRV_LOG(DEBUG, "Start dev_reset ...\n");
@@ -2978,17 +2973,47 @@ iavf_dev_reset(struct rte_eth_dev *dev)
 	return iavf_dev_init(dev);
 }

+static inline bool
+iavf_is_reset(struct iavf_hw *hw)
+{
+	return !(IAVF_READ_REG(hw, IAVF_VF_ARQLEN1) &
+		IAVF_VF_ARQLEN1_ARQENABLE_MASK);
+}
+
+static bool
+iavf_is_reset_detected(struct iavf_adapter *adapter)
+{
+	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter);
+	int i;
+
+	/* poll until we see the reset actually happen */
+	for (i = 0; i < IAVF_RESET_DETECTED_CNT; i++) {
+		if (iavf_is_reset(hw))
+			return true;
+		rte_delay_ms(20);
+	}
+
+	return false;
+}
+
 /*
  * Handle hardware reset
  */
-int
+void
 iavf_handle_hw_reset(struct rte_eth_dev *dev)
 {
-	struct iavf_adapter *adapter =
-		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct iavf_adapter *adapter = dev->data->dev_private;
 	int ret;

+	if (!dev->data->dev_started)
+		return;
+
+	if (!iavf_is_reset_detected(adapter)) {
+		PMD_DRV_LOG(DEBUG, "reset not start\n");
+		return;
+	}
+
 	vf->in_reset_recovery = true;
 	iavf_set_no_poll(adapter, false);

@@ -3007,6 +3032,7 @@ iavf_handle_hw_reset(struct rte_eth_dev *dev)
 	ret = iavf_dev_start(dev);
 	if (ret)
 		goto error;
+
 	dev->data->dev_started = 1;
 	goto exit;

@@ -3015,7 +3041,8 @@ error:
 exit:
 	vf->in_reset_recovery = false;
 	iavf_set_no_poll(adapter, false);
-	return ret;
+
+	return;
 }

 void
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.566084319 +0800
+++ 0015-net-iavf-fix-crash-on-VF-start.patch	2024-03-05 17:39:30.683566490 +0800
@@ -1 +1 @@
-From 80fb3c92045824da18af333ee8a758145b54b19f Mon Sep 17 00:00:00 2001
+From 9aa2da4c022425461eb21ffbfef889edae9bd881 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 80fb3c92045824da18af333ee8a758145b54b19f ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ice: fix memory leaks' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (14 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/iavf: fix crash on VF start' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'kernel/freebsd: fix module build on FreeBSD 14' " Xueming Li
                   ` (120 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Qi Zhang; +Cc: Wenjun Wu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=943de5c27e81245ded7d392cea48dd3ee65898e5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 943de5c27e81245ded7d392cea48dd3ee65898e5 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Sun, 7 Jan 2024 06:50:53 -0500
Subject: [PATCH] net/ice: fix memory leaks
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ]

Free memory for AQ buffer at icd_move_recfg_lan_txq
Free memory for profile list at ice_tm_conf_uninit

Fixes: 8c481c3bb65b ("net/ice: support queue and queue group bandwidth limit")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/ice/ice_tm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index f5ea47ae83..65b9fdf320 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -58,8 +58,15 @@ void
 ice_tm_conf_uninit(struct rte_eth_dev *dev)
 {
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct ice_tm_shaper_profile *shaper_profile;
 	struct ice_tm_node *tm_node;

+	/* clear profile */
+	while ((shaper_profile = TAILQ_FIRST(&pf->tm_conf.shaper_profile_list))) {
+		TAILQ_REMOVE(&pf->tm_conf.shaper_profile_list, shaper_profile, node);
+		rte_free(shaper_profile);
+	}
+
 	/* clear node configuration */
 	while ((tm_node = TAILQ_FIRST(&pf->tm_conf.queue_list))) {
 		TAILQ_REMOVE(&pf->tm_conf.queue_list, tm_node, node);
@@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
 	uint16_t buf_size = ice_struct_size(buf, txqs, 1);

 	buf = (struct ice_aqc_move_txqs_data *)ice_malloc(hw, sizeof(*buf));
+	if (buf == NULL)
+		return -ENOMEM;

 	queue_parent_node = queue_sched_node->parent;
 	buf->src_teid = queue_parent_node->info.node_teid;
@@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
 					NULL, buf, buf_size, &txqs_moved, NULL);
 	if (ret || txqs_moved == 0) {
 		PMD_DRV_LOG(ERR, "move lan queue %u failed", queue_id);
+		rte_free(buf);
 		return ICE_ERR_PARAM;
 	}

@@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
 	} else {
 		PMD_DRV_LOG(ERR, "invalid children number %d for queue %u",
 			    queue_parent_node->num_children, queue_id);
+		rte_free(buf);
 		return ICE_ERR_PARAM;
 	}
 	dst_node->children[dst_node->num_children++] = queue_sched_node;
 	queue_sched_node->parent = dst_node;
 	ice_sched_query_elem(hw, queue_sched_node->info.node_teid, &queue_sched_node->info);

+	rte_free(buf);
 	return ret;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.595962520 +0800
+++ 0016-net-ice-fix-memory-leaks.patch	2024-03-05 17:39:30.683566490 +0800
@@ -1 +1 @@
-From 546ee62dd441730daae181e336f30b315c5fb16f Mon Sep 17 00:00:00 2001
+From 943de5c27e81245ded7d392cea48dd3ee65898e5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 546ee62dd441730daae181e336f30b315c5fb16f ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index b570798f07..c00ecb6a97 100644
+index f5ea47ae83..65b9fdf320 100644
@@ -22 +24 @@
-@@ -59,8 +59,15 @@ void
+@@ -58,8 +58,15 @@ void
@@ -38 +40 @@
-@@ -636,6 +643,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
+@@ -648,6 +655,8 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
@@ -47 +49 @@
-@@ -647,6 +656,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
+@@ -659,6 +668,7 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
@@ -55 +57 @@
-@@ -656,12 +666,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,
+@@ -668,12 +678,14 @@ static int ice_move_recfg_lan_txq(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'kernel/freebsd: fix module build on FreeBSD 14' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (15 preceding siblings ...)
  2024-03-05  9:45 ` patch 'net/ice: fix memory leaks' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:45 ` patch 'build: fix reasons conflict' " Xueming Li
                   ` (119 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Daxue Gao, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=54e4045c780242359f0432af50093b09e6496944

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 54e4045c780242359f0432af50093b09e6496944 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 19 Dec 2023 11:29:59 +0000
Subject: [PATCH] kernel/freebsd: fix module build on FreeBSD 14
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5eedf66ac0e5ce62cd333e523996c63a3c4c2c00 ]

When building nic_uio module on FreeBSD 14, a build error is given in
the DRIVER_MODULE macro:

nic_uio.c:84:81: error: too many arguments provided to function-like macro invocation
DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0);
                                                                                ^
On FreeBSD 14, the devclass parameter is dropped from the macro,
so we conditionally compile a different invocation
for BSD versions before/after v14.

Bugzilla ID: 1335

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
---
 kernel/freebsd/nic_uio/nic_uio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/freebsd/nic_uio/nic_uio.c b/kernel/freebsd/nic_uio/nic_uio.c
index 7a81694c92..0043892870 100644
--- a/kernel/freebsd/nic_uio/nic_uio.c
+++ b/kernel/freebsd/nic_uio/nic_uio.c
@@ -78,10 +78,14 @@ struct pci_bdf {
 	uint32_t function;
 };

-static devclass_t nic_uio_devclass;
-
 DEFINE_CLASS_0(nic_uio, nic_uio_driver, nic_uio_methods, sizeof(struct nic_uio_softc));
+
+#if __FreeBSD_version < 1400000
+static devclass_t nic_uio_devclass;
 DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_devclass, nic_uio_modevent, 0);
+#else
+DRIVER_MODULE(nic_uio, pci, nic_uio_driver, nic_uio_modevent, 0);
+#endif

 static int
 nic_uio_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.621323621 +0800
+++ 0017-kernel-freebsd-fix-module-build-on-FreeBSD-14.patch	2024-03-05 17:39:30.683566490 +0800
@@ -1 +1 @@
-From 5eedf66ac0e5ce62cd333e523996c63a3c4c2c00 Mon Sep 17 00:00:00 2001
+From 54e4045c780242359f0432af50093b09e6496944 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5eedf66ac0e5ce62cd333e523996c63a3c4c2c00 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'build: fix reasons conflict' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (16 preceding siblings ...)
  2024-03-05  9:45 ` patch 'kernel/freebsd: fix module build on FreeBSD 14' " Xueming Li
@ 2024-03-05  9:45 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/graph: fix build reason' " Xueming Li
                   ` (118 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:45 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7872a7b0bd6270b7fb47ebd3f10d70ff2e118d54

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7872a7b0bd6270b7fb47ebd3f10d70ff2e118d54 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 31 Jan 2024 18:45:51 +0100
Subject: [PATCH] build: fix reasons conflict
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a206a01537eb04fabad9236372991ace6c5c0b4b ]

The "_disable_reason" variables are subject to naming conflicts.

This has been caught while looking at mingw builds where the graph
application was skipped with an <unknown_reason> (which is caused by a
missing reason variable set in app/graph/meson.build) and the graph
library was skipped with the same <unknown_reason> too, even though
this library meson does set a proper reason variable.

Example in GHA:

=================
Content Skipped
=================

apps:
	dumpcap:	not supported on Windows
	graph:	<unknown reason>
	pdump:	not supported on Windows
...

libs:
	acl:	not supported on Windows
	bbdev:	not supported on Windows
...
	graph:	<unknown reason>
	node:	not supported on Windows

Prefix all those variables with the type of component.

Fixes: ecf75180171b ("build: list selected applications")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 app/meson.build                |  2 +-
 drivers/common/qat/meson.build | 10 +++++-----
 drivers/meson.build            |  4 ++--
 lib/meson.build                |  2 +-
 meson.build                    |  6 +++---
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index 8aaed59f39..21b6da29b3 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -93,7 +93,7 @@ foreach app:apps
     if not build
         if reason != ''
             dpdk_apps_disabled += app
-            set_variable(app.underscorify() + '_disable_reason', reason)
+            set_variable('app_' + app.underscorify() + '_disable_reason', reason)
         endif
         continue
     endif
diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build
index 5c36fbb270..62abcb6fe3 100644
--- a/drivers/common/qat/meson.build
+++ b/drivers/common/qat/meson.build
@@ -17,13 +17,13 @@ qat_compress_relpath = '../../' + qat_compress_path
 if disable_drivers.contains(qat_crypto_path)
     qat_crypto = false
     dpdk_drvs_disabled += qat_crypto_path
-    set_variable(qat_crypto_path.underscorify() + '_disable_reason',
+    set_variable('drv_' + qat_crypto_path.underscorify() + '_disable_reason',
             'Explicitly disabled via build config')
 endif
 if disable_drivers.contains(qat_compress_path)
     qat_compress = false
     dpdk_drvs_disabled += qat_compress_path
-    set_variable(qat_compress_path.underscorify() + '_disable_reason',
+    set_variable('drv_' + qat_compress_path.underscorify() + '_disable_reason',
             'Explicitly disabled via build config')
 endif

@@ -36,7 +36,7 @@ if arch_subdir == 'arm'
     else
         qat_crypto = false
         dpdk_drvs_disabled += qat_crypto_path
-        set_variable(qat_crypto_path.underscorify() + '_disable_reason',
+        set_variable('drv_' + qat_crypto_path.underscorify() + '_disable_reason',
         'missing dependency for Arm, libcrypto')
     endif
 else
@@ -57,7 +57,7 @@ else
         else
             qat_crypto = false
             dpdk_drvs_disabled += qat_crypto_path
-            set_variable(qat_crypto_path.underscorify() + '_disable_reason',
+            set_variable('drv_' + qat_crypto_path.underscorify() + '_disable_reason',
                 'missing dependency, libipsecmb or libcrypto')
         endif
     elif libcrypto.found()
@@ -66,7 +66,7 @@ else
     else
         qat_crypto = false
         dpdk_drvs_disabled += qat_crypto_path
-        set_variable(qat_crypto_path.underscorify() + '_disable_reason',
+        set_variable('drv_' + qat_crypto_path.underscorify() + '_disable_reason',
             'missing dependency, libipsecmb or libcrypto')
     endif
 endif
diff --git a/drivers/meson.build b/drivers/meson.build
index 5ba534049a..f2be71bc05 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -93,7 +93,7 @@ foreach subpath:subdirs
         if skip_class
             drv_path = join_paths(class, '*')
             dpdk_drvs_disabled += drv_path
-            set_variable(drv_path.underscorify() + '_disable_reason', reason)
+            set_variable('drv_' + drv_path.underscorify() + '_disable_reason', reason)
             continue
         endif
     endif
@@ -199,7 +199,7 @@ foreach subpath:subdirs
             # component disable printout in those cases
             if reason != ''
                 dpdk_drvs_disabled += drv_path
-                set_variable(drv_path.underscorify() + '_disable_reason', reason)
+                set_variable('drv_' + drv_path.underscorify() + '_disable_reason', reason)
             endif
             continue
         endif
diff --git a/lib/meson.build b/lib/meson.build
index 6c143ce5a6..55d483cd26 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -228,7 +228,7 @@ foreach l:libraries

     if not build
         dpdk_libs_disabled += name
-        set_variable(name.underscorify() + '_disable_reason', reason)
+        set_variable('lib_' + name.underscorify() + '_disable_reason', reason)
         continue
     endif

diff --git a/meson.build b/meson.build
index 5e161f43e5..8b248d4505 100644
--- a/meson.build
+++ b/meson.build
@@ -164,17 +164,17 @@ message(output_message + '\n')
 output_message = '\n=================\nContent Skipped\n=================\n'
 output_message += '\napps:\n\t'
 foreach app:dpdk_apps_disabled
-    reason = get_variable(app.underscorify() + '_disable_reason')
+    reason = get_variable('app_' + app.underscorify() + '_disable_reason')
     output_message += app + ':\t' + reason + '\n\t'
 endforeach
 output_message += '\nlibs:\n\t'
 foreach lib:dpdk_libs_disabled
-    reason = get_variable(lib.underscorify() + '_disable_reason')
+    reason = get_variable('lib_' + lib.underscorify() + '_disable_reason')
     output_message += lib + ':\t' + reason + '\n\t'
 endforeach
 output_message += '\ndrivers:\n\t'
 foreach drv:dpdk_drvs_disabled
-    reason = get_variable(drv.underscorify() + '_disable_reason')
+    reason = get_variable('drv_' + drv.underscorify() + '_disable_reason')
     output_message += drv + ':\t' + reason + '\n\t'
 endforeach
 message(output_message + '\n')
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.648534022 +0800
+++ 0018-build-fix-reasons-conflict.patch	2024-03-05 17:39:30.693566490 +0800
@@ -1 +1 @@
-From a206a01537eb04fabad9236372991ace6c5c0b4b Mon Sep 17 00:00:00 2001
+From 7872a7b0bd6270b7fb47ebd3f10d70ff2e118d54 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a206a01537eb04fabad9236372991ace6c5c0b4b ]
@@ -36 +38,0 @@
-Cc: stable@dpdk.org
@@ -132 +134 @@
-index 72e9138d14..8637b72ab5 100644
+index 6c143ce5a6..55d483cd26 100644
@@ -135 +137 @@
-@@ -201,7 +201,7 @@ foreach l:libraries
+@@ -228,7 +228,7 @@ foreach l:libraries

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/graph: fix build reason' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (17 preceding siblings ...)
  2024-03-05  9:45 ` patch 'build: fix reasons conflict' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'telemetry: fix connected clients count' " Xueming Li
                   ` (117 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Tyler Retzlaff, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d7dc4804327b8d3df9a7a744912da00f7b82bfac

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d7dc4804327b8d3df9a7a744912da00f7b82bfac Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 31 Jan 2024 18:45:52 +0100
Subject: [PATCH] app/graph: fix build reason
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d9b797782bc36707e5689ae0362be4c2267461df ]

When a component is disabled, the reason meson variable must be set to
provide an explanation why.

Since epoll is a Linux thing, report that the graph application is only
supported on Linux.

Fixes: 5b21ffb23308 ("app/graph: add CLI framework")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 app/graph/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/graph/meson.build b/app/graph/meson.build
index 5b0f966d99..8aefdf505c 100644
--- a/app/graph/meson.build
+++ b/app/graph/meson.build
@@ -5,6 +5,7 @@
 name = 'graph'
 build = cc.has_header('sys/epoll.h')
 if not build
+    reason = 'only supported on Linux'
     subdir_done()
 endif

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.674285723 +0800
+++ 0019-app-graph-fix-build-reason.patch	2024-03-05 17:39:30.693566490 +0800
@@ -1 +1 @@
-From d9b797782bc36707e5689ae0362be4c2267461df Mon Sep 17 00:00:00 2001
+From d7dc4804327b8d3df9a7a744912da00f7b82bfac Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d9b797782bc36707e5689ae0362be4c2267461df ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'telemetry: fix connected clients count' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (18 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/graph: fix build reason' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'telemetry: fix empty JSON dictionaries' " Xueming Li
                   ` (116 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Shaowei Sun; +Cc: Bruce Richardson, Ciara Power, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cbd1c165bb1ea86efc31c8ac309ee5e7c5f555cb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cbd1c165bb1ea86efc31c8ac309ee5e7c5f555cb Mon Sep 17 00:00:00 2001
From: Shaowei Sun <1819846787@qq.com>
Date: Tue, 30 Jan 2024 09:57:04 +0800
Subject: [PATCH] telemetry: fix connected clients count
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e14bb5f1050924de1602033596d5b417bfbeee52 ]

Telemetry can only create 10 conns by default, each of which is processed
by a thread.

When a thread fails to write using socket, the thread will end directly
without reducing the total number of conns.

This will result in the machine running for a long time, and if there are
10 failures, the telemetry will be unavailable

Fixes: 2a7d0b872f79 ("telemetry: add upper limit on connections")

Signed-off-by: Shaowei Sun <1819846787@qq.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 .mailmap                  | 1 +
 lib/telemetry/telemetry.c | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index ab0742a382..8d8f5b1b5d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1278,6 +1278,7 @@ Shally Verma <shallyv@marvell.com> <shally.verma@caviumnetworks.com>
 Shannon Nelson <snelson@pensando.io>
 Shannon Zhao <zhaoshenglong@huawei.com>
 Shaopeng He <shaopeng.he@intel.com>
+Shaowei Sun <1819846787@qq.com>
 Sharmila Podury <sharmila.podury@att.com>
 Sharon Haroni <sharon.haroni@intel.com>
 Shay Agroskin <shayagr@amazon.com>
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 92982842a8..ee4718a4b3 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -377,8 +377,8 @@ client_handler(void *sock_id)
 			"{\"version\":\"%s\",\"pid\":%d,\"max_output_len\":%d}",
 			telemetry_version, getpid(), MAX_OUTPUT_LEN);
 	if (write(s, info_str, strlen(info_str)) < 0) {
-		close(s);
-		return NULL;
+		TMTY_LOG(ERR, "Socket write base info to client failed\n");
+		goto exit;
 	}

 	/* receive data is not null terminated */
@@ -403,6 +403,7 @@ client_handler(void *sock_id)

 		bytes = read(s, buffer, sizeof(buffer) - 1);
 	}
+exit:
 	close(s);
 	rte_atomic_fetch_sub_explicit(&v2_clients, 1, rte_memory_order_relaxed);
 	return NULL;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.698145124 +0800
+++ 0020-telemetry-fix-connected-clients-count.patch	2024-03-05 17:39:30.693566490 +0800
@@ -1 +1 @@
-From e14bb5f1050924de1602033596d5b417bfbeee52 Mon Sep 17 00:00:00 2001
+From cbd1c165bb1ea86efc31c8ac309ee5e7c5f555cb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e14bb5f1050924de1602033596d5b417bfbeee52 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index aa569ff456..a0756974e2 100644
+index ab0742a382..8d8f5b1b5d 100644
@@ -31 +33 @@
-@@ -1281,6 +1281,7 @@ Shally Verma <shallyv@marvell.com> <shally.verma@caviumnetworks.com>
+@@ -1278,6 +1278,7 @@ Shally Verma <shallyv@marvell.com> <shally.verma@caviumnetworks.com>
@@ -40 +42 @@
-index 47846ef868..d4720197ba 100644
+index 92982842a8..ee4718a4b3 100644
@@ -43 +45 @@
-@@ -378,8 +378,8 @@ client_handler(void *sock_id)
+@@ -377,8 +377,8 @@ client_handler(void *sock_id)
@@ -49 +51 @@
-+		TMTY_LOG_LINE(ERR, "Socket write base info to client failed");
++		TMTY_LOG(ERR, "Socket write base info to client failed\n");
@@ -54 +56 @@
-@@ -404,6 +404,7 @@ client_handler(void *sock_id)
+@@ -403,6 +403,7 @@ client_handler(void *sock_id)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'telemetry: fix empty JSON dictionaries' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (19 preceding siblings ...)
  2024-03-05  9:46 ` patch 'telemetry: fix connected clients count' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'gro: fix reordering of packets' " Xueming Li
                   ` (115 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Jonathan Erb; +Cc: Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b5c580913f3fd171f6324940b978bca487c36fc4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b5c580913f3fd171f6324940b978bca487c36fc4 Mon Sep 17 00:00:00 2001
From: Jonathan Erb <jonathan.erb@threater.com>
Date: Thu, 18 Jan 2024 12:26:02 -0500
Subject: [PATCH] telemetry: fix empty JSON dictionaries
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 324ec1df541711ca829f4d99b7e2d32ffe38d3ca ]

Fix to allow telemetry to handle empty dictionaries correctly.

This patch resolves an issue where empty dictionaries are reported
by telemetry as '[]' rather than '{}'. Initializing the output
buffer based on the container type resolves the issue.

Fixes: c933bb5177ca ("telemetry: support array values in data object")

Signed-off-by: Jonathan Erb <jonathan.erb@threater.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 .mailmap                  | 2 +-
 lib/telemetry/telemetry.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8d8f5b1b5d..bff68cefd8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -675,7 +675,7 @@ John Ousterhout <ouster@cs.stanford.edu>
 John Romein <romein@astron.nl>
 John W. Linville <linville@tuxdriver.com>
 Jonas Pfefferle <jpf@zurich.ibm.com> <pepperjo@japf.ch>
-Jonathan Erb <jonathan.erb@threatblockr.com> <jonathan.erb@banduracyber.com>
+Jonathan Erb <jonathan.erb@threater.com> <jonathan.erb@threatblockr.com> <jonathan.erb@banduracyber.com>
 Jonathan Tsai <jonathan1.tsai@intel.com>
 Jon DeVree <nuxi@vault24.org>
 Jon Loeliger <jdl@netgate.com>
diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index ee4718a4b3..88d6410980 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -169,7 +169,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
 		d->type != TEL_ARRAY_INT && d->type != TEL_ARRAY_STRING)
 		return snprintf(out_buf, buf_len, "null");

-	used = rte_tel_json_empty_array(out_buf, buf_len, 0);
+	if (d->type == TEL_DICT)
+		used = rte_tel_json_empty_obj(out_buf, buf_len, 0);
+	else
+		used = rte_tel_json_empty_array(out_buf, buf_len, 0);
+
 	if (d->type == TEL_ARRAY_UINT)
 		for (i = 0; i < d->data_len; i++)
 			used = rte_tel_json_add_array_uint(out_buf,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.721663925 +0800
+++ 0021-telemetry-fix-empty-JSON-dictionaries.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 324ec1df541711ca829f4d99b7e2d32ffe38d3ca Mon Sep 17 00:00:00 2001
+From b5c580913f3fd171f6324940b978bca487c36fc4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 324ec1df541711ca829f4d99b7e2d32ffe38d3ca ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index a0756974e2..de339562f4 100644
+index 8d8f5b1b5d..bff68cefd8 100644
@@ -26 +28 @@
-@@ -676,7 +676,7 @@ John Ousterhout <ouster@cs.stanford.edu>
+@@ -675,7 +675,7 @@ John Ousterhout <ouster@cs.stanford.edu>
@@ -36 +38 @@
-index d4720197ba..1663bd8c68 100644
+index ee4718a4b3..88d6410980 100644
@@ -39 +41 @@
-@@ -170,7 +170,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)
+@@ -169,7 +169,11 @@ container_to_json(const struct rte_tel_data *d, char *out_buf, size_t buf_len)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'gro: fix reordering of packets' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (20 preceding siblings ...)
  2024-03-05  9:46 ` patch 'telemetry: fix empty JSON dictionaries' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'ci: update versions of actions in GHA' " Xueming Li
                   ` (114 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Kumara Parameshwaran; +Cc: Jiayu Hu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d7a30d20c42e7409e1e9e3f3ad525898982befb3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d7a30d20c42e7409e1e9e3f3ad525898982befb3 Mon Sep 17 00:00:00 2001
From: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Date: Mon, 8 Jan 2024 21:34:53 +0530
Subject: [PATCH] gro: fix reordering of packets
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 547f294357690ab8501f120457a82919b1217517 ]

In the current implementation when a packet is received with
special TCP flag(s) set, only that packet is delivered out of order.
There could be already coalesced packets in the GRO table
belonging to the same flow but not delivered.
This fix makes sure that the entire segment is delivered with the
special flag(s) set which is how the Linux GRO is also implemented.

Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4")

Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Jiayu Hu <hujiayu.hu@foxmail.com>
---
 lib/gro/gro_tcp.h          |  9 +++++++++
 lib/gro/gro_tcp4.c         | 36 +++++++++++++++++++++++++++---------
 lib/gro/gro_tcp_internal.h |  2 +-
 lib/gro/gro_vxlan_tcp4.c   |  5 +++--
 4 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/lib/gro/gro_tcp.h b/lib/gro/gro_tcp.h
index d926c4b8cc..2c68b5f23e 100644
--- a/lib/gro/gro_tcp.h
+++ b/lib/gro/gro_tcp.h
@@ -19,6 +19,8 @@
 #define INVALID_TCP_HDRLEN(len) \
 	(((len) < sizeof(struct rte_tcp_hdr)) || ((len) > MAX_TCP_HLEN))

+#define VALID_GRO_TCP_FLAGS (RTE_TCP_ACK_FLAG | RTE_TCP_PSH_FLAG | RTE_TCP_FIN_FLAG)
+
 struct cmn_tcp_key {
 	struct rte_ether_addr eth_saddr;
 	struct rte_ether_addr eth_daddr;
@@ -81,11 +83,13 @@ merge_two_tcp_packets(struct gro_tcp_item *item,
 		struct rte_mbuf *pkt,
 		int cmp,
 		uint32_t sent_seq,
+		uint8_t tcp_flags,
 		uint16_t ip_id,
 		uint16_t l2_offset)
 {
 	struct rte_mbuf *pkt_head, *pkt_tail, *lastseg;
 	uint16_t hdr_len, l2_len;
+	struct rte_tcp_hdr *tcp_hdr;

 	if (cmp > 0) {
 		pkt_head = item->firstseg;
@@ -128,6 +132,11 @@ merge_two_tcp_packets(struct gro_tcp_item *item,
 	/* update MBUF metadata for the merged packet */
 	pkt_head->nb_segs += pkt_tail->nb_segs;
 	pkt_head->pkt_len += pkt_tail->pkt_len;
+	if (tcp_flags != RTE_TCP_ACK_FLAG) {
+		tcp_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_tcp_hdr *,
+						l2_offset + pkt_head->l2_len + pkt_head->l3_len);
+		tcp_hdr->tcp_flags |= tcp_flags;
+	}

 	return 1;
 }
diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
index 6645de592b..c8b8d7990c 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -126,6 +126,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 	uint32_t item_idx;
 	uint32_t i, max_flow_num, remaining_flow_num;
 	uint8_t find;
+	uint32_t item_start_idx;

 	/*
 	 * Don't process the packet whose TCP header length is greater
@@ -139,11 +140,8 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 	tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len;

-	/*
-	 * Don't process the packet which has FIN, SYN, RST, PSH, URG, ECE
-	 * or CWR set.
-	 */
-	if (tcp_hdr->tcp_flags != RTE_TCP_ACK_FLAG)
+	/* Return early if the TCP flags are not handled in GRO layer */
+	if (tcp_hdr->tcp_flags & ~VALID_GRO_TCP_FLAGS)
 		return -1;

 	/* trim the tail padding bytes */
@@ -183,13 +181,35 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 		if (tbl->flows[i].start_index != INVALID_ARRAY_INDEX) {
 			if (is_same_tcp4_flow(tbl->flows[i].key, key)) {
 				find = 1;
+				item_start_idx = tbl->flows[i].start_index;
 				break;
 			}
 			remaining_flow_num--;
 		}
 	}

-	if (find == 0) {
+	if (find == 1) {
+		/*
+		 * Any packet with additional flags like PSH,FIN should be processed
+		 * and flushed immediately.
+		 * Hence marking the start time to 0, so that the packets will be flushed
+		 * immediately in timer mode.
+		 */
+		if (tcp_hdr->tcp_flags & (RTE_TCP_ACK_FLAG | RTE_TCP_PSH_FLAG | RTE_TCP_FIN_FLAG)) {
+			if (tcp_hdr->tcp_flags != RTE_TCP_ACK_FLAG)
+				tbl->items[item_start_idx].start_time = 0;
+			return process_tcp_item(pkt, tcp_hdr, tcp_dl, tbl->items,
+						tbl->flows[i].start_index, &tbl->item_num,
+						tbl->max_item_num, ip_id, is_atomic, start_time);
+		} else {
+			return -1;
+		}
+	}
+	/*
+	 * Add new flow to the table only if contains ACK flag with data.
+	 * Do not add any packets with additional tcp flags to the GRO table
+	 */
+	if (tcp_hdr->tcp_flags == RTE_TCP_ACK_FLAG) {
 		sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 		item_idx = insert_new_tcp_item(pkt, tbl->items, &tbl->item_num,
 						tbl->max_item_num, start_time,
@@ -209,9 +229,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 		return 0;
 	}

-	return process_tcp_item(pkt, tcp_hdr, tcp_dl, tbl->items, tbl->flows[i].start_index,
-						&tbl->item_num, tbl->max_item_num,
-						ip_id, is_atomic, start_time);
+	return -1;
 }

 /*
diff --git a/lib/gro/gro_tcp_internal.h b/lib/gro/gro_tcp_internal.h
index cc84abeaeb..e4855da1ad 100644
--- a/lib/gro/gro_tcp_internal.h
+++ b/lib/gro/gro_tcp_internal.h
@@ -101,7 +101,7 @@ process_tcp_item(struct rte_mbuf *pkt,
 				is_atomic);
 		if (cmp) {
 			if (merge_two_tcp_packets(&items[cur_idx],
-						pkt, cmp, sent_seq, ip_id, 0))
+						pkt, cmp, sent_seq, tcp_hdr->tcp_flags, ip_id, 0))
 				return 1;
 			/*
 			 * Fail to merge the two packets, as the packet
diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c
index 6ab7001922..8dd62a949c 100644
--- a/lib/gro/gro_vxlan_tcp4.c
+++ b/lib/gro/gro_vxlan_tcp4.c
@@ -239,10 +239,11 @@ merge_two_vxlan_tcp4_packets(struct gro_vxlan_tcp4_item *item,
 		struct rte_mbuf *pkt,
 		int cmp,
 		uint32_t sent_seq,
+		uint8_t tcp_flags,
 		uint16_t outer_ip_id,
 		uint16_t ip_id)
 {
-	if (merge_two_tcp_packets(&item->inner_item, pkt, cmp, sent_seq,
+	if (merge_two_tcp_packets(&item->inner_item, pkt, cmp, sent_seq, tcp_flags,
 				ip_id, pkt->outer_l2_len +
 				pkt->outer_l3_len)) {
 		/* Update the outer IPv4 ID to the large value. */
@@ -413,7 +414,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 				tcp_dl, outer_is_atomic, is_atomic);
 		if (cmp) {
 			if (merge_two_vxlan_tcp4_packets(&(tbl->items[cur_idx]),
-						pkt, cmp, sent_seq,
+						pkt, cmp, sent_seq, tcp_hdr->tcp_flags,
 						outer_ip_id, ip_id))
 				return 1;
 			/*
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.746546825 +0800
+++ 0022-gro-fix-reordering-of-packets.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 547f294357690ab8501f120457a82919b1217517 Mon Sep 17 00:00:00 2001
+From d7a30d20c42e7409e1e9e3f3ad525898982befb3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 547f294357690ab8501f120457a82919b1217517 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index bbd2f9c16a..e9be7b95d1 100644
+index d926c4b8cc..2c68b5f23e 100644
@@ -65 +67 @@
-index d6c0f9182d..855cc7a71d 100644
+index 6645de592b..c8b8d7990c 100644
@@ -152 +154 @@
-index 2752650389..29d4a2e13d 100644
+index 6ab7001922..8dd62a949c 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'ci: update versions of actions in GHA' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (21 preceding siblings ...)
  2024-03-05  9:46 ` patch 'gro: fix reordering of packets' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'eal/x86: add AMD vendor check for TSC calibration' " Xueming Li
                   ` (113 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Aaron Conole, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a9e8fc49d9c537910ba78371b84766395004e2ef

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a9e8fc49d9c537910ba78371b84766395004e2ef Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 31 Jan 2024 18:44:36 +0100
Subject: [PATCH] ci: update versions of actions in GHA
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2ea7994ae39ff979b15899ec9eb9c68c944d4b11 ]

GitHub started deprecating GHA actions based on Node 16 [1].
For now, only warnings are raised, but we might as well switch to v4
versions of the common actions, now.

Link: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
---
 .github/workflows/build.yml | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 272a6ffc7f..6b35c56da0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -72,7 +72,7 @@ jobs:

     steps:
     - name: Checkout sources
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
     - name: Generate cache keys
       id: get_ref_keys
       run: |
@@ -80,7 +80,7 @@ jobs:
         echo 'libabigail=libabigail-${{ env.LIBABIGAIL_VERSION }}-${{ matrix.config.os }}' >> $GITHUB_OUTPUT
         echo 'abi=abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.REF_GIT_TAG }}' >> $GITHUB_OUTPUT
     - name: Retrieve ccache cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         path: ~/.ccache
         key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
@@ -88,13 +88,13 @@ jobs:
           ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
     - name: Retrieve libabigail cache
       id: libabigail-cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       if: env.ABI_CHECKS == 'true'
       with:
         path: libabigail
         key: ${{ steps.get_ref_keys.outputs.libabigail }}
     - name: Retrieve ABI reference cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       if: env.ABI_CHECKS == 'true'
       with:
         path: reference
@@ -143,7 +143,7 @@ jobs:
       run: .ci/linux-build.sh
     - name: Upload logs on failure
       if: failure()
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: meson-logs-${{ join(matrix.config.*, '-') }}
         path: |
@@ -171,7 +171,7 @@ jobs:
         echo 'image=image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d) >> $GITHUB_OUTPUT
     - name: Retrieve image cache
       id: image_cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         path: ~/.image
         key: ${{ steps.get_keys.outputs.image }}
@@ -218,7 +218,7 @@ jobs:

     steps:
     - name: Checkout sources
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
     - name: Generate various keys
       id: get_keys
       run: |
@@ -226,7 +226,7 @@ jobs:
         echo 'logs=meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':' >> $GITHUB_OUTPUT
     - name: Retrieve image cache
       id: image_cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         path: ~/.image
         key: ${{ needs.prepare-container-images.outputs.image }}
@@ -236,7 +236,7 @@ jobs:
         echo 'Image ${{ matrix.config.image }} is not cached.'
         false
     - name: Retrieve ccache cache
-      uses: actions/cache@v3
+      uses: actions/cache@v4
       with:
         path: ~/.ccache
         key: ${{ steps.get_keys.outputs.ccache }}-${{ github.ref }}
@@ -276,7 +276,7 @@ jobs:
       run: docker kill dpdk
     - name: Upload logs on failure
       if: failure()
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: ${{ steps.get_keys.outputs.logs }}
         path: |
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.776755526 +0800
+++ 0023-ci-update-versions-of-actions-in-GHA.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 2ea7994ae39ff979b15899ec9eb9c68c944d4b11 Mon Sep 17 00:00:00 2001
+From a9e8fc49d9c537910ba78371b84766395004e2ef Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2ea7994ae39ff979b15899ec9eb9c68c944d4b11 ]
@@ -12,2 +14,0 @@
-Cc: stable@dpdk.org
-
@@ -21 +22 @@
-index 421207c241..776fbf6f30 100644
+index 272a6ffc7f..6b35c56da0 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eal/x86: add AMD vendor check for TSC calibration' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (22 preceding siblings ...)
  2024-03-05  9:46 ` patch 'ci: update versions of actions in GHA' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05 11:17   ` Tummala, Sivaprasad
  2024-03-05  9:46 ` patch 'doc: remove cmdline polling mode deprecation notice' " Xueming Li
                   ` (112 subsequent siblings)
  136 siblings, 1 reply; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Sivaprasad Tummala; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0 Mon Sep 17 00:00:00 2001
From: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Date: Wed, 22 Nov 2023 23:27:30 -0800
Subject: [PATCH] eal/x86: add AMD vendor check for TSC calibration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 31d72ff4dc7c057366153e9918ac92bf9123a3bc ]

AMD Epyc processors doesn't support get_tsc_freq_arch().
The patch allows graceful return to allow fallback to
alternate TSC calibration.

Fixes: 3dbc565e81a0 ("timer: honor arch-specific TSC frequency query")

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 lib/eal/x86/rte_cycles.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index 69ed59b4f0..f147a5231d 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -10,6 +10,10 @@
 #include <cpuid.h>
 #endif

+#define x86_vendor_amd(t1, t2, t3)        \
+	((t1 == 0x68747541) && /* htuA */   \
+	 (t2 == 0x444d4163) && /* DMAc */   \
+	 (t3 == 0x69746e65))   /* itne */

 #include "eal_private.h"

@@ -110,6 +114,18 @@ get_tsc_freq_arch(void)
 	uint8_t mult, model;
 	int32_t ret;

+#ifdef RTE_TOOLCHAIN_MSVC
+	__cpuid(cpuinfo, 0);
+	a = cpuinfo[0];
+	b = cpuinfo[1];
+	c = cpuinfo[2];
+	d = cpuinfo[3];
+#else
+	__cpuid(0, a, b, c, d);
+#endif
+	if (x86_vendor_amd(b, c, d))
+		return 0;
+
 	/*
 	 * Time Stamp Counter and Nominal Core Crystal Clock
 	 * Information Leaf
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.808571927 +0800
+++ 0024-eal-x86-add-AMD-vendor-check-for-TSC-calibration.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 31d72ff4dc7c057366153e9918ac92bf9123a3bc Mon Sep 17 00:00:00 2001
+From 5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 31d72ff4dc7c057366153e9918ac92bf9123a3bc ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: remove cmdline polling mode deprecation notice' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (23 preceding siblings ...)
  2024-03-05  9:46 ` patch 'eal/x86: add AMD vendor check for TSC calibration' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'eal: verify strdup return' " Xueming Li
                   ` (111 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=bb34c79bf4d107dc8ccd952c48960523b58527ff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bb34c79bf4d107dc8ccd952c48960523b58527ff Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 11 Dec 2023 08:52:37 -0800
Subject: [PATCH] doc: remove cmdline polling mode deprecation notice
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1b4cdb197ce38ac719b9b0b98fc55c75dbb03450 ]

cmdline_poll has been removed by:
commit f44f2edd198a ("cmdline: remove poll function")
but deprecation notice was left behind.

Fixes: f44f2edd198a ("cmdline: remove poll function")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 81b93515cb..10630ba255 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -27,10 +27,6 @@ Deprecation Notices
 * kvargs: The function ``rte_kvargs_process`` will get a new parameter
   for returning key match count. It will ease handling of no-match case.

-* cmdline: The function ``cmdline_poll`` does not work correctly on either
-  Linux or Windows and is unused by any part of DPDK.
-  This function is now deprecated and will be removed in DPDK 23.11.
-
 * telemetry: The functions ``rte_tel_data_add_array_u64`` and ``rte_tel_data_add_dict_u64``,
   used by telemetry callbacks for adding unsigned integer values to be returned to the user,
   are renamed to ``rte_tel_data_add_array_uint`` and ``rte_tel_data_add_dict_uint`` respectively.
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.842664829 +0800
+++ 0025-doc-remove-cmdline-polling-mode-deprecation-notice.patch	2024-03-05 17:39:30.703566491 +0800
@@ -1 +1 @@
-From 1b4cdb197ce38ac719b9b0b98fc55c75dbb03450 Mon Sep 17 00:00:00 2001
+From bb34c79bf4d107dc8ccd952c48960523b58527ff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1b4cdb197ce38ac719b9b0b98fc55c75dbb03450 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eal: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (24 preceding siblings ...)
  2024-03-05  9:46 ` patch 'doc: remove cmdline polling mode deprecation notice' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'bus/dpaa: " Xueming Li
                   ` (110 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2feed5de509bed9536955e38c0a917126fbe6283

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2feed5de509bed9536955e38c0a917126fbe6283 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:02 +0000
Subject: [PATCH] eal: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5821a384a4ca611e0f67786400b9f5b18f34a416 ]

Add verify strdup() return value logic.

Fixes: 293c53d8b23c ("eal: add telemetry callbacks")
Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/eal/common/eal_common_options.c | 24 ++++++++++++++++++++++--
 lib/eal/linux/eal_dev.c             |  2 ++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index e9ba01fb89..aec51736f2 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -226,6 +226,8 @@ eal_save_args(int argc, char **argv)
 		if (strcmp(argv[i], "--") == 0)
 			break;
 		eal_args[i] = strdup(argv[i]);
+		if (eal_args[i] == NULL)
+			goto error;
 	}
 	eal_args[i++] = NULL; /* always finish with NULL */

@@ -235,13 +237,31 @@ eal_save_args(int argc, char **argv)

 	eal_app_args = calloc(argc - i + 1, sizeof(*eal_args));
 	if (eal_app_args == NULL)
-		return -1;
+		goto error;

-	for (j = 0; i < argc; j++, i++)
+	for (j = 0; i < argc; j++, i++) {
 		eal_app_args[j] = strdup(argv[i]);
+		if (eal_app_args[j] == NULL)
+			goto error;
+	}
 	eal_app_args[j] = NULL;

 	return 0;
+
+error:
+	if (eal_app_args != NULL) {
+		i = 0;
+		while (eal_app_args[i] != NULL)
+			free(eal_app_args[i++]);
+		free(eal_app_args);
+		eal_app_args = NULL;
+	}
+	i = 0;
+	while (eal_args[i] != NULL)
+		free(eal_args[i++]);
+	free(eal_args);
+	eal_args = NULL;
+	return -1;
 }
 #endif

diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index ac76f6174d..c0ba98852b 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -182,6 +182,8 @@ dev_uev_parse(const char *buf, struct rte_dev_event *event, int length)
 			i += 14;
 			strlcpy(pci_slot_name, buf, sizeof(subsystem));
 			event->devname = strdup(pci_slot_name);
+			if (event->devname == NULL)
+				return -1;
 		}
 		for (; i < length; i++) {
 			if (*buf == '\0')
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.864153229 +0800
+++ 0026-eal-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From 5821a384a4ca611e0f67786400b9f5b18f34a416 Mon Sep 17 00:00:00 2001
+From 2feed5de509bed9536955e38c0a917126fbe6283 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5821a384a4ca611e0f67786400b9f5b18f34a416 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index d9748076b4..e541f07939 100644
+index e9ba01fb89..aec51736f2 100644
@@ -66 +68 @@
-index e678dce6c7..fff4e8fa83 100644
+index ac76f6174d..c0ba98852b 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'bus/dpaa: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (25 preceding siblings ...)
  2024-03-05  9:46 ` patch 'eal: verify strdup return' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'bus/fslmc: " Xueming Li
                   ` (109 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Sachin Saxena, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8c8e7aeb9062db3e911628ec955af657432c7b61

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8c8e7aeb9062db3e911628ec955af657432c7b61 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:03 +0000
Subject: [PATCH] bus/dpaa: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2729fa6654b328bb4b9a0ede6d1e1019bd6caf0c ]

Add verify strdup return value logic.

Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index e57159f5d8..a67f5c9ab5 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -791,6 +791,10 @@ dpaa_bus_dev_iterate(const void *start, const char *str,

 	/* Now that name=device_name format is available, split */
 	dup = strdup(str);
+	if (dup == NULL) {
+		DPAA_BUS_DEBUG("Dup string (%s) failed!\n", str);
+		return NULL;
+	}
 	dev_name = dup + strlen("name=");

 	if (start != NULL) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.889322330 +0800
+++ 0027-bus-dpaa-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From 2729fa6654b328bb4b9a0ede6d1e1019bd6caf0c Mon Sep 17 00:00:00 2001
+From 8c8e7aeb9062db3e911628ec955af657432c7b61 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2729fa6654b328bb4b9a0ede6d1e1019bd6caf0c ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 46473603c8..5d4352bb3c 100644
+index e57159f5d8..a67f5c9ab5 100644
@@ -21 +23 @@
-@@ -792,6 +792,10 @@ dpaa_bus_dev_iterate(const void *start, const char *str,
+@@ -791,6 +791,10 @@ dpaa_bus_dev_iterate(const void *start, const char *str,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'bus/fslmc: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (26 preceding siblings ...)
  2024-03-05  9:46 ` patch 'bus/dpaa: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'bus/vdev: " Xueming Li
                   ` (108 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Sachin Saxena, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=82d4ba69f265c36bdfeadf9bf369b616934f1bb7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 82d4ba69f265c36bdfeadf9bf369b616934f1bb7 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:04 +0000
Subject: [PATCH] bus/fslmc: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 180d52bc7de2395ce9f4e5a707f4d8bb52be2fe4 ]

Add verify strdup return value logic.

Fixes: e67a61614d0b ("bus/fslmc: support device iteration")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 57bfb5111a..89f0f329c0 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -634,6 +634,10 @@ fslmc_bus_dev_iterate(const void *start, const char *str,

 	/* Now that name=device_name format is available, split */
 	dup = strdup(str);
+	if (dup == NULL) {
+		DPAA2_BUS_DEBUG("Dup string (%s) failed!\n", str);
+		return NULL;
+	}
 	dev_name = dup + strlen("name=");

 	if (start != NULL) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.917707931 +0800
+++ 0028-bus-fslmc-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From 180d52bc7de2395ce9f4e5a707f4d8bb52be2fe4 Mon Sep 17 00:00:00 2001
+From 82d4ba69f265c36bdfeadf9bf369b616934f1bb7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 180d52bc7de2395ce9f4e5a707f4d8bb52be2fe4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index b1af47ca7d..c155f4a2fd 100644
+index 57bfb5111a..89f0f329c0 100644
@@ -21 +23 @@
-@@ -635,6 +635,10 @@ fslmc_bus_dev_iterate(const void *start, const char *str,
+@@ -634,6 +634,10 @@ fslmc_bus_dev_iterate(const void *start, const char *str,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'bus/vdev: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (27 preceding siblings ...)
  2024-03-05  9:46 ` patch 'bus/fslmc: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'dma/idxd: " Xueming Li
                   ` (107 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Huisong Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b4943e7a51aac2584539eef7d4cbed84b9a3da06

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b4943e7a51aac2584539eef7d4cbed84b9a3da06 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:05 +0000
Subject: [PATCH] bus/vdev: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 83f275fa8124daf3a6b3e56f4b40a2be4b07a3b4 ]

Add verify strdup return value logic.

Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/bus/vdev/vdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 7974b27295..05582f1727 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -247,6 +247,10 @@ alloc_devargs(const char *name, const char *args)
 		devargs->data = strdup(args);
 	else
 		devargs->data = strdup("");
+	if (devargs->data == NULL) {
+		free(devargs);
+		return NULL;
+	}
 	devargs->args = devargs->data;

 	ret = strlcpy(devargs->name, name, sizeof(devargs->name));
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.941769232 +0800
+++ 0029-bus-vdev-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From 83f275fa8124daf3a6b3e56f4b40a2be4b07a3b4 Mon Sep 17 00:00:00 2001
+From b4943e7a51aac2584539eef7d4cbed84b9a3da06 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 83f275fa8124daf3a6b3e56f4b40a2be4b07a3b4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'dma/idxd: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (28 preceding siblings ...)
  2024-03-05  9:46 ` patch 'bus/vdev: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'event/cnxk: " Xueming Li
                   ` (106 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=df74839ea1d53002f0d56b0045a6b23b391e487d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From df74839ea1d53002f0d56b0045a6b23b391e487d Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:06 +0000
Subject: [PATCH] dma/idxd: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 83cfa2cbf3f3fb78e2f2dd228109adcb38e18a5c ]

Add verify strdup return value logic.

Fixes: e888bb1278c6 ("dma/idxd: add bus device probing")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/dma/idxd/idxd_bus.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c
index 3b2d4c2b65..ba8076715d 100644
--- a/drivers/dma/idxd/idxd_bus.c
+++ b/drivers/dma/idxd/idxd_bus.c
@@ -261,9 +261,15 @@ static int
 is_for_this_process_use(struct rte_dsa_device *dev, const char *name)
 {
 	char *runtime_dir = strdup(rte_eal_get_runtime_dir());
-	char *prefix = basename(runtime_dir);
-	int prefixlen = strlen(prefix);
 	int retval = 0;
+	int prefixlen;
+	char *prefix;
+
+	if (runtime_dir == NULL)
+		return retval;
+
+	prefix = basename(runtime_dir);
+	prefixlen = strlen(prefix);

 	if (strncmp(name, "dpdk_", 5) == 0)
 		retval = 1;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.966258033 +0800
+++ 0030-dma-idxd-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From 83cfa2cbf3f3fb78e2f2dd228109adcb38e18a5c Mon Sep 17 00:00:00 2001
+From df74839ea1d53002f0d56b0045a6b23b391e487d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 83cfa2cbf3f3fb78e2f2dd228109adcb38e18a5c ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'event/cnxk: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (29 preceding siblings ...)
  2024-03-05  9:46 ` patch 'dma/idxd: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/failsafe: fix memory leak in args parsing' " Xueming Li
                   ` (105 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cedf721f24a038780f06375573dc53c3f65ea5a8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cedf721f24a038780f06375573dc53c3f65ea5a8 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:07 +0000
Subject: [PATCH] event/cnxk: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b4b3a7037b2cab4dc5d004ed0fb9ec1e5911334e ]

Add verify strdup return value logic.

Fixes: 38c2e3240ba8 ("event/cnxk: add option to control SSO HWGRP QoS")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/event/cnxk/cnxk_eventdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
index 0c61f4c20e..1ec281e735 100644
--- a/drivers/event/cnxk/cnxk_eventdev.c
+++ b/drivers/event/cnxk/cnxk_eventdev.c
@@ -553,6 +553,9 @@ parse_list(const char *value, void *opaque, param_parse_t fn)
 	char *end = NULL;
 	char *f = s;

+	if (s == NULL)
+		return;
+
 	while (*s) {
 		if (*s == '[')
 			start = s;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:31.992995734 +0800
+++ 0031-event-cnxk-verify-strdup-return.patch	2024-03-05 17:39:30.713566491 +0800
@@ -1 +1 @@
-From b4b3a7037b2cab4dc5d004ed0fb9ec1e5911334e Mon Sep 17 00:00:00 2001
+From cedf721f24a038780f06375573dc53c3f65ea5a8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b4b3a7037b2cab4dc5d004ed0fb9ec1e5911334e ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/failsafe: fix memory leak in args parsing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (30 preceding siblings ...)
  2024-03-05  9:46 ` patch 'event/cnxk: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: verify strdup return' " Xueming Li
                   ` (104 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2044a179a7605771a17920dd560ca450b1131a4b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2044a179a7605771a17920dd560ca450b1131a4b Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:08 +0000
Subject: [PATCH] net/failsafe: fix memory leak in args parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2ddf2d7a15deeac3585e08fd7f9ef46ad082b126 ]

Should free the memory which allocated by strdup().

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/net/failsafe/failsafe_args.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c
index b203e02d9a..3b867437d7 100644
--- a/drivers/net/failsafe/failsafe_args.c
+++ b/drivers/net/failsafe/failsafe_args.c
@@ -248,7 +248,7 @@ fs_parse_device_param(struct rte_eth_dev *dev, const char *param,
 			goto free_args;
 	} else {
 		ERROR("Unrecognized device type: %.*s", (int)b, param);
-		return -EINVAL;
+		ret = -EINVAL;
 	}
 free_args:
 	free(args);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.019396234 +0800
+++ 0032-net-failsafe-fix-memory-leak-in-args-parsing.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From 2ddf2d7a15deeac3585e08fd7f9ef46ad082b126 Mon Sep 17 00:00:00 2001
+From 2044a179a7605771a17920dd560ca450b1131a4b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2ddf2d7a15deeac3585e08fd7f9ef46ad082b126 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (31 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/failsafe: fix memory leak in args parsing' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/dumpcap: " Xueming Li
                   ` (103 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Chaoyong He, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c6790ef542674b526824592b3b04ed46a804fcc9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c6790ef542674b526824592b3b04ed46a804fcc9 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:09 +0000
Subject: [PATCH] net/nfp: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4ea9eeb66170b30eb5bf02f91531f08aecd13298 ]

Add verify strdup return value logic.

Fixes: 3d21da66c06b ("net/nfp: create security session")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ipsec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c
index 452947380e..7ce9cca0b2 100644
--- a/drivers/net/nfp/nfp_ipsec.c
+++ b/drivers/net/nfp/nfp_ipsec.c
@@ -524,6 +524,11 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
 	uint8_t *cfg_iv;

 	iv_str = strdup(iv_string);
+	if (iv_str == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to strdup iv_string");
+		return;
+	}
+
 	cfg_iv = (uint8_t *)cfg->aesgcm_fields.iv;

 	for (i = 0; i < iv_len; i++) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.043366235 +0800
+++ 0033-net-nfp-verify-strdup-return.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From 4ea9eeb66170b30eb5bf02f91531f08aecd13298 Mon Sep 17 00:00:00 2001
+From c6790ef542674b526824592b3b04ed46a804fcc9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4ea9eeb66170b30eb5bf02f91531f08aecd13298 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 6e9bb06aa6..0b815fa983 100644
+index 452947380e..7ce9cca0b2 100644
@@ -21 +23 @@
-@@ -526,6 +526,11 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
+@@ -524,6 +524,11 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/dumpcap: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (32 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: verify strdup return' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/pdump: " Xueming Li
                   ` (102 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1387327fa4b3d0b0e8da1e0f97afc9c36a9ac35d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1387327fa4b3d0b0e8da1e0f97afc9c36a9ac35d Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:10 +0000
Subject: [PATCH] app/dumpcap: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6bb5ffe3ea9a5ad41848c19c2787df42de2a3cab ]

Add verify strdup return value logic.

Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 app/dumpcap/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index fc28e2d702..d57db0589a 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -628,6 +628,11 @@ static void dpdk_init(void)
 		eal_argv[i++] = strdup(file_prefix);
 	}

+	for (i = 0; i < (unsigned int)eal_argc; i++) {
+		if (eal_argv[i] == NULL)
+			rte_panic("No memory\n");
+	}
+
 	if (rte_eal_init(eal_argc, eal_argv) < 0)
 		rte_exit(EXIT_FAILURE, "EAL init failed: is primary process running?\n");
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.069435436 +0800
+++ 0034-app-dumpcap-verify-strdup-return.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From 6bb5ffe3ea9a5ad41848c19c2787df42de2a3cab Mon Sep 17 00:00:00 2001
+From 1387327fa4b3d0b0e8da1e0f97afc9c36a9ac35d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6bb5ffe3ea9a5ad41848c19c2787df42de2a3cab ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/pdump: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (33 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/dumpcap: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/crypto-perf: " Xueming Li
                   ` (101 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e0fd44c6abb047b5030d0dd0e8b497c739694368

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e0fd44c6abb047b5030d0dd0e8b497c739694368 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:11 +0000
Subject: [PATCH] app/pdump: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 32e1cb918d4bbe94c5da8d0888ce29fac1f4dbb4 ]

Add verify strdup return value logic.

Fixes: caa7028276b8 ("app/pdump: add tool for packet capturing")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 app/pdump/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 7a1c7bdf60..a9205e130b 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -171,6 +171,9 @@ parse_device_id(const char *key __rte_unused, const char *value,
 	struct pdump_tuples *pt = extra_args;

 	pt->device_id = strdup(value);
+	if (pt->device_id == NULL)
+		return -1;
+
 	pt->dump_by_type = DEVICE_ID;

 	return 0;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.109601237 +0800
+++ 0035-app-pdump-verify-strdup-return.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From 32e1cb918d4bbe94c5da8d0888ce29fac1f4dbb4 Mon Sep 17 00:00:00 2001
+From e0fd44c6abb047b5030d0dd0e8b497c739694368 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 32e1cb918d4bbe94c5da8d0888ce29fac1f4dbb4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (34 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/pdump: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/dma-perf: " Xueming Li
                   ` (100 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fefe40a5eda6cbaebadbadd40fdda45eaea9f8c3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fefe40a5eda6cbaebadbadd40fdda45eaea9f8c3 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:13 +0000
Subject: [PATCH] app/crypto-perf: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bf4728da1842bd264b2038e9f67e519ae9a0b4e3 ]

Add verify strdup return value logic.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 app/test-crypto-perf/cperf_options_parsing.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index 75afedc7fd..8909b5690d 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -516,6 +516,10 @@ parse_test_file(struct cperf_options *opts,
 		const char *arg)
 {
 	opts->test_file = strdup(arg);
+	if (opts->test_file == NULL) {
+		RTE_LOG(ERR, USER1, "Dup vector file failed!\n");
+		return -1;
+	}
 	if (access(opts->test_file, F_OK) != -1)
 		return 0;
 	RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n");
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.141178239 +0800
+++ 0036-app-crypto-perf-verify-strdup-return.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From bf4728da1842bd264b2038e9f67e519ae9a0b4e3 Mon Sep 17 00:00:00 2001
+From fefe40a5eda6cbaebadbadd40fdda45eaea9f8c3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bf4728da1842bd264b2038e9f67e519ae9a0b4e3 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/dma-perf: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (35 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/crypto-perf: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/testpmd: " Xueming Li
                   ` (99 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Huisong Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8d5327fcfde672c44d6eabfbc4450d47062a31b9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8d5327fcfde672c44d6eabfbc4450d47062a31b9 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:14 +0000
Subject: [PATCH] app/dma-perf: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8d9b64343344a56301dfc1975e4756d526f05824 ]

Add verify strdup return value logic.

Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-dma-perf/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
index 5f8bab8f45..544784df50 100644
--- a/app/test-dma-perf/main.c
+++ b/app/test-dma-perf/main.c
@@ -206,6 +206,8 @@ parse_lcore_dma(struct test_configure *test_case, const char *value)
 		return -1;

 	input = strndup(value, strlen(value) + 1);
+	if (input == NULL)
+		return -1;
 	addrs = input;

 	while (*addrs == '\0')
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.166195439 +0800
+++ 0037-app-dma-perf-verify-strdup-return.patch	2024-03-05 17:39:30.723566491 +0800
@@ -1 +1 @@
-From 8d9b64343344a56301dfc1975e4756d526f05824 Mon Sep 17 00:00:00 2001
+From 8d5327fcfde672c44d6eabfbc4450d47062a31b9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8d9b64343344a56301dfc1975e4756d526f05824 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (36 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/dma-perf: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'test: " Xueming Li
                   ` (98 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Ivan Malov, Huisong Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c830d9e2afb0cdb8748d8d31347a36f24ea039c6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c830d9e2afb0cdb8748d8d31347a36f24ea039c6 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:15 +0000
Subject: [PATCH] app/testpmd: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 365cdd7d01f70da2b10671aea05c5aaa036d3771 ]

Add verify strdup return value logic.

Fixes: 52e2e7edcf48 ("app/testpmd: add protocol-based buffer split")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ivan Malov <ivan.malov@arknetworks.am>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 app/test-pmd/cmdline.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9369d3b4c5..d9304e4a32 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -3528,6 +3528,8 @@ parse_hdrs_list(const char *str, const char *item_name, unsigned int max_items,

 	nb_item = 0;
 	char *str2 = strdup(str);
+	if (str2 == NULL)
+		return nb_item;
 	cur = strtok_r(str2, ",", &tmp);
 	while (cur != NULL) {
 		parsed_items[nb_item] = get_ptype(cur);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.189705840 +0800
+++ 0038-app-testpmd-verify-strdup-return.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From 365cdd7d01f70da2b10671aea05c5aaa036d3771 Mon Sep 17 00:00:00 2001
+From c830d9e2afb0cdb8748d8d31347a36f24ea039c6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 365cdd7d01f70da2b10671aea05c5aaa036d3771 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (37 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/testpmd: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'examples/qos_sched: fix memory leak in args parsing' " Xueming Li
                   ` (97 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Huisong Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fbd04d26f306ad0d5357fdd1f596dc43dfcadebc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fbd04d26f306ad0d5357fdd1f596dc43dfcadebc Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:12 +0000
Subject: [PATCH] test: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 68edcacf428994d3088afb6f5278958cc76665da ]

Add verify strdup return value logic.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 app/test/process.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test/process.h b/app/test/process.h
index af7bc3e0de..c576c42349 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -59,8 +59,11 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 		return -1;
 	else if (pid == 0) {
 		/* make a copy of the arguments to be passed to exec */
-		for (i = 0; i < numargs; i++)
+		for (i = 0; i < numargs; i++) {
 			argv_cpy[i] = strdup(argv[i]);
+			if (argv_cpy[i] == NULL)
+				rte_panic("Error dup args\n");
+		}
 		argv_cpy[i] = NULL;
 		num = numargs;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.222730341 +0800
+++ 0039-test-verify-strdup-return.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From 68edcacf428994d3088afb6f5278958cc76665da Mon Sep 17 00:00:00 2001
+From fbd04d26f306ad0d5357fdd1f596dc43dfcadebc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 68edcacf428994d3088afb6f5278958cc76665da ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/qos_sched: fix memory leak in args parsing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (38 preceding siblings ...)
  2024-03-05  9:46 ` patch 'test: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'examples/vhost: verify strdup return' " Xueming Li
                   ` (96 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=88f1c9af336f8fee966bd4b4b5f26e54ff809270

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 88f1c9af336f8fee966bd4b4b5f26e54ff809270 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:16 +0000
Subject: [PATCH] examples/qos_sched: fix memory leak in args parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]

Should free the memory which allocated by strdup().

Fixes: 035b6a4f4bba ("examples/qos_sched: fix out-of-bounds option parsing")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 examples/qos_sched/args.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index e97273152a..8d61d3e454 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -103,8 +103,10 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32

 	n_tokens = rte_strsplit(string, strnlen(string, 32), tokens, n_vals, separator);

-	if (n_tokens > MAX_OPT_VALUES)
+	if (n_tokens > MAX_OPT_VALUES) {
+		free(string);
 		return -1;
+	}

 	for (i = 0; i < n_tokens; i++)
 		opt_vals[i] = (uint32_t)atol(tokens[i]);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.248213842 +0800
+++ 0040-examples-qos_sched-fix-memory-leak-in-args-parsing.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From db8aee153e43375538667c6f861e981a47574476 Mon Sep 17 00:00:00 2001
+From 88f1c9af336f8fee966bd4b4b5f26e54ff809270 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/vhost: verify strdup return' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (39 preceding siblings ...)
  2024-03-05  9:46 ` patch 'examples/qos_sched: fix memory leak in args parsing' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'pipeline: fix calloc parameters' " Xueming Li
                   ` (95 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Huisong Li, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5331b413827f6a7fa43403fdccd13f574b34e849

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5331b413827f6a7fa43403fdccd13f574b34e849 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Fri, 10 Nov 2023 10:01:17 +0000
Subject: [PATCH] examples/vhost: verify strdup return
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b119863bd6643558af3ac3b39a63b6524e7545eb ]

Add verify strdup return value logic.

Fixes: 53d3f4778c1d ("vhost: integrate dmadev in asynchronous data-path")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 examples/vhost/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index ce5c1efddf..3fc1b151d1 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -260,6 +260,9 @@ open_dma(const char *value)
 	char *dma_arg[RTE_MAX_VHOST_DEVICE];
 	int args_nr;

+	if (input == NULL)
+		return -1;
+
 	while (isblank(*addrs))
 		addrs++;
 	if (*addrs == '\0') {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.271432143 +0800
+++ 0041-examples-vhost-verify-strdup-return.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From b119863bd6643558af3ac3b39a63b6524e7545eb Mon Sep 17 00:00:00 2001
+From 5331b413827f6a7fa43403fdccd13f574b34e849 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b119863bd6643558af3ac3b39a63b6524e7545eb ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'pipeline: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (40 preceding siblings ...)
  2024-03-05  9:46 ` patch 'examples/vhost: verify strdup return' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'eventdev: " Xueming Li
                   ` (94 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Cristian Dumitrescu, Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=600e30b793ef66ba9022a65d336455e376881146

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 600e30b793ef66ba9022a65d336455e376881146 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:53:58 +0000
Subject: [PATCH] pipeline: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0594ae0c42773d62aff870df25e73394f7f0a5a5 ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
 Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o
.../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:2893:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size]
 2893 |         s = calloc(sizeof(struct pipeline_spec), 1);
      |           ^

.../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’:
../lib/pipeline/rte_swx_pipeline_spec.c:4244:11:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size]
 4244 |         s = calloc(sizeof(struct pipeline_iospec), 1);
      |           ^

Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline build")
Fixes: 54cae37ef4ef ("pipeline: support I/O specification")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/pipeline/rte_swx_pipeline_spec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 2bba0d0524..17419e7b85 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -2890,7 +2890,7 @@ pipeline_spec_parse(FILE *spec,
 	}

 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_spec), 1);
+	s = calloc(1, sizeof(struct pipeline_spec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
@@ -4241,7 +4241,7 @@ pipeline_iospec_parse(FILE *spec,
 	}

 	/* Memory allocation. */
-	s = calloc(sizeof(struct pipeline_iospec), 1);
+	s = calloc(1, sizeof(struct pipeline_iospec));
 	if (!s) {
 		if (err_line)
 			*err_line = n_lines;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.297020344 +0800
+++ 0042-pipeline-fix-calloc-parameters.patch	2024-03-05 17:39:30.733566492 +0800
@@ -1 +1 @@
-From 0594ae0c42773d62aff870df25e73394f7f0a5a5 Mon Sep 17 00:00:00 2001
+From 600e30b793ef66ba9022a65d336455e376881146 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0594ae0c42773d62aff870df25e73394f7f0a5a5 ]
@@ -33 +35,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eventdev: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (41 preceding siblings ...)
  2024-03-05  9:46 ` patch 'pipeline: fix calloc parameters' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'dmadev: " Xueming Li
                   ` (93 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9173abff753d14fb5da1ac6640c085ca3c6eb7d6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9173abff753d14fb5da1ac6640c085ca3c6eb7d6 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:01 +0000
Subject: [PATCH] eventdev: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 09fbda36e495bc6f24fbe26d0909801107bee5f7 ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object lib/librte_eventdev.a.p/eventdev_rte_eventdev.c.o
../lib/eventdev/rte_eventdev.c: In function ‘handle_dev_dump’:
../lib/eventdev/rte_eventdev.c:2005:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 2005 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: a3b7b476d723 ("eventdev: support telemetry dump eventdev")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/eventdev/rte_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 157752868d..1c865e993f 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -2002,7 +2002,7 @@ handle_dev_dump(const char *cmd __rte_unused,

 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);

-	buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
+	buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char));
 	if (buf == NULL)
 		return -ENOMEM;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.324709245 +0800
+++ 0043-eventdev-fix-calloc-parameters.patch	2024-03-05 17:39:30.743566492 +0800
@@ -1 +1 @@
-From 09fbda36e495bc6f24fbe26d0909801107bee5f7 Mon Sep 17 00:00:00 2001
+From 9173abff753d14fb5da1ac6640c085ca3c6eb7d6 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 09fbda36e495bc6f24fbe26d0909801107bee5f7 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org
@@ -35 +37 @@
-index d494f8f205..ca295c87c4 100644
+index 157752868d..1c865e993f 100644
@@ -38 +40 @@
-@@ -2005,7 +2005,7 @@ handle_dev_dump(const char *cmd __rte_unused,
+@@ -2002,7 +2002,7 @@ handle_dev_dump(const char *cmd __rte_unused,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'dmadev: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (42 preceding siblings ...)
  2024-03-05  9:46 ` patch 'eventdev: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'rawdev: " Xueming Li
                   ` (92 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ad881b0db859fe2e4762ab2313a8e2fd4881894f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ad881b0db859fe2e4762ab2313a8e2fd4881894f Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:02 +0000
Subject: [PATCH] dmadev: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 905f8335f916aed1f3119e35332a32119dea4510 ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object lib/librte_dmadev.a.p/dmadev_rte_dmadev.c.o
../lib/dmadev/rte_dmadev.c: In function ‘dmadev_handle_dev_dump’:
../lib/dmadev/rte_dmadev.c:1033:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 1033 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: 94043b04212a ("dmadev: support telemetry dump dmadev")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/dmadev/rte_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index 009a21849a..31a268cfdb 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -1028,7 +1028,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,
 	if (*end_param != '\0')
 		RTE_DMA_LOG(WARNING, "Extra parameters passed to dmadev telemetry command, ignoring");

-	buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
+	buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char));
 	if (buf == NULL)
 		return -ENOMEM;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.350643745 +0800
+++ 0044-dmadev-fix-calloc-parameters.patch	2024-03-05 17:39:30.743566492 +0800
@@ -1 +1 @@
-From 905f8335f916aed1f3119e35332a32119dea4510 Mon Sep 17 00:00:00 2001
+From ad881b0db859fe2e4762ab2313a8e2fd4881894f Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 905f8335f916aed1f3119e35332a32119dea4510 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org
@@ -35 +37 @@
-index 25c92ef8a8..e64b279bac 100644
+index 009a21849a..31a268cfdb 100644
@@ -38 +40 @@
-@@ -1040,7 +1040,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,
+@@ -1028,7 +1028,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'rawdev: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (43 preceding siblings ...)
  2024-03-05  9:46 ` patch 'dmadev: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'common/mlx5: " Xueming Li
                   ` (91 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Morten Brørup, Chengwen Feng, Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7c10528d681e4cd7e5aeb0b14466ca71905b0c2e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7c10528d681e4cd7e5aeb0b14466ca71905b0c2e Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:00 +0000
Subject: [PATCH] rawdev: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 37ff33833b6b8932bfbc8e149d386ef23ccdc54e ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20240108 (experimental)

[2]
Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o
../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’:
../lib/rawdev/rte_rawdev.c:659:29:
  error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument
  [-Werror=calloc-transposed-args]
  659 |     buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
      |                         ^~~~

Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/rawdev/rte_rawdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index 474bdc9540..4f8897b639 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -656,7 +656,7 @@ handle_dev_dump(const char *cmd __rte_unused,
 	if (!rte_rawdev_pmd_is_valid_dev(dev_id))
 		return -EINVAL;

-	buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN);
+	buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char));
 	if (buf == NULL)
 		return -ENOMEM;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.374030346 +0800
+++ 0045-rawdev-fix-calloc-parameters.patch	2024-03-05 17:39:30.743566492 +0800
@@ -1 +1 @@
-From 37ff33833b6b8932bfbc8e149d386ef23ccdc54e Mon Sep 17 00:00:00 2001
+From 7c10528d681e4cd7e5aeb0b14466ca71905b0c2e Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 37ff33833b6b8932bfbc8e149d386ef23ccdc54e ]
@@ -26 +28,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/mlx5: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (44 preceding siblings ...)
  2024-03-05  9:46 ` patch 'rawdev: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/bnx2x: " Xueming Li
                   ` (90 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Morten Brørup, Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e3ae3295ee76a8016c023a083eef9ae68eb768eb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e3ae3295ee76a8016c023a083eef9ae68eb768eb Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:03 +0000
Subject: [PATCH] common/mlx5: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f805f70bc5511cd98a34fa2f8f7bd7a3e4cd8aa3 ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object .../common_mlx5_mlx5_common_mr.c.o
.../mlx5/mlx5_common_mr.c: In function ‘mlx5_mempool_get_chunks’:
.../common/mlx5/mlx5_common_mr.c:1384:29:
  warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
  argument and not in the later argument [-Wcalloc-transposed-args]
 1384 |         *out = calloc(sizeof(**out), n);
      |                             ^

Fixes: 7297d2cdecce ("common/mlx5: fix external memory pool registration")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/common/mlx5/mlx5_common_mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 40ff9153bd..85ec10d2ee 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -1381,7 +1381,7 @@ mlx5_mempool_get_chunks(struct rte_mempool *mp, struct mlx5_range **out,

 	DRV_LOG(DEBUG, "Collecting chunks of regular mempool %s", mp->name);
 	n = mp->nb_mem_chunks;
-	*out = calloc(sizeof(**out), n);
+	*out = calloc(n, sizeof(**out));
 	if (*out == NULL)
 		return -1;
 	rte_mempool_mem_iter(mp, mlx5_range_from_mempool_chunk, *out);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.397821147 +0800
+++ 0046-common-mlx5-fix-calloc-parameters.patch	2024-03-05 17:39:30.743566492 +0800
@@ -1 +1 @@
-From f805f70bc5511cd98a34fa2f8f7bd7a3e4cd8aa3 Mon Sep 17 00:00:00 2001
+From e3ae3295ee76a8016c023a083eef9ae68eb768eb Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f805f70bc5511cd98a34fa2f8f7bd7a3e4cd8aa3 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnx2x: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (45 preceding siblings ...)
  2024-03-05  9:46 ` patch 'common/mlx5: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: " Xueming Li
                   ` (89 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=238a03cdec9c471a8de6c87b92c09af8ba39871b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 238a03cdec9c471a8de6c87b92c09af8ba39871b Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:04 +0000
Subject: [PATCH] net/bnx2x: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ff0d80191617d3b4435e0f473b129cdc539c23f5 ]

gcc [1] generates warning [2] about rte_calloc usage, because
rte_calloc parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object drivers/libtmp_rte_net_bnx2x.a.p/net_bnx2x_bnx2x.c.o
../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_alloc_ilt_lines_mem’:
../drivers/net/bnx2x/bnx2x.c:2392:44:
 warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
 argument and not in the later argument [-Wcalloc-transposed-args]
 2392 |                     sizeof(struct ilt_line), ILT_MAX_LINES,
      |                            ^~~~~~

Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 drivers/net/bnx2x/bnx2x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index c3283c94f3..597ee43359 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2389,7 +2389,7 @@ int bnx2x_alloc_ilt_mem(struct bnx2x_softc *sc)
 static int bnx2x_alloc_ilt_lines_mem(struct bnx2x_softc *sc)
 {
 	sc->ilt->lines = rte_calloc("",
-				    sizeof(struct ilt_line), ILT_MAX_LINES,
+				    ILT_MAX_LINES, sizeof(struct ilt_line),
 				    RTE_CACHE_LINE_SIZE);
 	return sc->ilt->lines == NULL;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.427704748 +0800
+++ 0047-net-bnx2x-fix-calloc-parameters.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From ff0d80191617d3b4435e0f473b129cdc539c23f5 Mon Sep 17 00:00:00 2001
+From 238a03cdec9c471a8de6c87b92c09af8ba39871b Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ff0d80191617d3b4435e0f473b129cdc539c23f5 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (46 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/bnx2x: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/sfc: " Xueming Li
                   ` (88 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Chaoyong He, Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=acad009eedab668baf31f2aed512a3fd48a226cf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From acad009eedab668baf31f2aed512a3fd48a226cf Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:53:59 +0000
Subject: [PATCH] net/nfp: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0352f47a3bf923574afe17e822af58bedc7ead49 ]

gcc [1] generates warning [2] about calloc usage, because calloc
parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.0 20231102 (experimental)

[2]
Compiling C object .../net_nfp_nfpcore_nfp_mutex.c.o
.../net/nfp/nfpcore/nfp_mutex.c: In function ‘nfp_cpp_mutex_alloc’:
../drivers/net/nfp/nfpcore/nfp_mutex.c:171:15:
  warning: allocation of insufficient size ‘1’ for type
           ‘struct nfp_cpp_mutex’ with size ‘48’ [-Walloc-size]
  171 |         mutex = calloc(sizeof(*mutex), 1);
      |               ^

Fixes: c7e9729da6b5 ("net/nfp: support CPP")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 drivers/net/nfp/nfpcore/nfp_mutex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 3c10c7a090..edb78dfdc9 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -168,7 +168,7 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	if (tmp != key)
 		return NULL;

-	mutex = calloc(sizeof(*mutex), 1);
+	mutex = calloc(1, sizeof(*mutex));
 	if (mutex == NULL)
 		return NULL;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.455542749 +0800
+++ 0048-net-nfp-fix-calloc-parameters.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From 0352f47a3bf923574afe17e822af58bedc7ead49 Mon Sep 17 00:00:00 2001
+From acad009eedab668baf31f2aed512a3fd48a226cf Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0352f47a3bf923574afe17e822af58bedc7ead49 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/sfc: fix calloc parameters' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (47 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'build: fix linker warnings about undefined symbols' " Xueming Li
                   ` (87 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Morten Brørup, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=63241d76621b2accf88e511aa2fcf2b63f0a870e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 63241d76621b2accf88e511aa2fcf2b63f0a870e Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Wed, 24 Jan 2024 18:54:05 +0000
Subject: [PATCH] net/sfc: fix calloc parameters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 351f656ed67277f175de0a2baf296eed7e3fb21d ]

gcc [1] generates warning [2] about rte_calloc usage, because
rte_calloc parameter order is wrong, fixing it by replacing parameters.

[1]
gcc (GCC) 14.0.1 20240124 (experimental)

[2]
Compiling C object drivers/libtmp_rte_net_sfc.a.p/net_sfc_sfc_mae.c.o
../net/sfc/sfc_mae.c: In function ‘sfc_mae_action_set_list_add’:
../drivers/net/sfc/sfc_mae.c:1353:35:
 warning: ‘rte_calloc’ sizes specified with ‘sizeof’ in the earlier
 argument and not in the later argument [-Wcalloc-transposed-args]
 1353 |                    sizeof(struct sfc_mae_action_set *),
      |                           ^~~~~~

Fixes: 002f591f54c3 ("net/sfc: support packet replay in transfer flows")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index e5ec0ae49d..60ff6d2181 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1350,8 +1350,8 @@ sfc_mae_action_set_list_add(struct sfc_adapter *sa,

 	action_set_list->action_sets =
 		rte_calloc("sfc_mae_action_set_list_action_sets",
-			   sizeof(struct sfc_mae_action_set *),
-			   action_set_list->nb_action_sets, 0);
+			   action_set_list->nb_action_sets,
+			   sizeof(struct sfc_mae_action_set *), 0);
 	if (action_set_list->action_sets == NULL) {
 		sfc_err(sa, "failed to allocate action set list");
 		rte_free(action_set_list);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.477893550 +0800
+++ 0049-net-sfc-fix-calloc-parameters.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From 351f656ed67277f175de0a2baf296eed7e3fb21d Mon Sep 17 00:00:00 2001
+From 63241d76621b2accf88e511aa2fcf2b63f0a870e Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 351f656ed67277f175de0a2baf296eed7e3fb21d ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'build: fix linker warnings about undefined symbols' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (48 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/sfc: " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'build: link static libs with whole-archive in subproject' " Xueming Li
                   ` (86 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5e24d7f2ded389295b24688a339b2139d5281941

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5e24d7f2ded389295b24688a339b2139d5281941 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 10 Jan 2024 15:01:03 +0000
Subject: [PATCH] build: fix linker warnings about undefined symbols
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 51c9428dca9fad10bd60ca668ffdf78e4a801e2f ]

The default behaviour of "ld.lld" has changed, so it now prints out
warnings about entries in the version.map file which don't exist in
the current build. Since we use our version.map file simply to filter
out the functions we don't want made public, we include in it all
functions across all OS's and builds that we want public if present.
This causes these ld warnings to be emitted, e.g. on BSD, which is
missing functionality found on Linux. For example:

* hpet functions in EAL
* regexdev enqueue and dequeue burst
* eventdev event_timer functions

Easiest solution, without major rework of how we use our version.map
files, and without dynamically generating them per-build, is to pass
the --undefined-version flag to the linker, to restore the old
behaviour.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index a9ccd56deb..65662c5de3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -188,6 +188,9 @@ dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4)

 if not is_windows
     add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
+    if cc.has_link_argument('-Wl,--undefined-version')
+        add_project_link_arguments('-Wl,--undefined-version', language: 'c')
+    endif
 endif

 # use pthreads if available for the platform
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.504618451 +0800
+++ 0050-build-fix-linker-warnings-about-undefined-symbols.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From 51c9428dca9fad10bd60ca668ffdf78e4a801e2f Mon Sep 17 00:00:00 2001
+From 5e24d7f2ded389295b24688a339b2139d5281941 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 51c9428dca9fad10bd60ca668ffdf78e4a801e2f ]
@@ -22,2 +24,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'build: link static libs with whole-archive in subproject' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (49 preceding siblings ...)
  2024-03-05  9:46 ` patch 'build: fix linker warnings about undefined symbols' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'rcu: use atomic operation on acked token' " Xueming Li
                   ` (85 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Robin Jarry; +Cc: David Marchand, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8878a84e2ebc75bb3cc7fc94a5912810f32cd50e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8878a84e2ebc75bb3cc7fc94a5912810f32cd50e Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry@redhat.com>
Date: Mon, 29 Jan 2024 13:47:17 +0100
Subject: [PATCH] build: link static libs with whole-archive in subproject
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cafb10b3e4a73750c26b3d5e00df48caa93a997b ]

When DPDK is used as a subproject, declare static libs to be linked with
-Wl,--whole-archive along with the drivers. This is already done this
way in pkg-config.

Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/subproject/meson.build | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build
index 3192efaa40..322e01c029 100644
--- a/buildtools/subproject/meson.build
+++ b/buildtools/subproject/meson.build
@@ -8,8 +8,7 @@ if get_option('default_library') == 'static'
             dependencies: dpdk_static_lib_deps,
             # static library deps in DPDK build don't include "link_with" parameters,
             # so explicitly link-in both libs and drivers
-            link_with: dpdk_static_libraries,
-            link_whole: dpdk_drivers,
+            link_whole: dpdk_static_libraries + dpdk_drivers,
             link_args: dpdk_extra_ldflags)
 else
     dpdk_dep = declare_dependency(
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.528191751 +0800
+++ 0051-build-link-static-libs-with-whole-archive-in-subproj.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From cafb10b3e4a73750c26b3d5e00df48caa93a997b Mon Sep 17 00:00:00 2001
+From 8878a84e2ebc75bb3cc7fc94a5912810f32cd50e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cafb10b3e4a73750c26b3d5e00df48caa93a997b ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'rcu: use atomic operation on acked token' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (50 preceding siblings ...)
  2024-03-05  9:46 ` patch 'build: link static libs with whole-archive in subproject' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'rcu: fix acked token in debug log' " Xueming Li
                   ` (84 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Honnappa Nagarahalli; +Cc: Ola Liljedahl, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=94b20c14a64b64c09acd7887165f75b7674e46fb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 94b20c14a64b64c09acd7887165f75b7674e46fb Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Date: Mon, 5 Feb 2024 04:59:48 +0000
Subject: [PATCH] rcu: use atomic operation on acked token
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 063cddfc7426989f0c7feb514aa82bd8c4274756 ]

acked_token should be read using atomic operation as the
the API rte_rcu_qsbr_check is advertised as multi-thread safe.

Fixes: 1f90d32ce175 ("rcu: add least acknowledged token optimization")

Reported-by: Ola Liljedahl <ola.liljedahl@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
---
 lib/rcu/rte_rcu_qsbr.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 6b908e7ee0..66780b324b 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -667,7 +667,8 @@ rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
 	RTE_ASSERT(v != NULL);

 	/* Check if all the readers have already acknowledged this token */
-	if (likely(t <= v->acked_token)) {
+	if (likely(t <= rte_atomic_load_explicit(&v->acked_token,
+						rte_memory_order_relaxed))) {
 		__RTE_RCU_DP_LOG(DEBUG,
 			"%s: check: token = %" PRIu64 ", wait = %d",
 			__func__, t, wait);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.551375152 +0800
+++ 0052-rcu-use-atomic-operation-on-acked-token.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From 063cddfc7426989f0c7feb514aa82bd8c4274756 Mon Sep 17 00:00:00 2001
+From 94b20c14a64b64c09acd7887165f75b7674e46fb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 063cddfc7426989f0c7feb514aa82bd8c4274756 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 23c9f89805..ef1621d597 100644
+index 6b908e7ee0..66780b324b 100644
@@ -23 +25 @@
-@@ -666,7 +666,8 @@ rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
+@@ -667,7 +667,8 @@ rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'rcu: fix acked token in debug log' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (51 preceding siblings ...)
  2024-03-05  9:46 ` patch 'rcu: use atomic operation on acked token' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net: fix TCP/UDP checksum with padding data' " Xueming Li
                   ` (83 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Honnappa Nagarahalli; +Cc: Nathan Brown, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c30a4f8b3162bbe1178e79fdf476b2d65f182ea9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c30a4f8b3162bbe1178e79fdf476b2d65f182ea9 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Date: Mon, 5 Feb 2024 04:59:49 +0000
Subject: [PATCH] rcu: fix acked token in debug log
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit df33fb53e464cb1efc79fa65f923aaa60ae10f42 ]

Debug print should use acked token value that was used for comparison.

Fixes: bf386ae377aa ("rcu: add additional debug logs")

Reported-by: Nathan Brown <nathan.brown@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Nathan Brown <nathan.brown@arm.com>
---
 lib/rcu/rte_rcu_qsbr.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 66780b324b..8bda00e911 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -664,17 +664,20 @@ __rte_rcu_qsbr_check_all(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
 static __rte_always_inline int
 rte_rcu_qsbr_check(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
 {
+	uint64_t acked_token;
+
 	RTE_ASSERT(v != NULL);

 	/* Check if all the readers have already acknowledged this token */
-	if (likely(t <= rte_atomic_load_explicit(&v->acked_token,
-						rte_memory_order_relaxed))) {
+	acked_token = rte_atomic_load_explicit(&v->acked_token,
+						rte_memory_order_relaxed);
+	if (likely(t <= acked_token)) {
 		__RTE_RCU_DP_LOG(DEBUG,
 			"%s: check: token = %" PRIu64 ", wait = %d",
 			__func__, t, wait);
 		__RTE_RCU_DP_LOG(DEBUG,
 			"%s: status: least acked token = %" PRIu64,
-			__func__, v->acked_token);
+			__func__, acked_token);
 		return 1;
 	}

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.576372153 +0800
+++ 0053-rcu-fix-acked-token-in-debug-log.patch	2024-03-05 17:39:30.753566492 +0800
@@ -1 +1 @@
-From df33fb53e464cb1efc79fa65f923aaa60ae10f42 Mon Sep 17 00:00:00 2001
+From c30a4f8b3162bbe1178e79fdf476b2d65f182ea9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit df33fb53e464cb1efc79fa65f923aaa60ae10f42 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index ef1621d597..e7ef788175 100644
+index 66780b324b..8bda00e911 100644
@@ -22 +24 @@
-@@ -663,17 +663,20 @@ __rte_rcu_qsbr_check_all(struct rte_rcu_qsbr *v, uint64_t t, bool wait)
+@@ -664,17 +664,20 @@ __rte_rcu_qsbr_check_all(struct rte_rcu_qsbr *v, uint64_t t, bool wait)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net: fix TCP/UDP checksum with padding data' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (52 preceding siblings ...)
  2024-03-05  9:46 ` patch 'rcu: fix acked token in debug log' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in datapath' " Xueming Li
                   ` (82 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c139df70dd02ed9031e82d80bd51ba1882157f63

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c139df70dd02ed9031e82d80bd51ba1882157f63 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Thu, 14 Dec 2023 17:22:59 +0800
Subject: [PATCH] net: fix TCP/UDP checksum with padding data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e55ea3d5d970dfff2989e4a1c65b76d02512bce0 ]

IEEE 802 packets may have a minimum size limit. The data fields
should be padded when necessary. In some cases, the padding data
is not zero.

In 'rte_ipv4_udptcp_cksum_mbuf()', as payload length
"mbuf->pkt_len - l4_off" is used, which includes padding and if
padding is not zero it will end up producing wrong checksum.

This patch will use IP header to get the payload size to calculate
TCP/UDP checksum.

Fixes: d178f693bbfe ("net: add UDP/TCP checksum in mbuf segments")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/net/rte_ip.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index 6fa98a5a0f..0d103d4127 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -419,11 +419,14 @@ __rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m,
 {
 	uint16_t raw_cksum;
 	uint32_t cksum;
+	uint16_t len;

-	if (l4_off > m->pkt_len)
-		return 0;
+	if (unlikely(l4_off > m->pkt_len))
+		return 0; /* invalid params, return a dummy value */
+
+	len = rte_be_to_cpu_16(ipv4_hdr->total_length) - (uint16_t)rte_ipv4_hdr_len(ipv4_hdr);

-	if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum))
+	if (rte_raw_cksum_mbuf(m, l4_off, len, &raw_cksum))
 		return 0;

 	cksum = raw_cksum + rte_ipv4_phdr_cksum(ipv4_hdr, 0);
@@ -663,10 +666,10 @@ __rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m,
 	uint16_t raw_cksum;
 	uint32_t cksum;

-	if (l4_off > m->pkt_len)
-		return 0;
+	if (unlikely(l4_off > m->pkt_len))
+		return 0; /* invalid params, return a dummy value */

-	if (rte_raw_cksum_mbuf(m, l4_off, m->pkt_len - l4_off, &raw_cksum))
+	if (rte_raw_cksum_mbuf(m, l4_off, rte_be_to_cpu_16(ipv6_hdr->payload_len), &raw_cksum))
 		return 0;

 	cksum = raw_cksum + rte_ipv6_phdr_cksum(ipv6_hdr, 0);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.609662554 +0800
+++ 0054-net-fix-TCP-UDP-checksum-with-padding-data.patch	2024-03-05 17:39:30.763566493 +0800
@@ -1 +1 @@
-From e55ea3d5d970dfff2989e4a1c65b76d02512bce0 Mon Sep 17 00:00:00 2001
+From c139df70dd02ed9031e82d80bd51ba1882157f63 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e55ea3d5d970dfff2989e4a1c65b76d02512bce0 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix virtqueue access check in datapath' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (53 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net: fix TCP/UDP checksum with padding data' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in VDUSE setup' " Xueming Li
                   ` (81 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Eelco Chaudron, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=bbba917213589deeedba18ad5671c4733cf0134e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bbba917213589deeedba18ad5671c4733cf0134e Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 5 Dec 2023 10:45:31 +0100
Subject: [PATCH] vhost: fix virtqueue access check in datapath
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9fc93a1e23203e3053f5acc198e9203bc49024b5 ]

Now that a r/w lock is used, the access_ok field should only be updated
under a write lock.

Since the datapath code only takes a read lock on the virtqueue to check
access_ok, this lock must be released and a write lock taken before
calling vring_translate().

Fixes: 03f77d66d966 ("vhost: change virtqueue access lock to a read/write one")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/virtio_net.c | 60 +++++++++++++++++++++++++++++++-----------
 1 file changed, 44 insertions(+), 16 deletions(-)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 8af20f1487..d00f4b03aa 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1696,6 +1696,17 @@ virtio_dev_rx_packed(struct virtio_net *dev,
 	return pkt_idx;
 }

+static void
+virtio_dev_vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq)
+{
+	rte_rwlock_write_lock(&vq->access_lock);
+	vhost_user_iotlb_rd_lock(vq);
+	if (!vq->access_ok)
+		vring_translate(dev, vq);
+	vhost_user_iotlb_rd_unlock(vq);
+	rte_rwlock_write_unlock(&vq->access_lock);
+}
+
 static __rte_always_inline uint32_t
 virtio_dev_rx(struct virtio_net *dev, struct vhost_virtqueue *vq,
 	struct rte_mbuf **pkts, uint32_t count)
@@ -1710,9 +1721,13 @@ virtio_dev_rx(struct virtio_net *dev, struct vhost_virtqueue *vq,

 	vhost_user_iotlb_rd_lock(vq);

-	if (unlikely(!vq->access_ok))
-		if (unlikely(vring_translate(dev, vq) < 0))
-			goto out;
+	if (unlikely(!vq->access_ok)) {
+		vhost_user_iotlb_rd_unlock(vq);
+		rte_rwlock_read_unlock(&vq->access_lock);
+
+		virtio_dev_vring_translate(dev, vq);
+		goto out_no_unlock;
+	}

 	count = RTE_MIN((uint32_t)MAX_PKT_BURST, count);
 	if (count == 0)
@@ -1731,6 +1746,7 @@ out:
 out_access_unlock:
 	rte_rwlock_read_unlock(&vq->access_lock);

+out_no_unlock:
 	return nb_tx;
 }

@@ -2528,9 +2544,13 @@ virtio_dev_rx_async_submit(struct virtio_net *dev, struct vhost_virtqueue *vq,

 	vhost_user_iotlb_rd_lock(vq);

-	if (unlikely(!vq->access_ok))
-		if (unlikely(vring_translate(dev, vq) < 0))
-			goto out;
+	if (unlikely(!vq->access_ok)) {
+		vhost_user_iotlb_rd_unlock(vq);
+		rte_rwlock_read_unlock(&vq->access_lock);
+
+		virtio_dev_vring_translate(dev, vq);
+		goto out_no_unlock;
+	}

 	count = RTE_MIN((uint32_t)MAX_PKT_BURST, count);
 	if (count == 0)
@@ -2551,6 +2571,7 @@ out:
 out_access_unlock:
 	rte_rwlock_write_unlock(&vq->access_lock);

+out_no_unlock:
 	return nb_tx;
 }

@@ -3581,11 +3602,13 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,

 	vhost_user_iotlb_rd_lock(vq);

-	if (unlikely(!vq->access_ok))
-		if (unlikely(vring_translate(dev, vq) < 0)) {
-			count = 0;
-			goto out;
-		}
+	if (unlikely(!vq->access_ok)) {
+		vhost_user_iotlb_rd_unlock(vq);
+		rte_rwlock_read_unlock(&vq->access_lock);
+
+		virtio_dev_vring_translate(dev, vq);
+		goto out_no_unlock;
+	}

 	/*
 	 * Construct a RARP broadcast packet, and inject it to the "pkts"
@@ -3646,6 +3669,7 @@ out_access_unlock:
 	if (unlikely(rarp_mbuf != NULL))
 		count += 1;

+out_no_unlock:
 	return count;
 }

@@ -4196,11 +4220,14 @@ rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id,

 	vhost_user_iotlb_rd_lock(vq);

-	if (unlikely(vq->access_ok == 0))
-		if (unlikely(vring_translate(dev, vq) < 0)) {
-			count = 0;
-			goto out;
-		}
+	if (unlikely(vq->access_ok == 0)) {
+		vhost_user_iotlb_rd_unlock(vq);
+		rte_rwlock_read_unlock(&vq->access_lock);
+
+		virtio_dev_vring_translate(dev, vq);
+		count = 0;
+		goto out_no_unlock;
+	}

 	/*
 	 * Construct a RARP broadcast packet, and inject it to the "pkts"
@@ -4266,5 +4293,6 @@ out_access_unlock:
 	if (unlikely(rarp_mbuf != NULL))
 		count += 1;

+out_no_unlock:
 	return count;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.640555955 +0800
+++ 0055-vhost-fix-virtqueue-access-check-in-datapath.patch	2024-03-05 17:39:30.763566493 +0800
@@ -1 +1 @@
-From 9fc93a1e23203e3053f5acc198e9203bc49024b5 Mon Sep 17 00:00:00 2001
+From bbba917213589deeedba18ad5671c4733cf0134e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9fc93a1e23203e3053f5acc198e9203bc49024b5 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 280d4845f8..c738b7edc9 100644
+index 8af20f1487..d00f4b03aa 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix virtqueue access check in VDUSE setup' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (54 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in datapath' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in vhost-user " Xueming Li
                   ` (80 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Eelco Chaudron, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=692a7a0034dfc55a057be1ffd8623581a5ada51d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 692a7a0034dfc55a057be1ffd8623581a5ada51d Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 5 Dec 2023 10:45:32 +0100
Subject: [PATCH] vhost: fix virtqueue access check in VDUSE setup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit af5328656709c65a75fe7bdd4146d18da16104b4 ]

vring_translate and vring_invalidate change the vq access_ok field.
The access_ok field should only be updated under a (write) lock.

Fixes: a9120db8b98b ("vhost: add VDUSE device startup")
Fixes: ad67c65efda1 ("vhost: add VDUSE device stop")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/vduse.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index 080b58f7de..e198eeef64 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -196,6 +196,7 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index)
 				vq->size * sizeof(struct batch_copy_elem),
 				RTE_CACHE_LINE_SIZE, 0);

+	rte_rwlock_write_lock(&vq->access_lock);
 	vhost_user_iotlb_rd_lock(vq);
 	if (vring_translate(dev, vq))
 		VHOST_LOG_CONFIG(dev->ifname, ERR, "Failed to translate vring %d addresses\n",
@@ -206,6 +207,7 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index)
 				"Failed to disable guest notifications on vring %d\n",
 				index);
 	vhost_user_iotlb_rd_unlock(vq);
+	rte_rwlock_write_unlock(&vq->access_lock);

 	vq_efd.index = index;
 	vq_efd.fd = vq->kickfd;
@@ -259,7 +261,9 @@ vduse_vring_cleanup(struct virtio_net *dev, unsigned int index)
 	close(vq->kickfd);
 	vq->kickfd = VIRTIO_UNINITIALIZED_EVENTFD;

+	rte_rwlock_write_lock(&vq->access_lock);
 	vring_invalidate(dev, vq);
+	rte_rwlock_write_unlock(&vq->access_lock);

 	rte_free(vq->batch_copy_elems);
 	vq->batch_copy_elems = NULL;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.668656556 +0800
+++ 0056-vhost-fix-virtqueue-access-check-in-VDUSE-setup.patch	2024-03-05 17:39:30.773566493 +0800
@@ -1 +1 @@
-From af5328656709c65a75fe7bdd4146d18da16104b4 Mon Sep 17 00:00:00 2001
+From 692a7a0034dfc55a057be1ffd8623581a5ada51d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit af5328656709c65a75fe7bdd4146d18da16104b4 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index c7ba5a61dd..d462428d2c 100644
+index 080b58f7de..e198eeef64 100644
@@ -31 +33 @@
- 		VHOST_CONFIG_LOG(dev->ifname, ERR, "Failed to translate vring %d addresses",
+ 		VHOST_LOG_CONFIG(dev->ifname, ERR, "Failed to translate vring %d addresses\n",
@@ -33 +35 @@
- 				"Failed to disable guest notifications on vring %d",
+ 				"Failed to disable guest notifications on vring %d\n",

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix virtqueue access check in vhost-user setup' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (55 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in VDUSE setup' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/virtio: remove duplicate queue xstats' " Xueming Li
                   ` (79 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: Eelco Chaudron, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c8e7cd6c6dbf806fe64c8b930ad362d253fc7230

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c8e7cd6c6dbf806fe64c8b930ad362d253fc7230 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 5 Dec 2023 10:45:33 +0100
Subject: [PATCH] vhost: fix virtqueue access check in vhost-user setup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b3e42d92362bcc75df21c5b86ba7c0685b40a3bf ]

Calling vring_invalidate must be done with a (write) lock taken on the
virtqueue.

Fixes: 72d002b3ebda ("vhost: fix vring address handling during live migration")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/vhost_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index e36312181a..a323ce5fbf 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2198,7 +2198,9 @@ vhost_user_get_vring_base(struct virtio_net **pdev,

 	vhost_user_iotlb_flush_all(dev);

+	rte_rwlock_write_lock(&vq->access_lock);
 	vring_invalidate(dev, vq);
+	rte_rwlock_write_unlock(&vq->access_lock);

 	return RTE_VHOST_MSG_RESULT_REPLY;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.691983857 +0800
+++ 0057-vhost-fix-virtqueue-access-check-in-vhost-user-setup.patch	2024-03-05 17:39:30.773566493 +0800
@@ -1 +1 @@
-From b3e42d92362bcc75df21c5b86ba7c0685b40a3bf Mon Sep 17 00:00:00 2001
+From c8e7cd6c6dbf806fe64c8b930ad362d253fc7230 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b3e42d92362bcc75df21c5b86ba7c0685b40a3bf ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index bac10e6182..931dc690ad 100644
+index e36312181a..a323ce5fbf 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/virtio: remove duplicate queue xstats' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (56 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in vhost-user " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vhost: fix deadlock during vDPA SW live migration' " Xueming Li
                   ` (78 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Edwin Brossette; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=33fbddf9a41548ffe2746b6dfee7e3bdb64c043b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 33fbddf9a41548ffe2746b6dfee7e3bdb64c043b Mon Sep 17 00:00:00 2001
From: Edwin Brossette <edwin.brossette@6wind.com>
Date: Fri, 24 Nov 2023 14:52:36 +0100
Subject: [PATCH] net/virtio: remove duplicate queue xstats
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4b0a1fdb745c39003d70c75696d6730eba5636a5 ]

The flag RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS was temporarily set while
moving queue stats from 'struct rte_eth_stats' to the individual PMDs,
as explained in commit
f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats").

This flag was added so every pmd would keep its original behavior until
the change was implemented. However, this flag was not removed
afterwards in the virtio PMD and as a result, some queue stats are
displayed twice when trying to get them: once in lib_rte_ethdev, and a
second time in the virtio PMD.

Remove this flag so stats are printed only once.

Fixes: f30e69b41f94 ("ethdev: add device flag to bypass auto-filled queue xstats")

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index c2c0a1a111..517585740e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1793,8 +1793,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 	else
 		eth_dev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC;

-	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
-
 	/* Setting up rx_header size for the device */
 	if (virtio_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF) ||
 	    virtio_with_feature(hw, VIRTIO_F_VERSION_1) ||
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.717076558 +0800
+++ 0058-net-virtio-remove-duplicate-queue-xstats.patch	2024-03-05 17:39:30.773566493 +0800
@@ -1 +1 @@
-From 4b0a1fdb745c39003d70c75696d6730eba5636a5 Mon Sep 17 00:00:00 2001
+From 33fbddf9a41548ffe2746b6dfee7e3bdb64c043b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4b0a1fdb745c39003d70c75696d6730eba5636a5 ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix deadlock during vDPA SW live migration' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (57 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/virtio: remove duplicate queue xstats' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vdpa/mlx5: fix queue enable drain CQ' " Xueming Li
                   ` (77 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Hao Chen; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5eb1dd92dce634a60324243f530dfb4130efe610

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5eb1dd92dce634a60324243f530dfb4130efe610 Mon Sep 17 00:00:00 2001
From: Hao Chen <chenh@yusur.tech>
Date: Mon, 22 Jan 2024 11:27:44 +0800
Subject: [PATCH] vhost: fix deadlock during vDPA SW live migration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 19639c3b693bcfdc941c56d9d5bd60f65a8eeecb ]

In a nested virtualization environment, running dpdk-vdpa
in QEMU-L1 for software live migration will result in a
deadlock between dpdk-vdpa and QEMU-L2 processes.
'rte_vdpa_relay_vring_used'->
'__vhost_iova_to_vva'->
'vhost_user_iotlb_rd_unlock(vq)'->
'vhost_user_iotlb_miss'-> send vhost message
'VHOST_USER_SLAVE_IOTLB_MSG' to QEMU-L2's vdpa socket, then
call 'vhost_user_iotlb_rd_lock(vq)' to hold the read lock
`iotlb_lock`.

But there is no place to release this read lock.

QEMU-L2 get the 'VHOST_USER_SLAVE_IOTLB_MSG', then call
'vhost_user_send_device_iotlb_msg' to send
'VHOST_USER_IOTLB_MSG' messages to dpdk-vdpa.

dpdk-vdpa will call vhost_user_iotlb_cache_insert and will
obtain the write lock `iotlb_lock`, but the read lock
`iotlb_lock` has not been released and will block here.

This patch add lock and unlock function to fix the deadlock.

Fixes: b13ad2decc83 ("vhost: provide helpers for virtio ring relay")

Signed-off-by: Hao Chen <chenh@yusur.tech>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/vdpa.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index 219eef879c..ce4fb09859 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -19,6 +19,7 @@
 #include "rte_vdpa.h"
 #include "vdpa_driver.h"
 #include "vhost.h"
+#include "iotlb.h"

 /** Double linked list of vDPA devices. */
 TAILQ_HEAD(vdpa_device_list, rte_vdpa_device);
@@ -147,7 +148,6 @@ rte_vdpa_unregister_device(struct rte_vdpa_device *dev)

 int
 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
-	__rte_no_thread_safety_analysis /* FIXME: requires iotlb_lock? */
 {
 	struct virtio_net *dev = get_device(vid);
 	uint16_t idx, idx_m, desc_id;
@@ -193,17 +193,21 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
 			if (unlikely(nr_descs > vq->size))
 				return -1;

+			vhost_user_iotlb_rd_lock(vq);
 			desc_ring = (struct vring_desc *)(uintptr_t)
 				vhost_iova_to_vva(dev, vq,
 						vq->desc[desc_id].addr, &dlen,
 						VHOST_ACCESS_RO);
+			vhost_user_iotlb_rd_unlock(vq);
 			if (unlikely(!desc_ring))
 				return -1;

 			if (unlikely(dlen < vq->desc[desc_id].len)) {
+				vhost_user_iotlb_rd_lock(vq);
 				idesc = vhost_alloc_copy_ind_table(dev, vq,
 						vq->desc[desc_id].addr,
 						vq->desc[desc_id].len);
+				vhost_user_iotlb_rd_unlock(vq);
 				if (unlikely(!idesc))
 					return -1;

@@ -220,9 +224,12 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
 			if (unlikely(nr_descs-- == 0))
 				goto fail;
 			desc = desc_ring[desc_id];
-			if (desc.flags & VRING_DESC_F_WRITE)
+			if (desc.flags & VRING_DESC_F_WRITE) {
+				vhost_user_iotlb_rd_lock(vq);
 				vhost_log_write_iova(dev, vq, desc.addr,
 						     desc.len);
+				vhost_user_iotlb_rd_unlock(vq);
+			}
 			desc_id = desc.next;
 		} while (desc.flags & VRING_DESC_F_NEXT);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.743697159 +0800
+++ 0059-vhost-fix-deadlock-during-vDPA-SW-live-migration.patch	2024-03-05 17:39:30.773566493 +0800
@@ -1 +1 @@
-From 19639c3b693bcfdc941c56d9d5bd60f65a8eeecb Mon Sep 17 00:00:00 2001
+From 5eb1dd92dce634a60324243f530dfb4130efe610 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 19639c3b693bcfdc941c56d9d5bd60f65a8eeecb ]
@@ -30 +32,0 @@
-Cc: stable@dpdk.org
@@ -39 +41 @@
-index 9776fc07a9..a1dd5a753b 100644
+index 219eef879c..ce4fb09859 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vdpa/mlx5: fix queue enable drain CQ' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (58 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vhost: fix deadlock during vDPA SW live migration' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'vhost: fix memory leak in Virtio Tx split path' " Xueming Li
                   ` (76 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Yajun Wu; +Cc: Matan Azrad, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=19f0cf0927c7171c0fe06526388f51c17c5ce62b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 19f0cf0927c7171c0fe06526388f51c17c5ce62b Mon Sep 17 00:00:00 2001
From: Yajun Wu <yajunw@nvidia.com>
Date: Thu, 25 Jan 2024 11:17:55 +0800
Subject: [PATCH] vdpa/mlx5: fix queue enable drain CQ
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ]

For the case: `ethtool -L eth0 combined xxx` in VM, VQ will disable
and enable without calling device close. In such case, need add
drain CQ before reuse/reset event QP.

Fixes: 24969c7b6224 ("vdpa/mlx5: reuse event queues")

Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 9557c1042e..32430614d5 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -244,22 +244,30 @@ mlx5_vdpa_queues_complete(struct mlx5_vdpa_priv *priv)
 	return max;
 }

+static void
+mlx5_vdpa_drain_cq_one(struct mlx5_vdpa_priv *priv,
+	struct mlx5_vdpa_virtq *virtq)
+{
+	struct mlx5_vdpa_cq *cq = &virtq->eqp.cq;
+
+	mlx5_vdpa_queue_complete(cq);
+	if (cq->cq_obj.cq) {
+		cq->cq_obj.cqes[0].wqe_counter = rte_cpu_to_be_16(UINT16_MAX);
+		virtq->eqp.qp_pi = 0;
+		if (!cq->armed)
+			mlx5_vdpa_cq_arm(priv, cq);
+	}
+}
+
 void
 mlx5_vdpa_drain_cq(struct mlx5_vdpa_priv *priv)
 {
+	struct mlx5_vdpa_virtq *virtq;
 	unsigned int i;

 	for (i = 0; i < priv->caps.max_num_virtio_queues; i++) {
-		struct mlx5_vdpa_cq *cq = &priv->virtqs[i].eqp.cq;
-
-		mlx5_vdpa_queue_complete(cq);
-		if (cq->cq_obj.cq) {
-			cq->cq_obj.cqes[0].wqe_counter =
-				rte_cpu_to_be_16(UINT16_MAX);
-			priv->virtqs[i].eqp.qp_pi = 0;
-			if (!cq->armed)
-				mlx5_vdpa_cq_arm(priv, cq);
-		}
+		virtq = &priv->virtqs[i];
+		mlx5_vdpa_drain_cq_one(priv, virtq);
 	}
 }

@@ -632,6 +640,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n,
 	if (eqp->cq.cq_obj.cq != NULL && log_desc_n == eqp->cq.log_desc_n) {
 		/* Reuse existing resources. */
 		eqp->cq.callfd = callfd;
+		mlx5_vdpa_drain_cq_one(priv, virtq);
 		/* FW will set event qp to error state in q destroy. */
 		if (reset && !mlx5_vdpa_qps2rst2rts(eqp))
 			rte_write32(rte_cpu_to_be_32(RTE_BIT32(log_desc_n)),
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.765921359 +0800
+++ 0060-vdpa-mlx5-fix-queue-enable-drain-CQ.patch	2024-03-05 17:39:30.773566493 +0800
@@ -1 +1 @@
-From 32fbcf3139fbff04651b3fe173e9f3457f105221 Mon Sep 17 00:00:00 2001
+From 19f0cf0927c7171c0fe06526388f51c17c5ce62b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 32fbcf3139fbff04651b3fe173e9f3457f105221 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix memory leak in Virtio Tx split path' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (59 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vdpa/mlx5: fix queue enable drain CQ' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'cryptodev: remove unused extern variable' " Xueming Li
                   ` (75 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e951bbbd186c29ef86a3016ff30bc33b9dac35fa

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e951bbbd186c29ef86a3016ff30bc33b9dac35fa Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Wed, 31 Jan 2024 20:53:08 +0100
Subject: [PATCH] vhost: fix memory leak in Virtio Tx split path
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7746fba831509fdb4c528266d0b38a89566e01e5 ]

When vIOMMU is enabled, rte_vhost_dequeue_burst() can return early
because of IOTLB misses.
Such IOTLB misses are especially frequent when a Virtio device is
bound to a kernel driver in guest.

This patch fixes a mbuf leak occurring in this case.

Fixes: 242695f6122a ("vhost: allocate and free packets in bulk in Tx split")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/vhost/virtio_net.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index d00f4b03aa..895a79cf51 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3104,7 +3104,6 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 {
 	uint16_t i;
 	uint16_t avail_entries;
-	uint16_t dropped = 0;
 	static bool allocerr_warned;

 	/*
@@ -3143,11 +3142,8 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,

 		update_shadow_used_ring_split(vq, head_idx, 0);

-		if (unlikely(buf_len <= dev->vhost_hlen)) {
-			dropped += 1;
-			i++;
+		if (unlikely(buf_len <= dev->vhost_hlen))
 			break;
-		}

 		buf_len -= dev->vhost_hlen;

@@ -3164,8 +3160,6 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 					buf_len, mbuf_pool->name);
 				allocerr_warned = true;
 			}
-			dropped += 1;
-			i++;
 			break;
 		}

@@ -3176,27 +3170,21 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 				VHOST_LOG_DATA(dev->ifname, ERR, "failed to copy desc to mbuf.\n");
 				allocerr_warned = true;
 			}
-			dropped += 1;
-			i++;
 			break;
 		}
-
 	}

-	if (dropped)
-		rte_pktmbuf_free_bulk(&pkts[i - 1], count - i + 1);
+	if (unlikely(count != i))
+		rte_pktmbuf_free_bulk(&pkts[i], count - i);

-	vq->last_avail_idx += i;
-
-	do_data_copy_dequeue(vq);
-	if (unlikely(i < count))
-		vq->shadow_used_idx = i;
 	if (likely(vq->shadow_used_idx)) {
+		vq->last_avail_idx += vq->shadow_used_idx;
+		do_data_copy_dequeue(vq);
 		flush_shadow_used_ring_split(dev, vq);
 		vhost_vring_call_split(dev, vq);
 	}

-	return (i - dropped);
+	return i;
 }

 __rte_noinline
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.803090760 +0800
+++ 0061-vhost-fix-memory-leak-in-Virtio-Tx-split-path.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From 7746fba831509fdb4c528266d0b38a89566e01e5 Mon Sep 17 00:00:00 2001
+From e951bbbd186c29ef86a3016ff30bc33b9dac35fa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7746fba831509fdb4c528266d0b38a89566e01e5 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index c738b7edc9..9951842b9f 100644
+index d00f4b03aa..895a79cf51 100644
@@ -58 +60 @@
- 				VHOST_DATA_LOG(dev->ifname, ERR, "failed to copy desc to mbuf.");
+ 				VHOST_LOG_DATA(dev->ifname, ERR, "failed to copy desc to mbuf.\n");

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'cryptodev: remove unused extern variable' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (60 preceding siblings ...)
  2024-03-05  9:46 ` patch 'vhost: fix memory leak in Virtio Tx split path' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'examples/ipsec-secgw: fix width of variables' " Xueming Li
                   ` (74 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=96d48b5b40c7fc54c66734c2e239ba7a37b16c21

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 96d48b5b40c7fc54c66734c2e239ba7a37b16c21 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 12 Dec 2023 08:31:04 -0800
Subject: [PATCH] cryptodev: remove unused extern variable
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b6f30094e511c22f038907a507d16f7cc022c682 ]

The variable rte_cyptodev_names is unused and misspelled.

Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op oriented")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/cryptodev/rte_cryptodev.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index aaeaf294e6..59c7d69da5 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -26,8 +26,6 @@ extern "C" {

 #include "rte_cryptodev_trace_fp.h"

-extern const char **rte_cyptodev_names;
-
 /* Logging Macros */

 #define CDEV_LOG_ERR(...) \
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.828445461 +0800
+++ 0062-cryptodev-remove-unused-extern-variable.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From b6f30094e511c22f038907a507d16f7cc022c682 Mon Sep 17 00:00:00 2001
+From 96d48b5b40c7fc54c66734c2e239ba7a37b16c21 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b6f30094e511c22f038907a507d16f7cc022c682 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 359b6c2b29..f6ab0e5bbb 100644
+index aaeaf294e6..59c7d69da5 100644
@@ -27,3 +29,3 @@
- /**
-  * @internal Logtype used for cryptodev related messages.
-  */
+ /* Logging Macros */
+
+ #define CDEV_LOG_ERR(...) \

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/ipsec-secgw: fix width of variables' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (61 preceding siblings ...)
  2024-03-05  9:46 ` patch 'cryptodev: remove unused extern variable' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'common/cnxk: fix memory leak in CPT init' " Xueming Li
                   ` (73 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Konstantin Ananyev, Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f5d6c54154ea55c29a229683fae42f880980c4f0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f5d6c54154ea55c29a229683fae42f880980c4f0 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Tue, 19 Dec 2023 10:59:22 +0530
Subject: [PATCH] examples/ipsec-secgw: fix width of variables
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6b9dabfdffee7ff1efa83e9548b4063fab0819c5 ]

'rte_eth_rx_burst' returns uint16_t. The same value need to be passed
to 'process_packets' functions which performs further processing. Having
this function use 'uint8_t' can result in issues when MAX_PKT_BURST is
larger.

The route functions (route4_pkts & route6_pkts) take uint8_t as the
argument. The caller can pass larger values as the field that is passed
is of type uint32_t. And the function can work with uint32_t as it loops
through the packets and sends it out. Using uint8_t can result in silent
packet drops.

Fixes: 4fbfa6c7c921 ("examples/ipsec-secgw: update eth header during route lookup")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 examples/ipsec-secgw/ipsec-secgw.c  | 5 ++---
 examples/ipsec-secgw/ipsec_worker.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index bf98d2618b..a61bea400a 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -568,7 +568,7 @@ process_pkts_outbound_nosp(struct ipsec_ctx *ipsec_ctx,

 static inline void
 process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts,
-	     uint8_t nb_pkts, uint16_t portid, void *ctx)
+	     uint16_t nb_pkts, uint16_t portid, void *ctx)
 {
 	struct ipsec_traffic traffic;

@@ -695,8 +695,7 @@ ipsec_poll_mode_worker(void)
 	struct rte_mbuf *pkts[MAX_PKT_BURST];
 	uint32_t lcore_id;
 	uint64_t prev_tsc, diff_tsc, cur_tsc;
-	int32_t i, nb_rx;
-	uint16_t portid;
+	uint16_t i, nb_rx, portid;
 	uint8_t queueid;
 	struct lcore_conf *qconf;
 	int32_t rc, socket_id;
diff --git a/examples/ipsec-secgw/ipsec_worker.h b/examples/ipsec-secgw/ipsec_worker.h
index ac980b8bcf..8e937fda3e 100644
--- a/examples/ipsec-secgw/ipsec_worker.h
+++ b/examples/ipsec-secgw/ipsec_worker.h
@@ -469,7 +469,7 @@ fail:

 static __rte_always_inline void
 route4_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf *pkts[],
-	    uint8_t nb_pkts, uint64_t tx_offloads, bool ip_cksum)
+	    uint32_t nb_pkts, uint64_t tx_offloads, bool ip_cksum)
 {
 	uint32_t hop[MAX_PKT_BURST * 2];
 	uint32_t dst_ip[MAX_PKT_BURST * 2];
@@ -557,7 +557,7 @@ route4_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf *pkts[],
 }

 static __rte_always_inline void
-route6_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf *pkts[], uint8_t nb_pkts)
+route6_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf *pkts[], uint32_t nb_pkts)
 {
 	int32_t hop[MAX_PKT_BURST * 2];
 	uint8_t dst_ip[MAX_PKT_BURST * 2][16];
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.852461062 +0800
+++ 0063-examples-ipsec-secgw-fix-width-of-variables.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From 6b9dabfdffee7ff1efa83e9548b4063fab0819c5 Mon Sep 17 00:00:00 2001
+From f5d6c54154ea55c29a229683fae42f880980c4f0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6b9dabfdffee7ff1efa83e9548b4063fab0819c5 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix memory leak in CPT init' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (62 preceding siblings ...)
  2024-03-05  9:46 ` patch 'examples/ipsec-secgw: fix width of variables' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'crypto/cnxk: fix CN9K ECDH public key verification' " Xueming Li
                   ` (72 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ea096d3e488957cb72e339e9822794e0f6bfd2a9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ea096d3e488957cb72e339e9822794e0f6bfd2a9 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil@marvell.com>
Date: Wed, 17 Jan 2024 16:00:46 +0530
Subject: [PATCH] common/cnxk: fix memory leak in CPT init
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ffe0b570cfd04a35b3a2f8f753efbbbe0225c38c ]

dev_init() acquires some resources which need to be cleaned
in case a failure is observed afterwards.

Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration")

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/common/cnxk/roc_cpt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index 981e85a204..4e23d8c135 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -756,7 +756,7 @@ roc_cpt_dev_init(struct roc_cpt *roc_cpt)
 	rc = dev_init(dev, pci_dev);
 	if (rc) {
 		plt_err("Failed to init roc device");
-		goto fail;
+		return rc;
 	}

 	cpt->pci_dev = pci_dev;
@@ -788,6 +788,7 @@ roc_cpt_dev_init(struct roc_cpt *roc_cpt)
 	return 0;

 fail:
+	dev_fini(dev, pci_dev);
 	return rc;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.877164463 +0800
+++ 0064-common-cnxk-fix-memory-leak-in-CPT-init.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From ffe0b570cfd04a35b3a2f8f753efbbbe0225c38c Mon Sep 17 00:00:00 2001
+From ea096d3e488957cb72e339e9822794e0f6bfd2a9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ffe0b570cfd04a35b3a2f8f753efbbbe0225c38c ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'crypto/cnxk: fix CN9K ECDH public key verification' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (63 preceding siblings ...)
  2024-03-05  9:46 ` patch 'common/cnxk: fix memory leak in CPT init' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix next segment mbuf' " Xueming Li
                   ` (71 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8988726643bc4e51fc69195f98fde69422761cf0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8988726643bc4e51fc69195f98fde69422761cf0 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Wed, 17 Jan 2024 16:00:50 +0530
Subject: [PATCH] crypto/cnxk: fix CN9K ECDH public key verification
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5c90255831675489f3e303f7c2b08012f8401505 ]

Fix ECDH pubkey verify in cn9k.

Fixes: baae0994fa96 ("crypto/cnxk: support ECDH")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index 34d40b07d4..442cd8e5a9 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -578,7 +578,17 @@ cn9k_cpt_dequeue_post_process(struct cnxk_cpt_qp *qp, struct rte_crypto_op *cop,
 		if (unlikely(res->uc_compcode)) {
 			if (res->uc_compcode == ROC_SE_ERR_GC_ICV_MISCOMPARE)
 				cop->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
-			else
+			else if (cop->type == RTE_CRYPTO_OP_TYPE_ASYMMETRIC &&
+				 cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION &&
+				 cop->asym->ecdh.ke_type == RTE_CRYPTO_ASYM_KE_PUB_KEY_VERIFY) {
+				if (res->uc_compcode == ROC_AE_ERR_ECC_POINT_NOT_ON_CURVE) {
+					cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
+					return;
+				} else if (res->uc_compcode == ROC_AE_ERR_ECC_PAI) {
+					cop->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
+					return;
+				}
+			} else
 				cop->status = RTE_CRYPTO_OP_STATUS_ERROR;

 			plt_dp_info("Request failed with microcode error");
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.903248864 +0800
+++ 0065-crypto-cnxk-fix-CN9K-ECDH-public-key-verification.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From 5c90255831675489f3e303f7c2b08012f8401505 Mon Sep 17 00:00:00 2001
+From 8988726643bc4e51fc69195f98fde69422761cf0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5c90255831675489f3e303f7c2b08012f8401505 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 8b91d11b79..ccbd390bd7 100644
+index 34d40b07d4..442cd8e5a9 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: fix next segment mbuf' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (64 preceding siblings ...)
  2024-03-05  9:46 ` patch 'crypto/cnxk: fix CN9K ECDH public key verification' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix data comparison' " Xueming Li
                   ` (70 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Anoob Joseph, Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=dfc9d45365291d201b6f08cfaa5efba092a9572b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dfc9d45365291d201b6f08cfaa5efba092a9572b Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Thu, 4 Jan 2024 10:24:05 +0800
Subject: [PATCH] app/crypto-perf: fix next segment mbuf
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 06a109ca5dc551631d9251e81966a4bc52f98c5a ]

In fill_multi_seg_mbuf(), when remaining_segments is 0,
rte_mbuf m's next should pointer to NULL instead of a
new rte_mbuf, that causes setting m->next as NULL out
of the while loop to the invalid mbuf.

This commit fixes the invalid mbuf next operation.

Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 app/test-crypto-perf/cperf_test_common.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 932aab16df..b3bf9f67e8 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -49,7 +49,6 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
 {
 	uint16_t mbuf_hdr_size = sizeof(struct rte_mbuf);
 	uint16_t remaining_segments = segments_nb;
-	struct rte_mbuf *next_mbuf;
 	rte_iova_t next_seg_phys_addr = rte_mempool_virt2iova(obj) +
 			 mbuf_offset + mbuf_hdr_size;

@@ -70,15 +69,15 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct rte_mempool *mp,
 		m->nb_segs = segments_nb;
 		m->port = 0xff;
 		rte_mbuf_refcnt_set(m, 1);
-		next_mbuf = (struct rte_mbuf *) ((uint8_t *) m +
-					mbuf_hdr_size + segment_sz);
-		m->next = next_mbuf;
-		m = next_mbuf;
-		remaining_segments--;

+		remaining_segments--;
+		if (remaining_segments > 0) {
+			m->next = (struct rte_mbuf *)((uint8_t *) m + mbuf_hdr_size + segment_sz);
+			m = m->next;
+		} else {
+			m->next = NULL;
+		}
 	} while (remaining_segments > 0);
-
-	m->next = NULL;
 }

 static void
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.931514065 +0800
+++ 0066-app-crypto-perf-fix-next-segment-mbuf.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From 06a109ca5dc551631d9251e81966a4bc52f98c5a Mon Sep 17 00:00:00 2001
+From dfc9d45365291d201b6f08cfaa5efba092a9572b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 06a109ca5dc551631d9251e81966a4bc52f98c5a ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: fix data comparison' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (65 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix next segment mbuf' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix encrypt operation verification' " Xueming Li
                   ` (69 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Anoob Joseph, Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=04d9dfd6655c1604a1496601a8dac81580b6ec8f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 04d9dfd6655c1604a1496601a8dac81580b6ec8f Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Fri, 5 Jan 2024 08:03:22 +0800
Subject: [PATCH] app/crypto-perf: fix data comparison
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ddec2a39bae12da2817392239ddce19f3953fd53 ]

The function memcmp() returns an integer less than, equal to,
or greater than zero. In current code, if the first memcmp()
returns less than zero and the second memcmp() returns greater
than zero, the sum of results may still be 0 and indicates
verify successed.

This commit converts the return value to be zero or greater
than zero. That will make sure the sum of results be correct.

Fixes: df52cb3b6e13 ("app/crypto-perf: move verify as single test type")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 app/test-crypto-perf/cperf_test_verify.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index a6c0ffe813..8aa714b969 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -186,18 +186,18 @@ cperf_verify_op(struct rte_crypto_op *op,

 	if (cipher == 1) {
 		if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
-			res += memcmp(data + cipher_offset,
+			res += !!memcmp(data + cipher_offset,
 					vector->ciphertext.data,
 					options->test_buffer_size);
 		else
-			res += memcmp(data + cipher_offset,
+			res += !!memcmp(data + cipher_offset,
 					vector->plaintext.data,
 					options->test_buffer_size);
 	}

 	if (auth == 1) {
 		if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE)
-			res += memcmp(data + auth_offset,
+			res += !!memcmp(data + auth_offset,
 					vector->digest.data,
 					options->digest_sz);
 	}
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.955412366 +0800
+++ 0067-app-crypto-perf-fix-data-comparison.patch	2024-03-05 17:39:30.783566493 +0800
@@ -1 +1 @@
-From ddec2a39bae12da2817392239ddce19f3953fd53 Mon Sep 17 00:00:00 2001
+From 04d9dfd6655c1604a1496601a8dac81580b6ec8f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ddec2a39bae12da2817392239ddce19f3953fd53 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: fix encrypt operation verification' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (66 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix data comparison' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'event/cnxk: fix dequeue timeout configuration' " Xueming Li
                   ` (68 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Anoob Joseph, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b7fd1f73feff644ae8483546f3fb5c9903f5e6e6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b7fd1f73feff644ae8483546f3fb5c9903f5e6e6 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Fri, 5 Jan 2024 08:03:23 +0800
Subject: [PATCH] app/crypto-perf: fix encrypt operation verification
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7d55ca15124c47561120d23d5023843ad99c1a81 ]

AEAD uses RTE_CRYPTO_AEAD_OP_* with aead_op and CIPHER uses
RTE_CRYPTO_CIPHER_OP_* with cipher_op in current code.

This commit aligns aead_op and cipher_op operation to fix
incorrect AEAD verification.

Fixes: df52cb3b6e13 ("app/crypto-perf: move verify as single test type")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test-crypto-perf/cperf_test_verify.c | 55 ++++++++++++------------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index 8aa714b969..2b0d3f142b 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -111,8 +111,10 @@ cperf_verify_op(struct rte_crypto_op *op,
 	uint32_t len;
 	uint16_t nb_segs;
 	uint8_t *data;
-	uint32_t cipher_offset, auth_offset;
-	uint8_t	cipher, auth;
+	uint32_t cipher_offset, auth_offset = 0;
+	bool cipher = false;
+	bool digest_verify = false;
+	bool is_encrypt = false;
 	int res = 0;

 	if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS)
@@ -150,42 +152,43 @@ cperf_verify_op(struct rte_crypto_op *op,

 	switch (options->op_type) {
 	case CPERF_CIPHER_ONLY:
-		cipher = 1;
+		cipher = true;
 		cipher_offset = 0;
-		auth = 0;
-		auth_offset = 0;
-		break;
-	case CPERF_CIPHER_THEN_AUTH:
-		cipher = 1;
-		cipher_offset = 0;
-		auth = 1;
-		auth_offset = options->test_buffer_size;
+		is_encrypt = options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT;
 		break;
 	case CPERF_AUTH_ONLY:
-		cipher = 0;
 		cipher_offset = 0;
-		auth = 1;
-		auth_offset = options->test_buffer_size;
+		if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE) {
+			auth_offset = options->test_buffer_size;
+			digest_verify = true;
+		}
 		break;
+	case CPERF_CIPHER_THEN_AUTH:
 	case CPERF_AUTH_THEN_CIPHER:
-		cipher = 1;
+		cipher = true;
 		cipher_offset = 0;
-		auth = 1;
-		auth_offset = options->test_buffer_size;
+		if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) {
+			auth_offset = options->test_buffer_size;
+			digest_verify = true;
+			is_encrypt = true;
+		}
 		break;
 	case CPERF_AEAD:
-		cipher = 1;
+		cipher = true;
 		cipher_offset = 0;
-		auth = 1;
-		auth_offset = options->test_buffer_size;
+		if (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) {
+			auth_offset = options->test_buffer_size;
+			digest_verify = true;
+			is_encrypt = true;
+		}
 		break;
 	default:
 		res = 1;
 		goto out;
 	}

-	if (cipher == 1) {
-		if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
+	if (cipher) {
+		if (is_encrypt)
 			res += !!memcmp(data + cipher_offset,
 					vector->ciphertext.data,
 					options->test_buffer_size);
@@ -195,12 +198,8 @@ cperf_verify_op(struct rte_crypto_op *op,
 					options->test_buffer_size);
 	}

-	if (auth == 1) {
-		if (options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE)
-			res += !!memcmp(data + auth_offset,
-					vector->digest.data,
-					options->digest_sz);
-	}
+	if (digest_verify)
+		res += !!memcmp(data + auth_offset, vector->digest.data, options->digest_sz);

 out:
 	rte_free(data);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:32.985038467 +0800
+++ 0068-app-crypto-perf-fix-encrypt-operation-verification.patch	2024-03-05 17:39:30.793566494 +0800
@@ -1 +1 @@
-From 7d55ca15124c47561120d23d5023843ad99c1a81 Mon Sep 17 00:00:00 2001
+From b7fd1f73feff644ae8483546f3fb5c9903f5e6e6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7d55ca15124c47561120d23d5023843ad99c1a81 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'event/cnxk: fix dequeue timeout configuration' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (67 preceding siblings ...)
  2024-03-05  9:46 ` patch 'app/crypto-perf: fix encrypt operation verification' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'test/event: skip test if no driver is present' " Xueming Li
                   ` (67 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6ccd84cf1692d9fdc800078696afb99219946ed9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6ccd84cf1692d9fdc800078696afb99219946ed9 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Thu, 7 Dec 2023 12:25:39 +0530
Subject: [PATCH] event/cnxk: fix dequeue timeout configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit efcf81e1a89fa7b20aae17accfcb4a8e7ddc3d02 ]

Allow dequeue timeout to be configured as zero, when
RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT is disabled.

Fixes: 5512c7de85cd ("event/cnxk: add common configuration validation")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/cnxk/cnxk_eventdev.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
index 1ec281e735..20f7f0d6df 100644
--- a/drivers/event/cnxk/cnxk_eventdev.c
+++ b/drivers/event/cnxk/cnxk_eventdev.c
@@ -162,16 +162,17 @@ cnxk_sso_dev_validate(const struct rte_eventdev *event_dev, uint32_t deq_depth,

 	deq_tmo_ns = conf->dequeue_timeout_ns;

-	if (deq_tmo_ns == 0)
-		deq_tmo_ns = dev->min_dequeue_timeout_ns;
-	if (deq_tmo_ns < dev->min_dequeue_timeout_ns ||
-	    deq_tmo_ns > dev->max_dequeue_timeout_ns) {
+	if (deq_tmo_ns && (deq_tmo_ns < dev->min_dequeue_timeout_ns ||
+			   deq_tmo_ns > dev->max_dequeue_timeout_ns)) {
 		plt_err("Unsupported dequeue timeout requested");
 		return -EINVAL;
 	}

-	if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)
+	if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) {
+		if (deq_tmo_ns == 0)
+			deq_tmo_ns = dev->min_dequeue_timeout_ns;
 		dev->is_timeout_deq = 1;
+	}

 	dev->deq_tmo_ns = deq_tmo_ns;

@@ -666,7 +667,7 @@ cnxk_sso_init(struct rte_eventdev *event_dev)
 	}

 	dev->is_timeout_deq = 0;
-	dev->min_dequeue_timeout_ns = 0;
+	dev->min_dequeue_timeout_ns = USEC2NSEC(1);
 	dev->max_dequeue_timeout_ns = USEC2NSEC(0x3FF);
 	dev->max_num_events = -1;
 	dev->nb_event_queues = 0;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.012799767 +0800
+++ 0069-event-cnxk-fix-dequeue-timeout-configuration.patch	2024-03-05 17:39:30.793566494 +0800
@@ -1 +1 @@
-From efcf81e1a89fa7b20aae17accfcb4a8e7ddc3d02 Mon Sep 17 00:00:00 2001
+From 6ccd84cf1692d9fdc800078696afb99219946ed9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit efcf81e1a89fa7b20aae17accfcb4a8e7ddc3d02 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test/event: skip test if no driver is present' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (68 preceding siblings ...)
  2024-03-05  9:46 ` patch 'event/cnxk: fix dequeue timeout configuration' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'doc: fix commands in eventdev test tool guide' " Xueming Li
                   ` (66 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=935051346296fcd2075265414e5161b8dbaa309b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 935051346296fcd2075265414e5161b8dbaa309b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 24 Jan 2024 13:33:38 +0100
Subject: [PATCH] test/event: skip test if no driver is present
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f1caf6ff072ad932d93f3d5587c504d5f90d5d70 ]

Align eventdev with what other device abstraction libraries do: if no
driver is present, skip the tests.

Fixes: f8f9d233ea0e ("test/eventdev: add unit tests")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_eventdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 71de947ce4..e4e234dc98 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -33,9 +33,15 @@ testsuite_setup(void)
 	uint8_t count;
 	count = rte_event_dev_count();
 	if (!count) {
+		int ret;
+
 		printf("Failed to find a valid event device,"
-			" testing with event_skeleton device\n");
-		return rte_vdev_init("event_skeleton", NULL);
+			" trying with event_skeleton device\n");
+		ret = rte_vdev_init("event_skeleton", NULL);
+		if (ret != 0) {
+			printf("No event device, skipping\n");
+			return TEST_SKIPPED;
+		}
 	}
 	return TEST_SUCCESS;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.043051268 +0800
+++ 0070-test-event-skip-test-if-no-driver-is-present.patch	2024-03-05 17:39:30.793566494 +0800
@@ -1 +1 @@
-From f1caf6ff072ad932d93f3d5587c504d5f90d5d70 Mon Sep 17 00:00:00 2001
+From 935051346296fcd2075265414e5161b8dbaa309b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f1caf6ff072ad932d93f3d5587c504d5f90d5d70 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix commands in eventdev test tool guide' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (69 preceding siblings ...)
  2024-03-05  9:46 ` patch 'test/event: skip test if no driver is present' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'ethdev: fix NVGRE encap flow action description' " Xueming Li
                   ` (65 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d06a34452406cbc0c0802c634a657d0033c7d1f0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d06a34452406cbc0c0802c634a657d0033c7d1f0 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Fri, 2 Feb 2024 01:07:50 +0530
Subject: [PATCH] doc: fix commands in eventdev test tool guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b3342d76189e46f4b97d09245617a1188145d384 ]

Fix incorrect core masks in testeventdev example commands.

Fixes: f6dda59153f1 ("doc: add order queue test in eventdev test guide")
Fixes: dd37027f2ba6 ("doc: add order all types queue test in eventdev test guide")
Fixes: 43bc2fef79cd ("doc: add perf queue test in eventdev test guide")
Fixes: b3d4e665ed3d ("doc: add perf all types queue test in eventdev test guide")
Fixes: b01974da9f25 ("app/eventdev: add ethernet device producer option")
Fixes: ba9de463abeb ("doc: add pipeline queue test in testeventdev guide")
Fixes: d1b46daf7484 ("doc: add pipeline atq test in testeventdev guide")
Fixes: d008f20bce23 ("app/eventdev: add event timer adapter as a producer")
Fixes: 2eaa37b86635 ("app/eventdev: add vector mode in pipeline test")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 doc/guides/tools/testeventdev.rst | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index fc36bfb30c..3fcc2c9894 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -308,7 +308,7 @@ Example command to run order queue test:

 .. code-block:: console

-   sudo <build_dir>/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+   sudo <build_dir>/app/dpdk-test-eventdev -c 0x1f -s 0x10 --vdev=event_sw0 -- \
                 --test=order_queue --plcores 1 --wlcores 2,3


@@ -371,7 +371,7 @@ Example command to run order ``all types queue`` test:

 .. code-block:: console

-   sudo <build_dir>/app/dpdk-test-eventdev --vdev=event_octeontx -- \
+   sudo <build_dir>/app/dpdk-test-eventdev -c 0x1f -- \
                         --test=order_atq --plcores 1 --wlcores 2,3


@@ -475,14 +475,14 @@ Example command to run perf queue test:

 .. code-block:: console

-   sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
+   sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x2 --vdev=event_sw0 -- \
         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0

 Example command to run perf queue test with producer enqueuing a burst of events:

 .. code-block:: console

-   sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x1 --vdev=event_sw0 -- \
+   sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x2 --vdev=event_sw0 -- \
         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0 \
         --prod_enq_burst_sz=32

@@ -490,15 +490,15 @@ Example command to run perf queue test with ethernet ports:

 .. code-block:: console

-   sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- \
+   sudo build/app/dpdk-test-eventdev -c 0xf -s 0x2 --vdev=event_sw0 -- \
         --test=perf_queue --plcores=2 --wlcore=3 --stlist=p --prod_type_ethdev

 Example command to run perf queue test with event timer adapter:

 .. code-block:: console

-   sudo  <build_dir>/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
-                --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
+   sudo  <build_dir>/app/dpdk-test-eventdev -c 0xfff1 \
+                -- --wlcores 4 --plcores 12 --test perf_queue --stlist=a \
                 --prod_type_timerdev --fwd_latency

 PERF_ATQ Test
@@ -585,15 +585,15 @@ Example command to run perf ``all types queue`` test:

 .. code-block:: console

-   sudo <build_dir>/app/dpdk-test-eventdev --vdev=event_octeontx -- \
+   sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -- \
                 --test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=0

 Example command to run perf ``all types queue`` test with event timer adapter:

 .. code-block:: console

-   sudo  <build_dir>/app/dpdk-test-eventdev --vdev="event_octeontx" -- \
-                --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
+   sudo  <build_dir>/app/dpdk-test-eventdev -c 0xfff1 \
+                -- --wlcores 4 --plcores 12 --test perf_atq --verbose 20 \
                 --stlist=a --prod_type_timerdev --fwd_latency


@@ -817,13 +817,13 @@ Example command to run pipeline atq test:

 .. code-block:: console

-    sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
+    sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -- \
         --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a

 Example command to run pipeline atq test with vector events:

 .. code-block:: console

-    sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -s 0x8 --vdev=event_sw0 -- \
+    sudo <build_dir>/app/dpdk-test-eventdev -c 0xf -- \
         --test=pipeline_atq --wlcore=1 --prod_type_ethdev --stlist=a \
         --enable_vector  --vector_size 512
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.074764870 +0800
+++ 0071-doc-fix-commands-in-eventdev-test-tool-guide.patch	2024-03-05 17:39:30.793566494 +0800
@@ -1 +1 @@
-From b3342d76189e46f4b97d09245617a1188145d384 Mon Sep 17 00:00:00 2001
+From d06a34452406cbc0c0802c634a657d0033c7d1f0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b3342d76189e46f4b97d09245617a1188145d384 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'ethdev: fix NVGRE encap flow action description' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (70 preceding siblings ...)
  2024-03-05  9:46 ` patch 'doc: fix commands in eventdev test tool guide' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for device initialization' " Xueming Li
                   ` (64 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Sunyang Wu; +Cc: Joey Xing, Ori Kam, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8610d2715d3fd6822556a6e45a31d42846dd83a7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8610d2715d3fd6822556a6e45a31d42846dd83a7 Mon Sep 17 00:00:00 2001
From: Sunyang Wu <sunyang.wu@jaguarmicro.com>
Date: Thu, 30 Nov 2023 14:22:21 +0800
Subject: [PATCH] ethdev: fix NVGRE encap flow action description
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f59d78b5803be7b0c0831309c703273bd2c92a50 ]

Fix incorrect definition of 'NVGRE_ENCAP', and
modified the error comments of 'rte_flow_action_nvgre_encap'.

Fixes: c2beb1d469d2 ("ethdev: add missing items/actions to flow object converter")
Fixes: 3850cf0c8c37 ("ethdev: add tunnel encap/decap actions")

Signed-off-by: Joey Xing <joey.xing@jaguarmicro.com>
Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 lib/ethdev/rte_flow.c | 2 +-
 lib/ethdev/rte_flow.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 549e329558..04348e0243 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -216,7 +216,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 		       sizeof(struct rte_flow_action_of_push_mpls)),
 	MK_FLOW_ACTION(VXLAN_ENCAP, sizeof(struct rte_flow_action_vxlan_encap)),
 	MK_FLOW_ACTION(VXLAN_DECAP, 0),
-	MK_FLOW_ACTION(NVGRE_ENCAP, sizeof(struct rte_flow_action_vxlan_encap)),
+	MK_FLOW_ACTION(NVGRE_ENCAP, sizeof(struct rte_flow_action_nvgre_encap)),
 	MK_FLOW_ACTION(NVGRE_DECAP, 0),
 	MK_FLOW_ACTION(RAW_ENCAP, sizeof(struct rte_flow_action_raw_encap)),
 	MK_FLOW_ACTION(RAW_DECAP, sizeof(struct rte_flow_action_raw_decap)),
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index affdc8121b..4cdc1f1d8f 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3471,7 +3471,7 @@ struct rte_flow_action_vxlan_encap {
  */
 struct rte_flow_action_nvgre_encap {
 	/**
-	 * Encapsulating vxlan tunnel definition
+	 * Encapsulating nvgre tunnel definition
 	 * (terminated by the END pattern item).
 	 */
 	struct rte_flow_item *definition;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.114564671 +0800
+++ 0072-ethdev-fix-NVGRE-encap-flow-action-description.patch	2024-03-05 17:39:30.803566494 +0800
@@ -1 +1 @@
-From f59d78b5803be7b0c0831309c703273bd2c92a50 Mon Sep 17 00:00:00 2001
+From 8610d2715d3fd6822556a6e45a31d42846dd83a7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f59d78b5803be7b0c0831309c703273bd2c92a50 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 2cd30d63b7..43a41bdb1d 100644
+index 549e329558..04348e0243 100644
@@ -26 +28 @@
-@@ -219,7 +219,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
+@@ -216,7 +216,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
@@ -36 +38 @@
-index 78b6bbb159..440396be78 100644
+index affdc8121b..4cdc1f1d8f 100644
@@ -39 +41 @@
-@@ -3468,7 +3468,7 @@ struct rte_flow_action_vxlan_encap {
+@@ -3471,7 +3471,7 @@ struct rte_flow_action_vxlan_encap {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for device initialization' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (71 preceding siblings ...)
  2024-03-05  9:46 ` patch 'ethdev: fix NVGRE encap flow action description' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for CoreNIC firmware' " Xueming Li
                   ` (63 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f2ee31d52cdea323cbc686c99f5131cf22f4b250

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f2ee31d52cdea323cbc686c99f5131cf22f4b250 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:12 +0800
Subject: [PATCH] net/nfp: fix resource leak for device initialization
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3699456672516a11bf6cb4b456618d2dd12080e4 ]

Fix the resource leak problem in the abnormal logic of device
initialize function.

Fixes: f26e82397f6d ("net/nfp: implement xstats")
Fixes: 547137405be7 ("net/nfp: initialize IPsec related content")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index f02caf8056..25feb8e394 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -590,9 +590,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)

 		net_hw->mac_stats = net_hw->mac_stats_bar;
 	} else {
-		if (pf_dev->ctrl_bar == NULL)
-			return -ENODEV;
-
 		/* Use port offset in pf ctrl_bar for this ports control bar */
 		hw->ctrl_bar = pf_dev->ctrl_bar + (port * NFP_NET_CFG_BAR_SZ);
 		net_hw->mac_stats = app_fw_nic->ports[0]->mac_stats_bar +
@@ -604,18 +601,19 @@ nfp_net_init(struct rte_eth_dev *eth_dev)

 	err = nfp_net_common_init(pci_dev, net_hw);
 	if (err != 0)
-		return err;
+		goto free_area;

 	err = nfp_net_tlv_caps_parse(eth_dev);
 	if (err != 0) {
 		PMD_INIT_LOG(ERR, "Failed to parser TLV caps");
 		return err;
+		goto free_area;
 	}

 	err = nfp_ipsec_init(eth_dev);
 	if (err != 0) {
 		PMD_INIT_LOG(ERR, "Failed to init IPsec module");
-		return err;
+		goto free_area;
 	}

 	nfp_net_ethdev_ops_mount(net_hw, eth_dev);
@@ -625,7 +623,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	if (net_hw->eth_xstats_base == NULL) {
 		PMD_INIT_LOG(ERR, "no memory for xstats base values on device %s!",
 				pci_dev->device.name);
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto ipsec_exit;
 	}

 	/* Work out where in the BAR the queues start. */
@@ -655,7 +654,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	eth_dev->data->mac_addrs = rte_zmalloc("mac_addr", RTE_ETHER_ADDR_LEN, 0);
 	if (eth_dev->data->mac_addrs == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to space for MAC address");
-		return -ENOMEM;
+		err = -ENOMEM;
+		goto xstats_free;
 	}

 	nfp_net_pf_read_mac(app_fw_nic, port);
@@ -693,6 +693,16 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	nfp_net_stats_reset(eth_dev);

 	return 0;
+
+xstats_free:
+	rte_free(net_hw->eth_xstats_base);
+ipsec_exit:
+	nfp_ipsec_uninit(eth_dev);
+free_area:
+	if (net_hw->mac_stats_area != NULL)
+		nfp_cpp_area_release_free(net_hw->mac_stats_area);
+
+	return err;
 }

 #define DEFAULT_FW_PATH       "/lib/firmware/netronome"
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.179452373 +0800
+++ 0073-net-nfp-fix-resource-leak-for-device-initialization.patch	2024-03-05 17:39:30.803566494 +0800
@@ -1 +1 @@
-From 3699456672516a11bf6cb4b456618d2dd12080e4 Mon Sep 17 00:00:00 2001
+From f2ee31d52cdea323cbc686c99f5131cf22f4b250 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3699456672516a11bf6cb4b456618d2dd12080e4 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 9e40bce4dd..2a80a592f2 100644
+index f02caf8056..25feb8e394 100644
@@ -24 +26 @@
-@@ -597,9 +597,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -590,9 +590,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -34 +36 @@
-@@ -611,18 +608,19 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -604,18 +601,19 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -56 +58 @@
-@@ -632,7 +630,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -625,7 +623,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -66 +68 @@
-@@ -662,7 +661,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -655,7 +654,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -76 +78 @@
-@@ -700,6 +700,16 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -693,6 +693,16 @@ nfp_net_init(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for CoreNIC firmware' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (72 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for device initialization' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for PF initialization' " Xueming Li
                   ` (62 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:13 +0800
Subject: [PATCH] net/nfp: fix resource leak for CoreNIC firmware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 ]

Fix the resource leak problem in the logic of CoreNIC firmware
application.

Fixes: 646ea79ce481 ("net/nfp: move PF functions into its own file")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 25feb8e394..38ee1c399a 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -310,6 +310,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
 	rte_eal_alarm_cancel(nfp_net_beat_timer, (void *)multi_pf);
 }

+static void
+nfp_net_uninit(struct rte_eth_dev *eth_dev)
+{
+	struct nfp_net_hw *net_hw;
+
+	net_hw = eth_dev->data->dev_private;
+	rte_free(net_hw->eth_xstats_base);
+	nfp_ipsec_uninit(eth_dev);
+	if (net_hw->mac_stats_area != NULL)
+		nfp_cpp_area_release_free(net_hw->mac_stats_area);
+}
+
 /* Reset and stop device. The device can not be restarted. */
 static int
 nfp_net_close(struct rte_eth_dev *dev)
@@ -1130,12 +1142,11 @@ port_cleanup:
 				app_fw_nic->ports[id]->eth_dev != NULL) {
 			struct rte_eth_dev *tmp_dev;
 			tmp_dev = app_fw_nic->ports[id]->eth_dev;
-			nfp_ipsec_uninit(tmp_dev);
+			nfp_net_uninit(tmp_dev);
 			rte_eth_dev_release_port(tmp_dev);
-			app_fw_nic->ports[id] = NULL;
 		}
 	}
-	nfp_cpp_area_free(pf_dev->ctrl_area);
+	nfp_cpp_area_release_free(pf_dev->ctrl_area);
 app_cleanup:
 	rte_free(app_fw_nic);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.240549175 +0800
+++ 0074-net-nfp-fix-resource-leak-for-CoreNIC-firmware.patch	2024-03-05 17:39:30.803566494 +0800
@@ -1 +1 @@
-From 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 Mon Sep 17 00:00:00 2001
+From 1d53d5495ba4c5f4a23bc2dbe9f26c33c15e74a3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8b8f116b199e31795ecd5cedb12302f10c0ae5a4 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 2a80a592f2..c132e97d1a 100644
+index 25feb8e394..38ee1c399a 100644
@@ -23 +25 @@
-@@ -317,6 +317,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
+@@ -310,6 +310,18 @@ nfp_net_keepalive_stop(struct nfp_multi_pf *multi_pf)
@@ -42 +44 @@
-@@ -1137,12 +1149,11 @@ port_cleanup:
+@@ -1130,12 +1142,11 @@ port_cleanup:

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for PF initialization' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (73 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for CoreNIC firmware' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for flower firmware' " Xueming Li
                   ` (61 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=02916557c12578a78bef1e837aa2b4bb923bca80

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 02916557c12578a78bef1e837aa2b4bb923bca80 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:14 +0800
Subject: [PATCH] net/nfp: fix resource leak for PF initialization
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 528812a63c4c2d74ccf2c2f2aa297fcbff3ceea9 ]

Fix the resource leak problem in the abnormal logic of PF initialize
function.

Fixes: 646ea79ce481 ("net/nfp: move PF functions into its own file")
Fixes: 8ba461d1eecc ("net/nfp: introduce keepalive mechanism for multiple PF")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 38ee1c399a..bb0ddf3d54 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1326,12 +1326,13 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 	return 0;

 hwqueues_cleanup:
-	nfp_cpp_area_free(pf_dev->qc_area);
+	nfp_cpp_area_release_free(pf_dev->qc_area);
 sym_tbl_cleanup:
 	free(sym_tbl);
 fw_cleanup:
 	nfp_fw_unload(cpp);
 	nfp_net_keepalive_stop(&pf_dev->multi_pf);
+	nfp_net_keepalive_uninit(&pf_dev->multi_pf);
 eth_table_cleanup:
 	free(nfp_eth_table);
 hwinfo_cleanup:
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.280678476 +0800
+++ 0075-net-nfp-fix-resource-leak-for-PF-initialization.patch	2024-03-05 17:39:30.813566494 +0800
@@ -1 +1 @@
-From 528812a63c4c2d74ccf2c2f2aa297fcbff3ceea9 Mon Sep 17 00:00:00 2001
+From 02916557c12578a78bef1e837aa2b4bb923bca80 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 528812a63c4c2d74ccf2c2f2aa297fcbff3ceea9 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index c132e97d1a..6fdde105ba 100644
+index 38ee1c399a..bb0ddf3d54 100644
@@ -24 +26 @@
-@@ -1333,12 +1333,13 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
+@@ -1326,12 +1326,13 @@ nfp_pf_init(struct rte_pci_device *pci_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for flower firmware' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (74 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for PF initialization' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of CoreNIC " Xueming Li
                   ` (60 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=09e1df883afa97ba2d37c8c4a69a0273c962a7b9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 09e1df883afa97ba2d37c8c4a69a0273c962a7b9 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:15 +0800
Subject: [PATCH] net/nfp: fix resource leak for flower firmware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7c596721ae5f41d1dbab8b936a4983928d6b5603 ]

Fix the resource leak problem in the logic of flower firmware
application.

Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 .../net/nfp/flower/nfp_flower_representor.c   | 89 ++++++++++++++++++-
 .../net/nfp/flower/nfp_flower_representor.h   |  1 +
 2 files changed, 86 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 0f0e63aae0..7212d9e024 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -291,6 +291,43 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 	return sent;
 }

+static int
+nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev)
+{
+	struct nfp_flower_representor *repr;
+
+	repr = eth_dev->data->dev_private;
+	rte_ring_free(repr->ring);
+
+	return 0;
+}
+
+static int
+nfp_flower_pf_repr_uninit(__rte_unused struct rte_eth_dev *eth_dev)
+{
+	return 0;
+}
+
+static void
+nfp_flower_repr_free(struct nfp_flower_representor *repr,
+		enum nfp_repr_type repr_type)
+{
+	switch (repr_type) {
+	case NFP_REPR_TYPE_PHYS_PORT:
+		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		break;
+	case NFP_REPR_TYPE_PF:
+		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_pf_repr_uninit);
+		break;
+	case NFP_REPR_TYPE_VF:
+		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		break;
+	default:
+		PMD_DRV_LOG(ERR, "Unsupported repr port type.");
+		break;
+	}
+}
+
 static const struct eth_dev_ops nfp_flower_pf_repr_dev_ops = {
 	.dev_infos_get        = nfp_flower_repr_dev_infos_get,

@@ -410,6 +447,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev,

 	repr->app_fw_flower->pf_repr = repr;
 	repr->app_fw_flower->pf_hw->eth_dev = eth_dev;
+	repr->eth_dev = eth_dev;

 	return 0;
 }
@@ -501,6 +539,8 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
 		app_fw_flower->vf_reprs[index] = repr;
 	}

+	repr->eth_dev = eth_dev;
+
 	return 0;

 mac_cleanup:
@@ -511,6 +551,35 @@ ring_cleanup:
 	return ret;
 }

+static void
+nfp_flower_repr_free_all(struct nfp_app_fw_flower *app_fw_flower)
+{
+	uint32_t i;
+	struct nfp_flower_representor *repr;
+
+	for (i = 0; i < MAX_FLOWER_VFS; i++) {
+		repr = app_fw_flower->vf_reprs[i];
+		if (repr != NULL) {
+			nfp_flower_repr_free(repr, NFP_REPR_TYPE_VF);
+			app_fw_flower->vf_reprs[i] = NULL;
+		}
+	}
+
+	for (i = 0; i < NFP_MAX_PHYPORTS; i++) {
+		repr = app_fw_flower->phy_reprs[i];
+		if (repr != NULL) {
+			nfp_flower_repr_free(repr, NFP_REPR_TYPE_PHYS_PORT);
+			app_fw_flower->phy_reprs[i] = NULL;
+		}
+	}
+
+	repr = app_fw_flower->pf_repr;
+	if (repr != NULL) {
+		nfp_flower_repr_free(repr, NFP_REPR_TYPE_PF);
+		app_fw_flower->pf_repr = NULL;
+	}
+}
+
 static int
 nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 {
@@ -585,7 +654,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 	}

 	if (i < app_fw_flower->num_phyport_reprs)
-		return ret;
+		goto repr_free;

 	/*
 	 * Now allocate eth_dev's for VF representors.
@@ -614,9 +683,14 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower)
 	}

 	if (i < app_fw_flower->num_vf_reprs)
-		return ret;
+		goto repr_free;

 	return 0;
+
+repr_free:
+	nfp_flower_repr_free_all(app_fw_flower);
+
+	return ret;
 }

 int
@@ -635,7 +709,7 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower)

 	/* Allocate a switch domain for the flower app */
 	if (app_fw_flower->switch_domain_id == RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID &&
-			rte_eth_switch_domain_alloc(&app_fw_flower->switch_domain_id)) {
+			rte_eth_switch_domain_alloc(&app_fw_flower->switch_domain_id) != 0) {
 		PMD_INIT_LOG(WARNING, "failed to allocate switch domain for device");
 	}

@@ -677,8 +751,15 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower)
 	ret = nfp_flower_repr_alloc(app_fw_flower);
 	if (ret != 0) {
 		PMD_INIT_LOG(ERR, "representors allocation failed");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto domain_free;
 	}

 	return 0;
+
+domain_free:
+	if (rte_eth_switch_domain_free(app_fw_flower->switch_domain_id) != 0)
+		PMD_INIT_LOG(WARNING, "failed to free switch domain for device");
+
+	return ret;
 }
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.h b/drivers/net/nfp/flower/nfp_flower_representor.h
index bcb4c3cdb5..8053617562 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.h
+++ b/drivers/net/nfp/flower/nfp_flower_representor.h
@@ -20,6 +20,7 @@ struct nfp_flower_representor {
 	struct rte_ring *ring;
 	struct rte_eth_link link;
 	struct rte_eth_stats repr_stats;
+	struct rte_eth_dev *eth_dev;
 };

 int nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.309506877 +0800
+++ 0076-net-nfp-fix-resource-leak-for-flower-firmware.patch	2024-03-05 17:39:30.813566494 +0800
@@ -1 +1 @@
-From 7c596721ae5f41d1dbab8b936a4983928d6b5603 Mon Sep 17 00:00:00 2001
+From 09e1df883afa97ba2d37c8c4a69a0273c962a7b9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7c596721ae5f41d1dbab8b936a4983928d6b5603 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for exit of CoreNIC firmware' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (75 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for flower firmware' " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of flower " Xueming Li
                   ` (59 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e65a677895f1bd39b984971021ded9264874992d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e65a677895f1bd39b984971021ded9264874992d Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:16 +0800
Subject: [PATCH] net/nfp: fix resource leak for exit of CoreNIC firmware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 66d5f53d3e1beebf31de3b3b2e15371ffe322866 ]

Fix the resource leak problem in the exit logic of CoreNIC firmware.

Fixes: 646ea79ce481 ("net/nfp: move PF functions into its own file")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c     | 91 +++++++++++++++++++++++++-------
 drivers/net/nfp/nfp_net_common.h |  1 +
 2 files changed, 72 insertions(+), 20 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index bb0ddf3d54..5e473d9c16 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -322,6 +322,55 @@ nfp_net_uninit(struct rte_eth_dev *eth_dev)
 		nfp_cpp_area_release_free(net_hw->mac_stats_area);
 }

+static void
+nfp_cleanup_port_app_fw_nic(struct nfp_pf_dev *pf_dev,
+		uint8_t id)
+{
+	struct rte_eth_dev *eth_dev;
+	struct nfp_app_fw_nic *app_fw_nic;
+
+	app_fw_nic = pf_dev->app_fw_priv;
+	if (app_fw_nic->ports[id] != NULL) {
+		eth_dev = app_fw_nic->ports[id]->eth_dev;
+		if (eth_dev != NULL)
+			nfp_net_uninit(eth_dev);
+
+		app_fw_nic->ports[id] = NULL;
+	}
+}
+
+static void
+nfp_uninit_app_fw_nic(struct nfp_pf_dev *pf_dev)
+{
+	nfp_cpp_area_release_free(pf_dev->ctrl_area);
+	rte_free(pf_dev->app_fw_priv);
+}
+
+void
+nfp_pf_uninit(struct nfp_pf_dev *pf_dev)
+{
+	nfp_cpp_area_release_free(pf_dev->qc_area);
+	free(pf_dev->sym_tbl);
+	if (pf_dev->multi_pf.enabled) {
+		nfp_net_keepalive_stop(&pf_dev->multi_pf);
+		nfp_net_keepalive_uninit(&pf_dev->multi_pf);
+	}
+	free(pf_dev->nfp_eth_table);
+	free(pf_dev->hwinfo);
+	nfp_cpp_free(pf_dev->cpp);
+	rte_free(pf_dev);
+}
+
+static int
+nfp_pf_secondary_uninit(struct nfp_pf_dev *pf_dev)
+{
+	free(pf_dev->sym_tbl);
+	nfp_cpp_free(pf_dev->cpp);
+	rte_free(pf_dev);
+
+	return 0;
+}
+
 /* Reset and stop device. The device can not be restarted. */
 static int
 nfp_net_close(struct rte_eth_dev *dev)
@@ -333,8 +382,19 @@ nfp_net_close(struct rte_eth_dev *dev)
 	struct rte_pci_device *pci_dev;
 	struct nfp_app_fw_nic *app_fw_nic;

-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+	/*
+	 * In secondary process, a released eth device can be found by its name
+	 * in shared memory.
+	 * If the state of the eth device is RTE_ETH_DEV_UNUSED, it means the
+	 * eth device has been released.
+	 */
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		if (dev->state == RTE_ETH_DEV_UNUSED)
+			return 0;
+
+		nfp_pf_secondary_uninit(dev->process_private);
 		return 0;
+	}

 	hw = dev->data->dev_private;
 	pf_dev = hw->pf_dev;
@@ -351,16 +411,17 @@ nfp_net_close(struct rte_eth_dev *dev)
 	nfp_net_close_tx_queue(dev);
 	nfp_net_close_rx_queue(dev);

-	/* Clear ipsec */
-	nfp_ipsec_uninit(dev);
-
 	/* Cancel possible impending LSC work here before releasing the port */
 	rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, (void *)dev);

 	/* Only free PF resources after all physical ports have been closed */
 	/* Mark this port as unused and free device priv resources */
 	nn_cfg_writeb(&hw->super, NFP_NET_CFG_LSC, 0xff);
-	app_fw_nic->ports[hw->idx] = NULL;
+
+	if (pf_dev->app_fw_id != NFP_APP_FW_CORE_NIC)
+		return -EINVAL;
+
+	nfp_cleanup_port_app_fw_nic(pf_dev, hw->idx);

 	for (i = 0; i < app_fw_nic->total_phyports; i++) {
 		id = nfp_function_id_get(pf_dev, i);
@@ -370,26 +431,16 @@ nfp_net_close(struct rte_eth_dev *dev)
 			return 0;
 	}

-	/* Now it is safe to free all PF resources */
-	PMD_INIT_LOG(INFO, "Freeing PF resources");
-	if (pf_dev->multi_pf.enabled) {
-		nfp_net_keepalive_stop(&pf_dev->multi_pf);
-		nfp_net_keepalive_uninit(&pf_dev->multi_pf);
-	}
-	nfp_cpp_area_free(pf_dev->ctrl_area);
-	nfp_cpp_area_free(pf_dev->qc_area);
-	free(pf_dev->hwinfo);
-	free(pf_dev->sym_tbl);
-	nfp_cpp_free(pf_dev->cpp);
-	rte_free(app_fw_nic);
-	rte_free(pf_dev);
-
+	/* Enable in nfp_net_start() */
 	rte_intr_disable(pci_dev->intr_handle);

-	/* Unregister callback func from eal lib */
+	/* Register in nfp_net_init() */
 	rte_intr_callback_unregister(pci_dev->intr_handle,
 			nfp_net_dev_interrupt_handler, (void *)dev);

+	nfp_uninit_app_fw_nic(pf_dev);
+	nfp_pf_uninit(pf_dev);
+
 	return 0;
 }

diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index 30fea7ae02..ded491cbdc 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -272,6 +272,7 @@ int nfp_net_flow_ctrl_get(struct rte_eth_dev *dev,
 		struct rte_eth_fc_conf *fc_conf);
 int nfp_net_flow_ctrl_set(struct rte_eth_dev *dev,
 		struct rte_eth_fc_conf *fc_conf);
+void nfp_pf_uninit(struct nfp_pf_dev *pf_dev);

 #define NFP_PRIV_TO_APP_FW_NIC(app_fw_priv)\
 	((struct nfp_app_fw_nic *)app_fw_priv)
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.334851778 +0800
+++ 0077-net-nfp-fix-resource-leak-for-exit-of-CoreNIC-firmwa.patch	2024-03-05 17:39:30.813566494 +0800
@@ -1 +1 @@
-From 66d5f53d3e1beebf31de3b3b2e15371ffe322866 Mon Sep 17 00:00:00 2001
+From e65a677895f1bd39b984971021ded9264874992d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 66d5f53d3e1beebf31de3b3b2e15371ffe322866 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 6fdde105ba..537b4fe792 100644
+index bb0ddf3d54..5e473d9c16 100644
@@ -23 +25 @@
-@@ -329,6 +329,55 @@ nfp_net_uninit(struct rte_eth_dev *eth_dev)
+@@ -322,6 +322,55 @@ nfp_net_uninit(struct rte_eth_dev *eth_dev)
@@ -79 +81 @@
-@@ -340,8 +389,19 @@ nfp_net_close(struct rte_eth_dev *dev)
+@@ -333,8 +382,19 @@ nfp_net_close(struct rte_eth_dev *dev)
@@ -100 +102 @@
-@@ -358,16 +418,17 @@ nfp_net_close(struct rte_eth_dev *dev)
+@@ -351,16 +411,17 @@ nfp_net_close(struct rte_eth_dev *dev)
@@ -122 +124 @@
-@@ -377,26 +438,16 @@ nfp_net_close(struct rte_eth_dev *dev)
+@@ -370,26 +431,16 @@ nfp_net_close(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for exit of flower firmware' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (76 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of CoreNIC " Xueming Li
@ 2024-03-05  9:46 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix resource leak for VF' " Xueming Li
                   ` (58 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:46 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ddeb9d64a933aa84eb4e2c87d341b04401a5947b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ddeb9d64a933aa84eb4e2c87d341b04401a5947b Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:17 +0800
Subject: [PATCH] net/nfp: fix resource leak for exit of flower firmware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a256a1227dbe0eac576a42b6c336ce55b7713109 ]

Fix the resource leak problem in the exit logic of flower firmware.

Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c           | 73 ++++---------------
 drivers/net/nfp/flower/nfp_flower.h           |  1 +
 .../net/nfp/flower/nfp_flower_representor.c   | 64 ++++++++++++++++
 3 files changed, 80 insertions(+), 58 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 6b523d98b0..3698a3d4aa 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -82,63 +82,6 @@ nfp_flower_pf_start(struct rte_eth_dev *dev)
 	return 0;
 }

-/* Reset and stop device. The device can not be restarted. */
-static int
-nfp_flower_pf_close(struct rte_eth_dev *dev)
-{
-	uint16_t i;
-	struct nfp_net_hw *hw;
-	struct nfp_pf_dev *pf_dev;
-	struct nfp_net_txq *this_tx_q;
-	struct nfp_net_rxq *this_rx_q;
-	struct nfp_flower_representor *repr;
-	struct nfp_app_fw_flower *app_fw_flower;
-
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return 0;
-
-	repr = dev->data->dev_private;
-	hw = repr->app_fw_flower->pf_hw;
-	pf_dev = hw->pf_dev;
-	app_fw_flower = NFP_PRIV_TO_APP_FW_FLOWER(pf_dev->app_fw_priv);
-
-	nfp_mtr_priv_uninit(pf_dev);
-
-	/*
-	 * We assume that the DPDK application is stopping all the
-	 * threads/queues before calling the device close function.
-	 */
-	nfp_net_disable_queues(dev);
-
-	/* Clear queues */
-	for (i = 0; i < dev->data->nb_tx_queues; i++) {
-		this_tx_q = dev->data->tx_queues[i];
-		nfp_net_reset_tx_queue(this_tx_q);
-	}
-
-	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-		this_rx_q = dev->data->rx_queues[i];
-		nfp_net_reset_rx_queue(this_rx_q);
-	}
-
-	/* Cancel possible impending LSC work here before releasing the port */
-	rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler, (void *)dev);
-
-	nn_cfg_writeb(&hw->super, NFP_NET_CFG_LSC, 0xff);
-
-	/* Now it is safe to free all PF resources */
-	PMD_DRV_LOG(INFO, "Freeing PF resources");
-	nfp_cpp_area_free(pf_dev->ctrl_area);
-	nfp_cpp_area_free(pf_dev->qc_area);
-	free(pf_dev->hwinfo);
-	free(pf_dev->sym_tbl);
-	nfp_cpp_free(pf_dev->cpp);
-	rte_free(app_fw_flower);
-	rte_free(pf_dev);
-
-	return 0;
-}
-
 static const struct eth_dev_ops nfp_flower_pf_vnic_ops = {
 	.dev_infos_get          = nfp_net_infos_get,
 	.link_update            = nfp_net_link_update,
@@ -146,7 +89,6 @@ static const struct eth_dev_ops nfp_flower_pf_vnic_ops = {

 	.dev_start              = nfp_flower_pf_start,
 	.dev_stop               = nfp_net_stop,
-	.dev_close              = nfp_flower_pf_close,
 };

 static inline struct nfp_flower_representor *
@@ -858,6 +800,21 @@ app_cleanup:
 	return ret;
 }

+void
+nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev)
+{
+	struct nfp_app_fw_flower *app_fw_flower;
+
+	app_fw_flower = pf_dev->app_fw_priv;
+	nfp_flower_cleanup_ctrl_vnic(app_fw_flower->ctrl_hw);
+	nfp_cpp_area_free(app_fw_flower->ctrl_hw->ctrl_area);
+	nfp_cpp_area_free(pf_dev->ctrl_area);
+	rte_free(app_fw_flower->pf_hw);
+	nfp_mtr_priv_uninit(pf_dev);
+	nfp_flow_priv_uninit(pf_dev);
+	rte_free(app_fw_flower);
+}
+
 int
 nfp_secondary_init_app_fw_flower(struct nfp_pf_dev *pf_dev)
 {
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index 6f27c06acc..8393de66c5 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -106,6 +106,7 @@ nfp_flower_support_decap_v2(const struct nfp_app_fw_flower *app_fw_flower)

 int nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev,
 		const struct nfp_dev_info *dev_info);
+void nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev);
 int nfp_secondary_init_app_fw_flower(struct nfp_pf_dev *pf_dev);
 bool nfp_flower_pf_dispatch_pkts(struct nfp_net_hw *hw,
 		struct rte_mbuf *mbuf,
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 7212d9e024..02089d390e 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -328,12 +328,75 @@ nfp_flower_repr_free(struct nfp_flower_representor *repr,
 	}
 }

+/* Reset and stop device. The device can not be restarted. */
+static int
+nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
+{
+	uint16_t i;
+	struct nfp_net_hw *hw;
+	struct nfp_pf_dev *pf_dev;
+	struct nfp_net_txq *this_tx_q;
+	struct nfp_net_rxq *this_rx_q;
+	struct nfp_flower_representor *repr;
+	struct nfp_app_fw_flower *app_fw_flower;
+
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return 0;
+
+	repr = dev->data->dev_private;
+	app_fw_flower = repr->app_fw_flower;
+	hw = app_fw_flower->pf_hw;
+	pf_dev = hw->pf_dev;
+
+	/*
+	 * We assume that the DPDK application is stopping all the
+	 * threads/queues before calling the device close function.
+	 */
+	nfp_net_disable_queues(dev);
+
+	/* Clear queues */
+	for (i = 0; i < dev->data->nb_tx_queues; i++) {
+		this_tx_q = dev->data->tx_queues[i];
+		nfp_net_reset_tx_queue(this_tx_q);
+	}
+
+	for (i = 0; i < dev->data->nb_rx_queues; i++) {
+		this_rx_q = dev->data->rx_queues[i];
+		nfp_net_reset_rx_queue(this_rx_q);
+	}
+
+	if (pf_dev->app_fw_id != NFP_APP_FW_FLOWER_NIC)
+		return -EINVAL;
+
+	nfp_flower_repr_free(repr, repr->repr_type);
+
+	for (i = 0; i < MAX_FLOWER_VFS; i++) {
+		if (app_fw_flower->vf_reprs[i] != NULL)
+			return 0;
+	}
+
+	for (i = 0; i < NFP_MAX_PHYPORTS; i++) {
+		if (app_fw_flower->phy_reprs[i] != NULL)
+			return 0;
+	}
+
+	if (app_fw_flower->pf_repr != NULL)
+		return 0;
+
+	/* Now it is safe to free all PF resources */
+	nfp_uninit_app_fw_flower(pf_dev);
+	nfp_pf_uninit(pf_dev);
+
+	return 0;
+}
+
 static const struct eth_dev_ops nfp_flower_pf_repr_dev_ops = {
 	.dev_infos_get        = nfp_flower_repr_dev_infos_get,

 	.dev_start            = nfp_flower_pf_start,
 	.dev_configure        = nfp_net_configure,
 	.dev_stop             = nfp_net_stop,
+	.dev_close            = nfp_flower_repr_dev_close,

 	.rx_queue_setup       = nfp_net_rx_queue_setup,
 	.tx_queue_setup       = nfp_net_tx_queue_setup,
@@ -356,6 +419,7 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = {
 	.dev_start            = nfp_flower_repr_dev_start,
 	.dev_configure        = nfp_net_configure,
 	.dev_stop             = nfp_flower_repr_dev_stop,
+	.dev_close            = nfp_flower_repr_dev_close,

 	.rx_queue_setup       = nfp_flower_repr_rx_queue_setup,
 	.tx_queue_setup       = nfp_flower_repr_tx_queue_setup,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.362451379 +0800
+++ 0078-net-nfp-fix-resource-leak-for-exit-of-flower-firmwar.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From a256a1227dbe0eac576a42b6c336ce55b7713109 Mon Sep 17 00:00:00 2001
+From ddeb9d64a933aa84eb4e2c87d341b04401a5947b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a256a1227dbe0eac576a42b6c336ce55b7713109 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index f172c8350d..f950ae233b 100644
+index 6b523d98b0..3698a3d4aa 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix resource leak for VF' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (77 preceding siblings ...)
  2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of flower " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/af_xdp: fix memzone leak on config failure' " Xueming Li
                   ` (57 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c2a5c0d0855ae555373d84f9a350844c1eae8845

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c2a5c0d0855ae555373d84f9a350844c1eae8845 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Mon, 4 Dec 2023 09:57:18 +0800
Subject: [PATCH] net/nfp: fix resource leak for VF
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]

Fix the resource leak problem in the logic of VF.

Fixes: f26e82397f6d ("net/nfp: implement xstats")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev_vf.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 7927f53403..88da593190 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -160,13 +160,17 @@ nfp_netvf_set_link_down(struct rte_eth_dev *dev __rte_unused)
 static int
 nfp_netvf_close(struct rte_eth_dev *dev)
 {
+	struct nfp_net_hw *net_hw;
 	struct rte_pci_device *pci_dev;

 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;

+	net_hw = dev->data->dev_private;
 	pci_dev = RTE_ETH_DEV_TO_PCI(dev);

+	rte_free(net_hw->eth_xstats_base);
+
 	/*
 	 * We assume that the DPDK application is stopping all the
 	 * threads/queues before calling the device close function.
@@ -323,7 +327,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	if (eth_dev->data->mac_addrs == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to space for MAC address");
 		err = -ENOMEM;
-		goto dev_err_ctrl_map;
+		goto free_xstats;
 	}

 	nfp_read_mac(hw);
@@ -360,8 +364,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)

 	return 0;

-dev_err_ctrl_map:
-		nfp_cpp_area_free(net_hw->ctrl_area);
+free_xstats:
+	rte_free(net_hw->eth_xstats_base);

 	return err;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.390713080 +0800
+++ 0079-net-nfp-fix-resource-leak-for-VF.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 Mon Sep 17 00:00:00 2001
+From c2a5c0d0855ae555373d84f9a350844c1eae8845 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a7904d1c6b4fef73d9a8b32b6f6293ba697d10c2 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/af_xdp: fix memzone leak on config failure' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (78 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix resource leak for VF' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/memif: fix crash with Tx burst larger than 255' " Xueming Li
                   ` (56 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Ciara Loftus, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=01809245ba198265312458828a253a0b87bd2ec8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 01809245ba198265312458828a253a0b87bd2ec8 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Tue, 5 Dec 2023 20:23:51 +0800
Subject: [PATCH] net/af_xdp: fix memzone leak on config failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 960775fc5b7d43cfbf9fa31e4c0b36c4da79615a ]

In xdp_umem_configure() allocated memzone for the 'umem', we should
free it when xsk_umem__create() call fails, otherwise it will lead to
memory zone leak. To fix it move 'umem->mz = mz;' assignment after
'mz == NULL' check.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 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_xdp.c
index 353c8688ec..2d151e45c7 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1234,6 +1234,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 		AF_XDP_LOG(ERR, "Failed to reserve memzone for af_xdp umem.\n");
 		goto err;
 	}
+	umem->mz = mz;

 	ret = xsk_umem__create(&umem->umem, mz->addr,
 			       ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE,
@@ -1244,7 +1245,6 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 		AF_XDP_LOG(ERR, "Failed to create umem\n");
 		goto err;
 	}
-	umem->mz = mz;

 	return umem;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.416803581 +0800
+++ 0080-net-af_xdp-fix-memzone-leak-on-config-failure.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From 960775fc5b7d43cfbf9fa31e4c0b36c4da79615a Mon Sep 17 00:00:00 2001
+From 01809245ba198265312458828a253a0b87bd2ec8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 960775fc5b7d43cfbf9fa31e4c0b36c4da79615a ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/memif: fix crash with Tx burst larger than 255' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (79 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/af_xdp: fix memzone leak on config failure' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: refactor VF mailbox message struct' " Xueming Li
                   ` (55 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Joyce Kong
  Cc: Liangxing Wang, Ruifeng Wang, Stephen Hemminger, Ferruh Yigit,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9cf299a8738c63a463f0a4dbfcda83dd0af67f6b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9cf299a8738c63a463f0a4dbfcda83dd0af67f6b Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong@arm.com>
Date: Tue, 5 Dec 2023 04:05:24 +0000
Subject: [PATCH] net/memif: fix crash with Tx burst larger than 255
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d8d91d78fef8a9814f918ea40a487646da83d202 ]

There will be a segfault when Tx burst size is larger than 256.
This is because eth_memif_tx uses an index i which is uint8_t to count
transmitted nb_pkts.
Extend i to uint16_t, the same size as nb_pkts.

Fixes: b5613c8f9d0a ("net/memif: add a Tx fast path")

Reported-by: Liangxing Wang <liangxing.wang@arm.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                          | 1 +
 drivers/net/memif/rte_eth_memif.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index bff68cefd8..540a3caab7 100644
--- a/.mailmap
+++ b/.mailmap
@@ -788,6 +788,7 @@ Lewei Yang <leweix.yang@intel.com>
 Leyi Rong <leyi.rong@intel.com>
 Liang Ma <liangma@bytedance.com> <liangma@liangbit.com> <liang.j.ma@intel.com>
 Liang-Min Larry Wang <liang-min.wang@intel.com>
+Liangxing Wang <liangxing.wang@arm.com>
 Liang Xu <liang.xu@cinfotech.cn>
 Liang Zhang <zhangliang@bigo.sg>
 Li Feng <fengli@smartx.com>
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 7cc8c0da91..6f45a00172 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -684,7 +684,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		n_free = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE) - slot;
 	}

-	uint8_t i;
+	uint16_t i;
 	struct rte_mbuf **buf_tmp = bufs;
 	mbuf_head = *buf_tmp++;
 	struct rte_mempool *mp = mbuf_head->pool;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.446874582 +0800
+++ 0081-net-memif-fix-crash-with-Tx-burst-larger-than-255.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From d8d91d78fef8a9814f918ea40a487646da83d202 Mon Sep 17 00:00:00 2001
+From 9cf299a8738c63a463f0a4dbfcda83dd0af67f6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d8d91d78fef8a9814f918ea40a487646da83d202 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index dd3a4f7529..297da3b426 100644
+index bff68cefd8..540a3caab7 100644
@@ -28 +30 @@
-@@ -789,6 +789,7 @@ Lewei Yang <leweix.yang@intel.com>
+@@ -788,6 +788,7 @@ Lewei Yang <leweix.yang@intel.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: refactor VF mailbox message struct' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (80 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/memif: fix crash with Tx burst larger than 255' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: refactor PF " Xueming Li
                   ` (54 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c1c62366edd58c38d3c9e0e81eb3bfb7d40bc41a

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c1c62366edd58c38d3c9e0e81eb3bfb7d40bc41a Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 14:55:05 +0800
Subject: [PATCH] net/hns3: refactor VF mailbox message struct
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 692b35be121b724119da001d7ec4c0fabd51177b ]

The data region in VF to PF mbx memssage command is
used to communicate with PF driver. And this data
region exists as an array. As a result, some complicated
feature commands, like setting promisc mode, map/unmap
ring vector and setting VLAN id, have to use magic number
to set them. This isn't good for maintenance of driver.
So this patch refactors these messages by extracting an
hns3_vf_to_pf_msg structure.

In addition, the PF link change event message is reported
by the firmware and is reported in hns3_mbx_vf_to_pf_cmd
format, it also needs to be modified.

Fixes: 463e748964f5 ("net/hns3: support mailbox")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 54 ++++++++++++++---------------
 drivers/net/hns3/hns3_mbx.c       | 24 ++++++-------
 drivers/net/hns3/hns3_mbx.h       | 56 ++++++++++++++++++++++---------
 3 files changed, 76 insertions(+), 58 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 916cc0fb1b..19e734ca8d 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -254,11 +254,12 @@ hns3vf_set_promisc_mode(struct hns3_hw *hw, bool en_bc_pmc,
 	 *    the packets with vlan tag in promiscuous mode.
 	 */
 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_MBX_VF_TO_PF, false);
-	req->msg[0] = HNS3_MBX_SET_PROMISC_MODE;
-	req->msg[1] = en_bc_pmc ? 1 : 0;
-	req->msg[2] = en_uc_pmc ? 1 : 0;
-	req->msg[3] = en_mc_pmc ? 1 : 0;
-	req->msg[4] = hw->promisc_mode == HNS3_LIMIT_PROMISC_MODE ? 1 : 0;
+	req->msg.code = HNS3_MBX_SET_PROMISC_MODE;
+	req->msg.en_bc = en_bc_pmc ? 1 : 0;
+	req->msg.en_uc = en_uc_pmc ? 1 : 0;
+	req->msg.en_mc = en_mc_pmc ? 1 : 0;
+	req->msg.en_limit_promisc =
+		hw->promisc_mode == HNS3_LIMIT_PROMISC_MODE ? 1 : 0;

 	ret = hns3_cmd_send(hw, &desc, 1);
 	if (ret)
@@ -347,30 +348,28 @@ hns3vf_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id,
 			     bool mmap, enum hns3_ring_type queue_type,
 			     uint16_t queue_id)
 {
-	struct hns3_vf_bind_vector_msg bind_msg;
+#define HNS3_RING_VERCTOR_DATA_SIZE	14
+	struct hns3_vf_to_pf_msg req = {0};
 	const char *op_str;
-	uint16_t code;
 	int ret;

-	memset(&bind_msg, 0, sizeof(bind_msg));
-	code = mmap ? HNS3_MBX_MAP_RING_TO_VECTOR :
+	req.code = mmap ? HNS3_MBX_MAP_RING_TO_VECTOR :
 		HNS3_MBX_UNMAP_RING_TO_VECTOR;
-	bind_msg.vector_id = (uint8_t)vector_id;
+	req.vector_id = (uint8_t)vector_id;
+	req.ring_num = 1;

 	if (queue_type == HNS3_RING_TYPE_RX)
-		bind_msg.param[0].int_gl_index = HNS3_RING_GL_RX;
+		req.ring_param[0].int_gl_index = HNS3_RING_GL_RX;
 	else
-		bind_msg.param[0].int_gl_index = HNS3_RING_GL_TX;
-
-	bind_msg.param[0].ring_type = queue_type;
-	bind_msg.ring_num = 1;
-	bind_msg.param[0].tqp_index = queue_id;
+		req.ring_param[0].int_gl_index = HNS3_RING_GL_TX;
+	req.ring_param[0].ring_type = queue_type;
+	req.ring_param[0].tqp_index = queue_id;
 	op_str = mmap ? "Map" : "Unmap";
-	ret = hns3_send_mbx_msg(hw, code, 0, (uint8_t *)&bind_msg,
-				sizeof(bind_msg), false, NULL, 0);
+	ret = hns3_send_mbx_msg(hw, req.code, 0, (uint8_t *)&req.vector_id,
+				HNS3_RING_VERCTOR_DATA_SIZE, false, NULL, 0);
 	if (ret)
-		hns3_err(hw, "%s TQP %u fail, vector_id is %u, ret is %d.",
-			 op_str, queue_id, bind_msg.vector_id, ret);
+		hns3_err(hw, "%s TQP %u fail, vector_id is %u, ret = %d.",
+			 op_str, queue_id, req.vector_id, ret);

 	return ret;
 }
@@ -965,19 +964,16 @@ hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
 static int
 hns3vf_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
 {
-#define HNS3VF_VLAN_MBX_MSG_LEN 5
+	struct hns3_mbx_vlan_filter vlan_filter = {0};
 	struct hns3_hw *hw = &hns->hw;
-	uint8_t msg_data[HNS3VF_VLAN_MBX_MSG_LEN];
-	uint16_t proto = htons(RTE_ETHER_TYPE_VLAN);
-	uint8_t is_kill = on ? 0 : 1;

-	msg_data[0] = is_kill;
-	memcpy(&msg_data[1], &vlan_id, sizeof(vlan_id));
-	memcpy(&msg_data[3], &proto, sizeof(proto));
+	vlan_filter.is_kill = on ? 0 : 1;
+	vlan_filter.proto = rte_cpu_to_le_16(RTE_ETHER_TYPE_VLAN);
+	vlan_filter.vlan_id =  rte_cpu_to_le_16(vlan_id);

 	return hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN, HNS3_MBX_VLAN_FILTER,
-				 msg_data, HNS3VF_VLAN_MBX_MSG_LEN, true, NULL,
-				 0);
+				(uint8_t *)&vlan_filter, sizeof(vlan_filter),
+				 true, NULL, 0);
 }

 static int
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index f1743c195e..ad5ec555b3 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -11,8 +11,6 @@
 #include "hns3_intr.h"
 #include "hns3_rxtx.h"

-#define HNS3_CMD_CODE_OFFSET		2
-
 static const struct errno_respcode_map err_code_map[] = {
 	{0, 0},
 	{1, -EPERM},
@@ -127,29 +125,30 @@ hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
 	struct hns3_mbx_vf_to_pf_cmd *req;
 	struct hns3_cmd_desc desc;
 	bool is_ring_vector_msg;
-	int offset;
 	int ret;

 	req = (struct hns3_mbx_vf_to_pf_cmd *)desc.data;

 	/* first two bytes are reserved for code & subcode */
-	if (msg_len > (HNS3_MBX_MAX_MSG_SIZE - HNS3_CMD_CODE_OFFSET)) {
+	if (msg_len > HNS3_MBX_MSG_MAX_DATA_SIZE) {
 		hns3_err(hw,
 			 "VF send mbx msg fail, msg len %u exceeds max payload len %d",
-			 msg_len, HNS3_MBX_MAX_MSG_SIZE - HNS3_CMD_CODE_OFFSET);
+			 msg_len, HNS3_MBX_MSG_MAX_DATA_SIZE);
 		return -EINVAL;
 	}

 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_MBX_VF_TO_PF, false);
-	req->msg[0] = code;
+	req->msg.code = code;
 	is_ring_vector_msg = (code == HNS3_MBX_MAP_RING_TO_VECTOR) ||
 			     (code == HNS3_MBX_UNMAP_RING_TO_VECTOR) ||
 			     (code == HNS3_MBX_GET_RING_VECTOR_MAP);
 	if (!is_ring_vector_msg)
-		req->msg[1] = subcode;
+		req->msg.subcode = subcode;
 	if (msg_data) {
-		offset = is_ring_vector_msg ? 1 : HNS3_CMD_CODE_OFFSET;
-		memcpy(&req->msg[offset], msg_data, msg_len);
+		if (is_ring_vector_msg)
+			memcpy(&req->msg.vector_id, msg_data, msg_len);
+		else
+			memcpy(&req->msg.data, msg_data, msg_len);
 	}

 	/* synchronous send */
@@ -296,11 +295,8 @@ static void
 hns3pf_handle_link_change_event(struct hns3_hw *hw,
 				struct hns3_mbx_vf_to_pf_cmd *req)
 {
-#define LINK_STATUS_OFFSET     1
-#define LINK_FAIL_CODE_OFFSET  2
-
-	if (!req->msg[LINK_STATUS_OFFSET])
-		hns3_link_fail_parse(hw, req->msg[LINK_FAIL_CODE_OFFSET]);
+	if (!req->msg.link_status)
+		hns3_link_fail_parse(hw, req->msg.link_fail_code);

 	hns3_update_linkstatus_and_event(hw, true);
 }
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index 4a328802b9..59fb73abcc 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -89,7 +89,6 @@ enum hns3_mbx_link_fail_subcode {
 	HNS3_MBX_LF_XSFP_ABSENT,
 };

-#define HNS3_MBX_MAX_MSG_SIZE	16
 #define HNS3_MBX_MAX_RESP_DATA_SIZE	8
 #define HNS3_MBX_DEF_TIME_LIMIT_MS	500

@@ -107,6 +106,46 @@ struct hns3_mbx_resp_status {
 	uint8_t additional_info[HNS3_MBX_MAX_RESP_DATA_SIZE];
 };

+struct hns3_ring_chain_param {
+	uint8_t ring_type;
+	uint8_t tqp_index;
+	uint8_t int_gl_index;
+};
+
+struct hns3_mbx_vlan_filter {
+	uint8_t is_kill;
+	uint16_t vlan_id;
+	uint16_t proto;
+} __rte_packed;
+
+#define HNS3_MBX_MSG_MAX_DATA_SIZE	14
+#define HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM	4
+struct hns3_vf_to_pf_msg {
+	uint8_t code;
+	union {
+		struct {
+			uint8_t subcode;
+			uint8_t data[HNS3_MBX_MSG_MAX_DATA_SIZE];
+		};
+		struct {
+			uint8_t en_bc;
+			uint8_t en_uc;
+			uint8_t en_mc;
+			uint8_t en_limit_promisc;
+		};
+		struct {
+			uint8_t vector_id;
+			uint8_t ring_num;
+			struct hns3_ring_chain_param
+				ring_param[HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM];
+		};
+		struct {
+			uint8_t link_status;
+			uint8_t link_fail_code;
+		};
+	};
+};
+
 struct errno_respcode_map {
 	uint16_t resp_code;
 	int err_no;
@@ -122,7 +161,7 @@ struct hns3_mbx_vf_to_pf_cmd {
 	uint8_t msg_len;
 	uint8_t rsv2;
 	uint16_t match_id;
-	uint8_t msg[HNS3_MBX_MAX_MSG_SIZE];
+	struct hns3_vf_to_pf_msg msg;
 };

 struct hns3_mbx_pf_to_vf_cmd {
@@ -134,19 +173,6 @@ struct hns3_mbx_pf_to_vf_cmd {
 	uint16_t msg[8];
 };

-struct hns3_ring_chain_param {
-	uint8_t ring_type;
-	uint8_t tqp_index;
-	uint8_t int_gl_index;
-};
-
-#define HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM	4
-struct hns3_vf_bind_vector_msg {
-	uint8_t vector_id;
-	uint8_t ring_num;
-	struct hns3_ring_chain_param param[HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM];
-};
-
 struct hns3_pf_rst_done_cmd {
 	uint8_t pf_rst_done;
 	uint8_t rsv[23];
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.475904783 +0800
+++ 0082-net-hns3-refactor-VF-mailbox-message-struct.patch	2024-03-05 17:39:30.823566495 +0800
@@ -1 +1 @@
-From 692b35be121b724119da001d7ec4c0fabd51177b Mon Sep 17 00:00:00 2001
+From c1c62366edd58c38d3c9e0e81eb3bfb7d40bc41a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 692b35be121b724119da001d7ec4c0fabd51177b ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: refactor PF mailbox message struct' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (81 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: refactor VF mailbox message struct' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: refactor send mailbox function' " Xueming Li
                   ` (53 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f876981e54a106d1212164d8f93eb895fb184ce3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f876981e54a106d1212164d8f93eb895fb184ce3 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 14:55:06 +0800
Subject: [PATCH] net/hns3: refactor PF mailbox message struct
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4d534598d922130d12c244d3237652fbfdad0f4b ]

The data region in PF to VF mbx memssage command is used
to communicate with VF driver. And this data region exists
as an array. As a result, some complicated feature commands,
like mailbox response, link change event, close promisc mode,
reset request and update pvid state, have to use magic number
to set them. This isn't good for maintenance of driver. So
this patch refactors these messages by extracting an
hns3_pf_to_vf_msg structure.

Fixes: 463e748964f5 ("net/hns3: support mailbox")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_mbx.c | 38 ++++++++++++++++++-------------------
 drivers/net/hns3/hns3_mbx.h | 25 +++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index ad5ec555b3..c90f5d59ba 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -192,17 +192,17 @@ static void
 hns3vf_handle_link_change_event(struct hns3_hw *hw,
 				struct hns3_mbx_pf_to_vf_cmd *req)
 {
+	struct hns3_mbx_link_status *link_info =
+		(struct hns3_mbx_link_status *)req->msg.msg_data;
 	uint8_t link_status, link_duplex;
-	uint16_t *msg_q = req->msg;
 	uint8_t support_push_lsc;
 	uint32_t link_speed;

-	memcpy(&link_speed, &msg_q[2], sizeof(link_speed));
-	link_status = rte_le_to_cpu_16(msg_q[1]);
-	link_duplex = (uint8_t)rte_le_to_cpu_16(msg_q[4]);
-	hns3vf_update_link_status(hw, link_status, link_speed,
-				  link_duplex);
-	support_push_lsc = (*(uint8_t *)&msg_q[5]) & 1u;
+	link_status = (uint8_t)rte_le_to_cpu_16(link_info->link_status);
+	link_speed = rte_le_to_cpu_32(link_info->speed);
+	link_duplex = (uint8_t)rte_le_to_cpu_16(link_info->duplex);
+	hns3vf_update_link_status(hw, link_status, link_speed, link_duplex);
+	support_push_lsc = (link_info->flag) & 1u;
 	hns3vf_update_push_lsc_cap(hw, support_push_lsc);
 }

@@ -211,7 +211,6 @@ hns3_handle_asserting_reset(struct hns3_hw *hw,
 			    struct hns3_mbx_pf_to_vf_cmd *req)
 {
 	enum hns3_reset_level reset_level;
-	uint16_t *msg_q = req->msg;

 	/*
 	 * PF has asserted reset hence VF should go in pending
@@ -219,7 +218,7 @@ hns3_handle_asserting_reset(struct hns3_hw *hw,
 	 * has been completely reset. After this stack should
 	 * eventually be re-initialized.
 	 */
-	reset_level = rte_le_to_cpu_16(msg_q[1]);
+	reset_level = rte_le_to_cpu_16(req->msg.reset_level);
 	hns3_atomic_set_bit(reset_level, &hw->reset.pending);

 	hns3_warn(hw, "PF inform reset level %d", reset_level);
@@ -241,8 +240,9 @@ hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
 		 * to match the request.
 		 */
 		if (req->match_id == resp->match_id) {
-			resp->resp_status = hns3_resp_to_errno(req->msg[3]);
-			memcpy(resp->additional_info, &req->msg[4],
+			resp->resp_status =
+				hns3_resp_to_errno(req->msg.resp_status);
+			memcpy(resp->additional_info, &req->msg.resp_data,
 			       HNS3_MBX_MAX_RESP_DATA_SIZE);
 			rte_io_wmb();
 			resp->received_match_resp = true;
@@ -255,7 +255,8 @@ hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
 	 * support copy request's match_id to its response. So VF follows the
 	 * original scheme to process.
 	 */
-	msg_data = (uint32_t)req->msg[1] << HNS3_MBX_RESP_CODE_OFFSET | req->msg[2];
+	msg_data = (uint32_t)req->msg.vf_mbx_msg_code <<
+			HNS3_MBX_RESP_CODE_OFFSET | req->msg.vf_mbx_msg_subcode;
 	if (resp->req_msg_data != msg_data) {
 		hns3_warn(hw,
 			"received response tag (%u) is mismatched with requested tag (%u)",
@@ -263,8 +264,8 @@ hns3_handle_mbx_response(struct hns3_hw *hw, struct hns3_mbx_pf_to_vf_cmd *req)
 		return;
 	}

-	resp->resp_status = hns3_resp_to_errno(req->msg[3]);
-	memcpy(resp->additional_info, &req->msg[4],
+	resp->resp_status = hns3_resp_to_errno(req->msg.resp_status);
+	memcpy(resp->additional_info, &req->msg.resp_data,
 	       HNS3_MBX_MAX_RESP_DATA_SIZE);
 	rte_io_wmb();
 	resp->received_match_resp = true;
@@ -305,8 +306,7 @@ static void
 hns3_update_port_base_vlan_info(struct hns3_hw *hw,
 				struct hns3_mbx_pf_to_vf_cmd *req)
 {
-#define PVID_STATE_OFFSET	1
-	uint16_t new_pvid_state = req->msg[PVID_STATE_OFFSET] ?
+	uint16_t new_pvid_state = req->msg.pvid_state ?
 		HNS3_PORT_BASE_VLAN_ENABLE : HNS3_PORT_BASE_VLAN_DISABLE;
 	/*
 	 * Currently, hardware doesn't support more than two layers VLAN offload
@@ -355,7 +355,7 @@ hns3_handle_mbx_msg_out_intr(struct hns3_hw *hw)
 	while (next_to_use != tail) {
 		desc = &crq->desc[next_to_use];
 		req = (struct hns3_mbx_pf_to_vf_cmd *)desc->data;
-		opcode = req->msg[0] & 0xff;
+		opcode = req->msg.code & 0xff;

 		flag = rte_le_to_cpu_16(crq->desc[next_to_use].flag);
 		if (!hns3_get_bit(flag, HNS3_CMDQ_RX_OUTVLD_B))
@@ -428,7 +428,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)

 		desc = &crq->desc[crq->next_to_use];
 		req = (struct hns3_mbx_pf_to_vf_cmd *)desc->data;
-		opcode = req->msg[0] & 0xff;
+		opcode = req->msg.code & 0xff;

 		flag = rte_le_to_cpu_16(crq->desc[crq->next_to_use].flag);
 		if (unlikely(!hns3_get_bit(flag, HNS3_CMDQ_RX_OUTVLD_B))) {
@@ -484,7 +484,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
 			 * hns3 PF kernel driver, VF driver will receive this
 			 * mailbox message from PF driver.
 			 */
-			hns3_handle_promisc_info(hw, req->msg[1]);
+			hns3_handle_promisc_info(hw, req->msg.promisc_en);
 			break;
 		default:
 			hns3_err(hw, "received unsupported(%u) mbx msg",
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index 59fb73abcc..09780fcebd 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -118,6 +118,13 @@ struct hns3_mbx_vlan_filter {
 	uint16_t proto;
 } __rte_packed;

+struct hns3_mbx_link_status {
+	uint16_t link_status;
+	uint32_t speed;
+	uint16_t duplex;
+	uint8_t flag;
+} __rte_packed;
+
 #define HNS3_MBX_MSG_MAX_DATA_SIZE	14
 #define HNS3_MBX_MAX_RING_CHAIN_PARAM_NUM	4
 struct hns3_vf_to_pf_msg {
@@ -146,6 +153,22 @@ struct hns3_vf_to_pf_msg {
 	};
 };

+struct hns3_pf_to_vf_msg {
+	uint16_t code;
+	union {
+		struct {
+			uint16_t vf_mbx_msg_code;
+			uint16_t vf_mbx_msg_subcode;
+			uint16_t resp_status;
+			uint8_t resp_data[HNS3_MBX_MAX_RESP_DATA_SIZE];
+		};
+		uint16_t promisc_en;
+		uint16_t reset_level;
+		uint16_t pvid_state;
+		uint8_t msg_data[HNS3_MBX_MSG_MAX_DATA_SIZE];
+	};
+};
+
 struct errno_respcode_map {
 	uint16_t resp_code;
 	int err_no;
@@ -170,7 +193,7 @@ struct hns3_mbx_pf_to_vf_cmd {
 	uint8_t msg_len;
 	uint8_t rsv1;
 	uint16_t match_id;
-	uint16_t msg[8];
+	struct hns3_pf_to_vf_msg msg;
 };

 struct hns3_pf_rst_done_cmd {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.514800484 +0800
+++ 0083-net-hns3-refactor-PF-mailbox-message-struct.patch	2024-03-05 17:39:30.833566495 +0800
@@ -1 +1 @@
-From 4d534598d922130d12c244d3237652fbfdad0f4b Mon Sep 17 00:00:00 2001
+From f876981e54a106d1212164d8f93eb895fb184ce3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4d534598d922130d12c244d3237652fbfdad0f4b ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: refactor send mailbox function' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (82 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: refactor PF " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: refactor handle " Xueming Li
                   ` (52 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1be4ad59be7f6d3cea9c6e4536339178714c2cfc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1be4ad59be7f6d3cea9c6e4536339178714c2cfc Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 14:55:07 +0800
Subject: [PATCH] net/hns3: refactor send mailbox function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c9bd98d84587dbc0dddb8964ad3d7d54818aca01 ]

The 'hns3_send_mbx_msg' function has following problem:
1. the name is vague, missing caller indication
2. too many input parameters because the filling messages
   are placed in commands the send command.

Therefore, a common interface is encapsulated to fill in
the mailbox message before sending it.

Fixes: 463e748964f5 ("net/hns3: support mailbox")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 141 ++++++++++++++++++------------
 drivers/net/hns3/hns3_mbx.c       |  50 ++++-------
 drivers/net/hns3/hns3_mbx.h       |   8 +-
 drivers/net/hns3/hns3_rxtx.c      |  18 ++--
 4 files changed, 116 insertions(+), 101 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 19e734ca8d..b0d0c29df1 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -91,11 +91,13 @@ hns3vf_add_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 {
 	/* mac address was checked by upper level interface */
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_UNICAST,
-				HNS3_MBX_MAC_VLAN_UC_ADD, mac_addr->addr_bytes,
-				RTE_ETHER_ADDR_LEN, false, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_UNICAST,
+			 HNS3_MBX_MAC_VLAN_UC_ADD);
+	memcpy(req.data, mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret) {
 		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
 				      mac_addr);
@@ -110,12 +112,13 @@ hns3vf_remove_uc_mac_addr(struct hns3_hw *hw, struct rte_ether_addr *mac_addr)
 {
 	/* mac address was checked by upper level interface */
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_UNICAST,
-				HNS3_MBX_MAC_VLAN_UC_REMOVE,
-				mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN,
-				false, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_UNICAST,
+			 HNS3_MBX_MAC_VLAN_UC_REMOVE);
+	memcpy(req.data, mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret) {
 		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
 				       mac_addr);
@@ -134,6 +137,7 @@ hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
 	struct rte_ether_addr *old_addr;
 	uint8_t addr_bytes[HNS3_TWO_ETHER_ADDR_LEN]; /* for 2 MAC addresses */
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

 	/*
@@ -146,9 +150,10 @@ hns3vf_set_default_mac_addr(struct rte_eth_dev *dev,
 	memcpy(&addr_bytes[RTE_ETHER_ADDR_LEN], old_addr->addr_bytes,
 	       RTE_ETHER_ADDR_LEN);

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_UNICAST,
-				HNS3_MBX_MAC_VLAN_UC_MODIFY, addr_bytes,
-				HNS3_TWO_ETHER_ADDR_LEN, true, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_UNICAST,
+			 HNS3_MBX_MAC_VLAN_UC_MODIFY);
+	memcpy(req.data, addr_bytes, HNS3_TWO_ETHER_ADDR_LEN);
+	ret = hns3vf_mbx_send(hw, &req, true, NULL, 0);
 	if (ret) {
 		/*
 		 * The hns3 VF PMD depends on the hns3 PF kernel ethdev
@@ -185,12 +190,13 @@ hns3vf_add_mc_mac_addr(struct hns3_hw *hw,
 		       struct rte_ether_addr *mac_addr)
 {
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_MULTICAST,
-				HNS3_MBX_MAC_VLAN_MC_ADD,
-				mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN, false,
-				NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_MULTICAST,
+			 HNS3_MBX_MAC_VLAN_MC_ADD);
+	memcpy(req.data, mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret) {
 		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
 				      mac_addr);
@@ -206,12 +212,13 @@ hns3vf_remove_mc_mac_addr(struct hns3_hw *hw,
 			  struct rte_ether_addr *mac_addr)
 {
 	char mac_str[RTE_ETHER_ADDR_FMT_SIZE];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_MULTICAST,
-				HNS3_MBX_MAC_VLAN_MC_REMOVE,
-				mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN, false,
-				NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_MULTICAST,
+			 HNS3_MBX_MAC_VLAN_MC_REMOVE);
+	memcpy(req.data, mac_addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret) {
 		hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE,
 				       mac_addr);
@@ -348,7 +355,6 @@ hns3vf_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id,
 			     bool mmap, enum hns3_ring_type queue_type,
 			     uint16_t queue_id)
 {
-#define HNS3_RING_VERCTOR_DATA_SIZE	14
 	struct hns3_vf_to_pf_msg req = {0};
 	const char *op_str;
 	int ret;
@@ -365,8 +371,7 @@ hns3vf_bind_ring_with_vector(struct hns3_hw *hw, uint16_t vector_id,
 	req.ring_param[0].ring_type = queue_type;
 	req.ring_param[0].tqp_index = queue_id;
 	op_str = mmap ? "Map" : "Unmap";
-	ret = hns3_send_mbx_msg(hw, req.code, 0, (uint8_t *)&req.vector_id,
-				HNS3_RING_VERCTOR_DATA_SIZE, false, NULL, 0);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret)
 		hns3_err(hw, "%s TQP %u fail, vector_id is %u, ret = %d.",
 			 op_str, queue_id, req.vector_id, ret);
@@ -452,10 +457,12 @@ cfg_err:
 static int
 hns3vf_config_mtu(struct hns3_hw *hw, uint16_t mtu)
 {
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_MTU, 0, (const uint8_t *)&mtu,
-				sizeof(mtu), true, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_MTU, 0);
+	memcpy(req.data, &mtu, sizeof(mtu));
+	ret = hns3vf_mbx_send(hw, &req, true, NULL, 0);
 	if (ret)
 		hns3_err(hw, "Failed to set mtu (%u) for vf: %d", mtu, ret);

@@ -646,12 +653,13 @@ hns3vf_get_push_lsc_cap(struct hns3_hw *hw)
 	uint16_t val = HNS3_PF_PUSH_LSC_CAP_NOT_SUPPORTED;
 	uint16_t exp = HNS3_PF_PUSH_LSC_CAP_UNKNOWN;
 	struct hns3_vf *vf = HNS3_DEV_HW_TO_VF(hw);
+	struct hns3_vf_to_pf_msg req;

 	__atomic_store_n(&vf->pf_push_lsc_cap, HNS3_PF_PUSH_LSC_CAP_UNKNOWN,
 			 __ATOMIC_RELEASE);

-	(void)hns3_send_mbx_msg(hw, HNS3_MBX_GET_LINK_STATUS, 0, NULL, 0, false,
-				NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_GET_LINK_STATUS, 0);
+	(void)hns3vf_mbx_send(hw, &req, false, NULL, 0);

 	while (remain_ms > 0) {
 		rte_delay_ms(HNS3_POLL_RESPONE_MS);
@@ -746,12 +754,13 @@ hns3vf_check_tqp_info(struct hns3_hw *hw)
 static int
 hns3vf_get_port_base_vlan_filter_state(struct hns3_hw *hw)
 {
+	struct hns3_vf_to_pf_msg req;
 	uint8_t resp_msg;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN,
-				HNS3_MBX_GET_PORT_BASE_VLAN_STATE, NULL, 0,
-				true, &resp_msg, sizeof(resp_msg));
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_VLAN,
+			 HNS3_MBX_GET_PORT_BASE_VLAN_STATE);
+	ret = hns3vf_mbx_send(hw, &req, true, &resp_msg, sizeof(resp_msg));
 	if (ret) {
 		if (ret == -ETIME) {
 			/*
@@ -792,10 +801,12 @@ hns3vf_get_queue_info(struct hns3_hw *hw)
 {
 #define HNS3VF_TQPS_RSS_INFO_LEN	6
 	uint8_t resp_msg[HNS3VF_TQPS_RSS_INFO_LEN];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_QINFO, 0, NULL, 0, true,
-				resp_msg, HNS3VF_TQPS_RSS_INFO_LEN);
+	hns3vf_mbx_setup(&req, HNS3_MBX_GET_QINFO, 0);
+	ret = hns3vf_mbx_send(hw, &req, true,
+			      resp_msg, HNS3VF_TQPS_RSS_INFO_LEN);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Failed to get tqp info from PF: %d", ret);
 		return ret;
@@ -833,10 +844,11 @@ hns3vf_get_basic_info(struct hns3_hw *hw)
 {
 	uint8_t resp_msg[HNS3_MBX_MAX_RESP_DATA_SIZE];
 	struct hns3_basic_info *basic_info;
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_BASIC_INFO, 0, NULL, 0,
-				true, resp_msg, sizeof(resp_msg));
+	hns3vf_mbx_setup(&req, HNS3_MBX_GET_BASIC_INFO, 0);
+	ret = hns3vf_mbx_send(hw, &req, true, resp_msg, sizeof(resp_msg));
 	if (ret) {
 		hns3_err(hw, "failed to get basic info from PF, ret = %d.",
 				ret);
@@ -856,10 +868,11 @@ static int
 hns3vf_get_host_mac_addr(struct hns3_hw *hw)
 {
 	uint8_t host_mac[RTE_ETHER_ADDR_LEN];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_MAC_ADDR, 0, NULL, 0,
-				true, host_mac, RTE_ETHER_ADDR_LEN);
+	hns3vf_mbx_setup(&req, HNS3_MBX_GET_MAC_ADDR, 0);
+	ret = hns3vf_mbx_send(hw, &req, true, host_mac, RTE_ETHER_ADDR_LEN);
 	if (ret) {
 		hns3_err(hw, "Failed to get mac addr from PF: %d", ret);
 		return ret;
@@ -908,6 +921,7 @@ static void
 hns3vf_request_link_info(struct hns3_hw *hw)
 {
 	struct hns3_vf *vf = HNS3_DEV_HW_TO_VF(hw);
+	struct hns3_vf_to_pf_msg req;
 	bool send_req;
 	int ret;

@@ -919,8 +933,8 @@ hns3vf_request_link_info(struct hns3_hw *hw)
 	if (!send_req)
 		return;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_GET_LINK_STATUS, 0, NULL, 0, false,
-				NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_GET_LINK_STATUS, 0);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret) {
 		hns3_err(hw, "failed to fetch link status, ret = %d", ret);
 		return;
@@ -964,16 +978,18 @@ hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status,
 static int
 hns3vf_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on)
 {
-	struct hns3_mbx_vlan_filter vlan_filter = {0};
+	struct hns3_mbx_vlan_filter *vlan_filter;
+	struct hns3_vf_to_pf_msg req = {0};
 	struct hns3_hw *hw = &hns->hw;

-	vlan_filter.is_kill = on ? 0 : 1;
-	vlan_filter.proto = rte_cpu_to_le_16(RTE_ETHER_TYPE_VLAN);
-	vlan_filter.vlan_id =  rte_cpu_to_le_16(vlan_id);
+	req.code = HNS3_MBX_SET_VLAN;
+	req.subcode = HNS3_MBX_VLAN_FILTER;
+	vlan_filter = (struct hns3_mbx_vlan_filter *)req.data;
+	vlan_filter->is_kill = on ? 0 : 1;
+	vlan_filter->proto = rte_cpu_to_le_16(RTE_ETHER_TYPE_VLAN);
+	vlan_filter->vlan_id = rte_cpu_to_le_16(vlan_id);

-	return hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN, HNS3_MBX_VLAN_FILTER,
-				(uint8_t *)&vlan_filter, sizeof(vlan_filter),
-				 true, NULL, 0);
+	return hns3vf_mbx_send(hw, &req, true, NULL, 0);
 }

 static int
@@ -1002,6 +1018,7 @@ hns3vf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 static int
 hns3vf_en_vlan_filter(struct hns3_hw *hw, bool enable)
 {
+	struct hns3_vf_to_pf_msg req;
 	uint8_t msg_data;
 	int ret;

@@ -1009,9 +1026,10 @@ hns3vf_en_vlan_filter(struct hns3_hw *hw, bool enable)
 		return 0;

 	msg_data = enable ? 1 : 0;
-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN,
-			HNS3_MBX_ENABLE_VLAN_FILTER, &msg_data,
-			sizeof(msg_data), true, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_VLAN,
+			 HNS3_MBX_ENABLE_VLAN_FILTER);
+	memcpy(req.data, &msg_data, sizeof(msg_data));
+	ret = hns3vf_mbx_send(hw, &req, true, NULL, 0);
 	if (ret)
 		hns3_err(hw, "%s vlan filter failed, ret = %d.",
 				enable ? "enable" : "disable", ret);
@@ -1022,12 +1040,15 @@ hns3vf_en_vlan_filter(struct hns3_hw *hw, bool enable)
 static int
 hns3vf_en_hw_strip_rxvtag(struct hns3_hw *hw, bool enable)
 {
+	struct hns3_vf_to_pf_msg req;
 	uint8_t msg_data;
 	int ret;

 	msg_data = enable ? 1 : 0;
-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_SET_VLAN, HNS3_MBX_VLAN_RX_OFF_CFG,
-				&msg_data, sizeof(msg_data), false, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_VLAN,
+			 HNS3_MBX_VLAN_RX_OFF_CFG);
+	memcpy(req.data, &msg_data, sizeof(msg_data));
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret)
 		hns3_err(hw, "vf %s strip failed, ret = %d.",
 				enable ? "enable" : "disable", ret);
@@ -1171,11 +1192,13 @@ hns3vf_dev_configure_vlan(struct rte_eth_dev *dev)
 static int
 hns3vf_set_alive(struct hns3_hw *hw, bool alive)
 {
+	struct hns3_vf_to_pf_msg req;
 	uint8_t msg_data;

 	msg_data = alive ? 1 : 0;
-	return hns3_send_mbx_msg(hw, HNS3_MBX_SET_ALIVE, 0, &msg_data,
-				 sizeof(msg_data), false, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_SET_ALIVE, 0);
+	memcpy(req.data, &msg_data, sizeof(msg_data));
+	return hns3vf_mbx_send(hw, &req, false, NULL, 0);
 }

 static void
@@ -1183,11 +1206,12 @@ hns3vf_keep_alive_handler(void *param)
 {
 	struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;
 	struct hns3_adapter *hns = eth_dev->data->dev_private;
+	struct hns3_vf_to_pf_msg req;
 	struct hns3_hw *hw = &hns->hw;
 	int ret;

-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_KEEP_ALIVE, 0, NULL, 0,
-				false, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_KEEP_ALIVE, 0);
+	ret = hns3vf_mbx_send(hw, &req, false, NULL, 0);
 	if (ret)
 		hns3_err(hw, "VF sends keeping alive cmd failed(=%d)",
 			 ret);
@@ -1326,9 +1350,11 @@ err_init_hardware:
 static int
 hns3vf_clear_vport_list(struct hns3_hw *hw)
 {
-	return hns3_send_mbx_msg(hw, HNS3_MBX_HANDLE_VF_TBL,
-				 HNS3_MBX_VPORT_LIST_CLEAR, NULL, 0, false,
-				 NULL, 0);
+	struct hns3_vf_to_pf_msg req;
+
+	hns3vf_mbx_setup(&req, HNS3_MBX_HANDLE_VF_TBL,
+			 HNS3_MBX_VPORT_LIST_CLEAR);
+	return hns3vf_mbx_send(hw, &req, false, NULL, 0);
 }

 static int
@@ -1797,12 +1823,13 @@ hns3vf_wait_hardware_ready(struct hns3_adapter *hns)
 static int
 hns3vf_prepare_reset(struct hns3_adapter *hns)
 {
+	struct hns3_vf_to_pf_msg req;
 	struct hns3_hw *hw = &hns->hw;
 	int ret;

 	if (hw->reset.level == HNS3_VF_FUNC_RESET) {
-		ret = hns3_send_mbx_msg(hw, HNS3_MBX_RESET, 0, NULL,
-					0, true, NULL, 0);
+		hns3vf_mbx_setup(&req, HNS3_MBX_RESET, 0);
+		ret = hns3vf_mbx_send(hw, &req, true, NULL, 0);
 		if (ret)
 			return ret;
 	}
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index c90f5d59ba..43195ff184 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -24,6 +24,14 @@ static const struct errno_respcode_map err_code_map[] = {
 	{95, -EOPNOTSUPP},
 };

+void
+hns3vf_mbx_setup(struct hns3_vf_to_pf_msg *req, uint8_t code, uint8_t subcode)
+{
+	memset(req, 0, sizeof(struct hns3_vf_to_pf_msg));
+	req->code = code;
+	req->subcode = subcode;
+}
+
 static int
 hns3_resp_to_errno(uint16_t resp_code)
 {
@@ -118,45 +126,24 @@ hns3_mbx_prepare_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode)
 }

 int
-hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
-		  const uint8_t *msg_data, uint8_t msg_len, bool need_resp,
-		  uint8_t *resp_data, uint16_t resp_len)
+hns3vf_mbx_send(struct hns3_hw *hw,
+		struct hns3_vf_to_pf_msg *req, bool need_resp,
+		uint8_t *resp_data, uint16_t resp_len)
 {
-	struct hns3_mbx_vf_to_pf_cmd *req;
+	struct hns3_mbx_vf_to_pf_cmd *cmd;
 	struct hns3_cmd_desc desc;
-	bool is_ring_vector_msg;
 	int ret;

-	req = (struct hns3_mbx_vf_to_pf_cmd *)desc.data;
-
-	/* first two bytes are reserved for code & subcode */
-	if (msg_len > HNS3_MBX_MSG_MAX_DATA_SIZE) {
-		hns3_err(hw,
-			 "VF send mbx msg fail, msg len %u exceeds max payload len %d",
-			 msg_len, HNS3_MBX_MSG_MAX_DATA_SIZE);
-		return -EINVAL;
-	}
-
 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_MBX_VF_TO_PF, false);
-	req->msg.code = code;
-	is_ring_vector_msg = (code == HNS3_MBX_MAP_RING_TO_VECTOR) ||
-			     (code == HNS3_MBX_UNMAP_RING_TO_VECTOR) ||
-			     (code == HNS3_MBX_GET_RING_VECTOR_MAP);
-	if (!is_ring_vector_msg)
-		req->msg.subcode = subcode;
-	if (msg_data) {
-		if (is_ring_vector_msg)
-			memcpy(&req->msg.vector_id, msg_data, msg_len);
-		else
-			memcpy(&req->msg.data, msg_data, msg_len);
-	}
+	cmd = (struct hns3_mbx_vf_to_pf_cmd *)desc.data;
+	cmd->msg = *req;

 	/* synchronous send */
 	if (need_resp) {
-		req->mbx_need_resp |= HNS3_MBX_NEED_RESP_BIT;
+		cmd->mbx_need_resp |= HNS3_MBX_NEED_RESP_BIT;
 		rte_spinlock_lock(&hw->mbx_resp.lock);
-		hns3_mbx_prepare_resp(hw, code, subcode);
-		req->match_id = hw->mbx_resp.match_id;
+		hns3_mbx_prepare_resp(hw, req->code, req->subcode);
+		cmd->match_id = hw->mbx_resp.match_id;
 		ret = hns3_cmd_send(hw, &desc, 1);
 		if (ret) {
 			rte_spinlock_unlock(&hw->mbx_resp.lock);
@@ -165,7 +152,8 @@ hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
 			return ret;
 		}

-		ret = hns3_get_mbx_resp(hw, code, subcode, resp_data, resp_len);
+		ret = hns3_get_mbx_resp(hw, req->code, req->subcode,
+					resp_data, resp_len);
 		rte_spinlock_unlock(&hw->mbx_resp.lock);
 	} else {
 		/* asynchronous send */
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index 09780fcebd..2952b96ab6 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -208,7 +208,9 @@ struct hns3_pf_rst_done_cmd {

 struct hns3_hw;
 void hns3_dev_handle_mbx_msg(struct hns3_hw *hw);
-int hns3_send_mbx_msg(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
-		      const uint8_t *msg_data, uint8_t msg_len, bool need_resp,
-		      uint8_t *resp_data, uint16_t resp_len);
+void hns3vf_mbx_setup(struct hns3_vf_to_pf_msg *req,
+		      uint8_t code, uint8_t subcode);
+int hns3vf_mbx_send(struct hns3_hw *hw,
+		    struct hns3_vf_to_pf_msg *req_msg, bool need_resp,
+		    uint8_t *resp_data, uint16_t resp_len);
 #endif /* HNS3_MBX_H */
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 09b7e90c70..9087bcffed 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -686,13 +686,12 @@ tqp_reset_fail:
 static int
 hns3vf_reset_tqp(struct hns3_hw *hw, uint16_t queue_id)
 {
-	uint8_t msg_data[2];
+	struct hns3_vf_to_pf_msg req;
 	int ret;

-	memcpy(msg_data, &queue_id, sizeof(uint16_t));
-
-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_QUEUE_RESET, 0, msg_data,
-				 sizeof(msg_data), true, NULL, 0);
+	hns3vf_mbx_setup(&req, HNS3_MBX_QUEUE_RESET, 0);
+	memcpy(req.data, &queue_id, sizeof(uint16_t));
+	ret = hns3vf_mbx_send(hw, &req, true, NULL, 0);
 	if (ret)
 		hns3_err(hw, "fail to reset tqp, queue_id = %u, ret = %d.",
 			 queue_id, ret);
@@ -769,15 +768,14 @@ static int
 hns3vf_reset_all_tqps(struct hns3_hw *hw)
 {
 #define HNS3VF_RESET_ALL_TQP_DONE	1U
+	struct hns3_vf_to_pf_msg req;
 	uint8_t reset_status;
-	uint8_t msg_data[2];
 	int ret;
 	uint16_t i;

-	memset(msg_data, 0, sizeof(msg_data));
-	ret = hns3_send_mbx_msg(hw, HNS3_MBX_QUEUE_RESET, 0, msg_data,
-				sizeof(msg_data), true, &reset_status,
-				sizeof(reset_status));
+	hns3vf_mbx_setup(&req, HNS3_MBX_QUEUE_RESET, 0);
+	ret = hns3vf_mbx_send(hw, &req, true,
+			      &reset_status, sizeof(reset_status));
 	if (ret) {
 		hns3_err(hw, "fail to send rcb reset mbx, ret = %d.", ret);
 		return ret;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.547637285 +0800
+++ 0084-net-hns3-refactor-send-mailbox-function.patch	2024-03-05 17:39:30.833566495 +0800
@@ -1 +1 @@
-From c9bd98d84587dbc0dddb8964ad3d7d54818aca01 Mon Sep 17 00:00:00 2001
+From 1be4ad59be7f6d3cea9c6e4536339178714c2cfc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c9bd98d84587dbc0dddb8964ad3d7d54818aca01 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: refactor handle mailbox function' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (83 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: refactor send mailbox function' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: fix VF multiple count on one reset' " Xueming Li
                   ` (51 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8abf8591dcc17e9a0a7cd11da0597d90fe095b46

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8abf8591dcc17e9a0a7cd11da0597d90fe095b46 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 14:55:08 +0800
Subject: [PATCH] net/hns3: refactor handle mailbox function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 277d522ae39f6c9daa38c5ad5d3b94f632f9cf49 ]

The mailbox messages of the PF and VF are processed in
the same function. The PF and VF call the same function
to process the messages. This code is excessive coupling
and isn't good for maintenance. Therefore, this patch
separates the interfaces that handle PF mailbox message
and handle VF mailbox message.

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    |  2 +-
 drivers/net/hns3/hns3_ethdev_vf.c |  4 +-
 drivers/net/hns3/hns3_mbx.c       | 69 ++++++++++++++++++++++++-------
 drivers/net/hns3/hns3_mbx.h       |  3 +-
 4 files changed, 58 insertions(+), 20 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index ae81368f68..bccd9db0dd 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -380,7 +380,7 @@ hns3_interrupt_handler(void *param)
 		hns3_warn(hw, "received reset interrupt");
 		hns3_schedule_reset(hns);
 	} else if (event_cause == HNS3_VECTOR0_EVENT_MBX) {
-		hns3_dev_handle_mbx_msg(hw);
+		hns3pf_handle_mbx_msg(hw);
 	} else if (event_cause != HNS3_VECTOR0_EVENT_PTP) {
 		hns3_warn(hw, "received unknown event: vector0_int_stat:0x%x "
 			  "ras_int_stat:0x%x cmdq_int_stat:0x%x",
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index b0d0c29df1..f5a7a2b1f4 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -618,7 +618,7 @@ hns3vf_interrupt_handler(void *param)
 		hns3_schedule_reset(hns);
 		break;
 	case HNS3VF_VECTOR0_EVENT_MBX:
-		hns3_dev_handle_mbx_msg(hw);
+		hns3vf_handle_mbx_msg(hw);
 		break;
 	default:
 		break;
@@ -670,7 +670,7 @@ hns3vf_get_push_lsc_cap(struct hns3_hw *hw)
 		 * driver has to actively handle the HNS3_MBX_LINK_STAT_CHANGE
 		 * mailbox from PF driver to get this capability.
 		 */
-		hns3_dev_handle_mbx_msg(hw);
+		hns3vf_handle_mbx_msg(hw);
 		if (__atomic_load_n(&vf->pf_push_lsc_cap, __ATOMIC_ACQUIRE) !=
 			HNS3_PF_PUSH_LSC_CAP_UNKNOWN)
 			break;
diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c
index 43195ff184..9cdbc1668a 100644
--- a/drivers/net/hns3/hns3_mbx.c
+++ b/drivers/net/hns3/hns3_mbx.c
@@ -78,7 +78,7 @@ hns3_get_mbx_resp(struct hns3_hw *hw, uint16_t code, uint16_t subcode,
 			return -EIO;
 		}

-		hns3_dev_handle_mbx_msg(hw);
+		hns3vf_handle_mbx_msg(hw);
 		rte_delay_us(HNS3_WAIT_RESP_US);

 		if (hw->mbx_resp.received_match_resp)
@@ -372,9 +372,57 @@ scan_next:
 }

 void
-hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
+hns3pf_handle_mbx_msg(struct hns3_hw *hw)
+{
+	struct hns3_cmq_ring *crq = &hw->cmq.crq;
+	struct hns3_mbx_vf_to_pf_cmd *req;
+	struct hns3_cmd_desc *desc;
+	uint16_t flag;
+
+	rte_spinlock_lock(&hw->cmq.crq.lock);
+
+	while (!hns3_cmd_crq_empty(hw)) {
+		if (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED)) {
+			rte_spinlock_unlock(&hw->cmq.crq.lock);
+			return;
+		}
+		desc = &crq->desc[crq->next_to_use];
+		req = (struct hns3_mbx_vf_to_pf_cmd *)desc->data;
+
+		flag = rte_le_to_cpu_16(crq->desc[crq->next_to_use].flag);
+		if (unlikely(!hns3_get_bit(flag, HNS3_CMDQ_RX_OUTVLD_B))) {
+			hns3_warn(hw,
+				  "dropped invalid mailbox message, code = %u",
+				  req->msg.code);
+
+			/* dropping/not processing this invalid message */
+			crq->desc[crq->next_to_use].flag = 0;
+			hns3_mbx_ring_ptr_move_crq(crq);
+			continue;
+		}
+
+		switch (req->msg.code) {
+		case HNS3_MBX_PUSH_LINK_STATUS:
+			hns3pf_handle_link_change_event(hw, req);
+			break;
+		default:
+			hns3_err(hw, "received unsupported(%u) mbx msg",
+				 req->msg.code);
+			break;
+		}
+		crq->desc[crq->next_to_use].flag = 0;
+		hns3_mbx_ring_ptr_move_crq(crq);
+	}
+
+	/* Write back CMDQ_RQ header pointer, IMP need this pointer */
+	hns3_write_dev(hw, HNS3_CMDQ_RX_HEAD_REG, crq->next_to_use);
+
+	rte_spinlock_unlock(&hw->cmq.crq.lock);
+}
+
+void
+hns3vf_handle_mbx_msg(struct hns3_hw *hw)
 {
-	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	struct hns3_cmq_ring *crq = &hw->cmq.crq;
 	struct hns3_mbx_pf_to_vf_cmd *req;
 	struct hns3_cmd_desc *desc;
@@ -385,7 +433,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
 	rte_spinlock_lock(&hw->cmq.crq.lock);

 	handle_out = (rte_eal_process_type() != RTE_PROC_PRIMARY ||
-		      !rte_thread_is_intr()) && hns->is_vf;
+		      !rte_thread_is_intr());
 	if (handle_out) {
 		/*
 		 * Currently, any threads in the primary and secondary processes
@@ -430,8 +478,7 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
 			continue;
 		}

-		handle_out = hns->is_vf && desc->opcode == 0;
-		if (handle_out) {
+		if (desc->opcode == 0) {
 			/* Message already processed by other thread */
 			crq->desc[crq->next_to_use].flag = 0;
 			hns3_mbx_ring_ptr_move_crq(crq);
@@ -448,16 +495,6 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)
 		case HNS3_MBX_ASSERTING_RESET:
 			hns3_handle_asserting_reset(hw, req);
 			break;
-		case HNS3_MBX_PUSH_LINK_STATUS:
-			/*
-			 * This message is reported by the firmware and is
-			 * reported in 'struct hns3_mbx_vf_to_pf_cmd' format.
-			 * Therefore, we should cast the req variable to
-			 * 'struct hns3_mbx_vf_to_pf_cmd' and then process it.
-			 */
-			hns3pf_handle_link_change_event(hw,
-				(struct hns3_mbx_vf_to_pf_cmd *)req);
-			break;
 		case HNS3_MBX_PUSH_VLAN_INFO:
 			/*
 			 * When the PVID configuration status of VF device is
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index 2952b96ab6..2b6cb8f513 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -207,7 +207,8 @@ struct hns3_pf_rst_done_cmd {
 	((crq)->next_to_use = ((crq)->next_to_use + 1) % (crq)->desc_num)

 struct hns3_hw;
-void hns3_dev_handle_mbx_msg(struct hns3_hw *hw);
+void hns3pf_handle_mbx_msg(struct hns3_hw *hw);
+void hns3vf_handle_mbx_msg(struct hns3_hw *hw);
 void hns3vf_mbx_setup(struct hns3_vf_to_pf_msg *req,
 		      uint8_t code, uint8_t subcode);
 int hns3vf_mbx_send(struct hns3_hw *hw,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.582398286 +0800
+++ 0085-net-hns3-refactor-handle-mailbox-function.patch	2024-03-05 17:39:30.833566495 +0800
@@ -1 +1 @@
-From 277d522ae39f6c9daa38c5ad5d3b94f632f9cf49 Mon Sep 17 00:00:00 2001
+From 8abf8591dcc17e9a0a7cd11da0597d90fe095b46 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 277d522ae39f6c9daa38c5ad5d3b94f632f9cf49 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: fix VF multiple count on one reset' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (84 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: refactor handle " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: fix disable command with firmware' " Xueming Li
                   ` (50 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=48d9241bbdfb813302c12f057b0d79d557856010

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 48d9241bbdfb813302c12f057b0d79d557856010 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 15:44:14 +0800
Subject: [PATCH] net/hns3: fix VF multiple count on one reset
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 072a07a9dcbd604b1983bf2cb266d3dd4dc89824 ]

There are two ways for the hns3 VF driver to know reset event, namely,
interrupt task and periodic detection task. For the latter, the real
reset process will delay several microseconds to execute. Both tasks
cause the count to increase by 1.

However, the periodic detection task also detects a reset event A
after interrupt task receive a reset event A. As a result, the reset
count will be double.

So this patch adds the comparison of reset level for VF in case of the
multiple reset count.

Fixes: a5475d61fa34 ("net/hns3: support VF")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 44 ++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index f5a7a2b1f4..83d3d66005 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -569,13 +569,8 @@ hns3vf_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)
 		val = hns3_read_dev(hw, HNS3_VF_RST_ING);
 		hns3_write_dev(hw, HNS3_VF_RST_ING, val | HNS3_VF_RST_ING_BIT);
 		val = cmdq_stat_reg & ~BIT(HNS3_VECTOR0_RST_INT_B);
-		if (clearval) {
-			hw->reset.stats.global_cnt++;
-			hns3_warn(hw, "Global reset detected, clear reset status");
-		} else {
-			hns3_schedule_delayed_reset(hns);
-			hns3_warn(hw, "Global reset detected, don't clear reset status");
-		}
+		hw->reset.stats.global_cnt++;
+		hns3_warn(hw, "Global reset detected, clear reset status");

 		ret = HNS3VF_VECTOR0_EVENT_RST;
 		goto out;
@@ -590,9 +585,9 @@ hns3vf_check_event_cause(struct hns3_adapter *hns, uint32_t *clearval)

 	val = 0;
 	ret = HNS3VF_VECTOR0_EVENT_OTHER;
+
 out:
-	if (clearval)
-		*clearval = val;
+	*clearval = val;
 	return ret;
 }

@@ -1731,11 +1726,25 @@ is_vf_reset_done(struct hns3_hw *hw)
 	return true;
 }

+static enum hns3_reset_level
+hns3vf_detect_reset_event(struct hns3_hw *hw)
+{
+	enum hns3_reset_level reset = HNS3_NONE_RESET;
+	uint32_t cmdq_stat_reg;
+
+	cmdq_stat_reg = hns3_read_dev(hw, HNS3_VECTOR0_CMDQ_STAT_REG);
+	if (BIT(HNS3_VECTOR0_RST_INT_B) & cmdq_stat_reg)
+		reset = HNS3_VF_RESET;
+
+	return reset;
+}
+
 bool
 hns3vf_is_reset_pending(struct hns3_adapter *hns)
 {
+	enum hns3_reset_level last_req;
 	struct hns3_hw *hw = &hns->hw;
-	enum hns3_reset_level reset;
+	enum hns3_reset_level new_req;

 	/*
 	 * According to the protocol of PCIe, FLR to a PF device resets the PF
@@ -1758,13 +1767,18 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return false;

-	hns3vf_check_event_cause(hns, NULL);
-	reset = hns3vf_get_reset_level(hw, &hw->reset.pending);
-	if (hw->reset.level != HNS3_NONE_RESET && reset != HNS3_NONE_RESET &&
-	    hw->reset.level < reset) {
-		hns3_warn(hw, "High level reset %d is pending", reset);
+	new_req = hns3vf_detect_reset_event(hw);
+	if (new_req == HNS3_NONE_RESET)
+		return false;
+
+	last_req = hns3vf_get_reset_level(hw, &hw->reset.pending);
+	if (last_req == HNS3_NONE_RESET || last_req < new_req) {
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hns3_schedule_delayed_reset(hns);
+		hns3_warn(hw, "High level reset detected, delay do reset");
 		return true;
 	}
+
 	return false;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.616679088 +0800
+++ 0086-net-hns3-fix-VF-multiple-count-on-one-reset.patch	2024-03-05 17:39:30.833566495 +0800
@@ -1 +1 @@
-From 072a07a9dcbd604b1983bf2cb266d3dd4dc89824 Mon Sep 17 00:00:00 2001
+From 48d9241bbdfb813302c12f057b0d79d557856010 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 072a07a9dcbd604b1983bf2cb266d3dd4dc89824 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: fix disable command with firmware' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (85 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: fix VF multiple count on one reset' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: fix reset level comparison' " Xueming Li
                   ` (49 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a3584fcde635c1a12b036469a57887f75c08d370

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a3584fcde635c1a12b036469a57887f75c08d370 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 15:44:15 +0800
Subject: [PATCH] net/hns3: fix disable command with firmware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 66048270a49088f79c2a020bd28ee0a93c4a73ed ]

Disable command only when need to delay handle reset.
This patch fixes it.

Fixes: 5be38fc6c0fc ("net/hns3: fix multiple reset detected log")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index bccd9db0dd..d626bdd5b1 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5552,18 +5552,16 @@ hns3_detect_reset_event(struct hns3_hw *hw)

 	last_req = hns3_get_reset_level(hns, &hw->reset.pending);
 	vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
-	if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state) {
-		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+	if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state)
 		new_req = HNS3_IMP_RESET;
-	} else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state) {
-		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+	else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state)
 		new_req = HNS3_GLOBAL_RESET;
-	}

 	if (new_req == HNS3_NONE_RESET)
 		return HNS3_NONE_RESET;

 	if (last_req == HNS3_NONE_RESET || last_req < new_req) {
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
 		hns3_schedule_delayed_reset(hns);
 		hns3_warn(hw, "High level reset detected, delay do reset");
 	}
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.646752289 +0800
+++ 0087-net-hns3-fix-disable-command-with-firmware.patch	2024-03-05 17:39:30.843566495 +0800
@@ -1 +1 @@
-From 66048270a49088f79c2a020bd28ee0a93c4a73ed Mon Sep 17 00:00:00 2001
+From a3584fcde635c1a12b036469a57887f75c08d370 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 66048270a49088f79c2a020bd28ee0a93c4a73ed ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: fix reset level comparison' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (86 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: fix disable command with firmware' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix Rx memory leak' " Xueming Li
                   ` (48 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cb1cef89c47a4d266c9077b39170e4b96ce0784e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cb1cef89c47a4d266c9077b39170e4b96ce0784e Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Fri, 8 Dec 2023 15:44:16 +0800
Subject: [PATCH] net/hns3: fix reset level comparison
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 ]

Currently, there are two problems in hns3vf_is_reset_pending():
1. The new detect reset level is not HNS3_NONE_RESET, but the
   last reset level is HNS3_NONE_RESET, this function returns false.
2. Comparison between last_req and new_req is opposite.

In addition, the reset level comparison in hns3_detect_reset_event()
is similar to the hns3vf_is_reset_pending(). So this patch fixes
above the problems and merges the logic of reset level comparison.

Fixes: 5be38fc6c0fc ("net/hns3: fix multiple reset detected log")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index d626bdd5b1..eafcf2c6f6 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5545,27 +5545,15 @@ is_pf_reset_done(struct hns3_hw *hw)
 static enum hns3_reset_level
 hns3_detect_reset_event(struct hns3_hw *hw)
 {
-	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	enum hns3_reset_level new_req = HNS3_NONE_RESET;
-	enum hns3_reset_level last_req;
 	uint32_t vector0_intr_state;

-	last_req = hns3_get_reset_level(hns, &hw->reset.pending);
 	vector0_intr_state = hns3_read_dev(hw, HNS3_VECTOR0_OTHER_INT_STS_REG);
 	if (BIT(HNS3_VECTOR0_IMPRESET_INT_B) & vector0_intr_state)
 		new_req = HNS3_IMP_RESET;
 	else if (BIT(HNS3_VECTOR0_GLOBALRESET_INT_B) & vector0_intr_state)
 		new_req = HNS3_GLOBAL_RESET;

-	if (new_req == HNS3_NONE_RESET)
-		return HNS3_NONE_RESET;
-
-	if (last_req == HNS3_NONE_RESET || last_req < new_req) {
-		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
-		hns3_schedule_delayed_reset(hns);
-		hns3_warn(hw, "High level reset detected, delay do reset");
-	}
-
 	return new_req;
 }

@@ -5584,10 +5572,14 @@ hns3_is_reset_pending(struct hns3_adapter *hns)
 		return false;

 	new_req = hns3_detect_reset_event(hw);
+	if (new_req == HNS3_NONE_RESET)
+		return false;
+
 	last_req = hns3_get_reset_level(hns, &hw->reset.pending);
-	if (last_req != HNS3_NONE_RESET && new_req != HNS3_NONE_RESET &&
-	    new_req < last_req) {
-		hns3_warn(hw, "High level reset %d is pending", last_req);
+	if (last_req == HNS3_NONE_RESET || last_req < new_req) {
+		__atomic_store_n(&hw->reset.disable_cmd, 1, __ATOMIC_RELAXED);
+		hns3_schedule_delayed_reset(hns);
+		hns3_warn(hw, "High level reset detected, delay do reset");
 		return true;
 	}
 	last_req = hns3_get_reset_level(hns, &hw->reset.request);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.679629090 +0800
+++ 0088-net-hns3-fix-reset-level-comparison.patch	2024-03-05 17:39:30.843566495 +0800
@@ -1 +1 @@
-From 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 Mon Sep 17 00:00:00 2001
+From cb1cef89c47a4d266c9077b39170e4b96ce0784e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1ceb5ad2dfdcc3e6658119d25253bced5be3cc32 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix Rx memory leak' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (87 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: fix reset level comparison' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix Rx descriptor' " Xueming Li
                   ` (47 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e024c471f940415824c3ca508f71135bf4072bae

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e024c471f940415824c3ca508f71135bf4072bae Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Mon, 11 Dec 2023 13:45:25 +0800
Subject: [PATCH] net/nfp: fix Rx memory leak
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2bef94420b9036c4ad7e41270e9623ab540fa35f ]

If the Rx ring is full and do not care its return value, this will
cause memory leak.

Fixes: 766d51c9ce29 ("net/nfp: merge receive function")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 3698a3d4aa..1dc9b4250b 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -133,7 +133,9 @@ nfp_flower_pf_dispatch_pkts(struct nfp_net_hw *hw,
 		return false;
 	}

-	rte_ring_enqueue(repr->ring, (void *)mbuf);
+	if (rte_ring_enqueue(repr->ring, (void *)mbuf) != 0)
+		return false;
+
 	return true;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.706014490 +0800
+++ 0089-net-nfp-fix-Rx-memory-leak.patch	2024-03-05 17:39:30.843566495 +0800
@@ -1 +1 @@
-From 2bef94420b9036c4ad7e41270e9623ab540fa35f Mon Sep 17 00:00:00 2001
+From e024c471f940415824c3ca508f71135bf4072bae Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2bef94420b9036c4ad7e41270e9623ab540fa35f ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index f950ae233b..94b50611f0 100644
+index 3698a3d4aa..1dc9b4250b 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix Rx descriptor' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (88 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix Rx memory leak' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/hns3: remove QinQ insert support for VF' " Xueming Li
                   ` (46 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=48fe88cb3ce34d1d38859ef2856eda2113bfc8c7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 48fe88cb3ce34d1d38859ef2856eda2113bfc8c7 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Mon, 11 Dec 2023 13:45:26 +0800
Subject: [PATCH] net/nfp: fix Rx descriptor
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 580ea0b09a7c293c8912884109dc92abfea1229a ]

If the Rx loop is broken and PMD does not update the descriptor, packets
will not be received successfully.

Fixes: 766d51c9ce29 ("net/nfp: merge receive function")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index f21e120a43..8ca651ba55 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -747,15 +747,6 @@ nfp_net_recv_pkts(void *rx_queue,
 		/* Checking the checksum flag */
 		nfp_net_rx_cksum(rxq, rxds, mb);

-		if (meta.port_id == 0) {
-			rx_pkts[avail++] = mb;
-		} else if (nfp_flower_pf_dispatch_pkts(hw, mb, meta.port_id)) {
-			avail_multiplexed++;
-		} else {
-			rte_pktmbuf_free(mb);
-			break;
-		}
-
 		/* Now resetting and updating the descriptor */
 		rxds->vals[0] = 0;
 		rxds->vals[1] = 0;
@@ -768,6 +759,15 @@ nfp_net_recv_pkts(void *rx_queue,
 		rxq->rd_p++;
 		if (unlikely(rxq->rd_p == rxq->rx_count)) /* Wrapping */
 			rxq->rd_p = 0;
+
+		if (meta.port_id == 0) {
+			rx_pkts[avail++] = mb;
+		} else if (nfp_flower_pf_dispatch_pkts(hw, mb, meta.port_id)) {
+			avail_multiplexed++;
+		} else {
+			rte_pktmbuf_free(mb);
+			break;
+		}
 	}

 	if (nb_hold == 0)
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.732004191 +0800
+++ 0090-net-nfp-fix-Rx-descriptor.patch	2024-03-05 17:39:30.843566495 +0800
@@ -1 +1 @@
-From 580ea0b09a7c293c8912884109dc92abfea1229a Mon Sep 17 00:00:00 2001
+From 48fe88cb3ce34d1d38859ef2856eda2113bfc8c7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 580ea0b09a7c293c8912884109dc92abfea1229a ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 5094bbf145..3840e2372c 100644
+index f21e120a43..8ca651ba55 100644
@@ -23 +25 @@
-@@ -765,15 +765,6 @@ nfp_net_recv_pkts(void *rx_queue,
+@@ -747,15 +747,6 @@ nfp_net_recv_pkts(void *rx_queue,
@@ -39 +41 @@
-@@ -786,6 +777,15 @@ nfp_net_recv_pkts(void *rx_queue,
+@@ -768,6 +759,15 @@ nfp_net_recv_pkts(void *rx_queue,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: remove QinQ insert support for VF' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (89 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix Rx descriptor' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'doc: add --latencystats option in testpmd guide' " Xueming Li
                   ` (45 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Jie Hai, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e670d64d34218d896b1121c0fb3700b91cb63204

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e670d64d34218d896b1121c0fb3700b91cb63204 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 28 Dec 2023 20:14:28 +0800
Subject: [PATCH] net/hns3: remove QinQ insert support for VF
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f6e79b8d3968150736499bc225762b62fbf1b768 ]

In the HIP08 platform, the PF driver will notify VF driver to update
the PVID state [1], and VF will declare support QinQ insert when PVID
is disabled.

In the later platform (e.g. HIP09), the hardware has been improved,
so the PF driver will NOT notify VF driver to update the PVID state.

However, the later platform still have constraint: PVID and QinQ insert
cannot be enabled at the same time, otherwise, the hardware discards
packets and reports an error interrupt.

Plus, as far as we known, VF driver's users don't use the QinQ insert.

Therefore, we declare that the VF driver don't support QinQ insert.

[1] commit b4e4d7ac9f09 ("net/hns3: support setting VF PVID by PF driver")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 8f224aa00c..28c26b049c 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -85,7 +85,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 				 RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE |
 				 RTE_ETH_TX_OFFLOAD_VLAN_INSERT);

-	if (!hw->port_base_vlan_cfg.state)
+	if (!hns->is_vf && !hw->port_base_vlan_cfg.state)
 		info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_QINQ_INSERT;

 	if (hns3_dev_get_support(hw, OUTER_UDP_CKSUM))
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.754539692 +0800
+++ 0091-net-hns3-remove-QinQ-insert-support-for-VF.patch	2024-03-05 17:39:30.853566496 +0800
@@ -1 +1 @@
-From f6e79b8d3968150736499bc225762b62fbf1b768 Mon Sep 17 00:00:00 2001
+From e670d64d34218d896b1121c0fb3700b91cb63204 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f6e79b8d3968150736499bc225762b62fbf1b768 ]
@@ -22,2 +24,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: add --latencystats option in testpmd guide' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (90 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/hns3: remove QinQ insert support for VF' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'app/testpmd: hide --bitrate-stats in help if disabled' " Xueming Li
                   ` (44 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ec2260423ed7747c677a1a5a4dd50643bed2254d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ec2260423ed7747c677a1a5a4dd50643bed2254d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 9 Jan 2024 15:08:49 -0800
Subject: [PATCH] doc: add --latencystats option in testpmd guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8cd8f0a90bba2862d8044529e11276d6f6321192 ]

Option was added but never added to documentation.

Fixes: 62d3216d6194 ("app/testpmd: add latency statistics calculation")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/guides/testpmd_app_ug/run_app.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 24a086401e..1a9b812a7f 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -422,6 +422,10 @@ The command line options are:

     Set the logical core N to perform bitrate calculation.

+*   ``--latencystats=N``
+
+    Set the logical core N to perform latency and jitter calculations.
+
 *   ``--print-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|dev_probed|dev_released|flow_aged|err_recovering|recovery_success|recovery_failed|all>``

     Enable printing the occurrence of the designated event. Using all will
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.783265093 +0800
+++ 0092-doc-add-latencystats-option-in-testpmd-guide.patch	2024-03-05 17:39:30.853566496 +0800
@@ -1 +1 @@
-From 8cd8f0a90bba2862d8044529e11276d6f6321192 Mon Sep 17 00:00:00 2001
+From ec2260423ed7747c677a1a5a4dd50643bed2254d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8cd8f0a90bba2862d8044529e11276d6f6321192 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: hide --bitrate-stats in help if disabled' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (91 preceding siblings ...)
  2024-03-05  9:47 ` patch 'doc: add --latencystats option in testpmd guide' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/vmxnet3: fix initialization on FreeBSD' " Xueming Li
                   ` (43 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=edc0e91ffc15d513a9686dc878e6fa1442a3c2db

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From edc0e91ffc15d513a9686dc878e6fa1442a3c2db Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 9 Jan 2024 15:09:27 -0800
Subject: [PATCH] app/testpmd: hide --bitrate-stats in help if disabled
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e96491cb91fd048a79e848d713d65d45f0dde915 ]

Like other #ifdef options, bitrate-stats should not be printed
in help if not configured.

Also reordered latencystats help string to group it with bitrate-stats.

Fixes: e25e6c70fb56 ("app/testpmd: add --bitrate-stats option")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/parameters.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index a9ca58339d..11b0cce577 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -100,10 +100,6 @@ usage(char* progname)
 	       "of peer ports.\n");
 	printf("  --eth-peer=X,M:M:M:M:M:M: set the MAC address of the X peer "
 	       "port (0 <= X < %d).\n", RTE_MAX_ETHPORTS);
-#endif
-#ifdef RTE_LIB_LATENCYSTATS
-	printf("  --latencystats=N: enable latency and jitter statistics "
-	       "monitoring on forwarding lcore id N.\n");
 #endif
 	printf("  --disable-crc-strip: disable CRC stripping by hardware.\n");
 	printf("  --enable-scatter: enable scattered Rx.\n");
@@ -167,8 +163,14 @@ usage(char* progname)
 	printf("  --disable-device-start: do not automatically start port\n");
 	printf("  --no-lsc-interrupt: disable link status change interrupt.\n");
 	printf("  --no-rmv-interrupt: disable device removal interrupt.\n");
+#ifdef RTE_LIB_BITRATESTATS
 	printf("  --bitrate-stats=N: set the logical core N to perform "
 		"bit-rate calculation.\n");
+#endif
+#ifdef RTE_LIB_LATENCYSTATS
+	printf("  --latencystats=N: enable latency and jitter statistics "
+	       "monitoring on forwarding lcore id N.\n");
+#endif
 	printf("  --print-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|flow_aged|err_recovering|recovery_success|recovery_failed|all>: "
 	       "enable print of designated event or all of them.\n");
 	printf("  --mask-event <unknown|intr_lsc|queue_state|intr_reset|vf_mbox|macsec|intr_rmv|flow_aged|err_recovering|recovery_success|recovery_failed||all>: "
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.813053294 +0800
+++ 0093-app-testpmd-hide-bitrate-stats-in-help-if-disabled.patch	2024-03-05 17:39:30.853566496 +0800
@@ -1 +1 @@
-From e96491cb91fd048a79e848d713d65d45f0dde915 Mon Sep 17 00:00:00 2001
+From edc0e91ffc15d513a9686dc878e6fa1442a3c2db Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e96491cb91fd048a79e848d713d65d45f0dde915 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/vmxnet3: fix initialization on FreeBSD' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (92 preceding siblings ...)
  2024-03-05  9:47 ` patch 'app/testpmd: hide --bitrate-stats in help if disabled' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix device close' " Xueming Li
                   ` (42 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Lewis Donzis, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c65a2bfc264067ab34b81bad07f6f273524488ce

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c65a2bfc264067ab34b81bad07f6f273524488ce Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 9 Jan 2024 14:23:43 +0000
Subject: [PATCH] net/vmxnet3: fix initialization on FreeBSD
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 40d5676ff1ea43cc2c121fd66d19a29a1c9107bb ]

DPDK does not support interrupts on FreeBSD, so the vmxnet3 driver
returns error when enabling interrupts as it initializes. We can fix
this by #ifdef'ing out the interrupt calls when building for FreeBSD,
allowing the driver to initialize correctly.

Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")

Reported-by: Lewis Donzis <lew@perftech.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Lewis Donzis <lew@perftech.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                             | 1 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/.mailmap b/.mailmap
index 540a3caab7..aada8ea84c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -785,6 +785,7 @@ Leszek Zygo <leszek.zygo@intel.com>
 Levend Sayar <levendsayar@gmail.com>
 Lev Faerman <lev.faerman@intel.com>
 Lewei Yang <leweix.yang@intel.com>
+Lewis Donzis <lew@perftech.com>
 Leyi Rong <leyi.rong@intel.com>
 Liang Ma <liangma@bytedance.com> <liangma@liangbit.com> <liang.j.ma@intel.com>
 Liang-Min Larry Wang <liang-min.wang@intel.com>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718a..7032f0e324 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -257,6 +257,7 @@ vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
 		vmxnet3_disable_intr(hw, i);
 }

+#ifndef RTE_EXEC_ENV_FREEBSD
 /*
  * Enable all intrs used by the device
  */
@@ -280,6 +281,7 @@ vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
 			vmxnet3_enable_intr(hw, i);
 	}
 }
+#endif

 /*
  * Gets tx data ring descriptor size.
@@ -1129,6 +1131,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 	/* Setting proper Rx Mode and issue Rx Mode Update command */
 	vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_UCAST | VMXNET3_RXM_BCAST, 1);

+#ifndef RTE_EXEC_ENV_FREEBSD
 	/* Setup interrupt callback  */
 	rte_intr_callback_register(dev->intr_handle,
 				   vmxnet3_interrupt_handler, dev);
@@ -1140,6 +1143,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)

 	/* enable all intrs */
 	vmxnet3_enable_all_intrs(hw);
+#endif

 	vmxnet3_process_events(dev);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.839424795 +0800
+++ 0094-net-vmxnet3-fix-initialization-on-FreeBSD.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From 40d5676ff1ea43cc2c121fd66d19a29a1c9107bb Mon Sep 17 00:00:00 2001
+From c65a2bfc264067ab34b81bad07f6f273524488ce Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 40d5676ff1ea43cc2c121fd66d19a29a1c9107bb ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index d85e074fbd..32ff4ceb4b 100644
+index 540a3caab7..aada8ea84c 100644
@@ -27 +29 @@
-@@ -786,6 +786,7 @@ Leszek Zygo <leszek.zygo@intel.com>
+@@ -785,6 +785,7 @@ Leszek Zygo <leszek.zygo@intel.com>
@@ -36 +38 @@
-index b239ea3ede..1e6febb092 100644
+index e49191718a..7032f0e324 100644
@@ -39 +41 @@
-@@ -258,6 +258,7 @@ vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
+@@ -257,6 +257,7 @@ vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
@@ -47 +49 @@
-@@ -281,6 +282,7 @@ vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
+@@ -280,6 +281,7 @@ vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
@@ -55 +57 @@
-@@ -1130,6 +1132,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
+@@ -1129,6 +1131,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
@@ -63 +65 @@
-@@ -1141,6 +1144,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
+@@ -1140,6 +1143,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix device close' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (93 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/vmxnet3: fix initialization on FreeBSD' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix device resource freeing' " Xueming Li
                   ` (41 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=52bd57a03befe691c2bf6c2d257efbb8f2b0768e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 52bd57a03befe691c2bf6c2d257efbb8f2b0768e Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Thu, 14 Dec 2023 18:24:29 +0800
Subject: [PATCH] net/nfp: fix device close
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 243bbfa0f92f57851ae9369133256a622c79a2a0 ]

Close interface use "rte_eth_dev_destroy()" to destroy representor.
The "rte_eth_dev_destroy()" will call "rte_eth_dev_release_port()" but
the "rte_eth_dev_close()" also calls "rte_eth_dev_release_port()".
This will cause Segmentation fault.

Remove the "rte_eth_dev_destroy()" in nfp representor close interface.

Fixes: 7c596721ae5f ("net/nfp: fix resource leak for flower firmware")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 02089d390e..a18b3951da 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -314,13 +314,13 @@ nfp_flower_repr_free(struct nfp_flower_representor *repr,
 {
 	switch (repr_type) {
 	case NFP_REPR_TYPE_PHYS_PORT:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		nfp_flower_repr_uninit(repr->eth_dev);
 		break;
 	case NFP_REPR_TYPE_PF:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_pf_repr_uninit);
+		nfp_flower_pf_repr_uninit(repr->eth_dev);
 		break;
 	case NFP_REPR_TYPE_VF:
-		rte_eth_dev_destroy(repr->eth_dev, nfp_flower_repr_uninit);
+		nfp_flower_repr_uninit(repr->eth_dev);
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "Unsupported repr port type.");
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.867063196 +0800
+++ 0095-net-nfp-fix-device-close.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From 243bbfa0f92f57851ae9369133256a622c79a2a0 Mon Sep 17 00:00:00 2001
+From 52bd57a03befe691c2bf6c2d257efbb8f2b0768e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 243bbfa0f92f57851ae9369133256a622c79a2a0 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 7d8c055b80..27ea3891bd 100644
+index 02089d390e..a18b3951da 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix device resource freeing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (94 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix device close' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: free switch domain ID on close' " Xueming Li
                   ` (40 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a581442d9ba98f8a21bf4e1d71e0cfa85d1e1eb1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a581442d9ba98f8a21bf4e1d71e0cfa85d1e1eb1 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Thu, 14 Dec 2023 18:24:30 +0800
Subject: [PATCH] net/nfp: fix device resource freeing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 09309f87358b3a538af47e31340898a15bb34d85 ]

Set the representor array to NULL to avoid that close interface
does not free some resource.

Representor array points to dev_private which is already freed by
'rte_eth_dev_release_port()', and 'nfp_flower_repr_dev_close()' requires
pointers to be NULL to proceed freeing other resources.

Fixes: 7c596721ae5f ("net/nfp: fix resource leak for flower firmware")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index a18b3951da..4937c0780a 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -294,17 +294,30 @@ nfp_flower_repr_tx_burst(void *tx_queue,
 static int
 nfp_flower_repr_uninit(struct rte_eth_dev *eth_dev)
 {
+	uint16_t index;
 	struct nfp_flower_representor *repr;

 	repr = eth_dev->data->dev_private;
 	rte_ring_free(repr->ring);

+	if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) {
+		index = NFP_FLOWER_CMSG_PORT_PHYS_PORT_NUM(repr->port_id);
+		repr->app_fw_flower->phy_reprs[index] = NULL;
+	} else {
+		index = repr->vf_id;
+		repr->app_fw_flower->vf_reprs[index] = NULL;
+	}
+
 	return 0;
 }

 static int
-nfp_flower_pf_repr_uninit(__rte_unused struct rte_eth_dev *eth_dev)
+nfp_flower_pf_repr_uninit(struct rte_eth_dev *eth_dev)
 {
+	struct nfp_flower_representor *repr = eth_dev->data->dev_private;
+
+	repr->app_fw_flower->pf_repr = NULL;
+
 	return 0;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.892517897 +0800
+++ 0096-net-nfp-fix-device-resource-freeing.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From 09309f87358b3a538af47e31340898a15bb34d85 Mon Sep 17 00:00:00 2001
+From a581442d9ba98f8a21bf4e1d71e0cfa85d1e1eb1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 09309f87358b3a538af47e31340898a15bb34d85 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 27ea3891bd..5f7c1fa737 100644
+index a18b3951da..4937c0780a 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: free switch domain ID on close' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (95 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix device resource freeing' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mana: prevent values overflow returned from RDMA layer' " Xueming Li
                   ` (39 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=84e9d93f57b58a1959237c13bb9986e854937cb3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 84e9d93f57b58a1959237c13bb9986e854937cb3 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Thu, 14 Dec 2023 18:24:31 +0800
Subject: [PATCH] net/nfp: free switch domain ID on close
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 20eaa8e2ebae621b32d740f6c0529e11d33519ff ]

Free domain id in close interface.

Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 1dc9b4250b..326d36c3a9 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -814,6 +814,7 @@ nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev)
 	rte_free(app_fw_flower->pf_hw);
 	nfp_mtr_priv_uninit(pf_dev);
 	nfp_flow_priv_uninit(pf_dev);
+	rte_eth_switch_domain_free(app_fw_flower->switch_domain_id);
 	rte_free(app_fw_flower);
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.916455597 +0800
+++ 0097-net-nfp-free-switch-domain-ID-on-close.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From 20eaa8e2ebae621b32d740f6c0529e11d33519ff Mon Sep 17 00:00:00 2001
+From 84e9d93f57b58a1959237c13bb9986e854937cb3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 20eaa8e2ebae621b32d740f6c0529e11d33519ff ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 94b50611f0..88a1b061e1 100644
+index 1dc9b4250b..326d36c3a9 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mana: prevent values overflow returned from RDMA layer' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (96 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: free switch domain ID on close' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'drivers/net: fix buffer overflow for packet types list' " Xueming Li
                   ` (38 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7de2520f2d4c410c26528e46075739c0b7e82715

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7de2520f2d4c410c26528e46075739c0b7e82715 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Thu, 18 Jan 2024 10:05:37 -0800
Subject: [PATCH] net/mana: prevent values overflow returned from RDMA layer
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b7e79896c47e9b884eaed1bac439f84250fd959f ]

The device capabilities reported from RDMA layer are in int. Those
values can overflow with the data types defined in dev_info_get().

Fix this by doing a upper bound before returning those values.

Fixes: 517ed6e2d590 ("net/mana: add basic driver with build environment")

Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/net/mana/mana.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 781ed76139..58257c971e 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -296,8 +296,8 @@ mana_dev_info_get(struct rte_eth_dev *dev,
 	dev_info->min_rx_bufsize = MIN_RX_BUF_SIZE;
 	dev_info->max_rx_pktlen = MANA_MAX_MTU + RTE_ETHER_HDR_LEN;

-	dev_info->max_rx_queues = priv->max_rx_queues;
-	dev_info->max_tx_queues = priv->max_tx_queues;
+	dev_info->max_rx_queues = RTE_MIN(priv->max_rx_queues, UINT16_MAX);
+	dev_info->max_tx_queues = RTE_MIN(priv->max_tx_queues, UINT16_MAX);

 	dev_info->max_mac_addrs = MANA_MAX_MAC_ADDR;
 	dev_info->max_hash_mac_addrs = 0;
@@ -338,16 +338,20 @@ mana_dev_info_get(struct rte_eth_dev *dev,

 	/* Buffer limits */
 	dev_info->rx_desc_lim.nb_min = MIN_BUFFERS_PER_QUEUE;
-	dev_info->rx_desc_lim.nb_max = priv->max_rx_desc;
+	dev_info->rx_desc_lim.nb_max = RTE_MIN(priv->max_rx_desc, UINT16_MAX);
 	dev_info->rx_desc_lim.nb_align = MIN_BUFFERS_PER_QUEUE;
-	dev_info->rx_desc_lim.nb_seg_max = priv->max_recv_sge;
-	dev_info->rx_desc_lim.nb_mtu_seg_max = priv->max_recv_sge;
+	dev_info->rx_desc_lim.nb_seg_max =
+		RTE_MIN(priv->max_recv_sge, UINT16_MAX);
+	dev_info->rx_desc_lim.nb_mtu_seg_max =
+		RTE_MIN(priv->max_recv_sge, UINT16_MAX);

 	dev_info->tx_desc_lim.nb_min = MIN_BUFFERS_PER_QUEUE;
-	dev_info->tx_desc_lim.nb_max = priv->max_tx_desc;
+	dev_info->tx_desc_lim.nb_max = RTE_MIN(priv->max_tx_desc, UINT16_MAX);
 	dev_info->tx_desc_lim.nb_align = MIN_BUFFERS_PER_QUEUE;
-	dev_info->tx_desc_lim.nb_seg_max = priv->max_send_sge;
-	dev_info->rx_desc_lim.nb_mtu_seg_max = priv->max_recv_sge;
+	dev_info->tx_desc_lim.nb_seg_max =
+		RTE_MIN(priv->max_send_sge, UINT16_MAX);
+	dev_info->tx_desc_lim.nb_mtu_seg_max =
+		RTE_MIN(priv->max_send_sge, UINT16_MAX);

 	/* Speed */
 	dev_info->speed_capa = RTE_ETH_LINK_SPEED_100G;
@@ -1385,9 +1389,9 @@ mana_probe_port(struct ibv_device *ibdev, struct ibv_device_attr_ex *dev_attr,
 	priv->max_mr = dev_attr->orig_attr.max_mr;
 	priv->max_mr_size = dev_attr->orig_attr.max_mr_size;

-	DRV_LOG(INFO, "dev %s max queues %d desc %d sge %d",
+	DRV_LOG(INFO, "dev %s max queues %d desc %d sge %d mr %" PRIu64,
 		name, priv->max_rx_queues, priv->max_rx_desc,
-		priv->max_send_sge);
+		priv->max_send_sge, priv->max_mr_size);

 	rte_eth_copy_pci_info(eth_dev, pci_dev);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.942120198 +0800
+++ 0098-net-mana-prevent-values-overflow-returned-from-RDMA-.patch	2024-03-05 17:39:30.863566496 +0800
@@ -1 +1 @@
-From b7e79896c47e9b884eaed1bac439f84250fd959f Mon Sep 17 00:00:00 2001
+From 7de2520f2d4c410c26528e46075739c0b7e82715 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b7e79896c47e9b884eaed1bac439f84250fd959f ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'drivers/net: fix buffer overflow for packet types list' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (97 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mana: prevent values overflow returned from RDMA layer' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'app/testpmd: fix crash in multi-process forwarding' " Xueming Li
                   ` (37 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Sivaramakrishnan Venkat; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=db4ba50b3a16b3ee2c41a4e0107544109f87987f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From db4ba50b3a16b3ee2c41a4e0107544109f87987f Mon Sep 17 00:00:00 2001
From: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>
Date: Thu, 1 Feb 2024 15:50:20 +0000
Subject: [PATCH] drivers/net: fix buffer overflow for packet types list
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 ]

Address Sanitizer detects a buffer overflow caused by an incorrect
ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
Fix the ptypes list for drivers.

Fixes: 0849ac3b6122 ("net/tap: add packet type management")
Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types")
Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics")
Fixes: 398a1be14168 ("net/thunderx: remove generic passX references")

Signed-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/dpaa/dpaa_ethdev.c      | 3 ++-
 drivers/net/mvneta/mvneta_ethdev.c  | 3 ++-
 drivers/net/mvpp2/mrvl_ethdev.c     | 3 ++-
 drivers/net/nfp/nfp_net_common.c    | 1 +
 drivers/net/pfe/pfe_ethdev.c        | 3 ++-
 drivers/net/tap/rte_eth_tap.c       | 1 +
 drivers/net/thunderx/nicvf_ethdev.c | 2 ++
 7 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a..779bdc5860 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -363,7 +363,8 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
 		RTE_PTYPE_L4_SCTP,
-		RTE_PTYPE_TUNNEL_ESP
+		RTE_PTYPE_TUNNEL_ESP,
+		RTE_PTYPE_UNKNOWN
 	};

 	PMD_INIT_FUNC_TRACE();
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index daa69e533a..212c300c14 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -198,7 +198,8 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
 		RTE_PTYPE_L3_IPV4,
 		RTE_PTYPE_L3_IPV6,
 		RTE_PTYPE_L4_TCP,
-		RTE_PTYPE_L4_UDP
+		RTE_PTYPE_L4_UDP,
+		RTE_PTYPE_UNKNOWN
 	};

 	return ptypes;
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d..4cc64c7cad 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -1777,7 +1777,8 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
 		RTE_PTYPE_L3_IPV6_EXT,
 		RTE_PTYPE_L2_ETHER_ARP,
 		RTE_PTYPE_L4_TCP,
-		RTE_PTYPE_L4_UDP
+		RTE_PTYPE_L4_UDP,
+		RTE_PTYPE_UNKNOWN
 	};

 	return ptypes;
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index e969b840d6..46d0e07850 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1299,6 +1299,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_INNER_L4_NONFRAG,
 		RTE_PTYPE_INNER_L4_ICMP,
 		RTE_PTYPE_INNER_L4_SCTP,
+		RTE_PTYPE_UNKNOWN
 	};

 	if (dev->rx_pkt_burst != nfp_net_recv_pkts)
diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index 551f3cf193..0073dd7405 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -520,7 +520,8 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L3_IPV6_EXT,
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
-		RTE_PTYPE_L4_SCTP
+		RTE_PTYPE_L4_SCTP,
+		RTE_PTYPE_UNKNOWN
 	};

 	if (dev->rx_pkt_burst == pfe_recv_pkts ||
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index b41fa971cb..3fa03cdbee 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1803,6 +1803,7 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
 		RTE_PTYPE_L4_UDP,
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_SCTP,
+		RTE_PTYPE_UNKNOWN
 	};

 	return ptypes;
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index a504d41dfe..5a0c3dc4a6 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -392,12 +392,14 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
 		RTE_PTYPE_L4_FRAG,
+		RTE_PTYPE_UNKNOWN
 	};
 	static const uint32_t ptypes_tunnel[] = {
 		RTE_PTYPE_TUNNEL_GRE,
 		RTE_PTYPE_TUNNEL_GENEVE,
 		RTE_PTYPE_TUNNEL_VXLAN,
 		RTE_PTYPE_TUNNEL_NVGRE,
+		RTE_PTYPE_UNKNOWN
 	};
 	static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.967243999 +0800
+++ 0099-drivers-net-fix-buffer-overflow-for-packet-types-lis.patch	2024-03-05 17:39:30.873566496 +0800
@@ -1 +1 @@
-From 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 Mon Sep 17 00:00:00 2001
+From db4ba50b3a16b3ee2c41a4e0107544109f87987f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -32 +34 @@
-index bb2de5de80..cf73f9d50b 100644
+index ef4c06db6a..779bdc5860 100644
@@ -60 +62 @@
-index a91509d92a..82cb8d5368 100644
+index c12364941d..4cc64c7cad 100644
@@ -74 +76 @@
-index a438eb5871..c907d9d5f6 100644
+index e969b840d6..46d0e07850 100644
@@ -77 +79 @@
-@@ -1365,6 +1365,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)
+@@ -1299,6 +1299,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix crash in multi-process forwarding' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (98 preceding siblings ...)
  2024-03-05  9:47 ` patch 'drivers/net: fix buffer overflow for packet types list' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/ionic: fix missing volatile type for cqe pointers' " Xueming Li
                   ` (36 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Dengdui Huang; +Cc: Chengwen Feng, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=49b4ce1f949f50caa700026d9128b61231816504

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 49b4ce1f949f50caa700026d9128b61231816504 Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui@huawei.com>
Date: Tue, 30 Jan 2024 09:32:49 +0800
Subject: [PATCH] app/testpmd: fix crash in multi-process forwarding
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b3a33138f317d1c651cd86f423cc703176eb7b07 ]

On multi-process scenario, each process creates flows based on the
number of queues. When nbcore is greater than 1, multiple cores may
use the same queue to forward packet, like:
dpdk-testpmd -a BDF --proc-type=auto -- -i --rxq=4 --txq=4
--nb-cores=2 --num-procs=2 --proc-id=0
testpmd> start
mac packet forwarding - ports=1 - cores=2 - streams=4 - NUMA support
enabled, MP allocation mode: native
Logical Core 2 (socket 0) forwards packets on 2 streams:
  RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=0/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00
Logical Core 3 (socket 0) forwards packets on 2 streams:
  RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=0/Q=1 (socket 0) -> TX P=0/Q=1 (socket 0) peer=02:00:00:00:00:00

After this commit, the result will be:
dpdk-testpmd -a BDF --proc-type=auto -- -i --rxq=4 --txq=4
--nb-cores=2 --num-procs=2 --proc-id=0
testpmd> start
io packet forwarding - ports=1 - cores=2 - streams=2 - NUMA support
enabled, MP allocation mode: native
Logical Core 2 (socket 0) forwards packets on 1 streams:
  RX P=0/Q=0 (socket 2) -> TX P=0/Q=0 (socket 2) peer=02:00:00:00:00:00
Logical Core 3 (socket 0) forwards packets on 1 streams:
  RX P=0/Q=1 (socket 2) -> TX P=0/Q=1 (socket 2) peer=02:00:00:00:00:00

Fixes: a550baf24af9 ("app/testpmd: support multi-process")

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/config.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index cad7537bc6..2c4dedd603 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -4794,7 +4794,6 @@ rss_fwd_config_setup(void)
 	queueid_t  nb_q;
 	streamid_t  sm_id;
 	int start;
-	int end;

 	nb_q = nb_rxq;
 	if (nb_q > nb_txq)
@@ -4802,7 +4801,7 @@ rss_fwd_config_setup(void)
 	cur_fwd_config.nb_fwd_lcores = (lcoreid_t) nb_fwd_lcores;
 	cur_fwd_config.nb_fwd_ports = nb_fwd_ports;
 	cur_fwd_config.nb_fwd_streams =
-		(streamid_t) (nb_q * cur_fwd_config.nb_fwd_ports);
+		(streamid_t) (nb_q / num_procs * cur_fwd_config.nb_fwd_ports);

 	if (cur_fwd_config.nb_fwd_streams < cur_fwd_config.nb_fwd_lcores)
 		cur_fwd_config.nb_fwd_lcores =
@@ -4824,7 +4823,6 @@ rss_fwd_config_setup(void)
 	 * the 2~3 queue for secondary process.
 	 */
 	start = proc_id * nb_q / num_procs;
-	end = start + nb_q / num_procs;
 	rxp = 0;
 	rxq = start;
 	for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
@@ -4843,8 +4841,6 @@ rss_fwd_config_setup(void)
 			continue;
 		rxp = 0;
 		rxq++;
-		if (rxq >= end)
-			rxq = start;
 	}
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:33.997079900 +0800
+++ 0100-app-testpmd-fix-crash-in-multi-process-forwarding.patch	2024-03-05 17:39:30.873566496 +0800
@@ -1 +1 @@
-From b3a33138f317d1c651cd86f423cc703176eb7b07 Mon Sep 17 00:00:00 2001
+From 49b4ce1f949f50caa700026d9128b61231816504 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b3a33138f317d1c651cd86f423cc703176eb7b07 ]
@@ -33 +35,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ionic: fix missing volatile type for cqe pointers' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (99 preceding siblings ...)
  2024-03-05  9:47 ` patch 'app/testpmd: fix crash in multi-process forwarding' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/ionic: fix RSS query' " Xueming Li
                   ` (35 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Neel Patel; +Cc: Andrew Boyer, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2ea5bde55737cf3bbb8e6767267261e686e6f85d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2ea5bde55737cf3bbb8e6767267261e686e6f85d Mon Sep 17 00:00:00 2001
From: Neel Patel <neel.patel@amd.com>
Date: Tue, 6 Feb 2024 19:13:08 -0800
Subject: [PATCH] net/ionic: fix missing volatile type for cqe pointers
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 463ad260d35ee5934ab206d392a1a3e08b5506d0 ]

This memory may be changed by the hardware, so the volatile
keyword is required for correctness.

Fixes: e86a6fcc7cf3 ("net/ionic: add optimized non-scattered Rx/Tx")

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Signed-off-by: Neel Patel <neel.patel@amd.com>
---
 drivers/net/ionic/ionic_rxtx.c        | 4 ++--
 drivers/net/ionic/ionic_rxtx_sg.c     | 8 +++++---
 drivers/net/ionic/ionic_rxtx_simple.c | 8 +++++---
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index b9e73b4871..2f1ca986b3 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -752,7 +752,7 @@ ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)
 {
 	struct ionic_rx_qcq *rxq = rx_queue;
 	struct ionic_qcq *qcq = &rxq->qcq;
-	struct ionic_rxq_comp *cq_desc;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint16_t mask, head, tail, pos;
 	bool done_color;

@@ -791,7 +791,7 @@ ionic_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
 {
 	struct ionic_tx_qcq *txq = tx_queue;
 	struct ionic_qcq *qcq = &txq->qcq;
-	struct ionic_txq_comp *cq_desc;
+	volatile struct ionic_txq_comp *cq_desc;
 	uint16_t mask, head, tail, pos, cq_pos;
 	bool done_color;

diff --git a/drivers/net/ionic/ionic_rxtx_sg.c b/drivers/net/ionic/ionic_rxtx_sg.c
index ab8e56e91c..241b6f8587 100644
--- a/drivers/net/ionic/ionic_rxtx_sg.c
+++ b/drivers/net/ionic/ionic_rxtx_sg.c
@@ -27,7 +27,8 @@ ionic_tx_flush_sg(struct ionic_tx_qcq *txq)
 	struct ionic_cq *cq = &txq->qcq.cq;
 	struct ionic_queue *q = &txq->qcq.q;
 	struct rte_mbuf *txm;
-	struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_txq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_txq_comp *cq_desc;
 	void **info;
 	uint32_t i;

@@ -252,7 +253,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,
  */
 static __rte_always_inline void
 ionic_rx_clean_one_sg(struct ionic_rx_qcq *rxq,
-		struct ionic_rxq_comp *cq_desc,
+		volatile struct ionic_rxq_comp *cq_desc,
 		struct ionic_rx_service *rx_svc)
 {
 	struct ionic_queue *q = &rxq->qcq.q;
@@ -438,7 +439,8 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
 	struct ionic_cq *cq = &rxq->qcq.cq;
 	struct ionic_queue *q = &rxq->qcq.q;
 	struct ionic_rxq_desc *q_desc_base = q->base;
-	struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_rxq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint32_t work_done = 0;
 	uint64_t then, now, hz, delta;

diff --git a/drivers/net/ionic/ionic_rxtx_simple.c b/drivers/net/ionic/ionic_rxtx_simple.c
index 5f81856256..0992177afc 100644
--- a/drivers/net/ionic/ionic_rxtx_simple.c
+++ b/drivers/net/ionic/ionic_rxtx_simple.c
@@ -27,7 +27,8 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)
 	struct ionic_cq *cq = &txq->qcq.cq;
 	struct ionic_queue *q = &txq->qcq.q;
 	struct rte_mbuf *txm;
-	struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_txq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_txq_comp *cq_desc;
 	void **info;

 	cq_desc = &cq_desc_base[cq->tail_idx];
@@ -225,7 +226,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
  */
 static __rte_always_inline void
 ionic_rx_clean_one(struct ionic_rx_qcq *rxq,
-		struct ionic_rxq_comp *cq_desc,
+		volatile struct ionic_rxq_comp *cq_desc,
 		struct ionic_rx_service *rx_svc)
 {
 	struct ionic_queue *q = &rxq->qcq.q;
@@ -359,7 +360,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
 	struct ionic_cq *cq = &rxq->qcq.cq;
 	struct ionic_queue *q = &rxq->qcq.q;
 	struct ionic_rxq_desc *q_desc_base = q->base;
-	struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;
+	struct ionic_rxq_comp *cq_desc_base = cq->base;
+	volatile struct ionic_rxq_comp *cq_desc;
 	uint32_t work_done = 0;
 	uint64_t then, now, hz, delta;

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.026525001 +0800
+++ 0101-net-ionic-fix-missing-volatile-type-for-cqe-pointers.patch	2024-03-05 17:39:30.883566497 +0800
@@ -1 +1 @@
-From 463ad260d35ee5934ab206d392a1a3e08b5506d0 Mon Sep 17 00:00:00 2001
+From 2ea5bde55737cf3bbb8e6767267261e686e6f85d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 463ad260d35ee5934ab206d392a1a3e08b5506d0 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index e7a0e16ae1..8a9c5ae191 100644
+index b9e73b4871..2f1ca986b3 100644
@@ -24 +26 @@
-@@ -756,7 +756,7 @@ ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)
+@@ -752,7 +752,7 @@ ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset)
@@ -33 +35 @@
-@@ -795,7 +795,7 @@ ionic_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
+@@ -791,7 +791,7 @@ ionic_dev_tx_descriptor_status(void *tx_queue, uint16_t offset)
@@ -43 +45 @@
-index 6c028a698c..1392342463 100644
+index ab8e56e91c..241b6f8587 100644
@@ -46 +48,2 @@
-@@ -28,7 +28,8 @@ ionic_tx_flush_sg(struct ionic_tx_qcq *txq)
+@@ -27,7 +27,8 @@ ionic_tx_flush_sg(struct ionic_tx_qcq *txq)
+ 	struct ionic_cq *cq = &txq->qcq.cq;
@@ -48 +50,0 @@
- 	struct ionic_tx_stats *stats = &txq->stats;
@@ -56 +58 @@
-@@ -254,7 +255,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -252,7 +253,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,
@@ -65 +67 @@
-@@ -440,7 +441,8 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
+@@ -438,7 +439,8 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
@@ -76 +78 @@
-index 5969287b66..00152c885a 100644
+index 5f81856256..0992177afc 100644
@@ -79 +81,2 @@
-@@ -28,7 +28,8 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)
+@@ -27,7 +27,8 @@ ionic_tx_flush(struct ionic_tx_qcq *txq)
+ 	struct ionic_cq *cq = &txq->qcq.cq;
@@ -81 +83,0 @@
- 	struct ionic_tx_stats *stats = &txq->stats;
@@ -89 +91 @@
-@@ -227,7 +228,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -225,7 +226,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
@@ -98 +100 @@
-@@ -361,7 +362,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,
+@@ -359,7 +360,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ionic: fix RSS query' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (100 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/ionic: fix missing volatile type for cqe pointers' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/ionic: fix device close' " Xueming Li
                   ` (34 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Akshay Dorwat; +Cc: Andrew Boyer, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9583f634f31a41bf41c38f0b6f60b41c41fd61eb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9583f634f31a41bf41c38f0b6f60b41c41fd61eb Mon Sep 17 00:00:00 2001
From: Akshay Dorwat <akshay.dorwat@amd.com>
Date: Tue, 6 Feb 2024 19:13:11 -0800
Subject: [PATCH] net/ionic: fix RSS query
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1df32bfd0317a3c8aed1e91b51ca2aa8317812e4 ]

The routine that copies out the RSS config can't use memcpy() because
'reta_conf->reta' is an array of uint16_t while 'lif->rss_ind_tbl' is
an array of uint8_t. Instead, copy the values individually.

Fixes: 22e7171bc63b ("net/ionic: support RSS")

Signed-off-by: Akshay Dorwat <akshay.dorwat@amd.com>
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
 .mailmap                         | 1 +
 drivers/net/ionic/ionic_ethdev.c | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index aada8ea84c..65c0e8e0ac 100644
--- a/.mailmap
+++ b/.mailmap
@@ -29,6 +29,7 @@ Akash Saxena <akash.saxena@caviumnetworks.com>
 Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
 Akhil Goyal <gakhil@marvell.com> <akhil.goyal@nxp.com>
 Akihiko Odaki <akihiko.odaki@daynix.com>
+Akshay Dorwat <akshay.dorwat@amd.com>
 Alain Leon <xerebz@gmail.com>
 Alan Brady <alan.brady@intel.com>
 Alan Carew <alan.carew@intel.com>
diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 340fd0cd59..008e50e0b9 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -561,7 +561,7 @@ ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
 	struct ionic_adapter *adapter = lif->adapter;
 	struct ionic_identity *ident = &adapter->ident;
-	int i, num;
+	int i, j, num;
 	uint16_t tbl_sz = rte_le_to_cpu_16(ident->lif.eth.rss_ind_tbl_sz);

 	IONIC_PRINT_CALL();
@@ -582,9 +582,10 @@ ionic_dev_rss_reta_query(struct rte_eth_dev *eth_dev,
 	num = reta_size / RTE_ETH_RETA_GROUP_SIZE;

 	for (i = 0; i < num; i++) {
-		memcpy(reta_conf->reta,
-			&lif->rss_ind_tbl[i * RTE_ETH_RETA_GROUP_SIZE],
-			RTE_ETH_RETA_GROUP_SIZE);
+		for (j = 0; j < RTE_ETH_RETA_GROUP_SIZE; j++) {
+			reta_conf->reta[j] =
+				lif->rss_ind_tbl[(i * RTE_ETH_RETA_GROUP_SIZE) + j];
+		}
 		reta_conf++;
 	}

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.054127802 +0800
+++ 0102-net-ionic-fix-RSS-query.patch	2024-03-05 17:39:30.883566497 +0800
@@ -1 +1 @@
-From 1df32bfd0317a3c8aed1e91b51ca2aa8317812e4 Mon Sep 17 00:00:00 2001
+From 9583f634f31a41bf41c38f0b6f60b41c41fd61eb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1df32bfd0317a3c8aed1e91b51ca2aa8317812e4 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index d066dc35b6..dc7cd0497d 100644
+index aada8ea84c..65c0e8e0ac 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ionic: fix device close' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (101 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/ionic: fix RSS query' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bonding: fix flow count query' " Xueming Li
                   ` (33 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1ce60b941d17ee06fec8c363f8e58a6db0616af0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 Mon Sep 17 00:00:00 2001
From: Andrew Boyer <andrew.boyer@amd.com>
Date: Tue, 6 Feb 2024 19:13:14 -0800
Subject: [PATCH] net/ionic: fix device close
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ]

The close routine should release all resources, but not
call rte_eth_dev_destroy(). As written this code will call
rte_eth_dev_release_port() twice and segfault.

Instead, move rte_eth_dev_destroy() to the remove routine.
eth_ionic_dev_uninit() will call close if necessary.

Fixes: 175e4e7ed760 ("net/ionic: complete release on close")

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
 drivers/net/ionic/ionic_ethdev.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c
index 008e50e0b9..4ec9598b8e 100644
--- a/drivers/net/ionic/ionic_ethdev.c
+++ b/drivers/net/ionic/ionic_ethdev.c
@@ -970,19 +970,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)

 	ionic_lif_stop(lif);

-	ionic_lif_free_queues(lif);
-
 	IONIC_PRINT(NOTICE, "Removing device %s", eth_dev->device->name);
 	if (adapter->intf->unconfigure_intr)
 		(*adapter->intf->unconfigure_intr)(adapter);

-	rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit);
-
 	ionic_port_reset(adapter);
 	ionic_reset(adapter);
+
+	ionic_lif_free_queues(lif);
+	ionic_lif_deinit(lif);
+	ionic_lif_free(lif); /* Does not free LIF object */
+
 	if (adapter->intf->unmap_bars)
 		(*adapter->intf->unmap_bars)(adapter);

+	lif->adapter = NULL;
 	rte_free(adapter);

 	return 0;
@@ -1059,21 +1061,18 @@ err:
 static int
 eth_ionic_dev_uninit(struct rte_eth_dev *eth_dev)
 {
-	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
-	struct ionic_adapter *adapter = lif->adapter;
-
 	IONIC_PRINT_CALL();

 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;

-	adapter->lif = NULL;
-
-	ionic_lif_deinit(lif);
-	ionic_lif_free(lif);
+	if (eth_dev->state != RTE_ETH_DEV_UNUSED)
+		ionic_dev_close(eth_dev);

-	if (!(lif->state & IONIC_LIF_F_FW_RESET))
-		ionic_lif_reset(lif);
+	eth_dev->dev_ops = NULL;
+	eth_dev->rx_pkt_burst = NULL;
+	eth_dev->tx_pkt_burst = NULL;
+	eth_dev->tx_pkt_prepare = NULL;

 	return 0;
 }
@@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
 {
 	char name[RTE_ETH_NAME_MAX_LEN];
 	struct rte_eth_dev *eth_dev;
+	int ret = 0;

 	/* Adapter lookup is using the eth_dev name */
 	snprintf(name, sizeof(name), "%s_lif", rte_dev->name);

 	eth_dev = rte_eth_dev_allocated(name);
 	if (eth_dev)
-		ionic_dev_close(eth_dev);
+		ret = rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit);
 	else
 		IONIC_PRINT(DEBUG, "Cannot find device %s", rte_dev->name);

-	return 0;
+	return ret;
 }

 RTE_LOG_REGISTER_DEFAULT(ionic_logtype, NOTICE);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.091610403 +0800
+++ 0103-net-ionic-fix-device-close.patch	2024-03-05 17:39:30.883566497 +0800
@@ -1 +1 @@
-From 73028be3b4d4d52f5d73becfd22bff3f57a81252 Mon Sep 17 00:00:00 2001
+From 1ce60b941d17ee06fec8c363f8e58a6db0616af0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 73028be3b4d4d52f5d73becfd22bff3f57a81252 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 7c55a26956..bedcf958e2 100644
+index 008e50e0b9..4ec9598b8e 100644
@@ -25 +27 @@
-@@ -1009,19 +1009,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
+@@ -970,19 +970,21 @@ ionic_dev_close(struct rte_eth_dev *eth_dev)
@@ -51 +53 @@
-@@ -1098,21 +1100,18 @@ err:
+@@ -1059,21 +1061,18 @@ err:
@@ -79 +81 @@
-@@ -1267,17 +1266,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)
+@@ -1228,17 +1227,18 @@ eth_ionic_dev_remove(struct rte_device *rte_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bonding: fix flow count query' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (102 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/ionic: fix device close' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mana: fix memory leak on MR allocation' " Xueming Li
                   ` (32 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Mário Kuka; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3fb48407081ae377a19ebed021b03896a904c2ad

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3fb48407081ae377a19ebed021b03896a904c2ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A1rio=20Kuka?= <kuka@cesnet.cz>
Date: Wed, 3 Jan 2024 12:10:35 +0100
Subject: [PATCH] net/bonding: fix flow count query
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 02a2accb5f54183d448edf35902b71023ab908ac ]

The rte_flow_query_count structure returned from the bonding driver
always indicates that hits and bytes are invalid (bytes_set and
hits_set flags are zero) because bond_flow_query_count() from the
net/bonding driver does not set the bytes_set and hits_set flags.

Fixes: 49dad9028e2a ("net/bonding: support flow API")

Signed-off-by: Mário Kuka <kuka@cesnet.cz>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/bonding/rte_eth_bond_flow.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 71a91675f7..5d0be5caf5 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -180,6 +180,8 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,

 	count->bytes = 0;
 	count->hits = 0;
+	count->bytes_set = 0;
+	count->hits_set = 0;
 	rte_memcpy(&member_count, count, sizeof(member_count));
 	for (i = 0; i < internals->member_count; i++) {
 		ret = rte_flow_query(internals->members[i].port_id,
@@ -192,8 +194,12 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
 		}
 		count->bytes += member_count.bytes;
 		count->hits += member_count.hits;
+		count->bytes_set |= member_count.bytes_set;
+		count->hits_set |= member_count.hits_set;
 		member_count.bytes = 0;
 		member_count.hits = 0;
+		member_count.bytes_set = 0;
+		member_count.hits_set = 0;
 	}
 	return 0;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.125738104 +0800
+++ 0104-net-bonding-fix-flow-count-query.patch	2024-03-05 17:39:30.883566497 +0800
@@ -1 +1 @@
-From 02a2accb5f54183d448edf35902b71023ab908ac Mon Sep 17 00:00:00 2001
+From 3fb48407081ae377a19ebed021b03896a904c2ad Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 02a2accb5f54183d448edf35902b71023ab908ac ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mana: fix memory leak on MR allocation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (103 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bonding: fix flow count query' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mana: handle MR cache expansion failure' " Xueming Li
                   ` (31 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6679de7a8f35b249bc00f264807bdaf0b90651d9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6679de7a8f35b249bc00f264807bdaf0b90651d9 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Thu, 8 Feb 2024 16:05:03 -0800
Subject: [PATCH] net/mana: fix memory leak on MR allocation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9d61fe41acaaf6bf88c173acce2b3165ddf0eb9d ]

Use a MR on the stack instead of allocating it. This fixes the memory
leak in the code where a MR is allocated but never freed.

Fixes: 0f5db3c68ba7 ("net/mana: implement memory registration")

Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/net/mana/mr.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mana/mr.c b/drivers/net/mana/mr.c
index b8e6ea0bbf..dfb2412834 100644
--- a/drivers/net/mana/mr.c
+++ b/drivers/net/mana/mr.c
@@ -40,7 +40,7 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
 	struct ibv_mr *ibv_mr;
 	struct mana_range ranges[pool->nb_mem_chunks];
 	uint32_t i;
-	struct mana_mr_cache *mr;
+	struct mana_mr_cache mr;
 	int ret;

 	rte_mempool_mem_iter(pool, mana_mempool_chunk_cb, ranges);
@@ -75,14 +75,13 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
 			DP_LOG(DEBUG, "MR lkey %u addr %p len %zu",
 			       ibv_mr->lkey, ibv_mr->addr, ibv_mr->length);

-			mr = rte_calloc("MANA MR", 1, sizeof(*mr), 0);
-			mr->lkey = ibv_mr->lkey;
-			mr->addr = (uintptr_t)ibv_mr->addr;
-			mr->len = ibv_mr->length;
-			mr->verb_obj = ibv_mr;
+			mr.lkey = ibv_mr->lkey;
+			mr.addr = (uintptr_t)ibv_mr->addr;
+			mr.len = ibv_mr->length;
+			mr.verb_obj = ibv_mr;

 			rte_spinlock_lock(&priv->mr_btree_lock);
-			ret = mana_mr_btree_insert(&priv->mr_btree, mr);
+			ret = mana_mr_btree_insert(&priv->mr_btree, &mr);
 			rte_spinlock_unlock(&priv->mr_btree_lock);
 			if (ret) {
 				ibv_dereg_mr(ibv_mr);
@@ -90,7 +89,7 @@ mana_new_pmd_mr(struct mana_mr_btree *local_tree, struct mana_priv *priv,
 				return ret;
 			}

-			ret = mana_mr_btree_insert(local_tree, mr);
+			ret = mana_mr_btree_insert(local_tree, &mr);
 			if (ret) {
 				/* Don't need to clean up MR as it's already
 				 * in the global tree
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.152729805 +0800
+++ 0105-net-mana-fix-memory-leak-on-MR-allocation.patch	2024-03-05 17:39:30.893566497 +0800
@@ -1 +1 @@
-From 9d61fe41acaaf6bf88c173acce2b3165ddf0eb9d Mon Sep 17 00:00:00 2001
+From 6679de7a8f35b249bc00f264807bdaf0b90651d9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9d61fe41acaaf6bf88c173acce2b3165ddf0eb9d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index d6a5ad1460..c9d0f7ef5a 100644
+index b8e6ea0bbf..dfb2412834 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mana: handle MR cache expansion failure' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (104 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mana: fix memory leak on MR allocation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'common/sfc_efx/base: use C11 static assert' " Xueming Li
                   ` (30 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Long Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=216918c28c77c571c4e1f3bbcc6140df9062f2f5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 216918c28c77c571c4e1f3bbcc6140df9062f2f5 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Thu, 8 Feb 2024 16:05:04 -0800
Subject: [PATCH] net/mana: handle MR cache expansion failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0c7bc26bb0b39bfe8999f422329bd52861b43a72 ]

On MR cache expansion failure, the request should fail as there is no
path to get a new MR into the tree. Attempting to insert a new MR to the
cache tree will result in memory violation.

Fixes: 0f5db3c68ba7 ("net/mana: implement memory registration")

Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/net/mana/mana.h |  6 +++---
 drivers/net/mana/mr.c   | 45 ++++++++++++++++++++++++++++-------------
 2 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/drivers/net/mana/mana.h b/drivers/net/mana/mana.h
index 6836872dc2..822b8a1f15 100644
--- a/drivers/net/mana/mana.h
+++ b/drivers/net/mana/mana.h
@@ -522,9 +522,9 @@ void mana_del_pmd_mr(struct mana_mr_cache *mr);
 void mana_mempool_chunk_cb(struct rte_mempool *mp, void *opaque,
 			   struct rte_mempool_memhdr *memhdr, unsigned int idx);

-struct mana_mr_cache *mana_mr_btree_lookup(struct mana_mr_btree *bt,
-					   uint16_t *idx,
-					   uintptr_t addr, size_t len);
+int mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,
+			 uintptr_t addr, size_t len,
+			 struct mana_mr_cache **cache);
 int mana_mr_btree_insert(struct mana_mr_btree *bt, struct mana_mr_cache *entry);
 int mana_mr_btree_init(struct mana_mr_btree *bt, int n, int socket);
 void mana_mr_btree_free(struct mana_mr_btree *bt);
diff --git a/drivers/net/mana/mr.c b/drivers/net/mana/mr.c
index dfb2412834..eb6d073a95 100644
--- a/drivers/net/mana/mr.c
+++ b/drivers/net/mana/mr.c
@@ -137,8 +137,12 @@ mana_find_pmd_mr(struct mana_mr_btree *local_mr_btree, struct mana_priv *priv,

 try_again:
 	/* First try to find the MR in local queue tree */
-	mr = mana_mr_btree_lookup(local_mr_btree, &idx,
-				  (uintptr_t)mbuf->buf_addr, mbuf->buf_len);
+	ret = mana_mr_btree_lookup(local_mr_btree, &idx,
+				   (uintptr_t)mbuf->buf_addr, mbuf->buf_len,
+				   &mr);
+	if (ret)
+		return NULL;
+
 	if (mr) {
 		DP_LOG(DEBUG, "Local mr lkey %u addr 0x%" PRIxPTR " len %zu",
 		       mr->lkey, mr->addr, mr->len);
@@ -147,11 +151,14 @@ try_again:

 	/* If not found, try to find the MR in global tree */
 	rte_spinlock_lock(&priv->mr_btree_lock);
-	mr = mana_mr_btree_lookup(&priv->mr_btree, &idx,
-				  (uintptr_t)mbuf->buf_addr,
-				  mbuf->buf_len);
+	ret = mana_mr_btree_lookup(&priv->mr_btree, &idx,
+				   (uintptr_t)mbuf->buf_addr,
+				   mbuf->buf_len, &mr);
 	rte_spinlock_unlock(&priv->mr_btree_lock);

+	if (ret)
+		return NULL;
+
 	/* If found in the global tree, add it to the local tree */
 	if (mr) {
 		ret = mana_mr_btree_insert(local_mr_btree, mr);
@@ -227,22 +234,23 @@ mana_mr_btree_expand(struct mana_mr_btree *bt, int n)
 /*
  * Look for a region of memory in MR cache.
  */
-struct mana_mr_cache *
-mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,
-		     uintptr_t addr, size_t len)
+int mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,
+			 uintptr_t addr, size_t len,
+			 struct mana_mr_cache **cache)
 {
 	struct mana_mr_cache *table;
 	uint16_t n;
 	uint16_t base = 0;
 	int ret;

-	n = bt->len;
+	*cache = NULL;

+	n = bt->len;
 	/* Try to double the cache if it's full */
 	if (n == bt->size) {
 		ret = mana_mr_btree_expand(bt, bt->size << 1);
 		if (ret)
-			return NULL;
+			return ret;
 	}

 	table = bt->table;
@@ -261,14 +269,16 @@ mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,

 	*idx = base;

-	if (addr + len <= table[base].addr + table[base].len)
-		return &table[base];
+	if (addr + len <= table[base].addr + table[base].len) {
+		*cache = &table[base];
+		return 0;
+	}

 	DP_LOG(DEBUG,
 	       "addr 0x%" PRIxPTR " len %zu idx %u sum 0x%" PRIxPTR " not found",
 	       addr, len, *idx, addr + len);

-	return NULL;
+	return 0;
 }

 int
@@ -313,14 +323,21 @@ mana_mr_btree_insert(struct mana_mr_btree *bt, struct mana_mr_cache *entry)
 	struct mana_mr_cache *table;
 	uint16_t idx = 0;
 	uint16_t shift;
+	int ret;
+
+	ret = mana_mr_btree_lookup(bt, &idx, entry->addr, entry->len, &table);
+	if (ret)
+		return ret;

-	if (mana_mr_btree_lookup(bt, &idx, entry->addr, entry->len)) {
+	if (table) {
 		DP_LOG(DEBUG, "Addr 0x%" PRIxPTR " len %zu exists in btree",
 		       entry->addr, entry->len);
 		return 0;
 	}

 	if (bt->len >= bt->size) {
+		DP_LOG(ERR, "Btree overflow detected len %u size %u",
+		       bt->len, bt->size);
 		bt->overflow = 1;
 		return -1;
 	}
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.177888506 +0800
+++ 0106-net-mana-handle-MR-cache-expansion-failure.patch	2024-03-05 17:39:30.893566497 +0800
@@ -1 +1 @@
-From 0c7bc26bb0b39bfe8999f422329bd52861b43a72 Mon Sep 17 00:00:00 2001
+From 216918c28c77c571c4e1f3bbcc6140df9062f2f5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0c7bc26bb0b39bfe8999f422329bd52861b43a72 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 4c56e6f746..3626925871 100644
+index 6836872dc2..822b8a1f15 100644
@@ -23 +25 @@
-@@ -523,9 +523,9 @@ void mana_del_pmd_mr(struct mana_mr_cache *mr);
+@@ -522,9 +522,9 @@ void mana_del_pmd_mr(struct mana_mr_cache *mr);
@@ -37 +39 @@
-index c9d0f7ef5a..c4045141bc 100644
+index dfb2412834..eb6d073a95 100644
@@ -40 +42 @@
-@@ -138,8 +138,12 @@ mana_alloc_pmd_mr(struct mana_mr_btree *local_mr_btree, struct mana_priv *priv,
+@@ -137,8 +137,12 @@ mana_find_pmd_mr(struct mana_mr_btree *local_mr_btree, struct mana_priv *priv,
@@ -55 +57 @@
-@@ -148,11 +152,14 @@ try_again:
+@@ -147,11 +151,14 @@ try_again:
@@ -73 +75 @@
-@@ -228,22 +235,23 @@ mana_mr_btree_expand(struct mana_mr_btree *bt, int n)
+@@ -227,22 +234,23 @@ mana_mr_btree_expand(struct mana_mr_btree *bt, int n)
@@ -102 +104 @@
-@@ -262,14 +270,16 @@ mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,
+@@ -261,14 +269,16 @@ mana_mr_btree_lookup(struct mana_mr_btree *bt, uint16_t *idx,
@@ -122 +124 @@
-@@ -314,14 +324,21 @@ mana_mr_btree_insert(struct mana_mr_btree *bt, struct mana_mr_cache *entry)
+@@ -313,14 +323,21 @@ mana_mr_btree_insert(struct mana_mr_btree *bt, struct mana_mr_cache *entry)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/sfc_efx/base: use C11 static assert' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (105 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mana: handle MR cache expansion failure' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/memif: fix extra mbuf refcnt update in zero copy Tx' " Xueming Li
                   ` (29 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Morten Brørup, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c7b50f40e114efaacade1feaaf11f8f6ff3d6bbb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c7b50f40e114efaacade1feaaf11f8f6ff3d6bbb Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Sun, 11 Feb 2024 21:48:59 -0800
Subject: [PATCH] common/sfc_efx/base: use C11 static assert
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 047d7032b76a226f2f1c36775688950933f9121b ]

The sfc base code had its own definition of static assertions
using the out of bound array access hack. Replace it with a
static_assert like rte_common.h.

The use of null pointer to compute offset is not always a constant
in older versions of clang. Use standard offsetof() instead.

Fixes: f67e4719147d ("net/sfc/base: fix coding style")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/common/sfc_efx/base/efx.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 3312c2fa8f..5773cb00b3 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -7,6 +7,8 @@
 #ifndef	_SYS_EFX_H
 #define	_SYS_EFX_H

+#include <assert.h>
+
 #include "efx_annote.h"
 #include "efsys.h"
 #include "efx_types.h"
@@ -17,14 +19,20 @@
 extern "C" {
 #endif

-#define	EFX_STATIC_ASSERT(_cond)		\
-	((void)sizeof (char[(_cond) ? 1 : -1]))
+/*
+ * Triggers an error at compilation time if the condition is false.
+ *
+ * The  { } exists to workaround a bug in clang (#55821)
+ * where it would not handle _Static_assert in a switch case.
+ */
+#define	EFX_STATIC_ASSERT(_cond) \
+	{ static_assert((_cond), #_cond); }

 #define	EFX_ARRAY_SIZE(_array)			\
 	(sizeof (_array) / sizeof ((_array)[0]))

 #define	EFX_FIELD_OFFSET(_type, _field)		\
-	((size_t)&(((_type *)0)->_field))
+	offsetof(_type, _field)

 /* The macro expands divider twice */
 #define	EFX_DIV_ROUND_UP(_n, _d)		(((_n) + (_d) - 1) / (_d))
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.203637107 +0800
+++ 0107-common-sfc_efx-base-use-C11-static-assert.patch	2024-03-05 17:39:30.893566497 +0800
@@ -1 +1 @@
-From 047d7032b76a226f2f1c36775688950933f9121b Mon Sep 17 00:00:00 2001
+From c7b50f40e114efaacade1feaaf11f8f6ff3d6bbb Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 047d7032b76a226f2f1c36775688950933f9121b ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/memif: fix extra mbuf refcnt update in zero copy Tx' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (106 preceding siblings ...)
  2024-03-05  9:47 ` patch 'common/sfc_efx/base: use C11 static assert' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/softnic: fix include of log library' " Xueming Li
                   ` (28 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Wathsala Vithanage
  Cc: Liangxing Wang, Ruifeng Wang, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f Mon Sep 17 00:00:00 2001
From: Wathsala Vithanage <wathsala.vithanage@arm.com>
Date: Wed, 14 Feb 2024 00:36:16 +0000
Subject: [PATCH] net/memif: fix extra mbuf refcnt update in zero copy Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit aa3e97fcb55d7b68fef864aa76078bdae375ad3d ]

The refcnt update of stored mbufs in memif driver is redundant since
those mbufs are only freed in eth_memif_tx_zc(). No other place can
free those stored mbufs quietly. By removing this redundant update
single core dpdk memif performance can be improved by 7.5%.

testpmd stats on Arm Neoverse N1 (Ampere Altra)
+-----------------------------+-----------------------+
|        | With refcnt update | Without refcnt update |
+--------+--------------------+-----------------------+
| Rx-pps |      2748851       |         2955487       |
+--------+--------------------+-----------------------+
| Tx-pps |      2748812       |         2955436       |
+--------+--------------------+-----------------------+

Fixes: 43b815d88188 ("net/memif: support zero-copy slave")

Signed-off-by: Liangxing Wang <liangxing.wang@arm.com>
Signed-off-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                          | 1 +
 drivers/net/memif/rte_eth_memif.c | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/.mailmap b/.mailmap
index 65c0e8e0ac..55901a26c0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1511,6 +1511,7 @@ Walter Heymans <walter.heymans@corigine.com>
 Wang Sheng-Hui <shhuiw@gmail.com>
 Wangyu (Eric) <seven.wangyu@huawei.com>
 Waterman Cao <waterman.cao@intel.com>
+Wathsala Vithanage <wathsala.vithanage@arm.com>
 Weichun Chen <weichunx.chen@intel.com>
 Wei Dai <wei.dai@intel.com>
 Weifeng Li <liweifeng96@126.com>
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 6f45a00172..18377d9caf 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -265,8 +265,6 @@ memif_free_stored_mbufs(struct pmd_process_private *proc_private, struct memif_q
 	cur_tail = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE);
 	while (mq->last_tail != cur_tail) {
 		RTE_MBUF_PREFETCH_TO_FREE(mq->buffers[(mq->last_tail + 1) & mask]);
-		/* Decrement refcnt and free mbuf. (current segment) */
-		rte_mbuf_refcnt_update(mq->buffers[mq->last_tail & mask], -1);
 		rte_pktmbuf_free_seg(mq->buffers[mq->last_tail & mask]);
 		mq->last_tail++;
 	}
@@ -825,10 +823,6 @@ memif_tx_one_zc(struct pmd_process_private *proc_private, struct memif_queue *mq
 next_in_chain:
 	/* store pointer to mbuf to free it later */
 	mq->buffers[slot & mask] = mbuf;
-	/* Increment refcnt to make sure the buffer is not freed before server
-	 * receives it. (current segment)
-	 */
-	rte_mbuf_refcnt_update(mbuf, 1);
 	/* populate descriptor */
 	d0 = &ring->desc[slot & mask];
 	d0->length = rte_pktmbuf_data_len(mbuf);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.230372508 +0800
+++ 0108-net-memif-fix-extra-mbuf-refcnt-update-in-zero-copy-.patch	2024-03-05 17:39:30.893566497 +0800
@@ -1 +1 @@
-From aa3e97fcb55d7b68fef864aa76078bdae375ad3d Mon Sep 17 00:00:00 2001
+From edaeda9ef7ec00ecce31b4e5d16158e60fb1e15f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit aa3e97fcb55d7b68fef864aa76078bdae375ad3d ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index e040e2219b..b2d0fc0729 100644
+index 65c0e8e0ac..55901a26c0 100644
@@ -36 +38 @@
-@@ -1518,6 +1518,7 @@ Walter Heymans <walter.heymans@corigine.com>
+@@ -1511,6 +1511,7 @@ Walter Heymans <walter.heymans@corigine.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/softnic: fix include of log library' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (107 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/memif: fix extra mbuf refcnt update in zero copy Tx' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/gve: fix DQO for chained descriptors' " Xueming Li
                   ` (27 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=de543e342adb07a4d94fcf1714c1d8f1a2145dc6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From de543e342adb07a4d94fcf1714c1d8f1a2145dc6 Mon Sep 17 00:00:00 2001
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Date: Tue, 13 Feb 2024 17:38:09 +0000
Subject: [PATCH] net/softnic: fix include of log library
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 96893df75bf50a82cabd8debe3492d564a5d13d5 ]

When rte_log.h was moved to a new directory, the include path was not
updated for the generated C code produced by the pipeline library,
which results in build failure for this code.

Fixes: 09ce41310930 ("log: separate logging functions out of EAL")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/softnic/rte_eth_softnic_cli.c | 2 ++
 examples/pipeline/cli.c                   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c
index 085523fe03..95e705c553 100644
--- a/drivers/net/softnic/rte_eth_softnic_cli.c
+++ b/drivers/net/softnic/rte_eth_softnic_cli.c
@@ -337,6 +337,7 @@ cmd_softnic_pipeline_libbuild(struct pmd_internals *softnic __rte_unused,
 		 "-I %s/lib/eal/include "
 		 "-I %s/lib/eal/x86/include "
 		 "-I %s/lib/eal/include/generic "
+		 "-I %s/lib/log "
 		 "-I %s/lib/meter "
 		 "-I %s/lib/port "
 		 "-I %s/lib/table "
@@ -361,6 +362,7 @@ cmd_softnic_pipeline_libbuild(struct pmd_internals *softnic __rte_unused,
 		 install_dir,
 		 install_dir,
 		 install_dir,
+		 install_dir,
 		 log_file,
 		 obj_file,
 		 lib_file,
diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 2ae6cc579f..afb143c01f 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -714,6 +714,7 @@ cmd_pipeline_libbuild(char **tokens,
 		 "-I %s/lib/eal/include "
 		 "-I %s/lib/eal/x86/include "
 		 "-I %s/lib/eal/include/generic "
+		 "-I %s/lib/log "
 		 "-I %s/lib/meter "
 		 "-I %s/lib/port "
 		 "-I %s/lib/table "
@@ -738,6 +739,7 @@ cmd_pipeline_libbuild(char **tokens,
 		 install_dir,
 		 install_dir,
 		 install_dir,
+		 install_dir,
 		 log_file,
 		 obj_file,
 		 lib_file,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.256033409 +0800
+++ 0109-net-softnic-fix-include-of-log-library.patch	2024-03-05 17:39:30.903566497 +0800
@@ -1 +1 @@
-From 96893df75bf50a82cabd8debe3492d564a5d13d5 Mon Sep 17 00:00:00 2001
+From de543e342adb07a4d94fcf1714c1d8f1a2145dc6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 96893df75bf50a82cabd8debe3492d564a5d13d5 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -41 +43 @@
-index c1efea3c1a..015717cb39 100644
+index 2ae6cc579f..afb143c01f 100644
@@ -44 +46 @@
-@@ -707,6 +707,7 @@ cmd_pipeline_libbuild(char **tokens,
+@@ -714,6 +714,7 @@ cmd_pipeline_libbuild(char **tokens,
@@ -52 +54 @@
-@@ -731,6 +732,7 @@ cmd_pipeline_libbuild(char **tokens,
+@@ -738,6 +739,7 @@ cmd_pipeline_libbuild(char **tokens,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/gve: fix DQO for chained descriptors' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (108 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/softnic: fix include of log library' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net: add macros for VLAN metadata parsing' " Xueming Li
                   ` (26 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Rushil Gupta; +Cc: Joshua Washington, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=561a3f508fcc648f599b683656af8d8e54814789

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 561a3f508fcc648f599b683656af8d8e54814789 Mon Sep 17 00:00:00 2001
From: Rushil Gupta <rushilg@google.com>
Date: Thu, 15 Feb 2024 10:02:30 +0000
Subject: [PATCH] net/gve: fix DQO for chained descriptors
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ab2fc2cd7016ba4b65b2f9fd845f0f9a7a87ef16 ]

DQO Tx path had a bug where driver was overwriting mbufs in sw-ring.
We fixed this bug by cleaning slots for all segments.

Fixes: 4022f9999f56 ("net/gve: support basic Tx data path for DQO")

Signed-off-by: Rushil Gupta <rushilg@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
---
 drivers/net/gve/gve_tx_dqo.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c
index 16101de84f..30a1455b20 100644
--- a/drivers/net/gve/gve_tx_dqo.c
+++ b/drivers/net/gve/gve_tx_dqo.c
@@ -13,7 +13,7 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq)
 	struct gve_tx_compl_desc *compl_desc;
 	struct gve_tx_queue *aim_txq;
 	uint16_t nb_desc_clean;
-	struct rte_mbuf *txe;
+	struct rte_mbuf *txe, *txe_next;
 	uint16_t compl_tag;
 	uint16_t next;

@@ -43,10 +43,15 @@ gve_tx_clean_dqo(struct gve_tx_queue *txq)
 		PMD_DRV_LOG(DEBUG, "GVE_COMPL_TYPE_DQO_REINJECTION !!!");
 		/* FALLTHROUGH */
 	case GVE_COMPL_TYPE_DQO_PKT:
+		/* free all segments. */
 		txe = aim_txq->sw_ring[compl_tag];
-		if (txe != NULL) {
+		while (txe != NULL) {
+			txe_next = txe->next;
 			rte_pktmbuf_free_seg(txe);
-			txe = NULL;
+			if (aim_txq->sw_ring[compl_tag] == txe)
+				aim_txq->sw_ring[compl_tag] = NULL;
+			txe = txe_next;
+			compl_tag = (compl_tag + 1) & (aim_txq->sw_size - 1);
 		}
 		break;
 	case GVE_COMPL_TYPE_DQO_MISS:
@@ -83,6 +88,7 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	uint16_t tx_id;
 	uint16_t sw_id;
 	uint64_t bytes;
+	uint16_t first_sw_id;

 	sw_ring = txq->sw_ring;
 	txr = txq->tx_ring;
@@ -107,23 +113,25 @@ gve_tx_burst_dqo(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)

 		ol_flags = tx_pkt->ol_flags;
 		nb_used = tx_pkt->nb_segs;
-
+		first_sw_id = sw_id;
 		do {
-			txd = &txr[tx_id];
+			if (sw_ring[sw_id] != NULL)
+				PMD_DRV_LOG(DEBUG, "Overwriting an entry in sw_ring");

+			txd = &txr[tx_id];
 			sw_ring[sw_id] = tx_pkt;

 			/* fill Tx descriptor */
 			txd->pkt.buf_addr = rte_cpu_to_le_64(rte_mbuf_data_iova(tx_pkt));
 			txd->pkt.dtype = GVE_TX_PKT_DESC_DTYPE_DQO;
-			txd->pkt.compl_tag = rte_cpu_to_le_16(sw_id);
+			txd->pkt.compl_tag = rte_cpu_to_le_16(first_sw_id);
 			txd->pkt.buf_size = RTE_MIN(tx_pkt->data_len, GVE_TX_MAX_BUF_SIZE_DQO);

 			/* size of desc_ring and sw_ring could be different */
 			tx_id = (tx_id + 1) & mask;
 			sw_id = (sw_id + 1) & sw_mask;

-			bytes += tx_pkt->pkt_len;
+			bytes += tx_pkt->data_len;
 			tx_pkt = tx_pkt->next;
 		} while (tx_pkt);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.282763810 +0800
+++ 0110-net-gve-fix-DQO-for-chained-descriptors.patch	2024-03-05 17:39:30.903566497 +0800
@@ -1 +1 @@
-From ab2fc2cd7016ba4b65b2f9fd845f0f9a7a87ef16 Mon Sep 17 00:00:00 2001
+From 561a3f508fcc648f599b683656af8d8e54814789 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ab2fc2cd7016ba4b65b2f9fd845f0f9a7a87ef16 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net: add macros for VLAN metadata parsing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (109 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/gve: fix DQO for chained descriptors' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/netvsc: fix " Xueming Li
                   ` (25 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Alan Elder; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=de2d362411cbc91c28216db27330f5d6f6bb7635

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From de2d362411cbc91c28216db27330f5d6f6bb7635 Mon Sep 17 00:00:00 2001
From: Alan Elder <alan.elder@microsoft.com>
Date: Mon, 19 Feb 2024 09:31:25 +0000
Subject: [PATCH] net: add macros for VLAN metadata parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b74087f15e16c42fe4ff9c4d603cc7a51a1aa1dc ]

Add common macros for extracting parts of VLAN tag.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")

Signed-off-by: Alan Elder <alan.elder@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap            |  1 +
 lib/net/rte_ether.h | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/.mailmap b/.mailmap
index 55901a26c0..9541b3b02e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -34,6 +34,7 @@ Alain Leon <xerebz@gmail.com>
 Alan Brady <alan.brady@intel.com>
 Alan Carew <alan.carew@intel.com>
 Alan Dewar <alan.dewar@att.com> <adewar@brocade.com>
+Alan Elder <alan.elder@microsoft.com>
 Alan Liu <zaoxingliu@gmail.com>
 Alan Winkowski <walan@marvell.com>
 Alejandro Lucero <alejandro.lucero@netronome.com>
diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h
index ce073ea818..75285bdd12 100644
--- a/lib/net/rte_ether.h
+++ b/lib/net/rte_ether.h
@@ -46,6 +46,20 @@ extern "C" {

 #define RTE_ETHER_MIN_MTU 68 /**< Minimum MTU for IPv4 packets, see RFC 791. */

+/* VLAN header fields */
+#define RTE_VLAN_DEI_SHIFT	12
+#define RTE_VLAN_PRI_SHIFT	13
+#define RTE_VLAN_PRI_MASK	0xe000 /* Priority Code Point */
+#define RTE_VLAN_DEI_MASK	0x1000 /* Drop Eligible Indicator */
+#define RTE_VLAN_ID_MASK	0x0fff /* VLAN Identifier */
+
+#define RTE_VLAN_TCI_ID(vlan_tci)	((vlan_tci) & RTE_VLAN_ID_MASK)
+#define RTE_VLAN_TCI_PRI(vlan_tci)	(((vlan_tci) & RTE_VLAN_PRI_MASK) >> RTE_VLAN_PRI_SHIFT)
+#define RTE_VLAN_TCI_DEI(vlan_tci)	(((vlan_tci) & RTE_VLAN_DEI_MASK) >> RTE_VLAN_DEI_SHIFT)
+#define RTE_VLAN_TCI_MAKE(id, pri, dei)	((id) |					\
+					 ((pri) << RTE_VLAN_PRI_SHIFT) |	\
+					 ((dei) << RTE_VLAN_DEI_SHIFT))
+
 /**
  * Ethernet address:
  * A universally administered address is uniquely assigned to a device by its
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.305307010 +0800
+++ 0111-net-add-macros-for-VLAN-metadata-parsing.patch	2024-03-05 17:39:30.903566497 +0800
@@ -1 +1 @@
-From b74087f15e16c42fe4ff9c4d603cc7a51a1aa1dc Mon Sep 17 00:00:00 2001
+From de2d362411cbc91c28216db27330f5d6f6bb7635 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b74087f15e16c42fe4ff9c4d603cc7a51a1aa1dc ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index b2d0fc0729..12d2875641 100644
+index 55901a26c0..9541b3b02e 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/netvsc: fix VLAN metadata parsing' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (110 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net: add macros for VLAN metadata parsing' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: fix array overflow' " Xueming Li
                   ` (24 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Alan Elder; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c3ccbda492b50510574f90c9a08f26871bc55912

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c3ccbda492b50510574f90c9a08f26871bc55912 Mon Sep 17 00:00:00 2001
From: Alan Elder <alan.elder@microsoft.com>
Date: Mon, 19 Feb 2024 09:31:39 +0000
Subject: [PATCH] net/netvsc: fix VLAN metadata parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f7654c8c13f46ab537e8220ea4d6b4911f9f0fd5 ]

The previous code incorrectly parsed the VLAN ID and priority.
If the 16-bits of VLAN ID and priority/CFI on the wire was
0123456789ABCDEF the code parsed it as 456789ABCDEF3012.  There
were macros defined to handle this conversion but they were not
used.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")

Signed-off-by: Alan Elder <alan.elder@microsoft.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/netvsc/hn_rxtx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index e4f5015aa3..9bf1ec5509 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -612,7 +612,9 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
 					   RTE_PTYPE_L4_MASK);

 	if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) {
-		m->vlan_tci = info->vlan_info;
+		m->vlan_tci = RTE_VLAN_TCI_MAKE(NDIS_VLAN_INFO_ID(info->vlan_info),
+						NDIS_VLAN_INFO_PRI(info->vlan_info),
+						NDIS_VLAN_INFO_CFI(info->vlan_info));
 		m->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED | RTE_MBUF_F_RX_VLAN;

 		/* NDIS always strips tag, put it back if necessary */
@@ -1332,7 +1334,9 @@ static void hn_encap(struct rndis_packet_msg *pkt,
 	if (m->ol_flags & RTE_MBUF_F_TX_VLAN) {
 		pi_data = hn_rndis_pktinfo_append(pkt, NDIS_VLAN_INFO_SIZE,
 						  NDIS_PKTINFO_TYPE_VLAN);
-		*pi_data = m->vlan_tci;
+		*pi_data = NDIS_VLAN_INFO_MAKE(RTE_VLAN_TCI_ID(m->vlan_tci),
+					       RTE_VLAN_TCI_PRI(m->vlan_tci),
+					       RTE_VLAN_TCI_DEI(m->vlan_tci));
 	}

 	if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.332632311 +0800
+++ 0112-net-netvsc-fix-VLAN-metadata-parsing.patch	2024-03-05 17:39:30.903566497 +0800
@@ -1 +1 @@
-From f7654c8c13f46ab537e8220ea4d6b4911f9f0fd5 Mon Sep 17 00:00:00 2001
+From c3ccbda492b50510574f90c9a08f26871bc55912 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f7654c8c13f46ab537e8220ea4d6b4911f9f0fd5 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix array overflow' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (111 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/netvsc: fix " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: fix 50G and 100G forced speed' " Xueming Li
                   ` (23 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: Damodharam Ammepalli, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3fa018b15a6329237d9dd5066a5fac3c3bb53652

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3fa018b15a6329237d9dd5066a5fac3c3bb53652 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Mon, 11 Dec 2023 09:11:03 -0800
Subject: [PATCH] net/bnxt: fix array overflow
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4371b402c7bdbe821fff77e3c08e2faba67cb9b3 ]

In some cases the number of elements in the context memory array
can exceed the MAX_CTX_PAGES and that can cause the static members
ctx_pg_arr and ctx_dma_arr to overflow.
Allocate them dynamically to prevent this overflow.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  4 ++--
 drivers/net/bnxt/bnxt_ethdev.c | 42 +++++++++++++++++++++++++++-------
 2 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 0e01b1d4ba..aab09e3edf 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -449,8 +449,8 @@ struct bnxt_ring_mem_info {

 struct bnxt_ctx_pg_info {
 	uint32_t	entries;
-	void		*ctx_pg_arr[MAX_CTX_PAGES];
-	rte_iova_t	ctx_dma_arr[MAX_CTX_PAGES];
+	void		**ctx_pg_arr;
+	rte_iova_t	*ctx_dma_arr;
 	struct bnxt_ring_mem_info ring_mem;
 };

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index acf7e6e46e..9e63942a0f 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -4750,7 +4750,7 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
 {
 	struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem;
 	const struct rte_memzone *mz = NULL;
-	char mz_name[RTE_MEMZONE_NAMESIZE];
+	char name[RTE_MEMZONE_NAMESIZE];
 	rte_iova_t mz_phys_addr;
 	uint64_t valid_bits = 0;
 	uint32_t sz;
@@ -4762,6 +4762,19 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
 	rmem->nr_pages = RTE_ALIGN_MUL_CEIL(mem_size, BNXT_PAGE_SIZE) /
 			 BNXT_PAGE_SIZE;
 	rmem->page_size = BNXT_PAGE_SIZE;
+
+	snprintf(name, RTE_MEMZONE_NAMESIZE, "bnxt_ctx_pg_arr%s_%x_%d",
+		 suffix, idx, bp->eth_dev->data->port_id);
+	ctx_pg->ctx_pg_arr = rte_zmalloc(name, sizeof(void *) * rmem->nr_pages, 0);
+	if (ctx_pg->ctx_pg_arr == NULL)
+		return -ENOMEM;
+
+	snprintf(name, RTE_MEMZONE_NAMESIZE, "bnxt_ctx_dma_arr%s_%x_%d",
+		 suffix, idx, bp->eth_dev->data->port_id);
+	ctx_pg->ctx_dma_arr = rte_zmalloc(name, sizeof(rte_iova_t *) * rmem->nr_pages, 0);
+	if (ctx_pg->ctx_dma_arr == NULL)
+		return -ENOMEM;
+
 	rmem->pg_arr = ctx_pg->ctx_pg_arr;
 	rmem->dma_arr = ctx_pg->ctx_dma_arr;
 	rmem->flags = BNXT_RMEM_VALID_PTE_FLAG;
@@ -4769,13 +4782,13 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
 	valid_bits = PTU_PTE_VALID;

 	if (rmem->nr_pages > 1) {
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		snprintf(name, RTE_MEMZONE_NAMESIZE,
 			 "bnxt_ctx_pg_tbl%s_%x_%d",
 			 suffix, idx, bp->eth_dev->data->port_id);
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
+		name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+		mz = rte_memzone_lookup(name);
 		if (!mz) {
-			mz = rte_memzone_reserve_aligned(mz_name,
+			mz = rte_memzone_reserve_aligned(name,
 						rmem->nr_pages * 8,
 						bp->eth_dev->device->numa_node,
 						RTE_MEMZONE_2MB |
@@ -4794,11 +4807,11 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
 		rmem->pg_tbl_mz = mz;
 	}

-	snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "bnxt_ctx_%s_%x_%d",
+	snprintf(name, RTE_MEMZONE_NAMESIZE, "bnxt_ctx_%s_%x_%d",
 		 suffix, idx, bp->eth_dev->data->port_id);
-	mz = rte_memzone_lookup(mz_name);
+	mz = rte_memzone_lookup(name);
 	if (!mz) {
-		mz = rte_memzone_reserve_aligned(mz_name,
+		mz = rte_memzone_reserve_aligned(name,
 						 mem_size,
 						 bp->eth_dev->device->numa_node,
 						 RTE_MEMZONE_1GB |
@@ -4844,6 +4857,17 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)
 		return;

 	bp->ctx->flags &= ~BNXT_CTX_FLAG_INITED;
+	rte_free(bp->ctx->qp_mem.ctx_pg_arr);
+	rte_free(bp->ctx->srq_mem.ctx_pg_arr);
+	rte_free(bp->ctx->cq_mem.ctx_pg_arr);
+	rte_free(bp->ctx->vnic_mem.ctx_pg_arr);
+	rte_free(bp->ctx->stat_mem.ctx_pg_arr);
+	rte_free(bp->ctx->qp_mem.ctx_dma_arr);
+	rte_free(bp->ctx->srq_mem.ctx_dma_arr);
+	rte_free(bp->ctx->cq_mem.ctx_dma_arr);
+	rte_free(bp->ctx->vnic_mem.ctx_dma_arr);
+	rte_free(bp->ctx->stat_mem.ctx_dma_arr);
+
 	rte_memzone_free(bp->ctx->qp_mem.ring_mem.mz);
 	rte_memzone_free(bp->ctx->srq_mem.ring_mem.mz);
 	rte_memzone_free(bp->ctx->cq_mem.ring_mem.mz);
@@ -4856,6 +4880,8 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)
 	rte_memzone_free(bp->ctx->stat_mem.ring_mem.pg_tbl_mz);

 	for (i = 0; i < bp->ctx->tqm_fp_rings_count + 1; i++) {
+		rte_free(bp->ctx->tqm_mem[i]->ctx_pg_arr);
+		rte_free(bp->ctx->tqm_mem[i]->ctx_dma_arr);
 		if (bp->ctx->tqm_mem[i])
 			rte_memzone_free(bp->ctx->tqm_mem[i]->ring_mem.mz);
 	}
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.356474212 +0800
+++ 0113-net-bnxt-fix-array-overflow.patch	2024-03-05 17:39:30.913566498 +0800
@@ -1 +1 @@
-From 4371b402c7bdbe821fff77e3c08e2faba67cb9b3 Mon Sep 17 00:00:00 2001
+From 3fa018b15a6329237d9dd5066a5fac3c3bb53652 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4371b402c7bdbe821fff77e3c08e2faba67cb9b3 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 50f59552fa..dd08393b82 100644
+index 0e01b1d4ba..aab09e3edf 100644
@@ -25 +27 @@
-@@ -455,8 +455,8 @@ struct bnxt_ring_mem_info {
+@@ -449,8 +449,8 @@ struct bnxt_ring_mem_info {
@@ -37 +39 @@
-index b0589e2e49..762d863f14 100644
+index acf7e6e46e..9e63942a0f 100644
@@ -40 +42 @@
-@@ -4769,7 +4769,7 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
+@@ -4750,7 +4750,7 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
@@ -49 +51 @@
-@@ -4781,6 +4781,19 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
+@@ -4762,6 +4762,19 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
@@ -69 +71 @@
-@@ -4788,13 +4801,13 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
+@@ -4769,13 +4782,13 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
@@ -87 +89 @@
-@@ -4813,11 +4826,11 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
+@@ -4794,11 +4807,11 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
@@ -102 +104 @@
-@@ -4863,6 +4876,17 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)
+@@ -4844,6 +4857,17 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)
@@ -120 +122 @@
-@@ -4875,6 +4899,8 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)
+@@ -4856,6 +4880,8 @@ static void bnxt_free_ctx_mem(struct bnxt *bp)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix 50G and 100G forced speed' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (112 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: fix array overflow' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: fix speed change from 200G to 25G on Thor' " Xueming Li
                   ` (22 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e1f8152ede3691aae1d920397e045f4edf8e0e79

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e1f8152ede3691aae1d920397e045f4edf8e0e79 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu, 16 Nov 2023 00:12:01 -0800
Subject: [PATCH] net/bnxt: fix 50G and 100G forced speed
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dd8d40bc8294ee1f5753205d14f37accc7a7debc ]

Thor based NICs can support PAM4 as well as NRZ link negotiation.
While PAM4 can negotiate speeds at 50G, 100G and 200G, the PMD will
use NRZ signaling for 50G and 100G speeds. PAM4 signaling will be
used only for 200G speed negotiations.

Driver has to check for NRZ speed support first while forcing speed.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 06f196760f..b6ce4fc5f0 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3039,6 +3039,8 @@ static uint16_t bnxt_check_eth_link_autoneg(uint32_t conf_link)
 static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
 					  struct bnxt_link_info *link_info)
 {
+	uint16_t support_pam4_speeds = link_info->support_pam4_speeds;
+	uint16_t support_speeds = link_info->support_speeds;
 	uint16_t eth_link_speed = 0;

 	if (conf_link_speed == RTE_ETH_LINK_SPEED_AUTONEG)
@@ -3076,23 +3078,23 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
 			HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_40GB;
 		break;
 	case RTE_ETH_LINK_SPEED_50G:
-		if (link_info->support_pam4_speeds &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G) {
-			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB;
-			link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
-		} else {
+		if (support_speeds & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_50GB) {
 			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_50GB;
 			link_info->link_signal_mode = BNXT_SIG_MODE_NRZ;
+		} else if (support_pam4_speeds &
+			   HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_50G) {
+			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_50GB;
+			link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
 		}
 		break;
 	case RTE_ETH_LINK_SPEED_100G:
-		if (link_info->support_pam4_speeds &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G) {
-			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB;
-			link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
-		} else {
+		if (support_speeds & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB) {
 			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_100GB;
 			link_info->link_signal_mode = BNXT_SIG_MODE_NRZ;
+		} else if (support_pam4_speeds &
+			   HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_PAM4_SPEEDS_100G) {
+			eth_link_speed = HWRM_PORT_PHY_CFG_INPUT_FORCE_PAM4_LINK_SPEED_100GB;
+			link_info->link_signal_mode = BNXT_SIG_MODE_PAM4;
 		}
 		break;
 	case RTE_ETH_LINK_SPEED_200G:
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.387615013 +0800
+++ 0114-net-bnxt-fix-50G-and-100G-forced-speed.patch	2024-03-05 17:39:30.923566498 +0800
@@ -1 +1 @@
-From dd8d40bc8294ee1f5753205d14f37accc7a7debc Mon Sep 17 00:00:00 2001
+From e1f8152ede3691aae1d920397e045f4edf8e0e79 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dd8d40bc8294ee1f5753205d14f37accc7a7debc ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 2ae0cb2067..8f37077522 100644
+index 06f196760f..b6ce4fc5f0 100644
@@ -27 +29 @@
-@@ -3158,6 +3158,8 @@ static uint16_t bnxt_check_eth_link_autoneg(uint32_t conf_link)
+@@ -3039,6 +3039,8 @@ static uint16_t bnxt_check_eth_link_autoneg(uint32_t conf_link)
@@ -36 +38 @@
-@@ -3195,23 +3197,23 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
+@@ -3076,23 +3078,23 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix speed change from 200G to 25G on Thor' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (113 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: fix 50G and 100G forced speed' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: fix backward firmware compatibility' " Xueming Li
                   ` (21 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Somnath Kotur, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1fb50b8baa45801c07841e5c4ea840790d6d970d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1fb50b8baa45801c07841e5c4ea840790d6d970d Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Sat, 4 Nov 2023 22:31:07 -0700
Subject: [PATCH] net/bnxt: fix speed change from 200G to 25G on Thor
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 753b8ff26162ffaf118c03e47ab75cfd2229d4e8 ]

While forcing speed to 200G, driver sets the structure variable
"bp->link_info->link_signal_mode" value to BNXT_SIG_MODE_PAM4.
After that when the user forces the speed back to 25G, this
cached value is not set back to BNXT_SIG_MODE_NRZ which results
in issuing the HWRM_PORT_PHY_CFG command with wrong inputs.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b6ce4fc5f0..d9ad361c6c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3072,6 +3072,7 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
 	case RTE_ETH_LINK_SPEED_25G:
 		eth_link_speed =
 			HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB;
+		link_info->link_signal_mode = BNXT_SIG_MODE_NRZ;
 		break;
 	case RTE_ETH_LINK_SPEED_40G:
 		eth_link_speed =
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.418147614 +0800
+++ 0115-net-bnxt-fix-speed-change-from-200G-to-25G-on-Thor.patch	2024-03-05 17:39:30.933566498 +0800
@@ -1 +1 @@
-From 753b8ff26162ffaf118c03e47ab75cfd2229d4e8 Mon Sep 17 00:00:00 2001
+From 1fb50b8baa45801c07841e5c4ea840790d6d970d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 753b8ff26162ffaf118c03e47ab75cfd2229d4e8 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 8f37077522..441e3aef51 100644
+index b6ce4fc5f0..d9ad361c6c 100644
@@ -26 +28 @@
-@@ -3191,6 +3191,7 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
+@@ -3072,6 +3072,7 @@ static uint16_t bnxt_parse_eth_link_speed(uint32_t conf_link_speed,
@@ -29 +31 @@
- 			HWRM_PORT_PHY_CFG_INPUT_FORCE_LINK_SPEED_25GB;
+ 			HWRM_PORT_PHY_CFG_INPUT_AUTO_LINK_SPEED_25GB;

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix backward firmware compatibility' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (114 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: fix speed change from 200G to 25G on Thor' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: modify locking for representor Tx' " Xueming Li
                   ` (20 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c26cb2a6440e50a23c799612306ae3b746f7b54a

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c26cb2a6440e50a23c799612306ae3b746f7b54a Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu, 7 Dec 2023 07:56:26 -0800
Subject: [PATCH] net/bnxt: fix backward firmware compatibility
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 589619999b0411a4266e335fe105e1c7cba6e02b ]

On older firmware versions, HWRM_FUNC_QCAPS response is not
returning the maximum number of multicast filters that can be
supported by the function. As a result, memory allocation with
size 0 fails.

Bugzilla ID: 1309

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      | 1 +
 drivers/net/bnxt/bnxt_hwrm.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index aab09e3edf..7908efba78 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -896,6 +896,7 @@ struct bnxt {
 	struct rte_ether_addr	*mcast_addr_list;
 	rte_iova_t		mc_list_dma_addr;
 	uint32_t		nb_mc_addr;
+#define BNXT_DFLT_MAX_MC_ADDR	16 /* for compatibility with older firmware */
 	uint32_t		max_mcast_addr; /* maximum number of mcast filters supported */

 	struct rte_eth_rss_conf	rss_conf; /* RSS configuration. */
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index d9ad361c6c..94c3249ae4 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -863,6 +863,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		    bp->max_l2_ctx, bp->max_vnics);
 	bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx);
 	bp->max_mcast_addr = rte_le_to_cpu_32(resp->max_mcast_filters);
+	if (!bp->max_mcast_addr)
+		bp->max_mcast_addr = BNXT_DFLT_MAX_MC_ADDR;
 	memcpy(bp->dsn, resp->device_serial_number, sizeof(bp->dsn));

 	if (BNXT_PF(bp))
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.447695315 +0800
+++ 0116-net-bnxt-fix-backward-firmware-compatibility.patch	2024-03-05 17:39:30.943566499 +0800
@@ -1 +1 @@
-From 589619999b0411a4266e335fe105e1c7cba6e02b Mon Sep 17 00:00:00 2001
+From c26cb2a6440e50a23c799612306ae3b746f7b54a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 589619999b0411a4266e335fe105e1c7cba6e02b ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 3290c57a72..4b8a691f80 100644
+index aab09e3edf..7908efba78 100644
@@ -25 +27 @@
-@@ -974,6 +974,7 @@ struct bnxt {
+@@ -896,6 +896,7 @@ struct bnxt {
@@ -34 +36 @@
-index 441e3aef51..9260bcb4cd 100644
+index d9ad361c6c..94c3249ae4 100644
@@ -37 +39 @@
-@@ -901,6 +901,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
+@@ -863,6 +863,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: modify locking for representor Tx' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (115 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: fix backward firmware compatibility' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/bnxt: fix deadlock in ULP timer callback' " Xueming Li
                   ` (19 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: Peter Spreadborough, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d9e1762f076530d7ffa47e0649fe4a2b4c53d609

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d9e1762f076530d7ffa47e0649fe4a2b4c53d609 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 8 Feb 2024 09:13:25 -0800
Subject: [PATCH] net/bnxt: modify locking for representor Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d46406c7070724c8cfd04b805849339d1178f528 ]

Currently the representor Tx function is synchronized using a per
device lock. But that is not sufficient when there is simultaneous
traffic on the parent Tx ring and the representor rings.
Moreover the representor Tx is not protected from incursions by the
parent transmits. This can cause parent Tx threads to crossover into
the representor Tx contexts. Prevent this by using per TxQ locking and
protect not just representor Tx, but also the parent Tx using the lock.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  1 -
 drivers/net/bnxt/bnxt_ethdev.c | 11 +----------
 drivers/net/bnxt/bnxt_reps.c   |  6 +++---
 drivers/net/bnxt/bnxt_txq.c    |  6 ++++++
 drivers/net/bnxt/bnxt_txq.h    |  1 +
 drivers/net/bnxt/bnxt_txr.c    | 13 +++++++++++++
 drivers/net/bnxt/bnxt_txr.h    |  4 +++-
 7 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 7908efba78..be2fd689bb 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -550,7 +550,6 @@ struct bnxt_mark_info {

 struct bnxt_rep_info {
 	struct rte_eth_dev	*vfr_eth_dev;
-	pthread_mutex_t		vfr_lock;
 	pthread_mutex_t		vfr_start_lock;
 	bool			conduit_valid;
 };
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 9e63942a0f..0fc561d258 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1673,10 +1673,8 @@ bnxt_uninit_locks(struct bnxt *bp)
 	pthread_mutex_destroy(&bp->def_cp_lock);
 	pthread_mutex_destroy(&bp->health_check_lock);
 	pthread_mutex_destroy(&bp->err_recovery_lock);
-	if (bp->rep_info) {
-		pthread_mutex_destroy(&bp->rep_info->vfr_lock);
+	if (bp->rep_info)
 		pthread_mutex_destroy(&bp->rep_info->vfr_start_lock);
-	}
 }

 static void bnxt_drv_uninit(struct bnxt *bp)
@@ -6199,13 +6197,6 @@ static int bnxt_init_rep_info(struct bnxt *bp)
 	for (i = 0; i < BNXT_MAX_CFA_CODE; i++)
 		bp->cfa_code_map[i] = BNXT_VF_IDX_INVALID;

-	rc = pthread_mutex_init(&bp->rep_info->vfr_lock, NULL);
-	if (rc) {
-		PMD_DRV_LOG(ERR, "Unable to initialize vfr_lock\n");
-		bnxt_free_rep_info(bp);
-		return rc;
-	}
-
 	rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
 	if (rc) {
 		PMD_DRV_LOG(ERR, "Unable to initialize vfr_start_lock\n");
diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index 78337431af..a15f993328 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -124,8 +124,8 @@ bnxt_rep_tx_burst(void *tx_queue,
 	qid = vfr_txq->txq->queue_id;
 	vf_rep_bp = vfr_txq->bp;
 	parent = vf_rep_bp->parent_dev->data->dev_private;
-	pthread_mutex_lock(&parent->rep_info->vfr_lock);
 	ptxq = parent->tx_queues[qid];
+	pthread_mutex_lock(&ptxq->txq_lock);

 	ptxq->vfr_tx_cfa_action = vf_rep_bp->vfr_tx_cfa_action;

@@ -134,9 +134,9 @@ bnxt_rep_tx_burst(void *tx_queue,
 		vf_rep_bp->tx_pkts[qid]++;
 	}

-	rc = bnxt_xmit_pkts(ptxq, tx_pkts, nb_pkts);
+	rc = _bnxt_xmit_pkts(ptxq, tx_pkts, nb_pkts);
 	ptxq->vfr_tx_cfa_action = 0;
-	pthread_mutex_unlock(&parent->rep_info->vfr_lock);
+	pthread_mutex_unlock(&ptxq->txq_lock);

 	return rc;
 }
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index 4df4604975..696603757b 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -112,6 +112,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
 		txq->mz = NULL;

 		rte_free(txq->free);
+		pthread_mutex_destroy(&txq->txq_lock);
 		rte_free(txq);
 		dev->data->tx_queues[queue_idx] = NULL;
 	}
@@ -195,6 +196,11 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 		goto err;
 	}

+	rc = pthread_mutex_init(&txq->txq_lock, NULL);
+	if (rc != 0) {
+		PMD_DRV_LOG(ERR, "TxQ mutex init failed!");
+		goto err;
+	}
 	return 0;
 err:
 	bnxt_tx_queue_release_op(eth_dev, queue_idx);
diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h
index 3a483ad5c3..9e54985c4c 100644
--- a/drivers/net/bnxt/bnxt_txq.h
+++ b/drivers/net/bnxt/bnxt_txq.h
@@ -26,6 +26,7 @@ struct bnxt_tx_queue {
 	int			index;
 	int			tx_wake_thresh;
 	uint32_t		vfr_tx_cfa_action;
+	pthread_mutex_t		txq_lock;
 	struct bnxt_tx_ring_info	*tx_ring;

 	unsigned int		cp_nr_rings;
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 899986764f..cef14427a8 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -562,6 +562,19 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)

 uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts)
+{
+	struct bnxt_tx_queue *txq = tx_queue;
+	uint16_t rc;
+
+	pthread_mutex_lock(&txq->txq_lock);
+	rc = _bnxt_xmit_pkts(tx_queue, tx_pkts, nb_pkts);
+	pthread_mutex_unlock(&txq->txq_lock);
+
+	return rc;
+}
+
+uint16_t _bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+			 uint16_t nb_pkts)
 {
 	int rc;
 	uint16_t nb_tx_pkts = 0;
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index e64ea2c7d1..09078d545d 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -47,7 +47,9 @@ void bnxt_free_tx_rings(struct bnxt *bp);
 int bnxt_init_one_tx_ring(struct bnxt_tx_queue *txq);
 int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id);
 uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
-			       uint16_t nb_pkts);
+			uint16_t nb_pkts);
+uint16_t _bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+			 uint16_t nb_pkts);
 #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.477923716 +0800
+++ 0117-net-bnxt-modify-locking-for-representor-Tx.patch	2024-03-05 17:39:30.953566499 +0800
@@ -1 +1 @@
-From d46406c7070724c8cfd04b805849339d1178f528 Mon Sep 17 00:00:00 2001
+From d9e1762f076530d7ffa47e0649fe4a2b4c53d609 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d46406c7070724c8cfd04b805849339d1178f528 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -30 +32 @@
-index b604284256..23b0829e9e 100644
+index 7908efba78..be2fd689bb 100644
@@ -33 +35 @@
-@@ -623,7 +623,6 @@ struct bnxt_mark_info {
+@@ -550,7 +550,6 @@ struct bnxt_mark_info {
@@ -42 +44 @@
-index 74064e8971..72debaca64 100644
+index 9e63942a0f..0fc561d258 100644
@@ -45 +47 @@
-@@ -1802,10 +1802,8 @@ bnxt_uninit_locks(struct bnxt *bp)
+@@ -1673,10 +1673,8 @@ bnxt_uninit_locks(struct bnxt *bp)
@@ -57 +59 @@
-@@ -6523,13 +6521,6 @@ static int bnxt_init_rep_info(struct bnxt *bp)
+@@ -6199,13 +6197,6 @@ static int bnxt_init_rep_info(struct bnxt *bp)
@@ -72 +74 @@
-index d96d972904..3a4720bc3c 100644
+index 78337431af..a15f993328 100644
@@ -98 +100 @@
-index 7d91e88c9d..05032f7807 100644
+index 4df4604975..696603757b 100644
@@ -101 +103 @@
-@@ -114,6 +114,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
+@@ -112,6 +112,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
@@ -109 +111 @@
-@@ -197,6 +198,11 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
+@@ -195,6 +196,11 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
@@ -134 +136 @@
-index d74d271d91..7fc44e989d 100644
+index 899986764f..cef14427a8 100644
@@ -137 +139 @@
-@@ -567,6 +567,19 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)
+@@ -562,6 +562,19 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix deadlock in ULP timer callback' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (116 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: modify locking for representor Tx' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'ml/cnxk: fix xstats calculation' " Xueming Li
                   ` (18 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Weiguo Li; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a77f545bd7ebc03a2bd8f7457ea4c76ce0e42f1f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a77f545bd7ebc03a2bd8f7457ea4c76ce0e42f1f Mon Sep 17 00:00:00 2001
From: Weiguo Li <liweiguo@xencore.cn>
Date: Sat, 4 Nov 2023 12:06:58 +0800
Subject: [PATCH] net/bnxt: fix deadlock in ULP timer callback
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 81132be766f57ad39a7fe0ad86717b9618e60889 ]

The function 'ulp_ha_mgr_timer_cb' acquires a lock on the context
entry at the beginning with bnxt_ulp_cntxt_entry_acquire(). This lock
is expected to be released by bnxt_ulp_cntxt_entry_release() at the
end of the function.

However, the second early return statement in the function could
potentially bypass the lock release. To fix this issue, add
bnxt_ulp_cntxt_entry_release() before the return statement.

Fixes: 1993b267dbcb ("net/bnxt: cleanup ULP parser and mapper")

Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c
index f3f5bda890..852deef3b4 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c
@@ -253,6 +253,7 @@ ulp_ha_mgr_timer_cb(void *arg)

 	myclient_cnt = bnxt_ulp_cntxt_num_shared_clients_get(ulp_ctx);
 	if (myclient_cnt == 0) {
+		bnxt_ulp_cntxt_entry_release();
 		BNXT_TF_DBG(ERR,
 			    "PANIC Client Count is zero kill timer\n.");
 		return;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.509691217 +0800
+++ 0118-net-bnxt-fix-deadlock-in-ULP-timer-callback.patch	2024-03-05 17:39:30.953566499 +0800
@@ -1 +1 @@
-From 81132be766f57ad39a7fe0ad86717b9618e60889 Mon Sep 17 00:00:00 2001
+From a77f545bd7ebc03a2bd8f7457ea4c76ce0e42f1f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 81132be766f57ad39a7fe0ad86717b9618e60889 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'ml/cnxk: fix xstats calculation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (117 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/bnxt: fix deadlock in ULP timer callback' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/cnxk: fix flow RSS configuration' " Xueming Li
                   ` (17 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Anup Prabhu; +Cc: Srikanth Yalavarthi, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f047cea92658f8a247f99e8fe59c604db857a628

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f047cea92658f8a247f99e8fe59c604db857a628 Mon Sep 17 00:00:00 2001
From: Anup Prabhu <aprabhu@marvell.com>
Date: Tue, 28 Nov 2023 06:04:00 -0800
Subject: [PATCH] ml/cnxk: fix xstats calculation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 59ee1e574bd6106100175017807f2242a080fc2a ]

Exclude the hardware and firmware latency of model data
caching run from xstats calculation.

Fixes: 9cfad6c334f2 ("ml/cnxk: update device and model xstats functions")

Signed-off-by: Anup Prabhu <aprabhu@marvell.com>
Acked-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 7f7e5efcea..5370038733 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -288,6 +288,7 @@ cn10k_ml_model_xstat_get(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *l
 static int
 cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer)
 {
+	struct cn10k_ml_layer_xstats *xstats;
 	char str[RTE_MEMZONE_NAMESIZE];
 	const struct plt_memzone *mz;
 	uint64_t isize = 0;
@@ -309,6 +310,16 @@ cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *
 				      PLT_PTR_ADD(mz->addr, isize), 1);
 	plt_memzone_free(mz);

+	/* Reset sync xstats. */
+	xstats = layer->glow.sync_xstats;
+	xstats->hw_latency_tot = 0;
+	xstats->hw_latency_min = UINT64_MAX;
+	xstats->hw_latency_max = 0;
+	xstats->fw_latency_tot = 0;
+	xstats->fw_latency_min = UINT64_MAX;
+	xstats->fw_latency_max = 0;
+	xstats->dequeued_count = 0;
+
 	return ret;
 }

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.534182918 +0800
+++ 0119-ml-cnxk-fix-xstats-calculation.patch	2024-03-05 17:39:30.953566499 +0800
@@ -1 +1 @@
-From 59ee1e574bd6106100175017807f2242a080fc2a Mon Sep 17 00:00:00 2001
+From f047cea92658f8a247f99e8fe59c604db857a628 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 59ee1e574bd6106100175017807f2242a080fc2a ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix flow RSS configuration' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (118 preceding siblings ...)
  2024-03-05  9:47 ` patch 'ml/cnxk: fix xstats calculation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/thunderx: fix DMAC control register update' " Xueming Li
                   ` (16 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Kiran Kumar K; +Cc: Satheesh Paul, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=874fd2886685566630c7715424a6ad7961928182

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 874fd2886685566630c7715424a6ad7961928182 Mon Sep 17 00:00:00 2001
From: Kiran Kumar K <kirankumark@marvell.com>
Date: Fri, 15 Dec 2023 12:15:43 +0530
Subject: [PATCH] net/cnxk: fix flow RSS configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 752ce2f3e5bf7bd8add8dc9629f3b824886c641e ]

While creating a RSS rule, if no RSS types are specified,
use RSS types from dev config.

Fixes: bc778a17fa46 ("net/cnxk: support flow RSS")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/net/cnxk/cnxk_flow.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c
index 08ab75e2bb..800ae5d1df 100644
--- a/drivers/net/cnxk/cnxk_flow.c
+++ b/drivers/net/cnxk/cnxk_flow.c
@@ -102,15 +102,19 @@ npc_rss_action_validate(struct rte_eth_dev *eth_dev,
 }

 static void
-npc_rss_flowkey_get(struct cnxk_eth_dev *eth_dev,
-		    const struct roc_npc_action *rss_action,
-		    uint32_t *flowkey_cfg)
+npc_rss_flowkey_get(struct cnxk_eth_dev *eth_dev, const struct roc_npc_action *rss_action,
+		    uint32_t *flowkey_cfg, uint64_t default_rss_types)
 {
 	const struct roc_npc_action_rss *rss;
+	uint64_t rss_types;

 	rss = (const struct roc_npc_action_rss *)rss_action->conf;
+	rss_types = rss->types;
+	/* If no RSS types are specified, use default one */
+	if (rss_types == 0)
+		rss_types = default_rss_types;

-	*flowkey_cfg = cnxk_rss_ethdev_to_nix(eth_dev, rss->types, rss->level);
+	*flowkey_cfg = cnxk_rss_ethdev_to_nix(eth_dev, rss_types, rss->level);
 }

 static int
@@ -204,7 +208,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 				goto err_exit;
 			in_actions[i].type = ROC_NPC_ACTION_TYPE_RSS;
 			in_actions[i].conf = actions->conf;
-			npc_rss_flowkey_get(dev, &in_actions[i], flowkey_cfg);
+			npc_rss_flowkey_get(dev, &in_actions[i], flowkey_cfg,
+					    eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf);
 			break;

 		case RTE_FLOW_ACTION_TYPE_SECURITY:
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.559748519 +0800
+++ 0120-net-cnxk-fix-flow-RSS-configuration.patch	2024-03-05 17:39:30.953566499 +0800
@@ -1 +1 @@
-From 752ce2f3e5bf7bd8add8dc9629f3b824886c641e Mon Sep 17 00:00:00 2001
+From 874fd2886685566630c7715424a6ad7961928182 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 752ce2f3e5bf7bd8add8dc9629f3b824886c641e ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 11670d37e0..a92b61c332 100644
+index 08ab75e2bb..800ae5d1df 100644
@@ -22 +24 @@
-@@ -103,15 +103,19 @@ npc_rss_action_validate(struct rte_eth_dev *eth_dev, const struct rte_flow_attr
+@@ -102,15 +102,19 @@ npc_rss_action_validate(struct rte_eth_dev *eth_dev,
@@ -46 +48 @@
-@@ -293,7 +297,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
+@@ -204,7 +208,8 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/thunderx: fix DMAC control register update' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (119 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/cnxk: fix flow RSS configuration' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'common/cnxk: fix mbox region copy' " Xueming Li
                   ` (15 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Hanumanth Pothula; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0e5798d30b0a7c87e4c43a554d798d7799cf6824

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0e5798d30b0a7c87e4c43a554d798d7799cf6824 Mon Sep 17 00:00:00 2001
From: Hanumanth Pothula <hpothula@marvell.com>
Date: Thu, 21 Dec 2023 16:49:59 +0530
Subject: [PATCH] net/thunderx: fix DMAC control register update
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 44a8635459cbc83cde94b64971faee34ca9be19d ]

By default dmac control register is set to reject packets
on mac address match, leading all unicast packets to drop.
Update DMAC control register to allow packets on MAC address
match rather than dropping.

Fixes: e438796617dc ("net/thunderx: add PMD skeleton")

Signed-off-by: Hanumanth Pothula <hpothula@marvell.com>
---
 drivers/net/thunderx/base/nicvf_mbox.c | 12 ++++++++++++
 drivers/net/thunderx/base/nicvf_mbox.h | 10 ++++++++++
 drivers/net/thunderx/nicvf_ethdev.c    | 26 ++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/drivers/net/thunderx/base/nicvf_mbox.c b/drivers/net/thunderx/base/nicvf_mbox.c
index 5993eec4e6..0e0176974d 100644
--- a/drivers/net/thunderx/base/nicvf_mbox.c
+++ b/drivers/net/thunderx/base/nicvf_mbox.c
@@ -485,3 +485,15 @@ nicvf_mbox_reset_xcast(struct nicvf *nic)
 	mbx.msg.msg = NIC_MBOX_MSG_RESET_XCAST;
 	nicvf_mbox_send_msg_to_pf(nic, &mbx);
 }
+
+int
+nicvf_mbox_set_xcast(struct nicvf *nic, uint8_t  mode, uint64_t mac)
+{
+	struct nic_mbx mbx = { .msg = { 0 } };
+
+	mbx.xcast.msg = NIC_MBOX_MSG_SET_XCAST;
+	mbx.xcast.mode = mode;
+	mbx.xcast.mac = mac;
+
+	return nicvf_mbox_send_msg_to_pf(nic, &mbx);
+}
diff --git a/drivers/net/thunderx/base/nicvf_mbox.h b/drivers/net/thunderx/base/nicvf_mbox.h
index 322c8159cb..47f3d13755 100644
--- a/drivers/net/thunderx/base/nicvf_mbox.h
+++ b/drivers/net/thunderx/base/nicvf_mbox.h
@@ -45,6 +45,8 @@
 #define	NIC_MBOX_MSG_CFG_DONE		0xF0	/* VF configuration done */
 #define	NIC_MBOX_MSG_SHUTDOWN		0xF1	/* VF is being shutdown */
 #define NIC_MBOX_MSG_RESET_XCAST	0xF2    /* Reset DCAM filtering mode */
+#define	NIC_MBOX_MSG_ADD_MCAST		0xF3	/* ADD MAC to DCAM filters */
+#define	NIC_MBOX_MSG_SET_XCAST		0xF4	/* Set MCAST/BCAST Rx mode */
 #define	NIC_MBOX_MSG_MAX		0x100	/* Maximum number of messages */

 /* Get vNIC VF configuration */
@@ -190,6 +192,12 @@ struct change_link_mode_msg {

 };

+struct xcast {
+	uint8_t    msg;
+	uint8_t    mode;
+	uint64_t   mac:48;
+};
+
 struct nic_mbx {
 /* 128 bit shared memory between PF and each VF */
 union {
@@ -209,6 +217,7 @@ union {
 	struct reset_stat_cfg	reset_stat;
 	struct set_link_state	set_link;
 	struct change_link_mode_msg mode;
+	struct xcast xcast;
 };
 };

@@ -239,5 +248,6 @@ void nicvf_mbox_cfg_done(struct nicvf *nic);
 void nicvf_mbox_link_change(struct nicvf *nic);
 void nicvf_mbox_reset_xcast(struct nicvf *nic);
 int nicvf_mbox_change_mode(struct nicvf *nic, struct change_link_mode *cfg);
+int nicvf_mbox_set_xcast(struct nicvf *nic, uint8_t  mode, uint64_t mac);

 #endif /* __THUNDERX_NICVF_MBOX__ */
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 5a0c3dc4a6..ba2ef4058e 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -58,6 +58,10 @@ RTE_LOG_REGISTER_SUFFIX(nicvf_logtype_driver, driver, NOTICE);
 #define NICVF_QLM_MODE_SGMII  7
 #define NICVF_QLM_MODE_XFI   12

+#define BCAST_ACCEPT      0x01
+#define CAM_ACCEPT        (1 << 3)
+#define BGX_MCAST_MODE(x) ((x) << 1)
+
 enum nicvf_link_speed {
 	NICVF_LINK_SPEED_SGMII,
 	NICVF_LINK_SPEED_XAUI,
@@ -2185,9 +2189,22 @@ nicvf_eth_dev_uninit(struct rte_eth_dev *dev)
 	nicvf_dev_close(dev);
 	return 0;
 }
+
+static inline uint64_t ether_addr_to_u64(uint8_t *addr)
+{
+	uint64_t u = 0;
+	int i;
+
+	for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+		u = u << 8 | addr[i];
+
+	return u;
+}
+
 static int
 nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
 {
+	uint8_t dmac_ctrl_reg = 0;
 	int ret;
 	struct rte_pci_device *pci_dev;
 	struct nicvf *nic = nicvf_pmd_priv(eth_dev);
@@ -2311,6 +2328,15 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
 		goto malloc_fail;
 	}

+	/* set DMAC CTRL reg to allow MAC */
+	dmac_ctrl_reg = BCAST_ACCEPT | BGX_MCAST_MODE(2) | CAM_ACCEPT;
+	ret = nicvf_mbox_set_xcast(nic, dmac_ctrl_reg,
+			ether_addr_to_u64(nic->mac_addr));
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Failed to set mac addr");
+		goto malloc_fail;
+	}
+
 	ret = nicvf_set_first_skip(eth_dev);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "Failed to configure first skip");
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.599785720 +0800
+++ 0121-net-thunderx-fix-DMAC-control-register-update.patch	2024-03-05 17:39:30.963566499 +0800
@@ -1 +1 @@
-From 44a8635459cbc83cde94b64971faee34ca9be19d Mon Sep 17 00:00:00 2001
+From 0e5798d30b0a7c87e4c43a554d798d7799cf6824 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 44a8635459cbc83cde94b64971faee34ca9be19d ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -83 +85 @@
-index ddcc52770e..609d95dcfa 100644
+index 5a0c3dc4a6..ba2ef4058e 100644
@@ -97 +99 @@
-@@ -2182,9 +2186,22 @@ nicvf_eth_dev_uninit(struct rte_eth_dev *dev)
+@@ -2185,9 +2189,22 @@ nicvf_eth_dev_uninit(struct rte_eth_dev *dev)
@@ -120 +122 @@
-@@ -2308,6 +2325,15 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)
+@@ -2311,6 +2328,15 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix mbox region copy' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (120 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/thunderx: fix DMAC control register update' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'common/cnxk: fix VLAN check for inner header' " Xueming Li
                   ` (14 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=4f69dab88c41f1db915ceac639e8585563a69771

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4f69dab88c41f1db915ceac639e8585563a69771 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Thu, 21 Dec 2023 12:08:10 +0530
Subject: [PATCH] common/cnxk: fix mbox region copy
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4590d008892ce8a2d17ee7f1ed3fb10204a809e4 ]

Using proper API to perform copy to mbox device memory region

Fixes: 02719901d50f ("common/cnxk: send link status event to VF")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_dev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index e7e89bf3d6..084343c3b4 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -198,9 +198,8 @@ af_pf_wait_msg(struct dev *dev, uint16_t vf, int num_msg)
 			vf_msg = mbox_alloc_msg(&dev->mbox_vfpf_up, vf, sz);
 			if (vf_msg) {
 				mbox_req_init(MBOX_MSG_CGX_LINK_EVENT, vf_msg);
-				memcpy((uint8_t *)vf_msg +
-				       sizeof(struct mbox_msghdr), &linfo,
-				       sizeof(struct cgx_link_user_info));
+				mbox_memcpy((uint8_t *)vf_msg + sizeof(struct mbox_msghdr), &linfo,
+					    sizeof(struct cgx_link_user_info));

 				vf_msg->rc = msg->rc;
 				vf_msg->pcifunc = msg->pcifunc;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.635513821 +0800
+++ 0122-common-cnxk-fix-mbox-region-copy.patch	2024-03-05 17:39:30.963566499 +0800
@@ -1 +1 @@
-From 4590d008892ce8a2d17ee7f1ed3fb10204a809e4 Mon Sep 17 00:00:00 2001
+From 4f69dab88c41f1db915ceac639e8585563a69771 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4590d008892ce8a2d17ee7f1ed3fb10204a809e4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix VLAN check for inner header' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (121 preceding siblings ...)
  2024-03-05  9:47 ` patch 'common/cnxk: fix mbox region copy' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/cnxk: fix aged flow query' " Xueming Li
                   ` (13 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ecdb679c52824c52c0a652a7c0e2936973be8730

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ecdb679c52824c52c0a652a7c0e2936973be8730 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Thu, 21 Dec 2023 12:08:11 +0530
Subject: [PATCH] common/cnxk: fix VLAN check for inner header
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4f52aafa5901e653e536eb3126b818d78d7be1bc ]

Adding the has vlan check in inner headers i.e in LF layer. If
has_vlan is 0 it should be masked out while installing flow rule.

Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_npc_parse.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index ecd1b3e13b..3c288070fb 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -1092,6 +1092,7 @@ npc_parse_lf(struct npc_parse_state *pst)
 {
 	const struct roc_npc_item_info *pattern, *last_pattern;
 	char hw_mask[NPC_MAX_EXTRACT_HW_LEN];
+	const struct roc_npc_flow_item_eth *eth_item;
 	struct npc_parse_item_info info;
 	int lid, lt, lflags;
 	int nr_vlans = 0;
@@ -1108,10 +1109,12 @@ npc_parse_lf(struct npc_parse_state *pst)
 	lt = NPC_LT_LF_TU_ETHER;
 	lflags = 0;

+	eth_item = pst->pattern->spec;
+
 	/* No match support for vlan tags */
 	info.def_mask = NULL;
 	info.hw_mask = NULL;
-	info.len = pst->pattern->size;
+	info.len = sizeof(eth_item->hdr);
 	info.spec = NULL;
 	info.mask = NULL;
 	info.hw_hdr_len = 0;
@@ -1142,12 +1145,15 @@ npc_parse_lf(struct npc_parse_state *pst)
 	}

 	info.hw_mask = &hw_mask;
-	info.len = pst->pattern->size;
+	info.len = sizeof(eth_item->hdr);
 	info.hw_hdr_len = 0;
 	npc_get_hw_supp_mask(pst, &info, lid, lt);
 	info.spec = NULL;
 	info.mask = NULL;

+	if (eth_item && eth_item->has_vlan)
+		pst->set_vlan_ltype_mask = true;
+
 	rc = npc_parse_item_basic(pst->pattern, &info);
 	if (rc != 0)
 		return rc;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.663285022 +0800
+++ 0123-common-cnxk-fix-VLAN-check-for-inner-header.patch	2024-03-05 17:39:30.963566499 +0800
@@ -1 +1 @@
-From 4f52aafa5901e653e536eb3126b818d78d7be1bc Mon Sep 17 00:00:00 2001
+From ecdb679c52824c52c0a652a7c0e2936973be8730 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4f52aafa5901e653e536eb3126b818d78d7be1bc ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 9ceb707ebb..571d6b8e5d 100644
+index ecd1b3e13b..3c288070fb 100644
@@ -21 +23 @@
-@@ -1097,6 +1097,7 @@ npc_parse_lf(struct npc_parse_state *pst)
+@@ -1092,6 +1092,7 @@ npc_parse_lf(struct npc_parse_state *pst)
@@ -29 +31 @@
-@@ -1113,10 +1114,12 @@ npc_parse_lf(struct npc_parse_state *pst)
+@@ -1108,10 +1109,12 @@ npc_parse_lf(struct npc_parse_state *pst)
@@ -43 +45 @@
-@@ -1147,12 +1150,15 @@ npc_parse_lf(struct npc_parse_state *pst)
+@@ -1142,12 +1145,15 @@ npc_parse_lf(struct npc_parse_state *pst)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix aged flow query' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (122 preceding siblings ...)
  2024-03-05  9:47 ` patch 'common/cnxk: fix VLAN check for inner header' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: fix jump action validation' " Xueming Li
                   ` (12 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Kiran Kumar K, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=01c5db8d99fd3dc101cf9e6ebacbb6c150467529

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 01c5db8d99fd3dc101cf9e6ebacbb6c150467529 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Fri, 2 Feb 2024 10:51:37 +0530
Subject: [PATCH] net/cnxk: fix aged flow query
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4ebef525d40d74ca66b8d444ff154739ecc0908d ]

After all aged flows are destroyed, the aged_flows bitmap
is free-ed. Querying aged flows tries to access this bitmap
resulting in a segmentation fault. Fixing this by not accessing
the bitmap if no aged flows are present.

Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc_aging.c | 4 ++++
 drivers/net/cnxk/cnxk_flow.c        | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/roc_npc_aging.c
index 254dd2139b..e0f2dc2291 100644
--- a/drivers/common/cnxk/roc_npc_aging.c
+++ b/drivers/common/cnxk/roc_npc_aging.c
@@ -234,8 +234,11 @@ npc_age_flow_list_entry_delete(struct roc_npc *roc_npc,
 {
 	struct npc *npc = roc_npc_to_npc_priv(roc_npc);
 	struct npc_age_flow_list_head *list;
+	struct roc_npc_flow_age *flow_age;
 	struct npc_age_flow_entry *curr;

+	flow_age = &roc_npc->flow_age;
+
 	list = &npc->age_flow_list;
 	curr = TAILQ_FIRST(list);

@@ -244,6 +247,7 @@ npc_age_flow_list_entry_delete(struct roc_npc *roc_npc,

 	while (curr) {
 		if (flow->mcam_id == curr->flow->mcam_id) {
+			plt_bitmap_clear(flow_age->aged_flows, flow->mcam_id);
 			TAILQ_REMOVE(list, curr, next);
 			plt_free(curr);
 			break;
diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c
index 800ae5d1df..be0330fa04 100644
--- a/drivers/net/cnxk/cnxk_flow.c
+++ b/drivers/net/cnxk/cnxk_flow.c
@@ -508,6 +508,9 @@ cnxk_flow_get_aged_flows(struct rte_eth_dev *eth_dev, void **context,

 	flow_age = &roc_npc->flow_age;

+	if (!flow_age->age_flow_refcnt)
+		return 0;
+
 	do {
 		sn = plt_seqcount_read_begin(&flow_age->seq_cnt);

--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.689993023 +0800
+++ 0124-net-cnxk-fix-aged-flow-query.patch	2024-03-05 17:39:30.963566499 +0800
@@ -1 +1 @@
-From 4ebef525d40d74ca66b8d444ff154739ecc0908d Mon Sep 17 00:00:00 2001
+From 01c5db8d99fd3dc101cf9e6ebacbb6c150467529 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4ebef525d40d74ca66b8d444ff154739ecc0908d ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -46 +48 @@
-index a92b61c332..4deccd1a67 100644
+index 800ae5d1df..be0330fa04 100644
@@ -49 +51 @@
-@@ -616,6 +616,9 @@ cnxk_flow_get_aged_flows(struct rte_eth_dev *eth_dev, void **context,
+@@ -508,6 +508,9 @@ cnxk_flow_get_aged_flows(struct rte_eth_dev *eth_dev, void **context,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix jump action validation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (123 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/cnxk: fix aged flow query' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: fix flow tag modification' " Xueming Li
                   ` (11 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7c8f2e719a182fea1576fe02f9d2e57ef3e17830

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7c8f2e719a182fea1576fe02f9d2e57ef3e17830 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Mon, 27 Nov 2023 14:42:59 +0200
Subject: [PATCH] net/mlx5: fix jump action validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9c289272ae692bd03d1dc9726ef19785beedd313 ]

Currently PMD doesn't allow to jump to the same group in order to
avoid dead loop. But this also prevent experienced user to create
flow with less Hops in order to have better performance.

For example, rules in [1] should have better performance then [2].

Furthermore, this protection will not really prevent dead loop, i.e
[3]. So just remove this protection and user should take the
responsibility to avoid dead loop.

This patch enables jumping to the same group.

[1]:
flow create 0 group 1 priority 1 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 1 / end
flow create 0 group 1 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[2]:
flow create 0 group 1 priority 0 pattern eth / ipv4 / udp / gtp / end
actions raw_decap / raw_encap / jump group 2 / end
flow create 0 group 2 priority 0 pattern eth / ipv4 src is 1.0.0.1 / tcp
/ end actions queues index 1 / end

[3]:
flow create 0 group 1 pattern eth / end actions jump group 2 / end
flow create 0 group 2 pattern eth / end actions jump group 1 / end

Fixes: f78f747f41d0 ("net/mlx5: allow jump to group lower than current")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 115d730317..5d0cb4278b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5484,13 +5484,6 @@ flow_dv_validate_action_jump(struct rte_eth_dev *dev,
 				       &grp_info, error);
 	if (ret)
 		return ret;
-	if (attributes->group == target_group &&
-	    !(action_flags & (MLX5_FLOW_ACTION_TUNNEL_SET |
-			      MLX5_FLOW_ACTION_TUNNEL_MATCH)))
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
-					  "target group must be other than"
-					  " the current flow group");
 	if (table == 0)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.716128724 +0800
+++ 0125-net-mlx5-fix-jump-action-validation.patch	2024-03-05 17:39:30.983566500 +0800
@@ -1 +1 @@
-From 9c289272ae692bd03d1dc9726ef19785beedd313 Mon Sep 17 00:00:00 2001
+From 7c8f2e719a182fea1576fe02f9d2e57ef3e17830 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9c289272ae692bd03d1dc9726ef19785beedd313 ]
@@ -35 +37,0 @@
-Cc: stable@dpdk.org
@@ -44 +46 @@
-index 52620be262..f881dae6e8 100644
+index 115d730317..5d0cb4278b 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix flow tag modification' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (124 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: fix jump action validation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5/hws: fix ESP flow matching validation' " Xueming Li
                   ` (10 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d25716a8a02dc5568f26c3cdae8705c447d12bff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d25716a8a02dc5568f26c3cdae8705c447d12bff Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Mon, 27 Nov 2023 18:01:02 +0200
Subject: [PATCH] net/mlx5: fix flow tag modification
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b9427fe259ac687c3a29f5c13b63945c16a283db ]

When MPLS modification support was added [1], the "tag_index" field was
added into "rte_flow_action_modify_data" structure.
As part of this change, the "RTE_FLOW_FIELD_TAG" type moved to use it
for tag array instead of using "level" field.
Using "level" is still supported for backwards compatibility when
"tag_index" field is zero.

The "mlx5_flow_field_id_to_modify_info()" function calls
"flow_hw_get_reg_id()" function with "level" without checking first
whether "tag_index" field is valid.

This patch calls first to "flow_tag_index_get()" function to get the
index before sending it to "flow_hw_get_reg_id()" function.

[1] commit c23626f27b09 ("ethdev: add MPLS header modification")

Fixes: 04e740e69512 ("net/mlx5: separate registers usage per port")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 5d0cb4278b..cea94e889d 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1925,7 +1925,7 @@ mlx5_flow_field_id_to_modify_info
 			if (priv->sh->config.dv_flow_en == 2)
 				reg = flow_hw_get_reg_id(dev,
 							 RTE_FLOW_ITEM_TYPE_TAG,
-							 data->level);
+							 tag_index);
 			else
 				reg = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG,
 							   tag_index, error);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.753047825 +0800
+++ 0126-net-mlx5-fix-flow-tag-modification.patch	2024-03-05 17:39:31.013566501 +0800
@@ -1 +1 @@
-From b9427fe259ac687c3a29f5c13b63945c16a283db Mon Sep 17 00:00:00 2001
+From d25716a8a02dc5568f26c3cdae8705c447d12bff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b9427fe259ac687c3a29f5c13b63945c16a283db ]
@@ -23 +25,0 @@
-Cc: stable@dpdk.org
@@ -32 +34 @@
-index f881dae6e8..60fbdd96e6 100644
+index 5d0cb4278b..cea94e889d 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: fix ESP flow matching validation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (125 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: fix flow tag modification' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE TLV option management' " Xueming Li
                   ` (9 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Hamdan Igbaria, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c3eb8629791a10fafd439fe040bc18bc83965891

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c3eb8629791a10fafd439fe040bc18bc83965891 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Mon, 15 Jan 2024 14:09:39 +0200
Subject: [PATCH] net/mlx5/hws: fix ESP flow matching validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5ce652c02a7ff38cf51507b9d6b90eb32c5ccf1a ]

The "mlx5dr_definer_conv_item_esp()" function validates first whether
"ipsec_offload" PRM flag is on, if the flag is off the function returns
error.

The "ipsec_offload" PRM flag indicates whether IPsec encrypt/decrypt is
supported, IPsec matching may be supported even when this flag is off.

This patch removes this validation.

Fixes: 81cf20a25abf ("net/mlx5/hws: support match on ESP item")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Hamdan Igbaria <hamdani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 0b60479406..7bd4ea560e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -2240,11 +2240,6 @@ mlx5dr_definer_conv_item_esp(struct mlx5dr_definer_conv_data *cd,
 	const struct rte_flow_item_esp *m = item->mask;
 	struct mlx5dr_definer_fc *fc;

-	if (!cd->ctx->caps->ipsec_offload) {
-		rte_errno = ENOTSUP;
-		return rte_errno;
-	}
-
 	if (!m)
 		return 0;
 	if (m->hdr.spi) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.789359626 +0800
+++ 0127-net-mlx5-hws-fix-ESP-flow-matching-validation.patch	2024-03-05 17:39:31.013566501 +0800
@@ -1 +1 @@
-From 5ce652c02a7ff38cf51507b9d6b90eb32c5ccf1a Mon Sep 17 00:00:00 2001
+From c3eb8629791a10fafd439fe040bc18bc83965891 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5ce652c02a7ff38cf51507b9d6b90eb32c5ccf1a ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix GENEVE TLV option management' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (126 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5/hws: fix ESP flow matching validation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'common/mlx5: fix duplicate read of general capabilities' " Xueming Li
                   ` (8 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=18256299036cc5c55eaa0558376b31000564701f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 18256299036cc5c55eaa0558376b31000564701f Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Mon, 15 Jan 2024 14:13:26 +0200
Subject: [PATCH] net/mlx5: fix GENEVE TLV option management
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0303967e1127c00e78fc9ce742aa531b943a2a8b ]

In SW steering, the GENEVE TLV option matching flows must be created
using a translation function.
This function checks whether this option has already created a DevX
object for the matching and either creates the objects or updates the
reference counter.
After translation, a flag in flow structure is turned on indicating the
destroy function to release this DevX object.

When the flow rule has meter, the rule may be split, and call translate
function more than once per flow causing object reference counter to
increase each time without updating the flow flag accordingly.

This patch uses this flag as a reference counter which is increased
every translation and indicates the destroy function how many destroy
DevX to do.

Fixes: f15f0c3806d0 ("net/mlx5: create GENEVE TLV option management")
Fixes: e440d6cf589e ("net/mlx5: add GENEVE TLV option flow translation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cea94e889d..07a582810f 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -14273,7 +14273,7 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
 	 * Avoid be overwritten by other sub mlx5_flows.
 	 */
 	if (wks.geneve_tlv_option)
-		dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
+		dev_flow->flow->geneve_tlv_option += wks.geneve_tlv_option;
 	return 0;
 }

@@ -15877,9 +15877,9 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 		flow_dv_aso_ct_release(dev, flow->ct, NULL);
 	else if (flow->age)
 		flow_dv_aso_age_release(dev, flow->age);
-	if (flow->geneve_tlv_option) {
+	while (flow->geneve_tlv_option) {
 		flow_dev_geneve_tlv_option_resource_release(priv->sh);
-		flow->geneve_tlv_option = 0;
+		flow->geneve_tlv_option--;
 	}
 	while (flow->dev_handles) {
 		uint32_t tmp_idx = flow->dev_handles;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.812371027 +0800
+++ 0128-net-mlx5-fix-GENEVE-TLV-option-management.patch	2024-03-05 17:39:31.033566502 +0800
@@ -1 +1 @@
-From 0303967e1127c00e78fc9ce742aa531b943a2a8b Mon Sep 17 00:00:00 2001
+From 18256299036cc5c55eaa0558376b31000564701f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0303967e1127c00e78fc9ce742aa531b943a2a8b ]
@@ -24 +26,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index 80eee00813..e1d09d4455 100644
+index cea94e889d..07a582810f 100644
@@ -36 +38 @@
-@@ -14373,7 +14373,7 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
+@@ -14273,7 +14273,7 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
@@ -45 +47 @@
-@@ -15982,9 +15982,9 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
+@@ -15877,9 +15877,9 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/mlx5: fix duplicate read of general capabilities' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (127 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE TLV option management' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'common/mlx5: fix query sample info capability' " Xueming Li
                   ` (7 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=10061b4047bb006039807526ffec813ae5ead193

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 10061b4047bb006039807526ffec813ae5ead193 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 25 Jan 2024 15:30:21 +0200
Subject: [PATCH] common/mlx5: fix duplicate read of general capabilities
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ]

General object types support is indicated in bitmap general_obj_types,
which is part of HCA capabilities list.
This bitmap was read multiple times, and each time a different bit was
extracted.

Previous patch optimized the code, reading the bitmap once into a local
variable, and then extracting the required bits.
However, it missed few of them which still read the bitmap for
themselves. In addition, for other readings, it moved them to use local
variable without removing the old reading, and they are read twice.

This patch moves them all to use the local variable and removes all
duplications.

Fixes: 876d4702b141 ("common/mlx5: optimize read of general capabilities")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 4d8818924a..41f6e0a727 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -966,18 +966,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 	attr->max_geneve_tlv_option_data_len = MLX5_GET(cmd_hca_cap, hcattr,
 			max_geneve_tlv_option_data_len);
 	attr->qos.sup = MLX5_GET(cmd_hca_cap, hcattr, qos);
-	attr->qos.flow_meter_aso_sup = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO);
-	attr->vdpa.valid = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q);
-	attr->vdpa.queue_counters_valid = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-							general_obj_types) &
-				  MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_Q_COUNTERS);
-	attr->parse_graph_flex_node = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
-			      MLX5_GENERAL_OBJ_TYPES_CAP_PARSE_GRAPH_FLEX_NODE);
 	attr->wqe_index_ignore = MLX5_GET(cmd_hca_cap, hcattr,
 					  wqe_index_ignore_cap);
 	attr->cross_channel = MLX5_GET(cmd_hca_cap, hcattr, cd);
@@ -1001,6 +989,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 	/* Read the general_obj_types bitmap and extract the relevant bits. */
 	general_obj_types_supported = MLX5_GET64(cmd_hca_cap, hcattr,
 						 general_obj_types);
+	attr->qos.flow_meter_aso_sup =
+			!!(general_obj_types_supported &
+			   MLX5_GENERAL_OBJ_TYPES_CAP_FLOW_METER_ASO);
 	attr->vdpa.valid = !!(general_obj_types_supported &
 			      MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q);
 	attr->vdpa.queue_counters_valid =
@@ -1074,8 +1065,7 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 		MLX5_GET(cmd_hca_cap, hcattr, umr_modify_entity_size_disabled);
 	attr->wait_on_time = MLX5_GET(cmd_hca_cap, hcattr, wait_on_time);
 	attr->crypto = MLX5_GET(cmd_hca_cap, hcattr, crypto);
-	attr->ct_offload = !!(MLX5_GET64(cmd_hca_cap, hcattr,
-					 general_obj_types) &
+	attr->ct_offload = !!(general_obj_types_supported &
 			      MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD);
 	attr->rq_delay_drop = MLX5_GET(cmd_hca_cap, hcattr, rq_delay_drop);
 	attr->nic_flow_table = MLX5_GET(cmd_hca_cap, hcattr, nic_flow_table);
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.852426329 +0800
+++ 0129-common-mlx5-fix-duplicate-read-of-general-capabiliti.patch	2024-03-05 17:39:31.043566502 +0800
@@ -1 +1 @@
-From e8ffd7c26637b9119694368f16d2eb1341767fc6 Mon Sep 17 00:00:00 2001
+From 10061b4047bb006039807526ffec813ae5ead193 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e8ffd7c26637b9119694368f16d2eb1341767fc6 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -30 +32 @@
-index 3a894f894a..faa38a9f95 100644
+index 4d8818924a..41f6e0a727 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/mlx5: fix query sample info capability' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (128 preceding siblings ...)
  2024-03-05  9:47 ` patch 'common/mlx5: fix duplicate read of general capabilities' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: remove GENEVE options length limitation' " Xueming Li
                   ` (6 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=06c494555fd6840d4de23b5fac2bd9c316c43a26

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 06c494555fd6840d4de23b5fac2bd9c316c43a26 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 25 Jan 2024 15:30:22 +0200
Subject: [PATCH] common/mlx5: fix query sample info capability
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e9b1de285341732fde15a621bf01e2372ec88911 ]

Query sample info operation might be used by either Geneve TLV option or
parse graph. Each operations can be supported regardless to another
according the configured profile.

In current implementation, the query sample info capability is turn on
only when parse graph operation is supported adding unnecessary
requirement for Geneve TLV option.

This patch adds different cap for Geneve TLV option.

Fixes: bc0a9303ed6a ("net/mlx5: adopt new sample ID")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++--
 drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 41f6e0a727..3eeb27fc3f 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -965,6 +965,8 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 			max_geneve_tlv_options);
 	attr->max_geneve_tlv_option_data_len = MLX5_GET(cmd_hca_cap, hcattr,
 			max_geneve_tlv_option_data_len);
+	attr->query_match_sample_info = MLX5_GET(cmd_hca_cap, hcattr,
+						 query_match_sample_info);
 	attr->qos.sup = MLX5_GET(cmd_hca_cap, hcattr, qos);
 	attr->wqe_index_ignore = MLX5_GET(cmd_hca_cap, hcattr,
 					  wqe_index_ignore_cap);
@@ -1094,8 +1096,8 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 			(ctx, &attr->flex);
 		if (rc)
 			return -1;
-		attr->flex.query_match_sample_info = MLX5_GET(cmd_hca_cap, hcattr,
-							      query_match_sample_info);
+		attr->flex.query_match_sample_info =
+						attr->query_match_sample_info;
 	}
 	if (attr->crypto) {
 		attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts) ||
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 7f23e925a5..b814c8becc 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -315,6 +315,7 @@ struct mlx5_hca_attr {
 	uint32_t flow_counter_bulk_log_granularity:5;
 	uint32_t alloc_flow_counter_pd:1;
 	uint32_t flow_counter_access_aso:1;
+	uint32_t query_match_sample_info:1;
 	uint32_t flow_access_aso_opc_mod:8;
 	uint32_t cross_vhca:1;
 	uint32_t lag_rx_port_affinity:1;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.876616929 +0800
+++ 0130-common-mlx5-fix-query-sample-info-capability.patch	2024-03-05 17:39:31.053566502 +0800
@@ -1 +1 @@
-From e9b1de285341732fde15a621bf01e2372ec88911 Mon Sep 17 00:00:00 2001
+From 06c494555fd6840d4de23b5fac2bd9c316c43a26 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e9b1de285341732fde15a621bf01e2372ec88911 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index faa38a9f95..9b1cfcc135 100644
+index 41f6e0a727..3eeb27fc3f 100644
@@ -51 +53 @@
-index 4a6008dc1a..0c5727b669 100644
+index 7f23e925a5..b814c8becc 100644
@@ -54 +56 @@
-@@ -316,6 +316,7 @@ struct mlx5_hca_attr {
+@@ -315,6 +315,7 @@ struct mlx5_hca_attr {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: remove GENEVE options length limitation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (129 preceding siblings ...)
  2024-03-05  9:47 ` patch 'common/mlx5: fix query sample info capability' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE option item translation' " Xueming Li
                   ` (5 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=22653f6966c1e4fcf8e358ab05d7407053ca6ed3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 22653f6966c1e4fcf8e358ab05d7407053ca6ed3 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 25 Jan 2024 15:30:24 +0200
Subject: [PATCH] net/mlx5: remove GENEVE options length limitation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 48adbc80ba650aab12c00a7545cc33daff83976a ]

GENEVE header has field named "opt_len" describing the total length of
all GENEVE options in 4-byte granularity.

In SW sreering implementation, only single option with single DW data is
supported. When matching on GENEVE option data is requested, matching on
"opt_len" field is added according to given option length.

This behaveior assumes that only packets with single option can be
matched, but it is wrong, packet with a few option can be matched but
only one of them can match its value.

This patch removes the "opt_len" matching unless user ask it explicitly.

Fixes: e440d6cf589e ("net/mlx5: add GENEVE TLV option flow translation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 07a582810f..3fbfea74fb 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9979,7 +9979,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
 	const struct rte_flow_item_geneve_opt *geneve_opt_m;
 	const struct rte_flow_item_geneve_opt *geneve_opt_v;
 	const struct rte_flow_item_geneve_opt *geneve_opt_vv = item->spec;
-	void *misc_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters);
 	void *misc3_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_3);
 	rte_be32_t opt_data_key = 0, opt_data_mask = 0;
 	uint32_t *data;
@@ -9998,21 +9997,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
 			return ret;
 		}
 	}
-	/*
-	 * Set the option length in GENEVE header if not requested.
-	 * The GENEVE TLV option length is expressed by the option length field
-	 * in the GENEVE header.
-	 * If the option length was not requested but the GENEVE TLV option item
-	 * is present we set the option length field implicitly.
-	 */
-	if (!MLX5_GET16(fte_match_set_misc, misc_v, geneve_opt_len)) {
-		if (key_type & MLX5_SET_MATCHER_M)
-			MLX5_SET(fte_match_set_misc, misc_v, geneve_opt_len,
-				 MLX5_GENEVE_OPTLEN_MASK);
-		else
-			MLX5_SET(fte_match_set_misc, misc_v, geneve_opt_len,
-				 geneve_opt_v->option_len + 1);
-	}
 	/* Set the data. */
 	if (key_type == MLX5_SET_MATCHER_SW_V)
 		data = geneve_opt_vv->data;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.905747530 +0800
+++ 0131-net-mlx5-remove-GENEVE-options-length-limitation.patch	2024-03-05 17:39:31.073566503 +0800
@@ -1 +1 @@
-From 48adbc80ba650aab12c00a7545cc33daff83976a Mon Sep 17 00:00:00 2001
+From 22653f6966c1e4fcf8e358ab05d7407053ca6ed3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 48adbc80ba650aab12c00a7545cc33daff83976a ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index c31f726edb..4f8062d0ab 100644
+index 07a582810f..3fbfea74fb 100644
@@ -32 +34 @@
-@@ -10104,7 +10104,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
+@@ -9979,7 +9979,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
@@ -40 +42 @@
-@@ -10123,21 +10122,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
+@@ -9998,21 +9997,6 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix GENEVE option item translation' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (130 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: remove GENEVE options length limitation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/mlx5: fix stats query crash in secondary process' " Xueming Li
                   ` (4 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Michael Baum; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5982bea06b43581987e94f280e4e597e08181149

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5982bea06b43581987e94f280e4e597e08181149 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 25 Jan 2024 15:30:25 +0200
Subject: [PATCH] net/mlx5: fix GENEVE option item translation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf ]

The "flow_dv_translate_item_geneve_opt()" function is called twice per
flow rule, for either matcher focusing the mask or value focusing the
spec.
The spec is always provided and its field "option_len" indicates the
data size for both spec and mask. For using it, function has another
pointer "geneve_opt_vv" representing the spec regardless to focusing
while the "geneve_opt_v" pointer represents the mask for matcher and
spec for rule creation.

The current implementation has 2 issues:
1. geneve_opt_v get the spec in rule creation as sane as geneve_opt_vv,
   but function use if-else which is bacicly has same value.
2. function uses "option_len" from "geneve_opt_v" instead of
   "geneve_opt_v" even when the focus is on mask, for HWS the mask value
   may be 0 even data is valid.

This patch refactors the function implementation to avoid those issues.

Fixes: cd4ab742064a ("net/mlx5: split flow item matcher and value translation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 3fbfea74fb..79fde3de8e 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9978,13 +9978,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
 {
 	const struct rte_flow_item_geneve_opt *geneve_opt_m;
 	const struct rte_flow_item_geneve_opt *geneve_opt_v;
-	const struct rte_flow_item_geneve_opt *geneve_opt_vv = item->spec;
+	const struct rte_flow_item_geneve_opt *orig_spec = item->spec;
 	void *misc3_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_3);
 	rte_be32_t opt_data_key = 0, opt_data_mask = 0;
-	uint32_t *data;
+	size_t option_byte_len;
 	int ret = 0;

-	if (MLX5_ITEM_VALID(item, key_type))
+	if (MLX5_ITEM_VALID(item, key_type) || !orig_spec)
 		return -1;
 	MLX5_ITEM_UPDATE(item, key_type, geneve_opt_v, geneve_opt_m,
 			 &rte_flow_item_geneve_opt_mask);
@@ -9997,21 +9997,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
 			return ret;
 		}
 	}
-	/* Set the data. */
-	if (key_type == MLX5_SET_MATCHER_SW_V)
-		data = geneve_opt_vv->data;
-	else
-		data = geneve_opt_v->data;
-	if (data) {
-		memcpy(&opt_data_key, data,
-			RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),
-				sizeof(opt_data_key)));
-		memcpy(&opt_data_mask, geneve_opt_m->data,
-			RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4),
-				sizeof(opt_data_mask)));
+	/* Convert the option length from DW to bytes for using memcpy. */
+	option_byte_len = RTE_MIN((size_t)(orig_spec->option_len * 4),
+				  sizeof(rte_be32_t));
+	if (geneve_opt_v->data) {
+		memcpy(&opt_data_key, geneve_opt_v->data, option_byte_len);
+		memcpy(&opt_data_mask, geneve_opt_m->data, option_byte_len);
 		MLX5_SET(fte_match_set_misc3, misc3_v,
-				geneve_tlv_option_0_data,
-			rte_be_to_cpu_32(opt_data_key & opt_data_mask));
+			 geneve_tlv_option_0_data,
+			 rte_be_to_cpu_32(opt_data_key & opt_data_mask));
 	}
 	return ret;
 }
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.941850032 +0800
+++ 0132-net-mlx5-fix-GENEVE-option-item-translation.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf Mon Sep 17 00:00:00 2001
+From 5982bea06b43581987e94f280e4e597e08181149 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org
@@ -34 +36 @@
-index 4f8062d0ab..afcec4a63d 100644
+index 3fbfea74fb..79fde3de8e 100644
@@ -37 +39 @@
-@@ -10103,13 +10103,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
+@@ -9978,13 +9978,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
@@ -54 +56 @@
-@@ -10122,21 +10122,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,
+@@ -9997,21 +9997,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix stats query crash in secondary process' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (131 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE option item translation' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix NFD3 metadata " Xueming Li
                   ` (3 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Rongwei Liu; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1f3f99626970b526a0fb9b8dcb1281925d533e90

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1f3f99626970b526a0fb9b8dcb1281925d533e90 Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil@nvidia.com>
Date: Mon, 22 Jan 2024 09:44:05 +0200
Subject: [PATCH] net/mlx5: fix stats query crash in secondary process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d312cab568ecdc8411cb3dc896e7d5020836399b ]

The "outer_of_buffer" counter is owned by the primary process devx
object and it is pointer by pointer in mlx5_priv structure. Actually,
there are 4 levels' pointers in this piece of code.

The secondary process can't access this part directly since it belongs
to another process's heap.

Return ENOTSUP as a workaround.

Fixes: 750e48c7d8c3 ("common/mlx5: add DevX commands for queue counters")

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index ae82e1e5d8..fd104dabb2 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -2993,9 +2993,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,

 	if (priv->sh) {
 		if (priv->q_counters != NULL &&
-		    strcmp(ctr_name, "out_of_buffer") == 0)
+		    strcmp(ctr_name, "out_of_buffer") == 0) {
+			if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+				DRV_LOG(WARNING, "Devx out_of_buffer counter is not supported in the secondary process");
+				rte_errno = ENOTSUP;
+				return 1;
+			}
 			return mlx5_devx_cmd_queue_counter_query
 					(priv->q_counters, 0, (uint32_t *)stat);
+		}
 		MKSTR(path, "%s/ports/%d/hw_counters/%s",
 		      priv->sh->ibdev_path,
 		      priv->dev_port,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:34.978176933 +0800
+++ 0133-net-mlx5-fix-stats-query-crash-in-secondary-process.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From d312cab568ecdc8411cb3dc896e7d5020836399b Mon Sep 17 00:00:00 2001
+From 1f3f99626970b526a0fb9b8dcb1281925d533e90 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d312cab568ecdc8411cb3dc896e7d5020836399b ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index cc8e1919e8..f10e623953 100644
+index ae82e1e5d8..fd104dabb2 100644
@@ -28 +30 @@
-@@ -2998,9 +2998,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,
+@@ -2993,9 +2993,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix NFD3 metadata process' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (132 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/mlx5: fix stats query crash in secondary process' " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'net/nfp: fix NFDk " Xueming Li
                   ` (2 subsequent siblings)
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8e79562a0ed536de5a27a8a144ff17aa8b0164bd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8e79562a0ed536de5a27a8a144ff17aa8b0164bd Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 20 Feb 2024 16:14:50 +0800
Subject: [PATCH] net/nfp: fix NFD3 metadata process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7ecf3b9039dbe0370b48d620261f62049ab0786e ]

The Tx function can not check if the metadata process success for
the process function with void return type.

Fix it by change the return type of the metadata function from
void to integer and add the error handle logic in the Tx function.

Fixes: 962791ba6804 ("net/nfp: support VLAN insert with NFD3")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index ff9b10f046..b9da74bc99 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -137,7 +137,7 @@ nfp_net_nfd3_tx_vlan(struct nfp_net_txq *txq,
 	}
 }

-static inline void
+static inline int
 nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 		struct nfp_net_txq *txq,
 		struct rte_mbuf *pkt)
@@ -174,7 +174,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 	}

 	if (meta_data->length == 0)
-		return;
+		return 0;

 	meta_info = meta_data->header;
 	meta_data->header = rte_cpu_to_be_32(meta_data->header);
@@ -188,15 +188,16 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 		case NFP_NET_META_VLAN:
 			if (vlan_layer > 0) {
 				PMD_DRV_LOG(ERR, "At most 1 layers of vlan is supported");
-				return;
+				return -EINVAL;
 			}
+
 			nfp_net_set_meta_vlan(meta_data, pkt, layer);
 			vlan_layer++;
 			break;
 		case NFP_NET_META_IPSEC:
 			if (ipsec_layer > 2) {
 				PMD_DRV_LOG(ERR, "At most 3 layers of ipsec is supported for now.");
-				return;
+				return -EINVAL;
 			}

 			nfp_net_set_meta_ipsec(meta_data, txq, pkt, layer, ipsec_layer);
@@ -204,11 +205,13 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 			break;
 		default:
 			PMD_DRV_LOG(ERR, "The metadata type not supported");
-			return;
+			return -ENOTSUP;
 		}

 		memcpy(meta, &meta_data->data[layer], sizeof(meta_data->data[layer]));
 	}
+
+	return 0;
 }

 uint16_t
@@ -225,6 +228,7 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
 		uint16_t nb_pkts,
 		bool repr_flag)
 {
+	int ret;
 	uint16_t i;
 	uint8_t offset;
 	uint32_t pkt_size;
@@ -271,7 +275,10 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
 		if (!repr_flag) {
 			struct nfp_net_meta_raw meta_data;
 			memset(&meta_data, 0, sizeof(meta_data));
-			nfp_net_nfd3_set_meta_data(&meta_data, txq, pkt);
+			ret = nfp_net_nfd3_set_meta_data(&meta_data, txq, pkt);
+			if (unlikely(ret != 0))
+				goto xmit_end;
+
 			offset = meta_data.length;
 		} else {
 			offset = FLOWER_PKT_DATA_OFFSET;
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:35.017341234 +0800
+++ 0134-net-nfp-fix-NFD3-metadata-process.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From 7ecf3b9039dbe0370b48d620261f62049ab0786e Mon Sep 17 00:00:00 2001
+From 8e79562a0ed536de5a27a8a144ff17aa8b0164bd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7ecf3b9039dbe0370b48d620261f62049ab0786e ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index ee120f55ab..be31f4ac33 100644
+index ff9b10f046..b9da74bc99 100644
@@ -26 +28 @@
-@@ -142,7 +142,7 @@ nfp_net_nfd3_tx_vlan(struct nfp_net_txq *txq,
+@@ -137,7 +137,7 @@ nfp_net_nfd3_tx_vlan(struct nfp_net_txq *txq,
@@ -35 +37 @@
-@@ -177,7 +177,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
+@@ -174,7 +174,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
@@ -44 +46 @@
-@@ -191,15 +191,16 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
+@@ -188,15 +188,16 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
@@ -63 +65 @@
-@@ -207,11 +208,13 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
+@@ -204,11 +205,13 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
@@ -78 +80 @@
-@@ -228,6 +231,7 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
+@@ -225,6 +228,7 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
@@ -86 +88 @@
-@@ -274,7 +278,10 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
+@@ -271,7 +275,10 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix NFDk metadata process' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (133 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix NFD3 metadata " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-03-05  9:47 ` patch 'app/testpmd: fix GRO packets flush on timeout' " Xueming Li
  2024-04-13 12:48 ` patch " Xueming Li
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cc670c78337dc89cffa5248facf46c121216cf43

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cc670c78337dc89cffa5248facf46c121216cf43 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 20 Feb 2024 16:14:51 +0800
Subject: [PATCH] net/nfp: fix NFDk metadata process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b36f0b1d3e453727999a5770b00af555e21f07b1 ]

The Tx function can not check if the metadata process success for
the process function with void return type.

Fix it by change the return type of the metadata function from
void to integer and add the error handle logic in the Tx function.

Fixes: 7c82b8626af8 ("net/nfp: support VLAN insert with NFDk")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 0141fbcc8f..6a9e7ec042 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -167,7 +167,7 @@ close_block:
 	return nop_slots;
 }

-static void
+static int
 nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		struct nfp_net_txq *txq,
 		uint64_t *metadata)
@@ -206,8 +206,10 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		meta_data.length += 3 * NFP_NET_META_FIELD_SIZE;
 	}

-	if (meta_data.length == 0)
-		return;
+	if (meta_data.length == 0) {
+		*metadata = 0;
+		return 0;
+	}

 	meta_type = meta_data.header;
 	header_offset = meta_type << NFP_NET_META_NFDK_LENGTH;
@@ -223,15 +225,16 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 		case NFP_NET_META_VLAN:
 			if (vlan_layer > 0) {
 				PMD_DRV_LOG(ERR, "At most 1 layers of vlan is supported");
-				return;
+				return -EINVAL;
 			}
+
 			nfp_net_set_meta_vlan(&meta_data, pkt, layer);
 			vlan_layer++;
 			break;
 		case NFP_NET_META_IPSEC:
 			if (ipsec_layer > 2) {
 				PMD_DRV_LOG(ERR, "At most 3 layers of ipsec is supported for now.");
-				return;
+				return -EINVAL;
 			}

 			nfp_net_set_meta_ipsec(&meta_data, txq, pkt, layer, ipsec_layer);
@@ -239,13 +242,15 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 			break;
 		default:
 			PMD_DRV_LOG(ERR, "The metadata type not supported");
-			return;
+			return -ENOTSUP;
 		}

 		memcpy(meta, &meta_data.data[layer], sizeof(meta_data.data[layer]));
 	}

 	*metadata = NFDK_DESC_TX_CHAIN_META;
+
+	return 0;
 }

 uint16_t
@@ -292,6 +297,7 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,

 	/* Sending packets */
 	while (npkts < nb_pkts && free_descs > 0) {
+		int ret;
 		int nop_descs;
 		uint32_t type;
 		uint32_t dma_len;
@@ -319,10 +325,13 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,

 		temp_pkt = pkt;

-		if (repr_flag)
+		if (repr_flag) {
 			metadata = NFDK_DESC_TX_CHAIN_META;
-		else
-			nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
+		} else {
+			ret = nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
+			if (unlikely(ret != 0))
+				goto xmit_end;
+		}

 		if (unlikely(pkt->nb_segs > 1 &&
 				(hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:35.044073435 +0800
+++ 0135-net-nfp-fix-NFDk-metadata-process.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From b36f0b1d3e453727999a5770b00af555e21f07b1 Mon Sep 17 00:00:00 2001
+From cc670c78337dc89cffa5248facf46c121216cf43 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b36f0b1d3e453727999a5770b00af555e21f07b1 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index a1c6ecdfe5..daf5ac5b30 100644
+index 0141fbcc8f..6a9e7ec042 100644
@@ -26 +28 @@
-@@ -169,7 +169,7 @@ close_block:
+@@ -167,7 +167,7 @@ close_block:
@@ -108 +110 @@
- 				(hw->super.ctrl & NFP_NET_CFG_CTRL_GATHER) == 0)) {
+ 				(hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix GRO packets flush on timeout' has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (134 preceding siblings ...)
  2024-03-05  9:47 ` patch 'net/nfp: fix NFDk " Xueming Li
@ 2024-03-05  9:47 ` Xueming Li
  2024-04-13 12:48 ` patch " Xueming Li
  136 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-03-05  9:47 UTC (permalink / raw)
  To: Kumara Parameshwaran; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/31/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=05bea47b81f3f38d07cb3aedc6fc2a578c3caae8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 05bea47b81f3f38d07cb3aedc6fc2a578c3caae8 Mon Sep 17 00:00:00 2001
From: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Date: Fri, 16 Feb 2024 09:17:50 +0530
Subject: [PATCH] app/testpmd: fix GRO packets flush on timeout
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 461c287ab55303bad1e68bd1dfac6e6ec27953c3 ]

In heavy-weight mode GRO which is based on timer, the GRO packets
will not be flushed in spite of timer expiry if there is no packet
in the current poll.

If timer mode GRO is enabled the rte_gro_timeout_flush API should be
invoked.

Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO")

Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/csumonly.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 21210aff43..d73f08b2c6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -870,16 +870,28 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)

 	/* receive a burst of packet */
 	nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
-	if (unlikely(nb_rx == 0))
+	if (unlikely(nb_rx == 0)) {
+#ifndef RTE_LIB_GRO
 		return false;
+#else
+		gro_enable = gro_ports[fs->rx_port].enable;
+		/*
+		 * Check if packets need to be flushed in the GRO context
+		 * due to a timeout.
+		 *
+		 * Continue only in GRO heavyweight mode and if there are
+		 * packets in the GRO context.
+		 */
+		if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) ||
+			(rte_gro_get_pkt_count(current_fwd_lcore()->gro_ctx) == 0))
+			return false;
+#endif
+	}

 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
 	rx_bad_outer_l4_csum = 0;
 	rx_bad_outer_ip_csum = 0;
-#ifdef RTE_LIB_GRO
-	gro_enable = gro_ports[fs->rx_port].enable;
-#endif

 	txp = &ports[fs->tx_port];
 	tx_offloads = txp->dev_conf.txmode.offloads;
@@ -1110,6 +1122,7 @@ tunnel_update:
 	}

 #ifdef RTE_LIB_GRO
+	gro_enable = gro_ports[fs->rx_port].enable;
 	if (unlikely(gro_enable)) {
 		if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) {
 			nb_rx = rte_gro_reassemble_burst(pkts_burst, nb_rx,
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 17:39:35.071099836 +0800
+++ 0136-app-testpmd-fix-GRO-packets-flush-on-timeout.patch	2024-03-05 17:39:31.093566504 +0800
@@ -1 +1 @@
-From 461c287ab55303bad1e68bd1dfac6e6ec27953c3 Mon Sep 17 00:00:00 2001
+From 05bea47b81f3f38d07cb3aedc6fc2a578c3caae8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 461c287ab55303bad1e68bd1dfac6e6ec27953c3 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* RE: patch 'eal/x86: add AMD vendor check for TSC calibration' has been queued to stable release 23.11.1
  2024-03-05  9:46 ` patch 'eal/x86: add AMD vendor check for TSC calibration' " Xueming Li
@ 2024-03-05 11:17   ` Tummala, Sivaprasad
  0 siblings, 0 replies; 263+ messages in thread
From: Tummala, Sivaprasad @ 2024-03-05 11:17 UTC (permalink / raw)
  To: Xueming Li; +Cc: Yigit, Ferruh, dpdk stable

[AMD Official Use Only - General]

Hi Xueming,

LGTM!

> -----Original Message-----
> From: Xueming Li <xuemingl@nvidia.com>
> Sent: Tuesday, March 5, 2024 3:16 PM
> To: Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>
> Cc: Yigit, Ferruh <Ferruh.Yigit@amd.com>; dpdk stable <stable@dpdk.org>
> Subject: patch 'eal/x86: add AMD vendor check for TSC calibration' has been
> queued to stable release 23.11.1
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi,
>
> FYI, your patch has been queued to stable release 23.11.1
>
> Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> It will be pushed if I get no objections before 03/31/24. So please shout if anyone
> has objections.
>
> Also note that after the patch there's a diff of the upstream commit vs the patch
> applied to the branch. This will indicate if there was any rebasing needed to apply
> to the stable branch. If there were code changes for rebasing
> (ie: not only metadata diffs), please double check that the rebase was correctly
> done.
>
> Queued patches are on a temporary branch at:
> https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
>
> This queued commit can be viewed at:
> https://git.dpdk.org/dpdk-stable/commit/?h=23.11-
> staging&id=5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0
>
> Thanks.
>
> Xueming Li <xuemingl@nvidia.com>
>
> ---
> From 5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0 Mon Sep 17 00:00:00 2001
> From: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> Date: Wed, 22 Nov 2023 23:27:30 -0800
> Subject: [PATCH] eal/x86: add AMD vendor check for TSC calibration
> Cc: Xueming Li <xuemingl@nvidia.com>
>
> [ upstream commit 31d72ff4dc7c057366153e9918ac92bf9123a3bc ]
>
> AMD Epyc processors doesn't support get_tsc_freq_arch().
> The patch allows graceful return to allow fallback to alternate TSC calibration.
>
> Fixes: 3dbc565e81a0 ("timer: honor arch-specific TSC frequency query")
>
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
>  lib/eal/x86/rte_cycles.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c index
> 69ed59b4f0..f147a5231d 100644
> --- a/lib/eal/x86/rte_cycles.c
> +++ b/lib/eal/x86/rte_cycles.c
> @@ -10,6 +10,10 @@
>  #include <cpuid.h>
>  #endif
>
> +#define x86_vendor_amd(t1, t2, t3)        \
> +       ((t1 == 0x68747541) && /* htuA */   \
> +        (t2 == 0x444d4163) && /* DMAc */   \
> +        (t3 == 0x69746e65))   /* itne */
>
>  #include "eal_private.h"
>
> @@ -110,6 +114,18 @@ get_tsc_freq_arch(void)
>         uint8_t mult, model;
>         int32_t ret;
>
> +#ifdef RTE_TOOLCHAIN_MSVC
> +       __cpuid(cpuinfo, 0);
> +       a = cpuinfo[0];
> +       b = cpuinfo[1];
> +       c = cpuinfo[2];
> +       d = cpuinfo[3];
> +#else
> +       __cpuid(0, a, b, c, d);
> +#endif
> +       if (x86_vendor_amd(b, c, d))
> +               return 0;
> +
>         /*
>          * Time Stamp Counter and Nominal Core Crystal Clock
>          * Information Leaf
> --
> 2.34.1
>
> ---
>   Diff of the applied patch vs upstream commit (please double-check if non-empty:
> ---
> --- -   2024-03-05 17:39:31.808571927 +0800
> +++ 0024-eal-x86-add-AMD-vendor-check-for-TSC-calibration.patch
> +++ 2024-03-05 17:39:30.703566491 +0800
> @@ -1 +1 @@
> -From 31d72ff4dc7c057366153e9918ac92bf9123a3bc Mon Sep 17 00:00:00 2001
> +From 5f30c47cc54f320a4f7bffdd06abcbe6cc2bc7d0 Mon Sep 17 00:00:00 2001
> @@ -4,0 +5,3 @@
> +Cc: Xueming Li <xuemingl@nvidia.com>
> +
> +[ upstream commit 31d72ff4dc7c057366153e9918ac92bf9123a3bc ]
> @@ -11 +13,0 @@
> -Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch has been queued to stable release 23.11.1
  2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
                   ` (135 preceding siblings ...)
  2024-03-05  9:47 ` patch 'app/testpmd: fix GRO packets flush on timeout' " Xueming Li
@ 2024-04-13 12:48 ` Xueming Li
  2024-04-13 12:48   ` patch 'doc: fix configuration in baseband 5GNR driver guide' " Xueming Li
                     ` (123 more replies)
  136 siblings, 124 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cfa8a4cb909e07cbb34941358f4d912c879dca34

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cfa8a4cb909e07cbb34941358f4d912c879dca34 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@nvidia.com>
Date: Sat, 13 Apr 2024 20:43:04 +0800
Subject: [PATCH] *** SUBJECT HERE ***
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

*** BLURB HERE ***

Alex Vesker (2):
  net/mlx5/hws: fix direct index insert on depend WQE
  net/mlx5/hws: fix memory access in L3 decapsulation

Ali Alnubani (1):
  doc: update link to Windows DevX in mlx5 guide

Andrew Boyer (1):
  doc: fix typos in cryptodev overview

Ankur Dwivedi (1):
  doc: fix aging poll frequency option in cnxk guide

Arkadiusz Kusztal (2):
  common/qat: fix legacy flag
  crypto/qat: fix crash with CCM null AAD pointer

Bing Zhao (7):
  net/mlx5: prevent querying aged flows on uninit port
  net/mlx5: fix condition of LACP miss flow
  net/mlx5: fix HWS registers initialization
  net/mlx5: fix counters map in bonding mode
  net/mlx5: remove device status check in flow creation
  net/mlx5: fix age position in hairpin split
  net/mlx5: fix drop action release timing

Bruce Richardson (6):
  eventdev: improve Doxygen comments on configure struct
  eventdev: fix Doxygen processing of vector struct
  net/i40e: remove incorrect 16B descriptor read block
  net/iavf: remove incorrect 16B descriptor read block
  net/ice: remove incorrect 16B descriptor read block
  test: do not count skipped tests as executed

Chaoyong He (3):
  net/nfp: fix switch domain free check
  net/nfp: fix initialization failure flow
  net/nfp: fix uninitialized variable

Dariusz Sosnowski (7):
  app/testpmd: fix async flow create failure handling
  net/mlx5: fix conntrack action handle representation
  net/mlx5: fix connection tracking action validation
  net/mlx5: fix VLAN handling in meter split
  net/mlx5: fix flow counter cache starvation
  net/mlx5: fix template clean up of FDB control flow rule
  net/mlx5: fix flow configure validation

David Marchand (4):
  net/iavf: remove error logs for VLAN offloading
  app/testpmd: fix --stats-period option check
  app/testpmd: fix burst option parsing
  app/testpmd: fix error message for invalid option

Edwin Brossette (1):
  net/ixgbevf: fix RSS init for x550 NICs

Eli Britstein (1):
  net/mlx5: prevent ioctl failure log flooding

Emi Aoki (1):
  doc: fix typo in profiling guide

Erez Shitrit (1):
  net/mlx5/hws: check not supported fields in VXLAN

Fidel Castro (1):
  test/power: fix typo in error message

Flore Norceide (1):
  doc: fix typo in packet framework guide

Ganapati Kundapura (2):
  test/event: fix crash in Tx adapter freeing
  eventdev/crypto: fix enqueueing

Gregory Etelson (11):
  net/mlx5: fix parameters verification in HWS table create
  net/mlx5: fix flow action template expansion
  app/testpmd: fix async indirect action list creation
  net/mlx5: fix HWS meter actions availability
  net/mlx5: fix sync meter processing in HWS
  net/mlx5: fix indirect action async job initialization
  net/mlx5: fix non-masked indirect list meter translation
  net/mlx5: fix VLAN ID in flow modify
  net/mlx5: remove duplication of L3 flow item validation
  net/mlx5: fix IP-in-IP tunnels recognition
  net/mlx5: fix sync flow meter action

Hamdan Igbaria (2):
  net/mlx5/hws: fix VLAN item in non-relaxed mode
  net/mlx5/hws: fix VLAN inner type

Harman Kalra (1):
  common/cnxk: fix link config for SDP

Hernan Vargas (1):
  doc: fix configuration in baseband 5GNR driver guide

Holly Nichols (1):
  test/cfgfile: fix typo in error messages

Huisong Li (2):
  doc: add traffic manager in features table
  doc: add link speeds configuration in features table

Itamar Gozlan (1):
  net/mlx5/hws: skip item when inserting rules by index

Jie Hai (2):
  net/hns3: enable PFC for all user priorities
  net/hns3: support new device

Joyce Kong (1):
  config: fix CPU instruction set for cross-build

Juraj Linkeš (2):
  dts: fix smoke tests driver regex
  dts: strip whitespaces from stdout and stderr

Kalesh AP (1):
  net/bnxt: fix null pointer dereference

Kamil Vojanec (1):
  examples/l3fwd: fix Rx queue configuration

Kevin Traynor (1):
  net/ixgbe: increase VF reset timeout

Kishore Padmanabha (1):
  net/bnxt: fix number of Tx queues being created

Kommula Shiva Shankar (1):
  common/cnxk: fix RSS RETA configuration

Konstantin Ananyev (1):
  examples/l3fwd: fix Rx over not ready port

Kumara Parameshwaran (1):
  app/testpmd: return if no packets in GRO heavy weight mode

Maayan Kashani (1):
  net/mlx5: fix DR context release ordering

Masoumeh Farhadi Nia (1):
  examples/ipsec-secgw: fix typo in error message

Maxime Coquelin (2):
  vhost: fix VDUSE device destruction failure
  net/virtio: fix vDPA device init advertising control queue

Michael Baum (1):
  net/mlx5/hws: enable multiple integrity items

Mingjin Ye (2):
  test: fix probing in secondary process
  bus/vdev: fix devargs in secondary process

Morten Brørup (3):
  event/dlb2: remove superfluous memcpy
  net/bnx2x: fix warnings about memcpy lengths
  net/mlx5: fix warning about copy length

Nithin Dabilpuram (5):
  common/cnxk: remove CN9K inline IPsec FP opcodes
  net/cnxk: fix buffer size configuration
  common/cnxk: fix Tx MTU configuration
  net/cnxk: fix indirect mbuf handling in Tx
  common/cnxk: fix mbox struct attributes

Pengfei Sun (1):
  net/mlx5: fix use after free when releasing Tx queues

Qian Hao (1):
  examples/packet_ordering: fix Rx with reorder mode disabled

Qin Ke (1):
  net/nfp: fix getting firmware VNIC version

Radu Nicolau (1):
  examples/ipsec-secgw: fix cryptodev to SA mapping

Rahul Bhansali (5):
  common/cnxk: fix inline device pointer check
  net/cnxk: fix Rx packet format check condition
  net/cnxk: add cookies check for multi-segment offload
  net/cnxk: fix mbuf fields in multi-segment Tx
  net/cnxk: improve Tx performance for SW mbuf free

Rakesh Kudurumalla (1):
  test/mbuf: fix external mbuf case with assert enabled

Robin Jarry (2):
  test: assume C source files are UTF-8 encoded
  build: pass cflags in subproject

Rongwei Liu (2):
  app/testpmd: fix flow modify tag typo
  net/mlx5: fix modify flex item

Satheesh Paul (2):
  common/cnxk: remove dead code
  common/cnxk: fix possible out-of-bounds access

Shai Brandes (5):
  net/ena: fix fast mbuf free
  net/ena/base: limit exponential backoff
  net/ena/base: restructure interrupt handling
  net/ena: fix mbuf double free in fast free mode
  net/ena/base: fix metrics excessive memory consumption

Shani Peretz (1):
  app/testpmd: fix auto-completion for indirect action list

Shihong Wang (2):
  net/nfp: fix IPsec data endianness
  examples/ipsec-secgw: fix Rx queue ID in Rx callback

Shun Hao (1):
  net/mlx5: fix meter policy priority

Simei Su (1):
  doc: fix default IP fragments maximum in programmer guide

Stephen Hemminger (2):
  net/tap: do not overwrite flow API errors
  net/tap: fix traffic control handle calculation

Suanming Mou (3):
  app/crypto-perf: fix copy segment size
  app/crypto-perf: fix out-of-place mbuf size
  app/crypto-perf: add missing op resubmission

Sunil Kumar Kori (1):
  net/cnxk: fix MTU limit

Tom Jones (1):
  net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD

Viacheslav Ovsiienko (1):
  net/mlx5: fix error packets drop in regular Rx

Wenwu Ma (1):
  net/igc: fix timesync disable

Xueming Li (1):
  23.11.1-rc1

Yunjian Wang (1):
  net/af_xdp: fix leak on XSK configuration failure

 .mailmap                                      |  14 +-
 app/test-crypto-perf/cperf_test_common.c      |   5 +-
 app/test-crypto-perf/cperf_test_verify.c      |  12 +-
 app/test-pmd/cmdline_flow.c                   |  49 +-
 app/test-pmd/config.c                         |   8 +-
 app/test-pmd/csumonly.c                       |   2 +
 app/test-pmd/parameters.c                     |   8 +-
 app/test-pmd/testpmd.h                        |   1 +
 app/test/process.h                            |  46 +-
 app/test/test.c                               |   8 +-
 app/test/test_cfgfile.c                       |   8 +-
 app/test/test_event_eth_tx_adapter.c          |   4 +
 app/test/test_mbuf.c                          |   5 +-
 app/test/test_power.c                         |   2 +-
 buildtools/get-test-suites.py                 |   2 +-
 buildtools/subproject/meson.build             |   6 +
 config/meson.build                            |  11 +-
 doc/guides/bbdevs/fpga_5gnr_fec.rst           |   7 +-
 doc/guides/cryptodevs/overview.rst            |   6 +-
 doc/guides/nics/cnxk.rst                      |  24 +-
 doc/guides/nics/features.rst                  |  24 +
 doc/guides/nics/features/atlantic.ini         |   1 +
 doc/guides/nics/features/bnxt.ini             |   1 +
 doc/guides/nics/features/cnxk.ini             |   1 +
 doc/guides/nics/features/default.ini          |   2 +
 doc/guides/nics/features/dpaa.ini             |   1 +
 doc/guides/nics/features/dpaa2.ini            |   1 +
 doc/guides/nics/features/hns3.ini             |   2 +
 doc/guides/nics/features/i40e.ini             |   2 +
 doc/guides/nics/features/iavf.ini             |   3 +-
 doc/guides/nics/features/ice.ini              |   2 +
 doc/guides/nics/features/ice_dcf.ini          |   1 +
 doc/guides/nics/features/igb.ini              |   1 +
 doc/guides/nics/features/igc.ini              |   1 +
 doc/guides/nics/features/ionic.ini            |   1 +
 doc/guides/nics/features/ipn3ke.ini           |   1 +
 doc/guides/nics/features/ixgbe.ini            |   2 +
 doc/guides/nics/features/mvpp2.ini            |   3 +-
 doc/guides/nics/features/ngbe.ini             |   1 +
 doc/guides/nics/features/octeontx.ini         |   1 +
 doc/guides/nics/features/sfc.ini              |   1 +
 doc/guides/nics/features/thunderx.ini         |   1 +
 doc/guides/nics/features/txgbe.ini            |   2 +
 doc/guides/nics/hns3.rst                      |   2 +-
 doc/guides/nics/mlx5.rst                      |   4 +-
 doc/guides/platform/mlx5.rst                  |   2 +-
 .../prog_guide/ip_fragment_reassembly_lib.rst |   2 +-
 doc/guides/prog_guide/packet_framework.rst    |   2 +-
 doc/guides/prog_guide/profile_app.rst         |   2 +-
 drivers/bus/vdev/vdev.c                       |  22 +-
 drivers/common/cnxk/cnxk_security.c           | 229 -------
 drivers/common/cnxk/cnxk_security.h           |  12 -
 drivers/common/cnxk/roc_dev.c                 |   2 +
 drivers/common/cnxk/roc_ie_on.h               |  60 --
 drivers/common/cnxk/roc_mbox.h                |  16 +-
 drivers/common/cnxk/roc_nix.c                 |   2 +-
 drivers/common/cnxk/roc_nix.h                 |   2 -
 drivers/common/cnxk/roc_nix_inl.c             |   6 +-
 drivers/common/cnxk/roc_nix_inl.h             |  50 +-
 drivers/common/cnxk/roc_nix_rss.c             |   4 +-
 drivers/common/cnxk/roc_nix_tm.c              |   3 +
 drivers/common/cnxk/version.map               |   4 -
 drivers/common/qat/qat_device.c               |   1 +
 drivers/crypto/qat/dev/qat_crypto_pmd_gens.h  |  10 +-
 drivers/crypto/qat/qat_sym.c                  |   1 -
 drivers/event/cnxk/cn10k_tx_worker.h          |   8 +-
 drivers/event/cnxk/cn9k_worker.h              |   9 +-
 drivers/event/dlb2/dlb2.c                     |   3 -
 drivers/net/af_xdp/rte_eth_af_xdp.c           |   8 +-
 drivers/net/bnx2x/bnx2x_stats.c               |  14 +-
 drivers/net/bnx2x/bnx2x_vfpf.c                |  14 +-
 drivers/net/bnxt/bnxt_reps.c                  |  23 +-
 drivers/net/cnxk/cn10k_ethdev.c               |   6 +
 drivers/net/cnxk/cn10k_rx.h                   |   2 +-
 drivers/net/cnxk/cn10k_rxtx.h                 |   1 +
 drivers/net/cnxk/cn10k_tx.h                   | 369 +++++++---
 drivers/net/cnxk/cn9k_ethdev.c                |   6 +
 drivers/net/cnxk/cn9k_ethdev.h                |   1 +
 drivers/net/cnxk/cn9k_tx.h                    | 377 ++++++++---
 drivers/net/cnxk/cnxk_ethdev_devargs.c        |   2 +-
 drivers/net/cnxk/cnxk_ethdev_dp.h             |  10 +-
 drivers/net/cnxk/cnxk_ethdev_ops.c            |  40 +-
 drivers/net/ena/base/ena_com.c                |  17 +-
 drivers/net/ena/ena_ethdev.c                  |  41 +-
 drivers/net/hns3/hns3_cmd.c                   |   4 +-
 drivers/net/hns3/hns3_dcb.c                   |   9 +-
 drivers/net/hns3/hns3_ethdev.c                |   2 +
 drivers/net/hns3/hns3_ethdev.h                |   2 +
 drivers/net/i40e/i40e_rxtx_vec_avx2.c         |  64 +-
 drivers/net/iavf/iavf_ethdev.c                |   7 +-
 drivers/net/iavf/iavf_rxtx_vec_avx2.c         |  80 +--
 drivers/net/ice/ice_rxtx_vec_avx2.c           |  80 +--
 drivers/net/igc/igc_ethdev.c                  |   2 +-
 drivers/net/ixgbe/base/ixgbe_type.h           |   2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                |  19 +
 drivers/net/mlx5/hws/mlx5dr_action.c          |   4 +-
 drivers/net/mlx5/hws/mlx5dr_definer.c         |  29 +-
 drivers/net/mlx5/hws/mlx5dr_rule.c            |  18 +-
 drivers/net/mlx5/hws/mlx5dr_send.c            |   1 +
 drivers/net/mlx5/hws/mlx5dr_send.h            |   1 +
 drivers/net/mlx5/linux/mlx5_ethdev_os.c       | 251 +++++--
 drivers/net/mlx5/mlx5.c                       |  16 +-
 drivers/net/mlx5/mlx5.h                       |  56 +-
 drivers/net/mlx5/mlx5_flow.c                  |  63 +-
 drivers/net/mlx5/mlx5_flow.h                  |  21 +-
 drivers/net/mlx5/mlx5_flow_aso.c              | 178 +++--
 drivers/net/mlx5/mlx5_flow_dv.c               | 298 +++++----
 drivers/net/mlx5/mlx5_flow_hw.c               | 631 +++++++++++-------
 drivers/net/mlx5/mlx5_flow_meter.c            |  55 +-
 drivers/net/mlx5/mlx5_hws_cnt.c               |  72 +-
 drivers/net/mlx5/mlx5_hws_cnt.h               |  25 +-
 drivers/net/mlx5/mlx5_rx.c                    |  19 +-
 drivers/net/mlx5/mlx5_stats.c                 |  58 +-
 drivers/net/mlx5/mlx5_trigger.c               |   8 +-
 drivers/net/mlx5/windows/mlx5_ethdev_os.c     |  22 +-
 drivers/net/nfp/flower/nfp_flower.c           |   3 +-
 drivers/net/nfp/nfp_ethdev.c                  |   1 -
 drivers/net/nfp/nfp_ipsec.c                   |  72 +-
 drivers/net/nfp/nfp_ipsec.h                   |   9 +-
 drivers/net/nfp/nfp_net_common.c              |   2 +-
 drivers/net/tap/tap_flow.c                    |  44 +-
 .../net/virtio/virtio_user/virtio_user_dev.c  |  22 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +
 .../remote_session/remote/remote_session.py   |  24 +-
 dts/tests/TestSuite_smoke_tests.py            |   2 +-
 examples/ipsec-secgw/ipsec-secgw.c            |   4 +-
 examples/ipsec-secgw/ipsec.c                  |  20 +-
 examples/ipsec-secgw/parser.c                 |   2 +-
 examples/l3fwd/main.c                         |  15 +-
 examples/packet_ordering/main.c               |  32 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  16 +-
 lib/eventdev/rte_eventdev.h                   |  71 +-
 lib/vhost/fd_man.c                            |  23 +-
 lib/vhost/fd_man.h                            |   6 +
 lib/vhost/socket.c                            |   1 +
 lib/vhost/vduse.c                             |   3 +-
 136 files changed, 2454 insertions(+), 1690 deletions(-)

--
2.34.1

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix configuration in baseband 5GNR driver guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'event/dlb2: remove superfluous memcpy' " Xueming Li
                     ` (122 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=4e8d39a298ee9a20d8602b4dc57b415ac907b681

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4e8d39a298ee9a20d8602b4dc57b415ac907b681 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 8 Feb 2024 08:50:33 -0800
Subject: [PATCH] doc: fix configuration in baseband 5GNR driver guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a46c1225141d2c099c70d98b38f1f9c20307ff6f ]

flr_timeout was removed from the code a while ago, updating doc.
Fix minor typo in 5GNR example.

Fixes: 2d4306438c92 ("baseband/fpga_5gnr_fec: add configure function")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 doc/guides/bbdevs/fpga_5gnr_fec.rst | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/doc/guides/bbdevs/fpga_5gnr_fec.rst b/doc/guides/bbdevs/fpga_5gnr_fec.rst
index 956dd6bed5..99fc936829 100644
--- a/doc/guides/bbdevs/fpga_5gnr_fec.rst
+++ b/doc/guides/bbdevs/fpga_5gnr_fec.rst
@@ -100,7 +100,6 @@ parameters defined in ``rte_fpga_5gnr_fec_conf`` structure:
       uint8_t dl_bandwidth;
       uint8_t ul_load_balance;
       uint8_t dl_load_balance;
-      uint16_t flr_time_out;
   };
 
 - ``pf_mode_en``: identifies whether only PF is to be used, or the VFs. PF and
@@ -126,10 +125,6 @@ parameters defined in ``rte_fpga_5gnr_fec_conf`` structure:
   If all hardware queues exceeds the watermark, no code blocks will be
   streamed in from UL/DL code block FIFO.
 
-- ``flr_time_out``: specifies how many 16.384us to be FLR time out. The
-  time_out = flr_time_out x 16.384us. For instance, if you want to set 10ms for
-  the FLR time out then set this setting to 0x262=610.
-
 
 An example configuration code calling the function ``rte_fpga_5gnr_fec_configure()`` is shown
 below:
@@ -154,7 +149,7 @@ below:
   /* setup FPGA PF */
   ret = rte_fpga_5gnr_fec_configure(info->dev_name, &conf);
   TEST_ASSERT_SUCCESS(ret,
-      "Failed to configure 4G FPGA PF for bbdev %s",
+      "Failed to configure 5GNR FPGA PF for bbdev %s",
       info->dev_name);
 
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.258058792 +0800
+++ 0002-doc-fix-configuration-in-baseband-5GNR-driver-guide.patch	2024-04-13 20:43:04.897754062 +0800
@@ -1 +1 @@
-From a46c1225141d2c099c70d98b38f1f9c20307ff6f Mon Sep 17 00:00:00 2001
+From 4e8d39a298ee9a20d8602b4dc57b415ac907b681 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a46c1225141d2c099c70d98b38f1f9c20307ff6f ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'event/dlb2: remove superfluous memcpy' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
  2024-04-13 12:48   ` patch 'doc: fix configuration in baseband 5GNR driver guide' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'test/event: fix crash in Tx adapter freeing' " Xueming Li
                     ` (121 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Morten Brørup; +Cc: Stephen Hemminger, Abdullah Sevincer, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=524c60f42279c9528ba1a61ca4b517a4095726c4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 524c60f42279c9528ba1a61ca4b517a4095726c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Br=C3=B8rup?= <mb@smartsharesystems.com>
Date: Mon, 16 Jan 2023 14:07:22 +0100
Subject: [PATCH] event/dlb2: remove superfluous memcpy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c1b086d2abdb7773700b4d216f323bd9278ace7a ]

Copying with the same src and dst address has no effect; removed to
avoid compiler warning with decorated rte_memcpy.

Fixes: e7c9971a857a ("event/dlb2: add probe-time hardware init")

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
---
 drivers/event/dlb2/dlb2.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904..5044cb17ef 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -160,7 +160,6 @@ static int
 dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
 {
 	struct dlb2_hw_dev *handle = &dlb2->qm_instance;
-	struct dlb2_hw_resource_info *dlb2_info = &handle->info;
 	int num_ldb_ports;
 	int ret;
 
@@ -222,8 +221,6 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
 	handle->info.hw_rsrc_max.reorder_window_size =
 		dlb2->hw_rsrc_query_results.num_hist_list_entries;
 
-	rte_memcpy(dlb2_info, &handle->info.hw_rsrc_max, sizeof(*dlb2_info));
-
 	return 0;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.290679049 +0800
+++ 0003-event-dlb2-remove-superfluous-memcpy.patch	2024-04-13 20:43:04.897754062 +0800
@@ -1 +1 @@
-From c1b086d2abdb7773700b4d216f323bd9278ace7a Mon Sep 17 00:00:00 2001
+From 524c60f42279c9528ba1a61ca4b517a4095726c4 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c1b086d2abdb7773700b4d216f323bd9278ace7a ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 271bbce54a..628ddef649 100644
+index 050ace0904..5044cb17ef 100644
@@ -26 +28 @@
-@@ -163,7 +163,6 @@ static int
+@@ -160,7 +160,6 @@ static int
@@ -34 +36 @@
-@@ -225,8 +224,6 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
+@@ -222,8 +221,6 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test/event: fix crash in Tx adapter freeing' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
  2024-04-13 12:48   ` patch 'doc: fix configuration in baseband 5GNR driver guide' " Xueming Li
  2024-04-13 12:48   ` patch 'event/dlb2: remove superfluous memcpy' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'eventdev: improve Doxygen comments on configure struct' " Xueming Li
                     ` (120 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Pavan Nikhilesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7721c9f49898ed88162fdf4efb22986cad8018fb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7721c9f49898ed88162fdf4efb22986cad8018fb Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Mon, 26 Feb 2024 02:30:03 -0600
Subject: [PATCH] test/event: fix crash in Tx adapter freeing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1f85467fcaf03c6b0d879614ee18f9a98fe9e9e6 ]

Uninitialized mbufs are enqueued to eventdev which causes segfault
on freeing the mbuf in Tx adapter.
Fixed by initializing mbufs before enqueuing to eventdev.

Fixes: 46cf97e4bbfa ("eventdev: add test for eth Tx adapter")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test/test_event_eth_tx_adapter.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
index dbd22f6800..482b8e69e3 100644
--- a/app/test/test_event_eth_tx_adapter.c
+++ b/app/test/test_event_eth_tx_adapter.c
@@ -484,6 +484,10 @@ tx_adapter_service(void)
 	int internal_port;
 	uint32_t cap;
 
+	/* Initialize mbufs */
+	for (i = 0; i < RING_SIZE; i++)
+		rte_pktmbuf_reset(&bufs[i]);
+
 	memset(&dev_conf, 0, sizeof(dev_conf));
 	err = rte_event_eth_tx_adapter_caps_get(TEST_DEV_ID, TEST_ETHDEV_ID,
 						&cap);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.327714801 +0800
+++ 0004-test-event-fix-crash-in-Tx-adapter-freeing.patch	2024-04-13 20:43:04.897754062 +0800
@@ -1 +1 @@
-From 1f85467fcaf03c6b0d879614ee18f9a98fe9e9e6 Mon Sep 17 00:00:00 2001
+From 7721c9f49898ed88162fdf4efb22986cad8018fb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1f85467fcaf03c6b0d879614ee18f9a98fe9e9e6 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eventdev: improve Doxygen comments on configure struct' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (2 preceding siblings ...)
  2024-04-13 12:48   ` patch 'test/event: fix crash in Tx adapter freeing' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'eventdev: fix Doxygen processing of vector " Xueming Li
                     ` (119 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Pavan Nikhilesh, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2faf71417f2c08153a844df70beae6ff68a20e5b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2faf71417f2c08153a844df70beae6ff68a20e5b Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 21 Feb 2024 10:32:15 +0000
Subject: [PATCH] eventdev: improve Doxygen comments on configure struct
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1203462c5ada21bdace88e009db5a8f17f88528a ]

General rewording and cleanup on the rte_event_dev_config structure.
Improved the wording of some sentences and created linked
cross-references out of the existing references to the dev_info
structure.

As part of the rework, fix issue with how single-link port-queue pairs
were counted in the rte_event_dev_config structure. This did not match
the actual implementation and, if following the documentation, certain
valid port/queue configurations would have been impossible to configure.
Fix this by changing the documentation to match the implementation

Bugzilla ID:  1368
Fixes: 75d113136f38 ("eventdev: express DLB/DLB2 PMD constraints")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/eventdev/rte_eventdev.h | 61 ++++++++++++++++++++++---------------
 1 file changed, 37 insertions(+), 24 deletions(-)

diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index ec9b02455d..a3e2f9f862 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -515,9 +515,9 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
 struct rte_event_dev_config {
 	uint32_t dequeue_timeout_ns;
 	/**< rte_event_dequeue_burst() timeout on this device.
-	 * This value should be in the range of *min_dequeue_timeout_ns* and
-	 * *max_dequeue_timeout_ns* which previously provided in
-	 * rte_event_dev_info_get()
+	 * This value should be in the range of @ref rte_event_dev_info.min_dequeue_timeout_ns and
+	 * @ref rte_event_dev_info.max_dequeue_timeout_ns returned by
+	 * @ref rte_event_dev_info_get()
 	 * The value 0 is allowed, in which case, default dequeue timeout used.
 	 * @see RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT
 	 */
@@ -525,40 +525,53 @@ struct rte_event_dev_config {
 	/**< In a *closed system* this field is the limit on maximum number of
 	 * events that can be inflight in the eventdev at a given time. The
 	 * limit is required to ensure that the finite space in a closed system
-	 * is not overwhelmed. The value cannot exceed the *max_num_events*
-	 * as provided by rte_event_dev_info_get().
-	 * This value should be set to -1 for *open system*.
+	 * is not exhausted.
+	 * The value cannot exceed @ref rte_event_dev_info.max_num_events
+	 * returned by rte_event_dev_info_get().
+	 *
+	 * This value should be set to -1 for *open systems*, that is,
+	 * those systems returning -1 in @ref rte_event_dev_info.max_num_events.
+	 *
+	 * @see rte_event_port_conf.new_event_threshold
 	 */
 	uint8_t nb_event_queues;
 	/**< Number of event queues to configure on this device.
-	 * This value cannot exceed the *max_event_queues* which previously
-	 * provided in rte_event_dev_info_get()
+	 * This value *includes* any single-link queue-port pairs to be used.
+	 * This value cannot exceed @ref rte_event_dev_info.max_event_queues +
+	 * @ref rte_event_dev_info.max_single_link_event_port_queue_pairs
+	 * returned by rte_event_dev_info_get().
+	 * The number of non-single-link queues i.e. this value less
+	 * *nb_single_link_event_port_queues* in this struct, cannot exceed
+	 * @ref rte_event_dev_info.max_event_queues
 	 */
 	uint8_t nb_event_ports;
 	/**< Number of event ports to configure on this device.
-	 * This value cannot exceed the *max_event_ports* which previously
-	 * provided in rte_event_dev_info_get()
+	 * This value *includes* any single-link queue-port pairs to be used.
+	 * This value cannot exceed @ref rte_event_dev_info.max_event_ports +
+	 * @ref rte_event_dev_info.max_single_link_event_port_queue_pairs
+	 * returned by rte_event_dev_info_get().
+	 * The number of non-single-link ports i.e. this value less
+	 * *nb_single_link_event_port_queues* in this struct, cannot exceed
+	 * @ref rte_event_dev_info.max_event_ports
 	 */
 	uint32_t nb_event_queue_flows;
-	/**< Number of flows for any event queue on this device.
-	 * This value cannot exceed the *max_event_queue_flows* which previously
-	 * provided in rte_event_dev_info_get()
+	/**< Max number of flows needed for a single event queue on this device.
+	 * This value cannot exceed @ref rte_event_dev_info.max_event_queue_flows
+	 * returned by rte_event_dev_info_get()
 	 */
 	uint32_t nb_event_port_dequeue_depth;
-	/**< Maximum number of events can be dequeued at a time from an
-	 * event port by this device.
-	 * This value cannot exceed the *max_event_port_dequeue_depth*
-	 * which previously provided in rte_event_dev_info_get().
+	/**< Max number of events that can be dequeued at a time from an event port on this device.
+	 * This value cannot exceed @ref rte_event_dev_info.max_event_port_dequeue_depth
+	 * returned by rte_event_dev_info_get().
 	 * Ignored when device is not RTE_EVENT_DEV_CAP_BURST_MODE capable.
-	 * @see rte_event_port_setup()
+	 * @see rte_event_port_setup() rte_event_dequeue_burst()
 	 */
 	uint32_t nb_event_port_enqueue_depth;
-	/**< Maximum number of events can be enqueued at a time from an
-	 * event port by this device.
-	 * This value cannot exceed the *max_event_port_enqueue_depth*
-	 * which previously provided in rte_event_dev_info_get().
+	/**< Maximum number of events can be enqueued at a time to an event port on this device.
+	 * This value cannot exceed @ref rte_event_dev_info.max_event_port_enqueue_depth
+	 * returned by rte_event_dev_info_get().
 	 * Ignored when device is not RTE_EVENT_DEV_CAP_BURST_MODE capable.
-	 * @see rte_event_port_setup()
+	 * @see rte_event_port_setup() rte_event_enqueue_burst()
 	 */
 	uint32_t event_dev_cfg;
 	/**< Event device config flags(RTE_EVENT_DEV_CFG_)*/
@@ -568,7 +581,7 @@ struct rte_event_dev_config {
 	 * queues; this value cannot exceed *nb_event_ports* or
 	 * *nb_event_queues*. If the device has ports and queues that are
 	 * optimized for single-link usage, this field is a hint for how many
-	 * to allocate; otherwise, regular event ports and queues can be used.
+	 * to allocate; otherwise, regular event ports and queues will be used.
 	 */
 };
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.350252471 +0800
+++ 0005-eventdev-improve-Doxygen-comments-on-configure-struc.patch	2024-04-13 20:43:04.897754062 +0800
@@ -1 +1 @@
-From 1203462c5ada21bdace88e009db5a8f17f88528a Mon Sep 17 00:00:00 2001
+From 2faf71417f2c08153a844df70beae6ff68a20e5b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1203462c5ada21bdace88e009db5a8f17f88528a ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 9808889625..fb1c4429f0 100644
+index ec9b02455d..a3e2f9f862 100644
@@ -32 +34 @@
-@@ -684,9 +684,9 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
+@@ -515,9 +515,9 @@ rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
@@ -45 +47 @@
-@@ -694,40 +694,53 @@ struct rte_event_dev_config {
+@@ -525,40 +525,53 @@ struct rte_event_dev_config {
@@ -119 +121 @@
-@@ -737,7 +750,7 @@ struct rte_event_dev_config {
+@@ -568,7 +581,7 @@ struct rte_event_dev_config {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eventdev: fix Doxygen processing of vector struct' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (3 preceding siblings ...)
  2024-04-13 12:48   ` patch 'eventdev: improve Doxygen comments on configure struct' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'eventdev/crypto: fix enqueueing' " Xueming Li
                     ` (118 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Pavan Nikhilesh, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e5ed46471041c6777095d01f2f4d057c1be2b3af

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e5ed46471041c6777095d01f2f4d057c1be2b3af Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 21 Feb 2024 10:32:21 +0000
Subject: [PATCH] eventdev: fix Doxygen processing of vector struct
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f5746d3fa2f9f08179878c22a0ec1f598a7f15a1 ]

The event vector struct was missing comments on two members, and also
was inadvertently creating a local variable called "__rte_aligned" in
the doxygen output.

Correct the comment markers to fix the former issue, and fix the latter
by putting "#ifdef __DOXYGEN" around the alignment constraint.

Fixes: 1cc44d409271 ("eventdev: introduce event vector capability")
Fixes: 3c838062b91f ("eventdev: introduce event vector Rx capability")
Fixes: 699155f2d4e2 ("eventdev: fix clang C++ include")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/eventdev/rte_eventdev.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index a3e2f9f862..7fd9016ca7 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1111,10 +1111,8 @@ struct rte_event_vector {
 		 * port and queue of the mbufs in the vector
 		 */
 		struct {
-			uint16_t port;
-			/* Ethernet device port id. */
-			uint16_t queue;
-			/* Ethernet device queue id. */
+			uint16_t port;   /**< Ethernet device port id. */
+			uint16_t queue;  /**< Ethernet device queue id. */
 		};
 	};
 	/**< Union to hold common attributes of the vector array. */
@@ -1143,7 +1141,11 @@ struct rte_event_vector {
 	 * vector array can be an array of mbufs or pointers or opaque u64
 	 * values.
 	 */
+#ifndef __DOXYGEN__
 } __rte_aligned(16);
+#else
+};
+#endif
 
 /* Scheduler type definitions */
 #define RTE_SCHED_TYPE_ORDERED          0
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.379822833 +0800
+++ 0006-eventdev-fix-Doxygen-processing-of-vector-struct.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From f5746d3fa2f9f08179878c22a0ec1f598a7f15a1 Mon Sep 17 00:00:00 2001
+From e5ed46471041c6777095d01f2f4d057c1be2b3af Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f5746d3fa2f9f08179878c22a0ec1f598a7f15a1 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 913fe38974..3af46864df 100644
+index a3e2f9f862..7fd9016ca7 100644
@@ -29 +31 @@
-@@ -1358,10 +1358,8 @@ struct rte_event_vector {
+@@ -1111,10 +1111,8 @@ struct rte_event_vector {
@@ -42 +44 @@
-@@ -1390,7 +1388,11 @@ struct rte_event_vector {
+@@ -1143,7 +1141,11 @@ struct rte_event_vector {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'eventdev/crypto: fix enqueueing' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (4 preceding siblings ...)
  2024-04-13 12:48   ` patch 'eventdev: fix Doxygen processing of vector " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/crypto-perf: fix copy segment size' " Xueming Li
                     ` (117 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b2cd908926f9d8d9046e850dc0ca2a6494ef724b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b2cd908926f9d8d9046e850dc0ca2a6494ef724b Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Wed, 28 Feb 2024 04:39:19 -0600
Subject: [PATCH] eventdev/crypto: fix enqueueing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ]

When tail pointer of circular buffer rolls over as the circular buffer
becomes full, crypto adapter is enqueueing ops beyond the size of the
circular buffer leading to segfault due to invalid ops access.

Fixed by enqueueing ops from head pointer to (size-head) number of ops
when circular buffer becomes full and the remaining ops will be flushed
in next iteration.

Fixes: 6c3c888656fc ("eventdev/crypto: fix circular buffer full case")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index d46595d190..9903f96695 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -245,20 +245,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
 	struct rte_crypto_op **ops = bufp->op_buffer;
 
 	if (*tailp > *headp)
+		/* Flush ops from head pointer to (tail - head) OPs */
 		n = *tailp - *headp;
 	else if (*tailp < *headp)
+		/* Circ buffer - Rollover.
+		 * Flush OPs from head to max size of buffer.
+		 * Rest of the OPs will be flushed in next iteration.
+		 */
 		n = bufp->size - *headp;
 	else { /* head == tail case */
 		/* when head == tail,
 		 * circ buff is either full(tail pointer roll over) or empty
 		 */
 		if (bufp->count != 0) {
-			/* circ buffer is full */
-			n = bufp->count;
+			/* Circ buffer - FULL.
+			 * Flush OPs from head to max size of buffer.
+			 * Rest of the OPS will be flushed in next iteration.
+			 */
+			n = bufp->size - *headp;
 		} else {
-			/* circ buffer is empty */
+			/* Circ buffer - Empty */
 			*nb_ops_flushed = 0;
-			return 0;  /* buffer empty */
+			return 0;
 		}
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.411943791 +0800
+++ 0007-eventdev-crypto-fix-enqueueing.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 Mon Sep 17 00:00:00 2001
+From b2cd908926f9d8d9046e850dc0ca2a6494ef724b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: fix copy segment size' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (5 preceding siblings ...)
  2024-04-13 12:48   ` patch 'eventdev/crypto: fix enqueueing' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/crypto-perf: fix out-of-place mbuf " Xueming Li
                     ` (116 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f0cfffc636bac0f4bf8c064a36de2cac27d4ca03

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f0cfffc636bac0f4bf8c064a36de2cac27d4ca03 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Wed, 3 Jan 2024 12:00:23 +0800
Subject: [PATCH] app/crypto-perf: fix copy segment size
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7c31d17f68f615c31811afa1830fa0e38956ffc4 ]

For the case crypto device requires headroom and tailroom,
the segment_sz in options also contains the headroom_sz
and tailroom_sz, but mbuf's data_len is user's segment_sz
without headroom_sz and tailroom_sz. That means the data
size to be copied should use user's segment_sz instead
of options->segment_sz.

This commit fixes the copy segment size calculation.

Fixes: 14864c4217ce ("test/crypto-perf: populate mbuf in latency test")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index b3bf9f67e8..dbb08588ee 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -268,7 +268,7 @@ cperf_mbuf_set(struct rte_mbuf *mbuf,
 		const struct cperf_options *options,
 		const struct cperf_test_vector *test_vector)
 {
-	uint32_t segment_sz = options->segment_sz;
+	uint32_t segment_sz = options->segment_sz - options->headroom_sz - options->tailroom_sz;
 	uint8_t *mbuf_data;
 	uint8_t *test_data;
 	uint32_t remaining_bytes = options->max_buffer_size;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.435337760 +0800
+++ 0008-app-crypto-perf-fix-copy-segment-size.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 7c31d17f68f615c31811afa1830fa0e38956ffc4 Mon Sep 17 00:00:00 2001
+From f0cfffc636bac0f4bf8c064a36de2cac27d4ca03 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7c31d17f68f615c31811afa1830fa0e38956ffc4 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: fix out-of-place mbuf size' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (6 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/crypto-perf: fix copy segment size' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/crypto-perf: add missing op resubmission' " Xueming Li
                     ` (115 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a1f1843146e243594b105d0732aeae39196eb1c6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a1f1843146e243594b105d0732aeae39196eb1c6 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Wed, 3 Jan 2024 12:00:24 +0800
Subject: [PATCH] app/crypto-perf: fix out-of-place mbuf size
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 24515c93197091437e32f35bba3f467c01633c1d ]

If crypto device requires headroom and tailroom, the mbuf
of dst in out-of-place should reserve the headroom and
tailroom as well, otherwise there will be no enough room
for dst mbuf.

Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index dbb08588ee..94d39fb177 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -226,7 +226,8 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 				(mbuf_size * segments_nb);
 		params.dst_buf_offset = *dst_buf_offset;
 		/* Destination buffer will be one segment only */
-		obj_size += max_size + sizeof(struct rte_mbuf);
+		obj_size += max_size + sizeof(struct rte_mbuf) +
+			options->headroom_sz + options->tailroom_sz;
 	}
 
 	*pool = rte_mempool_create_empty(pool_name,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.457471131 +0800
+++ 0009-app-crypto-perf-fix-out-of-place-mbuf-size.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 24515c93197091437e32f35bba3f467c01633c1d Mon Sep 17 00:00:00 2001
+From a1f1843146e243594b105d0732aeae39196eb1c6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 24515c93197091437e32f35bba3f467c01633c1d ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/crypto-perf: add missing op resubmission' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (7 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/crypto-perf: fix out-of-place mbuf " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'doc: fix typos in cryptodev overview' " Xueming Li
                     ` (114 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Anoob Joseph, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=14c38e2db1ea3f8d09969caec97facbb93600526

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 14c38e2db1ea3f8d09969caec97facbb93600526 Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Mon, 15 Jan 2024 16:08:30 +0800
Subject: [PATCH] app/crypto-perf: add missing op resubmission
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 74d7c028ecf478f18cf9623210bab459d5992d7a ]

Currently, after enqueue_burst, there may be ops_unused ops
left for next round enqueue. And in next round preparation,
only ops_needed ops will be added. But if in the final round
the left ops is less than ops_needed, there will be invalid
ops between the new needed ops and previous unused ops. The
previous unused ops should be moved front after the needed
ops.

In the commit[1], an resubmission fix was added to throughput
test, and the fix was missed for verify.

This commit adds the missed resubmission fix for verify.

[1]
commit 44e2980b70d1 ("app/crypto-perf: fix crypto operation resubmission")

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test-crypto-perf/cperf_test_verify.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index 2b0d3f142b..10172a53a0 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -275,7 +275,6 @@ cperf_verify_test_runner(void *test_ctx)
 				ops_needed, ctx->sess, ctx->options,
 				ctx->test_vector, iv_offset, &imix_idx, NULL);
 
-
 		/* Populate the mbuf with the test vector, for verification */
 		for (i = 0; i < ops_needed; i++)
 			cperf_mbuf_set(ops[i]->sym->m_src,
@@ -293,6 +292,17 @@ cperf_verify_test_runner(void *test_ctx)
 		}
 #endif /* CPERF_LINEARIZATION_ENABLE */
 
+		/**
+		 * When ops_needed is smaller than ops_enqd, the
+		 * unused ops need to be moved to the front for
+		 * next round use.
+		 */
+		if (unlikely(ops_enqd > ops_needed)) {
+			size_t nb_b_to_mov = ops_unused * sizeof(struct rte_crypto_op *);
+
+			memmove(&ops[ops_needed], &ops[ops_enqd], nb_b_to_mov);
+		}
+
 		/* Enqueue burst of ops on crypto device */
 		ops_enqd = rte_cryptodev_enqueue_burst(ctx->dev_id, ctx->qp_id,
 				ops, burst_size);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.479948002 +0800
+++ 0010-app-crypto-perf-add-missing-op-resubmission.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 74d7c028ecf478f18cf9623210bab459d5992d7a Mon Sep 17 00:00:00 2001
+From 14c38e2db1ea3f8d09969caec97facbb93600526 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 74d7c028ecf478f18cf9623210bab459d5992d7a ]
@@ -23 +25,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix typos in cryptodev overview' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (8 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/crypto-perf: add missing op resubmission' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/qat: fix legacy flag' " Xueming Li
                     ` (113 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Andrew Boyer; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6cacd0e502e6228008f269d8204fa736c56313ca

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6cacd0e502e6228008f269d8204fa736c56313ca Mon Sep 17 00:00:00 2001
From: Andrew Boyer <andrew.boyer@amd.com>
Date: Thu, 22 Feb 2024 09:41:11 -0800
Subject: [PATCH] doc: fix typos in cryptodev overview
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 85256fea3859b57451657919486e4559b0f2677c ]

Very minor improvements.

Fixes: 2717246ecd7d ("cryptodev: replace mbuf scatter gather flag")

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/cryptodevs/overview.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guides/cryptodevs/overview.rst b/doc/guides/cryptodevs/overview.rst
index d754b0cfc6..b068d0d19c 100644
--- a/doc/guides/cryptodevs/overview.rst
+++ b/doc/guides/cryptodevs/overview.rst
@@ -20,17 +20,17 @@ Supported Feature Flags
    - "OOP SGL In SGL Out" feature flag stands for
      "Out-of-place Scatter-gather list Input, Scatter-gather list Output",
      which means PMD supports different scatter-gather styled input and output buffers
-     (i.e. both can consists of multiple segments).
+     (i.e. both can consist of multiple segments).
 
    - "OOP SGL In LB Out" feature flag stands for
      "Out-of-place Scatter-gather list Input, Linear Buffers Output",
-     which means PMD supports input from scatter-gathered styled buffers,
+     which means PMD supports input from scatter-gather styled buffers,
      outputting linear buffers (i.e. single segment).
 
    - "OOP LB In SGL Out" feature flag stands for
      "Out-of-place Linear Buffers Input, Scatter-gather list Output",
      which means PMD supports input from linear buffer, outputting
-     scatter-gathered styled buffers.
+     scatter-gather styled buffers.
 
    - "OOP LB In LB Out" feature flag stands for
      "Out-of-place Linear Buffers Input, Linear Buffers Output",
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.503547371 +0800
+++ 0011-doc-fix-typos-in-cryptodev-overview.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 85256fea3859b57451657919486e4559b0f2677c Mon Sep 17 00:00:00 2001
+From 6cacd0e502e6228008f269d8204fa736c56313ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 85256fea3859b57451657919486e4559b0f2677c ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/qat: fix legacy flag' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (9 preceding siblings ...)
  2024-04-13 12:48   ` patch 'doc: fix typos in cryptodev overview' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'vhost: fix VDUSE device destruction failure' " Xueming Li
                     ` (112 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Arkadiusz Kusztal; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=af414b892d61870494e57aba0b9147ecec03c3d1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From af414b892d61870494e57aba0b9147ecec03c3d1 Mon Sep 17 00:00:00 2001
From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Date: Fri, 1 Mar 2024 15:52:51 +0000
Subject: [PATCH] common/qat: fix legacy flag
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8191276fc5c10d55df72fd3bb80f97409b620318 ]

This commit fixes a legacy flag, which was placed in a file
that may not be included in a building process.

Fixes: cffb726b7797 ("crypto/qat: enable insecure algorithms")

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/common/qat/qat_device.c | 1 +
 drivers/crypto/qat/qat_sym.c    | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c
index f55dc3c6f0..eceb5c89c4 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -29,6 +29,7 @@ struct qat_dev_hw_spec_funcs *qat_dev_hw_spec[QAT_N_GENS];
 /* per-process array of device data */
 struct qat_device_info qat_pci_devs[RTE_PMD_QAT_MAX_PCI_DEVICES];
 static int qat_nb_pci_devices;
+int qat_legacy_capa;
 
 /*
  * The set of PCI devices this driver supports
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index 6e03bde841..4fa539769b 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -18,7 +18,6 @@
 #include "qat_qp.h"
 
 uint8_t qat_sym_driver_id;
-int qat_legacy_capa;
 
 struct qat_crypto_gen_dev_ops qat_sym_gen_dev_ops[QAT_N_GENS];
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.526426641 +0800
+++ 0012-common-qat-fix-legacy-flag.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 8191276fc5c10d55df72fd3bb80f97409b620318 Mon Sep 17 00:00:00 2001
+From af414b892d61870494e57aba0b9147ecec03c3d1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8191276fc5c10d55df72fd3bb80f97409b620318 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index a27252ea4d..500ca0f308 100644
+index f55dc3c6f0..eceb5c89c4 100644
@@ -23 +25 @@
-@@ -31,6 +31,7 @@ struct qat_service qat_service[QAT_MAX_SERVICES];
+@@ -29,6 +29,7 @@ struct qat_dev_hw_spec_funcs *qat_dev_hw_spec[QAT_N_GENS];
@@ -32 +34 @@
-index efca8f3ba1..6c7b1724ef 100644
+index 6e03bde841..4fa539769b 100644
@@ -35 +37 @@
-@@ -19,7 +19,6 @@
+@@ -18,7 +18,6 @@
@@ -41,2 +43,2 @@
- #define SYM_ENQ_THRESHOLD_NAME "qat_sym_enq_threshold"
- #define SYM_CIPHER_CRC_ENABLE_NAME "qat_sym_cipher_crc_enable"
+ struct qat_crypto_gen_dev_ops qat_sym_gen_dev_ops[QAT_N_GENS];
+ 

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'vhost: fix VDUSE device destruction failure' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (10 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/qat: fix legacy flag' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/af_xdp: fix leak on XSK configuration " Xueming Li
                     ` (111 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b2dba501cf2d141ae2cb01faf58077b62ffb57d2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b2dba501cf2d141ae2cb01faf58077b62ffb57d2 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Thu, 29 Feb 2024 13:24:56 +0100
Subject: [PATCH] vhost: fix VDUSE device destruction failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit deedfb86a7a6e10064d3cccd593f62072de96e36 ]

VDUSE_DESTROY_DEVICE ioctl can fail because the device's
chardev is not released despite close syscall having been
called. It happens because the events handler thread is
still polling the file descriptor.

fdset_pipe_notify() is not enough because it does not
ensure the notification has been handled by the event
thread, it just returns once the notification is sent.

To fix this, this patch introduces a synchronization
mechanism based on pthread's condition, so that
fdset_pipe_notify_sync() only returns once the pipe's
read callback has been executed.

Fixes: 51d018fdac4e ("vhost: add VDUSE events handler")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/fd_man.c | 23 +++++++++++++++++++++--
 lib/vhost/fd_man.h |  6 ++++++
 lib/vhost/socket.c |  1 +
 lib/vhost/vduse.c  |  3 ++-
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 134414fb4b..84c5da0793 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -307,10 +307,11 @@ fdset_event_dispatch(void *arg)
 }
 
 static void
-fdset_pipe_read_cb(int readfd, void *dat __rte_unused,
+fdset_pipe_read_cb(int readfd, void *dat,
 		   int *remove __rte_unused)
 {
 	char charbuf[16];
+	struct fdset *fdset = dat;
 	int r = read(readfd, charbuf, sizeof(charbuf));
 	/*
 	 * Just an optimization, we don't care if read() failed
@@ -318,6 +319,11 @@ fdset_pipe_read_cb(int readfd, void *dat __rte_unused,
 	 * compiler happy
 	 */
 	RTE_SET_USED(r);
+
+	pthread_mutex_lock(&fdset->sync_mutex);
+	fdset->sync = true;
+	pthread_cond_broadcast(&fdset->sync_cond);
+	pthread_mutex_unlock(&fdset->sync_mutex);
 }
 
 void
@@ -340,7 +346,7 @@ fdset_pipe_init(struct fdset *fdset)
 	}
 
 	ret = fdset_add(fdset, fdset->u.readfd,
-			fdset_pipe_read_cb, NULL, NULL);
+			fdset_pipe_read_cb, NULL, fdset);
 
 	if (ret < 0) {
 		RTE_LOG(ERR, VHOST_FDMAN,
@@ -364,5 +370,18 @@ fdset_pipe_notify(struct fdset *fdset)
 	 * compiler happy
 	 */
 	RTE_SET_USED(r);
+}
+
+void
+fdset_pipe_notify_sync(struct fdset *fdset)
+{
+	pthread_mutex_lock(&fdset->sync_mutex);
+
+	fdset->sync = false;
+	fdset_pipe_notify(fdset);
+
+	while (!fdset->sync)
+		pthread_cond_wait(&fdset->sync_cond, &fdset->sync_mutex);
 
+	pthread_mutex_unlock(&fdset->sync_mutex);
 }
diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h
index 6315904c8e..7816fb11ac 100644
--- a/lib/vhost/fd_man.h
+++ b/lib/vhost/fd_man.h
@@ -6,6 +6,7 @@
 #define _FD_MAN_H_
 #include <pthread.h>
 #include <poll.h>
+#include <stdbool.h>
 
 #define MAX_FDS 1024
 
@@ -35,6 +36,10 @@ struct fdset {
 			int writefd;
 		};
 	} u;
+
+	pthread_mutex_t sync_mutex;
+	pthread_cond_t sync_cond;
+	bool sync;
 };
 
 
@@ -53,5 +58,6 @@ int fdset_pipe_init(struct fdset *fdset);
 void fdset_pipe_uninit(struct fdset *fdset);
 
 void fdset_pipe_notify(struct fdset *fdset);
+void fdset_pipe_notify_sync(struct fdset *fdset);
 
 #endif
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 5882e44176..0b95c54c5b 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -93,6 +93,7 @@ static struct vhost_user vhost_user = {
 		.fd = { [0 ... MAX_FDS - 1] = {-1, NULL, NULL, NULL, 0} },
 		.fd_mutex = PTHREAD_MUTEX_INITIALIZER,
 		.fd_pooling_mutex = PTHREAD_MUTEX_INITIALIZER,
+		.sync_mutex = PTHREAD_MUTEX_INITIALIZER,
 		.num = 0
 	},
 	.vsocket_cnt = 0,
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index e198eeef64..b46f0e53c7 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -36,6 +36,7 @@ static struct vduse vduse = {
 		.fd = { [0 ... MAX_FDS - 1] = {-1, NULL, NULL, NULL, 0} },
 		.fd_mutex = PTHREAD_MUTEX_INITIALIZER,
 		.fd_pooling_mutex = PTHREAD_MUTEX_INITIALIZER,
+		.sync_mutex = PTHREAD_MUTEX_INITIALIZER,
 		.num = 0
 	},
 };
@@ -618,7 +619,7 @@ vduse_device_destroy(const char *path)
 	vduse_device_stop(dev);
 
 	fdset_del(&vduse.fdset, dev->vduse_dev_fd);
-	fdset_pipe_notify(&vduse.fdset);
+	fdset_pipe_notify_sync(&vduse.fdset);
 
 	if (dev->vduse_dev_fd >= 0) {
 		close(dev->vduse_dev_fd);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.548843712 +0800
+++ 0013-vhost-fix-VDUSE-device-destruction-failure.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From deedfb86a7a6e10064d3cccd593f62072de96e36 Mon Sep 17 00:00:00 2001
+From b2dba501cf2d141ae2cb01faf58077b62ffb57d2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit deedfb86a7a6e10064d3cccd593f62072de96e36 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -34 +36 @@
-index 79a8d2c006..481e6b900a 100644
+index 134414fb4b..84c5da0793 100644
@@ -37 +39 @@
-@@ -309,10 +309,11 @@ fdset_event_dispatch(void *arg)
+@@ -307,10 +307,11 @@ fdset_event_dispatch(void *arg)
@@ -50 +52 @@
-@@ -320,6 +321,11 @@ fdset_pipe_read_cb(int readfd, void *dat __rte_unused,
+@@ -318,6 +319,11 @@ fdset_pipe_read_cb(int readfd, void *dat __rte_unused,
@@ -62 +64 @@
-@@ -342,7 +348,7 @@ fdset_pipe_init(struct fdset *fdset)
+@@ -340,7 +346,7 @@ fdset_pipe_init(struct fdset *fdset)
@@ -70,2 +72,2 @@
- 		VHOST_FDMAN_LOG(ERR,
-@@ -366,5 +372,18 @@ fdset_pipe_notify(struct fdset *fdset)
+ 		RTE_LOG(ERR, VHOST_FDMAN,
+@@ -364,5 +370,18 @@ fdset_pipe_notify(struct fdset *fdset)
@@ -121 +123 @@
-index a2fdac30a4..96b3ab5595 100644
+index 5882e44176..0b95c54c5b 100644
@@ -133 +135 @@
-index d462428d2c..e0c6991b69 100644
+index e198eeef64..b46f0e53c7 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/af_xdp: fix leak on XSK configuration failure' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (11 preceding siblings ...)
  2024-04-13 12:48   ` patch 'vhost: fix VDUSE device destruction failure' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/testpmd: fix flow modify tag typo' " Xueming Li
                     ` (110 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Yunjian Wang; +Cc: Ciara Loftus, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c2d52df5993845a8baac976c631d4794458313ba

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c2d52df5993845a8baac976c631d4794458313ba Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 23 Feb 2024 09:45:45 +0800
Subject: [PATCH] net/af_xdp: fix leak on XSK configuration failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 955acb9594cec548ae57319bfc99d4297d773675 ]

In xdp_umem_configure() allocated some resources for the
xsk umem, we should delete them when xsk configure fails,
otherwise it will lead to resources leak.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 2d151e45c7..268a130c49 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -960,6 +960,9 @@ remove_xdp_program(struct pmd_internals *internals)
 static void
 xdp_umem_destroy(struct xsk_umem_info *umem)
 {
+	(void)xsk_umem__delete(umem->umem);
+	umem->umem = NULL;
+
 #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)
 	umem->mb_pool = NULL;
 #else
@@ -992,11 +995,8 @@ eth_dev_close(struct rte_eth_dev *dev)
 			break;
 		xsk_socket__delete(rxq->xsk);
 
-		if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1
-				== 0) {
-			(void)xsk_umem__delete(rxq->umem->umem);
+		if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0)
 			xdp_umem_destroy(rxq->umem);
-		}
 
 		/* free pkt_tx_queue */
 		rte_free(rxq->pair);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.577879974 +0800
+++ 0014-net-af_xdp-fix-leak-on-XSK-configuration-failure.patch	2024-04-13 20:43:04.907754049 +0800
@@ -1 +1 @@
-From 955acb9594cec548ae57319bfc99d4297d773675 Mon Sep 17 00:00:00 2001
+From c2d52df5993845a8baac976c631d4794458313ba Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 955acb9594cec548ae57319bfc99d4297d773675 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix flow modify tag typo' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (12 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/af_xdp: fix leak on XSK configuration " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix modify flex item' " Xueming Li
                     ` (109 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rongwei Liu; +Cc: Dariusz Sosnowski, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=4d1331e9725ad7947d98287f9cecce516c73c311

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4d1331e9725ad7947d98287f9cecce516c73c311 Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil@nvidia.com>
Date: Fri, 23 Feb 2024 05:21:54 +0200
Subject: [PATCH] app/testpmd: fix flow modify tag typo
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c68992beeeef90be917b88e013cb9dcbe2ee221e ]

Update the name to the right one: "src_tag_index"

Fixes: c23626f27b09 ("ethdev: add MPLS header modification")

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/cmdline_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index ce71818705..5647add29a 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -6905,7 +6905,7 @@ static const struct token token_list[] = {
 		.comp = comp_none,
 	},
 	[ACTION_MODIFY_FIELD_SRC_TAG_INDEX] = {
-		.name = "stc_tag_index",
+		.name = "src_tag_index",
 		.help = "source field tag array",
 		.next = NEXT(action_modify_field_src,
 			     NEXT_ENTRY(COMMON_UNSIGNED)),
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.608018034 +0800
+++ 0015-app-testpmd-fix-flow-modify-tag-typo.patch	2024-04-13 20:43:04.917754036 +0800
@@ -1 +1 @@
-From c68992beeeef90be917b88e013cb9dcbe2ee221e Mon Sep 17 00:00:00 2001
+From 4d1331e9725ad7947d98287f9cecce516c73c311 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c68992beeeef90be917b88e013cb9dcbe2ee221e ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index b4389e5150..f69516faf2 100644
+index ce71818705..5647add29a 100644
@@ -22 +24 @@
-@@ -7316,7 +7316,7 @@ static const struct token token_list[] = {
+@@ -6905,7 +6905,7 @@ static const struct token token_list[] = {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix modify flex item' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (13 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/testpmd: fix flow modify tag typo' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/testpmd: return if no packets in GRO heavy weight mode' " Xueming Li
                     ` (108 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rongwei Liu; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil@nvidia.com>
Date: Fri, 23 Feb 2024 05:21:55 +0200
Subject: [PATCH] net/mlx5: fix modify flex item
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 74f98c1586e73663b4ed69b7dbd3d085776d93df ]

In the rte_flow_field_data structure, the flex item handle is part
of union with other members like level/tag_index.

If the user wants to modify the flex item as source or destination,
there should not be any checking against zero.

Fixes: c23626f27b09 ("ethdev: add MPLS header modification")

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    |  2 +-
 drivers/net/mlx5/mlx5_flow_hw.c | 40 ++++++++++++++++++---------------
 2 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 85e8c77c81..3e31945f99 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2504,7 +2504,7 @@ int
 flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data,
 				 struct rte_flow_error *error)
 {
-	if (data->level == 0)
+	if (data->level == 0 || data->field == RTE_FLOW_FIELD_FLEX_ITEM)
 		return 0;
 	if (data->field != RTE_FLOW_FIELD_TAG &&
 	    data->field != (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index da873ae2e2..bda1ecf121 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4975,15 +4975,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
 	ret = flow_validate_modify_field_level(&action_conf->dst, error);
 	if (ret)
 		return ret;
-	if (action_conf->dst.tag_index &&
-	    !flow_modify_field_support_tag_array(action_conf->dst.field))
-		return rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ACTION, action,
-				"destination tag index is not supported");
-	if (action_conf->dst.class_id)
-		return rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ACTION, action,
-				"destination class id is not supported");
+	if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM) {
+		if (action_conf->dst.tag_index &&
+		    !flow_modify_field_support_tag_array(action_conf->dst.field))
+			return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, action,
+					"destination tag index is not supported");
+		if (action_conf->dst.class_id)
+			return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, action,
+					"destination class id is not supported");
+	}
 	if (mask_conf->dst.level != UINT8_MAX)
 		return rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ACTION, action,
@@ -4998,15 +5000,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
 				"destination field mask and template are not equal");
 	if (action_conf->src.field != RTE_FLOW_FIELD_POINTER &&
 	    action_conf->src.field != RTE_FLOW_FIELD_VALUE) {
-		if (action_conf->src.tag_index &&
-		    !flow_modify_field_support_tag_array(action_conf->src.field))
-			return rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ACTION, action,
-				"source tag index is not supported");
-		if (action_conf->src.class_id)
-			return rte_flow_error_set(error, EINVAL,
-				RTE_FLOW_ERROR_TYPE_ACTION, action,
-				"source class id is not supported");
+		if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM) {
+			if (action_conf->src.tag_index &&
+			    !flow_modify_field_support_tag_array(action_conf->src.field))
+				return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, action,
+					"source tag index is not supported");
+			if (action_conf->src.class_id)
+				return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, action,
+					"source class id is not supported");
+		}
 		if (mask_conf->src.level != UINT8_MAX)
 			return rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION, action,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.641364891 +0800
+++ 0016-net-mlx5-fix-modify-flex-item.patch	2024-04-13 20:43:04.927754023 +0800
@@ -1 +1 @@
-From 74f98c1586e73663b4ed69b7dbd3d085776d93df Mon Sep 17 00:00:00 2001
+From 61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 74f98c1586e73663b4ed69b7dbd3d085776d93df ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -18,3 +20,3 @@
- drivers/net/mlx5/mlx5_flow.c    | 2 +-
- drivers/net/mlx5/mlx5_flow_hw.c | 6 ++++--
- 2 files changed, 5 insertions(+), 3 deletions(-)
+ drivers/net/mlx5/mlx5_flow.c    |  2 +-
+ drivers/net/mlx5/mlx5_flow_hw.c | 40 ++++++++++++++++++---------------
+ 2 files changed, 23 insertions(+), 19 deletions(-)
@@ -23 +25 @@
-index 2b2ae62618..d8ed1ed6f6 100644
+index 85e8c77c81..3e31945f99 100644
@@ -26,2 +28,2 @@
-@@ -2384,7 +2384,7 @@ int
- flow_validate_modify_field_level(const struct rte_flow_field_data *data,
+@@ -2504,7 +2504,7 @@ int
+ flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data,
@@ -36 +38 @@
-index bcf43f5457..5b269b9c82 100644
+index da873ae2e2..bda1ecf121 100644
@@ -39 +41 @@
-@@ -5036,7 +5036,8 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
+@@ -4975,15 +4975,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
@@ -43,7 +45,24 @@
--	if (!flow_hw_modify_field_is_geneve_opt(action_conf->dst.field)) {
-+	if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM &&
-+	    !flow_hw_modify_field_is_geneve_opt(action_conf->dst.field)) {
- 		if (action_conf->dst.tag_index &&
- 		    !flow_modify_field_support_tag_array(action_conf->dst.field))
- 			return rte_flow_error_set(error, EINVAL,
-@@ -5061,7 +5062,8 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
+-	if (action_conf->dst.tag_index &&
+-	    !flow_modify_field_support_tag_array(action_conf->dst.field))
+-		return rte_flow_error_set(error, EINVAL,
+-				RTE_FLOW_ERROR_TYPE_ACTION, action,
+-				"destination tag index is not supported");
+-	if (action_conf->dst.class_id)
+-		return rte_flow_error_set(error, EINVAL,
+-				RTE_FLOW_ERROR_TYPE_ACTION, action,
+-				"destination class id is not supported");
++	if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM) {
++		if (action_conf->dst.tag_index &&
++		    !flow_modify_field_support_tag_array(action_conf->dst.field))
++			return rte_flow_error_set(error, EINVAL,
++					RTE_FLOW_ERROR_TYPE_ACTION, action,
++					"destination tag index is not supported");
++		if (action_conf->dst.class_id)
++			return rte_flow_error_set(error, EINVAL,
++					RTE_FLOW_ERROR_TYPE_ACTION, action,
++					"destination class id is not supported");
++	}
+ 	if (mask_conf->dst.level != UINT8_MAX)
+ 		return rte_flow_error_set(error, EINVAL,
+ 			RTE_FLOW_ERROR_TYPE_ACTION, action,
+@@ -4998,15 +5000,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev,
@@ -53,6 +72,23 @@
--		if (!flow_hw_modify_field_is_geneve_opt(action_conf->src.field)) {
-+		if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM &&
-+		    !flow_hw_modify_field_is_geneve_opt(action_conf->src.field)) {
- 			if (action_conf->src.tag_index &&
- 			    !flow_modify_field_support_tag_array(action_conf->src.field))
- 				return rte_flow_error_set(error, EINVAL,
+-		if (action_conf->src.tag_index &&
+-		    !flow_modify_field_support_tag_array(action_conf->src.field))
+-			return rte_flow_error_set(error, EINVAL,
+-				RTE_FLOW_ERROR_TYPE_ACTION, action,
+-				"source tag index is not supported");
+-		if (action_conf->src.class_id)
+-			return rte_flow_error_set(error, EINVAL,
+-				RTE_FLOW_ERROR_TYPE_ACTION, action,
+-				"source class id is not supported");
++		if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM) {
++			if (action_conf->src.tag_index &&
++			    !flow_modify_field_support_tag_array(action_conf->src.field))
++				return rte_flow_error_set(error, EINVAL,
++					RTE_FLOW_ERROR_TYPE_ACTION, action,
++					"source tag index is not supported");
++			if (action_conf->src.class_id)
++				return rte_flow_error_set(error, EINVAL,
++					RTE_FLOW_ERROR_TYPE_ACTION, action,
++					"source class id is not supported");
++		}
+ 		if (mask_conf->src.level != UINT8_MAX)
+ 			return rte_flow_error_set(error, EINVAL,
+ 				RTE_FLOW_ERROR_TYPE_ACTION, action,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: return if no packets in GRO heavy weight mode' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (14 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix modify flex item' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'app/testpmd: fix async flow create failure handling' " Xueming Li
                     ` (107 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Kumara Parameshwaran; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=92ab2d6da25f20572d4fd77e5ff792eae6e6504d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 92ab2d6da25f20572d4fd77e5ff792eae6e6504d Mon Sep 17 00:00:00 2001
From: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Date: Sun, 25 Feb 2024 11:46:36 +0530
Subject: [PATCH] app/testpmd: return if no packets in GRO heavy weight mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0007e4045c9efe6a20ad2590dfa68a86cc778b48 ]

If there are no packets flushed in GRO heavy weight mode,
return false as this fall through code would return true
indicating that packets are available

Fixes: 461c287ab553 ("app/testpmd: fix GRO packets flush on timeout")

Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/csumonly.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index d73f08b2c6..6711dda42e 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -1142,6 +1142,8 @@ tunnel_update:
 						gro_pkts_num);
 				fs->gro_times = 0;
 			}
+			if (nb_rx == 0)
+				return false;
 		}
 
 		pkts_ip_csum_recalc(pkts_burst, nb_rx, tx_offloads);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.694181222 +0800
+++ 0017-app-testpmd-return-if-no-packets-in-GRO-heavy-weight.patch	2024-04-13 20:43:04.927754023 +0800
@@ -1 +1 @@
-From 0007e4045c9efe6a20ad2590dfa68a86cc778b48 Mon Sep 17 00:00:00 2001
+From 92ab2d6da25f20572d4fd77e5ff792eae6e6504d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0007e4045c9efe6a20ad2590dfa68a86cc778b48 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix async flow create failure handling' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (15 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/testpmd: return if no packets in GRO heavy weight mode' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/tap: do not overwrite flow API errors' " Xueming Li
                     ` (106 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=4a1ffc9b02bcda814389a53b914cdad06e03f872

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4a1ffc9b02bcda814389a53b914cdad06e03f872 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Wed, 28 Feb 2024 19:57:07 +0100
Subject: [PATCH] app/testpmd: fix async flow create failure handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0da12ecba770873851a3a63dc08052271a350aeb ]

In case of an error when an asynchronous flow create operation was
enqueued, test-pmd attempted to enqueue a flow destroy operation
of that flow rule.
However, this was incorrect because:

- Flow rule index was used to enqueue a flow destroy operation.
  This flow rule index was not yet initialized, so flow rule number 0
  was always destroyed as a result.
- Since rte_flow_async_create() does not return a handle on error,
  then there is no flow rule to destroy.

test-pmd only needs to free internal memory allocated for
storing a flow rule. Any flow destroy operation is not needed
in this case.

Fixes: ecdc927b99f2 ("app/testpmd: add async flow create/destroy operations")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2c4dedd603..7c24e401ec 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2789,8 +2789,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
 		flow = rte_flow_async_create_by_index(port_id, queue_id, &op_attr, pt->table,
 			rule_idx, actions, actions_idx, job, &error);
 	if (!flow) {
-		uint64_t flow_id = pf->id;
-		port_queue_flow_destroy(port_id, queue_id, true, 1, &flow_id);
+		free(pf);
 		free(job);
 		return port_flow_complain(&error);
 	}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.724984282 +0800
+++ 0018-app-testpmd-fix-async-flow-create-failure-handling.patch	2024-04-13 20:43:04.927754023 +0800
@@ -1 +1 @@
-From 0da12ecba770873851a3a63dc08052271a350aeb Mon Sep 17 00:00:00 2001
+From 4a1ffc9b02bcda814389a53b914cdad06e03f872 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0da12ecba770873851a3a63dc08052271a350aeb ]
@@ -22 +24,0 @@
-Cc: stable@dpdk.org
@@ -31 +33 @@
-index cd2a436cd7..968d2164ab 100644
+index 2c4dedd603..7c24e401ec 100644
@@ -34 +36 @@
-@@ -2856,8 +2856,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
+@@ -2789,8 +2789,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/tap: do not overwrite flow API errors' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (16 preceding siblings ...)
  2024-04-13 12:48   ` patch 'app/testpmd: fix async flow create failure handling' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/tap: fix traffic control handle calculation' " Xueming Li
                     ` (105 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e9462a5690b6e3d09930960bfd1ea6906d848263

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e9462a5690b6e3d09930960bfd1ea6906d848263 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 29 Feb 2024 09:31:07 -0800
Subject: [PATCH] net/tap: do not overwrite flow API errors
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 11b90b53c6716ca9bc713bab6cfba039fe8e38cb ]

All flow errors were ending up being reported as not supported,
even when the error path was previously setting a valid and
better error message.

Example, asking for a non-existent queue in flow.

Before:
testpmd> flow create 0 ingress pattern eth src is 06:05:04:03:02:01 \
  / end actions queue index 12 / end
port_flow_complain(): Caught PMD error type 16 (specific action):
cause: 0x7fffc46c1e18, action not supported: Operation not supported

After:
testpmd> flow create 0 ingress pattern eth src is 06:05:04:03:02:01 \
  / end actions queue index 12 / end
port_flow_complain(): Caught PMD error type 16 (specific action):
cause: 0x7fffa54e1d88, queue index out of range: Numerical result
       out of range

Fixes: f46900d03823 ("net/tap: fix flow and port commands")
Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/tap/tap_flow.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index ed4d42f92f..5b0fee9064 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -1082,8 +1082,11 @@ priv_flow_process(struct pmd_internals *pmd,
 		}
 		/* use flower filter type */
 		tap_nlattr_add(&flow->msg.nh, TCA_KIND, sizeof("flower"), "flower");
-		if (tap_nlattr_nested_start(&flow->msg, TCA_OPTIONS) < 0)
-			goto exit_item_not_supported;
+		if (tap_nlattr_nested_start(&flow->msg, TCA_OPTIONS) < 0) {
+			rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
+					   actions, "could not allocated netlink msg");
+			goto exit_return_error;
+		}
 	}
 	for (; items->type != RTE_FLOW_ITEM_TYPE_END; ++items) {
 		const struct tap_flow_items *token = NULL;
@@ -1199,9 +1202,12 @@ actions:
 			if (action)
 				goto exit_action_not_supported;
 			action = 1;
-			if (!queue ||
-			    (queue->index > pmd->dev->data->nb_rx_queues - 1))
-				goto exit_action_not_supported;
+			if (queue->index >= pmd->dev->data->nb_rx_queues) {
+				rte_flow_error_set(error, ERANGE,
+						   RTE_FLOW_ERROR_TYPE_ACTION, actions,
+						   "queue index out of range");
+				goto exit_return_error;
+			}
 			if (flow) {
 				struct action_data adata = {
 					.id = "skbedit",
@@ -1227,7 +1233,7 @@ actions:
 			if (!pmd->rss_enabled) {
 				err = rss_enable(pmd, attr, error);
 				if (err)
-					goto exit_action_not_supported;
+					goto exit_return_error;
 			}
 			if (flow)
 				err = rss_add_actions(flow, pmd, rss, error);
@@ -1235,7 +1241,7 @@ actions:
 			goto exit_action_not_supported;
 		}
 		if (err)
-			goto exit_action_not_supported;
+			goto exit_return_error;
 	}
 	/* When fate is unknown, drop traffic. */
 	if (!action) {
@@ -1258,6 +1264,7 @@ exit_item_not_supported:
 exit_action_not_supported:
 	rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
 			   actions, "action not supported");
+exit_return_error:
 	return -rte_errno;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.752023346 +0800
+++ 0019-net-tap-do-not-overwrite-flow-API-errors.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 11b90b53c6716ca9bc713bab6cfba039fe8e38cb Mon Sep 17 00:00:00 2001
+From e9462a5690b6e3d09930960bfd1ea6906d848263 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 11b90b53c6716ca9bc713bab6cfba039fe8e38cb ]
@@ -27 +29,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/tap: fix traffic control handle calculation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (17 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/tap: do not overwrite flow API errors' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/bnxt: fix null pointer dereference' " Xueming Li
                     ` (104 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1d5bfd9fdf17cb809a9e32da71d2abc92f2bf871

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1d5bfd9fdf17cb809a9e32da71d2abc92f2bf871 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 29 Feb 2024 09:31:08 -0800
Subject: [PATCH] net/tap: fix traffic control handle calculation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4e924ff6f789c6a67424263bf384f3e4b4fba373 ]

The code to take a flow pointer and make a TC handle was incorrect
and would always generate the same handle. This is because it was
hashing the address of the union on the stack (which is invariant)
rather than the contents of the union.

The following testpmd case would cause an error:
testpmd> flow create 0 ingress pattern eth src is 06:05:04:03:02:01 \
  / end actions queue index 2 / end
Flow rule #0 created
testpmd> flow create 0 ingress pattern eth src is 06:05:04:03:02:02 \
  / end actions queue index 3 / end
tap_nl_dump_ext_ack(): Filter already exists
tap_flow_create(): Kernel refused TC filter rule creation (17): File exists
port_flow_complain(): Caught PMD error type 2 (flow rule (handle)):
  overlapping rules or Kernel too old for flower support: File exists

This fix does it in a more robust manner using size independent
code. It also initializes the hash seed so the same hash won't
show up every time and risk potential leakage of address to
other places.

Bugzilla ID: 1382
Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Fixes: a625ab89df11 ("net/tap: fix build with GCC 11")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/tap/tap_flow.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index 5b0fee9064..fa50fe45d7 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -11,6 +11,7 @@
 
 #include <rte_byteorder.h>
 #include <rte_jhash.h>
+#include <rte_random.h>
 #include <rte_malloc.h>
 #include <rte_eth_tap.h>
 #include <tap_flow.h>
@@ -1297,9 +1298,7 @@ tap_flow_validate(struct rte_eth_dev *dev,
  * In those rules, the handle (uint32_t) is the part that would identify
  * specifically each rule.
  *
- * On 32-bit architectures, the handle can simply be the flow's pointer address.
- * On 64-bit architectures, we rely on jhash(flow) to find a (sufficiently)
- * unique handle.
+ * Use jhash of the flow pointer to make a unique handle.
  *
  * @param[in, out] flow
  *   The flow that needs its handle set.
@@ -1309,16 +1308,18 @@ tap_flow_set_handle(struct rte_flow *flow)
 {
 	union {
 		struct rte_flow *flow;
-		const void *key;
-	} tmp;
-	uint32_t handle = 0;
+		uint32_t words[sizeof(flow) / sizeof(uint32_t)];
+	} tmp = {
+		.flow = flow,
+	};
+	uint32_t handle;
+	static uint64_t hash_seed;
 
-	tmp.flow = flow;
+	if (hash_seed == 0)
+		hash_seed = rte_rand();
+
+	handle = rte_jhash_32b(tmp.words, sizeof(flow) / sizeof(uint32_t), hash_seed);
 
-	if (sizeof(flow) > 4)
-		handle = rte_jhash(tmp.key, sizeof(flow), 1);
-	else
-		handle = (uintptr_t)flow;
 	/* must be at least 1 to avoid letting the kernel choose one for us */
 	if (!handle)
 		handle = 1;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.777702013 +0800
+++ 0020-net-tap-fix-traffic-control-handle-calculation.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 4e924ff6f789c6a67424263bf384f3e4b4fba373 Mon Sep 17 00:00:00 2001
+From 1d5bfd9fdf17cb809a9e32da71d2abc92f2bf871 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4e924ff6f789c6a67424263bf384f3e4b4fba373 ]
@@ -30 +32,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix null pointer dereference' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (18 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/tap: fix traffic control handle calculation' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/ixgbevf: fix RSS init for x550 NICs' " Xueming Li
                     ` (103 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, Somnath Kotur, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a71de447a2351b7c5b4f95446b5382e253415232

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a71de447a2351b7c5b4f95446b5382e253415232 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Wed, 7 Feb 2024 01:19:02 -0800
Subject: [PATCH] net/bnxt: fix null pointer dereference
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 68eeafdef4db7362ff5307995b670a98f65f2493 ]

In the recent changes to rte_eth_dev_release_port() the library sets
eth_dev->data to NULL at the end of the routine. This causes a NULL
pointer dereference in the bnxt_rep_dev_info_get_op() and
bnxt_representor_uninit() routines when it tries to validate parent dev.

Add code to handle this.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_reps.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index a15f993328..a7b75b543e 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -32,6 +32,14 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = {
 	.flow_ops_get = bnxt_flow_ops_get_op
 };
 
+static bool bnxt_rep_check_parent(struct bnxt_representor *rep)
+{
+	if (!rep->parent_dev->data->dev_private)
+		return false;
+
+	return true;
+}
+
 uint16_t
 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
 {
@@ -266,12 +274,12 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev)
 	PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id);
 	eth_dev->data->mac_addrs = NULL;
 
-	parent_bp = rep->parent_dev->data->dev_private;
-	if (!parent_bp) {
+	if (!bnxt_rep_check_parent(rep)) {
 		PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n",
 			    eth_dev->data->port_id);
 		return 0;
 	}
+	parent_bp = rep->parent_dev->data->dev_private;
 
 	parent_bp->num_reps--;
 	vf_id = rep->vf_id;
@@ -539,11 +547,12 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	int rc = 0;
 
 	/* MAC Specifics */
-	parent_bp = rep_bp->parent_dev->data->dev_private;
-	if (!parent_bp) {
-		PMD_DRV_LOG(ERR, "Rep parent NULL!\n");
+	if (!bnxt_rep_check_parent(rep_bp)) {
+		/* Need not be an error scenario, if parent is closed first */
+		PMD_DRV_LOG(INFO, "Rep parent port does not exist.\n");
 		return rc;
 	}
+	parent_bp = rep_bp->parent_dev->data->dev_private;
 	PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n");
 	dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
 	dev_info->max_hash_mac_addrs = 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.800972282 +0800
+++ 0021-net-bnxt-fix-null-pointer-dereference.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 68eeafdef4db7362ff5307995b670a98f65f2493 Mon Sep 17 00:00:00 2001
+From a71de447a2351b7c5b4f95446b5382e253415232 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 68eeafdef4db7362ff5307995b670a98f65f2493 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 3a4720bc3c..edcc27f556 100644
+index a15f993328..a7b75b543e 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ixgbevf: fix RSS init for x550 NICs' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (19 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/bnxt: fix null pointer dereference' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/iavf: remove error logs for VLAN offloading' " Xueming Li
                     ` (102 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Edwin Brossette; +Cc: Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2aa5a757508a5861f9ddfc07cace84b7a51697f6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2aa5a757508a5861f9ddfc07cace84b7a51697f6 Mon Sep 17 00:00:00 2001
From: Edwin Brossette <edwin.brossette@6wind.com>
Date: Thu, 15 Feb 2024 14:31:45 +0100
Subject: [PATCH] net/ixgbevf: fix RSS init for x550 NICs
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3a53577d5f390e8635a672b79616e54c59b330ab ]

Different Intel NICs with the igxbe PMD do not handle RSS in the same
way when working with virtualization. While some NICs like Intel 82599ES
only have a single RSS table in the device and leave all RSS features to
be handled by the PF, some other NICs like x550 let the VF handle RSS
features. This can lead to different behavior when RSS is enabled
depending on the model of nic used.

In particular, ixgbevf_dev_rx_init() does not configure RSS parameters
at device init, even if the multi-queue mode option is set in the device
configuration (ie. RTE_ETH_MQ_RX_RSS is set). Note that this issue went
unnoticed until now, probably because some NICs do not really have
support for RSS in virtualization mode.

Thus, depending on the NIC used, we can we find ourselves in a situation
where RSS is not configured despite being enabled. This will cause
serious performance issues because the RSS RETA table will be fully
zeroed, causing all packets to go only to the first queue, leaving all
other queues empty.

By looking at ixgbe_reta_size_get(), we can see that only X550 NIC
models have a non zero RETA size set in VF mode. Therefore, add a call
to ixgbe_rss_configure() for these cards in ixgbevf_dev_rx_init() if the
option to enable RSS is set.

Fixes: f4d1598ee14f ("ixgbevf: support RSS config on x550")

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 90b0a7004f..f6c17d4efb 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -5844,6 +5844,25 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 		IXGBE_PSRTYPE_RQPL_SHIFT;
 	IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, psrtype);
 
+	/* Initialize the rss for x550_vf cards if enabled */
+	switch (hw->mac.type) {
+	case ixgbe_mac_X550_vf:
+	case ixgbe_mac_X550EM_x_vf:
+	case ixgbe_mac_X550EM_a_vf:
+		switch (dev->data->dev_conf.rxmode.mq_mode) {
+		case RTE_ETH_MQ_RX_RSS:
+		case RTE_ETH_MQ_RX_DCB_RSS:
+		case RTE_ETH_MQ_RX_VMDQ_RSS:
+			ixgbe_rss_configure(dev);
+			break;
+		default:
+			break;
+		}
+		break;
+	default:
+		break;
+	}
+
 	ixgbe_set_rx_function(dev);
 
 	return 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.824293352 +0800
+++ 0022-net-ixgbevf-fix-RSS-init-for-x550-NICs.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 3a53577d5f390e8635a672b79616e54c59b330ab Mon Sep 17 00:00:00 2001
+From 2aa5a757508a5861f9ddfc07cace84b7a51697f6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3a53577d5f390e8635a672b79616e54c59b330ab ]
@@ -31 +33,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/iavf: remove error logs for VLAN offloading' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (20 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/ixgbevf: fix RSS init for x550 NICs' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/ixgbe: increase VF reset timeout' " Xueming Li
                     ` (101 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=eefc0111dec8c9b7a03b672e1d890d3a9229ced3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From eefc0111dec8c9b7a03b672e1d890d3a9229ced3 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 6 Feb 2024 11:34:20 +0100
Subject: [PATCH] net/iavf: remove error logs for VLAN offloading
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 325764b3a20a16a7a997a324cc0b93367eb7f3e1 ]

This was reported by RH QE.

When a vlan is enforced on a VF via an administrative configuration on
the PF side, the net/iavf driver logs two error messages.
Those error messages have no consequence on the rest of the port
initialisation and packet processing works fine.

[root@toto ~] # ip l set enp94s0 vf 0 vlan 2
[root@toto ~] # dpdk-testpmd -a 0000:5e:02.0 -- -i
...
Configuring Port 0 (socket 0)
iavf_dev_init_vlan(): Failed to update vlan offload
iavf_dev_configure(): configure VLAN failed: -95
iavf_set_rx_function(): request RXDID[1] in Queue[0] is legacy, set
	rx_pkt_burst as legacy for all queues

The first change is to remove the error log in iavf_dev_init_vlan().
This log is unneeded since all error path are covered by dedicated log
messages already.

Then, in iavf_dev_init_vlan(), requesting all possible VLAN offloading
must not trigger an ERROR level log message. This is simply confusing,
as the application may not have requested such vlan offloading.
The reason why the driver requests all offloading is unclear so keep it
as is. Instead, rephrase the log message and lower its level to INFO.

Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 32a1626420..c26612c4a1 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -630,7 +630,8 @@ iavf_dev_init_vlan(struct rte_eth_dev *dev)
 					RTE_ETH_VLAN_FILTER_MASK |
 					RTE_ETH_VLAN_EXTEND_MASK);
 	if (err) {
-		PMD_DRV_LOG(ERR, "Failed to update vlan offload");
+		PMD_DRV_LOG(INFO,
+			"VLAN offloading is not supported, or offloading was refused by the PF");
 		return err;
 	}
 
@@ -706,9 +707,7 @@ iavf_dev_configure(struct rte_eth_dev *dev)
 		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
 	}
 
-	ret = iavf_dev_init_vlan(dev);
-	if (ret)
-		PMD_DRV_LOG(ERR, "configure VLAN failed: %d", ret);
+	iavf_dev_init_vlan(dev);
 
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {
 		if (iavf_init_rss(ad) != 0) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.849317819 +0800
+++ 0023-net-iavf-remove-error-logs-for-VLAN-offloading.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 325764b3a20a16a7a997a324cc0b93367eb7f3e1 Mon Sep 17 00:00:00 2001
+From eefc0111dec8c9b7a03b672e1d890d3a9229ced3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 325764b3a20a16a7a997a324cc0b93367eb7f3e1 ]
@@ -33 +35,0 @@
-Cc: stable@dpdk.org
@@ -42 +44 @@
-index b5f6049a91..2cb602a358 100644
+index 32a1626420..c26612c4a1 100644
@@ -45 +47 @@
-@@ -633,7 +633,8 @@ iavf_dev_init_vlan(struct rte_eth_dev *dev)
+@@ -630,7 +630,8 @@ iavf_dev_init_vlan(struct rte_eth_dev *dev)
@@ -55 +57 @@
-@@ -709,9 +710,7 @@ iavf_dev_configure(struct rte_eth_dev *dev)
+@@ -706,9 +707,7 @@ iavf_dev_configure(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ixgbe: increase VF reset timeout' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (21 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/iavf: remove error logs for VLAN offloading' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/i40e: remove incorrect 16B descriptor read block' " Xueming Li
                     ` (100 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: Vladimir Medvedkin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=33b5bed057b1c466dbfbd18f2b30deadee66715f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 33b5bed057b1c466dbfbd18f2b30deadee66715f Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Tue, 30 Jan 2024 10:00:27 +0000
Subject: [PATCH] net/ixgbe: increase VF reset timeout
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 64e714f838aeb1afbd4e7544686a0d7cd8921589 ]

When VF issues a reset to PF there is a 50 msec wait plus an additional
max of 1 msec (200 * 5us) for the PF to indicate the reset is complete
before timeout.

In some cases, it is seen that the reset is timing out, in which case
the reset does not complete and an error is returned.

In order to account for this, continue to wait an initial 50 msecs, but
then allow a max of an additional 50 msecs (10,000 * 5us) for the
command to complete.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_type.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index 1094df5891..35212a561b 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -1800,7 +1800,7 @@ enum {
 /* VFRE bitmask */
 #define IXGBE_VFRE_ENABLE_ALL	0xFFFFFFFF
 
-#define IXGBE_VF_INIT_TIMEOUT	200 /* Number of retries to clear RSTI */
+#define IXGBE_VF_INIT_TIMEOUT	10000 /* Number of retries to clear RSTI */
 
 /* RDHMPN and TDHMPN bitmasks */
 #define IXGBE_RDHMPN_RDICADDR		0x007FF800
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.876115184 +0800
+++ 0024-net-ixgbe-increase-VF-reset-timeout.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 64e714f838aeb1afbd4e7544686a0d7cd8921589 Mon Sep 17 00:00:00 2001
+From 33b5bed057b1c466dbfbd18f2b30deadee66715f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 64e714f838aeb1afbd4e7544686a0d7cd8921589 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/i40e: remove incorrect 16B descriptor read block' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (22 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/ixgbe: increase VF reset timeout' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/iavf: " Xueming Li
                     ` (99 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=542c8410cbefeada90e6ba1028da1e92d279aba3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 542c8410cbefeada90e6ba1028da1e92d279aba3 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 23 Jan 2024 11:40:48 +0000
Subject: [PATCH] net/i40e: remove incorrect 16B descriptor read block
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b527d9585d9cd0446d6bfa39d3a8e896c87883e5 ]

By default, the driver works with 32B descriptors, but has a separate
descriptor read block for reading two descriptors at a time when using
16B descriptors. However, the 32B reads used are not guaranteed to be
atomic, which will cause issues if that is not the case on a system,
since the descriptors may be read in an undefined order.  Remove the
block, to avoid issues, and just use the regular descriptor reading path
for 16B descriptors, if that support is enabled at build time.

Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec_avx2.c | 64 ++++++++++-----------------
 1 file changed, 24 insertions(+), 40 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index f468c1fd90..19cf0ac718 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -276,46 +276,30 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 				_mm256_loadu_si256((void *)&sw_ring[i + 4]));
 #endif
 
-		__m256i raw_desc0_1, raw_desc2_3, raw_desc4_5, raw_desc6_7;
-#ifdef RTE_LIBRTE_I40E_16BYTE_RX_DESC
-		/* for AVX we need alignment otherwise loads are not atomic */
-		if (avx_aligned) {
-			/* load in descriptors, 2 at a time, in reverse order */
-			raw_desc6_7 = _mm256_load_si256((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			raw_desc4_5 = _mm256_load_si256((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			raw_desc2_3 = _mm256_load_si256((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			raw_desc0_1 = _mm256_load_si256((void *)(rxdp + 0));
-		} else
-#endif
-		do {
-			const __m128i raw_desc7 = _mm_load_si128((void *)(rxdp + 7));
-			rte_compiler_barrier();
-			const __m128i raw_desc6 = _mm_load_si128((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			const __m128i raw_desc5 = _mm_load_si128((void *)(rxdp + 5));
-			rte_compiler_barrier();
-			const __m128i raw_desc4 = _mm_load_si128((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			const __m128i raw_desc3 = _mm_load_si128((void *)(rxdp + 3));
-			rte_compiler_barrier();
-			const __m128i raw_desc2 = _mm_load_si128((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			const __m128i raw_desc1 = _mm_load_si128((void *)(rxdp + 1));
-			rte_compiler_barrier();
-			const __m128i raw_desc0 = _mm_load_si128((void *)(rxdp + 0));
-
-			raw_desc6_7 = _mm256_inserti128_si256(
-					_mm256_castsi128_si256(raw_desc6), raw_desc7, 1);
-			raw_desc4_5 = _mm256_inserti128_si256(
-					_mm256_castsi128_si256(raw_desc4), raw_desc5, 1);
-			raw_desc2_3 = _mm256_inserti128_si256(
-					_mm256_castsi128_si256(raw_desc2), raw_desc3, 1);
-			raw_desc0_1 = _mm256_inserti128_si256(
-					_mm256_castsi128_si256(raw_desc0), raw_desc1, 1);
-		} while (0);
+		const __m128i raw_desc7 = _mm_load_si128((void *)(rxdp + 7));
+		rte_compiler_barrier();
+		const __m128i raw_desc6 = _mm_load_si128((void *)(rxdp + 6));
+		rte_compiler_barrier();
+		const __m128i raw_desc5 = _mm_load_si128((void *)(rxdp + 5));
+		rte_compiler_barrier();
+		const __m128i raw_desc4 = _mm_load_si128((void *)(rxdp + 4));
+		rte_compiler_barrier();
+		const __m128i raw_desc3 = _mm_load_si128((void *)(rxdp + 3));
+		rte_compiler_barrier();
+		const __m128i raw_desc2 = _mm_load_si128((void *)(rxdp + 2));
+		rte_compiler_barrier();
+		const __m128i raw_desc1 = _mm_load_si128((void *)(rxdp + 1));
+		rte_compiler_barrier();
+		const __m128i raw_desc0 = _mm_load_si128((void *)(rxdp + 0));
+
+		const __m256i raw_desc6_7 = _mm256_inserti128_si256(
+				_mm256_castsi128_si256(raw_desc6), raw_desc7, 1);
+		const __m256i raw_desc4_5 = _mm256_inserti128_si256(
+				_mm256_castsi128_si256(raw_desc4), raw_desc5, 1);
+		const __m256i raw_desc2_3 = _mm256_inserti128_si256(
+				_mm256_castsi128_si256(raw_desc2), raw_desc3, 1);
+		const __m256i raw_desc0_1 = _mm256_inserti128_si256(
+				_mm256_castsi128_si256(raw_desc0), raw_desc1, 1);
 
 		if (split_packet) {
 			int j;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.900966252 +0800
+++ 0025-net-i40e-remove-incorrect-16B-descriptor-read-block.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From b527d9585d9cd0446d6bfa39d3a8e896c87883e5 Mon Sep 17 00:00:00 2001
+From 542c8410cbefeada90e6ba1028da1e92d279aba3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b527d9585d9cd0446d6bfa39d3a8e896c87883e5 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/iavf: remove incorrect 16B descriptor read block' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (23 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/i40e: remove incorrect 16B descriptor read block' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/ice: " Xueming Li
                     ` (98 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=72093d3d41b3a9fcad9010accc7f55e79f205cc9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 72093d3d41b3a9fcad9010accc7f55e79f205cc9 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 23 Jan 2024 11:40:50 +0000
Subject: [PATCH] net/iavf: remove incorrect 16B descriptor read block
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d4ade5d02d188fcbe51871c5a5d66ef075ca0f86 ]

By default, the driver works with 32B descriptors, but has a separate
descriptor read block for reading two descriptors at a time when using
16B descriptors. However, the 32B reads used are not guaranteed to be
atomic, which will cause issues if that is not the case on a system,
since the descriptors may be read in an undefined order.  Remove the
block, to avoid issues, and just use the regular descriptor reading path
for 16B descriptors, if that support is enabled at build time.

Fixes: af0c246a3800 ("net/iavf: enable AVX2 for iavf")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/iavf/iavf_rxtx_vec_avx2.c | 80 ++++++++-------------------
 1 file changed, 24 insertions(+), 56 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
index 510b4d8f1c..49d41af953 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
@@ -193,62 +193,30 @@ _iavf_recv_raw_pkts_vec_avx2(struct iavf_rx_queue *rxq,
 			 _mm256_loadu_si256((void *)&sw_ring[i + 4]));
 #endif
 
-		__m256i raw_desc0_1, raw_desc2_3, raw_desc4_5, raw_desc6_7;
-#ifdef RTE_LIBRTE_IAVF_16BYTE_RX_DESC
-		/* for AVX we need alignment otherwise loads are not atomic */
-		if (avx_aligned) {
-			/* load in descriptors, 2 at a time, in reverse order */
-			raw_desc6_7 = _mm256_load_si256((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			raw_desc4_5 = _mm256_load_si256((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			raw_desc2_3 = _mm256_load_si256((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			raw_desc0_1 = _mm256_load_si256((void *)(rxdp + 0));
-		} else
-#endif
-		{
-			const __m128i raw_desc7 =
-				_mm_load_si128((void *)(rxdp + 7));
-			rte_compiler_barrier();
-			const __m128i raw_desc6 =
-				_mm_load_si128((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			const __m128i raw_desc5 =
-				_mm_load_si128((void *)(rxdp + 5));
-			rte_compiler_barrier();
-			const __m128i raw_desc4 =
-				_mm_load_si128((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			const __m128i raw_desc3 =
-				_mm_load_si128((void *)(rxdp + 3));
-			rte_compiler_barrier();
-			const __m128i raw_desc2 =
-				_mm_load_si128((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			const __m128i raw_desc1 =
-				_mm_load_si128((void *)(rxdp + 1));
-			rte_compiler_barrier();
-			const __m128i raw_desc0 =
-				_mm_load_si128((void *)(rxdp + 0));
-
-			raw_desc6_7 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc6),
-					 raw_desc7, 1);
-			raw_desc4_5 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc4),
-					 raw_desc5, 1);
-			raw_desc2_3 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc2),
-					 raw_desc3, 1);
-			raw_desc0_1 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc0),
-					 raw_desc1, 1);
-		}
+		const __m128i raw_desc7 = _mm_load_si128((void *)(rxdp + 7));
+		rte_compiler_barrier();
+		const __m128i raw_desc6 = _mm_load_si128((void *)(rxdp + 6));
+		rte_compiler_barrier();
+		const __m128i raw_desc5 = _mm_load_si128((void *)(rxdp + 5));
+		rte_compiler_barrier();
+		const __m128i raw_desc4 = _mm_load_si128((void *)(rxdp + 4));
+		rte_compiler_barrier();
+		const __m128i raw_desc3 = _mm_load_si128((void *)(rxdp + 3));
+		rte_compiler_barrier();
+		const __m128i raw_desc2 = _mm_load_si128((void *)(rxdp + 2));
+		rte_compiler_barrier();
+		const __m128i raw_desc1 = _mm_load_si128((void *)(rxdp + 1));
+		rte_compiler_barrier();
+		const __m128i raw_desc0 = _mm_load_si128((void *)(rxdp + 0));
+
+		const __m256i raw_desc6_7 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc6), raw_desc7, 1);
+		const __m256i raw_desc4_5 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc4), raw_desc5, 1);
+		const __m256i raw_desc2_3 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc2), raw_desc3, 1);
+		const __m256i raw_desc0_1 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc0), raw_desc1, 1);
 
 		if (split_packet) {
 			int j;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.929289815 +0800
+++ 0026-net-iavf-remove-incorrect-16B-descriptor-read-block.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From d4ade5d02d188fcbe51871c5a5d66ef075ca0f86 Mon Sep 17 00:00:00 2001
+From 72093d3d41b3a9fcad9010accc7f55e79f205cc9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d4ade5d02d188fcbe51871c5a5d66ef075ca0f86 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ice: remove incorrect 16B descriptor read block' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (24 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/iavf: " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix inline device pointer check' " Xueming Li
                     ` (97 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=dbdcd8bb8532fb04458d131adc335cfbda7c70da

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dbdcd8bb8532fb04458d131adc335cfbda7c70da Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 23 Jan 2024 11:40:52 +0000
Subject: [PATCH] net/ice: remove incorrect 16B descriptor read block
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9aee908eddeb6e8f3de402ac5661bca5161809a6 ]

By default, the driver works with 32B descriptors, but has a separate
descriptor read block for reading two descriptors at a time when using
16B descriptors. However, the 32B reads used are not guaranteed to be
atomic, which will cause issues if that is not the case on a system,
since the descriptors may be read in an undefined order.  Remove the
block, to avoid issues, and just use the regular descriptor reading path
for 16B descriptors, if that support is enabled at build time.

Fixes: ae60d3c9b227 ("net/ice: support Rx AVX2 vector")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ice/ice_rxtx_vec_avx2.c | 80 +++++++++--------------------
 1 file changed, 24 insertions(+), 56 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c b/drivers/net/ice/ice_rxtx_vec_avx2.c
index 6f6d790967..d6e88dbb29 100644
--- a/drivers/net/ice/ice_rxtx_vec_avx2.c
+++ b/drivers/net/ice/ice_rxtx_vec_avx2.c
@@ -254,62 +254,30 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 			 _mm256_loadu_si256((void *)&sw_ring[i + 4]));
 #endif
 
-		__m256i raw_desc0_1, raw_desc2_3, raw_desc4_5, raw_desc6_7;
-#ifdef RTE_LIBRTE_ICE_16BYTE_RX_DESC
-		/* for AVX we need alignment otherwise loads are not atomic */
-		if (avx_aligned) {
-			/* load in descriptors, 2 at a time, in reverse order */
-			raw_desc6_7 = _mm256_load_si256((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			raw_desc4_5 = _mm256_load_si256((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			raw_desc2_3 = _mm256_load_si256((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			raw_desc0_1 = _mm256_load_si256((void *)(rxdp + 0));
-		} else
-#endif
-		{
-			const __m128i raw_desc7 =
-				_mm_load_si128((void *)(rxdp + 7));
-			rte_compiler_barrier();
-			const __m128i raw_desc6 =
-				_mm_load_si128((void *)(rxdp + 6));
-			rte_compiler_barrier();
-			const __m128i raw_desc5 =
-				_mm_load_si128((void *)(rxdp + 5));
-			rte_compiler_barrier();
-			const __m128i raw_desc4 =
-				_mm_load_si128((void *)(rxdp + 4));
-			rte_compiler_barrier();
-			const __m128i raw_desc3 =
-				_mm_load_si128((void *)(rxdp + 3));
-			rte_compiler_barrier();
-			const __m128i raw_desc2 =
-				_mm_load_si128((void *)(rxdp + 2));
-			rte_compiler_barrier();
-			const __m128i raw_desc1 =
-				_mm_load_si128((void *)(rxdp + 1));
-			rte_compiler_barrier();
-			const __m128i raw_desc0 =
-				_mm_load_si128((void *)(rxdp + 0));
-
-			raw_desc6_7 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc6),
-					 raw_desc7, 1);
-			raw_desc4_5 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc4),
-					 raw_desc5, 1);
-			raw_desc2_3 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc2),
-					 raw_desc3, 1);
-			raw_desc0_1 =
-				_mm256_inserti128_si256
-					(_mm256_castsi128_si256(raw_desc0),
-					 raw_desc1, 1);
-		}
+		const __m128i raw_desc7 = _mm_load_si128((void *)(rxdp + 7));
+		rte_compiler_barrier();
+		const __m128i raw_desc6 = _mm_load_si128((void *)(rxdp + 6));
+		rte_compiler_barrier();
+		const __m128i raw_desc5 = _mm_load_si128((void *)(rxdp + 5));
+		rte_compiler_barrier();
+		const __m128i raw_desc4 = _mm_load_si128((void *)(rxdp + 4));
+		rte_compiler_barrier();
+		const __m128i raw_desc3 = _mm_load_si128((void *)(rxdp + 3));
+		rte_compiler_barrier();
+		const __m128i raw_desc2 = _mm_load_si128((void *)(rxdp + 2));
+		rte_compiler_barrier();
+		const __m128i raw_desc1 = _mm_load_si128((void *)(rxdp + 1));
+		rte_compiler_barrier();
+		const __m128i raw_desc0 = _mm_load_si128((void *)(rxdp + 0));
+
+		const __m256i raw_desc6_7 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc6), raw_desc7, 1);
+		const __m256i raw_desc4_5 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc4), raw_desc5, 1);
+		const __m256i raw_desc2_3 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc2), raw_desc3, 1);
+		const __m256i raw_desc0_1 =
+			_mm256_inserti128_si256(_mm256_castsi128_si256(raw_desc0), raw_desc1, 1);
 
 		if (split_packet) {
 			int j;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.962044072 +0800
+++ 0027-net-ice-remove-incorrect-16B-descriptor-read-block.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From 9aee908eddeb6e8f3de402ac5661bca5161809a6 Mon Sep 17 00:00:00 2001
+From dbdcd8bb8532fb04458d131adc335cfbda7c70da Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9aee908eddeb6e8f3de402ac5661bca5161809a6 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix inline device pointer check' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (25 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/ice: " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: fix Rx packet format check condition' " Xueming Li
                     ` (96 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8bc81d544729171ea2faed5d394b6f9fed0979a5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8bc81d544729171ea2faed5d394b6f9fed0979a5 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Thu, 22 Feb 2024 15:37:27 +0530
Subject: [PATCH] common/cnxk: fix inline device pointer check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c4e9c066ab8c03a27183b03d29d4fce7c4b462d5 ]

Add missing check of Inline device pointer before accessing
is_multi_channel variable.

Fixes: 7ea187184a51 ("common/cnxk: support 1-N pool-aura per NIX LF")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/common/cnxk/roc_nix_inl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index 750fd08355..a7bae8a51c 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -876,7 +876,8 @@ roc_nix_inl_inb_init(struct roc_nix *roc_nix)
 	inl_dev = idev->nix_inl_dev;
 
 	roc_nix->custom_meta_aura_ena = (roc_nix->local_meta_aura_ena &&
-					 (inl_dev->is_multi_channel || roc_nix->custom_sa_action));
+					 ((inl_dev && inl_dev->is_multi_channel) ||
+					  roc_nix->custom_sa_action));
 	if (!roc_model_is_cn9k() && !roc_errata_nix_no_meta_aura()) {
 		nix->need_meta_aura = true;
 		if (!roc_nix->local_meta_aura_ena || roc_nix->custom_meta_aura_ena)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:05.987137539 +0800
+++ 0028-common-cnxk-fix-inline-device-pointer-check.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From c4e9c066ab8c03a27183b03d29d4fce7c4b462d5 Mon Sep 17 00:00:00 2001
+From 8bc81d544729171ea2faed5d394b6f9fed0979a5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c4e9c066ab8c03a27183b03d29d4fce7c4b462d5 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index de8fd2a605..a205c658e9 100644
+index 750fd08355..a7bae8a51c 100644
@@ -21 +23 @@
-@@ -933,7 +933,8 @@ roc_nix_inl_inb_init(struct roc_nix *roc_nix)
+@@ -876,7 +876,8 @@ roc_nix_inl_inb_init(struct roc_nix *roc_nix)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix Rx packet format check condition' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (26 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix inline device pointer check' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/bnx2x: fix warnings about memcpy lengths' " Xueming Li
                     ` (95 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2d11f389b0f8fe86387c2d7ddc33e9230dfedd11

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2d11f389b0f8fe86387c2d7ddc33e9230dfedd11 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Thu, 22 Feb 2024 15:37:28 +0530
Subject: [PATCH] net/cnxk: fix Rx packet format check condition
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f9e6c013564967de5e76f45a81dc593361f2ccdd ]

For IPsec decrypted packets, full packet format condition check
is enabled for both reassembly and non-reassembly path as part
of OOP handling. Instead, it should be only in reassembly path.
To fix this, NIX_RX_REAS_F flag condition is added to avoid
packet format check in non-reassembly fast path.

Fixes: 5e9e008d0127 ("net/cnxk: support inline ingress out-of-place session")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_rx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 7bb4c86d75..86e4233dc7 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -705,7 +705,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf,
 	if (cq_w1 & BIT(11) && flags & NIX_RX_OFFLOAD_SECURITY_F) {
 		const uint64_t *wqe = (const uint64_t *)(mbuf + 1);
 
-		if (hdr->w0.pkt_fmt != ROC_IE_OT_SA_PKT_FMT_FULL)
+		if (!(flags & NIX_RX_REAS_F) || hdr->w0.pkt_fmt != ROC_IE_OT_SA_PKT_FMT_FULL)
 			rx = (const union nix_rx_parse_u *)(wqe + 1);
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.011927707 +0800
+++ 0029-net-cnxk-fix-Rx-packet-format-check-condition.patch	2024-04-13 20:43:04.937754010 +0800
@@ -1 +1 @@
-From f9e6c013564967de5e76f45a81dc593361f2ccdd Mon Sep 17 00:00:00 2001
+From 2d11f389b0f8fe86387c2d7ddc33e9230dfedd11 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f9e6c013564967de5e76f45a81dc593361f2ccdd ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index c4ad1b64fe..89621af3fb 100644
+index 7bb4c86d75..86e4233dc7 100644
@@ -24,3 +26,3 @@
-@@ -734,7 +734,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf,
- 		else
- 			wqe = (const uint64_t *)(mbuf + 1);
+@@ -705,7 +705,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf,
+ 	if (cq_w1 & BIT(11) && flags & NIX_RX_OFFLOAD_SECURITY_F) {
+ 		const uint64_t *wqe = (const uint64_t *)(mbuf + 1);

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnx2x: fix warnings about memcpy lengths' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (27 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: fix Rx packet format check condition' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: remove CN9K inline IPsec FP opcodes' " Xueming Li
                     ` (94 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Morten Brørup; +Cc: Devendra Singh Rawat, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b3ef799286fdab7c12d8b0a7f77a61aa45500f06

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b3ef799286fdab7c12d8b0a7f77a61aa45500f06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Br=C3=B8rup?= <mb@smartsharesystems.com>
Date: Fri, 23 Feb 2024 15:00:56 +0100
Subject: [PATCH] net/bnx2x: fix warnings about memcpy lengths
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c50b86f7d60f757ea62fe14076be69bf114f1740 ]

The vlan in the bulletin does not contain a VLAN header, only the
VLAN ID, so only copy 2 byte, not 4. The target structure has padding
after the field, so copying 2 byte too many is effectively harmless.
Fix it by using generic memcpy version instead of specialized
rte version as it not used in fast path.

Also, Use RTE_PTR_ADD where copying arrays to the offset of a first field
in a structure holding multiple fields, to avoid compiler warnings with
decorated memcpy.

Bugzilla ID: 1146
Fixes: 540a211084a7 ("bnx2x: driver core")

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
---
 drivers/net/bnx2x/bnx2x_stats.c | 14 ++++++++------
 drivers/net/bnx2x/bnx2x_vfpf.c  | 14 +++++++-------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index c07b01510a..69132c7c80 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -114,7 +114,7 @@ bnx2x_hw_stats_post(struct bnx2x_softc *sc)
 
 	/* Update MCP's statistics if possible */
 	if (sc->func_stx) {
-		rte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
+		memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
 				sizeof(sc->func_stats));
 	}
 
@@ -817,10 +817,10 @@ bnx2x_hw_stats_update(struct bnx2x_softc *sc)
 			  etherstatspktsover1522octets);
     }
 
-    rte_memcpy(old, new, sizeof(struct nig_stats));
+	memcpy(old, new, sizeof(struct nig_stats));
 
-    rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
-	   sizeof(struct mac_stx));
+	memcpy(RTE_PTR_ADD(estats, offsetof(struct bnx2x_eth_stats, rx_stat_ifhcinbadoctets_hi)),
+			&pstats->mac_stx[1], sizeof(struct mac_stx));
     estats->brb_drop_hi = pstats->brb_drop_hi;
     estats->brb_drop_lo = pstats->brb_drop_lo;
 
@@ -1492,9 +1492,11 @@ bnx2x_stats_init(struct bnx2x_softc *sc)
 		REG_RD(sc, NIG_REG_STAT0_BRB_TRUNCATE + port*0x38);
 	if (!CHIP_IS_E3(sc)) {
 		REG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT0 + port*0x50,
-				&(sc->port.old_nig_stats.egress_mac_pkt0_lo), 2);
+				RTE_PTR_ADD(&sc->port.old_nig_stats,
+				offsetof(struct nig_stats, egress_mac_pkt0_lo)), 2);
 		REG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT1 + port*0x50,
-				&(sc->port.old_nig_stats.egress_mac_pkt1_lo), 2);
+				RTE_PTR_ADD(&sc->port.old_nig_stats,
+				offsetof(struct nig_stats, egress_mac_pkt1_lo)), 2);
 	}
 
 	/* function stats */
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 63953c2979..5411df3a38 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -52,9 +52,9 @@ bnx2x_check_bull(struct bnx2x_softc *sc)
 
 	/* check the mac address and VLAN and allocate memory if valid */
 	if (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN))
-		rte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
+		memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
 	if (valid_bitmap & (1 << VLAN_VALID))
-		rte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
+		memcpy(&bull->vlan, &sc->old_bulletin.vlan, sizeof(bull->vlan));
 
 	sc->old_bulletin = *bull;
 
@@ -569,7 +569,7 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
 
 	bnx2x_check_bull(sc);
 
-	rte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
+	memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
 
 	bnx2x_add_tlv(sc, query, query->first_tlv.tl.length,
 		      BNX2X_VF_TLV_LIST_END,
@@ -583,9 +583,9 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
 	while (BNX2X_VF_STATUS_FAILURE == reply->status &&
 			bnx2x_check_bull(sc)) {
 		/* A new mac was configured by PF for us */
-		rte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
+		memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
 				ETH_ALEN);
-		rte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
+		memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
 				ETH_ALEN);
 
 		rc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr);
@@ -622,10 +622,10 @@ bnx2x_vf_config_rss(struct bnx2x_softc *sc,
 		      BNX2X_VF_TLV_LIST_END,
 		      sizeof(struct channel_list_end_tlv));
 
-	rte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
+	memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
 	query->rss_key_size = T_ETH_RSS_KEY;
 
-	rte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);
+	memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);
 	query->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE;
 
 	query->rss_result_mask = params->rss_result_mask;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.035532376 +0800
+++ 0030-net-bnx2x-fix-warnings-about-memcpy-lengths.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From c50b86f7d60f757ea62fe14076be69bf114f1740 Mon Sep 17 00:00:00 2001
+From b3ef799286fdab7c12d8b0a7f77a61aa45500f06 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c50b86f7d60f757ea62fe14076be69bf114f1740 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: remove CN9K inline IPsec FP opcodes' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (28 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/bnx2x: fix warnings about memcpy lengths' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: fix buffer size configuration' " Xueming Li
                     ` (93 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fbfaa5ae043e9902427af18b0f4802235f6a60a7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fbfaa5ae043e9902427af18b0f4802235f6a60a7 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 26 Feb 2024 19:05:23 +0530
Subject: [PATCH] common/cnxk: remove CN9K inline IPsec FP opcodes
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 930d94170e044ce1a2a2f222306c7dad50898728 ]

Since now Inline IPsec in cn9k is using same opcode as LA,
remove the definitions of fast path opcode.

Also fix devarg handling for ipsec_out_max_sa to allow 32-bit.

Fixes: fe5846bcc076 ("net/cnxk: add devargs for min-max SPI")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/cnxk_security.c    | 229 -------------------------
 drivers/common/cnxk/cnxk_security.h    |  12 --
 drivers/common/cnxk/roc_ie_on.h        |  60 -------
 drivers/common/cnxk/roc_nix_inl.h      |  50 +-----
 drivers/common/cnxk/version.map        |   4 -
 drivers/net/cnxk/cnxk_ethdev_devargs.c |   2 +-
 6 files changed, 3 insertions(+), 354 deletions(-)

diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c
index a8c3ba90cd..40685d0912 100644
--- a/drivers/common/cnxk/cnxk_security.c
+++ b/drivers/common/cnxk/cnxk_security.c
@@ -618,235 +618,6 @@ cnxk_ot_ipsec_outb_sa_valid(struct roc_ot_ipsec_outb_sa *sa)
 	return !!sa->w2.s.valid;
 }
 
-static inline int
-ipsec_xfrm_verify(struct rte_security_ipsec_xform *ipsec_xfrm,
-		  struct rte_crypto_sym_xform *crypto_xfrm)
-{
-	if (crypto_xfrm->next == NULL)
-		return -EINVAL;
-
-	if (ipsec_xfrm->direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS) {
-		if (crypto_xfrm->type != RTE_CRYPTO_SYM_XFORM_AUTH ||
-		    crypto_xfrm->next->type != RTE_CRYPTO_SYM_XFORM_CIPHER)
-			return -EINVAL;
-	} else {
-		if (crypto_xfrm->type != RTE_CRYPTO_SYM_XFORM_CIPHER ||
-		    crypto_xfrm->next->type != RTE_CRYPTO_SYM_XFORM_AUTH)
-			return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int
-onf_ipsec_sa_common_param_fill(struct roc_ie_onf_sa_ctl *ctl, uint8_t *salt,
-			       uint8_t *cipher_key, uint8_t *hmac_opad_ipad,
-			       struct rte_security_ipsec_xform *ipsec_xfrm,
-			       struct rte_crypto_sym_xform *crypto_xfrm)
-{
-	struct rte_crypto_sym_xform *auth_xfrm, *cipher_xfrm;
-	int rc, length, auth_key_len;
-	const uint8_t *key = NULL;
-	uint8_t ccm_flag = 0;
-
-	/* Set direction */
-	switch (ipsec_xfrm->direction) {
-	case RTE_SECURITY_IPSEC_SA_DIR_INGRESS:
-		ctl->direction = ROC_IE_SA_DIR_INBOUND;
-		auth_xfrm = crypto_xfrm;
-		cipher_xfrm = crypto_xfrm->next;
-		break;
-	case RTE_SECURITY_IPSEC_SA_DIR_EGRESS:
-		ctl->direction = ROC_IE_SA_DIR_OUTBOUND;
-		cipher_xfrm = crypto_xfrm;
-		auth_xfrm = crypto_xfrm->next;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	/* Set protocol - ESP vs AH */
-	switch (ipsec_xfrm->proto) {
-	case RTE_SECURITY_IPSEC_SA_PROTO_ESP:
-		ctl->ipsec_proto = ROC_IE_SA_PROTOCOL_ESP;
-		break;
-	case RTE_SECURITY_IPSEC_SA_PROTO_AH:
-		return -ENOTSUP;
-	default:
-		return -EINVAL;
-	}
-
-	/* Set mode - transport vs tunnel */
-	switch (ipsec_xfrm->mode) {
-	case RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT:
-		ctl->ipsec_mode = ROC_IE_SA_MODE_TRANSPORT;
-		break;
-	case RTE_SECURITY_IPSEC_SA_MODE_TUNNEL:
-		ctl->ipsec_mode = ROC_IE_SA_MODE_TUNNEL;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	/* Set encryption algorithm */
-	if (crypto_xfrm->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
-		length = crypto_xfrm->aead.key.length;
-
-		switch (crypto_xfrm->aead.algo) {
-		case RTE_CRYPTO_AEAD_AES_GCM:
-			ctl->enc_type = ROC_IE_ON_SA_ENC_AES_GCM;
-			ctl->auth_type = ROC_IE_ON_SA_AUTH_NULL;
-			memcpy(salt, &ipsec_xfrm->salt, 4);
-			key = crypto_xfrm->aead.key.data;
-			break;
-		case RTE_CRYPTO_AEAD_AES_CCM:
-			ctl->enc_type = ROC_IE_ON_SA_ENC_AES_CCM;
-			ctl->auth_type = ROC_IE_ON_SA_AUTH_NULL;
-			ccm_flag = 0x07 & ~ROC_CPT_AES_CCM_CTR_LEN;
-			*salt = ccm_flag;
-			memcpy(PLT_PTR_ADD(salt, 1), &ipsec_xfrm->salt, 3);
-			key = crypto_xfrm->aead.key.data;
-			break;
-		default:
-			return -ENOTSUP;
-		}
-
-	} else {
-		rc = ipsec_xfrm_verify(ipsec_xfrm, crypto_xfrm);
-		if (rc)
-			return rc;
-
-		switch (cipher_xfrm->cipher.algo) {
-		case RTE_CRYPTO_CIPHER_AES_CBC:
-			ctl->enc_type = ROC_IE_ON_SA_ENC_AES_CBC;
-			break;
-		case RTE_CRYPTO_CIPHER_AES_CTR:
-			ctl->enc_type = ROC_IE_ON_SA_ENC_AES_CTR;
-			break;
-		default:
-			return -ENOTSUP;
-		}
-
-		switch (auth_xfrm->auth.algo) {
-		case RTE_CRYPTO_AUTH_SHA1_HMAC:
-			ctl->auth_type = ROC_IE_ON_SA_AUTH_SHA1;
-			break;
-		default:
-			return -ENOTSUP;
-		}
-		auth_key_len = auth_xfrm->auth.key.length;
-		if (auth_key_len < 20 || auth_key_len > 64)
-			return -ENOTSUP;
-
-		key = cipher_xfrm->cipher.key.data;
-		length = cipher_xfrm->cipher.key.length;
-
-		ipsec_hmac_opad_ipad_gen(auth_xfrm, hmac_opad_ipad);
-	}
-
-	switch (length) {
-	case ROC_CPT_AES128_KEY_LEN:
-		ctl->aes_key_len = ROC_IE_SA_AES_KEY_LEN_128;
-		break;
-	case ROC_CPT_AES192_KEY_LEN:
-		ctl->aes_key_len = ROC_IE_SA_AES_KEY_LEN_192;
-		break;
-	case ROC_CPT_AES256_KEY_LEN:
-		ctl->aes_key_len = ROC_IE_SA_AES_KEY_LEN_256;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	memcpy(cipher_key, key, length);
-
-	if (ipsec_xfrm->options.esn)
-		ctl->esn_en = 1;
-
-	ctl->spi = rte_cpu_to_be_32(ipsec_xfrm->spi);
-	return 0;
-}
-
-int
-cnxk_onf_ipsec_inb_sa_fill(struct roc_onf_ipsec_inb_sa *sa,
-			   struct rte_security_ipsec_xform *ipsec_xfrm,
-			   struct rte_crypto_sym_xform *crypto_xfrm)
-{
-	struct roc_ie_onf_sa_ctl *ctl = &sa->ctl;
-	int rc;
-
-	rc = onf_ipsec_sa_common_param_fill(ctl, sa->nonce, sa->cipher_key,
-					    sa->hmac_key, ipsec_xfrm,
-					    crypto_xfrm);
-	if (rc)
-		return rc;
-
-	rte_wmb();
-
-	/* Enable SA */
-	ctl->valid = 1;
-	return 0;
-}
-
-int
-cnxk_onf_ipsec_outb_sa_fill(struct roc_onf_ipsec_outb_sa *sa,
-			    struct rte_security_ipsec_xform *ipsec_xfrm,
-			    struct rte_crypto_sym_xform *crypto_xfrm)
-{
-	struct rte_security_ipsec_tunnel_param *tunnel = &ipsec_xfrm->tunnel;
-	struct roc_ie_onf_sa_ctl *ctl = &sa->ctl;
-	int rc;
-
-	/* Fill common params */
-	rc = onf_ipsec_sa_common_param_fill(ctl, sa->nonce, sa->cipher_key,
-					    sa->hmac_key, ipsec_xfrm,
-					    crypto_xfrm);
-	if (rc)
-		return rc;
-
-	if (ipsec_xfrm->mode != RTE_SECURITY_IPSEC_SA_MODE_TUNNEL)
-		goto skip_tunnel_info;
-
-	/* Tunnel header info */
-	switch (tunnel->type) {
-	case RTE_SECURITY_IPSEC_TUNNEL_IPV4:
-		memcpy(&sa->ip_src, &tunnel->ipv4.src_ip,
-		       sizeof(struct in_addr));
-		memcpy(&sa->ip_dst, &tunnel->ipv4.dst_ip,
-		       sizeof(struct in_addr));
-		break;
-	case RTE_SECURITY_IPSEC_TUNNEL_IPV6:
-		return -ENOTSUP;
-	default:
-		return -EINVAL;
-	}
-
-	/* Update udp encap ports */
-	if (ipsec_xfrm->options.udp_encap == 1) {
-		sa->udp_src = 4500;
-		sa->udp_dst = 4500;
-	}
-
-skip_tunnel_info:
-	rte_wmb();
-
-	/* Enable SA */
-	ctl->valid = 1;
-	return 0;
-}
-
-bool
-cnxk_onf_ipsec_inb_sa_valid(struct roc_onf_ipsec_inb_sa *sa)
-{
-	return !!sa->ctl.valid;
-}
-
-bool
-cnxk_onf_ipsec_outb_sa_valid(struct roc_onf_ipsec_outb_sa *sa)
-{
-	return !!sa->ctl.valid;
-}
-
 uint8_t
 cnxk_ipsec_ivlen_get(enum rte_crypto_cipher_algorithm c_algo,
 		     enum rte_crypto_auth_algorithm a_algo,
diff --git a/drivers/common/cnxk/cnxk_security.h b/drivers/common/cnxk/cnxk_security.h
index 2277ce9144..72628ef3b8 100644
--- a/drivers/common/cnxk/cnxk_security.h
+++ b/drivers/common/cnxk/cnxk_security.h
@@ -48,18 +48,6 @@ cnxk_ot_ipsec_outb_sa_fill(struct roc_ot_ipsec_outb_sa *sa,
 bool __roc_api cnxk_ot_ipsec_inb_sa_valid(struct roc_ot_ipsec_inb_sa *sa);
 bool __roc_api cnxk_ot_ipsec_outb_sa_valid(struct roc_ot_ipsec_outb_sa *sa);
 
-/* [CN9K, CN10K) */
-int __roc_api
-cnxk_onf_ipsec_inb_sa_fill(struct roc_onf_ipsec_inb_sa *sa,
-			   struct rte_security_ipsec_xform *ipsec_xfrm,
-			   struct rte_crypto_sym_xform *crypto_xfrm);
-int __roc_api
-cnxk_onf_ipsec_outb_sa_fill(struct roc_onf_ipsec_outb_sa *sa,
-			    struct rte_security_ipsec_xform *ipsec_xfrm,
-			    struct rte_crypto_sym_xform *crypto_xfrm);
-bool __roc_api cnxk_onf_ipsec_inb_sa_valid(struct roc_onf_ipsec_inb_sa *sa);
-bool __roc_api cnxk_onf_ipsec_outb_sa_valid(struct roc_onf_ipsec_outb_sa *sa);
-
 /* [CN9K] */
 int __roc_api
 cnxk_on_ipsec_inb_sa_create(struct rte_security_ipsec_xform *ipsec,
diff --git a/drivers/common/cnxk/roc_ie_on.h b/drivers/common/cnxk/roc_ie_on.h
index 9933ffa148..11c995e9d1 100644
--- a/drivers/common/cnxk/roc_ie_on.h
+++ b/drivers/common/cnxk/roc_ie_on.h
@@ -269,66 +269,6 @@ struct roc_ie_on_inb_sa {
 #define ROC_IE_ON_UCC_L2_HDR_INFO_ERR	  0xCF
 #define ROC_IE_ON_UCC_L2_HDR_LEN_ERR	  0xE0
 
-struct roc_ie_onf_sa_ctl {
-	uint32_t spi;
-	uint64_t exp_proto_inter_frag : 8;
-	uint64_t rsvd_41_40 : 2;
-	/* Disable SPI, SEQ data in RPTR for Inbound inline */
-	uint64_t spi_seq_dis : 1;
-	uint64_t esn_en : 1;
-	uint64_t rsvd_44_45 : 2;
-	uint64_t encap_type : 2;
-	uint64_t enc_type : 3;
-	uint64_t rsvd_48 : 1;
-	uint64_t auth_type : 4;
-	uint64_t valid : 1;
-	uint64_t direction : 1;
-	uint64_t outer_ip_ver : 1;
-	uint64_t inner_ip_ver : 1;
-	uint64_t ipsec_mode : 1;
-	uint64_t ipsec_proto : 1;
-	uint64_t aes_key_len : 2;
-};
-
-struct roc_onf_ipsec_outb_sa {
-	/* w0 */
-	struct roc_ie_onf_sa_ctl ctl;
-
-	/* w1 */
-	uint8_t nonce[4];
-	uint16_t udp_src;
-	uint16_t udp_dst;
-
-	/* w2 */
-	uint32_t ip_src;
-	uint32_t ip_dst;
-
-	/* w3-w6 */
-	uint8_t cipher_key[32];
-
-	/* w7-w12 */
-	uint8_t hmac_key[48];
-};
-
-struct roc_onf_ipsec_inb_sa {
-	/* w0 */
-	struct roc_ie_onf_sa_ctl ctl;
-
-	/* w1 */
-	uint8_t nonce[4]; /* Only for AES-GCM */
-	uint32_t unused;
-
-	/* w2 */
-	uint32_t esn_hi;
-	uint32_t esn_low;
-
-	/* w3-w6 */
-	uint8_t cipher_key[32];
-
-	/* w7-w12 */
-	uint8_t hmac_key[48];
-};
-
 #define ROC_ONF_IPSEC_INB_MAX_L2_SZ	  32UL
 #define ROC_ONF_IPSEC_OUTB_MAX_L2_SZ	  30UL
 #define ROC_ONF_IPSEC_OUTB_MAX_L2_INFO_SZ (ROC_ONF_IPSEC_OUTB_MAX_L2_SZ + 2)
diff --git a/drivers/common/cnxk/roc_nix_inl.h b/drivers/common/cnxk/roc_nix_inl.h
index ab1e9c0f98..f5ce26f03f 100644
--- a/drivers/common/cnxk/roc_nix_inl.h
+++ b/drivers/common/cnxk/roc_nix_inl.h
@@ -4,24 +4,6 @@
 #ifndef _ROC_NIX_INL_H_
 #define _ROC_NIX_INL_H_
 
-/* ONF INB HW area */
-#define ROC_NIX_INL_ONF_IPSEC_INB_HW_SZ                                        \
-	PLT_ALIGN(sizeof(struct roc_onf_ipsec_inb_sa), ROC_ALIGN)
-/* ONF INB SW reserved area */
-#define ROC_NIX_INL_ONF_IPSEC_INB_SW_RSVD 384
-#define ROC_NIX_INL_ONF_IPSEC_INB_SA_SZ                                        \
-	(ROC_NIX_INL_ONF_IPSEC_INB_HW_SZ + ROC_NIX_INL_ONF_IPSEC_INB_SW_RSVD)
-#define ROC_NIX_INL_ONF_IPSEC_INB_SA_SZ_LOG2 9
-
-/* ONF OUTB HW area */
-#define ROC_NIX_INL_ONF_IPSEC_OUTB_HW_SZ                                       \
-	PLT_ALIGN(sizeof(struct roc_onf_ipsec_outb_sa), ROC_ALIGN)
-/* ONF OUTB SW reserved area */
-#define ROC_NIX_INL_ONF_IPSEC_OUTB_SW_RSVD 128
-#define ROC_NIX_INL_ONF_IPSEC_OUTB_SA_SZ                                       \
-	(ROC_NIX_INL_ONF_IPSEC_OUTB_HW_SZ + ROC_NIX_INL_ONF_IPSEC_OUTB_SW_RSVD)
-#define ROC_NIX_INL_ONF_IPSEC_OUTB_SA_SZ_LOG2 8
-
 /* ON INB HW area */
 #define ROC_NIX_INL_ON_IPSEC_INB_HW_SZ                                         \
 	PLT_ALIGN(sizeof(struct roc_ie_on_inb_sa), ROC_ALIGN)
@@ -31,10 +13,10 @@
 	(ROC_NIX_INL_ON_IPSEC_INB_HW_SZ + ROC_NIX_INL_ON_IPSEC_INB_SW_RSVD)
 #define ROC_NIX_INL_ON_IPSEC_INB_SA_SZ_LOG2 10
 
-/* ONF OUTB HW area */
+/* ON OUTB HW area */
 #define ROC_NIX_INL_ON_IPSEC_OUTB_HW_SZ                                        \
 	PLT_ALIGN(sizeof(struct roc_ie_on_outb_sa), ROC_ALIGN)
-/* ONF OUTB SW reserved area */
+/* ON OUTB SW reserved area */
 #define ROC_NIX_INL_ON_IPSEC_OUTB_SW_RSVD 256
 #define ROC_NIX_INL_ON_IPSEC_OUTB_SA_SZ                                        \
 	(ROC_NIX_INL_ON_IPSEC_OUTB_HW_SZ + ROC_NIX_INL_ON_IPSEC_OUTB_SW_RSVD)
@@ -86,34 +68,6 @@ roc_nix_inl_on_ipsec_outb_sa_sw_rsvd(void *sa)
 	return PLT_PTR_ADD(sa, ROC_NIX_INL_ON_IPSEC_OUTB_HW_SZ);
 }
 
-static inline struct roc_onf_ipsec_inb_sa *
-roc_nix_inl_onf_ipsec_inb_sa(uintptr_t base, uint64_t idx)
-{
-	uint64_t off = idx << ROC_NIX_INL_ONF_IPSEC_INB_SA_SZ_LOG2;
-
-	return PLT_PTR_ADD(base, off);
-}
-
-static inline struct roc_onf_ipsec_outb_sa *
-roc_nix_inl_onf_ipsec_outb_sa(uintptr_t base, uint64_t idx)
-{
-	uint64_t off = idx << ROC_NIX_INL_ONF_IPSEC_OUTB_SA_SZ_LOG2;
-
-	return PLT_PTR_ADD(base, off);
-}
-
-static inline void *
-roc_nix_inl_onf_ipsec_inb_sa_sw_rsvd(void *sa)
-{
-	return PLT_PTR_ADD(sa, ROC_NIX_INL_ONF_IPSEC_INB_HW_SZ);
-}
-
-static inline void *
-roc_nix_inl_onf_ipsec_outb_sa_sw_rsvd(void *sa)
-{
-	return PLT_PTR_ADD(sa, ROC_NIX_INL_ONF_IPSEC_OUTB_HW_SZ);
-}
-
 /* Inline device SSO Work callback */
 typedef void (*roc_nix_inl_sso_work_cb_t)(uint64_t *gw, void *args,
 					  uint32_t soft_exp_event);
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index aa884a8fe2..e718c13acb 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -17,10 +17,6 @@ INTERNAL {
 	cnxk_logtype_sso;
 	cnxk_logtype_tim;
 	cnxk_logtype_tm;
-	cnxk_onf_ipsec_inb_sa_fill;
-	cnxk_onf_ipsec_outb_sa_fill;
-	cnxk_onf_ipsec_inb_sa_valid;
-	cnxk_onf_ipsec_outb_sa_valid;
 	cnxk_ot_ipsec_inb_sa_fill;
 	cnxk_ot_ipsec_outb_sa_fill;
 	cnxk_ot_ipsec_inb_sa_valid;
diff --git a/drivers/net/cnxk/cnxk_ethdev_devargs.c b/drivers/net/cnxk/cnxk_ethdev_devargs.c
index 8e862be933..a0e9300cff 100644
--- a/drivers/net/cnxk/cnxk_ethdev_devargs.c
+++ b/drivers/net/cnxk/cnxk_ethdev_devargs.c
@@ -75,7 +75,7 @@ parse_ipsec_out_max_sa(const char *key, const char *value, void *extra_args)
 	if (errno)
 		val = 0;
 
-	*(uint16_t *)extra_args = val;
+	*(uint32_t *)extra_args = val;
 
 	return 0;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.064692038 +0800
+++ 0031-common-cnxk-remove-CN9K-inline-IPsec-FP-opcodes.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From 930d94170e044ce1a2a2f222306c7dad50898728 Mon Sep 17 00:00:00 2001
+From fbfaa5ae043e9902427af18b0f4802235f6a60a7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 930d94170e044ce1a2a2f222306c7dad50898728 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -16 +18 @@
- drivers/common/cnxk/cnxk_security.c    | 230 -------------------------
+ drivers/common/cnxk/cnxk_security.c    | 229 -------------------------
@@ -22 +24 @@
- 6 files changed, 3 insertions(+), 355 deletions(-)
+ 6 files changed, 3 insertions(+), 354 deletions(-)
@@ -25 +27 @@
-index 64c901a57a..bab015e3b3 100644
+index a8c3ba90cd..40685d0912 100644
@@ -28 +30 @@
-@@ -574,236 +574,6 @@ cnxk_ot_ipsec_outb_sa_valid(struct roc_ot_ipsec_outb_sa *sa)
+@@ -618,235 +618,6 @@ cnxk_ot_ipsec_outb_sa_valid(struct roc_ot_ipsec_outb_sa *sa)
@@ -155,2 +157 @@
--		roc_se_hmac_opad_ipad_gen(ctl->auth_type, auth_xfrm->auth.key.data,
--					  auth_xfrm->auth.key.length, hmac_opad_ipad, ROC_SE_IPSEC);
+-		ipsec_hmac_opad_ipad_gen(auth_xfrm, hmac_opad_ipad);
@@ -266 +267 @@
-index b323b8b757..19eb9bb03d 100644
+index 2277ce9144..72628ef3b8 100644
@@ -286,2 +287,2 @@
- int __roc_api cnxk_on_ipsec_inb_sa_create(struct rte_security_ipsec_xform *ipsec,
- 					  struct rte_crypto_sym_xform *crypto_xform,
+ int __roc_api
+ cnxk_on_ipsec_inb_sa_create(struct rte_security_ipsec_xform *ipsec,
@@ -360 +361 @@
-index a89b40ff61..8acd7e0545 100644
+index ab1e9c0f98..f5ce26f03f 100644
@@ -437 +438 @@
-index 892fcb1f0d..73fd890f20 100644
+index aa884a8fe2..e718c13acb 100644
@@ -452 +453 @@
-index 50dc80ce2c..1bab19fc23 100644
+index 8e862be933..a0e9300cff 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix buffer size configuration' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (29 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: remove CN9K inline IPsec FP opcodes' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix Tx MTU " Xueming Li
                     ` (92 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e71ac13a3825273e9cfec20cf4410dd0d4db2ebb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e71ac13a3825273e9cfec20cf4410dd0d4db2ebb Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 26 Feb 2024 19:05:28 +0530
Subject: [PATCH] net/cnxk: fix buffer size configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3e12147f71ffb96595bf35a92f3f3741ae9d91bb ]

In case where cnxk_nix_mtu_set() is called before
data->min_rx_buf_size is set, use buf size from first RQ's
mempool.

Fixes: 34b46320f446 ("net/cnxk: perform early MTU setup for event mode")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev_ops.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 5de2919047..ec72c32826 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -544,8 +544,9 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	struct rte_eth_dev_data *data = eth_dev->data;
 	struct roc_nix *nix = &dev->nix;
+	struct cnxk_eth_rxq_sp *rxq_sp;
+	uint32_t buffsz = 0;
 	int rc = -EINVAL;
-	uint32_t buffsz;
 
 	frame_size += CNXK_NIX_TIMESYNC_RX_OFFSET * dev->ptp_en;
 
@@ -561,8 +562,24 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
 		goto exit;
 	}
 
-	buffsz = data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM;
-	old_frame_size = data->mtu + CNXK_NIX_L2_OVERHEAD;
+	if (!eth_dev->data->nb_rx_queues)
+		goto skip_buffsz_check;
+
+	/* Perform buff size check */
+	if (data->min_rx_buf_size) {
+		buffsz = data->min_rx_buf_size;
+	} else if (eth_dev->data->rx_queues && eth_dev->data->rx_queues[0]) {
+		rxq_sp = cnxk_eth_rxq_to_sp(data->rx_queues[0]);
+
+		if (rxq_sp->qconf.mp)
+			buffsz = rte_pktmbuf_data_room_size(rxq_sp->qconf.mp);
+	}
+
+	/* Skip validation if RQ's are not yet setup */
+	if (!buffsz)
+		goto skip_buffsz_check;
+
+	buffsz -= RTE_PKTMBUF_HEADROOM;
 
 	/* Refuse MTU that requires the support of scattered packets
 	 * when this feature has not been enabled before.
@@ -580,6 +597,8 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)
 		goto exit;
 	}
 
+skip_buffsz_check:
+	old_frame_size = data->mtu + CNXK_NIX_L2_OVERHEAD;
 	/* if new MTU was smaller than old one, then flush all SQs before MTU change */
 	if (old_frame_size > frame_size) {
 		if (data->dev_started) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.097194496 +0800
+++ 0032-net-cnxk-fix-buffer-size-configuration.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From 3e12147f71ffb96595bf35a92f3f3741ae9d91bb Mon Sep 17 00:00:00 2001
+From e71ac13a3825273e9cfec20cf4410dd0d4db2ebb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3e12147f71ffb96595bf35a92f3f3741ae9d91bb ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index e9ab8da781..e816884d47 100644
+index 5de2919047..ec72c32826 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix Tx MTU configuration' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (30 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: fix buffer size configuration' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: fix MTU limit' " Xueming Li
                     ` (91 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3e73021b35d56bd1f17648047fa2abd439d653bf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3e73021b35d56bd1f17648047fa2abd439d653bf Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 26 Feb 2024 19:05:29 +0530
Subject: [PATCH] common/cnxk: fix Tx MTU configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cc9f534f60815d858b946062cb1d9701c91b9b58 ]

Skip setting Tx MTU separately as now the Tx credit configuration
is based on max MTU possible for that link.

Also, initialize  MTU with max value for that port.

Fixes: 8589ec212e80 ("net/cnxk: support MTU set")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_nix.c      |  2 +-
 drivers/common/cnxk/roc_nix.h      |  2 --
 drivers/net/cnxk/cnxk_ethdev_ops.c | 12 +-----------
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c
index f64933a1d9..afbc3eb901 100644
--- a/drivers/common/cnxk/roc_nix.c
+++ b/drivers/common/cnxk/roc_nix.c
@@ -482,7 +482,7 @@ skip_dev_init:
 	sdp_lbk_id_update(pci_dev, nix);
 	nix->pci_dev = pci_dev;
 	nix->reta_sz = reta_sz;
-	nix->mtu = ROC_NIX_DEFAULT_HW_FRS;
+	nix->mtu = roc_nix_max_pkt_len(roc_nix);
 	nix->dmac_flt_idx = -1;
 
 	/* Register error and ras interrupts */
diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h
index acdd1c4cbc..250d710c07 100644
--- a/drivers/common/cnxk/roc_nix.h
+++ b/drivers/common/cnxk/roc_nix.h
@@ -267,8 +267,6 @@ struct roc_nix_eeprom_info {
 #define ROC_NIX_RSS_KEY_LEN	     48 /* 352 Bits */
 #define ROC_NIX_RSS_MCAM_IDX_DEFAULT (-1)
 
-#define ROC_NIX_DEFAULT_HW_FRS 1514
-
 #define ROC_NIX_VWQE_MAX_SIZE_LOG2 11
 #define ROC_NIX_VWQE_MIN_SIZE_LOG2 2
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index ec72c32826..2fdad8b4b6 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -610,19 +610,9 @@ skip_buffsz_check:
 
 	frame_size -= RTE_ETHER_CRC_LEN;
 
-	/* Update mtu on Tx */
-	rc = roc_nix_mac_mtu_set(nix, frame_size);
-	if (rc) {
-		plt_err("Failed to set MTU, rc=%d", rc);
-		goto exit;
-	}
-
-	/* Sync same frame size on Rx */
+	/* Set frame size on Rx */
 	rc = roc_nix_mac_max_rx_len_set(nix, frame_size);
 	if (rc) {
-		/* Rollback to older mtu */
-		roc_nix_mac_mtu_set(nix,
-				    old_frame_size - RTE_ETHER_CRC_LEN);
 		plt_err("Failed to max Rx frame length, rc=%d", rc);
 		goto exit;
 	}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.120148366 +0800
+++ 0033-common-cnxk-fix-Tx-MTU-configuration.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From cc9f534f60815d858b946062cb1d9701c91b9b58 Mon Sep 17 00:00:00 2001
+From 3e73021b35d56bd1f17648047fa2abd439d653bf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cc9f534f60815d858b946062cb1d9701c91b9b58 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 97c0ae3e25..90ccb260fb 100644
+index f64933a1d9..afbc3eb901 100644
@@ -25 +27 @@
-@@ -484,7 +484,7 @@ skip_dev_init:
+@@ -482,7 +482,7 @@ skip_dev_init:
@@ -35 +37 @@
-index 2a198de458..4db71544f0 100644
+index acdd1c4cbc..250d710c07 100644
@@ -48 +50 @@
-index e816884d47..4962f3bced 100644
+index ec72c32826..2fdad8b4b6 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix MTU limit' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (31 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix Tx MTU " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix RSS RETA configuration' " Xueming Li
                     ` (90 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f4c83ba01c38bf22ca2bb3d2ada958a0c4f041ec

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f4c83ba01c38bf22ca2bb3d2ada958a0c4f041ec Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <skori@marvell.com>
Date: Mon, 26 Feb 2024 19:05:30 +0530
Subject: [PATCH] net/cnxk: fix MTU limit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 402de2fd8729b61a3ace67c597e99893acb426d4 ]

Device can support maximum frame size up to 9212 bytes. While configuring
MTU, overhead is considered as ethernet header size, CRC and
2 * (VLAN tags) which translates to 26 bytes.

Exposed overhead to the user via rte_eth_dev_info() is 18 bytes which were
leading to set wrong Rx frame size.

Fixes: 8589ec212e80 ("net/cnxk: support MTU set")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev_ops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 2fdad8b4b6..3c77f79fcc 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -20,8 +20,7 @@ cnxk_nix_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *devinfo)
 	devinfo->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;
 	devinfo->max_mac_addrs = dev->max_mac_entries;
 	devinfo->max_vfs = pci_dev->max_vfs;
-	devinfo->max_mtu = devinfo->max_rx_pktlen -
-				(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);
+	devinfo->max_mtu = devinfo->max_rx_pktlen - CNXK_NIX_L2_OVERHEAD;
 	devinfo->min_mtu = devinfo->min_rx_bufsize - CNXK_NIX_L2_OVERHEAD;
 
 	devinfo->rx_offload_capa = dev->rx_offload_capa;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.148319129 +0800
+++ 0034-net-cnxk-fix-MTU-limit.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From 402de2fd8729b61a3ace67c597e99893acb426d4 Mon Sep 17 00:00:00 2001
+From f4c83ba01c38bf22ca2bb3d2ada958a0c4f041ec Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 402de2fd8729b61a3ace67c597e99893acb426d4 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 4962f3bced..56049c5dd2 100644
+index 2fdad8b4b6..3c77f79fcc 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix RSS RETA configuration' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (32 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: fix MTU limit' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: fix indirect mbuf handling in Tx' " Xueming Li
                     ` (89 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Kommula Shiva Shankar; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6c6cd1fe5322873d1116f178d263673ab0c7757f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6c6cd1fe5322873d1116f178d263673ab0c7757f Mon Sep 17 00:00:00 2001
From: Kommula Shiva Shankar <kshankar@marvell.com>
Date: Mon, 26 Feb 2024 19:05:31 +0530
Subject: [PATCH] common/cnxk: fix RSS RETA configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dce7f0c2400246da41049c64c0c461a24a4c0498 ]

Update queue entries copy in RETA table based on data type.

Fixes: 1bf6746e653b ("common/cnxk: support NIX RSS")

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
---
 drivers/common/cnxk/roc_nix_rss.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_rss.c b/drivers/common/cnxk/roc_nix_rss.c
index 3599eb9bae..2b88e1360d 100644
--- a/drivers/common/cnxk/roc_nix_rss.c
+++ b/drivers/common/cnxk/roc_nix_rss.c
@@ -196,7 +196,7 @@ roc_nix_rss_reta_set(struct roc_nix *roc_nix, uint8_t group,
 	if (rc)
 		return rc;
 
-	memcpy(&nix->reta[group], reta, ROC_NIX_RSS_RETA_MAX);
+	memcpy(&nix->reta[group], reta, sizeof(uint16_t) * ROC_NIX_RSS_RETA_MAX);
 	return 0;
 }
 
@@ -209,7 +209,7 @@ roc_nix_rss_reta_get(struct roc_nix *roc_nix, uint8_t group,
 	if (group >= ROC_NIX_RSS_GRPS)
 		return NIX_ERR_PARAM;
 
-	memcpy(reta, &nix->reta[group], ROC_NIX_RSS_RETA_MAX);
+	memcpy(reta, &nix->reta[group], sizeof(uint16_t) * ROC_NIX_RSS_RETA_MAX);
 	return 0;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.175059894 +0800
+++ 0035-common-cnxk-fix-RSS-RETA-configuration.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From dce7f0c2400246da41049c64c0c461a24a4c0498 Mon Sep 17 00:00:00 2001
+From 6c6cd1fe5322873d1116f178d263673ab0c7757f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dce7f0c2400246da41049c64c0c461a24a4c0498 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix indirect mbuf handling in Tx' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (33 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix RSS RETA configuration' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: add cookies check for multi-segment offload' " Xueming Li
                     ` (88 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: Rahul Bhansali, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0e5159a2235eccd26418d422868a9301d0aaf741

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0e5159a2235eccd26418d422868a9301d0aaf741 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 26 Feb 2024 19:05:32 +0530
Subject: [PATCH] net/cnxk: fix indirect mbuf handling in Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3232c95d2c361bdf5509cb9e9d0b9820398c1335 ]

Indirect mbuf can be pointing to data from different pool. Use the
correct AURA in NIX send header in SG2 and SG case.

Fixes: 862e28128707 ("net/cnxk: add vector Tx for CN9K")
Fixes: f71b7dbbf04b ("net/cnxk: add vector Tx for CN10K")
Fixes: 7e95c11df4f1 ("net/cnxk: add multi-segment Tx for CN9K")
Fixes: 3626d5195d49 ("net/cnxk: add multi-segment Tx for CN10K")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev.c   |   6 +
 drivers/net/cnxk/cn10k_rxtx.h     |   1 +
 drivers/net/cnxk/cn10k_tx.h       | 269 +++++++++++++++++++--------
 drivers/net/cnxk/cn9k_ethdev.c    |   6 +
 drivers/net/cnxk/cn9k_ethdev.h    |   1 +
 drivers/net/cnxk/cn9k_tx.h        | 299 +++++++++++++++++++++---------
 drivers/net/cnxk/cnxk_ethdev_dp.h |  10 +-
 7 files changed, 414 insertions(+), 178 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index 4a4e97287c..29b7f2ba5e 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -389,7 +389,13 @@ cn10k_nix_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t qidx)
 		struct roc_nix_sq *sq = &dev->sqs[qidx];
 		do {
 			handle_tx_completion_pkts(txq, flags & NIX_TX_VWQE_F);
+			/* Check if SQ is empty */
 			roc_nix_sq_head_tail_get(nix, sq->qid, &head, &tail);
+			if (head != tail)
+				continue;
+
+			/* Check if completion CQ is empty */
+			roc_nix_cq_head_tail_get(nix, sq->cqid, &head, &tail);
 		} while (head != tail);
 	}
 
diff --git a/drivers/net/cnxk/cn10k_rxtx.h b/drivers/net/cnxk/cn10k_rxtx.h
index aeffc4ac92..9f33d0192e 100644
--- a/drivers/net/cnxk/cn10k_rxtx.h
+++ b/drivers/net/cnxk/cn10k_rxtx.h
@@ -177,6 +177,7 @@ handle_tx_completion_pkts(struct cn10k_eth_txq *txq, uint8_t mt_safe)
 			m = m_next;
 		}
 		rte_pktmbuf_free_seg(m);
+		txq->tx_compl.ptr[tx_compl_s0->sqe_id] = NULL;
 
 		head++;
 		head &= qmask;
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 467f0ccc65..025eff2913 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -786,8 +786,9 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
 
 static __rte_always_inline uint64_t
 cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
-		struct nix_send_hdr_s *send_hdr)
+		      struct nix_send_hdr_s *send_hdr, uint64_t *aura)
 {
+	struct rte_mbuf *prev = NULL;
 	uint32_t sqe_id;
 
 	if (RTE_MBUF_HAS_EXTBUF(m)) {
@@ -796,7 +797,10 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
 			return 1;
 		}
 		if (send_hdr->w0.pnc) {
-			txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m;
+			sqe_id = send_hdr->w1.sqe_id;
+			prev = txq->tx_compl.ptr[sqe_id];
+			m->next = prev;
+			txq->tx_compl.ptr[sqe_id] = m;
 		} else {
 			sqe_id = __atomic_fetch_add(&txq->tx_compl.sqe_id, 1, __ATOMIC_RELAXED);
 			send_hdr->w0.pnc = 1;
@@ -806,10 +810,155 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
 		}
 		return 1;
 	} else {
-		return cnxk_nix_prefree_seg(m);
+		return cnxk_nix_prefree_seg(m, aura);
 	}
 }
 
+#if defined(RTE_ARCH_ARM64)
+/* Only called for first segments of single segmented mbufs */
+static __rte_always_inline void
+cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+			  uint64x2_t *senddesc01_w0, uint64x2_t *senddesc23_w0,
+			  uint64x2_t *senddesc01_w1, uint64x2_t *senddesc23_w1)
+{
+	struct rte_mbuf **tx_compl_ptr = txq->tx_compl.ptr;
+	uint32_t nb_desc_mask = txq->tx_compl.nb_desc_mask;
+	bool tx_compl_ena = txq->tx_compl.ena;
+	struct rte_mbuf *m0, *m1, *m2, *m3;
+	struct rte_mbuf *cookie;
+	uint64_t w0, w1, aura;
+	uint64_t sqe_id;
+
+	m0 = mbufs[0];
+	m1 = mbufs[1];
+	m2 = mbufs[2];
+	m3 = mbufs[3];
+
+	/* mbuf 0 */
+	w0 = vgetq_lane_u64(*senddesc01_w0, 0);
+	if (RTE_MBUF_HAS_EXTBUF(m0)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc01_w1, 0);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m0);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m0;
+			*senddesc01_w1 = vsetq_lane_u64(w1, *senddesc01_w1, 0);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m0) ? m0 : rte_mbuf_from_indirect(m0);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m0, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc01_w0 = vsetq_lane_u64(w0, *senddesc01_w0, 0);
+
+	/* mbuf1 */
+	w0 = vgetq_lane_u64(*senddesc01_w0, 1);
+	if (RTE_MBUF_HAS_EXTBUF(m1)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc01_w1, 1);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m1);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m1;
+			*senddesc01_w1 = vsetq_lane_u64(w1, *senddesc01_w1, 1);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m1) ? m1 : rte_mbuf_from_indirect(m1);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m1, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc01_w0 = vsetq_lane_u64(w0, *senddesc01_w0, 1);
+
+	/* mbuf 2 */
+	w0 = vgetq_lane_u64(*senddesc23_w0, 0);
+	if (RTE_MBUF_HAS_EXTBUF(m2)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc23_w1, 0);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m2);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m2;
+			*senddesc23_w1 = vsetq_lane_u64(w1, *senddesc23_w1, 0);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m2) ? m2 : rte_mbuf_from_indirect(m2);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m2, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc23_w0 = vsetq_lane_u64(w0, *senddesc23_w0, 0);
+
+	/* mbuf3 */
+	w0 = vgetq_lane_u64(*senddesc23_w0, 1);
+	if (RTE_MBUF_HAS_EXTBUF(m3)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc23_w1, 1);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m3);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m3;
+			*senddesc23_w1 = vsetq_lane_u64(w1, *senddesc23_w1, 1);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m3) ? m3 : rte_mbuf_from_indirect(m3);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m3, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc23_w0 = vsetq_lane_u64(w0, *senddesc23_w0, 1);
+#ifndef RTE_LIBRTE_MEMPOOL_DEBUG
+	RTE_SET_USED(cookie);
+#endif
+}
+#endif
+
 static __rte_always_inline void
 cn10k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
 {
@@ -889,6 +1038,9 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
 		sg = (union nix_send_sg_s *)(cmd + 2);
 	}
 
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)
+		send_hdr->w0.pnc = 0;
+
 	if (flags & (NIX_TX_NEED_SEND_HDR_W1 | NIX_TX_OFFLOAD_SECURITY_F)) {
 		ol_flags = m->ol_flags;
 		w1.u = 0;
@@ -1049,19 +1201,30 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
 		send_hdr->w1.u = w1.u;
 
 	if (!(flags & NIX_TX_MULTI_SEG_F)) {
+		struct rte_mbuf *cookie;
+
 		sg->seg1_size = send_hdr->w0.total;
 		*(rte_iova_t *)(sg + 1) = rte_mbuf_data_iova(m);
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
+			uint64_t aura;
+
 			/* DF bit = 1 if refcount of current mbuf or parent mbuf
 			 *		is greater than 1
 			 * DF bit = 0 otherwise
 			 */
-			send_hdr->w0.df = cn10k_nix_prefree_seg(m, txq, send_hdr);
+			aura = send_hdr->w0.aura;
+			send_hdr->w0.df = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
+			send_hdr->w0.aura = aura;
 		}
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		/* Mark mempool object as "put" since it is freed by NIX */
 		if (!send_hdr->w0.df)
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+#else
+		RTE_SET_USED(cookie);
+#endif
 	} else {
 		sg->seg1_size = m->data_len;
 		*(rte_iova_t *)(sg + 1) = rte_mbuf_data_iova(m);
@@ -1135,6 +1298,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 	struct nix_send_hdr_s *send_hdr;
 	union nix_send_sg_s *sg, l_sg;
 	union nix_send_sg2_s l_sg2;
+	struct rte_mbuf *cookie;
 	struct rte_mbuf *m_next;
 	uint8_t off, is_sg2;
 	uint64_t len, dlen;
@@ -1163,21 +1327,26 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 	len -= dlen;
 	nb_segs = m->nb_segs - 1;
 	m_next = m->next;
+	m->next = NULL;
 	slist = &cmd[3 + off + 1];
 
+	cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 	/* Set invert df if buffer is not to be freed by H/W */
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-		prefree = cn10k_nix_prefree_seg(m, txq, send_hdr);
+		aura = send_hdr->w0.aura;
+		prefree = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
+		send_hdr->w0.aura = aura;
 		l_sg.i1 = prefree;
 	}
 
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 	/* Mark mempool object as "put" since it is freed by NIX */
 	if (!prefree)
-		RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+		RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 	rte_io_wmb();
+#else
+	RTE_SET_USED(cookie);
 #endif
-	m->next = NULL;
 
 	/* Quickly handle single segmented packets. With this if-condition
 	 * compiler will completely optimize out the below do-while loop
@@ -1207,9 +1376,12 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 		aura = aura0;
 		prefree = 0;
 
+		m->next = NULL;
+
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 			aura = roc_npa_aura_handle_to_aura(m->pool->pool_id);
-			prefree = cn10k_nix_prefree_seg(m, txq, send_hdr);
+			prefree = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
 			is_sg2 = aura != aura0 && !prefree;
 		}
 
@@ -1259,13 +1431,14 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 			l_sg.subdc = NIX_SUBDC_SG;
 			slist++;
 		}
-		m->next = NULL;
 
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		/* Mark mempool object as "put" since it is freed by NIX
 		 */
 		if (!prefree)
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+#else
+		RTE_SET_USED(cookie);
 #endif
 		m = m_next;
 	} while (nb_segs);
@@ -1997,13 +2170,10 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
 	uint64x2_t sgdesc01_w0, sgdesc23_w0;
 	uint64x2_t sgdesc01_w1, sgdesc23_w1;
 	struct cn10k_eth_txq *txq = tx_queue;
-	uint64x2_t xmask01_w0, xmask23_w0;
-	uint64x2_t xmask01_w1, xmask23_w1;
 	rte_iova_t io_addr = txq->io_addr;
 	uint8_t lnum, shift = 0, loff = 0;
 	uintptr_t laddr = txq->lmt_base;
 	uint8_t c_lnum, c_shft, c_loff;
-	struct nix_send_hdr_s send_hdr;
 	uint64x2_t ltypes01, ltypes23;
 	uint64x2_t xtmp128, ytmp128;
 	uint64x2_t xmask01, xmask23;
@@ -2153,7 +2323,7 @@ again:
 		}
 		/* Clear lower 32bit of SEND_HDR_W0 and SEND_SG_W0 */
 		senddesc01_w0 =
-			vbicq_u64(senddesc01_w0, vdupq_n_u64(0xFFFFFFFF));
+			vbicq_u64(senddesc01_w0, vdupq_n_u64(0x800FFFFFFFF));
 		sgdesc01_w0 = vbicq_u64(sgdesc01_w0, vdupq_n_u64(0xFFFFFFFF));
 
 		senddesc23_w0 = senddesc01_w0;
@@ -2859,73 +3029,8 @@ again:
 		    !(flags & NIX_TX_MULTI_SEG_F) &&
 		    !(flags & NIX_TX_OFFLOAD_SECURITY_F)) {
 			/* Set don't free bit if reference count > 1 */
-			xmask01_w0 = vdupq_n_u64(0);
-			xmask01_w1 = vdupq_n_u64(0);
-			xmask23_w0 = xmask01_w0;
-			xmask23_w1 = xmask01_w1;
-
-			/* Move mbufs to iova */
-			mbuf0 = (uint64_t *)tx_pkts[0];
-			mbuf1 = (uint64_t *)tx_pkts[1];
-			mbuf2 = (uint64_t *)tx_pkts[2];
-			mbuf3 = (uint64_t *)tx_pkts[3];
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn10k_nix_prefree_seg((struct rte_mbuf *)mbuf0, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask01_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask01_w0, 0);
-				xmask01_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask01_w1, 0);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf0)->pool,
-					(void **)&mbuf0, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn10k_nix_prefree_seg((struct rte_mbuf *)mbuf1, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask01_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask01_w0, 1);
-				xmask01_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask01_w1, 1);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf1)->pool,
-					(void **)&mbuf1, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn10k_nix_prefree_seg((struct rte_mbuf *)mbuf2, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask23_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask23_w0, 0);
-				xmask23_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask23_w1, 0);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf2)->pool,
-					(void **)&mbuf2, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn10k_nix_prefree_seg((struct rte_mbuf *)mbuf3, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask23_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask23_w0, 1);
-				xmask23_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask23_w1, 1);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf3)->pool,
-					(void **)&mbuf3, 1, 0);
-			}
-
-			senddesc01_w0 = vorrq_u64(senddesc01_w0, xmask01_w0);
-			senddesc23_w0 = vorrq_u64(senddesc23_w0, xmask23_w0);
-			senddesc01_w1 = vorrq_u64(senddesc01_w1, xmask01_w1);
-			senddesc23_w1 = vorrq_u64(senddesc23_w1, xmask23_w1);
+			cn10k_nix_prefree_seg_vec(tx_pkts, txq, &senddesc01_w0, &senddesc23_w0,
+						  &senddesc01_w1, &senddesc23_w1);
 		} else if (!(flags & NIX_TX_MULTI_SEG_F) &&
 			   !(flags & NIX_TX_OFFLOAD_SECURITY_F)) {
 			/* Move mbufs to iova */
diff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c
index bae4dda5e2..b92b978a27 100644
--- a/drivers/net/cnxk/cn9k_ethdev.c
+++ b/drivers/net/cnxk/cn9k_ethdev.c
@@ -347,7 +347,13 @@ cn9k_nix_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t qidx)
 		struct roc_nix_sq *sq = &dev->sqs[qidx];
 		do {
 			handle_tx_completion_pkts(txq, 0);
+			/* Check if SQ is empty */
 			roc_nix_sq_head_tail_get(nix, sq->qid, &head, &tail);
+			if (head != tail)
+				continue;
+
+			/* Check if completion CQ is empty */
+			roc_nix_cq_head_tail_get(nix, sq->cqid, &head, &tail);
 		} while (head != tail);
 	}
 
diff --git a/drivers/net/cnxk/cn9k_ethdev.h b/drivers/net/cnxk/cn9k_ethdev.h
index 9e0a3c5bb2..6ae0db62ca 100644
--- a/drivers/net/cnxk/cn9k_ethdev.h
+++ b/drivers/net/cnxk/cn9k_ethdev.h
@@ -169,6 +169,7 @@ handle_tx_completion_pkts(struct cn9k_eth_txq *txq, uint8_t mt_safe)
 			m = m_next;
 		}
 		rte_pktmbuf_free_seg(m);
+		txq->tx_compl.ptr[tx_compl_s0->sqe_id] = NULL;
 
 		head++;
 		head &= qmask;
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index fba4bb4215..3596651cc2 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -83,9 +83,10 @@ cn9k_nix_tx_skeleton(struct cn9k_eth_txq *txq, uint64_t *cmd,
 }
 
 static __rte_always_inline uint64_t
-cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq,
-		struct nix_send_hdr_s *send_hdr)
+cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq, struct nix_send_hdr_s *send_hdr,
+		     uint64_t *aura)
 {
+	struct rte_mbuf *prev;
 	uint32_t sqe_id;
 
 	if (RTE_MBUF_HAS_EXTBUF(m)) {
@@ -94,7 +95,10 @@ cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq,
 			return 1;
 		}
 		if (send_hdr->w0.pnc) {
-			txq->tx_compl.ptr[send_hdr->w1.sqe_id]->next = m;
+			sqe_id = send_hdr->w1.sqe_id;
+			prev = txq->tx_compl.ptr[sqe_id];
+			m->next = prev;
+			txq->tx_compl.ptr[sqe_id] = m;
 		} else {
 			sqe_id = __atomic_fetch_add(&txq->tx_compl.sqe_id, 1, __ATOMIC_RELAXED);
 			send_hdr->w0.pnc = 1;
@@ -104,10 +108,155 @@ cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq,
 		}
 		return 1;
 	} else {
-		return cnxk_nix_prefree_seg(m);
+		return cnxk_nix_prefree_seg(m, aura);
 	}
 }
 
+#if defined(RTE_ARCH_ARM64)
+/* Only called for first segments of single segmented mbufs */
+static __rte_always_inline void
+cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
+			 uint64x2_t *senddesc01_w0, uint64x2_t *senddesc23_w0,
+			 uint64x2_t *senddesc01_w1, uint64x2_t *senddesc23_w1)
+{
+	struct rte_mbuf **tx_compl_ptr = txq->tx_compl.ptr;
+	uint32_t nb_desc_mask = txq->tx_compl.nb_desc_mask;
+	bool tx_compl_ena = txq->tx_compl.ena;
+	struct rte_mbuf *m0, *m1, *m2, *m3;
+	struct rte_mbuf *cookie;
+	uint64_t w0, w1, aura;
+	uint64_t sqe_id;
+
+	m0 = mbufs[0];
+	m1 = mbufs[1];
+	m2 = mbufs[2];
+	m3 = mbufs[3];
+
+	/* mbuf 0 */
+	w0 = vgetq_lane_u64(*senddesc01_w0, 0);
+	if (RTE_MBUF_HAS_EXTBUF(m0)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc01_w1, 0);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m0);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m0;
+			*senddesc01_w1 = vsetq_lane_u64(w1, *senddesc01_w1, 0);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m0) ? m0 : rte_mbuf_from_indirect(m0);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m0, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc01_w0 = vsetq_lane_u64(w0, *senddesc01_w0, 0);
+
+	/* mbuf1 */
+	w0 = vgetq_lane_u64(*senddesc01_w0, 1);
+	if (RTE_MBUF_HAS_EXTBUF(m1)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc01_w1, 1);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m1);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m1;
+			*senddesc01_w1 = vsetq_lane_u64(w1, *senddesc01_w1, 1);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m1) ? m1 : rte_mbuf_from_indirect(m1);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m1, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc01_w0 = vsetq_lane_u64(w0, *senddesc01_w0, 1);
+
+	/* mbuf 2 */
+	w0 = vgetq_lane_u64(*senddesc23_w0, 0);
+	if (RTE_MBUF_HAS_EXTBUF(m2)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc23_w1, 0);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m2);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m2;
+			*senddesc23_w1 = vsetq_lane_u64(w1, *senddesc23_w1, 0);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m2) ? m2 : rte_mbuf_from_indirect(m2);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m2, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc23_w0 = vsetq_lane_u64(w0, *senddesc23_w0, 0);
+
+	/* mbuf3 */
+	w0 = vgetq_lane_u64(*senddesc23_w0, 1);
+	if (RTE_MBUF_HAS_EXTBUF(m3)) {
+		w0 |= BIT_ULL(19);
+		w1 = vgetq_lane_u64(*senddesc23_w1, 1);
+		w1 &= ~0xFFFF000000000000UL;
+		if (unlikely(!tx_compl_ena)) {
+			rte_pktmbuf_free_seg(m3);
+		} else {
+			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
+							       rte_memory_order_relaxed);
+			sqe_id = sqe_id & nb_desc_mask;
+			/* Set PNC */
+			w0 |= BIT_ULL(43);
+			w1 |= sqe_id << 48;
+			tx_compl_ptr[sqe_id] = m3;
+			*senddesc23_w1 = vsetq_lane_u64(w1, *senddesc23_w1, 1);
+		}
+	} else {
+		cookie = RTE_MBUF_DIRECT(m3) ? m3 : rte_mbuf_from_indirect(m3);
+		aura = (w0 >> 20) & 0xFFFFF;
+		w0 &= ~0xFFFFF00000UL;
+		w0 |= cnxk_nix_prefree_seg(m3, &aura) << 19;
+		w0 |= aura << 20;
+
+		if ((w0 & BIT_ULL(19)) == 0)
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+	}
+	*senddesc23_w0 = vsetq_lane_u64(w0, *senddesc23_w0, 1);
+#ifndef RTE_LIBRTE_MEMPOOL_DEBUG
+	RTE_SET_USED(cookie);
+#endif
+}
+#endif
+
 static __rte_always_inline void
 cn9k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
 {
@@ -191,6 +340,8 @@ cn9k_nix_xmit_prepare(struct cn9k_eth_txq *txq,
 		ol_flags = m->ol_flags;
 		w1.u = 0;
 	}
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)
+		send_hdr->w0.pnc = 0;
 
 	if (!(flags & NIX_TX_MULTI_SEG_F))
 		send_hdr->w0.total = m->data_len;
@@ -345,23 +496,33 @@ cn9k_nix_xmit_prepare(struct cn9k_eth_txq *txq,
 		send_hdr->w1.u = w1.u;
 
 	if (!(flags & NIX_TX_MULTI_SEG_F)) {
+		struct rte_mbuf *cookie;
+
 		sg->seg1_size = m->data_len;
 		*(rte_iova_t *)(++sg) = rte_mbuf_data_iova(m);
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
+			uint64_t aura;
 			/* DF bit = 1 if refcount of current mbuf or parent mbuf
 			 *		is greater than 1
 			 * DF bit = 0 otherwise
 			 */
-			send_hdr->w0.df = cn9k_nix_prefree_seg(m, txq, send_hdr);
+			aura = send_hdr->w0.aura;
+			send_hdr->w0.df = cn9k_nix_prefree_seg(m, txq, send_hdr, &aura);
+			send_hdr->w0.aura = aura;
 			/* Ensuring mbuf fields which got updated in
 			 * cnxk_nix_prefree_seg are written before LMTST.
 			 */
 			rte_io_wmb();
 		}
+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		/* Mark mempool object as "put" since it is freed by NIX */
 		if (!send_hdr->w0.df)
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
+#else
+		RTE_SET_USED(cookie);
+#endif
 	} else {
 		sg->seg1_size = m->data_len;
 		*(rte_iova_t *)(sg + 1) = rte_mbuf_data_iova(m);
@@ -443,6 +604,8 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 		      struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
 {
 	struct nix_send_hdr_s *send_hdr;
+	uint64_t prefree = 0, aura;
+	struct rte_mbuf *cookie;
 	union nix_send_sg_s *sg;
 	struct rte_mbuf *m_next;
 	uint64_t *slist, sg_u;
@@ -467,17 +630,23 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 	m_next = m->next;
 	slist = &cmd[3 + off + 1];
 
+	cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 	/* Set invert df if buffer is not to be freed by H/W */
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-		sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr) << 55);
+		aura = send_hdr->w0.aura;
+		prefree = (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << 55);
+		send_hdr->w0.aura = aura;
+		sg_u |= prefree;
 		rte_io_wmb();
 	}
 
 	/* Mark mempool object as "put" since it is freed by NIX */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 	if (!(sg_u & (1ULL << 55)))
-		RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+		RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 	rte_io_wmb();
+#else
+	RTE_SET_USED(cookie);
 #endif
 	m = m_next;
 	if (!m)
@@ -488,16 +657,17 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 		m_next = m->next;
 		sg_u = sg_u | ((uint64_t)m->data_len << (i << 4));
 		*slist = rte_mbuf_data_iova(m);
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		/* Set invert df if buffer is not to be freed by H/W */
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr) << (i + 55));
+			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, NULL) << (i + 55));
 			/* Commit changes to mbuf */
 			rte_io_wmb();
 		}
 		/* Mark mempool object as "put" since it is freed by NIX */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		if (!(sg_u & (1ULL << (i + 55))))
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 		rte_io_wmb();
 #endif
 		slist++;
@@ -709,8 +879,8 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 			       struct nix_send_hdr_s *send_hdr,
 			       union nix_send_sg_s *sg, const uint32_t flags)
 {
-	struct rte_mbuf *m_next;
-	uint64_t *slist, sg_u;
+	struct rte_mbuf *m_next, *cookie;
+	uint64_t *slist, sg_u, aura;
 	uint16_t nb_segs;
 	uint64_t segdw;
 	int i = 1;
@@ -727,13 +897,19 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 	m_next = m->next;
 
 	/* Set invert df if buffer is not to be freed by H/W */
-	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)
-		sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr) << 55);
-		/* Mark mempool object as "put" since it is freed by NIX */
+	cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
+		aura = send_hdr->w0.aura;
+		sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << 55);
+		send_hdr->w0.aura = aura;
+	}
+	/* Mark mempool object as "put" since it is freed by NIX */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 	if (!(sg_u & (1ULL << 55)))
-		RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+		RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 	rte_io_wmb();
+#else
+	RTE_SET_USED(cookie);
 #endif
 
 	m = m_next;
@@ -742,14 +918,15 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 		m_next = m->next;
 		sg_u = sg_u | ((uint64_t)m->data_len << (i << 4));
 		*slist = rte_mbuf_data_iova(m);
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		/* Set invert df if buffer is not to be freed by H/W */
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)
-			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr) << (i + 55));
+			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << (i + 55));
 			/* Mark mempool object as "put" since it is freed by NIX
 			 */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		if (!(sg_u & (1ULL << (i + 55))))
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 		rte_io_wmb();
 #endif
 		slist++;
@@ -789,15 +966,20 @@ cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq,
 			  uint64x2_t *cmd1, const uint32_t flags)
 {
 	struct nix_send_hdr_s send_hdr;
+	struct rte_mbuf *cookie;
 	union nix_send_sg_s sg;
+	uint64_t aura;
 	uint8_t ret;
 
 	if (m->nb_segs == 1) {
+		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 			send_hdr.w0.u = vgetq_lane_u64(cmd0[0], 0);
 			send_hdr.w1.u = vgetq_lane_u64(cmd0[0], 1);
 			sg.u = vgetq_lane_u64(cmd1[0], 0);
-			sg.u |= (cn9k_nix_prefree_seg(m, txq, &send_hdr) << 55);
+			aura = send_hdr.w0.aura;
+			sg.u |= (cn9k_nix_prefree_seg(m, txq, &send_hdr, &aura) << 55);
+			send_hdr.w0.aura = aura;
 			cmd1[0] = vsetq_lane_u64(sg.u, cmd1[0], 0);
 			cmd0[0] = vsetq_lane_u64(send_hdr.w0.u, cmd0[0], 0);
 			cmd0[0] = vsetq_lane_u64(send_hdr.w1.u, cmd0[0], 1);
@@ -806,8 +988,10 @@ cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq,
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 		sg.u = vgetq_lane_u64(cmd1[0], 0);
 		if (!(sg.u & (1ULL << 55)))
-			RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(cookie->pool, (void **)&cookie, 1, 0);
 		rte_io_wmb();
+#else
+		RTE_SET_USED(cookie);
 #endif
 		return 2 + !!(flags & NIX_TX_NEED_EXT_HDR) +
 		       !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
@@ -962,10 +1146,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint64x2_t sgdesc01_w1, sgdesc23_w1;
 	struct cn9k_eth_txq *txq = tx_queue;
 	uint64_t *lmt_addr = txq->lmt_addr;
-	uint64x2_t xmask01_w0, xmask23_w0;
-	uint64x2_t xmask01_w1, xmask23_w1;
 	rte_iova_t io_addr = txq->io_addr;
-	struct nix_send_hdr_s send_hdr;
 	uint64x2_t ltypes01, ltypes23;
 	uint64x2_t xtmp128, ytmp128;
 	uint64x2_t xmask01, xmask23;
@@ -1028,7 +1209,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 	for (i = 0; i < pkts; i += NIX_DESCS_PER_LOOP) {
 		/* Clear lower 32bit of SEND_HDR_W0 and SEND_SG_W0 */
 		senddesc01_w0 =
-			vbicq_u64(senddesc01_w0, vdupq_n_u64(0xFFFFFFFF));
+			vbicq_u64(senddesc01_w0, vdupq_n_u64(0x800FFFFFFFF));
 		sgdesc01_w0 = vbicq_u64(sgdesc01_w0, vdupq_n_u64(0xFFFFFFFF));
 
 		senddesc23_w0 = senddesc01_w0;
@@ -1732,74 +1913,8 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 		if ((flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) &&
 		    !(flags & NIX_TX_MULTI_SEG_F)) {
 			/* Set don't free bit if reference count > 1 */
-			xmask01_w0 = vdupq_n_u64(0);
-			xmask01_w1 = vdupq_n_u64(0);
-			xmask23_w0 = xmask01_w0;
-			xmask23_w1 = xmask01_w1;
-
-			/* Move mbufs to iova */
-			mbuf0 = (uint64_t *)tx_pkts[0];
-			mbuf1 = (uint64_t *)tx_pkts[1];
-			mbuf2 = (uint64_t *)tx_pkts[2];
-			mbuf3 = (uint64_t *)tx_pkts[3];
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn9k_nix_prefree_seg((struct rte_mbuf *)mbuf0, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask01_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask01_w0, 0);
-				xmask01_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask01_w1, 0);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf0)->pool,
-					(void **)&mbuf0, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn9k_nix_prefree_seg((struct rte_mbuf *)mbuf1, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask01_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask01_w0, 1);
-				xmask01_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask01_w1, 1);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf1)->pool,
-					(void **)&mbuf1, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn9k_nix_prefree_seg((struct rte_mbuf *)mbuf2, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask23_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask23_w0, 0);
-				xmask23_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask23_w1, 0);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf2)->pool,
-					(void **)&mbuf2, 1, 0);
-			}
-
-			send_hdr.w0.u = 0;
-			send_hdr.w1.u = 0;
-
-			if (cn9k_nix_prefree_seg((struct rte_mbuf *)mbuf3, txq, &send_hdr)) {
-				send_hdr.w0.df = 1;
-				xmask23_w0 = vsetq_lane_u64(send_hdr.w0.u, xmask23_w0, 1);
-				xmask23_w1 = vsetq_lane_u64(send_hdr.w1.u, xmask23_w1, 1);
-			} else {
-				RTE_MEMPOOL_CHECK_COOKIES(
-					((struct rte_mbuf *)mbuf3)->pool,
-					(void **)&mbuf3, 1, 0);
-			}
-
-			senddesc01_w0 = vorrq_u64(senddesc01_w0, xmask01_w0);
-			senddesc23_w0 = vorrq_u64(senddesc23_w0, xmask23_w0);
-			senddesc01_w1 = vorrq_u64(senddesc01_w1, xmask01_w1);
-			senddesc23_w1 = vorrq_u64(senddesc23_w1, xmask23_w1);
-
+			cn9k_nix_prefree_seg_vec(tx_pkts, txq, &senddesc01_w0, &senddesc23_w0,
+						 &senddesc01_w1, &senddesc23_w1);
 			/* Ensuring mbuf fields which got updated in
 			 * cnxk_nix_prefree_seg are written before LMTST.
 			 */
diff --git a/drivers/net/cnxk/cnxk_ethdev_dp.h b/drivers/net/cnxk/cnxk_ethdev_dp.h
index c1f99a2616..67f40b8e25 100644
--- a/drivers/net/cnxk/cnxk_ethdev_dp.h
+++ b/drivers/net/cnxk/cnxk_ethdev_dp.h
@@ -84,7 +84,7 @@ struct cnxk_timesync_info {
 
 /* Inlines */
 static __rte_always_inline uint64_t
-cnxk_pktmbuf_detach(struct rte_mbuf *m)
+cnxk_pktmbuf_detach(struct rte_mbuf *m, uint64_t *aura)
 {
 	struct rte_mempool *mp = m->pool;
 	uint32_t mbuf_size, buf_len;
@@ -94,6 +94,8 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)
 
 	/* Update refcount of direct mbuf */
 	md = rte_mbuf_from_indirect(m);
+	if (aura)
+		*aura = roc_npa_aura_handle_to_aura(md->pool->pool_id);
 	refcount = rte_mbuf_refcnt_update(md, -1);
 
 	priv_size = rte_pktmbuf_priv_size(mp);
@@ -126,18 +128,18 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)
 }
 
 static __rte_always_inline uint64_t
-cnxk_nix_prefree_seg(struct rte_mbuf *m)
+cnxk_nix_prefree_seg(struct rte_mbuf *m, uint64_t *aura)
 {
 	if (likely(rte_mbuf_refcnt_read(m) == 1)) {
 		if (!RTE_MBUF_DIRECT(m))
-			return cnxk_pktmbuf_detach(m);
+			return cnxk_pktmbuf_detach(m, aura);
 
 		m->next = NULL;
 		m->nb_segs = 1;
 		return 0;
 	} else if (rte_mbuf_refcnt_update(m, -1) == 0) {
 		if (!RTE_MBUF_DIRECT(m))
-			return cnxk_pktmbuf_detach(m);
+			return cnxk_pktmbuf_detach(m, aura);
 
 		rte_mbuf_refcnt_set(m, 1);
 		m->next = NULL;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.201540659 +0800
+++ 0036-net-cnxk-fix-indirect-mbuf-handling-in-Tx.patch	2024-04-13 20:43:04.947753997 +0800
@@ -1 +1 @@
-From 3232c95d2c361bdf5509cb9e9d0b9820398c1335 Mon Sep 17 00:00:00 2001
+From 0e5159a2235eccd26418d422868a9301d0aaf741 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3232c95d2c361bdf5509cb9e9d0b9820398c1335 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index 78d1dca3c1..05d6d3b53f 100644
+index 4a4e97287c..29b7f2ba5e 100644
@@ -46 +48 @@
-index 2143df1a7e..492a07a2f7 100644
+index aeffc4ac92..9f33d0192e 100644
@@ -58 +60 @@
-index fcd19be77e..9647f4259e 100644
+index 467f0ccc65..025eff2913 100644
@@ -61 +63 @@
-@@ -735,8 +735,9 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
+@@ -786,8 +786,9 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
@@ -72 +74 @@
-@@ -745,7 +746,10 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
+@@ -796,7 +797,10 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
@@ -84 +86 @@
-@@ -755,10 +759,155 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
+@@ -806,10 +810,155 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
@@ -241 +243 @@
-@@ -838,6 +987,9 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
+@@ -889,6 +1038,9 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
@@ -251 +253 @@
-@@ -998,19 +1150,30 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
+@@ -1049,19 +1201,30 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
@@ -284 +286 @@
-@@ -1084,6 +1247,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1135,6 +1298,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -292 +294 @@
-@@ -1112,21 +1276,26 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1163,21 +1327,26 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -322 +324 @@
-@@ -1156,9 +1325,12 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1207,9 +1376,12 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -336 +338 @@
-@@ -1208,13 +1380,14 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1259,13 +1431,14 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -353 +355 @@
-@@ -1946,13 +2119,10 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
+@@ -1997,13 +2170,10 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
@@ -367 +369 @@
-@@ -2106,7 +2276,7 @@ again:
+@@ -2153,7 +2323,7 @@ again:
@@ -376 +378 @@
-@@ -2812,73 +2982,8 @@ again:
+@@ -2859,73 +3029,8 @@ again:
@@ -453 +455 @@
-index 67f21a9c7f..ea92b1dcb6 100644
+index bae4dda5e2..b92b978a27 100644
@@ -953 +955 @@
-index 56cfcb7fc6..119bb1836a 100644
+index c1f99a2616..67f40b8e25 100644
@@ -956 +958 @@
-@@ -92,7 +92,7 @@ struct cnxk_ethdev_inj_cfg {
+@@ -84,7 +84,7 @@ struct cnxk_timesync_info {
@@ -965 +967 @@
-@@ -102,6 +102,8 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)
+@@ -94,6 +94,8 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)
@@ -974 +976 @@
-@@ -134,18 +136,18 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)
+@@ -126,18 +128,18 @@ cnxk_pktmbuf_detach(struct rte_mbuf *m)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: add cookies check for multi-segment offload' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (34 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: fix indirect mbuf handling in Tx' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix mbox struct attributes' " Xueming Li
                     ` (87 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e5450b2bba3066b7b34e29a4edae3450b9b7d46c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e5450b2bba3066b7b34e29a4edae3450b9b7d46c Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Mon, 26 Feb 2024 19:05:33 +0530
Subject: [PATCH] net/cnxk: add cookies check for multi-segment offload
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 26a6bda9dfd153192c4cfb73b3367398caa3afaa ]

Fix missing check cookies with multi-seg offload case

Fixes: 3626d5195d49 ("net/cnxk: add multi-segment Tx for CN10K")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 025eff2913..84d71d0818 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -1867,6 +1867,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
 	len -= dlen;
 	sg_u = sg_u | ((uint64_t)dlen);
 
+	/* Mark mempool object as "put" since it is freed by NIX */
+	RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+
 	nb_segs = m->nb_segs - 1;
 	m_next = m->next;
 	m->next = NULL;
@@ -1892,6 +1895,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
 			slist++;
 		}
 		m->next = NULL;
+		/* Mark mempool object as "put" since it is freed by NIX */
+		RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
+
 		m = m_next;
 	} while (nb_segs);
 
@@ -1915,8 +1921,11 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
 	union nix_send_hdr_w0_u sh;
 	union nix_send_sg_s sg;
 
-	if (m->nb_segs == 1)
+	if (m->nb_segs == 1) {
+		/* Mark mempool object as "put" since it is freed by NIX */
+		RTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);
 		return;
+	}
 
 	sh.u = vgetq_lane_u64(cmd0[0], 0);
 	sg.u = vgetq_lane_u64(cmd1[0], 0);
@@ -1976,6 +1985,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
 			*data128 |= ((__uint128_t)7) << *shift;
 			*shift += 3;
 
+			/* Mark mempool object as "put" since it is freed by NIX */
+			RTE_MEMPOOL_CHECK_COOKIES(mbufs[0]->pool, (void **)&mbufs[0], 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(mbufs[1]->pool, (void **)&mbufs[1], 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(mbufs[2]->pool, (void **)&mbufs[2], 1, 0);
+			RTE_MEMPOOL_CHECK_COOKIES(mbufs[3]->pool, (void **)&mbufs[3], 1, 0);
 			return 1;
 		}
 	}
@@ -1994,6 +2008,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
 				vst1q_u64(lmt_addr + 10, cmd2[j + 1]);
 				vst1q_u64(lmt_addr + 12, cmd1[j + 1]);
 				vst1q_u64(lmt_addr + 14, cmd3[j + 1]);
+
+				/* Mark mempool object as "put" since it is freed by NIX */
+				RTE_MEMPOOL_CHECK_COOKIES(mbufs[j]->pool, (void **)&mbufs[j], 1, 0);
+				RTE_MEMPOOL_CHECK_COOKIES(mbufs[j + 1]->pool,
+							  (void **)&mbufs[j + 1], 1, 0);
 			} else if (flags & NIX_TX_NEED_EXT_HDR) {
 				/* EXT header take 3 each, space for 2 segs.*/
 				cn10k_nix_prepare_mseg_vec(mbufs[j],
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.234572916 +0800
+++ 0037-net-cnxk-add-cookies-check-for-multi-segment-offload.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 26a6bda9dfd153192c4cfb73b3367398caa3afaa Mon Sep 17 00:00:00 2001
+From e5450b2bba3066b7b34e29a4edae3450b9b7d46c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 26a6bda9dfd153192c4cfb73b3367398caa3afaa ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -17 +19 @@
-index 9647f4259e..91b7f15c02 100644
+index 025eff2913..84d71d0818 100644
@@ -20 +22 @@
-@@ -1816,6 +1816,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
+@@ -1867,6 +1867,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
@@ -30 +32 @@
-@@ -1841,6 +1844,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
+@@ -1892,6 +1895,9 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
@@ -40 +42 @@
-@@ -1864,8 +1870,11 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
+@@ -1915,8 +1921,11 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
@@ -53 +55 @@
-@@ -1925,6 +1934,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
+@@ -1976,6 +1985,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
@@ -65 +67 @@
-@@ -1943,6 +1957,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
+@@ -1994,6 +2008,11 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix mbox struct attributes' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (35 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: add cookies check for multi-segment offload' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: fix mbuf fields in multi-segment Tx' " Xueming Li
                     ` (86 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a6bd2f39c150d439a56c95069041dc5883659eff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a6bd2f39c150d439a56c95069041dc5883659eff Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 26 Feb 2024 19:05:34 +0530
Subject: [PATCH] common/cnxk: fix mbox struct attributes
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c9dca1c5e352008bda8d0edeab8fbcf328437282 ]

IO attribute is needed to mbox structs to avoid unaligned or pair
access causing by compiler optimization. Add them to structs
where it is missing.

Fixes: 503b82de2cbf ("common/cnxk: add mbox request and response definitions")
Fixes: ddf955d3917e ("common/cnxk: support CPT second pass")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_mbox.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index 05434aec5a..7eaff0a0eb 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -1420,12 +1420,12 @@ struct nix_cn10k_aq_enq_req {
 struct nix_cn10k_aq_enq_rsp {
 	struct mbox_msghdr hdr;
 	union {
-		struct nix_cn10k_rq_ctx_s rq;
-		struct nix_cn10k_sq_ctx_s sq;
-		struct nix_cq_ctx_s cq;
-		struct nix_rsse_s rss;
-		struct nix_rx_mce_s mce;
-		struct nix_band_prof_s prof;
+		__io struct nix_cn10k_rq_ctx_s rq;
+		__io struct nix_cn10k_sq_ctx_s sq;
+		__io struct nix_cq_ctx_s cq;
+		__io struct nix_rsse_s rss;
+		__io struct nix_rx_mce_s mce;
+		__io struct nix_band_prof_s prof;
 	};
 };
 
@@ -1661,11 +1661,11 @@ struct nix_rq_cpt_field_mask_cfg_req {
 #define RQ_CTX_MASK_MAX 6
 	union {
 		uint64_t __io rq_ctx_word_set[RQ_CTX_MASK_MAX];
-		struct nix_cn10k_rq_ctx_s rq_set;
+		__io struct nix_cn10k_rq_ctx_s rq_set;
 	};
 	union {
 		uint64_t __io rq_ctx_word_mask[RQ_CTX_MASK_MAX];
-		struct nix_cn10k_rq_ctx_s rq_mask;
+		__io struct nix_cn10k_rq_ctx_s rq_mask;
 	};
 	struct nix_lf_rx_ipec_cfg1_req {
 		uint32_t __io spb_cpt_aura;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.258867084 +0800
+++ 0038-common-cnxk-fix-mbox-struct-attributes.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From c9dca1c5e352008bda8d0edeab8fbcf328437282 Mon Sep 17 00:00:00 2001
+From a6bd2f39c150d439a56c95069041dc5883659eff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c9dca1c5e352008bda8d0edeab8fbcf328437282 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 4b4f48e372..d8a8494ac4 100644
+index 05434aec5a..7eaff0a0eb 100644
@@ -23 +25 @@
-@@ -1427,12 +1427,12 @@ struct nix_cn10k_aq_enq_req {
+@@ -1420,12 +1420,12 @@ struct nix_cn10k_aq_enq_req {
@@ -42 +44 @@
-@@ -1668,11 +1668,11 @@ struct nix_rq_cpt_field_mask_cfg_req {
+@@ -1661,11 +1661,11 @@ struct nix_rq_cpt_field_mask_cfg_req {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: fix mbuf fields in multi-segment Tx' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (36 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix mbox struct attributes' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix link config for SDP' " Xueming Li
                     ` (85 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6f05d2d4615a20eac1313912aedf3dfcf4f8f98c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6f05d2d4615a20eac1313912aedf3dfcf4f8f98c Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Mon, 26 Feb 2024 19:05:36 +0530
Subject: [PATCH] net/cnxk: fix mbuf fields in multi-segment Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 ]

Currently in debug mode when a buffer is allocated in SW,
nb_segs will have invalid values as it didn't come from driver
Rx path. Hence reset mbuf next and nb_segs fields in multi-seg Tx path.

Fixes: 3626d5195d49 ("net/cnxk: add multi-segment Tx for CN10K")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_tx.h |  2 ++
 drivers/net/cnxk/cn9k_tx.h  | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 84d71d0818..cc480d24e8 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -1328,6 +1328,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 	nb_segs = m->nb_segs - 1;
 	m_next = m->next;
 	m->next = NULL;
+	m->nb_segs = 1;
 	slist = &cmd[3 + off + 1];
 
 	cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
@@ -1873,6 +1874,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
 	nb_segs = m->nb_segs - 1;
 	m_next = m->next;
 	m->next = NULL;
+	m->nb_segs = 1;
 	m = m_next;
 	/* Fill mbuf segments */
 	do {
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 3596651cc2..94acbe64fa 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -647,6 +647,10 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 	rte_io_wmb();
 #else
 	RTE_SET_USED(cookie);
+#endif
+#ifdef RTE_ENABLE_ASSERT
+	m->next = NULL;
+	m->nb_segs = 1;
 #endif
 	m = m_next;
 	if (!m)
@@ -683,6 +687,9 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 			sg_u = sg->u;
 			slist++;
 		}
+#ifdef RTE_ENABLE_ASSERT
+		m->next = NULL;
+#endif
 		m = m_next;
 	} while (nb_segs);
 
@@ -696,6 +703,9 @@ done:
 	segdw += (off >> 1) + 1 + !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
 	send_hdr->w0.sizem1 = segdw - 1;
 
+#ifdef RTE_ENABLE_ASSERT
+	rte_io_wmb();
+#endif
 	return segdw;
 }
 
@@ -912,6 +922,10 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 	RTE_SET_USED(cookie);
 #endif
 
+#ifdef RTE_ENABLE_ASSERT
+	m->next = NULL;
+	m->nb_segs = 1;
+#endif
 	m = m_next;
 	/* Fill mbuf segments */
 	do {
@@ -942,6 +956,9 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 			sg_u = sg->u;
 			slist++;
 		}
+#ifdef RTE_ENABLE_ASSERT
+		m->next = NULL;
+#endif
 		m = m_next;
 	} while (nb_segs);
 
@@ -957,6 +974,9 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 		 !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
 	send_hdr->w0.sizem1 = segdw - 1;
 
+#ifdef RTE_ENABLE_ASSERT
+	rte_io_wmb();
+#endif
 	return segdw;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.282742553 +0800
+++ 0039-net-cnxk-fix-mbuf-fields-in-multi-segment-Tx.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 Mon Sep 17 00:00:00 2001
+From 6f05d2d4615a20eac1313912aedf3dfcf4f8f98c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8ed5ca4dda858c991b27ad6ce5a5525e26a960c0 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 91b7f15c02..266c899a05 100644
+index 84d71d0818..cc480d24e8 100644
@@ -23 +25 @@
-@@ -1277,6 +1277,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1328,6 +1328,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -31 +33 @@
-@@ -1822,6 +1823,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,
+@@ -1873,6 +1874,7 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix link config for SDP' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (37 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: fix mbuf fields in multi-segment Tx' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: remove dead code' " Xueming Li
                     ` (84 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9cb9b9c8a0508b9e9b3074611636760c6cd24cae

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9cb9b9c8a0508b9e9b3074611636760c6cd24cae Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra@marvell.com>
Date: Wed, 28 Feb 2024 00:25:19 +0530
Subject: [PATCH] common/cnxk: fix link config for SDP
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 48054ca3842b0fc468e3e7931143dcb154b45921 ]

Link configure registers are invalid and should not be accessed
for SDP ports. But while on Txq release which does SQ flush calls
back pressure disable API which configures these link registers.

Fixes: 58debb813a8d ("common/cnxk: enable TM to listen on Rx pause frames")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_nix_tm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
index ece88b5e99..9e5e614b3b 100644
--- a/drivers/common/cnxk/roc_nix_tm.c
+++ b/drivers/common/cnxk/roc_nix_tm.c
@@ -328,6 +328,9 @@ nix_tm_bp_config_set(struct roc_nix *roc_nix, uint16_t sq, uint16_t tc,
 	uint8_t k = 0;
 	int rc = 0, i;
 
+	if (roc_nix_is_sdp(roc_nix))
+		return 0;
+
 	sq_s = nix->sqs[sq];
 	if (!sq_s)
 		return -ENOENT;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.309170919 +0800
+++ 0040-common-cnxk-fix-link-config-for-SDP.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 48054ca3842b0fc468e3e7931143dcb154b45921 Mon Sep 17 00:00:00 2001
+From 9cb9b9c8a0508b9e9b3074611636760c6cd24cae Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 48054ca3842b0fc468e3e7931143dcb154b45921 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 6a61e448a1..4e6a28f827 100644
+index ece88b5e99..9e5e614b3b 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: remove dead code' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (38 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix link config for SDP' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'common/cnxk: fix possible out-of-bounds access' " Xueming Li
                     ` (83 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Nithin Dabilpuram, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9172348240ce8568603366561e08f6d09b0f7398

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9172348240ce8568603366561e08f6d09b0f7398 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Fri, 1 Mar 2024 09:05:33 +0530
Subject: [PATCH] common/cnxk: remove dead code
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1ded7ef41ac888eb5e804d3337be687e5ebd324d ]

Removed dead code reported by Coverity.

Coverity issue: 380992
Fixes: da1ec39060b2 ("common/cnxk: delay inline device RQ enable to dev start")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_nix_inl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index a7bae8a51c..bc9cc2f429 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -620,8 +620,7 @@ roc_nix_reassembly_configure(uint32_t max_wait_time, uint16_t max_frags)
 		return -EFAULT;
 
 	PLT_SET_USED(max_frags);
-	if (idev == NULL)
-		return -ENOTSUP;
+
 	roc_cpt = idev->cpt;
 	if (!roc_cpt) {
 		plt_err("Cannot support inline inbound, cryptodev not probed");
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.332484788 +0800
+++ 0041-common-cnxk-remove-dead-code.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 1ded7ef41ac888eb5e804d3337be687e5ebd324d Mon Sep 17 00:00:00 2001
+From 9172348240ce8568603366561e08f6d09b0f7398 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1ded7ef41ac888eb5e804d3337be687e5ebd324d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index a205c658e9..7dbeae5017 100644
+index a7bae8a51c..bc9cc2f429 100644
@@ -22 +24 @@
-@@ -677,8 +677,7 @@ roc_nix_reassembly_configure(uint32_t max_wait_time, uint16_t max_frags)
+@@ -620,8 +620,7 @@ roc_nix_reassembly_configure(uint32_t max_wait_time, uint16_t max_frags)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'common/cnxk: fix possible out-of-bounds access' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (39 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: remove dead code' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/cnxk: improve Tx performance for SW mbuf free' " Xueming Li
                     ` (82 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Harman Kalra, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=37256aa1bf8f366524d76e4ed56205c49e9b4892

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 37256aa1bf8f366524d76e4ed56205c49e9b4892 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Fri, 1 Mar 2024 09:05:34 +0530
Subject: [PATCH] common/cnxk: fix possible out-of-bounds access
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9a92937cf0c836b7f2b5e303523279ddf9473a35 ]

The subtraction expression in mbox_memcpy() can wrap around
causing an out-of-bounds access. Added a check on 'size' to
fix this.

Coverity issue: 384431, 384439
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_dev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.c
index 084343c3b4..14aff233d5 100644
--- a/drivers/common/cnxk/roc_dev.c
+++ b/drivers/common/cnxk/roc_dev.c
@@ -502,6 +502,8 @@ pf_vf_mbox_send_up_msg(struct dev *dev, void *rec_msg)
 	size_t size;
 
 	size = PLT_ALIGN(mbox_id2size(msg->hdr.id), MBOX_MSG_ALIGN);
+	if (size < sizeof(struct mbox_msghdr))
+		return;
 	/* Send UP message to all VF's */
 	for (vf = 0; vf < vf_mbox->ndevs; vf++) {
 		/* VF active */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.358261355 +0800
+++ 0042-common-cnxk-fix-possible-out-of-bounds-access.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 9a92937cf0c836b7f2b5e303523279ddf9473a35 Mon Sep 17 00:00:00 2001
+From 37256aa1bf8f366524d76e4ed56205c49e9b4892 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9a92937cf0c836b7f2b5e303523279ddf9473a35 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/cnxk: improve Tx performance for SW mbuf free' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (40 preceding siblings ...)
  2024-04-13 12:48   ` patch 'common/cnxk: fix possible out-of-bounds access' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'doc: fix aging poll frequency option in cnxk guide' " Xueming Li
                     ` (81 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=630dbc8a928ba12e93c534df9d7dfdd6ad4af371

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 630dbc8a928ba12e93c534df9d7dfdd6ad4af371 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Fri, 1 Mar 2024 08:46:45 +0530
Subject: [PATCH] net/cnxk: improve Tx performance for SW mbuf free
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f3d7cf8a4c7eedbf2bdfc19370d49bd2557717e6 ]

Performance improvement is done for Tx fastpath flag MBUF_NOFF when
tx_compl_ena is false and mbuf has an external buffer.
In such case, Instead of individual external mbuf free before LMTST,
a chain of external mbuf will be created and free all after LMTST.
This not only improve the performance but also fixes SQ corruption.

CN10k performance improvement is ~14%.
CN9k performance improvement is ~20%.

Fixes: 51a636528515 ("net/cnxk: fix crash during Tx completion")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/event/cnxk/cn10k_tx_worker.h |  8 ++-
 drivers/event/cnxk/cn9k_worker.h     |  9 ++-
 drivers/net/cnxk/cn10k_tx.h          | 97 +++++++++++++++++++---------
 drivers/net/cnxk/cn9k_tx.h           | 88 ++++++++++++++++---------
 4 files changed, 135 insertions(+), 67 deletions(-)

diff --git a/drivers/event/cnxk/cn10k_tx_worker.h b/drivers/event/cnxk/cn10k_tx_worker.h
index 53e0dde20c..256237b895 100644
--- a/drivers/event/cnxk/cn10k_tx_worker.h
+++ b/drivers/event/cnxk/cn10k_tx_worker.h
@@ -70,6 +70,7 @@ cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 		 const uint64_t *txq_data, const uint32_t flags)
 {
 	uint8_t lnum = 0, loff = 0, shft = 0;
+	struct rte_mbuf *extm = NULL;
 	struct cn10k_eth_txq *txq;
 	uintptr_t laddr;
 	uint16_t segdw;
@@ -90,7 +91,7 @@ cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 	if (flags & NIX_TX_OFFLOAD_TSO_F)
 		cn10k_nix_xmit_prepare_tso(m, flags);
 
-	cn10k_nix_xmit_prepare(txq, m, cmd, flags, txq->lso_tun_fmt, &sec,
+	cn10k_nix_xmit_prepare(txq, m, &extm, cmd, flags, txq->lso_tun_fmt, &sec,
 			       txq->mark_flag, txq->mark_fmt);
 
 	laddr = lmt_addr;
@@ -105,7 +106,7 @@ cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 	cn10k_nix_xmit_mv_lmt_base(laddr, cmd, flags);
 
 	if (flags & NIX_TX_MULTI_SEG_F)
-		segdw = cn10k_nix_prepare_mseg(txq, m, (uint64_t *)laddr, flags);
+		segdw = cn10k_nix_prepare_mseg(txq, m, &extm, (uint64_t *)laddr, flags);
 	else
 		segdw = cn10k_nix_tx_ext_subs(flags) + 2;
 
@@ -127,6 +128,9 @@ cn10k_sso_tx_one(struct cn10k_sso_hws *ws, struct rte_mbuf *m, uint64_t *cmd,
 	/* Memory barrier to make sure lmtst store completes */
 	rte_io_wmb();
 
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena)
+		cn10k_nix_free_extmbuf(extm);
+
 	return 1;
 }
 
diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index 0451157812..107265d54b 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -746,7 +746,7 @@ static __rte_always_inline uint16_t
 cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
 		      uint64_t *txq_data, const uint32_t flags)
 {
-	struct rte_mbuf *m = ev->mbuf;
+	struct rte_mbuf *m = ev->mbuf, *extm = NULL;
 	struct cn9k_eth_txq *txq;
 
 	/* Perform header writes before barrier for TSO */
@@ -767,7 +767,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
 	if (cn9k_sso_sq_depth(txq) <= 0)
 		return 0;
 	cn9k_nix_tx_skeleton(txq, cmd, flags, 0);
-	cn9k_nix_xmit_prepare(txq, m, cmd, flags, txq->lso_tun_fmt, txq->mark_flag,
+	cn9k_nix_xmit_prepare(txq, m, &extm, cmd, flags, txq->lso_tun_fmt, txq->mark_flag,
 			      txq->mark_fmt);
 
 	if (flags & NIX_TX_OFFLOAD_SECURITY_F) {
@@ -789,7 +789,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
 	}
 
 	if (flags & NIX_TX_MULTI_SEG_F) {
-		const uint16_t segdw = cn9k_nix_prepare_mseg(txq, m, cmd, flags);
+		const uint16_t segdw = cn9k_nix_prepare_mseg(txq, m, &extm, cmd, flags);
 		cn9k_nix_xmit_prepare_tstamp(txq, cmd, m->ol_flags, segdw,
 					     flags);
 		if (!CNXK_TT_FROM_EVENT(ev->event)) {
@@ -819,6 +819,9 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
 	}
 
 done:
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena)
+		cn9k_nix_free_extmbuf(extm);
+
 	return 1;
 }
 
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index cc480d24e8..5dff578ba4 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -784,8 +784,19 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
 }
 #endif
 
+static inline void
+cn10k_nix_free_extmbuf(struct rte_mbuf *m)
+{
+	struct rte_mbuf *m_next;
+	while (m != NULL) {
+		m_next = m->next;
+		rte_pktmbuf_free_seg(m);
+		m = m_next;
+	}
+}
+
 static __rte_always_inline uint64_t
-cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
+cn10k_nix_prefree_seg(struct rte_mbuf *m, struct rte_mbuf **extm, struct cn10k_eth_txq *txq,
 		      struct nix_send_hdr_s *send_hdr, uint64_t *aura)
 {
 	struct rte_mbuf *prev = NULL;
@@ -793,7 +804,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
 
 	if (RTE_MBUF_HAS_EXTBUF(m)) {
 		if (unlikely(txq->tx_compl.ena == 0)) {
-			rte_pktmbuf_free_seg(m);
+			m->next = *extm;
+			*extm = m;
 			return 1;
 		}
 		if (send_hdr->w0.pnc) {
@@ -817,7 +829,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
 #if defined(RTE_ARCH_ARM64)
 /* Only called for first segments of single segmented mbufs */
 static __rte_always_inline void
-cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct rte_mbuf **extm,
+			  struct cn10k_eth_txq *txq,
 			  uint64x2_t *senddesc01_w0, uint64x2_t *senddesc23_w0,
 			  uint64x2_t *senddesc01_w1, uint64x2_t *senddesc23_w1)
 {
@@ -841,7 +854,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc01_w1, 0);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m0);
+			m0->next = *extm;
+			*extm = m0;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -871,7 +885,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc01_w1, 1);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m1);
+			m1->next = *extm;
+			*extm = m1;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -901,7 +916,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc23_w1, 0);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m2);
+			m2->next = *extm;
+			*extm = m2;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -931,7 +947,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc23_w1, 1);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m3);
+			m3->next = *extm;
+			*extm = m3;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -1013,9 +1030,9 @@ cn10k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
 
 static __rte_always_inline void
 cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
-		       struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags,
-		       const uint64_t lso_tun_fmt, bool *sec, uint8_t mark_flag,
-		       uint64_t mark_fmt)
+		       struct rte_mbuf *m, struct rte_mbuf **extm, uint64_t *cmd,
+		       const uint16_t flags, const uint64_t lso_tun_fmt, bool *sec,
+		       uint8_t mark_flag, uint64_t mark_fmt)
 {
 	uint8_t mark_off = 0, mark_vlan = 0, markptr = 0;
 	struct nix_send_ext_s *send_hdr_ext;
@@ -1215,7 +1232,7 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
 			 * DF bit = 0 otherwise
 			 */
 			aura = send_hdr->w0.aura;
-			send_hdr->w0.df = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
+			send_hdr->w0.df = cn10k_nix_prefree_seg(m, extm, txq, send_hdr, &aura);
 			send_hdr->w0.aura = aura;
 		}
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
@@ -1291,8 +1308,8 @@ cn10k_nix_xmit_prepare_tstamp(struct cn10k_eth_txq *txq, uintptr_t lmt_addr,
 }
 
 static __rte_always_inline uint16_t
-cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
-		       struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq, struct rte_mbuf *m, struct rte_mbuf **extm,
+		       uint64_t *cmd, const uint16_t flags)
 {
 	uint64_t prefree = 0, aura0, aura, nb_segs, segdw;
 	struct nix_send_hdr_s *send_hdr;
@@ -1335,7 +1352,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 	/* Set invert df if buffer is not to be freed by H/W */
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 		aura = send_hdr->w0.aura;
-		prefree = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
+		prefree = cn10k_nix_prefree_seg(m, extm, txq, send_hdr, &aura);
 		send_hdr->w0.aura = aura;
 		l_sg.i1 = prefree;
 	}
@@ -1382,7 +1399,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
 		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 			aura = roc_npa_aura_handle_to_aura(m->pool->pool_id);
-			prefree = cn10k_nix_prefree_seg(m, txq, send_hdr, &aura);
+			prefree = cn10k_nix_prefree_seg(m, extm, txq, send_hdr, &aura);
 			is_sg2 = aura != aura0 && !prefree;
 		}
 
@@ -1476,6 +1493,7 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,
 	uint8_t lnum, c_lnum, c_shft, c_loff;
 	uintptr_t pa, lbase = txq->lmt_base;
 	uint16_t lmt_id, burst, left, i;
+	struct rte_mbuf *extm = NULL;
 	uintptr_t c_lbase = lbase;
 	uint64_t lso_tun_fmt = 0;
 	uint64_t mark_fmt = 0;
@@ -1530,7 +1548,7 @@ again:
 		if (flags & NIX_TX_OFFLOAD_TSO_F)
 			cn10k_nix_xmit_prepare_tso(tx_pkts[i], flags);
 
-		cn10k_nix_xmit_prepare(txq, tx_pkts[i], cmd, flags, lso_tun_fmt,
+		cn10k_nix_xmit_prepare(txq, tx_pkts[i], &extm, cmd, flags, lso_tun_fmt,
 				       &sec, mark_flag, mark_fmt);
 
 		laddr = (uintptr_t)LMT_OFF(lbase, lnum, 0);
@@ -1605,6 +1623,11 @@ again:
 	}
 
 	rte_io_wmb();
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena) {
+		cn10k_nix_free_extmbuf(extm);
+		extm = NULL;
+	}
+
 	if (left)
 		goto again;
 
@@ -1620,6 +1643,7 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,
 	uintptr_t pa0, pa1, lbase = txq->lmt_base;
 	const rte_iova_t io_addr = txq->io_addr;
 	uint16_t segdw, lmt_id, burst, left, i;
+	struct rte_mbuf *extm = NULL;
 	uint8_t lnum, c_lnum, c_loff;
 	uintptr_t c_lbase = lbase;
 	uint64_t lso_tun_fmt = 0;
@@ -1681,7 +1705,7 @@ again:
 		if (flags & NIX_TX_OFFLOAD_TSO_F)
 			cn10k_nix_xmit_prepare_tso(tx_pkts[i], flags);
 
-		cn10k_nix_xmit_prepare(txq, tx_pkts[i], cmd, flags, lso_tun_fmt,
+		cn10k_nix_xmit_prepare(txq, tx_pkts[i], &extm, cmd, flags, lso_tun_fmt,
 				       &sec, mark_flag, mark_fmt);
 
 		laddr = (uintptr_t)LMT_OFF(lbase, lnum, 0);
@@ -1695,7 +1719,7 @@ again:
 		/* Move NIX desc to LMT/NIXTX area */
 		cn10k_nix_xmit_mv_lmt_base(laddr, cmd, flags);
 		/* Store sg list directly on lmt line */
-		segdw = cn10k_nix_prepare_mseg(txq, tx_pkts[i], (uint64_t *)laddr,
+		segdw = cn10k_nix_prepare_mseg(txq, tx_pkts[i], &extm, (uint64_t *)laddr,
 					       flags);
 		cn10k_nix_xmit_prepare_tstamp(txq, laddr, tx_pkts[i]->ol_flags,
 					      segdw, flags);
@@ -1768,6 +1792,11 @@ again:
 	}
 
 	rte_io_wmb();
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena) {
+		cn10k_nix_free_extmbuf(extm);
+		extm = NULL;
+	}
+
 	if (left)
 		goto again;
 
@@ -1818,7 +1847,7 @@ cn10k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1,
 
 static __rte_always_inline uint16_t
 cn10k_nix_prepare_mseg_vec_noff(struct cn10k_eth_txq *txq,
-				struct rte_mbuf *m, uint64_t *cmd,
+				struct rte_mbuf *m, struct rte_mbuf **extm, uint64_t *cmd,
 				uint64x2_t *cmd0, uint64x2_t *cmd1,
 				uint64x2_t *cmd2, uint64x2_t *cmd3,
 				const uint32_t flags)
@@ -1833,7 +1862,7 @@ cn10k_nix_prepare_mseg_vec_noff(struct cn10k_eth_txq *txq,
 		vst1q_u64(cmd + 2, *cmd1); /* sg */
 	}
 
-	segdw = cn10k_nix_prepare_mseg(txq, m, cmd, flags);
+	segdw = cn10k_nix_prepare_mseg(txq, m, extm, cmd, flags);
 
 	if (flags & NIX_TX_OFFLOAD_TSTAMP_F)
 		vst1q_u64(cmd + segdw * 2 - 2, *cmd3);
@@ -1943,7 +1972,7 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
 
 static __rte_always_inline uint8_t
 cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
-			       struct rte_mbuf **mbufs, uint64x2_t *cmd0,
+			       struct rte_mbuf **mbufs, struct rte_mbuf **extm, uint64x2_t *cmd0,
 			       uint64x2_t *cmd1, uint64x2_t *cmd2,
 			       uint64x2_t *cmd3, uint8_t *segdw,
 			       uint64_t *lmt_addr, __uint128_t *data128,
@@ -1961,7 +1990,7 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
 				lmt_addr += 16;
 				off = 0;
 			}
-			off += cn10k_nix_prepare_mseg_vec_noff(txq, mbufs[j],
+			off += cn10k_nix_prepare_mseg_vec_noff(txq, mbufs[j], extm,
 					lmt_addr + off * 2, &cmd0[j], &cmd1[j],
 					&cmd2[j], &cmd3[j], flags);
 		}
@@ -2114,14 +2143,14 @@ cn10k_nix_lmt_next(uint8_t dw, uintptr_t laddr, uint8_t *lnum, uint8_t *loff,
 
 static __rte_always_inline void
 cn10k_nix_xmit_store(struct cn10k_eth_txq *txq,
-		     struct rte_mbuf *mbuf, uint8_t segdw, uintptr_t laddr,
+		     struct rte_mbuf *mbuf, struct rte_mbuf **extm, uint8_t segdw, uintptr_t laddr,
 		     uint64x2_t cmd0, uint64x2_t cmd1, uint64x2_t cmd2,
 		     uint64x2_t cmd3, const uint16_t flags)
 {
 	uint8_t off;
 
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-		cn10k_nix_prepare_mseg_vec_noff(txq, mbuf, LMT_OFF(laddr, 0, 0),
+		cn10k_nix_prepare_mseg_vec_noff(txq, mbuf, extm, LMT_OFF(laddr, 0, 0),
 						&cmd0, &cmd1, &cmd2, &cmd3,
 						flags);
 		return;
@@ -2205,6 +2234,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
 		__uint128_t data128;
 		uint64_t data[2];
 	} wd;
+	struct rte_mbuf *extm = NULL;
 
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && txq->tx_compl.ena)
 		handle_tx_completion_pkts(txq, flags & NIX_TX_VWQE_F);
@@ -3050,8 +3080,8 @@ again:
 		    !(flags & NIX_TX_MULTI_SEG_F) &&
 		    !(flags & NIX_TX_OFFLOAD_SECURITY_F)) {
 			/* Set don't free bit if reference count > 1 */
-			cn10k_nix_prefree_seg_vec(tx_pkts, txq, &senddesc01_w0, &senddesc23_w0,
-						  &senddesc01_w1, &senddesc23_w1);
+			cn10k_nix_prefree_seg_vec(tx_pkts, &extm, txq, &senddesc01_w0,
+						  &senddesc23_w0, &senddesc01_w1, &senddesc23_w1);
 		} else if (!(flags & NIX_TX_MULTI_SEG_F) &&
 			   !(flags & NIX_TX_OFFLOAD_SECURITY_F)) {
 			/* Move mbufs to iova */
@@ -3123,7 +3153,7 @@ again:
 						   &shift, &wd.data128, &next);
 
 			/* Store mbuf0 to LMTLINE/CPT NIXTX area */
-			cn10k_nix_xmit_store(txq, tx_pkts[0], segdw[0], next,
+			cn10k_nix_xmit_store(txq, tx_pkts[0], &extm, segdw[0], next,
 					     cmd0[0], cmd1[0], cmd2[0], cmd3[0],
 					     flags);
 
@@ -3139,7 +3169,7 @@ again:
 						   &shift, &wd.data128, &next);
 
 			/* Store mbuf1 to LMTLINE/CPT NIXTX area */
-			cn10k_nix_xmit_store(txq, tx_pkts[1], segdw[1], next,
+			cn10k_nix_xmit_store(txq, tx_pkts[1], &extm, segdw[1], next,
 					     cmd0[1], cmd1[1], cmd2[1], cmd3[1],
 					     flags);
 
@@ -3155,7 +3185,7 @@ again:
 						   &shift, &wd.data128, &next);
 
 			/* Store mbuf2 to LMTLINE/CPT NIXTX area */
-			cn10k_nix_xmit_store(txq, tx_pkts[2], segdw[2], next,
+			cn10k_nix_xmit_store(txq, tx_pkts[2], &extm, segdw[2], next,
 					     cmd0[2], cmd1[2], cmd2[2], cmd3[2],
 					     flags);
 
@@ -3171,7 +3201,7 @@ again:
 						   &shift, &wd.data128, &next);
 
 			/* Store mbuf3 to LMTLINE/CPT NIXTX area */
-			cn10k_nix_xmit_store(txq, tx_pkts[3], segdw[3], next,
+			cn10k_nix_xmit_store(txq, tx_pkts[3], &extm, segdw[3], next,
 					     cmd0[3], cmd1[3], cmd2[3], cmd3[3],
 					     flags);
 
@@ -3179,7 +3209,7 @@ again:
 			uint8_t j;
 
 			segdw[4] = 8;
-			j = cn10k_nix_prep_lmt_mseg_vector(txq, tx_pkts, cmd0, cmd1,
+			j = cn10k_nix_prep_lmt_mseg_vector(txq, tx_pkts, &extm, cmd0, cmd1,
 							  cmd2, cmd3, segdw,
 							  (uint64_t *)
 							  LMT_OFF(laddr, lnum,
@@ -3329,6 +3359,11 @@ again:
 	}
 
 	rte_io_wmb();
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena) {
+		cn10k_nix_free_extmbuf(extm);
+		extm = NULL;
+	}
+
 	if (left)
 		goto again;
 
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 94acbe64fa..018fae2eb7 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -82,16 +82,28 @@ cn9k_nix_tx_skeleton(struct cn9k_eth_txq *txq, uint64_t *cmd,
 	}
 }
 
+static __rte_always_inline void
+cn9k_nix_free_extmbuf(struct rte_mbuf *m)
+{
+	struct rte_mbuf *m_next;
+	while (m != NULL) {
+		m_next = m->next;
+		rte_pktmbuf_free_seg(m);
+		m = m_next;
+	}
+}
+
 static __rte_always_inline uint64_t
-cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq, struct nix_send_hdr_s *send_hdr,
-		     uint64_t *aura)
+cn9k_nix_prefree_seg(struct rte_mbuf *m, struct rte_mbuf **extm, struct cn9k_eth_txq *txq,
+		     struct nix_send_hdr_s *send_hdr, uint64_t *aura)
 {
 	struct rte_mbuf *prev;
 	uint32_t sqe_id;
 
 	if (RTE_MBUF_HAS_EXTBUF(m)) {
 		if (unlikely(txq->tx_compl.ena == 0)) {
-			rte_pktmbuf_free_seg(m);
+			m->next = *extm;
+			*extm = m;
 			return 1;
 		}
 		if (send_hdr->w0.pnc) {
@@ -115,7 +127,7 @@ cn9k_nix_prefree_seg(struct rte_mbuf *m, struct cn9k_eth_txq *txq, struct nix_se
 #if defined(RTE_ARCH_ARM64)
 /* Only called for first segments of single segmented mbufs */
 static __rte_always_inline void
-cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
+cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct rte_mbuf **extm, struct cn9k_eth_txq *txq,
 			 uint64x2_t *senddesc01_w0, uint64x2_t *senddesc23_w0,
 			 uint64x2_t *senddesc01_w1, uint64x2_t *senddesc23_w1)
 {
@@ -139,7 +151,8 @@ cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc01_w1, 0);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m0);
+			m0->next = *extm;
+			*extm = m0;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -169,7 +182,8 @@ cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc01_w1, 1);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m1);
+			m1->next = *extm;
+			*extm = m1;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -199,7 +213,8 @@ cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc23_w1, 0);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m2);
+			m2->next = *extm;
+			*extm = m2;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -229,7 +244,8 @@ cn9k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn9k_eth_txq *txq,
 		w1 = vgetq_lane_u64(*senddesc23_w1, 1);
 		w1 &= ~0xFFFF000000000000UL;
 		if (unlikely(!tx_compl_ena)) {
-			rte_pktmbuf_free_seg(m3);
+			m3->next = *extm;
+			*extm = m3;
 		} else {
 			sqe_id = rte_atomic_fetch_add_explicit(&txq->tx_compl.sqe_id, 1,
 							       rte_memory_order_relaxed);
@@ -310,10 +326,9 @@ cn9k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
 }
 
 static __rte_always_inline void
-cn9k_nix_xmit_prepare(struct cn9k_eth_txq *txq,
-		      struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags,
-		      const uint64_t lso_tun_fmt, uint8_t mark_flag,
-		      uint64_t mark_fmt)
+cn9k_nix_xmit_prepare(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_mbuf **extm,
+		      uint64_t *cmd, const uint16_t flags, const uint64_t lso_tun_fmt,
+		      uint8_t mark_flag, uint64_t mark_fmt)
 {
 	uint8_t mark_off = 0, mark_vlan = 0, markptr = 0;
 	struct nix_send_ext_s *send_hdr_ext;
@@ -509,7 +524,7 @@ cn9k_nix_xmit_prepare(struct cn9k_eth_txq *txq,
 			 * DF bit = 0 otherwise
 			 */
 			aura = send_hdr->w0.aura;
-			send_hdr->w0.df = cn9k_nix_prefree_seg(m, txq, send_hdr, &aura);
+			send_hdr->w0.df = cn9k_nix_prefree_seg(m, extm, txq, send_hdr, &aura);
 			send_hdr->w0.aura = aura;
 			/* Ensuring mbuf fields which got updated in
 			 * cnxk_nix_prefree_seg are written before LMTST.
@@ -600,8 +615,8 @@ cn9k_nix_xmit_submit_lmt_release(const rte_iova_t io_addr)
 }
 
 static __rte_always_inline uint16_t
-cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
-		      struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)
+cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_mbuf **extm,
+		      uint64_t *cmd, const uint16_t flags)
 {
 	struct nix_send_hdr_s *send_hdr;
 	uint64_t prefree = 0, aura;
@@ -634,7 +649,7 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 	/* Set invert df if buffer is not to be freed by H/W */
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 		aura = send_hdr->w0.aura;
-		prefree = (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << 55);
+		prefree = (cn9k_nix_prefree_seg(m, extm, txq, send_hdr, &aura) << 55);
 		send_hdr->w0.aura = aura;
 		sg_u |= prefree;
 		rte_io_wmb();
@@ -664,7 +679,7 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq,
 		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		/* Set invert df if buffer is not to be freed by H/W */
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
-			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, NULL) << (i + 55));
+			sg_u |= (cn9k_nix_prefree_seg(m, extm, txq, send_hdr, NULL) << (i + 55));
 			/* Commit changes to mbuf */
 			rte_io_wmb();
 		}
@@ -748,6 +763,7 @@ cn9k_nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t pkts,
 	const rte_iova_t io_addr = txq->io_addr;
 	uint64_t lso_tun_fmt = 0, mark_fmt = 0;
 	void *lmt_addr = txq->lmt_addr;
+	struct rte_mbuf *extm = NULL;
 	uint8_t mark_flag = 0;
 	uint16_t i;
 
@@ -778,13 +794,16 @@ cn9k_nix_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t pkts,
 		rte_io_wmb();
 
 	for (i = 0; i < pkts; i++) {
-		cn9k_nix_xmit_prepare(txq, tx_pkts[i], cmd, flags, lso_tun_fmt,
+		cn9k_nix_xmit_prepare(txq, tx_pkts[i], &extm, cmd, flags, lso_tun_fmt,
 				      mark_flag, mark_fmt);
 		cn9k_nix_xmit_prepare_tstamp(txq, cmd, tx_pkts[i]->ol_flags, 4,
 					     flags);
 		cn9k_nix_xmit_one(cmd, lmt_addr, io_addr, flags);
 	}
 
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena)
+		cn9k_nix_free_extmbuf(extm);
+
 	/* Reduce the cached count */
 	txq->fc_cache_pkts -= pkts;
 
@@ -799,6 +818,7 @@ cn9k_nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 	const rte_iova_t io_addr = txq->io_addr;
 	uint64_t lso_tun_fmt = 0, mark_fmt = 0;
 	void *lmt_addr = txq->lmt_addr;
+	struct rte_mbuf *extm = NULL;
 	uint8_t mark_flag = 0;
 	uint16_t segdw;
 	uint64_t i;
@@ -830,14 +850,17 @@ cn9k_nix_xmit_pkts_mseg(void *tx_queue, struct rte_mbuf **tx_pkts,
 		rte_io_wmb();
 
 	for (i = 0; i < pkts; i++) {
-		cn9k_nix_xmit_prepare(txq, tx_pkts[i], cmd, flags, lso_tun_fmt,
+		cn9k_nix_xmit_prepare(txq, tx_pkts[i], &extm, cmd, flags, lso_tun_fmt,
 				      mark_flag, mark_fmt);
-		segdw = cn9k_nix_prepare_mseg(txq, tx_pkts[i], cmd, flags);
+		segdw = cn9k_nix_prepare_mseg(txq, tx_pkts[i], &extm, cmd, flags);
 		cn9k_nix_xmit_prepare_tstamp(txq, cmd, tx_pkts[i]->ol_flags,
 					     segdw, flags);
 		cn9k_nix_xmit_mseg_one(cmd, lmt_addr, io_addr, segdw);
 	}
 
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena)
+		cn9k_nix_free_extmbuf(extm);
+
 	/* Reduce the cached count */
 	txq->fc_cache_pkts -= pkts;
 
@@ -885,7 +908,7 @@ cn9k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1,
 
 static __rte_always_inline uint8_t
 cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
-			       struct rte_mbuf *m, uint64_t *cmd,
+			       struct rte_mbuf *m, struct rte_mbuf **extm, uint64_t *cmd,
 			       struct nix_send_hdr_s *send_hdr,
 			       union nix_send_sg_s *sg, const uint32_t flags)
 {
@@ -910,7 +933,7 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 	cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {
 		aura = send_hdr->w0.aura;
-		sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << 55);
+		sg_u |= (cn9k_nix_prefree_seg(m, extm, txq, send_hdr, &aura) << 55);
 		send_hdr->w0.aura = aura;
 	}
 	/* Mark mempool object as "put" since it is freed by NIX */
@@ -935,7 +958,7 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 		cookie = RTE_MBUF_DIRECT(m) ? m : rte_mbuf_from_indirect(m);
 		/* Set invert df if buffer is not to be freed by H/W */
 		if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)
-			sg_u |= (cn9k_nix_prefree_seg(m, txq, send_hdr, &aura) << (i + 55));
+			sg_u |= (cn9k_nix_prefree_seg(m, extm, txq, send_hdr, &aura) << (i + 55));
 			/* Mark mempool object as "put" since it is freed by NIX
 			 */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
@@ -981,9 +1004,8 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 }
 
 static __rte_always_inline uint8_t
-cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq,
-			  struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
-			  uint64x2_t *cmd1, const uint32_t flags)
+cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_mbuf **extm,
+			  uint64_t *cmd, uint64x2_t *cmd0, uint64x2_t *cmd1, const uint32_t flags)
 {
 	struct nix_send_hdr_s send_hdr;
 	struct rte_mbuf *cookie;
@@ -998,7 +1020,7 @@ cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq,
 			send_hdr.w1.u = vgetq_lane_u64(cmd0[0], 1);
 			sg.u = vgetq_lane_u64(cmd1[0], 0);
 			aura = send_hdr.w0.aura;
-			sg.u |= (cn9k_nix_prefree_seg(m, txq, &send_hdr, &aura) << 55);
+			sg.u |= (cn9k_nix_prefree_seg(m, extm, txq, &send_hdr, &aura) << 55);
 			send_hdr.w0.aura = aura;
 			cmd1[0] = vsetq_lane_u64(sg.u, cmd1[0], 0);
 			cmd0[0] = vsetq_lane_u64(send_hdr.w0.u, cmd0[0], 0);
@@ -1021,7 +1043,7 @@ cn9k_nix_prepare_mseg_vec(struct cn9k_eth_txq *txq,
 	send_hdr.w1.u = vgetq_lane_u64(cmd0[0], 1);
 	sg.u = vgetq_lane_u64(cmd1[0], 0);
 
-	ret = cn9k_nix_prepare_mseg_vec_list(txq, m, cmd, &send_hdr, &sg, flags);
+	ret = cn9k_nix_prepare_mseg_vec_list(txq, m, extm, cmd, &send_hdr, &sg, flags);
 
 	cmd0[0] = vsetq_lane_u64(send_hdr.w0.u, cmd0[0], 0);
 	cmd0[0] = vsetq_lane_u64(send_hdr.w1.u, cmd0[0], 1);
@@ -1168,6 +1190,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint64_t *lmt_addr = txq->lmt_addr;
 	rte_iova_t io_addr = txq->io_addr;
 	uint64x2_t ltypes01, ltypes23;
+	struct rte_mbuf *extm = NULL;
 	uint64x2_t xtmp128, ytmp128;
 	uint64x2_t xmask01, xmask23;
 	uint64_t lmt_status, i;
@@ -1933,8 +1956,8 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 		if ((flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) &&
 		    !(flags & NIX_TX_MULTI_SEG_F)) {
 			/* Set don't free bit if reference count > 1 */
-			cn9k_nix_prefree_seg_vec(tx_pkts, txq, &senddesc01_w0, &senddesc23_w0,
-						 &senddesc01_w1, &senddesc23_w1);
+			cn9k_nix_prefree_seg_vec(tx_pkts, &extm, txq, &senddesc01_w0,
+						 &senddesc23_w0, &senddesc01_w1, &senddesc23_w1);
 			/* Ensuring mbuf fields which got updated in
 			 * cnxk_nix_prefree_seg are written before LMTST.
 			 */
@@ -1995,7 +2018,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 			/* Build mseg list for each packet individually. */
 			for (j = 0; j < NIX_DESCS_PER_LOOP; j++)
 				segdw[j] = cn9k_nix_prepare_mseg_vec(txq,
-							tx_pkts[j],
+							tx_pkts[j], &extm,
 							seg_list[j], &cmd0[j],
 							&cmd1[j], flags);
 			segdw[4] = 8;
@@ -2070,6 +2093,9 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts,
 		tx_pkts = tx_pkts + NIX_DESCS_PER_LOOP;
 	}
 
+	if (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && !txq->tx_compl.ena)
+		cn9k_nix_free_extmbuf(extm);
+
 	if (unlikely(pkts_left)) {
 		if (flags & NIX_TX_MULTI_SEG_F)
 			pkts += cn9k_nix_xmit_pkts_mseg(tx_queue, tx_pkts,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.384004321 +0800
+++ 0043-net-cnxk-improve-Tx-performance-for-SW-mbuf-free.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From f3d7cf8a4c7eedbf2bdfc19370d49bd2557717e6 Mon Sep 17 00:00:00 2001
+From 630dbc8a928ba12e93c534df9d7dfdd6ad4af371 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f3d7cf8a4c7eedbf2bdfc19370d49bd2557717e6 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -20,6 +22,5 @@
- doc/guides/rel_notes/release_24_03.rst |  1 +
- drivers/event/cnxk/cn10k_tx_worker.h   |  8 ++-
- drivers/event/cnxk/cn9k_worker.h       |  9 ++-
- drivers/net/cnxk/cn10k_tx.h            | 97 ++++++++++++++++++--------
- drivers/net/cnxk/cn9k_tx.h             | 88 +++++++++++++++--------
- 5 files changed, 136 insertions(+), 67 deletions(-)
+ drivers/event/cnxk/cn10k_tx_worker.h |  8 ++-
+ drivers/event/cnxk/cn9k_worker.h     |  9 ++-
+ drivers/net/cnxk/cn10k_tx.h          | 97 +++++++++++++++++++---------
+ drivers/net/cnxk/cn9k_tx.h           | 88 ++++++++++++++++---------
+ 4 files changed, 135 insertions(+), 67 deletions(-)
@@ -27,12 +27,0 @@
-diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
-index 6f6cc06dbb..639de93b79 100644
---- a/doc/guides/rel_notes/release_24_03.rst
-+++ b/doc/guides/rel_notes/release_24_03.rst
-@@ -115,6 +115,7 @@ New Features
-   * Added support for ``RTE_FLOW_ITEM_TYPE_PPPOES`` flow item.
-   * Added support for ``RTE_FLOW_ACTION_TYPE_SAMPLE`` flow item.
-   * Added support for Rx inject.
-+  * Optimized SW external mbuf free for better performance and avoid SQ corruption.
- 
- * **Updated Marvell OCTEON EP driver.**
- 
@@ -80 +69 @@
-index e8863e42fc..a8e998951c 100644
+index 0451157812..107265d54b 100644
@@ -83 +72 @@
-@@ -749,7 +749,7 @@ static __rte_always_inline uint16_t
+@@ -746,7 +746,7 @@ static __rte_always_inline uint16_t
@@ -92 +81 @@
-@@ -770,7 +770,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
+@@ -767,7 +767,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
@@ -101 +90 @@
-@@ -792,7 +792,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
+@@ -789,7 +789,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
@@ -110 +99 @@
-@@ -822,6 +822,9 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
+@@ -819,6 +819,9 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
@@ -121 +110 @@
-index 266c899a05..5c4b9e559e 100644
+index cc480d24e8..5dff578ba4 100644
@@ -124 +113 @@
-@@ -733,8 +733,19 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
+@@ -784,8 +784,19 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
@@ -145 +134 @@
-@@ -742,7 +753,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
+@@ -793,7 +804,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
@@ -155 +144 @@
-@@ -766,7 +778,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
+@@ -817,7 +829,8 @@ cn10k_nix_prefree_seg(struct rte_mbuf *m, struct cn10k_eth_txq *txq,
@@ -165 +154 @@
-@@ -790,7 +803,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+@@ -841,7 +854,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
@@ -175 +164 @@
-@@ -820,7 +834,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+@@ -871,7 +885,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
@@ -185 +174 @@
-@@ -850,7 +865,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+@@ -901,7 +916,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
@@ -195 +184 @@
-@@ -880,7 +896,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
+@@ -931,7 +947,8 @@ cn10k_nix_prefree_seg_vec(struct rte_mbuf **mbufs, struct cn10k_eth_txq *txq,
@@ -205 +194 @@
-@@ -962,9 +979,9 @@ cn10k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
+@@ -1013,9 +1030,9 @@ cn10k_nix_xmit_prepare_tso(struct rte_mbuf *m, const uint64_t flags)
@@ -218 +207 @@
-@@ -1164,7 +1181,7 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
+@@ -1215,7 +1232,7 @@ cn10k_nix_xmit_prepare(struct cn10k_eth_txq *txq,
@@ -227 +216 @@
-@@ -1240,8 +1257,8 @@ cn10k_nix_xmit_prepare_tstamp(struct cn10k_eth_txq *txq, uintptr_t lmt_addr,
+@@ -1291,8 +1308,8 @@ cn10k_nix_xmit_prepare_tstamp(struct cn10k_eth_txq *txq, uintptr_t lmt_addr,
@@ -238 +227 @@
-@@ -1284,7 +1301,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1335,7 +1352,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -247 +236 @@
-@@ -1331,7 +1348,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
+@@ -1382,7 +1399,7 @@ cn10k_nix_prepare_mseg(struct cn10k_eth_txq *txq,
@@ -256 +245 @@
-@@ -1425,6 +1442,7 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,
+@@ -1476,6 +1493,7 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,
@@ -264 +253 @@
-@@ -1479,7 +1497,7 @@ again:
+@@ -1530,7 +1548,7 @@ again:
@@ -273 +262 @@
-@@ -1554,6 +1572,11 @@ again:
+@@ -1605,6 +1623,11 @@ again:
@@ -285 +274 @@
-@@ -1569,6 +1592,7 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,
+@@ -1620,6 +1643,7 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,
@@ -293 +282 @@
-@@ -1630,7 +1654,7 @@ again:
+@@ -1681,7 +1705,7 @@ again:
@@ -302 +291 @@
-@@ -1644,7 +1668,7 @@ again:
+@@ -1695,7 +1719,7 @@ again:
@@ -311 +300 @@
-@@ -1717,6 +1741,11 @@ again:
+@@ -1768,6 +1792,11 @@ again:
@@ -323 +312 @@
-@@ -1767,7 +1796,7 @@ cn10k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1,
+@@ -1818,7 +1847,7 @@ cn10k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1,
@@ -332 +321 @@
-@@ -1782,7 +1811,7 @@ cn10k_nix_prepare_mseg_vec_noff(struct cn10k_eth_txq *txq,
+@@ -1833,7 +1862,7 @@ cn10k_nix_prepare_mseg_vec_noff(struct cn10k_eth_txq *txq,
@@ -341 +330 @@
-@@ -1892,7 +1921,7 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
+@@ -1943,7 +1972,7 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,
@@ -350 +339 @@
-@@ -1910,7 +1939,7 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
+@@ -1961,7 +1990,7 @@ cn10k_nix_prep_lmt_mseg_vector(struct cn10k_eth_txq *txq,
@@ -359 +348 @@
-@@ -2063,14 +2092,14 @@ cn10k_nix_lmt_next(uint8_t dw, uintptr_t laddr, uint8_t *lnum, uint8_t *loff,
+@@ -2114,14 +2143,14 @@ cn10k_nix_lmt_next(uint8_t dw, uintptr_t laddr, uint8_t *lnum, uint8_t *loff,
@@ -376 +365 @@
-@@ -2154,6 +2183,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
+@@ -2205,6 +2234,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
@@ -384 +373 @@
-@@ -3003,8 +3033,8 @@ again:
+@@ -3050,8 +3080,8 @@ again:
@@ -395 +384 @@
-@@ -3076,7 +3106,7 @@ again:
+@@ -3123,7 +3153,7 @@ again:
@@ -404 +393 @@
-@@ -3092,7 +3122,7 @@ again:
+@@ -3139,7 +3169,7 @@ again:
@@ -413 +402 @@
-@@ -3108,7 +3138,7 @@ again:
+@@ -3155,7 +3185,7 @@ again:
@@ -422 +411 @@
-@@ -3124,7 +3154,7 @@ again:
+@@ -3171,7 +3201,7 @@ again:
@@ -431 +420 @@
-@@ -3132,7 +3162,7 @@ again:
+@@ -3179,7 +3209,7 @@ again:
@@ -440 +429 @@
-@@ -3282,6 +3312,11 @@ again:
+@@ -3329,6 +3359,11 @@ again:

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix aging poll frequency option in cnxk guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (41 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/cnxk: improve Tx performance for SW mbuf free' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5/hws: skip item when inserting rules by index' " Xueming Li
                     ` (80 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Ankur Dwivedi; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2368f82fd89fc132b9d9b701c04860b2e9a9e307

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2368f82fd89fc132b9d9b701c04860b2e9a9e307 Mon Sep 17 00:00:00 2001
From: Ankur Dwivedi <adwivedi@marvell.com>
Date: Mon, 4 Mar 2024 20:00:06 +0530
Subject: [PATCH] doc: fix aging poll frequency option in cnxk guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7fcf4e8a03c4b0d2c6cec11ddd18c7bf88ba0384 ]

The information for CNXK NPC MCAM aging poll frequency devargs is moved to
runtime config options section for ethdev device. Initially it was
incorrectly placed in runtime config options section for inline device.

Fixes: a44775505911 ("net/cnxk: support flow aging")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 doc/guides/nics/cnxk.rst | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst
index 9ec52e380f..28d54be16d 100644
--- a/doc/guides/nics/cnxk.rst
+++ b/doc/guides/nics/cnxk.rst
@@ -416,6 +416,18 @@ Runtime Config Options
    With the above configuration, PMD would allocate meta buffers of size 512 for
    inline inbound IPsec processing second pass.
 
+- ``NPC MCAM Aging poll frequency in seconds`` (default ``10``)
+
+   Poll frequency for aging control thread can be specified by
+   ``aging_poll_freq`` devargs parameter.
+
+   For example::
+
+      -a 0002:01:00.2,aging_poll_freq=50
+
+   With the above configuration, driver would poll for aging flows
+   every 50 seconds.
+
 .. note::
 
    Above devarg parameters are configurable per device, user needs to pass the
@@ -601,18 +613,6 @@ Runtime Config Options for inline device
    With the above configuration, driver would poll for soft expiry events every
    1000 usec.
 
-- ``NPC MCAM Aging poll frequency in seconds`` (default ``10``)
-
-   Poll frequency for aging control thread can be specified by
-   ``aging_poll_freq`` ``devargs`` parameter.
-
-   For example::
-
-      -a 0002:01:00.2,aging_poll_freq=50
-
-   With the above configuration, driver would poll for aging flows every 50
-   seconds.
-
 Debugging Options
 -----------------
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.414337581 +0800
+++ 0044-doc-fix-aging-poll-frequency-option-in-cnxk-guide.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 7fcf4e8a03c4b0d2c6cec11ddd18c7bf88ba0384 Mon Sep 17 00:00:00 2001
+From 2368f82fd89fc132b9d9b701c04860b2e9a9e307 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7fcf4e8a03c4b0d2c6cec11ddd18c7bf88ba0384 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index f11fb59439..f5f296ee36 100644
+index 9ec52e380f..28d54be16d 100644
@@ -22 +24 @@
-@@ -419,6 +419,18 @@ Runtime Config Options
+@@ -416,6 +416,18 @@ Runtime Config Options
@@ -38 +40 @@
- - ``Rx Inject Enable inbound inline IPsec for second pass`` (default ``0``)
+ .. note::
@@ -40,2 +42,2 @@
-    Rx packet inject feature for inbound inline IPsec processing can be enabled
-@@ -617,18 +629,6 @@ Runtime Config Options for inline device
+    Above devarg parameters are configurable per device, user needs to pass the
+@@ -601,18 +613,6 @@ Runtime Config Options for inline device
@@ -57 +59,2 @@
- - ``Rx Inject Enable inbound inline IPsec for second pass`` (default ``0``)
+ Debugging Options
+ -----------------
@@ -59 +61,0 @@
-    Rx packet inject feature for inbound inline IPsec processing can be enabled

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: skip item when inserting rules by index' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (42 preceding siblings ...)
  2024-04-13 12:48   ` patch 'doc: fix aging poll frequency option in cnxk guide' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5/hws: check not supported fields in VXLAN' " Xueming Li
                     ` (79 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Itamar Gozlan; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b80ca5960e391dc055f9571beaf0a2927929d6d3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b80ca5960e391dc055f9571beaf0a2927929d6d3 Mon Sep 17 00:00:00 2001
From: Itamar Gozlan <igozlan@nvidia.com>
Date: Sun, 18 Feb 2024 07:11:15 +0200
Subject: [PATCH] net/mlx5/hws: skip item when inserting rules by index
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e23edbc509f68b67b55ee6c06920402c9ac5db2b ]

The location of indexed rules is determined by the index, not the item
hash. A matcher test is added to prevent access to non-existent items.
This avoids unnecessary processing and potential segmentation faults.

Fixes: 405242c52dd5 ("net/mlx5/hws: add rule object")

Signed-off-by: Itamar Gozlan <igozlan@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_rule.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c
index fa19303b91..e39137a6ee 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -23,6 +23,9 @@ static void mlx5dr_rule_skip(struct mlx5dr_matcher *matcher,
 	*skip_rx = false;
 	*skip_tx = false;
 
+	if (unlikely(mlx5dr_matcher_is_insert_by_idx(matcher)))
+		return;
+
 	if (mt->item_flags & MLX5_FLOW_ITEM_REPRESENTED_PORT) {
 		v = items[mt->vport_item_id].spec;
 		vport = flow_hw_conv_port_id(v->port_id);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.439454649 +0800
+++ 0045-net-mlx5-hws-skip-item-when-inserting-rules-by-index.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From e23edbc509f68b67b55ee6c06920402c9ac5db2b Mon Sep 17 00:00:00 2001
+From b80ca5960e391dc055f9571beaf0a2927929d6d3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e23edbc509f68b67b55ee6c06920402c9ac5db2b ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: check not supported fields in VXLAN' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (43 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5/hws: skip item when inserting rules by index' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN item in non-relaxed mode' " Xueming Li
                     ` (78 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Erez Shitrit; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=21d51e8848c68523906da07edf69b41a283b6665

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 21d51e8848c68523906da07edf69b41a283b6665 Mon Sep 17 00:00:00 2001
From: Erez Shitrit <erezsh@nvidia.com>
Date: Sun, 18 Feb 2024 07:11:16 +0200
Subject: [PATCH] net/mlx5/hws: check not supported fields in VXLAN
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4506703cbe96185bf3593a222fb9f51f70de78af ]

Don't allow the user to mask over rsvd1 / rsvd2 fields which are not
supported.

Fixes: 28e69588f417 ("net/mlx5/hws: fix tunnel protocol checks")

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 7bd4ea560e..720d271179 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1347,6 +1347,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
 	/* In order to match on VXLAN we must match on ether_type, ip_protocol
 	 * and l4_dport.
 	 */
+	if (m && (m->rsvd0[0] != 0 || m->rsvd0[1] != 0 || m->rsvd0[2] != 0 ||
+	    m->rsvd1 != 0)) {
+		DR_LOG(ERR, "reserved fields are not supported");
+		rte_errno = ENOTSUP;
+		return rte_errno;
+	}
+
 	if (!cd->relaxed) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, inner)];
 		if (!fc->tag_set) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.466062214 +0800
+++ 0046-net-mlx5-hws-check-not-supported-fields-in-VXLAN.patch	2024-04-13 20:43:04.957753984 +0800
@@ -1 +1 @@
-From 4506703cbe96185bf3593a222fb9f51f70de78af Mon Sep 17 00:00:00 2001
+From 21d51e8848c68523906da07edf69b41a283b6665 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4506703cbe96185bf3593a222fb9f51f70de78af ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 79d98bbf78..8b8757ecac 100644
+index 7bd4ea560e..720d271179 100644
@@ -22,4 +24,4 @@
-@@ -1414,6 +1414,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
- 	struct mlx5dr_definer_fc *fc;
- 	bool inner = cd->tunnel;
- 
+@@ -1347,6 +1347,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
+ 	/* In order to match on VXLAN we must match on ether_type, ip_protocol
+ 	 * and l4_dport.
+ 	 */
@@ -33,3 +35,3 @@
- 	if (inner) {
- 		DR_LOG(ERR, "Inner VXLAN item not supported");
- 		rte_errno = ENOTSUP;
+ 	if (!cd->relaxed) {
+ 		fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, inner)];
+ 		if (!fc->tag_set) {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: fix VLAN item in non-relaxed mode' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (44 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5/hws: check not supported fields in VXLAN' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix use after free when releasing Tx queues' " Xueming Li
                     ` (77 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Hamdan Igbaria; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a06ab8044ac854dff30f8705f30baf2a8f7e61b2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a06ab8044ac854dff30f8705f30baf2a8f7e61b2 Mon Sep 17 00:00:00 2001
From: Hamdan Igbaria <hamdani@nvidia.com>
Date: Sun, 18 Feb 2024 07:11:20 +0200
Subject: [PATCH] net/mlx5/hws: fix VLAN item in non-relaxed mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0aacd886e93df862f010a45ed333d08355f4bca8 ]

If a VLAN item was passed with null mask, the item handler would
return immediately and thus won't set default values for non relax
mode.
Also change the non relax default set to single-tagged (CVLAN).

Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 720d271179..f047ffdab3 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -183,6 +183,7 @@ struct mlx5dr_definer_conv_data {
 	X(SET,		ib_l4_udp_port,		UDP_ROCEV2_PORT,	rte_flow_item_ib_bth) \
 	X(SET,		ib_l4_opcode,		v->hdr.opcode,		rte_flow_item_ib_bth) \
 	X(SET,		ib_l4_bth_a,		v->hdr.a,		rte_flow_item_ib_bth) \
+	X(SET,		cvlan,			STE_CVLAN,		rte_flow_item_vlan) \
 
 /* Item set function format */
 #define X(set_type, func_name, value, item_type) \
@@ -769,6 +770,15 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
 	struct mlx5dr_definer_fc *fc;
 	bool inner = cd->tunnel;
 
+	if (!cd->relaxed) {
+		/* Mark packet as tagged (CVLAN) */
+		fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)];
+		fc->item_idx = item_idx;
+		fc->tag_mask_set = &mlx5dr_definer_ones_set;
+		fc->tag_set = &mlx5dr_definer_cvlan_set;
+		DR_CALC_SET(fc, eth_l2, first_vlan_qualifier, inner);
+	}
+
 	if (!m)
 		return 0;
 
@@ -777,8 +787,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
 		return rte_errno;
 	}
 
-	if (!cd->relaxed || m->has_more_vlan) {
-		/* Mark packet as tagged (CVLAN or SVLAN) even if TCI is not specified.*/
+	if (m->has_more_vlan) {
 		fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)];
 		fc->item_idx = item_idx;
 		fc->tag_mask_set = &mlx5dr_definer_ones_set;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.499237470 +0800
+++ 0047-net-mlx5-hws-fix-VLAN-item-in-non-relaxed-mode.patch	2024-04-13 20:43:04.967753971 +0800
@@ -1 +1 @@
-From 0aacd886e93df862f010a45ed333d08355f4bca8 Mon Sep 17 00:00:00 2001
+From a06ab8044ac854dff30f8705f30baf2a8f7e61b2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0aacd886e93df862f010a45ed333d08355f4bca8 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index eb788a772a..b8a546989a 100644
+index 720d271179..f047ffdab3 100644
@@ -24 +26,2 @@
-@@ -223,6 +223,7 @@ struct mlx5dr_definer_conv_data {
+@@ -183,6 +183,7 @@ struct mlx5dr_definer_conv_data {
+ 	X(SET,		ib_l4_udp_port,		UDP_ROCEV2_PORT,	rte_flow_item_ib_bth) \
@@ -26 +28,0 @@
- 	X(SET,		random_number,		v->value,		rte_flow_item_random) \
@@ -32 +34 @@
-@@ -864,6 +865,15 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
+@@ -769,6 +770,15 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
@@ -48 +50 @@
-@@ -872,8 +882,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
+@@ -777,8 +787,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix use after free when releasing Tx queues' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (45 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN item in non-relaxed mode' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix error packets drop in regular Rx' " Xueming Li
                     ` (76 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Pengfei Sun; +Cc: Yunjian Wang, Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=213cb8806857a4dad0b870c4b81b055e616eaa90

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 213cb8806857a4dad0b870c4b81b055e616eaa90 Mon Sep 17 00:00:00 2001
From: Pengfei Sun <sunpengfei16@huawei.com>
Date: Tue, 20 Feb 2024 17:31:39 +0800
Subject: [PATCH] net/mlx5: fix use after free when releasing Tx queues
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b805b7c451f1ee5bafa5628ee67f3a495f6a8682 ]

In function mlx5_dev_configure, dev->data->tx_queues is assigned
to priv->txqs. When a member is removed from a bond, the function
eth_dev_tx_queue_config is called to release dev->data->tx_queues.
However, function mlx5_dev_close will access priv->txqs again and
cause the use after free problem.

In function mlx5_dev_close, before free priv->txqs, we add a check
that dev->data->tx_queues is not NULL.

build/app/dpdk-testpmd -c7 -a 0000:08:00.2 --  -i --nb-cores=2
--total-num-mbufs=2048

testpmd> port stop 0
testpmd> create bonding device 4 0
testpmd> add bonding member 0 1
testpmd> remove bonding member 0 1
testpmd> quit

ASan reports:
==2571911==ERROR: AddressSanitizer: heap-use-after-free on address
0x000174529880 at pc 0x0000113c8440 bp 0xffffefae0ea0 sp 0xffffefae0eb0
READ of size 8 at 0x000174529880 thread T0
    #0 0x113c843c in mlx5_txq_release ../drivers/net/mlx5/mlx5_txq.c:
1203
    #1 0xffdb53c in mlx5_dev_close ../drivers/net/mlx5/mlx5.c:2286
    #2 0xe12dc0 in rte_eth_dev_close ../lib/ethdev/rte_ethdev.c:1877
    #3 0x6bac1c in close_port ../app/test-pmd/testpmd.c:3540
    #4 0x6bc320 in pmd_test_exit ../app/test-pmd/testpmd.c:3808
    #5 0x6c1a94 in main ../app/test-pmd/testpmd.c:4759
    #6 0xffff9328f038  (/usr/lib64/libc.so.6+0x2b038)
    #7 0xffff9328f110 in __libc_start_main (/usr/lib64/libc.so.6+
0x2b110)

Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")

Reported-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Pengfei Sun <sunpengfei16@huawei.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 3a182de248..6b5a4da430 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2279,7 +2279,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		mlx5_free(priv->rxq_privs);
 		priv->rxq_privs = NULL;
 	}
-	if (priv->txqs != NULL) {
+	if (priv->txqs != NULL && dev->data->tx_queues != NULL) {
 		/* XXX race condition if mlx5_tx_burst() is still running. */
 		rte_delay_us_sleep(1000);
 		for (i = 0; (i != priv->txqs_n); ++i)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.527472634 +0800
+++ 0048-net-mlx5-fix-use-after-free-when-releasing-Tx-queues.patch	2024-04-13 20:43:04.967753971 +0800
@@ -1 +1 @@
-From b805b7c451f1ee5bafa5628ee67f3a495f6a8682 Mon Sep 17 00:00:00 2001
+From 213cb8806857a4dad0b870c4b81b055e616eaa90 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b805b7c451f1ee5bafa5628ee67f3a495f6a8682 ]
@@ -40 +42,0 @@
-Cc: stable@dpdk.org
@@ -50 +52 @@
-index 881c42a97a..f2ca0ae4c2 100644
+index 3a182de248..6b5a4da430 100644
@@ -53 +55 @@
-@@ -2362,7 +2362,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -2279,7 +2279,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix error packets drop in regular Rx' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (46 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix use after free when releasing Tx queues' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: prevent querying aged flows on uninit port' " Xueming Li
                     ` (75 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=bfa6cbba4c6cffa1e3a27c17a6f8e89644f340a1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bfa6cbba4c6cffa1e3a27c17a6f8e89644f340a1 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Tue, 20 Feb 2024 13:45:20 +0200
Subject: [PATCH] net/mlx5: fix error packets drop in regular Rx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 ]

When packet gets received with error it is reported in CQE
structure and PMD analyzes the error syndrome and provides
two options - either reset the entire queue for the critical
errors, or just ignore the packet.

The non-vectorized rx_burst did not ignore the non-critical
error packets, and in case of packet length exceeding the
mbuf data buffer length it took the next element in the queue
WQE ring, resulting in CQE/WQE consume indices synchronization
lost.

Fixes: aa67ed308458 ("net/mlx5: ignore non-critical syndromes for Rx queue")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_rx.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 5bf1a679b2..cc087348a4 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -613,7 +613,8 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
  * @param mprq
  *   Indication if it is called from MPRQ.
  * @return
- *   0 in case of empty CQE, MLX5_REGULAR_ERROR_CQE_RET in case of error CQE,
+ *   0 in case of empty CQE,
+ *   MLX5_REGULAR_ERROR_CQE_RET in case of error CQE,
  *   MLX5_CRITICAL_ERROR_CQE_RET in case of error CQE lead to Rx queue reset,
  *   otherwise the packet size in regular RxQ,
  *   and striding byte count format in mprq case.
@@ -697,6 +698,11 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 					if (ret == MLX5_RECOVERY_ERROR_RET ||
 						ret == MLX5_RECOVERY_COMPLETED_RET)
 						return MLX5_CRITICAL_ERROR_CQE_RET;
+					if (!mprq && ret == MLX5_RECOVERY_IGNORE_RET) {
+						*skip_cnt = 1;
+						++rxq->cq_ci;
+						return MLX5_ERROR_CQE_MASK;
+					}
 				} else {
 					return 0;
 				}
@@ -971,19 +977,18 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_mask];
 			len = mlx5_rx_poll_len(rxq, cqe, cqe_n, cqe_mask, &mcqe, &skip_cnt, false);
 			if (unlikely(len & MLX5_ERROR_CQE_MASK)) {
+				/* We drop packets with non-critical errors */
+				rte_mbuf_raw_free(rep);
 				if (len == MLX5_CRITICAL_ERROR_CQE_RET) {
-					rte_mbuf_raw_free(rep);
 					rq_ci = rxq->rq_ci << sges_n;
 					break;
 				}
+				/* Skip specified amount of error CQEs packets */
 				rq_ci >>= sges_n;
 				rq_ci += skip_cnt;
 				rq_ci <<= sges_n;
-				idx = rq_ci & wqe_mask;
-				wqe = &((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx];
-				seg = (*rxq->elts)[idx];
-				cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_mask];
-				len = len & ~MLX5_ERROR_CQE_MASK;
+				MLX5_ASSERT(!pkt);
+				continue;
 			}
 			if (len == 0) {
 				rte_mbuf_raw_free(rep);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.552569301 +0800
+++ 0049-net-mlx5-fix-error-packets-drop-in-regular-Rx.patch	2024-04-13 20:43:04.967753971 +0800
@@ -1 +1 @@
-From ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 Mon Sep 17 00:00:00 2001
+From bfa6cbba4c6cffa1e3a27c17a6f8e89644f340a1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ef296e8f6140ea469b50c7bfe73501b1c9ef86e1 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: prevent querying aged flows on uninit port' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (47 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix error packets drop in regular Rx' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN inner type' " Xueming Li
                     ` (74 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=99be466799c897e5746c1cf65f2ffe599286702f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 99be466799c897e5746c1cf65f2ffe599286702f Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Wed, 21 Feb 2024 05:23:22 +0200
Subject: [PATCH] net/mlx5: prevent querying aged flows on uninit port
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3b1ccc5833b0bd89931e90c5e843134839ba46ce ]

In HWS template API, the aging mechanism doesn't support shared host
mode now. When the guest's counter is set to 0, the aging won't be
initialized.

The current implementation didn't prevent the user from querying the
aged flows on the uninitialized port. The access of invalid pointers
would cause a crash.

With this commit, the flag of the per port aging initialization will
be checked. This would help to get rid of the invalid accessing.

Fixes: 04a4de756e14 ("net/mlx5: support flow age action with HWS")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index bda1ecf121..25fef8c086 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -10746,6 +10746,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, "empty context");
+	if (!priv->hws_age_req)
+		return rte_flow_error_set(error, ENOENT,
+					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					  NULL, "No aging initialized");
 	if (priv->hws_strict_queue) {
 		if (queue_id >= age_info->hw_q_age->nb_rings)
 			return rte_flow_error_set(error, EINVAL,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.577389468 +0800
+++ 0050-net-mlx5-prevent-querying-aged-flows-on-uninit-port.patch	2024-04-13 20:43:04.967753971 +0800
@@ -1 +1 @@
-From 3b1ccc5833b0bd89931e90c5e843134839ba46ce Mon Sep 17 00:00:00 2001
+From 99be466799c897e5746c1cf65f2ffe599286702f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3b1ccc5833b0bd89931e90c5e843134839ba46ce ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index bd5c46b6ad..91d1c59fbd 100644
+index bda1ecf121..25fef8c086 100644
@@ -30 +32 @@
-@@ -11219,6 +11219,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,
+@@ -10746,6 +10746,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: fix VLAN inner type' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (48 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: prevent querying aged flows on uninit port' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix condition of LACP miss flow' " Xueming Li
                     ` (73 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Hamdan Igbaria; +Cc: Erez Shitrit, Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=17f644b4a810b7938d2a63317a5b12454302320e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 17f644b4a810b7938d2a63317a5b12454302320e Mon Sep 17 00:00:00 2001
From: Hamdan Igbaria <hamdani@nvidia.com>
Date: Wed, 21 Feb 2024 08:28:11 +0200
Subject: [PATCH] net/mlx5/hws: fix VLAN inner type
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d1d350d868439357e750297d5719670f706facc2 ]

Set the correct VLAN inner_type value, till today the
once the VLAN inner_type field was set, an incorrect
value was taken instead of the inner_type field.

Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index f047ffdab3..34a5174aa8 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -184,6 +184,7 @@ struct mlx5dr_definer_conv_data {
 	X(SET,		ib_l4_opcode,		v->hdr.opcode,		rte_flow_item_ib_bth) \
 	X(SET,		ib_l4_bth_a,		v->hdr.a,		rte_flow_item_ib_bth) \
 	X(SET,		cvlan,			STE_CVLAN,		rte_flow_item_vlan) \
+	X(SET_BE16,	inner_type,		v->inner_type,		rte_flow_item_vlan) \
 
 /* Item set function format */
 #define X(set_type, func_name, value, item_type) \
@@ -805,7 +806,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
 	if (m->hdr.eth_proto) {
 		fc = &cd->fc[DR_CALC_FNAME(ETH_TYPE, inner)];
 		fc->item_idx = item_idx;
-		fc->tag_set = &mlx5dr_definer_eth_type_set;
+		fc->tag_set = &mlx5dr_definer_inner_type_set;
 		DR_CALC_SET(fc, eth_l2, l3_ethertype, inner);
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.614457920 +0800
+++ 0051-net-mlx5-hws-fix-VLAN-inner-type.patch	2024-04-13 20:43:04.967753971 +0800
@@ -1 +1 @@
-From d1d350d868439357e750297d5719670f706facc2 Mon Sep 17 00:00:00 2001
+From 17f644b4a810b7938d2a63317a5b12454302320e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d1d350d868439357e750297d5719670f706facc2 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index c1508e6b53..e036aca781 100644
+index f047ffdab3..34a5174aa8 100644
@@ -24,2 +26,2 @@
-@@ -224,6 +224,7 @@ struct mlx5dr_definer_conv_data {
- 	X(SET,		random_number,		v->value,		rte_flow_item_random) \
+@@ -184,6 +184,7 @@ struct mlx5dr_definer_conv_data {
+ 	X(SET,		ib_l4_opcode,		v->hdr.opcode,		rte_flow_item_ib_bth) \
@@ -32 +34 @@
-@@ -990,7 +991,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
+@@ -805,7 +806,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix condition of LACP miss flow' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (49 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN inner type' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix conntrack action handle representation' " Xueming Li
                     ` (72 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a5d0545e5d9d61716e1c22598db5ecf7f1bc0d3f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a5d0545e5d9d61716e1c22598db5ecf7f1bc0d3f Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Wed, 21 Feb 2024 08:49:48 +0200
Subject: [PATCH] net/mlx5: fix condition of LACP miss flow
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 87e4384d2662f520bfae28ae14dbff2429c6923d ]

The LACP traffic is only related to the bond interface. The default
miss flow to redirect the LACP traffic with ethertype 0x8809 to the
kernel driver should only be created on the bond device.

This commit will:
  1. remove the incorrect assertion of the port role.
  2. skip the resource allocation and flow rule creation on the
     representor port.

Fixes: 0f0ae73a3287 ("net/mlx5: add parameter for LACP packets control")
Fixes: 49dffadf4b0c ("net/mlx5: fix LACP redirection in Rx domain")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 3 +--
 drivers/net/mlx5/mlx5_trigger.c | 8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 25fef8c086..c748e48e31 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8529,7 +8529,7 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
 		}
 	}
 	/* Create LACP default miss table. */
-	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0) {
+	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0 && priv->master) {
 		lacp_rx_items_tmpl = flow_hw_create_lacp_rx_pattern_template(dev, error);
 		if (!lacp_rx_items_tmpl) {
 			DRV_LOG(ERR, "port %u failed to create pattern template"
@@ -12222,7 +12222,6 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)
 		.type = MLX5_HW_CTRL_FLOW_TYPE_LACP_RX,
 	};
 
-	MLX5_ASSERT(priv->master);
 	if (!priv->dr_ctx || !priv->hw_lacp_rx_tbl)
 		return 0;
 	return flow_hw_create_ctrl_flow(dev, dev, priv->hw_lacp_rx_tbl, eth_lacp, 0,
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 5ac25d7e2d..f8d67282ce 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1524,7 +1524,7 @@ mlx5_traffic_enable_hws(struct rte_eth_dev *dev)
 	}
 	if (priv->isolated)
 		return 0;
-	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0)
+	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0 && priv->master)
 		if (mlx5_flow_hw_lacp_rx_flow(dev))
 			goto error;
 	if (dev->data->promiscuous)
@@ -1632,14 +1632,14 @@ mlx5_traffic_enable(struct rte_eth_dev *dev)
 		DRV_LOG(INFO, "port %u FDB default rule is disabled",
 			dev->data->port_id);
 	}
-	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0) {
+	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0 && priv->master) {
 		ret = mlx5_flow_lacp_miss(dev);
 		if (ret)
 			DRV_LOG(INFO, "port %u LACP rule cannot be created - "
 				"forward LACP to kernel.", dev->data->port_id);
 		else
-			DRV_LOG(INFO, "LACP traffic will be missed in port %u."
-				, dev->data->port_id);
+			DRV_LOG(INFO, "LACP traffic will be missed in port %u.",
+				dev->data->port_id);
 	}
 	if (priv->isolated)
 		return 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.641871884 +0800
+++ 0052-net-mlx5-fix-condition-of-LACP-miss-flow.patch	2024-04-13 20:43:04.977753958 +0800
@@ -1 +1 @@
-From 87e4384d2662f520bfae28ae14dbff2429c6923d Mon Sep 17 00:00:00 2001
+From a5d0545e5d9d61716e1c22598db5ecf7f1bc0d3f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 87e4384d2662f520bfae28ae14dbff2429c6923d ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 91d1c59fbd..e7f1b5f551 100644
+index 25fef8c086..c748e48e31 100644
@@ -30 +32 @@
-@@ -8934,7 +8934,7 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
+@@ -8529,7 +8529,7 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
@@ -39 +41 @@
-@@ -12761,7 +12761,6 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)
+@@ -12222,7 +12222,6 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix conntrack action handle representation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (50 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix condition of LACP miss flow' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix connection tracking action validation' " Xueming Li
                     ` (71 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1d65510ff679b97cd6689ca28633fea9af4e0042

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1d65510ff679b97cd6689ca28633fea9af4e0042 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Tue, 27 Feb 2024 15:52:21 +0200
Subject: [PATCH] net/mlx5: fix conntrack action handle representation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4487a79277a11bd5e78f57234b29b77b62f4e653 ]

In mlx5 PMD, handles to indirect connection tracking flow actions
are encoded in 32-bit unsigned integers as follows:

- Bits 31-29 - indirect action type.
- Bits 28-25 - port on which connection tracking action was created.
- Bits 24-0 - index of connection tracking object.

Macro defining a bit shift for owner part in this representation
was incorrectly defined as 22. This patch fixes that, as well as
aligns documented limitations.

Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS")
Fixes: 48fbb0e93d06 ("net/mlx5: support flow meter mark indirect action with HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 doc/guides/nics/mlx5.rst     | 4 ++--
 drivers/net/mlx5/mlx5_flow.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 6b52fb93c5..d0ebc101b4 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -708,8 +708,8 @@ Limitations
 
   - Cannot co-exist with ASO meter, ASO age action in a single flow rule.
   - Flow rules insertion rate and memory consumption need more optimization.
-  - 256 ports maximum.
-  - 4M connections maximum with ``dv_flow_en`` 1 mode. 16M with ``dv_flow_en`` 2.
+  - 16 ports maximum.
+  - 32M connections maximum.
 
 - Multi-thread flow insertion:
 
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 6dde9de688..edc273c518 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -77,7 +77,7 @@ enum mlx5_indirect_type {
 /* Now, the maximal ports will be supported is 16, action number is 32M. */
 #define MLX5_INDIRECT_ACT_CT_MAX_PORT 0x10
 
-#define MLX5_INDIRECT_ACT_CT_OWNER_SHIFT 22
+#define MLX5_INDIRECT_ACT_CT_OWNER_SHIFT 25
 #define MLX5_INDIRECT_ACT_CT_OWNER_MASK (MLX5_INDIRECT_ACT_CT_MAX_PORT - 1)
 
 /* 29-31: type, 25-28: owner port, 0-24: index */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.674066242 +0800
+++ 0053-net-mlx5-fix-conntrack-action-handle-representation.patch	2024-04-13 20:43:04.977753958 +0800
@@ -1 +1 @@
-From 4487a79277a11bd5e78f57234b29b77b62f4e653 Mon Sep 17 00:00:00 2001
+From 1d65510ff679b97cd6689ca28633fea9af4e0042 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4487a79277a11bd5e78f57234b29b77b62f4e653 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 6dce4f1c98..de286c67c8 100644
+index 6b52fb93c5..d0ebc101b4 100644
@@ -32 +34 @@
-@@ -814,8 +814,8 @@ Limitations
+@@ -708,8 +708,8 @@ Limitations
@@ -44 +46 @@
-index a4d0ff7b13..b4bf96cd64 100644
+index 6dde9de688..edc273c518 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix connection tracking action validation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (51 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix conntrack action handle representation' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix HWS registers initialization' " Xueming Li
                     ` (70 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=527857d5c23773f18c6bc166c227f6ded034d6e2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 527857d5c23773f18c6bc166c227f6ded034d6e2 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Tue, 27 Feb 2024 15:52:22 +0200
Subject: [PATCH] net/mlx5: fix connection tracking action validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ]

In mlx5 PMD, handles to indirect connection tracking flow actions
are encoded as 32-bit unsigned integers, where port ID is stored
in bits 28-25. Because of this, connection tracking flow actions
cannot be created on ports with IDs higher than 15.
This patch adds missing validation.

Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 9 +++++++++
 drivers/net/mlx5/mlx5_flow_hw.c | 7 +++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 79fde3de8e..c0d9e4fb82 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -13629,6 +13629,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "Connection is not supported");
+	if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				   "CT supports port indexes up to "
+				   RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT));
+		return 0;
+	}
 	idx = flow_dv_aso_ct_alloc(dev, error);
 	if (!idx)
 		return rte_flow_error_set(error, rte_errno,
@@ -16321,6 +16328,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
 	case RTE_FLOW_ACTION_TYPE_CONNTRACK:
 		ret = flow_dv_translate_create_conntrack(dev, action->conf,
 							 err);
+		if (!ret)
+			break;
 		idx = MLX5_INDIRECT_ACT_CT_GEN_IDX(PORT_ID(priv), ret);
 		break;
 	default:
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index c748e48e31..4927975461 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -9857,6 +9857,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,
 				   "CT is not enabled");
 		return 0;
 	}
+	if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				   "CT supports port indexes up to "
+				   RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT));
+		return 0;
+	}
 	ct = mlx5_ipool_zmalloc(pool->cts, &ct_idx);
 	if (!ct) {
 		rte_flow_error_set(error, rte_errno,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.700172408 +0800
+++ 0054-net-mlx5-fix-connection-tracking-action-validation.patch	2024-04-13 20:43:04.987753945 +0800
@@ -1 +1 @@
-From bd2db022c1ad154cd996b7b858c9f04f5a458416 Mon Sep 17 00:00:00 2001
+From 527857d5c23773f18c6bc166c227f6ded034d6e2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 75a8a223ab..ddf19e9a51 100644
+index 79fde3de8e..c0d9e4fb82 100644
@@ -26 +28 @@
-@@ -13889,6 +13889,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
+@@ -13629,6 +13629,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
@@ -40 +42 @@
-@@ -16586,6 +16593,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
+@@ -16321,6 +16328,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
@@ -50 +52 @@
-index c8440262d8..43bde71c93 100644
+index c748e48e31..4927975461 100644
@@ -53 +55 @@
-@@ -10346,6 +10346,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -9857,6 +9857,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix HWS registers initialization' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (52 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix connection tracking action validation' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5/hws: enable multiple integrity items' " Xueming Li
                     ` (69 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ca1084cd4891d179c6a2a8e595358a9045fd3c9b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ca1084cd4891d179c6a2a8e595358a9045fd3c9b Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Tue, 27 Feb 2024 17:26:27 +0200
Subject: [PATCH] net/mlx5: fix HWS registers initialization
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1beeb6d71fcc2fa73d149071c6880573d78fa071 ]

The method to initialize tag registers by using capability bits is
not supported on some old NICs. In the meanwhile, the HWS for flow
rule insertion is not supported either. There is no need to
initialize HWS only resource on the old NICs.

Fixes: 48041ccbaa8d ("net/mlx5: initialize HWS flow registers in shared context")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 6b5a4da430..df0383078d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1689,7 +1689,8 @@ mlx5_init_shared_dev_registers(struct mlx5_dev_ctx_shared *sh)
 	} else {
 		DRV_LOG(DEBUG, "ASO register: NONE");
 	}
-	mlx5_init_hws_flow_tags_registers(sh);
+	if (sh->config.dv_flow_en == 2)
+		mlx5_init_hws_flow_tags_registers(sh);
 }
 
 /**
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.743432351 +0800
+++ 0055-net-mlx5-fix-HWS-registers-initialization.patch	2024-04-13 20:43:04.987753945 +0800
@@ -1 +1 @@
-From 1beeb6d71fcc2fa73d149071c6880573d78fa071 Mon Sep 17 00:00:00 2001
+From ca1084cd4891d179c6a2a8e595358a9045fd3c9b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1beeb6d71fcc2fa73d149071c6880573d78fa071 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index f2ca0ae4c2..4f7304f099 100644
+index 6b5a4da430..df0383078d 100644
@@ -24 +26 @@
-@@ -1690,7 +1690,8 @@ mlx5_init_shared_dev_registers(struct mlx5_dev_ctx_shared *sh)
+@@ -1689,7 +1689,8 @@ mlx5_init_shared_dev_registers(struct mlx5_dev_ctx_shared *sh)
@@ -33 +35 @@
- static struct mlx5_physical_device *
+ /**

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: enable multiple integrity items' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (53 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix HWS registers initialization' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix VLAN handling in meter split' " Xueming Li
                     ` (68 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Michael Baum; +Cc: Erez Shitrit, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=86c66608c2ac4909fc88f28b26b90ae9a95ed8f1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 86c66608c2ac4909fc88f28b26b90ae9a95ed8f1 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Wed, 28 Feb 2024 11:50:55 +0200
Subject: [PATCH] net/mlx5/hws: enable multiple integrity items
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8c178ac8ce81ab0cbd9e90fd7eb4a2b47fca7c2b ]

The integrity item uses the DW "oks1" in header layout. It includes the
all supported bits for both inner and outer. When item is integrity
type, the relevant bits are turned on and all DW is submitted.

When user provides more then single integrity item in same pattern, the
last one overrides the values were submitted before. This is problematic
when user wants to match integrity bits for both inner and outer in same
pattern, he cannot merge them into single item since rte_flow API
provides encapsulation level field to match either inner or outer.

This patch avoids the overriding values, when "oks1" is submitted,
operator "or" is used instead of regular set.

Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 34a5174aa8..c6918ef4f3 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -41,6 +41,10 @@
 				  (bit_off))); \
 	} while (0)
 
+/* Getter function based on bit offset and mask, for 32bit DW*/
+#define DR_GET_32(p, byte_off, bit_off, mask) \
+	((rte_be_to_cpu_32(*((const rte_be32_t *)(p) + ((byte_off) / 4))) >> (bit_off)) & (mask))
+
 /* Setter function based on bit offset and mask */
 #define DR_SET(p, v, byte_off, bit_off, mask) \
 	do { \
@@ -379,7 +383,7 @@ mlx5dr_definer_integrity_set(struct mlx5dr_definer_fc *fc,
 {
 	bool inner = (fc->fname == MLX5DR_DEFINER_FNAME_INTEGRITY_I);
 	const struct rte_flow_item_integrity *v = item_spec;
-	uint32_t ok1_bits = 0;
+	uint32_t ok1_bits = DR_GET_32(tag, fc->byte_off, fc->bit_off, fc->bit_mask);
 
 	if (v->l3_ok)
 		ok1_bits |= inner ? BIT(MLX5DR_DEFINER_OKS1_SECOND_L3_OK) :
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.767693920 +0800
+++ 0056-net-mlx5-hws-enable-multiple-integrity-items.patch	2024-04-13 20:43:04.987753945 +0800
@@ -1 +1 @@
-From 8c178ac8ce81ab0cbd9e90fd7eb4a2b47fca7c2b Mon Sep 17 00:00:00 2001
+From 86c66608c2ac4909fc88f28b26b90ae9a95ed8f1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8c178ac8ce81ab0cbd9e90fd7eb4a2b47fca7c2b ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -30 +32 @@
-index e036aca781..0e15aafb8a 100644
+index 34a5174aa8..c6918ef4f3 100644
@@ -33 +35 @@
-@@ -44,6 +44,10 @@
+@@ -41,6 +41,10 @@
@@ -44 +46 @@
-@@ -509,7 +513,7 @@ mlx5dr_definer_integrity_set(struct mlx5dr_definer_fc *fc,
+@@ -379,7 +383,7 @@ mlx5dr_definer_integrity_set(struct mlx5dr_definer_fc *fc,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix VLAN handling in meter split' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (54 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5/hws: enable multiple integrity items' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix parameters verification in HWS table create' " Xueming Li
                     ` (67 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0198b11a1109696dff05344fde67fb7a4f7e26d7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0198b11a1109696dff05344fde67fb7a4f7e26d7 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Tue, 27 Feb 2024 14:58:15 +0100
Subject: [PATCH] net/mlx5: fix VLAN handling in meter split
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5d2301a222d77e7bac3a085aa17f8ef7a3af7ffe ]

On the attempt to create a flow rule with:

- matching on REPRESENTED_PORT,
- matching on outer VLAN tag,
- matching on inner VLAN tag,
- METER action,

flow splitting mechanism for handling metering flows was causing
memory corruption. It was assumed that suffix flow will have a single
VLAN item (used for translation of OF_PUSH_VLAN/OF_SET_VLAN_VID
actions), however during flow_meter_split_prep() 2 VLAN items were
parsed. This caused the buffer overflow on allocated
suffix flow item buffer.

This patch fixes this overflow, by account for number of VLAN items
in flow rule pattern when allocating items for suffix flow.

Fixes: 50f576d657d7 ("net/mlx5: fix VLAN actions in meter")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 60 +++++++++++++++++++++++-------------
 1 file changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3e31945f99..ee210549e7 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5817,8 +5817,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 	struct mlx5_rte_flow_item_tag *tag_item_spec;
 	struct mlx5_rte_flow_item_tag *tag_item_mask;
 	uint32_t tag_id = 0;
-	struct rte_flow_item *vlan_item_dst = NULL;
-	const struct rte_flow_item *vlan_item_src = NULL;
+	bool vlan_actions;
+	struct rte_flow_item *orig_sfx_items = sfx_items;
 	const struct rte_flow_item *orig_items = items;
 	struct rte_flow_action *hw_mtr_action;
 	struct rte_flow_action *action_pre_head = NULL;
@@ -5835,6 +5835,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 
 	/* Prepare the suffix subflow items. */
 	tag_item = sfx_items++;
+	tag_item->type = (enum rte_flow_item_type)MLX5_RTE_FLOW_ITEM_TYPE_TAG;
 	for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
 		int item_type = items->type;
 
@@ -5857,10 +5858,13 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 			sfx_items++;
 			break;
 		case RTE_FLOW_ITEM_TYPE_VLAN:
-			/* Determine if copy vlan item below. */
-			vlan_item_src = items;
-			vlan_item_dst = sfx_items++;
-			vlan_item_dst->type = RTE_FLOW_ITEM_TYPE_VOID;
+			/*
+			 * Copy VLAN items in case VLAN actions are performed.
+			 * If there are no VLAN actions, these items will be VOID.
+			 */
+			memcpy(sfx_items, items, sizeof(*sfx_items));
+			sfx_items->type = (enum rte_flow_item_type)MLX5_RTE_FLOW_ITEM_TYPE_VLAN;
+			sfx_items++;
 			break;
 		default:
 			break;
@@ -5877,6 +5881,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 		tag_action = actions_pre++;
 	}
 	/* Prepare the actions for prefix and suffix flow. */
+	vlan_actions = false;
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
 		struct rte_flow_action *action_cur = NULL;
 
@@ -5907,16 +5912,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 			break;
 		case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
 		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
-			if (vlan_item_dst && vlan_item_src) {
-				memcpy(vlan_item_dst, vlan_item_src,
-					sizeof(*vlan_item_dst));
-				/*
-				 * Convert to internal match item, it is used
-				 * for vlan push and set vid.
-				 */
-				vlan_item_dst->type = (enum rte_flow_item_type)
-						MLX5_RTE_FLOW_ITEM_TYPE_VLAN;
-			}
+			vlan_actions = true;
 			break;
 		case RTE_FLOW_ACTION_TYPE_COUNT:
 			if (fm->def_policy)
@@ -5931,6 +5927,14 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 					actions_sfx++ : actions_pre++;
 		memcpy(action_cur, actions, sizeof(struct rte_flow_action));
 	}
+	/* If there are no VLAN actions, convert VLAN items to VOID in suffix flow items. */
+	if (!vlan_actions) {
+		struct rte_flow_item *it = orig_sfx_items;
+
+		for (; it->type != RTE_FLOW_ITEM_TYPE_END; it++)
+			if (it->type == (enum rte_flow_item_type)MLX5_RTE_FLOW_ITEM_TYPE_VLAN)
+				it->type = RTE_FLOW_ITEM_TYPE_VOID;
+	}
 	/* Add end action to the actions. */
 	actions_sfx->type = RTE_FLOW_ACTION_TYPE_END;
 	if (priv->sh->meter_aso_en) {
@@ -6020,8 +6024,6 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
 	tag_action->type = (enum rte_flow_action_type)
 				MLX5_RTE_FLOW_ACTION_TYPE_TAG;
 	tag_action->conf = set_tag;
-	tag_item->type = (enum rte_flow_item_type)
-				MLX5_RTE_FLOW_ITEM_TYPE_TAG;
 	tag_item->spec = tag_item_spec;
 	tag_item->last = NULL;
 	tag_item->mask = tag_item_mask;
@@ -6849,6 +6851,19 @@ flow_meter_create_drop_flow_with_org_pattern(struct rte_eth_dev *dev,
 				&drop_split_info, error);
 }
 
+static int
+flow_count_vlan_items(const struct rte_flow_item items[])
+{
+	int items_n = 0;
+
+	for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
+		if (items->type == RTE_FLOW_ITEM_TYPE_VLAN ||
+		    items->type == (enum rte_flow_item_type)MLX5_RTE_FLOW_ITEM_TYPE_VLAN)
+			items_n++;
+	}
+	return items_n;
+}
+
 /**
  * The splitting for meter feature.
  *
@@ -6904,6 +6919,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 	size_t act_size;
 	size_t item_size;
 	int actions_n = 0;
+	int vlan_items_n = 0;
 	int ret = 0;
 
 	if (priv->mtr_en)
@@ -6963,9 +6979,11 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 		act_size = (sizeof(struct rte_flow_action) *
 			    (actions_n + METER_PREFIX_ACTION)) +
 			   sizeof(struct mlx5_rte_flow_action_set_tag);
-		/* Suffix items: tag, vlan, port id, end. */
-#define METER_SUFFIX_ITEM 4
-		item_size = sizeof(struct rte_flow_item) * METER_SUFFIX_ITEM +
+		/* Flow can have multiple VLAN items. Account for them in suffix items. */
+		vlan_items_n = flow_count_vlan_items(items);
+		/* Suffix items: tag, [vlans], port id, end. */
+#define METER_SUFFIX_ITEM 3
+		item_size = sizeof(struct rte_flow_item) * (METER_SUFFIX_ITEM + vlan_items_n) +
 			    sizeof(struct mlx5_rte_flow_item_tag) * 2;
 		sfx_actions = mlx5_malloc(MLX5_MEM_ZERO, (act_size + item_size),
 					  0, SOCKET_ID_ANY);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.793788586 +0800
+++ 0057-net-mlx5-fix-VLAN-handling-in-meter-split.patch	2024-04-13 20:43:04.997753931 +0800
@@ -1 +1 @@
-From 5d2301a222d77e7bac3a085aa17f8ef7a3af7ffe Mon Sep 17 00:00:00 2001
+From 0198b11a1109696dff05344fde67fb7a4f7e26d7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5d2301a222d77e7bac3a085aa17f8ef7a3af7ffe ]
@@ -24 +26,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index c7d70b8c7b..f8943a60be 100644
+index 3e31945f99..ee210549e7 100644
@@ -36 +38 @@
-@@ -5707,8 +5707,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5817,8 +5817,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -47 +49 @@
-@@ -5725,6 +5725,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5835,6 +5835,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -55 +57 @@
-@@ -5747,10 +5748,13 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5857,10 +5858,13 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -73 +75 @@
-@@ -5767,6 +5771,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5877,6 +5881,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -81 +83 @@
-@@ -5797,16 +5802,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5907,16 +5912,7 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -99 +101 @@
-@@ -5821,6 +5817,14 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5931,6 +5927,14 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -114 +116 @@
-@@ -5910,8 +5914,6 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -6020,8 +6024,6 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -123 +125 @@
-@@ -6739,6 +6741,19 @@ flow_meter_create_drop_flow_with_org_pattern(struct rte_eth_dev *dev,
+@@ -6849,6 +6851,19 @@ flow_meter_create_drop_flow_with_org_pattern(struct rte_eth_dev *dev,
@@ -143 +145 @@
-@@ -6794,6 +6809,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+@@ -6904,6 +6919,7 @@ flow_create_split_meter(struct rte_eth_dev *dev,
@@ -151 +153 @@
-@@ -6853,9 +6869,11 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+@@ -6963,9 +6979,11 @@ flow_create_split_meter(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix parameters verification in HWS table create' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (55 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix VLAN handling in meter split' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:48   ` patch 'net/mlx5: fix flow counter cache starvation' " Xueming Li
                     ` (66 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b90c42e4ff19cd494711152d52dabd0abdce4692

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b90c42e4ff19cd494711152d52dabd0abdce4692 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Wed, 28 Feb 2024 15:33:10 +0200
Subject: [PATCH] net/mlx5: fix parameters verification in HWS table create
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 075796dcc692b50a7b3e89cf969210171d09a06c ]

Modified the conditionals in `flow_hw_table_create()` to use bitwise
AND instead of equality checks when assessing
`table_cfg->attr->specialize` bitmask.
This will allow for greater flexibility as the bitmask may encapsulate
multiple flags.
The patch maintains the previous behavior with single flag values,
while providing support for multiple flags.

Fixes: 240b77cfcba5 ("net/mlx5: enable hint in async flow table")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 4927975461..93035c8548 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4368,12 +4368,23 @@ flow_hw_table_create(struct rte_eth_dev *dev,
 	matcher_attr.rule.num_log = rte_log2_u32(nb_flows);
 	/* Parse hints information. */
 	if (attr->specialize) {
-		if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG)
-			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_WIRE;
-		else if (attr->specialize == RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG)
-			matcher_attr.optimize_flow_src = MLX5DR_MATCHER_FLOW_SRC_VPORT;
-		else
-			DRV_LOG(INFO, "Unsupported hint value %x", attr->specialize);
+		uint32_t val = RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG |
+			       RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG;
+
+		if ((attr->specialize & val) == val) {
+			DRV_LOG(INFO, "Invalid hint value %x",
+				attr->specialize);
+			rte_errno = EINVAL;
+			goto it_error;
+		}
+		if (attr->specialize &
+		    RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG)
+			matcher_attr.optimize_flow_src =
+				MLX5DR_MATCHER_FLOW_SRC_WIRE;
+		else if (attr->specialize &
+			 RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG)
+			matcher_attr.optimize_flow_src =
+				MLX5DR_MATCHER_FLOW_SRC_VPORT;
 	}
 	/* Build the item template. */
 	for (i = 0; i < nb_item_templates; i++) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.830815337 +0800
+++ 0058-net-mlx5-fix-parameters-verification-in-HWS-table-cr.patch	2024-04-13 20:43:04.997753931 +0800
@@ -1 +1 @@
-From 075796dcc692b50a7b3e89cf969210171d09a06c Mon Sep 17 00:00:00 2001
+From b90c42e4ff19cd494711152d52dabd0abdce4692 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 075796dcc692b50a7b3e89cf969210171d09a06c ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 74a3133c13..76783145cf 100644
+index 4927975461..93035c8548 100644
@@ -27 +29 @@
-@@ -4397,12 +4397,23 @@ flow_hw_table_create(struct rte_eth_dev *dev,
+@@ -4368,12 +4368,23 @@ flow_hw_table_create(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix flow counter cache starvation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (56 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix parameters verification in HWS table create' " Xueming Li
@ 2024-04-13 12:48   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix counters map in bonding mode' " Xueming Li
                     ` (65 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:48 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, Bing Zhao, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=091234f3cb541f513fb086fb511cb0ce390e7d82

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 091234f3cb541f513fb086fb511cb0ce390e7d82 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Wed, 28 Feb 2024 20:06:06 +0100
Subject: [PATCH] net/mlx5: fix flow counter cache starvation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d755221b77c29549be4025e547cf907ad3a0abcf ]

mlx5 PMD maintains a global counter pool and per-queue counter cache,
which are used to allocate COUNT flow action objects.
Whenever an empty cache is accessed, it is replenished
with a pre-defined number of counters.

If number of configured counters was sufficiently small, then
it might have happened that caches associated with some queues
could get starved because all counters were fetched on other queues.

This patch fixes that by disabling cache at runtime
if number of configured counters is not sufficient to avoid
such starvation.

Fixes: 4d368e1da3a4 ("net/mlx5: support flow counter action for HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c |  6 +--
 drivers/net/mlx5/mlx5_hws_cnt.c | 72 ++++++++++++++++++++++++---------
 drivers/net/mlx5/mlx5_hws_cnt.h | 25 +++++++++---
 3 files changed, 74 insertions(+), 29 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 93035c8548..7cef9bd3ff 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3123,8 +3123,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
 				break;
 			/* Fall-through. */
 		case RTE_FLOW_ACTION_TYPE_COUNT:
-			/* If the port is engaged in resource sharing, do not use queue cache. */
-			cnt_queue = mlx5_hws_cnt_is_pool_shared(priv) ? NULL : &queue;
+			cnt_queue = mlx5_hws_cnt_get_queue(priv, &queue);
 			ret = mlx5_hws_cnt_pool_get(priv->hws_cpool, cnt_queue, &cnt_id, age_idx);
 			if (ret != 0)
 				return ret;
@@ -3722,8 +3721,7 @@ flow_hw_age_count_release(struct mlx5_priv *priv, uint32_t queue,
 		}
 		return;
 	}
-	/* If the port is engaged in resource sharing, do not use queue cache. */
-	cnt_queue = mlx5_hws_cnt_is_pool_shared(priv) ? NULL : &queue;
+	cnt_queue = mlx5_hws_cnt_get_queue(priv, &queue);
 	/* Put the counter first to reduce the race risk in BG thread. */
 	mlx5_hws_cnt_pool_put(priv->hws_cpool, cnt_queue, &flow->cnt_id);
 	flow->cnt_id = 0;
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index a3bea94811..c31f2f380b 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -340,6 +340,55 @@ mlx5_hws_cnt_pool_deinit(struct mlx5_hws_cnt_pool * const cntp)
 	mlx5_free(cntp);
 }
 
+static bool
+mlx5_hws_cnt_should_enable_cache(const struct mlx5_hws_cnt_pool_cfg *pcfg,
+				 const struct mlx5_hws_cache_param *ccfg)
+{
+	/*
+	 * Enable cache if and only if there are enough counters requested
+	 * to populate all of the caches.
+	 */
+	return pcfg->request_num >= ccfg->q_num * ccfg->size;
+}
+
+static struct mlx5_hws_cnt_pool_caches *
+mlx5_hws_cnt_cache_init(const struct mlx5_hws_cnt_pool_cfg *pcfg,
+			const struct mlx5_hws_cache_param *ccfg)
+{
+	struct mlx5_hws_cnt_pool_caches *cache;
+	char mz_name[RTE_MEMZONE_NAMESIZE];
+	uint32_t qidx;
+
+	/* If counter pool is big enough, setup the counter pool cache. */
+	cache = mlx5_malloc(MLX5_MEM_ANY | MLX5_MEM_ZERO,
+			sizeof(*cache) +
+			sizeof(((struct mlx5_hws_cnt_pool_caches *)0)->qcache[0])
+				* ccfg->q_num, 0, SOCKET_ID_ANY);
+	if (cache == NULL)
+		return NULL;
+	/* Store the necessary cache parameters. */
+	cache->fetch_sz = ccfg->fetch_sz;
+	cache->preload_sz = ccfg->preload_sz;
+	cache->threshold = ccfg->threshold;
+	cache->q_num = ccfg->q_num;
+	for (qidx = 0; qidx < ccfg->q_num; qidx++) {
+		snprintf(mz_name, sizeof(mz_name), "%s_qc/%x", pcfg->name, qidx);
+		cache->qcache[qidx] = rte_ring_create(mz_name, ccfg->size,
+				SOCKET_ID_ANY,
+				RING_F_SP_ENQ | RING_F_SC_DEQ |
+				RING_F_EXACT_SZ);
+		if (cache->qcache[qidx] == NULL)
+			goto error;
+	}
+	return cache;
+
+error:
+	while (qidx--)
+		rte_ring_free(cache->qcache[qidx]);
+	mlx5_free(cache);
+	return NULL;
+}
+
 static struct mlx5_hws_cnt_pool *
 mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,
 		       const struct mlx5_hws_cnt_pool_cfg *pcfg,
@@ -348,7 +397,6 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,
 	char mz_name[RTE_MEMZONE_NAMESIZE];
 	struct mlx5_hws_cnt_pool *cntp;
 	uint64_t cnt_num = 0;
-	uint32_t qidx;
 
 	MLX5_ASSERT(pcfg);
 	MLX5_ASSERT(ccfg);
@@ -360,17 +408,6 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,
 	cntp->cfg = *pcfg;
 	if (cntp->cfg.host_cpool)
 		return cntp;
-	cntp->cache = mlx5_malloc(MLX5_MEM_ANY | MLX5_MEM_ZERO,
-			sizeof(*cntp->cache) +
-			sizeof(((struct mlx5_hws_cnt_pool_caches *)0)->qcache[0])
-				* ccfg->q_num, 0, SOCKET_ID_ANY);
-	if (cntp->cache == NULL)
-		goto error;
-	 /* store the necessary cache parameters. */
-	cntp->cache->fetch_sz = ccfg->fetch_sz;
-	cntp->cache->preload_sz = ccfg->preload_sz;
-	cntp->cache->threshold = ccfg->threshold;
-	cntp->cache->q_num = ccfg->q_num;
 	if (pcfg->request_num > sh->hws_max_nb_counters) {
 		DRV_LOG(ERR, "Counter number %u "
 			"is greater than the maximum supported (%u).",
@@ -418,13 +455,10 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,
 		DRV_LOG(ERR, "failed to create reuse list ring");
 		goto error;
 	}
-	for (qidx = 0; qidx < ccfg->q_num; qidx++) {
-		snprintf(mz_name, sizeof(mz_name), "%s_qc/%x", pcfg->name, qidx);
-		cntp->cache->qcache[qidx] = rte_ring_create(mz_name, ccfg->size,
-				SOCKET_ID_ANY,
-				RING_F_SP_ENQ | RING_F_SC_DEQ |
-				RING_F_EXACT_SZ);
-		if (cntp->cache->qcache[qidx] == NULL)
+	/* Allocate counter cache only if needed. */
+	if (mlx5_hws_cnt_should_enable_cache(pcfg, ccfg)) {
+		cntp->cache = mlx5_hws_cnt_cache_init(pcfg, ccfg);
+		if (cntp->cache == NULL)
 			goto error;
 	}
 	/* Initialize the time for aging-out calculation. */
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.h b/drivers/net/mlx5/mlx5_hws_cnt.h
index 585b5a83ad..e00596088f 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.h
+++ b/drivers/net/mlx5/mlx5_hws_cnt.h
@@ -557,19 +557,32 @@ mlx5_hws_cnt_pool_get(struct mlx5_hws_cnt_pool *cpool, uint32_t *queue,
 }
 
 /**
- * Check if counter pool allocated for HWS is shared between ports.
+ * Decide if the given queue can be used to perform counter allocation/deallcation
+ * based on counter configuration
  *
  * @param[in] priv
  *   Pointer to the port private data structure.
+ * @param[in] queue
+ *   Pointer to the queue index.
  *
  * @return
- *   True if counter pools is shared between ports. False otherwise.
+ *   @p queue if cache related to the queue can be used. NULL otherwise.
  */
-static __rte_always_inline bool
-mlx5_hws_cnt_is_pool_shared(struct mlx5_priv *priv)
+static __rte_always_inline uint32_t *
+mlx5_hws_cnt_get_queue(struct mlx5_priv *priv, uint32_t *queue)
 {
-	return priv && priv->hws_cpool &&
-	    (priv->shared_refcnt || priv->hws_cpool->cfg.host_cpool != NULL);
+	if (priv && priv->hws_cpool) {
+		/* Do not use queue cache if counter pool is shared. */
+		if (priv->shared_refcnt || priv->hws_cpool->cfg.host_cpool != NULL)
+			return NULL;
+		/* Do not use queue cache if counter cache is disabled. */
+		if (priv->hws_cpool->cache == NULL)
+			return NULL;
+		return queue;
+	}
+	/* This case should not be reached if counter pool was successfully configured. */
+	MLX5_ASSERT(false);
+	return NULL;
 }
 
 static __rte_always_inline unsigned int
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.868225888 +0800
+++ 0059-net-mlx5-fix-flow-counter-cache-starvation.patch	2024-04-13 20:43:04.997753931 +0800
@@ -1 +1 @@
-From d755221b77c29549be4025e547cf907ad3a0abcf Mon Sep 17 00:00:00 2001
+From 091234f3cb541f513fb086fb511cb0ce390e7d82 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d755221b77c29549be4025e547cf907ad3a0abcf ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -32 +34 @@
-index 9620b7f576..c1dbdc5f19 100644
+index 93035c8548..7cef9bd3ff 100644
@@ -35 +37 @@
-@@ -3131,8 +3131,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
+@@ -3123,8 +3123,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
@@ -45 +47 @@
-@@ -3776,8 +3775,7 @@ flow_hw_age_count_release(struct mlx5_priv *priv, uint32_t queue,
+@@ -3722,8 +3721,7 @@ flow_hw_age_count_release(struct mlx5_priv *priv, uint32_t queue,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix counters map in bonding mode' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (57 preceding siblings ...)
  2024-04-13 12:48   ` patch 'net/mlx5: fix flow counter cache starvation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix flow action template expansion' " Xueming Li
                     ` (64 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0c31d1220ffaff4742154c3c957ab5305e5f5c3a

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0c31d1220ffaff4742154c3c957ab5305e5f5c3a Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Thu, 29 Feb 2024 11:34:56 +0200
Subject: [PATCH] net/mlx5: fix counters map in bonding mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a687c3e658c2d889052089af8340bc0b9299c856 ]

In the HW-LAG mode, there is only one mlx5 IB device with 2 ETH
interfaces. In theory, the settings on both ports should be the same.
But in the real life, some inconsistent settings may be done by the
user and the PMD is not aware of this.

In the previous implementation, the xstats map was generated from the
information fetched on the 1st port of a bonding interface. If the
2nd port had a different settings, the number and the order of the
counters may differ from that of the 1st one. The ioctl() call may
corrupt the user buffers (copy_to_user) and cause a crash.

The commit will change the map between the driver counters to the
PMD user counters.
  1. Switch the inner and outer loop to speed up the initialization
     time AMAP - since there will be >300 counters returned from the
     driver.
  2. Generate an unique map for both ports in LAG mode.
    a. Scan the 1st port and find the supported counters' strings,
       then add to the map.
    b. In bonding, scan the 2nd port and find the strings. If one is
       already in the map, use the index. Or append to the next free
       slot.
    c. Append the device counters that needs to be fetched via sysfs
       or Devx command. This kind of counter(s) is unique per IB
       device.

After querying the statistics from the driver, the value will be read
from the proper offset in the "struct ethtool_stats" and then added
into the output array based on the map information. In bonding mode,
the statistics from both ports will be accumulated if the counters
are valid on both ports.

Compared to the system call or Devx command, the overhead introduced
by the extra index comparison is light and should not cause a
significant degradation.

The application should ensure that the port settings should not be
changed out of the DPDK application dynamically in most cases. Or
else the change cannot be notified and the counters map might not
be valid when the number doesn't change but the counters set had
changed. A device restart will help to re-initialize the map from
scrath.

Fixes: 7ed15acdcd69 ("net/mlx5: improve xstats of bonding port")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c   | 249 +++++++++++++++-------
 drivers/net/mlx5/mlx5.h                   |  15 +-
 drivers/net/mlx5/mlx5_stats.c             |  58 +++--
 drivers/net/mlx5/windows/mlx5_ethdev_os.c |  22 +-
 4 files changed, 242 insertions(+), 102 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index dd5a0c546d..0ee8c58ba7 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1286,13 +1286,16 @@ _mlx5_os_read_dev_counters(struct rte_eth_dev *dev, int pf, uint64_t *stats)
 	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
 	unsigned int i;
 	struct ifreq ifr;
-	unsigned int stats_sz = xstats_ctrl->stats_n * sizeof(uint64_t);
+	unsigned int max_stats_n = RTE_MAX(xstats_ctrl->stats_n, xstats_ctrl->stats_n_2nd);
+	unsigned int stats_sz = max_stats_n * sizeof(uint64_t);
 	unsigned char et_stat_buf[sizeof(struct ethtool_stats) + stats_sz];
 	struct ethtool_stats *et_stats = (struct ethtool_stats *)et_stat_buf;
 	int ret;
+	uint16_t i_idx, o_idx;
 
 	et_stats->cmd = ETHTOOL_GSTATS;
-	et_stats->n_stats = xstats_ctrl->stats_n;
+	/* Pass the maximum value, the driver may ignore this. */
+	et_stats->n_stats = max_stats_n;
 	ifr.ifr_data = (caddr_t)et_stats;
 	if (pf >= 0)
 		ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[pf].ifname,
@@ -1305,21 +1308,34 @@ _mlx5_os_read_dev_counters(struct rte_eth_dev *dev, int pf, uint64_t *stats)
 			dev->data->port_id);
 		return ret;
 	}
-	for (i = 0; i != xstats_ctrl->mlx5_stats_n; ++i) {
-		if (xstats_ctrl->info[i].dev)
-			continue;
-		stats[i] += (uint64_t)
-			    et_stats->data[xstats_ctrl->dev_table_idx[i]];
+	if (pf <= 0) {
+		for (i = 0; i != xstats_ctrl->mlx5_stats_n; i++) {
+			i_idx = xstats_ctrl->dev_table_idx[i];
+			if (i_idx == UINT16_MAX || xstats_ctrl->info[i].dev)
+				continue;
+			o_idx = xstats_ctrl->xstats_o_idx[i];
+			stats[o_idx] += (uint64_t)et_stats->data[i_idx];
+		}
+	} else {
+		for (i = 0; i != xstats_ctrl->mlx5_stats_n; i++) {
+			i_idx = xstats_ctrl->dev_table_idx_2nd[i];
+			if (i_idx == UINT16_MAX)
+				continue;
+			o_idx = xstats_ctrl->xstats_o_idx_2nd[i];
+			stats[o_idx] += (uint64_t)et_stats->data[i_idx];
+		}
 	}
 	return 0;
 }
 
-/**
+/*
  * Read device counters.
  *
  * @param dev
  *   Pointer to Ethernet device.
- * @param[out] stats
+ * @param bond_master
+ *   Indicate if the device is a bond master.
+ * @param stats
  *   Counters table output buffer.
  *
  * @return
@@ -1327,7 +1343,7 @@ _mlx5_os_read_dev_counters(struct rte_eth_dev *dev, int pf, uint64_t *stats)
  *   rte_errno is set.
  */
 int
-mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
+mlx5_os_read_dev_counters(struct rte_eth_dev *dev, bool bond_master, uint64_t *stats)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
@@ -1335,7 +1351,7 @@ mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
 
 	memset(stats, 0, sizeof(*stats) * xstats_ctrl->mlx5_stats_n);
 	/* Read ifreq counters. */
-	if (priv->master && priv->pf_bond >= 0) {
+	if (bond_master) {
 		/* Sum xstats from bonding device member ports. */
 		for (i = 0; i < priv->sh->bond.n_port; i++) {
 			ret = _mlx5_os_read_dev_counters(dev, i, stats);
@@ -1347,13 +1363,17 @@ mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
 		if (ret)
 			return ret;
 	}
-	/* Read IB counters. */
-	for (i = 0; i != xstats_ctrl->mlx5_stats_n; ++i) {
+	/*
+	 * Read IB counters.
+	 * The counters are unique per IB device but not per net IF.
+	 * In bonding mode, getting the stats name only from 1 port is enough.
+	 */
+	for (i = 0; i != xstats_ctrl->mlx5_stats_n; i++) {
 		if (!xstats_ctrl->info[i].dev)
 			continue;
 		/* return last xstats counter if fail to read. */
 		if (mlx5_os_read_dev_stat(priv, xstats_ctrl->info[i].ctr_name,
-			    &stats[i]) == 0)
+					  &stats[i]) == 0)
 			xstats_ctrl->xstats[i] = stats[i];
 		else
 			stats[i] = xstats_ctrl->xstats[i];
@@ -1361,18 +1381,24 @@ mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
 	return ret;
 }
 
-/**
+/*
  * Query the number of statistics provided by ETHTOOL.
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param bond_master
+ *   Indicate if the device is a bond master.
+ * @param n_stats
+ *   Pointer to number of stats to store.
+ * @param n_stats_sec
+ *   Pointer to number of stats to store for the 2nd port of the bond.
  *
  * @return
- *   Number of statistics on success, negative errno value otherwise and
- *   rte_errno is set.
+ *   0 on success, negative errno value otherwise and rte_errno is set.
  */
 int
-mlx5_os_get_stats_n(struct rte_eth_dev *dev)
+mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master,
+		    uint16_t *n_stats, uint16_t *n_stats_sec)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct ethtool_drvinfo drvinfo;
@@ -1381,18 +1407,34 @@ mlx5_os_get_stats_n(struct rte_eth_dev *dev)
 
 	drvinfo.cmd = ETHTOOL_GDRVINFO;
 	ifr.ifr_data = (caddr_t)&drvinfo;
-	if (priv->master && priv->pf_bond >= 0)
-		/* Bonding PF. */
+	/* Bonding PFs. */
+	if (bond_master) {
 		ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[0].ifname,
 					   SIOCETHTOOL, &ifr);
-	else
+		if (ret) {
+			DRV_LOG(WARNING, "bonding port %u unable to query number of"
+				" statistics for the 1st slave, %d", PORT_ID(priv), ret);
+			return ret;
+		}
+		*n_stats = drvinfo.n_stats;
+		ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[1].ifname,
+					   SIOCETHTOOL, &ifr);
+		if (ret) {
+			DRV_LOG(WARNING, "bonding port %u unable to query number of"
+				" statistics for the 2nd slave, %d", PORT_ID(priv), ret);
+			return ret;
+		}
+		*n_stats_sec = drvinfo.n_stats;
+	} else {
 		ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
-	if (ret) {
-		DRV_LOG(WARNING, "port %u unable to query number of statistics",
-			dev->data->port_id);
-		return ret;
+		if (ret) {
+			DRV_LOG(WARNING, "port %u unable to query number of statistics",
+				PORT_ID(priv));
+			return ret;
+		}
+		*n_stats = drvinfo.n_stats;
 	}
-	return drvinfo.n_stats;
+	return 0;
 }
 
 static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
@@ -1578,6 +1620,101 @@ static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
 
 static const unsigned int xstats_n = RTE_DIM(mlx5_counters_init);
 
+static int
+mlx5_os_get_stats_strings(struct rte_eth_dev *dev, bool bond_master,
+			  struct ethtool_gstrings *strings,
+			  uint32_t stats_n, uint32_t stats_n_2nd)
+{
+	struct mlx5_priv *priv = dev->data->dev_private;
+	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
+	struct ifreq ifr;
+	int ret;
+	uint32_t i, j, idx;
+
+	/* Ensure no out of bounds access before. */
+	MLX5_ASSERT(xstats_n <= MLX5_MAX_XSTATS);
+	strings->cmd = ETHTOOL_GSTRINGS;
+	strings->string_set = ETH_SS_STATS;
+	strings->len = stats_n;
+	ifr.ifr_data = (caddr_t)strings;
+	if (bond_master)
+		ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[0].ifname,
+					   SIOCETHTOOL, &ifr);
+	else
+		ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
+	if (ret) {
+		DRV_LOG(WARNING, "port %u unable to get statistic names with %d",
+			PORT_ID(priv), ret);
+		return ret;
+	}
+	/* Reorganize the orders to reduce the iterations. */
+	for (j = 0; j < xstats_n; j++) {
+		xstats_ctrl->dev_table_idx[j] = UINT16_MAX;
+		for (i = 0; i < stats_n; i++) {
+			const char *curr_string =
+				(const char *)&strings->data[i * ETH_GSTRING_LEN];
+
+			if (!strcmp(mlx5_counters_init[j].ctr_name, curr_string)) {
+				idx = xstats_ctrl->mlx5_stats_n++;
+				xstats_ctrl->dev_table_idx[j] = i;
+				xstats_ctrl->xstats_o_idx[j] = idx;
+				xstats_ctrl->info[idx] = mlx5_counters_init[j];
+			}
+		}
+	}
+	if (!bond_master) {
+		/* Add dev counters, unique per IB device. */
+		for (j = 0; j != xstats_n; j++) {
+			if (mlx5_counters_init[j].dev) {
+				idx = xstats_ctrl->mlx5_stats_n++;
+				xstats_ctrl->info[idx] = mlx5_counters_init[j];
+				xstats_ctrl->hw_stats[idx] = 0;
+			}
+		}
+		return 0;
+	}
+
+	strings->len = stats_n_2nd;
+	ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[1].ifname,
+				   SIOCETHTOOL, &ifr);
+	if (ret) {
+		DRV_LOG(WARNING, "port %u unable to get statistic names for 2nd slave with %d",
+			PORT_ID(priv), ret);
+		return ret;
+	}
+	/* The 2nd slave port may have a different strings set, based on the configuration. */
+	for (j = 0; j != xstats_n; j++) {
+		xstats_ctrl->dev_table_idx_2nd[j] = UINT16_MAX;
+		for (i = 0; i != stats_n_2nd; i++) {
+			const char *curr_string =
+				(const char *)&strings->data[i * ETH_GSTRING_LEN];
+
+			if (!strcmp(mlx5_counters_init[j].ctr_name, curr_string)) {
+				xstats_ctrl->dev_table_idx_2nd[j] = i;
+				if (xstats_ctrl->dev_table_idx[j] != UINT16_MAX) {
+					/* Already mapped in the 1st slave port. */
+					idx = xstats_ctrl->xstats_o_idx[j];
+					xstats_ctrl->xstats_o_idx_2nd[j] = idx;
+				} else {
+					/* Append the new items to the end of the map. */
+					idx = xstats_ctrl->mlx5_stats_n++;
+					xstats_ctrl->xstats_o_idx_2nd[j] = idx;
+					xstats_ctrl->info[idx] = mlx5_counters_init[j];
+				}
+			}
+		}
+	}
+	/* Dev counters are always at the last now. */
+	for (j = 0; j != xstats_n; j++) {
+		if (mlx5_counters_init[j].dev) {
+			idx = xstats_ctrl->mlx5_stats_n++;
+			xstats_ctrl->info[idx] = mlx5_counters_init[j];
+			xstats_ctrl->hw_stats[idx] = 0;
+		}
+	}
+	return 0;
+}
+
 /**
  * Init the structures to read device counters.
  *
@@ -1590,76 +1727,44 @@ mlx5_os_stats_init(struct rte_eth_dev *dev)
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
 	struct mlx5_stats_ctrl *stats_ctrl = &priv->stats_ctrl;
-	unsigned int i;
-	unsigned int j;
-	struct ifreq ifr;
 	struct ethtool_gstrings *strings = NULL;
-	unsigned int dev_stats_n;
+	uint16_t dev_stats_n = 0;
+	uint16_t dev_stats_n_2nd = 0;
+	unsigned int max_stats_n;
 	unsigned int str_sz;
 	int ret;
+	bool bond_master = (priv->master && priv->pf_bond >= 0);
 
 	/* So that it won't aggregate for each init. */
 	xstats_ctrl->mlx5_stats_n = 0;
-	ret = mlx5_os_get_stats_n(dev);
+	ret = mlx5_os_get_stats_n(dev, bond_master, &dev_stats_n, &dev_stats_n_2nd);
 	if (ret < 0) {
 		DRV_LOG(WARNING, "port %u no extended statistics available",
 			dev->data->port_id);
 		return;
 	}
-	dev_stats_n = ret;
+	max_stats_n = RTE_MAX(dev_stats_n, dev_stats_n_2nd);
 	/* Allocate memory to grab stat names and values. */
-	str_sz = dev_stats_n * ETH_GSTRING_LEN;
+	str_sz = max_stats_n * ETH_GSTRING_LEN;
 	strings = (struct ethtool_gstrings *)
 		  mlx5_malloc(0, str_sz + sizeof(struct ethtool_gstrings), 0,
 			      SOCKET_ID_ANY);
 	if (!strings) {
 		DRV_LOG(WARNING, "port %u unable to allocate memory for xstats",
-		     dev->data->port_id);
+			dev->data->port_id);
 		return;
 	}
-	strings->cmd = ETHTOOL_GSTRINGS;
-	strings->string_set = ETH_SS_STATS;
-	strings->len = dev_stats_n;
-	ifr.ifr_data = (caddr_t)strings;
-	if (priv->master && priv->pf_bond >= 0)
-		/* Bonding master. */
-		ret = mlx5_ifreq_by_ifname(priv->sh->bond.ports[0].ifname,
-					   SIOCETHTOOL, &ifr);
-	else
-		ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
-	if (ret) {
-		DRV_LOG(WARNING, "port %u unable to get statistic names",
+	ret = mlx5_os_get_stats_strings(dev, bond_master, strings,
+					dev_stats_n, dev_stats_n_2nd);
+	if (ret < 0) {
+		DRV_LOG(WARNING, "port %u failed to get the stats strings",
 			dev->data->port_id);
 		goto free;
 	}
-	for (i = 0; i != dev_stats_n; ++i) {
-		const char *curr_string = (const char *)
-			&strings->data[i * ETH_GSTRING_LEN];
-
-		for (j = 0; j != xstats_n; ++j) {
-			if (!strcmp(mlx5_counters_init[j].ctr_name,
-				    curr_string)) {
-				unsigned int idx = xstats_ctrl->mlx5_stats_n++;
-
-				xstats_ctrl->dev_table_idx[idx] = i;
-				xstats_ctrl->info[idx] = mlx5_counters_init[j];
-				break;
-			}
-		}
-	}
-	/* Add dev counters. */
-	MLX5_ASSERT(xstats_ctrl->mlx5_stats_n <= MLX5_MAX_XSTATS);
-	for (i = 0; i != xstats_n; ++i) {
-		if (mlx5_counters_init[i].dev) {
-			unsigned int idx = xstats_ctrl->mlx5_stats_n++;
-
-			xstats_ctrl->info[idx] = mlx5_counters_init[i];
-			xstats_ctrl->hw_stats[idx] = 0;
-		}
-	}
 	xstats_ctrl->stats_n = dev_stats_n;
+	xstats_ctrl->stats_n_2nd = dev_stats_n_2nd;
 	/* Copy to base at first time. */
-	ret = mlx5_os_read_dev_counters(dev, xstats_ctrl->base);
+	ret = mlx5_os_read_dev_counters(dev, bond_master, xstats_ctrl->base);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot read device counters: %s",
 			dev->data->port_id, strerror(rte_errno));
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 263ebead7f..153374802a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -263,14 +263,22 @@ struct mlx5_counter_ctrl {
 struct mlx5_xstats_ctrl {
 	/* Number of device stats. */
 	uint16_t stats_n;
+	/* Number of device stats, for the 2nd port in bond. */
+	uint16_t stats_n_2nd;
 	/* Number of device stats identified by PMD. */
-	uint16_t  mlx5_stats_n;
+	uint16_t mlx5_stats_n;
 	/* Index in the device counters table. */
 	uint16_t dev_table_idx[MLX5_MAX_XSTATS];
+	/* Index in the output table. */
+	uint16_t xstats_o_idx[MLX5_MAX_XSTATS];
 	uint64_t base[MLX5_MAX_XSTATS];
 	uint64_t xstats[MLX5_MAX_XSTATS];
 	uint64_t hw_stats[MLX5_MAX_XSTATS];
 	struct mlx5_counter_ctrl info[MLX5_MAX_XSTATS];
+	/* Index in the device counters table, for the 2nd port in bond. */
+	uint16_t dev_table_idx_2nd[MLX5_MAX_XSTATS];
+	/* Index in the output table, for the 2nd port in bond. */
+	uint16_t xstats_o_idx_2nd[MLX5_MAX_XSTATS];
 };
 
 struct mlx5_stats_ctrl {
@@ -2131,8 +2139,9 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev,
 			   struct rte_dev_eeprom_info *info);
 int mlx5_os_read_dev_stat(struct mlx5_priv *priv,
 			  const char *ctr_name, uint64_t *stat);
-int mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats);
-int mlx5_os_get_stats_n(struct rte_eth_dev *dev);
+int mlx5_os_read_dev_counters(struct rte_eth_dev *dev, bool bond_master, uint64_t *stats);
+int mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master,
+			uint16_t *n_stats, uint16_t *n_stats_sec);
 void mlx5_os_stats_init(struct rte_eth_dev *dev);
 int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev);
 
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 615e1d073d..f4ac58e2f9 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -39,24 +39,36 @@ mlx5_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats,
 		unsigned int n)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	unsigned int i;
-	uint64_t counters[n];
+	uint64_t counters[MLX5_MAX_XSTATS];
 	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
+	unsigned int i;
+	uint16_t stats_n = 0;
+	uint16_t stats_n_2nd = 0;
 	uint16_t mlx5_stats_n = xstats_ctrl->mlx5_stats_n;
+	bool bond_master = (priv->master && priv->pf_bond >= 0);
 
 	if (n >= mlx5_stats_n && stats) {
-		int stats_n;
 		int ret;
 
-		stats_n = mlx5_os_get_stats_n(dev);
-		if (stats_n < 0)
-			return stats_n;
-		if (xstats_ctrl->stats_n != stats_n)
+		ret = mlx5_os_get_stats_n(dev, bond_master, &stats_n, &stats_n_2nd);
+		if (ret < 0)
+			return ret;
+		/*
+		 * The number of statistics fetched via "ETH_SS_STATS" may vary because
+		 * of the port configuration each time. This is also true between 2
+		 * ports. There might be a case that the numbers are the same even if
+		 * configurations are different.
+		 * It is not recommended to change the configuration without using
+		 * RTE API. The port(traffic) restart may trigger another initialization
+		 * to make sure the map are correct.
+		 */
+		if (xstats_ctrl->stats_n != stats_n ||
+		    (bond_master && xstats_ctrl->stats_n_2nd != stats_n_2nd))
 			mlx5_os_stats_init(dev);
-		ret = mlx5_os_read_dev_counters(dev, counters);
-		if (ret)
+		ret = mlx5_os_read_dev_counters(dev, bond_master, counters);
+		if (ret < 0)
 			return ret;
-		for (i = 0; i != mlx5_stats_n; ++i) {
+		for (i = 0; i != mlx5_stats_n; i++) {
 			stats[i].id = i;
 			if (xstats_ctrl->info[i].dev) {
 				uint64_t wrap_n;
@@ -225,30 +237,32 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl;
-	int stats_n;
 	unsigned int i;
 	uint64_t *counters;
 	int ret;
+	uint16_t stats_n = 0;
+	uint16_t stats_n_2nd = 0;
+	bool bond_master = (priv->master && priv->pf_bond >= 0);
 
-	stats_n = mlx5_os_get_stats_n(dev);
-	if (stats_n < 0) {
+	ret = mlx5_os_get_stats_n(dev, bond_master, &stats_n, &stats_n_2nd);
+	if (ret < 0) {
 		DRV_LOG(ERR, "port %u cannot get stats: %s", dev->data->port_id,
-			strerror(-stats_n));
-		return stats_n;
+			strerror(-ret));
+		return ret;
 	}
-	if (xstats_ctrl->stats_n != stats_n)
+	if (xstats_ctrl->stats_n != stats_n ||
+	    (bond_master && xstats_ctrl->stats_n_2nd != stats_n_2nd))
 		mlx5_os_stats_init(dev);
-	counters =  mlx5_malloc(MLX5_MEM_SYS, sizeof(*counters) *
-			xstats_ctrl->mlx5_stats_n, 0,
-			SOCKET_ID_ANY);
+	/* Considering to use stack directly. */
+	counters = mlx5_malloc(MLX5_MEM_SYS, sizeof(*counters) * xstats_ctrl->mlx5_stats_n,
+			       0, SOCKET_ID_ANY);
 	if (!counters) {
-		DRV_LOG(WARNING, "port %u unable to allocate memory for xstats "
-				"counters",
+		DRV_LOG(WARNING, "port %u unable to allocate memory for xstats counters",
 		     dev->data->port_id);
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
-	ret = mlx5_os_read_dev_counters(dev, counters);
+	ret = mlx5_os_read_dev_counters(dev, bond_master, counters);
 	if (ret) {
 		DRV_LOG(ERR, "port %u cannot read device counters: %s",
 			dev->data->port_id, strerror(rte_errno));
diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
index a31e1b5494..49f750be68 100644
--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
@@ -178,20 +178,29 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	return -ENOTSUP;
 }
 
-/**
+/*
  * Query the number of statistics provided by ETHTOOL.
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param bond_master
+ *   Indicate if the device is a bond master.
+ * @param n_stats
+ *   Pointer to number of stats to store.
+ * @param n_stats_sec
+ *   Pointer to number of stats to store for the 2nd port of the bond.
  *
  * @return
- *   Number of statistics on success, negative errno value otherwise and
- *   rte_errno is set.
+ *   0 on success, negative errno value otherwise and rte_errno is set.
  */
 int
-mlx5_os_get_stats_n(struct rte_eth_dev *dev)
+mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master,
+		    uint16_t *n_stats, uint16_t *n_stats_sec)
 {
 	RTE_SET_USED(dev);
+	RTE_SET_USED(bond_master);
+	RTE_SET_USED(n_stats);
+	RTE_SET_USED(n_stats_sec);
 	return -ENOTSUP;
 }
 
@@ -221,6 +230,8 @@ mlx5_os_stats_init(struct rte_eth_dev *dev)
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param bond_master
+ *   Indicate if the device is a bond master.
  * @param[out] stats
  *   Counters table output buffer.
  *
@@ -229,9 +240,10 @@ mlx5_os_stats_init(struct rte_eth_dev *dev)
  *   rte_errno is set.
  */
 int
-mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
+mlx5_os_read_dev_counters(struct rte_eth_dev *dev, bool bond_master, uint64_t *stats)
 {
 	RTE_SET_USED(dev);
+	RTE_SET_USED(bond_master);
 	RTE_SET_USED(stats);
 	return -ENOTSUP;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.901405245 +0800
+++ 0060-net-mlx5-fix-counters-map-in-bonding-mode.patch	2024-04-13 20:43:05.007753918 +0800
@@ -1 +1 @@
-From a687c3e658c2d889052089af8340bc0b9299c856 Mon Sep 17 00:00:00 2001
+From 0c31d1220ffaff4742154c3c957ab5305e5f5c3a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a687c3e658c2d889052089af8340bc0b9299c856 ]
@@ -50 +52,0 @@
-Cc: stable@dpdk.org
@@ -62 +64 @@
-index 92c47a3b3d..eb47c284ec 100644
+index dd5a0c546d..0ee8c58ba7 100644
@@ -237 +239 @@
-@@ -1615,6 +1657,101 @@ static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
+@@ -1578,6 +1620,101 @@ static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
@@ -339 +341 @@
-@@ -1627,76 +1764,44 @@ mlx5_os_stats_init(struct rte_eth_dev *dev)
+@@ -1590,76 +1727,44 @@ mlx5_os_stats_init(struct rte_eth_dev *dev)
@@ -431 +433 @@
-index f11a0181b8..fb3df76cac 100644
+index 263ebead7f..153374802a 100644
@@ -458 +460 @@
-@@ -2182,8 +2190,9 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev,
+@@ -2131,8 +2139,9 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix flow action template expansion' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (58 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix counters map in bonding mode' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: remove device status check in flow creation' " Xueming Li
                     ` (63 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a10a65c3967651721c6a09c6d554536c2b769ac5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a10a65c3967651721c6a09c6d554536c2b769ac5 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 29 Feb 2024 12:19:55 +0200
Subject: [PATCH] net/mlx5: fix flow action template expansion
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 487191742f4620392ca103c4e2a3a69491a2ea2c ]

MLX5 PMD actions template compilation may implicitly add MODIFY_HEADER
to actions list provided by application.
MLX5 actions in a template list must be arranged according to the HW
supported order.
The PMD must place new MODIFY_HEADER in the correct location relative
to existing actions.

The patch adds indirect actions list to calculation of the new
MODIFY_HEADER location.

Fixes: e26f50adbf38 ("net/mlx5: support indirect list meter mark action")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 80 +++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 7cef9bd3ff..7e4ead1875 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -110,6 +110,9 @@ mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev,
 			       struct mlx5_tbl_multi_pattern_ctx *mpat,
 			       struct rte_flow_error *error);
 
+static __rte_always_inline enum mlx5_indirect_list_type
+flow_hw_inlist_type_get(const struct rte_flow_action *actions);
+
 static __rte_always_inline int
 mlx5_multi_pattern_reformat_to_index(enum mlx5dr_action_type type)
 {
@@ -5456,6 +5459,69 @@ mlx5_decap_encap_reformat_type(const struct rte_flow_action *actions,
 	       MLX5_FLOW_ACTION_ENCAP : MLX5_FLOW_ACTION_DECAP;
 }
 
+enum mlx5_hw_indirect_list_relative_position {
+	MLX5_INDIRECT_LIST_POSITION_UNKNOWN = -1,
+	MLX5_INDIRECT_LIST_POSITION_BEFORE_MH = 0,
+	MLX5_INDIRECT_LIST_POSITION_AFTER_MH,
+};
+
+static enum mlx5_hw_indirect_list_relative_position
+mlx5_hw_indirect_list_mh_position(const struct rte_flow_action *action)
+{
+	const struct rte_flow_action_indirect_list *conf = action->conf;
+	enum mlx5_indirect_list_type list_type = mlx5_get_indirect_list_type(conf->handle);
+	enum mlx5_hw_indirect_list_relative_position pos = MLX5_INDIRECT_LIST_POSITION_UNKNOWN;
+	const union {
+		struct mlx5_indlst_legacy *legacy;
+		struct mlx5_hw_encap_decap_action *reformat;
+		struct rte_flow_action_list_handle *handle;
+	} h = { .handle = conf->handle};
+
+	switch (list_type) {
+	case  MLX5_INDIRECT_ACTION_LIST_TYPE_LEGACY:
+		switch (h.legacy->legacy_type) {
+		case RTE_FLOW_ACTION_TYPE_AGE:
+		case RTE_FLOW_ACTION_TYPE_COUNT:
+		case RTE_FLOW_ACTION_TYPE_CONNTRACK:
+		case RTE_FLOW_ACTION_TYPE_METER_MARK:
+		case RTE_FLOW_ACTION_TYPE_QUOTA:
+			pos = MLX5_INDIRECT_LIST_POSITION_BEFORE_MH;
+			break;
+		case RTE_FLOW_ACTION_TYPE_RSS:
+			pos = MLX5_INDIRECT_LIST_POSITION_AFTER_MH;
+			break;
+		default:
+			pos = MLX5_INDIRECT_LIST_POSITION_UNKNOWN;
+			break;
+		}
+		break;
+	case MLX5_INDIRECT_ACTION_LIST_TYPE_MIRROR:
+		pos = MLX5_INDIRECT_LIST_POSITION_AFTER_MH;
+		break;
+	case MLX5_INDIRECT_ACTION_LIST_TYPE_REFORMAT:
+		switch (h.reformat->action_type) {
+		case MLX5DR_ACTION_TYP_REFORMAT_TNL_L2_TO_L2:
+		case MLX5DR_ACTION_TYP_REFORMAT_TNL_L3_TO_L2:
+			pos = MLX5_INDIRECT_LIST_POSITION_BEFORE_MH;
+			break;
+		case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2:
+		case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L3:
+			pos = MLX5_INDIRECT_LIST_POSITION_AFTER_MH;
+			break;
+		default:
+			pos = MLX5_INDIRECT_LIST_POSITION_UNKNOWN;
+			break;
+		}
+		break;
+	default:
+		pos = MLX5_INDIRECT_LIST_POSITION_UNKNOWN;
+		break;
+	}
+	return pos;
+}
+
+#define MLX5_HW_EXPAND_MH_FAILED 0xffff
+
 static inline uint16_t
 flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
 				     struct rte_flow_action masks[],
@@ -5492,6 +5558,7 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
 	 * @see action_order_arr[]
 	 */
 	for (i = act_num - 2; (int)i >= 0; i--) {
+		enum mlx5_hw_indirect_list_relative_position pos;
 		enum rte_flow_action_type type = actions[i].type;
 		uint64_t reformat_type;
 
@@ -5522,6 +5589,13 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
 			if (actions[i - 1].type == RTE_FLOW_ACTION_TYPE_RAW_DECAP)
 				i--;
 			break;
+		case RTE_FLOW_ACTION_TYPE_INDIRECT_LIST:
+			pos = mlx5_hw_indirect_list_mh_position(&actions[i]);
+			if (pos == MLX5_INDIRECT_LIST_POSITION_UNKNOWN)
+				return MLX5_HW_EXPAND_MH_FAILED;
+			if (pos == MLX5_INDIRECT_LIST_POSITION_BEFORE_MH)
+				goto insert;
+			break;
 		default:
 			i++; /* new MF inserted AFTER actions[i] */
 			goto insert;
@@ -6476,6 +6550,12 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,
 							   action_flags,
 							   act_num,
 							   expand_mf_num);
+		if (pos == MLX5_HW_EXPAND_MH_FAILED) {
+			rte_flow_error_set(error, ENOMEM,
+					   RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "modify header expansion failed");
+			return NULL;
+		}
 		act_num += expand_mf_num;
 		for (i = pos + expand_mf_num; i < act_num; i++)
 			src_off[i] += expand_mf_num;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.928512110 +0800
+++ 0061-net-mlx5-fix-flow-action-template-expansion.patch	2024-04-13 20:43:05.007753918 +0800
@@ -1 +1 @@
-From 487191742f4620392ca103c4e2a3a69491a2ea2c Mon Sep 17 00:00:00 2001
+From a10a65c3967651721c6a09c6d554536c2b769ac5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 487191742f4620392ca103c4e2a3a69491a2ea2c ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index c1dbdc5f19..f3f4649c5d 100644
+index 7cef9bd3ff..7e4ead1875 100644
@@ -29,3 +31,3 @@
-@@ -88,6 +88,9 @@ mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev,
- static void
- mlx5_destroy_multi_pattern_segment(struct mlx5_multi_pattern_segment *segment);
+@@ -110,6 +110,9 @@ mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev,
+ 			       struct mlx5_tbl_multi_pattern_ctx *mpat,
+ 			       struct rte_flow_error *error);
@@ -39 +41 @@
-@@ -5820,6 +5823,69 @@ mlx5_decap_encap_reformat_type(const struct rte_flow_action *actions,
+@@ -5456,6 +5459,69 @@ mlx5_decap_encap_reformat_type(const struct rte_flow_action *actions,
@@ -109 +111 @@
-@@ -5856,6 +5922,7 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
+@@ -5492,6 +5558,7 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
@@ -117 +119 @@
-@@ -5886,6 +5953,13 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
+@@ -5522,6 +5589,13 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],
@@ -131 +133 @@
-@@ -6891,6 +6965,12 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,
+@@ -6476,6 +6550,12 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: remove device status check in flow creation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (59 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix flow action template expansion' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'test: fix probing in secondary process' " Xueming Li
                     ` (62 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=272feb8eb990b5ef05604e0359d39dc5650f449c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 272feb8eb990b5ef05604e0359d39dc5650f449c Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Thu, 29 Feb 2024 12:51:56 +0100
Subject: [PATCH] net/mlx5: remove device status check in flow creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4095ce34095e33ae9e8b19150b9280ff8737a590 ]

The flow rule can be inserted even before the device started. The
only exception is for a queue or RSS action.

For the other interfaces of template API, the start status is not
checked. The checking would cause some cache miss or eviction since
the flag locates on some other cache line.

Fixes: f1fecffa88df ("net/mlx5: support Direct Rules action template API")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 7e4ead1875..6aaf3aee2a 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3322,10 +3322,6 @@ flow_hw_async_flow_create(struct rte_eth_dev *dev,
 	uint32_t res_idx = 0;
 	int ret;
 
-	if (unlikely((!dev->data->dev_started))) {
-		rte_errno = EINVAL;
-		goto error;
-	}
 	job = flow_hw_job_get(priv, queue);
 	if (!job) {
 		rte_errno = ENOMEM;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:06.968868057 +0800
+++ 0062-net-mlx5-remove-device-status-check-in-flow-creation.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 4095ce34095e33ae9e8b19150b9280ff8737a590 Mon Sep 17 00:00:00 2001
+From 272feb8eb990b5ef05604e0359d39dc5650f449c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4095ce34095e33ae9e8b19150b9280ff8737a590 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +21,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 5 -----
- 1 file changed, 5 deletions(-)
+ drivers/net/mlx5/mlx5_flow_hw.c | 4 ----
+ 1 file changed, 4 deletions(-)
@@ -23 +25 @@
-index 6f43e88864..8ca866059d 100644
+index 7e4ead1875..6aaf3aee2a 100644
@@ -26 +28 @@
-@@ -3526,11 +3526,6 @@ flow_hw_async_flow_create(struct rte_eth_dev *dev,
+@@ -3322,10 +3322,6 @@ flow_hw_async_flow_create(struct rte_eth_dev *dev,
@@ -31,3 +33,2 @@
--		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
--				   "Port must be started before enqueueing flow operations");
--		return NULL;
+-		rte_errno = EINVAL;
+-		goto error;
@@ -35,3 +36,3 @@
- 	flow = mlx5_ipool_malloc(table->flow, &flow_idx);
- 	if (!flow)
- 		goto error;
+ 	job = flow_hw_job_get(priv, queue);
+ 	if (!job) {
+ 		rte_errno = ENOMEM;

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test: fix probing in secondary process' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (60 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: remove device status check in flow creation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'bus/vdev: fix devargs " Xueming Li
                     ` (61 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: Zhimin Huang, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ef4c8a57f320f01061b399b62e9dac7836dea83b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ef4c8a57f320f01061b399b62e9dac7836dea83b Mon Sep 17 00:00:00 2001
From: Mingjin Ye <mingjinx.ye@intel.com>
Date: Tue, 14 Nov 2023 10:28:15 +0000
Subject: [PATCH] test: fix probing in secondary process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b3ce7891ad386310abab56352053a46ba06ca72f ]

In EAL related test cases, the allow parameters are not passed to
the secondary process, resulting in unexpected NICs being loaded.

This patch fixes this issue by appending the allow parameters to
the secondary process.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/process.h | 46 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 42 insertions(+), 4 deletions(-)

diff --git a/app/test/process.h b/app/test/process.h
index c576c42349..9fb2bf481c 100644
--- a/app/test/process.h
+++ b/app/test/process.h
@@ -17,6 +17,7 @@
 #include <dirent.h>
 
 #include <rte_string_fns.h> /* strlcpy */
+#include <rte_devargs.h>
 
 #ifdef RTE_EXEC_ENV_FREEBSD
 #define self "curproc"
@@ -34,6 +35,34 @@ extern uint16_t flag_for_send_pkts;
 #endif
 #endif
 
+#define PREFIX_ALLOW "--allow="
+
+static int
+add_parameter_allow(char **argv, int max_capacity)
+{
+	struct rte_devargs *devargs;
+	int count = 0;
+
+	RTE_EAL_DEVARGS_FOREACH(NULL, devargs) {
+		if (strlen(devargs->name) == 0)
+			continue;
+
+		if (devargs->data == NULL || strlen(devargs->data) == 0) {
+			if (asprintf(&argv[count], PREFIX_ALLOW"%s", devargs->name) < 0)
+				break;
+		} else {
+			if (asprintf(&argv[count], PREFIX_ALLOW"%s,%s",
+					 devargs->name, devargs->data) < 0)
+				break;
+		}
+
+		if (++count == max_capacity)
+			break;
+	}
+
+	return count;
+}
+
 /*
  * launches a second copy of the test process using the given argv parameters,
  * which should include argv[0] as the process name. To identify in the
@@ -43,8 +72,10 @@ extern uint16_t flag_for_send_pkts;
 static inline int
 process_dup(const char *const argv[], int numargs, const char *env_value)
 {
-	int num;
-	char *argv_cpy[numargs + 1];
+	int num = 0;
+	char **argv_cpy;
+	int allow_num;
+	int argv_num;
 	int i, status;
 	char path[32];
 #ifdef RTE_LIB_PDUMP
@@ -58,14 +89,21 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
 	if (pid < 0)
 		return -1;
 	else if (pid == 0) {
+		allow_num = rte_devargs_type_count(RTE_DEVTYPE_ALLOWED);
+		argv_num = numargs + allow_num + 1;
+		argv_cpy = calloc(argv_num, sizeof(char *));
+		if (!argv_cpy)
+			rte_panic("Memory allocation failed\n");
+
 		/* make a copy of the arguments to be passed to exec */
 		for (i = 0; i < numargs; i++) {
 			argv_cpy[i] = strdup(argv[i]);
 			if (argv_cpy[i] == NULL)
 				rte_panic("Error dup args\n");
 		}
-		argv_cpy[i] = NULL;
-		num = numargs;
+		if (allow_num > 0)
+			num = add_parameter_allow(&argv_cpy[i], allow_num);
+		num += numargs;
 
 #ifdef RTE_EXEC_ENV_LINUX
 		{
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.000578116 +0800
+++ 0063-test-fix-probing-in-secondary-process.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From b3ce7891ad386310abab56352053a46ba06ca72f Mon Sep 17 00:00:00 2001
+From ef4c8a57f320f01061b399b62e9dac7836dea83b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b3ce7891ad386310abab56352053a46ba06ca72f ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'bus/vdev: fix devargs in secondary process' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (61 preceding siblings ...)
  2024-04-13 12:49   ` patch 'test: fix probing in secondary process' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'config: fix CPU instruction set for cross-build' " Xueming Li
                     ` (60 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Mingjin Ye; +Cc: Anatoly Burakov, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6148604a438aad21e5d74f414976666b370582c1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6148604a438aad21e5d74f414976666b370582c1 Mon Sep 17 00:00:00 2001
From: Mingjin Ye <mingjinx.ye@intel.com>
Date: Fri, 1 Sep 2023 07:24:09 +0000
Subject: [PATCH] bus/vdev: fix devargs in secondary process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6666628362c94a0b567a39a0177539c12c97d999 ]

When a device is created by a secondary process, an empty devargs is
temporarily generated and bound to it. This causes the device to not
be associated with the correct devargs, and the empty devargs are not
released when the resource is freed.

This patch fixes the issue by matching the devargs when inserting a
device in secondary process.

Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")
Fixes: a16040453968 ("eal: extract vdev infra")

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/bus/vdev/vdev.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 05582f1727..14cf856237 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -263,6 +263,22 @@ alloc_devargs(const char *name, const char *args)
 	return devargs;
 }
 
+static struct rte_devargs *
+vdev_devargs_lookup(const char *name)
+{
+	struct rte_devargs *devargs;
+	char dev_name[32];
+
+	RTE_EAL_DEVARGS_FOREACH("vdev", devargs) {
+		devargs->bus->parse(devargs->name, &dev_name);
+		if (strcmp(dev_name, name) == 0) {
+			VDEV_LOG(INFO, "devargs matched %s", dev_name);
+			return devargs;
+		}
+	}
+	return NULL;
+}
+
 static int
 insert_vdev(const char *name, const char *args,
 		struct rte_vdev_device **p_dev,
@@ -275,7 +291,11 @@ insert_vdev(const char *name, const char *args,
 	if (name == NULL)
 		return -EINVAL;
 
-	devargs = alloc_devargs(name, args);
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+		devargs = alloc_devargs(name, args);
+	else
+		devargs = vdev_devargs_lookup(name);
+
 	if (!devargs)
 		return -ENOMEM;
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.025817983 +0800
+++ 0064-bus-vdev-fix-devargs-in-secondary-process.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 6666628362c94a0b567a39a0177539c12c97d999 Mon Sep 17 00:00:00 2001
+From 6148604a438aad21e5d74f414976666b370582c1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6666628362c94a0b567a39a0177539c12c97d999 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'config: fix CPU instruction set for cross-build' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (62 preceding siblings ...)
  2024-04-13 12:49   ` patch 'bus/vdev: fix devargs " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'test/mbuf: fix external mbuf case with assert enabled' " Xueming Li
                     ` (59 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Joyce Kong; +Cc: Ruifeng Wang, Stephen Hemminger, Pavan Nikhilesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ced51dd5efede54fd04d0b1f7b4da3c5785df7bf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ced51dd5efede54fd04d0b1f7b4da3c5785df7bf Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong@arm.com>
Date: Tue, 5 Dec 2023 03:52:58 +0000
Subject: [PATCH] config: fix CPU instruction set for cross-build
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d74543f8ad30db164c08ec69910b05d6811b1b89 ]

The platform value would be 'native' only when not cross build.
Move the operation about modifying cpu_instruction_set while
platform equals 'native' to the not cross build branch.

Fixes: bf66003b51ec ("build: use platform for generic and native builds")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 config/meson.build | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 65662c5de3..898b719929 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -121,13 +121,14 @@ else
             cpu_instruction_set = 'generic'
         endif
     endif
+    if platform == 'native'
+        if cpu_instruction_set == 'auto'
+            cpu_instruction_set = 'native'
+        endif
+    endif
 endif
 
-if platform == 'native'
-    if cpu_instruction_set == 'auto'
-        cpu_instruction_set = 'native'
-    endif
-elif platform == 'generic'
+if platform == 'generic'
     if cpu_instruction_set == 'auto'
         cpu_instruction_set = 'generic'
     endif
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.050449350 +0800
+++ 0065-config-fix-CPU-instruction-set-for-cross-build.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From d74543f8ad30db164c08ec69910b05d6811b1b89 Mon Sep 17 00:00:00 2001
+From ced51dd5efede54fd04d0b1f7b4da3c5785df7bf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d74543f8ad30db164c08ec69910b05d6811b1b89 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 8cb6429313..bbb931a457 100644
+index 65662c5de3..898b719929 100644
@@ -25 +27 @@
-@@ -128,13 +128,14 @@ else
+@@ -121,13 +121,14 @@ else

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test/mbuf: fix external mbuf case with assert enabled' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (63 preceding siblings ...)
  2024-04-13 12:49   ` patch 'config: fix CPU instruction set for cross-build' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'test: assume C source files are UTF-8 encoded' " Xueming Li
                     ` (58 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Rakesh Kudurumalla; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=de3976eb27efa755499f0982e0be846e305e7226

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From de3976eb27efa755499f0982e0be846e305e7226 Mon Sep 17 00:00:00 2001
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Date: Thu, 23 Nov 2023 12:12:21 +0530
Subject: [PATCH] test/mbuf: fix external mbuf case with assert enabled
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6dbaa4ee67135ac6ff8ef35fa98a93e0f08af494 ]

when RTE_ENABLE_ASSERT is defined test_mbuf application is
failing because we are trying to attach extbuf to a cloned
buffer to which external mbuf is already attached.
To make test_mbuf pass CI we have updated ol_flags.
This patch fixes the same.

Fixes: 7b295dceea07 ("test/mbuf: add unit test cases")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test/test_mbuf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index d7393df7eb..a39288a5f8 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2345,16 +2345,13 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
 		GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
 				__func__);
 
-	/* allocate one more mbuf */
+	/* allocate one more mbuf, it is attached to the same external buffer */
 	clone = rte_pktmbuf_clone(m, pktmbuf_pool);
 	if (clone == NULL)
 		GOTO_FAIL("%s: mbuf clone allocation failed!\n", __func__);
 	if (rte_pktmbuf_pkt_len(clone) != 0)
 		GOTO_FAIL("%s: Bad packet length\n", __func__);
 
-	/* attach the same external buffer to the cloned mbuf */
-	rte_pktmbuf_attach_extbuf(clone, ext_buf_addr, buf_iova, buf_len,
-			ret_shinfo);
 	if (clone->ol_flags != RTE_MBUF_F_EXTERNAL)
 		GOTO_FAIL("%s: External buffer is not attached to mbuf\n",
 				__func__);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.075992217 +0800
+++ 0066-test-mbuf-fix-external-mbuf-case-with-assert-enabled.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 6dbaa4ee67135ac6ff8ef35fa98a93e0f08af494 Mon Sep 17 00:00:00 2001
+From de3976eb27efa755499f0982e0be846e305e7226 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6dbaa4ee67135ac6ff8ef35fa98a93e0f08af494 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 51ea6ef1c4..17be977f31 100644
+index d7393df7eb..a39288a5f8 100644
@@ -25 +27 @@
-@@ -2346,16 +2346,13 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)
+@@ -2345,16 +2345,13 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test: assume C source files are UTF-8 encoded' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (64 preceding siblings ...)
  2024-04-13 12:49   ` patch 'test/mbuf: fix external mbuf case with assert enabled' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'test: do not count skipped tests as executed' " Xueming Li
                     ` (57 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Robin Jarry
  Cc: Bruce Richardson, Morten Brørup, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5c5df0f29203b18a22deb19a5046152961b07d12

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5c5df0f29203b18a22deb19a5046152961b07d12 Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry@redhat.com>
Date: Tue, 5 Mar 2024 14:46:15 +0100
Subject: [PATCH] test: assume C source files are UTF-8 encoded
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 39846d56c48ba9a5da23f4a8af40cd46b47e9367 ]

Instead of relying on the default locale from the environment (LC_ALL),
explicitly read the files as utf-8 encoded.

Fixes: 0aeaf75df879 ("test: define unit tests suites based on test types")

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 buildtools/get-test-suites.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildtools/get-test-suites.py b/buildtools/get-test-suites.py
index 574c233aa8..c61f6a273f 100644
--- a/buildtools/get-test-suites.py
+++ b/buildtools/get-test-suites.py
@@ -19,7 +19,7 @@ def get_fast_test_params(test_name, ln):
     return f":{nohuge.strip().lower()}:{asan.strip().lower()}"
 
 for fname in input_list:
-    with open(fname) as f:
+    with open(fname, "r", encoding="utf-8") as f:
         contents = [ln.strip() for ln in f.readlines()]
         test_lines = [ln for ln in contents if test_def_regex.match(ln)]
         non_suite_tests.extend([non_suite_regex.match(ln).group(1)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.103063882 +0800
+++ 0067-test-assume-C-source-files-are-UTF-8-encoded.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 39846d56c48ba9a5da23f4a8af40cd46b47e9367 Mon Sep 17 00:00:00 2001
+From 5c5df0f29203b18a22deb19a5046152961b07d12 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 39846d56c48ba9a5da23f4a8af40cd46b47e9367 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test: do not count skipped tests as executed' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (65 preceding siblings ...)
  2024-04-13 12:49   ` patch 'test: assume C source files are UTF-8 encoded' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'examples/packet_ordering: fix Rx with reorder mode disabled' " Xueming Li
                     ` (56 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Akhil Goyal, Ciara Power, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e8dccbca30cec3504b043b3e4da6951c0f9f8168

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e8dccbca30cec3504b043b3e4da6951c0f9f8168 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Mon, 13 Nov 2023 15:05:33 +0000
Subject: [PATCH] test: do not count skipped tests as executed
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a620df6df6d61660661afade09760b2dfba4eb42 ]

The logic around skipped tests is a little confusing in the unit test
runner.
* Any explicitly disabled tests are counted as skipped but not
  executed.
* Any tests that return TEST_SKIPPED are counted as both skipped and
  executed, using the same statistics counters.

This makes the stats very strange and hard to correlate, since the
totals don't add up.  One would expect that SKIPPED + EXECUTED +
UNSUPPORTED == TOTAL, and that PASSED + FAILED == EXECUTED.

To achieve this, mark any tests returning TEST_SKIPPED, or ENOTSUP as
not having executed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 app/test/test.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test/test.c b/app/test/test.c
index bfa9ea52e3..7b882a59de 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -375,11 +375,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 
 			if (test_success == TEST_SUCCESS)
 				suite->succeeded++;
-			else if (test_success == TEST_SKIPPED)
+			else if (test_success == TEST_SKIPPED) {
 				suite->skipped++;
-			else if (test_success == -ENOTSUP)
+				suite->executed--;
+			} else if (test_success == -ENOTSUP) {
 				suite->unsupported++;
-			else
+				suite->executed--;
+			} else
 				suite->failed++;
 		} else if (test_success == -ENOTSUP) {
 			suite->unsupported++;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.128290849 +0800
+++ 0068-test-do-not-count-skipped-tests-as-executed.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From a620df6df6d61660661afade09760b2dfba4eb42 Mon Sep 17 00:00:00 2001
+From e8dccbca30cec3504b043b3e4da6951c0f9f8168 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a620df6df6d61660661afade09760b2dfba4eb42 ]
@@ -20,2 +22,0 @@
-Cc: stable@dpdk.org
-
@@ -31 +32 @@
-index 8b25615913..680351f6a3 100644
+index bfa9ea52e3..7b882a59de 100644
@@ -34 +35 @@
-@@ -369,11 +369,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)
+@@ -375,11 +375,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/packet_ordering: fix Rx with reorder mode disabled' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (66 preceding siblings ...)
  2024-04-13 12:49   ` patch 'test: do not count skipped tests as executed' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx over not ready port' " Xueming Li
                     ` (55 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Qian Hao; +Cc: Volodymyr Fialko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=10296d5f506e4ad4e5c7bb2c32a1f6369ffdcd9c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 10296d5f506e4ad4e5c7bb2c32a1f6369ffdcd9c Mon Sep 17 00:00:00 2001
From: Qian Hao <qi_an_hao@126.com>
Date: Wed, 13 Dec 2023 19:07:18 +0800
Subject: [PATCH] examples/packet_ordering: fix Rx with reorder mode disabled
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7ba49dc729937ea97642a615e9b08f33919b94f4 ]

The packet_ordering example works in two modes (opt via --disable-reorder):
  - When reorder is enabled: rx_thread - N*worker_thread - send_thread
  - When reorder is disabled: rx_thread - N*worker_thread - tx_thread
N parallel worker_thread(s) generate out-of-order packets.

When reorder is enabled, send_thread uses sequence number generated in
rx_thread (L459) to enforce packet ordering. Otherwise rx_thread just
sends any packet it receives.

rx_thread writes sequence number into a dynamic field, which is only
registered by calling rte_reorder_create() (Line 741) when reorder is
enabled. However, rx_thread marks sequence number onto each packet no
matter whether reorder is enabled, overwriting the leading bytes in packet
mbufs when reorder is disabled, resulting in segfaults when PMD tries to
DMA packets.

`if (!disable_reorder_flag) {...}` is added in rx_thread to fix the bug.
The test is inlined by the compiler to prevent any performance loss.

Signed-off-by: Qian Hao <qi_an_hao@126.com>
Acked-by: Volodymyr Fialko <vfialko@marvell.com>
---
 .mailmap                        |  1 +
 examples/packet_ordering/main.c | 32 +++++++++++++++++++++++++-------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/.mailmap b/.mailmap
index 9541b3b02e..daa1f52205 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1131,6 +1131,7 @@ Przemyslaw Czesnowicz <przemyslaw.czesnowicz@intel.com>
 Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
 Przemyslaw Zegan <przemyslawx.zegan@intel.com>
 Pu Xu <583493798@qq.com>
+Qian Hao <qi_an_hao@126.com>
 Qian Xu <qian.q.xu@intel.com>
 Qiao Liu <qiao.liu@intel.com>
 Qi Fu <qi.fu@intel.com>
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index d2fd6f77e4..f839db9102 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <getopt.h>
+#include <stdbool.h>
 
 #include <rte_eal.h>
 #include <rte_common.h>
@@ -427,8 +428,8 @@ int_handler(int sig_num)
  * The mbufs are then passed to the worker threads via the rx_to_workers
  * ring.
  */
-static int
-rx_thread(struct rte_ring *ring_out)
+static __rte_always_inline int
+rx_thread(struct rte_ring *ring_out, bool disable_reorder_flag)
 {
 	uint32_t seqn = 0;
 	uint16_t i, ret = 0;
@@ -454,9 +455,11 @@ rx_thread(struct rte_ring *ring_out)
 				}
 				app_stats.rx.rx_pkts += nb_rx_pkts;
 
-				/* mark sequence number */
-				for (i = 0; i < nb_rx_pkts; )
-					*rte_reorder_seqn(pkts[i++]) = seqn++;
+				/* mark sequence number if reorder is enabled */
+				if (!disable_reorder_flag) {
+					for (i = 0; i < nb_rx_pkts;)
+						*rte_reorder_seqn(pkts[i++]) = seqn++;
+				}
 
 				/* enqueue to rx_to_workers ring */
 				ret = rte_ring_enqueue_burst(ring_out,
@@ -473,6 +476,18 @@ rx_thread(struct rte_ring *ring_out)
 	return 0;
 }
 
+static __rte_noinline int
+rx_thread_reorder(struct rte_ring *ring_out)
+{
+	return rx_thread(ring_out, false);
+}
+
+static __rte_noinline int
+rx_thread_reorder_disabled(struct rte_ring *ring_out)
+{
+	return rx_thread(ring_out, true);
+}
+
 /**
  * This thread takes bursts of packets from the rx_to_workers ring and
  * Changes the input port value to output port value. And feds it to
@@ -772,8 +787,11 @@ main(int argc, char **argv)
 				(void *)&send_args, last_lcore_id);
 	}
 
-	/* Start rx_thread() on the main core */
-	rx_thread(rx_to_workers);
+	/* Start rx_thread_xxx() on the main core */
+	if (disable_reorder)
+		rx_thread_reorder_disabled(rx_to_workers);
+	else
+		rx_thread_reorder(rx_to_workers);
 
 	RTE_LCORE_FOREACH_WORKER(lcore_id) {
 		if (rte_eal_wait_lcore(lcore_id) < 0)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.152866717 +0800
+++ 0069-examples-packet_ordering-fix-Rx-with-reorder-mode-di.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 7ba49dc729937ea97642a615e9b08f33919b94f4 Mon Sep 17 00:00:00 2001
+From 10296d5f506e4ad4e5c7bb2c32a1f6369ffdcd9c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7ba49dc729937ea97642a615e9b08f33919b94f4 ]
@@ -25,2 +27,0 @@
-Cc: stable@dpdk.org
-
@@ -35 +36 @@
-index 1b346f630f..55913d0450 100644
+index 9541b3b02e..daa1f52205 100644
@@ -38 +39 @@
-@@ -1142,6 +1142,7 @@ Przemyslaw Czesnowicz <przemyslaw.czesnowicz@intel.com>
+@@ -1131,6 +1131,7 @@ Przemyslaw Czesnowicz <przemyslaw.czesnowicz@intel.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/l3fwd: fix Rx over not ready port' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (67 preceding siblings ...)
  2024-04-13 12:49   ` patch 'examples/packet_ordering: fix Rx with reorder mode disabled' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'dts: fix smoke tests driver regex' " Xueming Li
                     ` (54 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: Konstantin Ananyev, Pavan Nikhilesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ce95b8c9cd764820f0364755f97809549f58e76f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ce95b8c9cd764820f0364755f97809549f58e76f Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Date: Fri, 1 Mar 2024 16:39:31 +0000
Subject: [PATCH] examples/l3fwd: fix Rx over not ready port
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 495709d32be87cb962c55917b19ad7d4489cde3e ]

Running l3fwd in event mode with SW eventdev, service cores
can start RX before main thread is finished with PMD installation.
to reproduce:
./dpdk-l3fwd --lcores=49,51 -n 6 -a ca:00.0 -s 0x8000000000000 \
--vdev event_sw0 -- \
-L -P -p 1  --mode eventdev --eventq-sched=ordered \
--rule_ipv4=test/l3fwd_lpm_v4_u1.cfg --rule_ipv6=test/l3fwd_lpm_v6_u1.cfg \
--no-numa

At init stage user will most likely see the error message like that:
ETHDEV: lcore 51 called rx_pkt_burst for not ready port 0
0: ./dpdk-l3fwd (rte_dump_stack+0x1f) [15de723]
...
9: ./dpdk-l3fwd (eal_thread_loop+0x5a2) [15c1324]
...

And then all depends how luck/unlucky you are.
If there are some actual packet in HW RX queue, then the app will most
likely crash, otherwise it might survive.
As error message suggests, the problem is that services are started
before main thread finished with NIC setup and initialization.
The suggested fix moves services startup after NIC setup phase.

Bugzilla ID: 1390
Fixes: 8bd537e9c6cf ("examples/l3fwd: add service core setup based on caps")

Signed-off-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l3fwd/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 3bf28aec0c..d4fb5d1971 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1577,7 +1577,6 @@ main(int argc, char **argv)
 			l3fwd_lkp.main_loop = evt_rsrc->ops.fib_event_loop;
 		else
 			l3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop;
-		l3fwd_event_service_setup();
 	} else
 #endif
 		l3fwd_poll_resource_setup();
@@ -1609,6 +1608,11 @@ main(int argc, char **argv)
 		}
 	}
 
+#ifdef RTE_LIB_EVENTDEV
+	if (evt_rsrc->enabled)
+		l3fwd_event_service_setup();
+#endif
+
 	printf("\n");
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.179359982 +0800
+++ 0070-examples-l3fwd-fix-Rx-over-not-ready-port.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 495709d32be87cb962c55917b19ad7d4489cde3e Mon Sep 17 00:00:00 2001
+From ce95b8c9cd764820f0364755f97809549f58e76f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 495709d32be87cb962c55917b19ad7d4489cde3e ]
@@ -31 +33,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'dts: fix smoke tests driver regex' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (68 preceding siblings ...)
  2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx over not ready port' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx queue configuration' " Xueming Li
                     ` (53 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: Jeremy Spewock, Nicholas Pratte, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2f8836901cbbe9221ab2495ef5ee3caf4e76d2b7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2f8836901cbbe9221ab2495ef5ee3caf4e76d2b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
Date: Fri, 23 Feb 2024 09:30:01 +0100
Subject: [PATCH] dts: fix smoke tests driver regex
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 409359adce43360a77c2675ff0e228da67ae3c96 ]

Add hyphen to the regex, which is needed for drivers such as vfio-pci.

Fixes: 88489c0501af ("dts: add smoke tests")

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>
Tested-by: Nicholas Pratte <npratte@iol.unh.edu>
---
 .mailmap                           | 1 +
 dts/tests/TestSuite_smoke_tests.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index daa1f52205..f76fef1c48 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1013,6 +1013,7 @@ Nemanja Marjanovic <nemanja.marjanovic@intel.com>
 Netanel Belgazal <netanel@amazon.com>
 Netanel Gonen <netanelg@mellanox.com>
 Niall Power <niall.power@intel.com>
+Nicholas Pratte <npratte@iol.unh.edu>
 Nick Connolly <nick.connolly@mayadata.io>
 Nick Nunley <nicholas.d.nunley@intel.com>
 Niclas Storm <niclas.storm@ericsson.com>
diff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke_tests.py
index 8958f58dac..5e897cf5d2 100644
--- a/dts/tests/TestSuite_smoke_tests.py
+++ b/dts/tests/TestSuite_smoke_tests.py
@@ -91,7 +91,7 @@ class SmokeTests(TestSuite):
             # with the address for the nic we are on in the loop and then captures the
             # name of the driver in a group
             devbind_info_for_nic = re.search(
-                f"{nic.pci}[^\\n]*drv=([\\d\\w]*) [^\\n]*",
+                f"{nic.pci}[^\\n]*drv=([\\d\\w-]*) [^\\n]*",
                 all_nics_in_dpdk_devbind,
             )
             self.verify(
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.204000550 +0800
+++ 0071-dts-fix-smoke-tests-driver-regex.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 409359adce43360a77c2675ff0e228da67ae3c96 Mon Sep 17 00:00:00 2001
+From 2f8836901cbbe9221ab2495ef5ee3caf4e76d2b7 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 409359adce43360a77c2675ff0e228da67ae3c96 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 55913d0450..68b4cae8d3 100644
+index daa1f52205..f76fef1c48 100644
@@ -26 +28 @@
-@@ -1020,6 +1020,7 @@ Nemanja Marjanovic <nemanja.marjanovic@intel.com>
+@@ -1013,6 +1013,7 @@ Nemanja Marjanovic <nemanja.marjanovic@intel.com>
@@ -35 +37 @@
-index 5e2bac14bd..1be5c3047e 100644
+index 8958f58dac..5e897cf5d2 100644
@@ -38 +40 @@
-@@ -130,7 +130,7 @@ class SmokeTests(TestSuite):
+@@ -91,7 +91,7 @@ class SmokeTests(TestSuite):

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/l3fwd: fix Rx queue configuration' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (69 preceding siblings ...)
  2024-04-13 12:49   ` patch 'dts: fix smoke tests driver regex' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/virtio: fix vDPA device init advertising control queue' " Xueming Li
                     ` (52 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Kamil Vojanec; +Cc: Konstantin Ananyev, Kevin Traynor, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=587143897e3f081134d895adb59526e748d8e7f6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 587143897e3f081134d895adb59526e748d8e7f6 Mon Sep 17 00:00:00 2001
From: Kamil Vojanec <vojanec@cesnet.cz>
Date: Fri, 16 Feb 2024 13:02:07 +0100
Subject: [PATCH] examples/l3fwd: fix Rx queue configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7015f232adf0e1622822660afc70055bf359bd7a ]

When configuring Rx queues, the default port configuration was used,
even though it was modified before. This results in the
'relax-rx-offload' not being respected for Rx queues.
This commit uses 'rte_eth_dev_conf_get()' to obtain the device
configuration structure instead.

Fixes: 4b01cabfb09b ("examples/l3fwd: add option to relax Rx offload")

Signed-off-by: Kamil Vojanec <vojanec@cesnet.cz>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 .mailmap              | 2 +-
 examples/l3fwd/main.c | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index f76fef1c48..debb7beb5f 100644
--- a/.mailmap
+++ b/.mailmap
@@ -723,7 +723,7 @@ Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
 Kamil Bednarczyk <kamil.bednarczyk@intel.com>
 Kamil Chalupnik <kamilx.chalupnik@intel.com>
 Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
-Kamil Vojanec <xvojan00@stud.fit.vutbr.cz>
+Kamil Vojanec <vojanec@cesnet.cz> <xvojan00@stud.fit.vutbr.cz>
 Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
 Karen Kelly <karen.kelly@intel.com>
 Karen Sornek <karen.sornek@intel.com>
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index d4fb5d1971..8d32ae1dd5 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1388,6 +1388,7 @@ l3fwd_poll_resource_setup(void)
 		fflush(stdout);
 		/* init RX queues */
 		for(queue = 0; queue < qconf->n_rx_queue; ++queue) {
+			struct rte_eth_conf local_conf;
 			struct rte_eth_rxconf rxq_conf;
 
 			portid = qconf->rx_queue_list[queue].port_id;
@@ -1408,8 +1409,14 @@ l3fwd_poll_resource_setup(void)
 					"Error during getting device (port %u) info: %s\n",
 					portid, strerror(-ret));
 
+			ret = rte_eth_dev_conf_get(portid, &local_conf);
+			if (ret != 0)
+				rte_exit(EXIT_FAILURE,
+					"Error during getting device (port %u) configuration: %s\n",
+					portid, strerror(-ret));
+
 			rxq_conf = dev_info.default_rxconf;
-			rxq_conf.offloads = port_conf.rxmode.offloads;
+			rxq_conf.offloads = local_conf.rxmode.offloads;
 			if (!per_port_pool)
 				ret = rte_eth_rx_queue_setup(portid, queueid,
 						nb_rxd, socketid,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.229162617 +0800
+++ 0072-examples-l3fwd-fix-Rx-queue-configuration.patch	2024-04-13 20:43:05.017753905 +0800
@@ -1 +1 @@
-From 7015f232adf0e1622822660afc70055bf359bd7a Mon Sep 17 00:00:00 2001
+From 587143897e3f081134d895adb59526e748d8e7f6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7015f232adf0e1622822660afc70055bf359bd7a ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 68b4cae8d3..66ebc20666 100644
+index f76fef1c48..debb7beb5f 100644
@@ -27 +29 @@
-@@ -728,7 +728,7 @@ Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
+@@ -723,7 +723,7 @@ Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/virtio: fix vDPA device init advertising control queue' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (70 preceding siblings ...)
  2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx queue configuration' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'build: pass cflags in subproject' " Xueming Li
                     ` (51 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7105c8a2997b364313c06f7d4cbc62a64eb61dec

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7105c8a2997b364313c06f7d4cbc62a64eb61dec Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Wed, 13 Mar 2024 13:59:31 +0100
Subject: [PATCH] net/virtio: fix vDPA device init advertising control queue
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 58c894154165f24de8344383e2d1d5cccf4a42bc ]

If the vDPA device advertises control queue support, but
the user neither passes "cq=1" as devarg nor requests
multiple queues, the initialization fails because the
driver tries to setup the control queue without negotiating
related feature.

This patch enables the control queue at driver level as
soon as the device claims to support it, and not only when
multiple queue pairs are requested. Also, enable the
control queue event if multiqueue feature has not been
negotiated and device start time, and disable it at device
stop time.

Fixes: b277308e8868 ("net/virtio-user: advertise control VQ support with vDPA")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 .../net/virtio/virtio_user/virtio_user_dev.c  | 22 ++++++++++++++-----
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index af1f8c8237..4fd89a8e97 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -215,6 +215,12 @@ virtio_user_start_device(struct virtio_user_dev *dev)
 	if (ret < 0)
 		goto error;
 
+	if (dev->scvq) {
+		ret = dev->ops->cvq_enable(dev, 1);
+		if (ret < 0)
+			goto error;
+	}
+
 	dev->started = true;
 
 	pthread_mutex_unlock(&dev->mutex);
@@ -247,6 +253,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
 			goto err;
 	}
 
+	if (dev->scvq) {
+		ret = dev->ops->cvq_enable(dev, 0);
+		if (ret < 0)
+			goto err;
+	}
+
 	/* Stop the backend. */
 	for (i = 0; i < dev->max_queue_pairs * 2; ++i) {
 		state.index = i;
@@ -725,7 +737,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
 	if (virtio_user_dev_init_max_queue_pairs(dev, queues))
 		dev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ);
 
-	if (dev->max_queue_pairs > 1)
+	if (dev->max_queue_pairs > 1 || dev->hw_cvq)
 		cq = 1;
 
 	if (!mrg_rxbuf)
@@ -743,8 +755,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
 		dev->unsupported_features |= (1ull << VIRTIO_NET_F_MAC);
 
 	if (cq) {
-		/* device does not really need to know anything about CQ,
-		 * so if necessary, we just claim to support CQ
+		/* Except for vDPA, the device does not really need to know
+		 * anything about CQ, so if necessary, we just claim to support
+		 * control queue.
 		 */
 		dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
 	} else {
@@ -844,9 +857,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)
 	for (i = q_pairs; i < dev->max_queue_pairs; ++i)
 		ret |= dev->ops->enable_qp(dev, i, 0);
 
-	if (dev->scvq)
-		ret |= dev->ops->cvq_enable(dev, 1);
-
 	dev->queue_pairs = q_pairs;
 
 	return ret;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.252100287 +0800
+++ 0073-net-virtio-fix-vDPA-device-init-advertising-control-.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From 58c894154165f24de8344383e2d1d5cccf4a42bc Mon Sep 17 00:00:00 2001
+From 7105c8a2997b364313c06f7d4cbc62a64eb61dec Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 58c894154165f24de8344383e2d1d5cccf4a42bc ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index d395fc1676..54187fedf5 100644
+index af1f8c8237..4fd89a8e97 100644
@@ -32 +34 @@
-@@ -216,6 +216,12 @@ virtio_user_start_device(struct virtio_user_dev *dev)
+@@ -215,6 +215,12 @@ virtio_user_start_device(struct virtio_user_dev *dev)
@@ -45 +47 @@
-@@ -248,6 +254,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
+@@ -247,6 +253,12 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)
@@ -58 +60 @@
-@@ -752,7 +764,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
+@@ -725,7 +737,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
@@ -67 +69 @@
-@@ -770,8 +782,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
+@@ -743,8 +755,9 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, uint16_t queues,
@@ -79 +81 @@
-@@ -871,9 +884,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)
+@@ -844,9 +857,6 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'build: pass cflags in subproject' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (71 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/virtio: fix vDPA device init advertising control queue' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' " Xueming Li
                     ` (50 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Robin Jarry; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9796ac2ab87502888fc1a1d7252233d132b6ae41

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9796ac2ab87502888fc1a1d7252233d132b6ae41 Mon Sep 17 00:00:00 2001
From: Robin Jarry <rjarry@redhat.com>
Date: Fri, 8 Mar 2024 12:58:40 +0100
Subject: [PATCH] build: pass cflags in subproject
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3f9aa55632bd272981471516608a7eaf543bea37 ]

When DPDK is used as a subproject, include the required compile
arguments so that the parent project is also built with the appropriate
cflags (most importantly -march). Use the same cflags as pkg-config.

Fixes: f93a605f2d6e ("build: add definitions for use as Meson subproject")

Signed-off-by: Robin Jarry <rjarry@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/subproject/meson.build | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/buildtools/subproject/meson.build b/buildtools/subproject/meson.build
index 322e01c029..203c5d36c6 100644
--- a/buildtools/subproject/meson.build
+++ b/buildtools/subproject/meson.build
@@ -2,10 +2,15 @@
 # Copyright(c) 2022 Intel Corporation
 
 message('DPDK subproject linking: ' + get_option('default_library'))
+subproject_cflags = ['-include', 'rte_config.h'] + machine_args
+if is_freebsd
+    subproject_cflags += ['-D__BSD_VISIBLE']
+endif
 if get_option('default_library') == 'static'
     dpdk_dep = declare_dependency(
             version: meson.project_version(),
             dependencies: dpdk_static_lib_deps,
+            compile_args: subproject_cflags,
             # static library deps in DPDK build don't include "link_with" parameters,
             # so explicitly link-in both libs and drivers
             link_whole: dpdk_static_libraries + dpdk_drivers,
@@ -13,6 +18,7 @@ if get_option('default_library') == 'static'
 else
     dpdk_dep = declare_dependency(
             version: meson.project_version(),
+            compile_args: subproject_cflags,
             # shared library deps include all necessary linking parameters
             dependencies: dpdk_shared_lib_deps)
 endif
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.277467454 +0800
+++ 0074-build-pass-cflags-in-subproject.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From 3f9aa55632bd272981471516608a7eaf543bea37 Mon Sep 17 00:00:00 2001
+From 9796ac2ab87502888fc1a1d7252233d132b6ae41 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3f9aa55632bd272981471516608a7eaf543bea37 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (72 preceding siblings ...)
  2024-04-13 12:49   ` patch 'build: pass cflags in subproject' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'crypto/qat: fix crash with CCM null AAD pointer' " Xueming Li
                     ` (49 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Radu Nicolau; +Cc: Ting-Kai Ku, Ciara Power, Kai Ji, Anoob Joseph, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=90d0e13d7d2651f8a32c66378d23605cd664c446

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 90d0e13d7d2651f8a32c66378d23605cd664c446 Mon Sep 17 00:00:00 2001
From: Radu Nicolau <radu.nicolau@intel.com>
Date: Tue, 27 Feb 2024 13:28:46 +0000
Subject: [PATCH] examples/ipsec-secgw: fix cryptodev to SA mapping
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ]

There are use cases where a SA should be able to use different
cryptodevs on different lcores, for example there can be cryptodevs
with just 1 qp per VF.
Hence, the check in create lookaside session function is relaxed.
Also added a check to verify that a CQP is available for the current lcore.

Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Tested-by: Ting-Kai Ku <ting-kai.ku@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
---
 .mailmap                     |  1 +
 examples/ipsec-secgw/ipsec.c | 20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index debb7beb5f..3b32923fef 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1431,6 +1431,7 @@ Timothy McDaniel <timothy.mcdaniel@intel.com>
 Timothy Miskell <timothy.miskell@intel.com>
 Timothy Redaelli <tredaelli@redhat.com>
 Tim Shearer <tim.shearer@overturenetworks.com>
+Ting-Kai Ku <ting-kai.ku@intel.com>
 Ting Xu <ting.xu@intel.com>
 Tiwei Bie <tiwei.bie@intel.com> <btw@mail.ustc.edu.cn>
 Todd Fujinaka <todd.fujinaka@intel.com>
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index f5cec4a928..c321108119 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -288,10 +288,21 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
 		if (cdev_id == RTE_CRYPTO_MAX_DEVS)
 			cdev_id = ipsec_ctx->tbl[cdev_id_qp].id;
 		else if (cdev_id != ipsec_ctx->tbl[cdev_id_qp].id) {
-			RTE_LOG(ERR, IPSEC,
-					"SA mapping to multiple cryptodevs is "
-					"not supported!");
-			return -EINVAL;
+			struct rte_cryptodev_info dev_info_1, dev_info_2;
+			rte_cryptodev_info_get(cdev_id, &dev_info_1);
+			rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id,
+					&dev_info_2);
+			if (dev_info_1.driver_id == dev_info_2.driver_id) {
+				RTE_LOG(WARNING, IPSEC,
+					"SA mapped to multiple cryptodevs for SPI %d\n",
+					sa->spi);
+
+			} else {
+				RTE_LOG(WARNING, IPSEC,
+					"SA mapped to multiple cryptodevs of different types for SPI %d\n",
+					sa->spi);
+
+			}
 		}
 
 		/* Store per core queue pair information */
@@ -908,6 +919,7 @@ ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
 			continue;
 		}
 
+		RTE_ASSERT(sa->cqp[ipsec_ctx->lcore_id] != NULL);
 		enqueue_cop(sa->cqp[ipsec_ctx->lcore_id], &priv->cop);
 	}
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.299143126 +0800
+++ 0075-examples-ipsec-secgw-fix-cryptodev-to-SA-mapping.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From f406064ff0988a53f955c74a672d696c595dc0f0 Mon Sep 17 00:00:00 2001
+From 90d0e13d7d2651f8a32c66378d23605cd664c446 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f406064ff0988a53f955c74a672d696c595dc0f0 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 66ebc20666..50726e1232 100644
+index debb7beb5f..3b32923fef 100644
@@ -29 +31 @@
-@@ -1442,6 +1442,7 @@ Timothy McDaniel <timothy.mcdaniel@intel.com>
+@@ -1431,6 +1431,7 @@ Timothy McDaniel <timothy.mcdaniel@intel.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'crypto/qat: fix crash with CCM null AAD pointer' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (73 preceding siblings ...)
  2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/hns3: enable PFC for all user priorities' " Xueming Li
                     ` (48 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Arkadiusz Kusztal; +Cc: Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=72d3dfa9decb8de97c99c5c5ac2cd26413290d7e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 72d3dfa9decb8de97c99c5c5ac2cd26413290d7e Mon Sep 17 00:00:00 2001
From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Date: Fri, 8 Mar 2024 08:25:12 +0000
Subject: [PATCH] crypto/qat: fix crash with CCM null AAD pointer
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e90ef1803bb34768d1446e756046020e8cbce4bc ]

This commit fixes a segfault, that occurs when NULL pointer
is being set to the AAD pointer field.

Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request")

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
index b8ddf42d6f..24044bec13 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
@@ -894,10 +894,12 @@ enqueue_one_aead_job_gen1(struct qat_sym_session *ctx,
 		*(uint8_t *)&cipher_param->u.cipher_IV_array[0] =
 			q - ICP_QAT_HW_CCM_NONCE_OFFSET;
 
-		rte_memcpy((uint8_t *)aad->va +
-				ICP_QAT_HW_CCM_NONCE_OFFSET,
-			(uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET,
-			ctx->cipher_iv.length);
+		if (ctx->aad_len > 0) {
+			rte_memcpy((uint8_t *)aad->va +
+					ICP_QAT_HW_CCM_NONCE_OFFSET,
+				(uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET,
+				ctx->cipher_iv.length);
+		}
 		break;
 	default:
 		break;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.327076989 +0800
+++ 0076-crypto-qat-fix-crash-with-CCM-null-AAD-pointer.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From e90ef1803bb34768d1446e756046020e8cbce4bc Mon Sep 17 00:00:00 2001
+From 72d3dfa9decb8de97c99c5c5ac2cd26413290d7e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e90ef1803bb34768d1446e756046020e8cbce4bc ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 60b0f0551c..1f5d2583c4 100644
+index b8ddf42d6f..24044bec13 100644
@@ -22 +24 @@
-@@ -925,10 +925,12 @@ enqueue_one_aead_job_gen1(struct qat_sym_session *ctx,
+@@ -894,10 +894,12 @@ enqueue_one_aead_job_gen1(struct qat_sym_session *ctx,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: enable PFC for all user priorities' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (74 preceding siblings ...)
  2024-04-13 12:49   ` patch 'crypto/qat: fix crash with CCM null AAD pointer' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'doc: add traffic manager in features table' " Xueming Li
                     ` (47 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Jie Hai; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cadb90f7119a2b3e45df919f941feab9029fe92f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cadb90f7119a2b3e45df919f941feab9029fe92f Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Wed, 6 Mar 2024 17:20:47 +0800
Subject: [PATCH] net/hns3: enable PFC for all user priorities
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit aae6989df36c105b917cf69975c075dfde2e6b84 ]

When user set TC number to 4 and enable PFC and ETS by dev_configure,
driver only enable user priority 0-3.
The packet with user priority 4-7 cannot trigger PFC frame.

Fix by enabling PFC for all user priorities.

By the way, the nb_tcs from user can never be 0 because of the ahead
check in driver. So remove this redundant code.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 drivers/net/hns3/hns3_dcb.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c
index 2831d3dc62..915e4eb768 100644
--- a/drivers/net/hns3/hns3_dcb.c
+++ b/drivers/net/hns3/hns3_dcb.c
@@ -1499,7 +1499,6 @@ hns3_dcb_info_update(struct hns3_adapter *hns, uint8_t num_tc)
 static int
 hns3_dcb_hw_configure(struct hns3_adapter *hns)
 {
-	struct rte_eth_dcb_rx_conf *dcb_rx_conf;
 	struct hns3_pf *pf = &hns->pf;
 	struct hns3_hw *hw = &hns->hw;
 	enum hns3_fc_status fc_status = hw->current_fc_status;
@@ -1519,12 +1518,8 @@ hns3_dcb_hw_configure(struct hns3_adapter *hns)
 	}
 
 	if (hw->data->dev_conf.dcb_capability_en & RTE_ETH_DCB_PFC_SUPPORT) {
-		dcb_rx_conf = &hw->data->dev_conf.rx_adv_conf.dcb_rx_conf;
-		if (dcb_rx_conf->nb_tcs == 0)
-			hw->dcb_info.pfc_en = 1; /* tc0 only */
-		else
-			hw->dcb_info.pfc_en =
-			RTE_LEN2MASK((uint8_t)dcb_rx_conf->nb_tcs, uint8_t);
+		hw->dcb_info.pfc_en =
+			RTE_LEN2MASK((uint8_t)HNS3_MAX_USER_PRIO, uint8_t);
 
 		hw->dcb_info.hw_pfc_map =
 				hns3_dcb_undrop_tc_map(hw, hw->dcb_info.pfc_en);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.358308448 +0800
+++ 0077-net-hns3-enable-PFC-for-all-user-priorities.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From aae6989df36c105b917cf69975c075dfde2e6b84 Mon Sep 17 00:00:00 2001
+From cadb90f7119a2b3e45df919f941feab9029fe92f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit aae6989df36c105b917cf69975c075dfde2e6b84 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: add traffic manager in features table' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (75 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/hns3: enable PFC for all user priorities' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'app/testpmd: fix async indirect action list creation' " Xueming Li
                     ` (46 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Huisong Li
  Cc: Chengwen Feng, Ferruh Yigit, Hemant Agrawal, Cristian Dumitrescu,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=166c5df81008cb833c577cc868dfad6bc79b155c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 166c5df81008cb833c577cc868dfad6bc79b155c Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 28 Nov 2023 20:40:56 +0800
Subject: [PATCH] doc: add traffic manager in features table
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a905e821007e884355e01289bdc67c3548591fec ]

Add Traffic Manager feature.

Fixes: 5d109deffa87 ("ethdev: add traffic management API")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 doc/guides/nics/features.rst         | 13 +++++++++++++
 doc/guides/nics/features/cnxk.ini    |  1 +
 doc/guides/nics/features/default.ini |  1 +
 doc/guides/nics/features/dpaa2.ini   |  1 +
 doc/guides/nics/features/hns3.ini    |  1 +
 doc/guides/nics/features/i40e.ini    |  1 +
 doc/guides/nics/features/iavf.ini    |  3 ++-
 doc/guides/nics/features/ice.ini     |  1 +
 doc/guides/nics/features/ice_dcf.ini |  1 +
 doc/guides/nics/features/ipn3ke.ini  |  1 +
 doc/guides/nics/features/ixgbe.ini   |  1 +
 doc/guides/nics/features/mvpp2.ini   |  3 ++-
 doc/guides/nics/features/txgbe.ini   |  1 +
 13 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index f7d9980849..966b3e17d1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -751,6 +751,19 @@ Supports congestion management.
   ``rte_eth_cman_config_set()``, ``rte_eth_cman_config_get()``.
 
 
+.. _nic_features_traffic_manager:
+
+Traffic manager
+---------------
+
+Supports Traffic manager.
+
+* **[implements] rte_tm_ops**: ``capabilities_get``, ``shaper_profile_add``,
+  ``hierarchy_commit`` and so on.
+* **[related]    API**: ``rte_tm_capabilities_get()``, ``rte_tm_shaper_profile_add()``,
+  ``rte_tm_hierarchy_commit()`` and so on.
+
+
 .. _nic_features_fw_version:
 
 FW version
diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index ac7de9a0f0..f85813ab52 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -28,6 +28,7 @@ RSS key update       = Y
 RSS reta update      = Y
 Inner RSS            = Y
 Congestion management = Y
+Traffic manager      = Y
 Inline protocol      = Y
 Flow control         = Y
 Scattered Rx         = Y
diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 806cb033ff..64ee0f8c2f 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -42,6 +42,7 @@ VLAN filter          =
 Flow control         =
 Rate limitation      =
 Congestion management =
+Traffic manager      =
 Inline crypto        =
 Inline protocol      =
 CRC offload          =
diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini
index 26dc8c2178..f02da463d9 100644
--- a/doc/guides/nics/features/dpaa2.ini
+++ b/doc/guides/nics/features/dpaa2.ini
@@ -17,6 +17,7 @@ Unicast MAC filter   = Y
 RSS hash             = Y
 VLAN filter          = Y
 Flow control         = Y
+Traffic manager      = Y
 VLAN offload         = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini
index 338b4e6864..a20ece20e8 100644
--- a/doc/guides/nics/features/hns3.ini
+++ b/doc/guides/nics/features/hns3.ini
@@ -28,6 +28,7 @@ RSS reta update      = Y
 DCB                  = Y
 VLAN filter          = Y
 Flow control         = Y
+Traffic manager      = Y
 CRC offload          = Y
 VLAN offload         = Y
 FEC                  = Y
diff --git a/doc/guides/nics/features/i40e.ini b/doc/guides/nics/features/i40e.ini
index e241dad047..2d168199f0 100644
--- a/doc/guides/nics/features/i40e.ini
+++ b/doc/guides/nics/features/i40e.ini
@@ -27,6 +27,7 @@ SR-IOV               = Y
 DCB                  = Y
 VLAN filter          = Y
 Flow control         = Y
+Traffic manager      = Y
 CRC offload          = Y
 VLAN offload         = Y
 QinQ offload         = P
diff --git a/doc/guides/nics/features/iavf.ini b/doc/guides/nics/features/iavf.ini
index db4f92ce71..c59115ae15 100644
--- a/doc/guides/nics/features/iavf.ini
+++ b/doc/guides/nics/features/iavf.ini
@@ -25,6 +25,8 @@ RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
 VLAN filter          = Y
+Traffic manager      = Y
+Inline crypto        = Y
 CRC offload          = Y
 VLAN offload         = P
 L3 checksum offload  = Y
@@ -35,7 +37,6 @@ Inner L4 checksum    = Y
 Packet type parsing  = Y
 Rx descriptor status = Y
 Tx descriptor status = Y
-Inline crypto        = Y
 Basic stats          = Y
 Multiprocess aware   = Y
 FreeBSD              = Y
diff --git a/doc/guides/nics/features/ice.ini b/doc/guides/nics/features/ice.ini
index 13f8871dcc..8febbc4f1e 100644
--- a/doc/guides/nics/features/ice.ini
+++ b/doc/guides/nics/features/ice.ini
@@ -26,6 +26,7 @@ RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
 VLAN filter          = Y
+Traffic manager      = Y
 CRC offload          = Y
 VLAN offload         = Y
 QinQ offload         = P
diff --git a/doc/guides/nics/features/ice_dcf.ini b/doc/guides/nics/features/ice_dcf.ini
index 3b11622d4c..0e86338990 100644
--- a/doc/guides/nics/features/ice_dcf.ini
+++ b/doc/guides/nics/features/ice_dcf.ini
@@ -22,6 +22,7 @@ Promiscuous mode     = Y
 Allmulticast mode    = Y
 Unicast MAC filter   = Y
 VLAN filter          = Y
+Traffic manager      = Y
 VLAN offload         = Y
 Extended stats       = Y
 Basic stats          = Y
diff --git a/doc/guides/nics/features/ipn3ke.ini b/doc/guides/nics/features/ipn3ke.ini
index 1f6b780273..e412978820 100644
--- a/doc/guides/nics/features/ipn3ke.ini
+++ b/doc/guides/nics/features/ipn3ke.ini
@@ -25,6 +25,7 @@ SR-IOV               = Y
 DCB                  = Y
 VLAN filter          = Y
 Flow control         = Y
+Traffic manager      = Y
 CRC offload          = Y
 VLAN offload         = Y
 QinQ offload         = Y
diff --git a/doc/guides/nics/features/ixgbe.ini b/doc/guides/nics/features/ixgbe.ini
index 8590ac857f..f05fcec455 100644
--- a/doc/guides/nics/features/ixgbe.ini
+++ b/doc/guides/nics/features/ixgbe.ini
@@ -27,6 +27,7 @@ DCB                  = Y
 VLAN filter          = Y
 Flow control         = Y
 Rate limitation      = Y
+Traffic manager      = Y
 Inline crypto        = Y
 CRC offload          = P
 VLAN offload         = P
diff --git a/doc/guides/nics/features/mvpp2.ini b/doc/guides/nics/features/mvpp2.ini
index 653c9d08cb..ccc2c2d4f8 100644
--- a/doc/guides/nics/features/mvpp2.ini
+++ b/doc/guides/nics/features/mvpp2.ini
@@ -12,8 +12,9 @@ Allmulticast mode    = Y
 Unicast MAC filter   = Y
 Multicast MAC filter = Y
 RSS hash             = Y
-Flow control         = Y
 VLAN filter          = Y
+Flow control         = Y
+Traffic manager      = Y
 CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
diff --git a/doc/guides/nics/features/txgbe.ini b/doc/guides/nics/features/txgbe.ini
index e21083052c..3a11fb2037 100644
--- a/doc/guides/nics/features/txgbe.ini
+++ b/doc/guides/nics/features/txgbe.ini
@@ -26,6 +26,7 @@ DCB                  = Y
 VLAN filter          = Y
 Flow control         = Y
 Rate limitation      = Y
+Traffic manager      = Y
 Inline crypto        = Y
 CRC offload          = P
 VLAN offload         = P
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.384903914 +0800
+++ 0078-doc-add-traffic-manager-in-features-table.patch	2024-04-13 20:43:05.027753892 +0800
@@ -1 +1 @@
-From a905e821007e884355e01289bdc67c3548591fec Mon Sep 17 00:00:00 2001
+From 166c5df81008cb833c577cc868dfad6bc79b155c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a905e821007e884355e01289bdc67c3548591fec ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index 38eba8742c..b4f7f1ee61 100644
+index f7d9980849..966b3e17d1 100644
@@ -36 +38 @@
-@@ -762,6 +762,19 @@ Supports congestion management.
+@@ -751,6 +751,19 @@ Supports congestion management.
@@ -57 +59 @@
-index 1c8db1ad13..2de156c695 100644
+index ac7de9a0f0..f85813ab52 100644
@@ -69 +71 @@
-index e21725bdea..c06b6fea9a 100644
+index 806cb033ff..64ee0f8c2f 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix async indirect action list creation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (76 preceding siblings ...)
  2024-04-13 12:49   ` patch 'doc: add traffic manager in features table' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'doc: add link speeds configuration in features table' " Xueming Li
                     ` (45 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=15952c71eb673ca8ce6acd754bd39ef367896423

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 15952c71eb673ca8ce6acd754bd39ef367896423 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 7 Mar 2024 12:27:11 +0200
Subject: [PATCH] app/testpmd: fix async indirect action list creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c1496cb606875e7fda120a41435731fccff8f664 ]

Testpmd calls the same function to create legacy indirect action and
indirect list action.
The function did not identify required action correctly.

The patch adds the `indirect_list` boolean function parameter that is
derived from the action type.

Fixes: 72a3dec7126f ("ethdev: add indirect flow list action")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 1 +
 app/test-pmd/config.c       | 5 ++---
 app/test-pmd/testpmd.h      | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 5647add29a..b19b3205f0 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -12609,6 +12609,7 @@ cmd_flow_parsed(const struct buffer *in)
 		port_queue_action_handle_create(
 				in->port, in->queue, in->postpone,
 				in->args.vc.attr.group,
+				in->command == QUEUE_INDIRECT_ACTION_LIST_CREATE,
 				&((const struct rte_flow_indir_action_conf) {
 					.ingress = in->args.vc.attr.ingress,
 					.egress = in->args.vc.attr.egress,
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 7c24e401ec..6d605556ff 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2996,6 +2996,7 @@ port_queue_flow_update(portid_t port_id, queueid_t queue_id,
 int
 port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
 				bool postpone, uint32_t id,
+				bool indirect_list,
 				const struct rte_flow_indir_action_conf *conf,
 				const struct rte_flow_action *action)
 {
@@ -3005,8 +3006,6 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
 	int ret;
 	struct rte_flow_error error;
 	struct queue_job *job;
-	bool is_indirect_list = action[1].type != RTE_FLOW_ACTION_TYPE_END;
-
 
 	ret = action_alloc(port_id, id, &pia);
 	if (ret)
@@ -3028,7 +3027,7 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
 	/* Poisoning to make sure PMDs update it in case of error. */
 	memset(&error, 0x88, sizeof(error));
 
-	if (is_indirect_list)
+	if (indirect_list)
 		queue_action_list_handle_create(port_id, queue_id, pia, job,
 						&attr, conf, action, &error);
 	else
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 9b10a9ea1c..5bb1a79330 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -996,6 +996,7 @@ int port_queue_flow_update(portid_t port_id, queueid_t queue_id,
 			   const struct rte_flow_action *actions);
 int port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
 			bool postpone, uint32_t id,
+			bool indirect_list,
 			const struct rte_flow_indir_action_conf *conf,
 			const struct rte_flow_action *action);
 int port_queue_action_handle_destroy(portid_t port_id,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.414113375 +0800
+++ 0079-app-testpmd-fix-async-indirect-action-list-creation.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From c1496cb606875e7fda120a41435731fccff8f664 Mon Sep 17 00:00:00 2001
+From 15952c71eb673ca8ce6acd754bd39ef367896423 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c1496cb606875e7fda120a41435731fccff8f664 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 5f761903c1..fd6c51f72d 100644
+index 5647add29a..b19b3205f0 100644
@@ -28 +30 @@
-@@ -13237,6 +13237,7 @@ cmd_flow_parsed(const struct buffer *in)
+@@ -12609,6 +12609,7 @@ cmd_flow_parsed(const struct buffer *in)
@@ -37 +39 @@
-index 968d2164ab..ba1007ace6 100644
+index 7c24e401ec..6d605556ff 100644
@@ -40 +42 @@
-@@ -3099,6 +3099,7 @@ port_queue_flow_update(portid_t port_id, queueid_t queue_id,
+@@ -2996,6 +2996,7 @@ port_queue_flow_update(portid_t port_id, queueid_t queue_id,
@@ -48 +50 @@
-@@ -3108,8 +3109,6 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
+@@ -3005,8 +3006,6 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
@@ -57 +59 @@
-@@ -3131,7 +3130,7 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
+@@ -3028,7 +3027,7 @@ port_queue_action_handle_create(portid_t port_id, uint32_t queue_id,
@@ -67 +69 @@
-index 55df12033a..0afae7d771 100644
+index 9b10a9ea1c..5bb1a79330 100644
@@ -70 +72 @@
-@@ -1002,6 +1002,7 @@ int port_queue_flow_update(portid_t port_id, queueid_t queue_id,
+@@ -996,6 +996,7 @@ int port_queue_flow_update(portid_t port_id, queueid_t queue_id,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: add link speeds configuration in features table' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (77 preceding siblings ...)
  2024-04-13 12:49   ` patch 'app/testpmd: fix async indirect action list creation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/nfp: fix getting firmware VNIC version' " Xueming Li
                     ` (44 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Huisong Li; +Cc: Chengwen Feng, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5853ebb3b959e581e6d41363e81fed80c5532f54

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5853ebb3b959e581e6d41363e81fed80c5532f54 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 28 Nov 2023 21:00:05 +0800
Subject: [PATCH] doc: add link speeds configuration in features table
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 79758d40007c56231fce3cf1004ae5168616b3aa ]

Add features for link speeds.

Fixes: 82113036e4e5 ("ethdev: redesign link speed config")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/guides/nics/features.rst          | 11 +++++++++++
 doc/guides/nics/features/atlantic.ini |  1 +
 doc/guides/nics/features/bnxt.ini     |  1 +
 doc/guides/nics/features/default.ini  |  1 +
 doc/guides/nics/features/dpaa.ini     |  1 +
 doc/guides/nics/features/hns3.ini     |  1 +
 doc/guides/nics/features/i40e.ini     |  1 +
 doc/guides/nics/features/ice.ini      |  1 +
 doc/guides/nics/features/igb.ini      |  1 +
 doc/guides/nics/features/igc.ini      |  1 +
 doc/guides/nics/features/ionic.ini    |  1 +
 doc/guides/nics/features/ixgbe.ini    |  1 +
 doc/guides/nics/features/ngbe.ini     |  1 +
 doc/guides/nics/features/octeontx.ini |  1 +
 doc/guides/nics/features/sfc.ini      |  1 +
 doc/guides/nics/features/thunderx.ini |  1 +
 doc/guides/nics/features/txgbe.ini    |  1 +
 17 files changed, 27 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 966b3e17d1..cf9fabb8b8 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -34,6 +34,17 @@ Supports getting the speed capabilities that the current device is capable of.
 * **[related]  API**: ``rte_eth_dev_info_get()``.
 
 
+.. _nic_features_link_speeds_config:
+
+Link speed configuration
+------------------------
+
+Supports configurating fixed speed and link autonegotiation.
+
+* **[uses]     user config**: ``dev_conf.link_speeds:RTE_ETH_LINK_SPEED_*``.
+* **[related]  API**: ``rte_eth_dev_configure()``.
+
+
 .. _nic_features_link_status:
 
 Link status
diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/features/atlantic.ini
index ef4155027c..29969c1493 100644
--- a/doc/guides/nics/features/atlantic.ini
+++ b/doc/guides/nics/features/atlantic.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
diff --git a/doc/guides/nics/features/bnxt.ini b/doc/guides/nics/features/bnxt.ini
index bd4e2295dc..c33889663d 100644
--- a/doc/guides/nics/features/bnxt.ini
+++ b/doc/guides/nics/features/bnxt.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 64ee0f8c2f..c30702c72e 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -8,6 +8,7 @@
 ;
 [Features]
 Speed capabilities   =
+Link speed configuration =
 Link status          =
 Link status event    =
 Removal event        =
diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini
index a382c7160c..b136ed191a 100644
--- a/doc/guides/nics/features/dpaa.ini
+++ b/doc/guides/nics/features/dpaa.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Burst mode info      = Y
diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini
index a20ece20e8..8b623d3077 100644
--- a/doc/guides/nics/features/hns3.ini
+++ b/doc/guides/nics/features/hns3.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/i40e.ini b/doc/guides/nics/features/i40e.ini
index 2d168199f0..ef7514c44b 100644
--- a/doc/guides/nics/features/i40e.ini
+++ b/doc/guides/nics/features/i40e.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/ice.ini b/doc/guides/nics/features/ice.ini
index 8febbc4f1e..62869ef0a0 100644
--- a/doc/guides/nics/features/ice.ini
+++ b/doc/guides/nics/features/ice.ini
@@ -8,6 +8,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/igb.ini b/doc/guides/nics/features/igb.ini
index 7b4af6f86c..ee2408f3ee 100644
--- a/doc/guides/nics/features/igb.ini
+++ b/doc/guides/nics/features/igb.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = P
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/igc.ini b/doc/guides/nics/features/igc.ini
index 47d9344435..d6db18c1e8 100644
--- a/doc/guides/nics/features/igc.ini
+++ b/doc/guides/nics/features/igc.ini
@@ -4,6 +4,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 FW version           = Y
diff --git a/doc/guides/nics/features/ionic.ini b/doc/guides/nics/features/ionic.ini
index af0fc5462a..64b2316288 100644
--- a/doc/guides/nics/features/ionic.ini
+++ b/doc/guides/nics/features/ionic.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Fast mbuf free       = Y
diff --git a/doc/guides/nics/features/ixgbe.ini b/doc/guides/nics/features/ixgbe.ini
index f05fcec455..cb9331dbcd 100644
--- a/doc/guides/nics/features/ixgbe.ini
+++ b/doc/guides/nics/features/ixgbe.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/ngbe.ini b/doc/guides/nics/features/ngbe.ini
index 2701c5f051..1dfd92e96b 100644
--- a/doc/guides/nics/features/ngbe.ini
+++ b/doc/guides/nics/features/ngbe.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Free Tx mbuf on demand = Y
diff --git a/doc/guides/nics/features/octeontx.ini b/doc/guides/nics/features/octeontx.ini
index fa1e18b120..46ae8318a9 100644
--- a/doc/guides/nics/features/octeontx.ini
+++ b/doc/guides/nics/features/octeontx.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Lock-free Tx queue   = Y
diff --git a/doc/guides/nics/features/sfc.ini b/doc/guides/nics/features/sfc.ini
index 8a9198adcb..f9654e69ed 100644
--- a/doc/guides/nics/features/sfc.ini
+++ b/doc/guides/nics/features/sfc.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
diff --git a/doc/guides/nics/features/thunderx.ini b/doc/guides/nics/features/thunderx.ini
index b33bb37c82..2ab8db7239 100644
--- a/doc/guides/nics/features/thunderx.ini
+++ b/doc/guides/nics/features/thunderx.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
diff --git a/doc/guides/nics/features/txgbe.ini b/doc/guides/nics/features/txgbe.ini
index 3a11fb2037..be0af3dfad 100644
--- a/doc/guides/nics/features/txgbe.ini
+++ b/doc/guides/nics/features/txgbe.ini
@@ -5,6 +5,7 @@
 ;
 [Features]
 Speed capabilities   = Y
+Link speed configuration = Y
 Link status          = Y
 Link status event    = Y
 Rx interrupt         = Y
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.453206124 +0800
+++ 0080-doc-add-link-speeds-configuration-in-features-table.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 79758d40007c56231fce3cf1004ae5168616b3aa Mon Sep 17 00:00:00 2001
+From 5853ebb3b959e581e6d41363e81fed80c5532f54 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 79758d40007c56231fce3cf1004ae5168616b3aa ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -35 +37 @@
-index b4f7f1ee61..cd0115ffb3 100644
+index 966b3e17d1..cf9fabb8b8 100644
@@ -81 +83 @@
-index c06b6fea9a..1e9a156a2a 100644
+index 64ee0f8c2f..c30702c72e 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix getting firmware VNIC version' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (78 preceding siblings ...)
  2024-04-13 12:49   ` patch 'doc: add link speeds configuration in features table' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/nfp: fix IPsec data endianness' " Xueming Li
                     ` (43 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Qin Ke; +Cc: Chaoyong He, Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=bec3117648637d45e894bde55adea7c2be1a9851

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bec3117648637d45e894bde55adea7c2be1a9851 Mon Sep 17 00:00:00 2001
From: Qin Ke <qin.ke@corigine.com>
Date: Mon, 11 Mar 2024 09:54:14 +0800
Subject: [PATCH] net/nfp: fix getting firmware VNIC version
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e72d6053a945b71348f5874cca6cd0be89eed8e0 ]

When getting firmware VNIC version, the logic for representor
ports and other ports is inverse, fix it.

Fixes: c4de52eca76c ("net/nfp: remove redundancy for representor port")

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_net_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 46d0e07850..10732f459c 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -2073,7 +2073,7 @@ nfp_net_firmware_version_get(struct rte_eth_dev *dev,
 
 	hw = nfp_net_get_hw(dev);
 
-	if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) != 0) {
+	if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) == 0) {
 		snprintf(vnic_version, FW_VER_LEN, "%d.%d.%d.%d",
 			hw->ver.extend, hw->ver.class,
 			hw->ver.major, hw->ver.minor);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.484163284 +0800
+++ 0081-net-nfp-fix-getting-firmware-VNIC-version.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From e72d6053a945b71348f5874cca6cd0be89eed8e0 Mon Sep 17 00:00:00 2001
+From bec3117648637d45e894bde55adea7c2be1a9851 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e72d6053a945b71348f5874cca6cd0be89eed8e0 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 20e628bfd1..bd43925960 100644
+index 46d0e07850..10732f459c 100644
@@ -24 +26 @@
-@@ -2155,7 +2155,7 @@ nfp_net_firmware_version_get(struct rte_eth_dev *dev,
+@@ -2073,7 +2073,7 @@ nfp_net_firmware_version_get(struct rte_eth_dev *dev,
@@ -28,2 +30,2 @@
--	if (rte_eth_dev_is_repr(dev)) {
-+	if (!rte_eth_dev_is_repr(dev)) {
+-	if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) != 0) {
++	if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) == 0) {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix IPsec data endianness' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (79 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/nfp: fix getting firmware VNIC version' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/ena: fix fast mbuf free' " Xueming Li
                     ` (42 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shihong Wang; +Cc: Chaoyong He, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5f75adca7e2ed0a0b264d6abda40ea81595d1c04

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5f75adca7e2ed0a0b264d6abda40ea81595d1c04 Mon Sep 17 00:00:00 2001
From: Shihong Wang <shihong.wang@corigine.com>
Date: Mon, 11 Mar 2024 10:49:39 +0800
Subject: [PATCH] net/nfp: fix IPsec data endianness
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7e13f2dc603e406eaa099a0b45c099a9d9004dd0 ]

The algorithm key of the security framework is stored in the u8
array according to big-endian, and the driver algorithm key is
CPU-endian of u32, so it maybe need to convert the endianness order
to ensure that the value assigned to the driver is CPU-endian.

This patch removes the operation of converting IPsec Tx metadata
to big-endian to ensure that IPsec Tx metadata is CPU-endian.

Fixes: 547137405be7 ("net/nfp: initialize IPsec related content")
Fixes: 3d21da66c06b ("net/nfp: create security session")
Fixes: 310a1780581e ("net/nfp: support IPsec Rx and Tx offload")

Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ipsec.c | 72 +++++++++++++++++++++++--------------
 drivers/net/nfp/nfp_ipsec.h |  9 ++---
 2 files changed, 47 insertions(+), 34 deletions(-)

diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c
index 7ce9cca0b2..aebdbb2f48 100644
--- a/drivers/net/nfp/nfp_ipsec.c
+++ b/drivers/net/nfp/nfp_ipsec.c
@@ -18,6 +18,7 @@
 #include "nfp_rxtx.h"
 
 #define NFP_UDP_ESP_PORT            4500
+#define NFP_ESP_IV_LENGTH           8
 
 static const struct rte_cryptodev_capabilities nfp_crypto_caps[] = {
 	{
@@ -521,7 +522,8 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
 	char *save;
 	char *iv_b;
 	char *iv_str;
-	uint8_t *cfg_iv;
+	const rte_be32_t *iv_value;
+	uint8_t cfg_iv[NFP_ESP_IV_LENGTH];
 
 	iv_str = strdup(iv_string);
 	if (iv_str == NULL) {
@@ -529,8 +531,6 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
 		return;
 	}
 
-	cfg_iv = (uint8_t *)cfg->aesgcm_fields.iv;
-
 	for (i = 0; i < iv_len; i++) {
 		iv_b = strtok_r(i ? NULL : iv_str, ",", &save);
 		if (iv_b == NULL)
@@ -539,8 +539,9 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
 		cfg_iv[i] = strtoul(iv_b, NULL, 0);
 	}
 
-	*(uint32_t *)cfg_iv = rte_be_to_cpu_32(*(uint32_t *)cfg_iv);
-	*(uint32_t *)&cfg_iv[4] = rte_be_to_cpu_32(*(uint32_t *)&cfg_iv[4]);
+	iv_value = (const rte_be32_t *)(cfg_iv);
+	cfg->aesgcm_fields.iv[0] = rte_be_to_cpu_32(iv_value[0]);
+	cfg->aesgcm_fields.iv[1] = rte_be_to_cpu_32(iv_value[1]);
 
 	free(iv_str);
 }
@@ -581,7 +582,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
 	uint32_t offset;
 	uint32_t device_id;
 	const char *iv_str;
-	const uint32_t *key;
+	const rte_be32_t *key;
 	struct nfp_net_hw *net_hw;
 
 	net_hw = eth_dev->data->dev_private;
@@ -631,7 +632,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 	}
 
-	key = (const uint32_t *)(aead->key.data);
+	key = (const rte_be32_t *)(aead->key.data);
 
 	/*
 	 * The CHACHA20's key order needs to be adjusted based on hardware design.
@@ -643,16 +644,22 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
 
 	for (i = 0; i < key_length / sizeof(cfg->cipher_key[0]); i++) {
 		index = (i + offset) % (key_length / sizeof(cfg->cipher_key[0]));
-		cfg->cipher_key[index] = rte_cpu_to_be_32(*key++);
+		cfg->cipher_key[index] = rte_be_to_cpu_32(key[i]);
 	}
 
 	/*
-	 * The iv of the FW is equal to ESN by default. Reading the
-	 * iv of the configuration information is not supported.
+	 * The iv of the FW is equal to ESN by default. Only the
+	 * aead algorithm can offload the iv of configuration and
+	 * the length of iv cannot be greater than NFP_ESP_IV_LENGTH.
 	 */
 	iv_str = getenv("ETH_SEC_IV_OVR");
 	if (iv_str != NULL) {
 		iv_len = aead->iv.length;
+		if (iv_len > NFP_ESP_IV_LENGTH) {
+			PMD_DRV_LOG(ERR, "Unsupported length of iv data");
+			return -EINVAL;
+		}
+
 		nfp_aesgcm_iv_update(cfg, iv_len, iv_str);
 	}
 
@@ -669,7 +676,7 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
 	int ret;
 	uint32_t i;
 	uint32_t device_id;
-	const uint32_t *key;
+	const rte_be32_t *key;
 	struct nfp_net_hw *net_hw;
 
 	net_hw = eth_dev->data->dev_private;
@@ -703,14 +710,14 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 	}
 
-	key = (const uint32_t  *)(cipher->key.data);
+	key = (const rte_be32_t *)(cipher->key.data);
 	if (key_length > sizeof(cfg->cipher_key)) {
 		PMD_DRV_LOG(ERR, "Insufficient space for offloaded key");
 		return -EINVAL;
 	}
 
 	for (i = 0; i < key_length / sizeof(cfg->cipher_key[0]); i++)
-		cfg->cipher_key[i] = rte_cpu_to_be_32(*key++);
+		cfg->cipher_key[i] = rte_be_to_cpu_32(key[i]);
 
 	return 0;
 }
@@ -805,7 +812,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
 	uint32_t i;
 	uint8_t key_length;
 	uint32_t device_id;
-	const uint32_t *key;
+	const rte_be32_t *key;
 	struct nfp_net_hw *net_hw;
 
 	if (digest_length == 0) {
@@ -852,7 +859,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 	}
 
-	key = (const uint32_t *)(auth->key.data);
+	key = (const rte_be32_t *)(auth->key.data);
 	key_length = auth->key.length;
 	if (key_length > sizeof(cfg->auth_key)) {
 		PMD_DRV_LOG(ERR, "Insufficient space for offloaded auth key!");
@@ -860,7 +867,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
 	}
 
 	for (i = 0; i < key_length / sizeof(cfg->auth_key[0]); i++)
-		cfg->auth_key[i] = rte_cpu_to_be_32(*key++);
+		cfg->auth_key[i] = rte_be_to_cpu_32(key[i]);
 
 	return 0;
 }
@@ -900,7 +907,7 @@ nfp_crypto_msg_build(struct rte_eth_dev *eth_dev,
 			return ret;
 		}
 
-		cfg->aesgcm_fields.salt = rte_cpu_to_be_32(conf->ipsec.salt);
+		cfg->aesgcm_fields.salt = conf->ipsec.salt;
 		break;
 	case RTE_CRYPTO_SYM_XFORM_AUTH:
 		/* Only support Auth + Cipher for inbound */
@@ -965,7 +972,10 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
 		struct rte_security_session_conf *conf,
 		struct nfp_ipsec_msg *msg)
 {
+	int i;
 	int ret;
+	rte_be32_t *src_ip;
+	rte_be32_t *dst_ip;
 	struct ipsec_add_sa *cfg;
 	enum rte_security_ipsec_tunnel_type type;
 
@@ -1023,12 +1033,18 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
 		type = conf->ipsec.tunnel.type;
 		cfg->ctrl_word.mode = NFP_IPSEC_MODE_TUNNEL;
 		if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV4) {
-			cfg->src_ip.v4 = conf->ipsec.tunnel.ipv4.src_ip;
-			cfg->dst_ip.v4 = conf->ipsec.tunnel.ipv4.dst_ip;
+			src_ip = (rte_be32_t *)&conf->ipsec.tunnel.ipv4.src_ip.s_addr;
+			dst_ip = (rte_be32_t *)&conf->ipsec.tunnel.ipv4.dst_ip.s_addr;
+			cfg->src_ip[0] = rte_be_to_cpu_32(src_ip[0]);
+			cfg->dst_ip[0] = rte_be_to_cpu_32(dst_ip[0]);
 			cfg->ipv6 = 0;
 		} else if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV6) {
-			cfg->src_ip.v6 = conf->ipsec.tunnel.ipv6.src_addr;
-			cfg->dst_ip.v6 = conf->ipsec.tunnel.ipv6.dst_addr;
+			src_ip = (rte_be32_t *)conf->ipsec.tunnel.ipv6.src_addr.s6_addr;
+			dst_ip = (rte_be32_t *)conf->ipsec.tunnel.ipv6.dst_addr.s6_addr;
+			for (i = 0; i < 4; i++) {
+				cfg->src_ip[i] = rte_be_to_cpu_32(src_ip[i]);
+				cfg->dst_ip[i] = rte_be_to_cpu_32(dst_ip[i]);
+			}
 			cfg->ipv6 = 1;
 		} else {
 			PMD_DRV_LOG(ERR, "Unsupported address family!");
@@ -1041,9 +1057,11 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
 		cfg->ctrl_word.mode = NFP_IPSEC_MODE_TRANSPORT;
 		if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV4) {
 			memset(&cfg->src_ip, 0, sizeof(cfg->src_ip));
+			memset(&cfg->dst_ip, 0, sizeof(cfg->dst_ip));
 			cfg->ipv6 = 0;
 		} else if (type == RTE_SECURITY_IPSEC_TUNNEL_IPV6) {
 			memset(&cfg->src_ip, 0, sizeof(cfg->src_ip));
+			memset(&cfg->dst_ip, 0, sizeof(cfg->dst_ip));
 			cfg->ipv6 = 1;
 		} else {
 			PMD_DRV_LOG(ERR, "Unsupported address family!");
@@ -1177,18 +1195,18 @@ nfp_security_set_pkt_metadata(void *device,
 		desc_md = RTE_MBUF_DYNFIELD(m, offset, struct nfp_tx_ipsec_desc_msg *);
 
 		if (priv_session->msg.ctrl_word.ext_seq != 0 && sqn != NULL) {
-			desc_md->esn.low = rte_cpu_to_be_32(*sqn);
-			desc_md->esn.hi = rte_cpu_to_be_32(*sqn >> 32);
+			desc_md->esn.low = (uint32_t)*sqn;
+			desc_md->esn.hi = (uint32_t)(*sqn >> 32);
 		} else if (priv_session->msg.ctrl_word.ext_seq != 0) {
-			desc_md->esn.low = rte_cpu_to_be_32(priv_session->ipsec.esn.low);
-			desc_md->esn.hi = rte_cpu_to_be_32(priv_session->ipsec.esn.hi);
+			desc_md->esn.low = priv_session->ipsec.esn.low;
+			desc_md->esn.hi = priv_session->ipsec.esn.hi;
 		} else {
-			desc_md->esn.low = rte_cpu_to_be_32(priv_session->ipsec.esn.value);
+			desc_md->esn.low = priv_session->ipsec.esn.low;
 			desc_md->esn.hi = 0;
 		}
 
 		desc_md->enc = 1;
-		desc_md->sa_idx = rte_cpu_to_be_32(priv_session->sa_index);
+		desc_md->sa_idx = priv_session->sa_index;
 	}
 
 	return 0;
diff --git a/drivers/net/nfp/nfp_ipsec.h b/drivers/net/nfp/nfp_ipsec.h
index d7a729398a..f7c4f3f225 100644
--- a/drivers/net/nfp/nfp_ipsec.h
+++ b/drivers/net/nfp/nfp_ipsec.h
@@ -36,11 +36,6 @@ struct sa_ctrl_word {
 	uint32_t spare2 :1;      /**< Must be set to 0 */
 };
 
-union nfp_ip_addr {
-	struct in6_addr v6;
-	struct in_addr v4;
-};
-
 struct ipsec_add_sa {
 	uint32_t cipher_key[8];           /**< Cipher Key */
 	union {
@@ -60,8 +55,8 @@ struct ipsec_add_sa {
 	uint8_t spare1;
 	uint32_t soft_byte_cnt;           /**< Soft lifetime byte count */
 	uint32_t hard_byte_cnt;           /**< Hard lifetime byte count */
-	union nfp_ip_addr src_ip;         /**< Src IP addr */
-	union nfp_ip_addr dst_ip;         /**< Dst IP addr */
+	uint32_t src_ip[4];               /**< Src IP addr */
+	uint32_t dst_ip[4];               /**< Dst IP addr */
 	uint16_t natt_dst_port;           /**< NAT-T UDP Header dst port */
 	uint16_t natt_src_port;           /**< NAT-T UDP Header src port */
 	uint32_t soft_lifetime_limit;     /**< Soft lifetime time limit */
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.508682352 +0800
+++ 0082-net-nfp-fix-IPsec-data-endianness.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 7e13f2dc603e406eaa099a0b45c099a9d9004dd0 Mon Sep 17 00:00:00 2001
+From 5f75adca7e2ed0a0b264d6abda40ea81595d1c04 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7e13f2dc603e406eaa099a0b45c099a9d9004dd0 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 0bf146b9be..205d1d594c 100644
+index 7ce9cca0b2..aebdbb2f48 100644
@@ -30,2 +32,2 @@
-@@ -21,6 +21,7 @@
- #include "nfp_net_meta.h"
+@@ -18,6 +18,7 @@
+ #include "nfp_rxtx.h"
@@ -38 +40 @@
-@@ -524,7 +525,8 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
+@@ -521,7 +522,8 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
@@ -48 +50 @@
-@@ -532,8 +534,6 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
+@@ -529,8 +531,6 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
@@ -57 +59 @@
-@@ -542,8 +542,9 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
+@@ -539,8 +539,9 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
@@ -69 +71 @@
-@@ -584,7 +585,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
+@@ -581,7 +582,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
@@ -78 +80 @@
-@@ -634,7 +635,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
+@@ -631,7 +632,7 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
@@ -87 +89 @@
-@@ -646,16 +647,22 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
+@@ -643,16 +644,22 @@ nfp_aead_map(struct rte_eth_dev *eth_dev,
@@ -113 +115 @@
-@@ -672,7 +679,7 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
+@@ -669,7 +676,7 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
@@ -122 +124 @@
-@@ -706,14 +713,14 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
+@@ -703,14 +710,14 @@ nfp_cipher_map(struct rte_eth_dev *eth_dev,
@@ -139 +141 @@
-@@ -808,7 +815,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
+@@ -805,7 +812,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
@@ -148 +150 @@
-@@ -855,7 +862,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
+@@ -852,7 +859,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
@@ -157 +159 @@
-@@ -863,7 +870,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
+@@ -860,7 +867,7 @@ nfp_auth_map(struct rte_eth_dev *eth_dev,
@@ -166 +168 @@
-@@ -903,7 +910,7 @@ nfp_crypto_msg_build(struct rte_eth_dev *eth_dev,
+@@ -900,7 +907,7 @@ nfp_crypto_msg_build(struct rte_eth_dev *eth_dev,
@@ -175 +177 @@
-@@ -968,7 +975,10 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
+@@ -965,7 +972,10 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
@@ -186 +188 @@
-@@ -1026,12 +1036,18 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
+@@ -1023,12 +1033,18 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
@@ -209 +211 @@
-@@ -1044,9 +1060,11 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
+@@ -1041,9 +1057,11 @@ nfp_ipsec_msg_build(struct rte_eth_dev *eth_dev,
@@ -221 +223 @@
-@@ -1180,18 +1198,18 @@ nfp_security_set_pkt_metadata(void *device,
+@@ -1177,18 +1195,18 @@ nfp_security_set_pkt_metadata(void *device,
@@ -247 +249 @@
-index 4ef0e196be..8fdb7fd534 100644
+index d7a729398a..f7c4f3f225 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ena: fix fast mbuf free' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (80 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/nfp: fix IPsec data endianness' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/ena/base: limit exponential backoff' " Xueming Li
                     ` (41 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shai Brandes; +Cc: Amit Bernstein, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2fa8497bd30eb130c45d8e6f3538f8e50b4102c2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2fa8497bd30eb130c45d8e6f3538f8e50b4102c2 Mon Sep 17 00:00:00 2001
From: Shai Brandes <shaibran@amazon.com>
Date: Tue, 12 Mar 2024 20:06:50 +0200
Subject: [PATCH] net/ena: fix fast mbuf free
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ]

In case the application enables fast mbuf release optimization,
the driver releases 256 TX mbufs in bulk upon reaching the
TX free threshold.
The existing implementation utilizes rte_mempool_put_bulk for bulk
freeing TXs, which exclusively supports direct mbufs.
In case the application transmits indirect bufs, the driver must
also decrement the mbuf reference count and unlink the mbuf segment.
For such case, the driver should employ rte_pktmbuf_free_bulk.

Fixes: c339f53823f3 ("net/ena: support fast mbuf free")

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 drivers/net/ena/ena_ethdev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index dc846d2e84..1e138849cc 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -3117,8 +3117,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean,
 		m_next = mbuf->next;
 		mbufs_to_clean[mbuf_cnt++] = mbuf;
 		if (mbuf_cnt == buf_size) {
-			rte_mempool_put_bulk(mbufs_to_clean[0]->pool, (void **)mbufs_to_clean,
-				(unsigned int)mbuf_cnt);
+			rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt);
 			mbuf_cnt = 0;
 		}
 		mbuf = m_next;
@@ -3186,8 +3185,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
 	}
 
 	if (mbuf_cnt != 0)
-		rte_mempool_put_bulk(mbufs_to_clean[0]->pool,
-			(void **)mbufs_to_clean, mbuf_cnt);
+		rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt);
 
 	/* Notify completion handler that full cleanup was performed */
 	if (free_pkt_cnt == 0 || total_tx_pkts < cleanup_budget)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.531356222 +0800
+++ 0083-net-ena-fix-fast-mbuf-free.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 89b081e154c5f81295014fd8b5b32193dd01b9cb Mon Sep 17 00:00:00 2001
+From 2fa8497bd30eb130c45d8e6f3538f8e50b4102c2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 89b081e154c5f81295014fd8b5b32193dd01b9cb ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 3157237c0d..537ee9f8c3 100644
+index dc846d2e84..1e138849cc 100644
@@ -28 +30 @@
-@@ -3122,8 +3122,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean,
+@@ -3117,8 +3117,7 @@ ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean,
@@ -38 +40 @@
-@@ -3191,8 +3190,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
+@@ -3186,8 +3185,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ena/base: limit exponential backoff' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (81 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/ena: fix fast mbuf free' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/ena/base: restructure interrupt handling' " Xueming Li
                     ` (40 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shai Brandes; +Cc: Amit Bernstein, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e1abac3de0eed7755edee3400722db6df5395abe

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e1abac3de0eed7755edee3400722db6df5395abe Mon Sep 17 00:00:00 2001
From: Shai Brandes <shaibran@amazon.com>
Date: Tue, 12 Mar 2024 20:06:52 +0200
Subject: [PATCH] net/ena/base: limit exponential backoff
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4b378679c88ff231b97b71aaedc2d424e82f1aba ]

Limit the value of the exponent used for this backoff
at (1<<16) to prevent it from reaching to an excessive
value (1<<32) or potentially even overflowing.
In addition, for uniformity and readability purposes,
the min/max parameter in the calls of ENA_MIN32 and
ENA_MAX32 macros was changed to be first.

Fixes: 0c84e04824db ("net/ena/base: make delay exponential in polling functions")

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 drivers/net/ena/base/ena_com.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 6953a1fa33..31c37b0ab3 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -34,6 +34,8 @@
 
 #define ENA_REGS_ADMIN_INTR_MASK 1
 
+#define ENA_MAX_BACKOFF_DELAY_EXP 16U
+
 #define ENA_MIN_ADMIN_POLL_US 100
 
 #define ENA_MAX_ADMIN_POLL_US 5000
@@ -545,8 +547,9 @@ static int ena_com_comp_status_to_errno(struct ena_com_admin_queue *admin_queue,
 
 static void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us)
 {
+	exp = ENA_MIN32(ENA_MAX_BACKOFF_DELAY_EXP, exp);
 	delay_us = ENA_MAX32(ENA_MIN_ADMIN_POLL_US, delay_us);
-	delay_us = ENA_MIN32(delay_us * (1U << exp), ENA_MAX_ADMIN_POLL_US);
+	delay_us = ENA_MIN32(ENA_MAX_ADMIN_POLL_US, delay_us * (1U << exp));
 	ENA_USLEEP(delay_us);
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.564358479 +0800
+++ 0084-net-ena-base-limit-exponential-backoff.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 4b378679c88ff231b97b71aaedc2d424e82f1aba Mon Sep 17 00:00:00 2001
+From e1abac3de0eed7755edee3400722db6df5395abe Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4b378679c88ff231b97b71aaedc2d424e82f1aba ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ena/base: restructure interrupt handling' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (82 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/ena/base: limit exponential backoff' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/nfp: fix switch domain free check' " Xueming Li
                     ` (39 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shai Brandes; +Cc: Amit Bernstein, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=aa850bad00f408ad4d680023dd8c952e062606b1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From aa850bad00f408ad4d680023dd8c952e062606b1 Mon Sep 17 00:00:00 2001
From: Shai Brandes <shaibran@amazon.com>
Date: Tue, 12 Mar 2024 20:07:00 +0200
Subject: [PATCH] net/ena/base: restructure interrupt handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 553653ccc18c1ed9fb0406e1b0130e945d5ab30f ]

When invoking an admin command, in interrupt mode, if the interrupt
is received after timeout and also after the calling function finished
running, the response will be written into a memory that is no longer
valid.

Fixes: 99ecfbf845b3 ("ena: import communication layer")

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 drivers/net/ena/base/ena_com.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 31c37b0ab3..57ccde9545 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -179,6 +179,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev,
 static void comp_ctxt_release(struct ena_com_admin_queue *queue,
 				     struct ena_comp_ctx *comp_ctx)
 {
+	comp_ctx->user_cqe = NULL;
 	comp_ctx->occupied = false;
 	ATOMIC32_DEC(&queue->outstanding_cmds);
 }
@@ -472,6 +473,9 @@ static void ena_com_handle_single_admin_completion(struct ena_com_admin_queue *a
 		return;
 	}
 
+	if (!comp_ctx->occupied)
+		return;
+
 	comp_ctx->status = ENA_CMD_COMPLETED;
 	comp_ctx->comp_status = cqe->acq_common_descriptor.status;
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.600492132 +0800
+++ 0085-net-ena-base-restructure-interrupt-handling.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 553653ccc18c1ed9fb0406e1b0130e945d5ab30f Mon Sep 17 00:00:00 2001
+From aa850bad00f408ad4d680023dd8c952e062606b1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 553653ccc18c1ed9fb0406e1b0130e945d5ab30f ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index fb3ad27d0a..a0c88b1a0e 100644
+index 31c37b0ab3..57ccde9545 100644
@@ -24 +26 @@
-@@ -181,6 +181,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev,
+@@ -179,6 +179,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev *ena_dev,
@@ -32 +34 @@
-@@ -474,6 +475,9 @@ static void ena_com_handle_single_admin_completion(struct ena_com_admin_queue *a
+@@ -472,6 +473,9 @@ static void ena_com_handle_single_admin_completion(struct ena_com_admin_queue *a

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix switch domain free check' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (83 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/ena/base: restructure interrupt handling' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/nfp: fix initialization failure flow' " Xueming Li
                     ` (38 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=dd48153b15f1b6113ed16f14061e891b556404ea

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dd48153b15f1b6113ed16f14061e891b556404ea Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Thu, 14 Mar 2024 15:40:17 +0800
Subject: [PATCH] net/nfp: fix switch domain free check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5b1b9f9c11bedb672cdf01c834d6c341d50a0f1e ]

CI found calling 'rte_eth_switch_domain_free()' without checking return
value.

Coverity issue: 414936
Fixes: 20eaa8e2ebae ("net/nfp: free switch domain ID on close")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 326d36c3a9..ecf7a1e576 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -814,7 +814,8 @@ nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev)
 	rte_free(app_fw_flower->pf_hw);
 	nfp_mtr_priv_uninit(pf_dev);
 	nfp_flow_priv_uninit(pf_dev);
-	rte_eth_switch_domain_free(app_fw_flower->switch_domain_id);
+	if (rte_eth_switch_domain_free(app_fw_flower->switch_domain_id) != 0)
+		PMD_DRV_LOG(WARNING, "Failed to free switch domain for device");
 	rte_free(app_fw_flower);
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.640225280 +0800
+++ 0086-net-nfp-fix-switch-domain-free-check.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 5b1b9f9c11bedb672cdf01c834d6c341d50a0f1e Mon Sep 17 00:00:00 2001
+From dd48153b15f1b6113ed16f14061e891b556404ea Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5b1b9f9c11bedb672cdf01c834d6c341d50a0f1e ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 97219ff379..303f6bd3f6 100644
+index 326d36c3a9..ecf7a1e576 100644
@@ -24 +26 @@
-@@ -793,7 +793,8 @@ nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev)
+@@ -814,7 +814,8 @@ nfp_uninit_app_fw_flower(struct nfp_pf_dev *pf_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix initialization failure flow' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (84 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/nfp: fix switch domain free check' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'app/testpmd: fix --stats-period option check' " Xueming Li
                     ` (37 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0884b3bd36a9880955f5b7d9a59c5a71619e3c0f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0884b3bd36a9880955f5b7d9a59c5a71619e3c0f Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Thu, 14 Mar 2024 15:40:19 +0800
Subject: [PATCH] net/nfp: fix initialization failure flow
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fdaa8f98d754a704e00c7738c177efd43b669081 ]

CI found there has unreachable control flow, fix it by remove the
missing delete 'return' statement.

Coverity issue: 414938
Fixes: 369945667251 ("net/nfp: fix resource leak for device initialization")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 5e473d9c16..7baacd18b0 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -669,7 +669,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	err = nfp_net_tlv_caps_parse(eth_dev);
 	if (err != 0) {
 		PMD_INIT_LOG(ERR, "Failed to parser TLV caps");
-		return err;
 		goto free_area;
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.672265038 +0800
+++ 0087-net-nfp-fix-initialization-failure-flow.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From fdaa8f98d754a704e00c7738c177efd43b669081 Mon Sep 17 00:00:00 2001
+From 0884b3bd36a9880955f5b7d9a59c5a71619e3c0f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fdaa8f98d754a704e00c7738c177efd43b669081 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 31c54a595c..568de1d024 100644
+index 5e473d9c16..7baacd18b0 100644
@@ -24 +26 @@
-@@ -936,7 +936,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -669,7 +669,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix --stats-period option check' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (85 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/nfp: fix initialization failure flow' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'app/testpmd: fix burst option parsing' " Xueming Li
                     ` (36 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=6c2174ad80afb5de9602d4355658723f151df5a6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6c2174ad80afb5de9602d4355658723f151df5a6 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 14 Mar 2024 10:17:02 +0100
Subject: [PATCH] app/testpmd: fix --stats-period option check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2ae06c579ea4e1cd234c5b14bef2957ee154ec74 ]

Rather than silently ignore an invalid value, raise an error for
stats-period user input.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/parameters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11b0cce577..d715750bb8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -776,7 +776,7 @@ launch_args_parse(int argc, char** argv)
 				n = strtoul(optarg, &end, 10);
 				if ((optarg[0] == '\0') || (end == NULL) ||
 						(*end != '\0'))
-					break;
+					rte_exit(EXIT_FAILURE, "Invalid stats-period value\n");
 
 				stats_period = n;
 				break;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.702680399 +0800
+++ 0088-app-testpmd-fix-stats-period-option-check.patch	2024-04-13 20:43:05.037753879 +0800
@@ -1 +1 @@
-From 2ae06c579ea4e1cd234c5b14bef2957ee154ec74 Mon Sep 17 00:00:00 2001
+From 6c2174ad80afb5de9602d4355658723f151df5a6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2ae06c579ea4e1cd234c5b14bef2957ee154ec74 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix burst option parsing' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (86 preceding siblings ...)
  2024-04-13 12:49   ` patch 'app/testpmd: fix --stats-period option check' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'app/testpmd: fix error message for invalid option' " Xueming Li
                     ` (35 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=92c08367ea185939f79ec9b562e7e40b1d92e352

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 92c08367ea185939f79ec9b562e7e40b1d92e352 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 14 Mar 2024 10:17:03 +0100
Subject: [PATCH] app/testpmd: fix burst option parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6fa896ae804a7dbd7fb766643f733dbad12bba43 ]

rte_eth_dev_info_get() is not supposed to fail for a valid port_id, but
for the theoretical case when it would fail, raise an error rather than
skip subsequent options.

Fixes: 6f51deb903b2 ("app/testpmd: check status of getting ethdev info")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/parameters.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index d715750bb8..3414a0d38c 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -1128,7 +1128,9 @@ launch_args_parse(int argc, char** argv)
 								0,
 								&dev_info);
 					if (ret != 0)
-						return;
+						rte_exit(EXIT_FAILURE, "Failed to get driver "
+							"recommended burst size, please provide a "
+							"value between 1 and %d\n", MAX_PKT_BURST);
 
 					rec_nb_pkts = dev_info
 						.default_rxportconf.burst_size;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.730374062 +0800
+++ 0089-app-testpmd-fix-burst-option-parsing.patch	2024-04-13 20:43:05.047753866 +0800
@@ -1 +1 @@
-From 6fa896ae804a7dbd7fb766643f733dbad12bba43 Mon Sep 17 00:00:00 2001
+From 92c08367ea185939f79ec9b562e7e40b1d92e352 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6fa896ae804a7dbd7fb766643f733dbad12bba43 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix error message for invalid option' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (87 preceding siblings ...)
  2024-04-13 12:49   ` patch 'app/testpmd: fix burst option parsing' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/hns3: support new device' " Xueming Li
                     ` (34 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=97089aa02e6cc724601cae527ff8ddb3ca0479e3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 97089aa02e6cc724601cae527ff8ddb3ca0479e3 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 14 Mar 2024 10:17:04 +0100
Subject: [PATCH] app/testpmd: fix error message for invalid option
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c25382fa81533429d5968b47b356c79153b76212 ]

"""
The variable optind is the index of the next element to be processed in
argv.  The system initializes this value to 1.  The caller can reset it
to 1 to restart scanning of the same argv, or when scanning a new
argument vector.
"""

Hence, if an invalid option is passed through testpmd cmdline, getopt
returns '?' and increments optind to the next index in argv for a
subsequent call.
The message should log the previous index.

Fixes: 8fad2e5ab2c5 ("app/testpmd: report invalid command line parameter")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/parameters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 3414a0d38c..a4c09e2a2b 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -1497,7 +1497,7 @@ launch_args_parse(int argc, char** argv)
 			break;
 		default:
 			usage(argv[0]);
-			fprintf(stderr, "Invalid option: %s\n", argv[optind]);
+			fprintf(stderr, "Invalid option: %s\n", argv[optind - 1]);
 			rte_exit(EXIT_FAILURE,
 				 "Command line is incomplete or incorrect\n");
 			break;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.759182325 +0800
+++ 0090-app-testpmd-fix-error-message-for-invalid-option.patch	2024-04-13 20:43:05.047753866 +0800
@@ -1 +1 @@
-From c25382fa81533429d5968b47b356c79153b76212 Mon Sep 17 00:00:00 2001
+From 97089aa02e6cc724601cae527ff8ddb3ca0479e3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c25382fa81533429d5968b47b356c79153b76212 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/hns3: support new device' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (88 preceding siblings ...)
  2024-04-13 12:49   ` patch 'app/testpmd: fix error message for invalid option' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix HWS meter actions availability' " Xueming Li
                     ` (33 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Jie Hai; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fe697bbce32c5ec34bac71e31407108d3190da12

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fe697bbce32c5ec34bac71e31407108d3190da12 Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Fri, 15 Mar 2024 10:54:48 +0800
Subject: [PATCH] net/hns3: support new device
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3f1436d7006c2659232305ef2b8b186796319041 ]

This patch introduces the new devices, which are on-chip network
interface controllers with RDMA/DCB/ROH supporting. One is 100GE
and the other is 200GE. Both can be found on HIP09/HIP10 SoCs.

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 doc/guides/nics/hns3.rst       | 2 +-
 drivers/net/hns3/hns3_cmd.c    | 4 +++-
 drivers/net/hns3/hns3_ethdev.c | 2 ++
 drivers/net/hns3/hns3_ethdev.h | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/hns3.rst b/doc/guides/nics/hns3.rst
index 3b0613fc1b..3e84d1ff1c 100644
--- a/doc/guides/nics/hns3.rst
+++ b/doc/guides/nics/hns3.rst
@@ -6,7 +6,7 @@ HNS3 Poll Mode Driver
 
 The hns3 PMD (**librte_net_hns3**) provides poll mode driver support
 for the inbuilt HiSilicon Network Subsystem(HNS) network engine
-found in the HiSilicon Kunpeng 920 SoC and Kunpeng 930 SoC .
+found in the HiSilicon Kunpeng 920 SoC (HIP08) and Kunpeng 930 SoC (HIP09/HIP10).
 
 Features
 --------
diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c
index 2c1664485b..001ff49b36 100644
--- a/drivers/net/hns3/hns3_cmd.c
+++ b/drivers/net/hns3/hns3_cmd.c
@@ -545,7 +545,9 @@ hns3_set_dcb_capability(struct hns3_hw *hw)
 	if (device_id == HNS3_DEV_ID_25GE_RDMA ||
 	    device_id == HNS3_DEV_ID_50GE_RDMA ||
 	    device_id == HNS3_DEV_ID_100G_RDMA_MACSEC ||
-	    device_id == HNS3_DEV_ID_200G_RDMA)
+	    device_id == HNS3_DEV_ID_200G_RDMA ||
+	    device_id == HNS3_DEV_ID_100G_ROH ||
+	    device_id == HNS3_DEV_ID_200G_ROH)
 		hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
 }
 
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index eafcf2c6f6..90dbc4a84b 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -6648,6 +6648,8 @@ static const struct rte_pci_id pci_id_hns3_map[] = {
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_50GE_RDMA) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_MACSEC) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_RDMA) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_ROH) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_ROH) },
 	{ .vendor_id = 0, }, /* sentinel */
 };
 
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 12d8299def..e70c5fff2a 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -28,7 +28,9 @@
 #define HNS3_DEV_ID_25GE_RDMA			0xA222
 #define HNS3_DEV_ID_50GE_RDMA			0xA224
 #define HNS3_DEV_ID_100G_RDMA_MACSEC		0xA226
+#define HNS3_DEV_ID_100G_ROH	                0xA227
 #define HNS3_DEV_ID_200G_RDMA			0xA228
+#define HNS3_DEV_ID_200G_ROH	                0xA22C
 #define HNS3_DEV_ID_100G_VF			0xA22E
 #define HNS3_DEV_ID_100G_RDMA_PFC_VF		0xA22F
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.785417390 +0800
+++ 0091-net-hns3-support-new-device.patch	2024-04-13 20:43:05.047753866 +0800
@@ -1 +1 @@
-From 3f1436d7006c2659232305ef2b8b186796319041 Mon Sep 17 00:00:00 2001
+From fe697bbce32c5ec34bac71e31407108d3190da12 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3f1436d7006c2659232305ef2b8b186796319041 ]
@@ -10,2 +12,0 @@
-Cc: stable@dpdk.org
-
@@ -14,6 +15,5 @@
- doc/guides/nics/hns3.rst               | 2 +-
- doc/guides/rel_notes/release_24_03.rst | 4 ++++
- drivers/net/hns3/hns3_cmd.c            | 4 +++-
- drivers/net/hns3/hns3_ethdev.c         | 2 ++
- drivers/net/hns3/hns3_ethdev.h         | 2 ++
- 5 files changed, 12 insertions(+), 2 deletions(-)
+ doc/guides/nics/hns3.rst       | 2 +-
+ drivers/net/hns3/hns3_cmd.c    | 4 +++-
+ drivers/net/hns3/hns3_ethdev.c | 2 ++
+ drivers/net/hns3/hns3_ethdev.h | 2 ++
+ 4 files changed, 8 insertions(+), 2 deletions(-)
@@ -34,15 +33,0 @@
-diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
-index 8e809456aa..14826ea08f 100644
---- a/doc/guides/rel_notes/release_24_03.rst
-+++ b/doc/guides/rel_notes/release_24_03.rst
-@@ -123,6 +123,10 @@ New Features
- 
-   * Added support for 5760X device family.
- 
-+* **Updated HiSilicon hns3 ethdev driver.**
-+
-+  * Added new device supporting RDMA/DCB/ROH with PCI IDs: ``0xa227, 0xa22c``.
-+
- * **Updated Marvell cnxk net driver.**
- 
-   * Added support for port representors.
@@ -65 +50 @@
-index b10d1216d2..9730b9a7e9 100644
+index eafcf2c6f6..90dbc4a84b 100644
@@ -68 +53 @@
-@@ -6649,6 +6649,8 @@ static const struct rte_pci_id pci_id_hns3_map[] = {
+@@ -6648,6 +6648,8 @@ static const struct rte_pci_id pci_id_hns3_map[] = {

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix HWS meter actions availability' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (89 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/hns3: support new device' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix sync meter processing in HWS' " Xueming Li
                     ` (32 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=50eb03f8d3302810ac2d966cff17dd1be6549bd7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 50eb03f8d3302810ac2d966cff17dd1be6549bd7 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 7 Mar 2024 12:19:08 +0200
Subject: [PATCH] net/mlx5: fix HWS meter actions availability
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7576c32eefd3b8444cff7f946361fb5c074634a7 ]

Allow compilation of HWS meter code only on platforms
that support HWS.

Fixes: 24865366e495 ("net/mlx5: support flow meter action for HWS")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_meter.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index 7cbf772ea4..beeb868c8c 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -618,6 +618,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev,
 							meter_profile_id);
 }
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 /**
  * Callback to add MTR profile with HWS.
  *
@@ -697,6 +698,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev,
 	memset(fmp, 0, sizeof(struct mlx5_flow_meter_profile));
 	return 0;
 }
+#endif
 
 /**
  * Find policy by id.
@@ -839,6 +841,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev,
 	return 0;
 }
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 /**
  * Callback to check MTR policy action validate for HWS
  *
@@ -875,6 +878,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev,
 	}
 	return 0;
 }
+#endif
 
 static int
 __mlx5_flow_meter_policy_delete(struct rte_eth_dev *dev,
@@ -1201,6 +1205,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev,
 							      &policy_idx);
 }
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 /**
  * Callback to delete MTR policy for HWS.
  *
@@ -1523,7 +1528,7 @@ policy_add_err:
 				  RTE_MTR_ERROR_TYPE_UNSPECIFIED,
 				  NULL, "Failed to create meter policy.");
 }
-
+#endif
 /**
  * Check meter validation.
  *
@@ -1893,6 +1898,7 @@ error:
 		NULL, "Failed to create devx meter.");
 }
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 /**
  * Create meter rules.
  *
@@ -1976,6 +1982,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	__atomic_fetch_add(&policy->ref_cnt, 1, __ATOMIC_RELAXED);
 	return 0;
 }
+#endif
 
 static int
 mlx5_flow_meter_params_flush(struct rte_eth_dev *dev,
@@ -2460,6 +2467,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = {
 	.stats_read = mlx5_flow_meter_stats_read,
 };
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
 	.capabilities_get = mlx5_flow_mtr_cap_get,
 	.meter_profile_add = mlx5_flow_meter_profile_hws_add,
@@ -2478,6 +2486,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
 	.stats_update = NULL,
 	.stats_read = NULL,
 };
+#endif
 
 /**
  * Get meter operations.
@@ -2493,12 +2502,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
 int
 mlx5_flow_meter_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg)
 {
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 	struct mlx5_priv *priv = dev->data->dev_private;
 
 	if (priv->sh->config.dv_flow_en == 2)
 		*(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_hws_ops;
 	else
 		*(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_ops;
+#else
+	*(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_ops;
+#endif
 	return 0;
 }
 
@@ -2877,7 +2890,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
 	struct mlx5_flow_meter_profile *fmp;
 	struct mlx5_legacy_flow_meter *legacy_fm;
 	struct mlx5_flow_meter_info *fm;
-	struct mlx5_flow_meter_policy *policy;
 	struct mlx5_flow_meter_sub_policy *sub_policy;
 	void *tmp;
 	uint32_t i, mtr_idx, policy_idx;
@@ -2945,15 +2957,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
 		mlx5_l3t_destroy(priv->policy_idx_tbl);
 		priv->policy_idx_tbl = NULL;
 	}
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 	if (priv->mtr_policy_arr) {
+		struct mlx5_flow_meter_policy *policy;
+
 		for (i = 0; i < priv->mtr_config.nb_meter_policies; i++) {
 			policy = mlx5_flow_meter_policy_find(dev, i,
 							     &policy_idx);
-			if (policy->initialized)
+			if (policy->initialized) {
 				mlx5_flow_meter_policy_hws_delete(dev, i,
 								  error);
+			}
 		}
 	}
+#endif
 	if (priv->mtr_profile_tbl) {
 		MLX5_L3T_FOREACH(priv->mtr_profile_tbl, i, entry) {
 			fmp = entry;
@@ -2967,14 +2984,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
 		mlx5_l3t_destroy(priv->mtr_profile_tbl);
 		priv->mtr_profile_tbl = NULL;
 	}
+#if defined(HAVE_MLX5_HWS_SUPPORT)
 	if (priv->mtr_profile_arr) {
 		for (i = 0; i < priv->mtr_config.nb_meter_profiles; i++) {
 			fmp = mlx5_flow_meter_profile_find(priv, i);
-			if (fmp->initialized)
+			if (fmp->initialized) {
 				mlx5_flow_meter_profile_hws_delete(dev, i,
 								   error);
+			}
 		}
 	}
+#endif
 	/* Delete default policy table. */
 	mlx5_flow_destroy_def_policy(dev);
 	if (priv->sh->refcnt == 1)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.817311049 +0800
+++ 0092-net-mlx5-fix-HWS-meter-actions-availability.patch	2024-04-13 20:43:05.047753866 +0800
@@ -1 +1 @@
-From 7576c32eefd3b8444cff7f946361fb5c074634a7 Mon Sep 17 00:00:00 2001
+From 50eb03f8d3302810ac2d966cff17dd1be6549bd7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7576c32eefd3b8444cff7f946361fb5c074634a7 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index c0578ce6e9..57de95b4b9 100644
+index 7cbf772ea4..beeb868c8c 100644
@@ -22 +24 @@
-@@ -896,6 +896,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev,
+@@ -618,6 +618,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev,
@@ -30 +32 @@
-@@ -981,6 +982,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev,
+@@ -697,6 +698,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev,
@@ -38 +40 @@
-@@ -1123,6 +1125,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev,
+@@ -839,6 +841,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev,
@@ -46 +48 @@
-@@ -1159,6 +1162,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev,
+@@ -875,6 +878,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev,
@@ -54 +56 @@
-@@ -1485,6 +1489,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev,
+@@ -1201,6 +1205,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev,
@@ -62 +64 @@
-@@ -1807,7 +1812,7 @@ policy_add_err:
+@@ -1523,7 +1528,7 @@ policy_add_err:
@@ -71 +73 @@
-@@ -2177,6 +2182,7 @@ error:
+@@ -1893,6 +1898,7 @@ error:
@@ -79 +81 @@
-@@ -2260,6 +2266,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -1976,6 +1982,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
@@ -87 +89 @@
-@@ -2744,6 +2751,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = {
+@@ -2460,6 +2467,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = {
@@ -95 +97 @@
-@@ -2762,6 +2770,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
+@@ -2478,6 +2486,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
@@ -103 +105 @@
-@@ -2777,12 +2786,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
+@@ -2493,12 +2502,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = {
@@ -120 +122 @@
-@@ -3161,7 +3174,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
+@@ -2877,7 +2890,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
@@ -128 +130 @@
-@@ -3229,15 +3241,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
+@@ -2945,15 +2957,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
@@ -150 +152 @@
-@@ -3251,14 +3268,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
+@@ -2967,14 +2984,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix sync meter processing in HWS' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (90 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix HWS meter actions availability' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix indirect action async job initialization' " Xueming Li
                     ` (31 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=7192f0ed8230f93e80915d0e37198d710952be9f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7192f0ed8230f93e80915d0e37198d710952be9f Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 7 Mar 2024 12:19:09 +0200
Subject: [PATCH] net/mlx5: fix sync meter processing in HWS
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4359d9d1f76b9ac35e548fe958b59ae4e1cbf11b ]

Synchronous calls for meter ASO try to pull pending completions
from CQ, submit WR and return to caller. That avoids delays between
WR post and  HW response.
If the template API was activated, PMD will use control queue for
sync operations.

PMD has different formats for the `user_data` context in sync and
async meter ASO calls.
PMD port destruction procedure submits async operations to the port
control queue and polls the queue CQs to clean HW responses.

Port destruction can pull a meter ASO completion from control CQ.
Such completion has sync format, but was processed by async handler.

The patch implements sync meter ASO interface with async calls
in the template API environment.

Fixes: 48fbb0e93d06 ("net/mlx5: support flow meter mark indirect action with HWS")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5.h            |  35 +++++-
 drivers/net/mlx5/mlx5_flow_aso.c   | 178 ++++++++++++++++++-----------
 drivers/net/mlx5/mlx5_flow_hw.c    |  98 ++++++++--------
 drivers/net/mlx5/mlx5_flow_meter.c |  27 +++--
 4 files changed, 215 insertions(+), 123 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 153374802a..e2c6fe0d00 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1997,6 +1997,30 @@ enum dr_dump_rec_type {
 	DR_DUMP_REC_TYPE_PMD_COUNTER = 4430,
 };
 
+#if defined(HAVE_MLX5_HWS_SUPPORT)
+static __rte_always_inline struct mlx5_hw_q_job *
+flow_hw_job_get(struct mlx5_priv *priv, uint32_t queue)
+{
+	MLX5_ASSERT(priv->hw_q[queue].job_idx <= priv->hw_q[queue].size);
+	return priv->hw_q[queue].job_idx ?
+	       priv->hw_q[queue].job[--priv->hw_q[queue].job_idx] : NULL;
+}
+
+static __rte_always_inline void
+flow_hw_job_put(struct mlx5_priv *priv, struct mlx5_hw_q_job *job, uint32_t queue)
+{
+	MLX5_ASSERT(priv->hw_q[queue].job_idx < priv->hw_q[queue].size);
+	priv->hw_q[queue].job[priv->hw_q[queue].job_idx++] = job;
+}
+
+struct mlx5_hw_q_job *
+mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+			  const struct rte_flow_action_handle *handle,
+			  void *user_data, void *query_data,
+			  enum mlx5_hw_job_type type,
+			  struct rte_flow_error *error);
+#endif
+
 /**
  * Indicates whether HW objects operations can be created by DevX.
  *
@@ -2403,11 +2427,12 @@ int mlx5_aso_flow_hit_queue_poll_start(struct mlx5_dev_ctx_shared *sh);
 int mlx5_aso_flow_hit_queue_poll_stop(struct mlx5_dev_ctx_shared *sh);
 void mlx5_aso_queue_uninit(struct mlx5_dev_ctx_shared *sh,
 			   enum mlx5_access_aso_opc_mod aso_opc_mod);
-int mlx5_aso_meter_update_by_wqe(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
-		struct mlx5_aso_mtr *mtr, struct mlx5_mtr_bulk *bulk,
-		void *user_data, bool push);
-int mlx5_aso_mtr_wait(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
-		struct mlx5_aso_mtr *mtr);
+int mlx5_aso_meter_update_by_wqe(struct mlx5_priv *priv, uint32_t queue,
+				 struct mlx5_aso_mtr *mtr,
+				 struct mlx5_mtr_bulk *bulk,
+				 struct mlx5_hw_q_job *job, bool push);
+int mlx5_aso_mtr_wait(struct mlx5_priv *priv,
+		      struct mlx5_aso_mtr *mtr, bool is_tmpl_api);
 int mlx5_aso_ct_update_by_wqe(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
 			      struct mlx5_aso_ct_action *ct,
 			      const struct rte_flow_action_conntrack *profile,
diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index f311443472..ab9eb21e01 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -792,7 +792,7 @@ mlx5_aso_mtr_sq_enqueue_single(struct mlx5_dev_ctx_shared *sh,
 			       struct mlx5_aso_mtr *aso_mtr,
 			       struct mlx5_mtr_bulk *bulk,
 			       bool need_lock,
-			       void *user_data,
+			       struct mlx5_hw_q_job *job,
 			       bool push)
 {
 	volatile struct mlx5_aso_wqe *wqe = NULL;
@@ -819,7 +819,7 @@ mlx5_aso_mtr_sq_enqueue_single(struct mlx5_dev_ctx_shared *sh,
 	rte_prefetch0(&sq->sq_obj.aso_wqes[(sq->head + 1) & mask]);
 	/* Fill next WQE. */
 	fm = &aso_mtr->fm;
-	sq->elts[sq->head & mask].mtr = user_data ? user_data : aso_mtr;
+	sq->elts[sq->head & mask].user_data = job ? job : (void *)aso_mtr;
 	if (aso_mtr->type == ASO_METER_INDIRECT) {
 		if (likely(sh->config.dv_flow_en == 2))
 			pool = aso_mtr->pool;
@@ -897,24 +897,6 @@ mlx5_aso_mtr_sq_enqueue_single(struct mlx5_dev_ctx_shared *sh,
 	return 1;
 }
 
-static void
-mlx5_aso_mtrs_status_update(struct mlx5_aso_sq *sq, uint16_t aso_mtrs_nums)
-{
-	uint16_t size = 1 << sq->log_desc_n;
-	uint16_t mask = size - 1;
-	uint16_t i;
-	struct mlx5_aso_mtr *aso_mtr = NULL;
-	uint8_t exp_state = ASO_METER_WAIT;
-
-	for (i = 0; i < aso_mtrs_nums; ++i) {
-		aso_mtr = sq->elts[(sq->tail + i) & mask].mtr;
-		MLX5_ASSERT(aso_mtr);
-		(void)__atomic_compare_exchange_n(&aso_mtr->state,
-				&exp_state, ASO_METER_READY,
-				false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
-	}
-}
-
 static void
 mlx5_aso_mtr_completion_handle(struct mlx5_aso_sq *sq, bool need_lock)
 {
@@ -925,7 +907,7 @@ mlx5_aso_mtr_completion_handle(struct mlx5_aso_sq *sq, bool need_lock)
 	uint32_t idx;
 	uint32_t next_idx = cq->cq_ci & mask;
 	uint16_t max;
-	uint16_t n = 0;
+	uint16_t i, n = 0;
 	int ret;
 
 	if (need_lock)
@@ -957,7 +939,19 @@ mlx5_aso_mtr_completion_handle(struct mlx5_aso_sq *sq, bool need_lock)
 		cq->cq_ci++;
 	} while (1);
 	if (likely(n)) {
-		mlx5_aso_mtrs_status_update(sq, n);
+		uint8_t exp_state = ASO_METER_WAIT;
+		struct mlx5_aso_mtr *aso_mtr;
+		__rte_unused bool verdict;
+
+		for (i = 0; i < n; ++i) {
+			aso_mtr = sq->elts[(sq->tail + i) & mask].mtr;
+			MLX5_ASSERT(aso_mtr);
+			verdict = __atomic_compare_exchange_n(&aso_mtr->state,
+						    &exp_state, ASO_METER_READY,
+						    false, __ATOMIC_RELAXED,
+						    __ATOMIC_RELAXED);
+			MLX5_ASSERT(verdict);
+		}
 		sq->tail += n;
 		rte_io_wmb();
 		cq->cq_obj.db_rec[0] = rte_cpu_to_be_32(cq->cq_ci);
@@ -966,6 +960,82 @@ mlx5_aso_mtr_completion_handle(struct mlx5_aso_sq *sq, bool need_lock)
 		rte_spinlock_unlock(&sq->sqsl);
 }
 
+static __rte_always_inline struct mlx5_aso_sq *
+mlx5_aso_mtr_select_sq(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
+		       struct mlx5_aso_mtr *mtr, bool *need_lock)
+{
+	struct mlx5_aso_sq *sq;
+
+	if (likely(sh->config.dv_flow_en == 2) &&
+	    mtr->type == ASO_METER_INDIRECT) {
+		if (queue == MLX5_HW_INV_QUEUE) {
+			sq = &mtr->pool->sq[mtr->pool->nb_sq - 1];
+			*need_lock = true;
+		} else {
+			sq = &mtr->pool->sq[queue];
+			*need_lock = false;
+		}
+	} else {
+		sq = &sh->mtrmng->pools_mng.sq;
+		*need_lock = true;
+	}
+	return sq;
+}
+
+#if defined(HAVE_MLX5_HWS_SUPPORT)
+static void
+mlx5_aso_poll_cq_mtr_hws(struct mlx5_priv *priv, struct mlx5_aso_sq *sq)
+{
+#define MLX5_HWS_MTR_CMPL_NUM 4
+
+	int i, ret;
+	struct mlx5_aso_mtr *mtr;
+	uint8_t exp_state = ASO_METER_WAIT;
+	struct rte_flow_op_result res[MLX5_HWS_MTR_CMPL_NUM];
+	__rte_unused bool verdict;
+
+	rte_spinlock_lock(&sq->sqsl);
+repeat:
+	ret = mlx5_aso_pull_completion(sq, res, MLX5_HWS_MTR_CMPL_NUM);
+	if (ret) {
+		for (i = 0; i < ret; i++) {
+			struct mlx5_hw_q_job *job = res[i].user_data;
+
+			MLX5_ASSERT(job);
+			mtr = mlx5_ipool_get(priv->hws_mpool->idx_pool,
+					     MLX5_INDIRECT_ACTION_IDX_GET(job->action));
+			MLX5_ASSERT(mtr);
+			verdict = __atomic_compare_exchange_n(&mtr->state,
+						    &exp_state, ASO_METER_READY,
+						    false, __ATOMIC_RELAXED,
+						    __ATOMIC_RELAXED);
+			MLX5_ASSERT(verdict);
+			flow_hw_job_put(priv, job, CTRL_QUEUE_ID(priv));
+		}
+		if (ret == MLX5_HWS_MTR_CMPL_NUM)
+			goto repeat;
+	}
+	rte_spinlock_unlock(&sq->sqsl);
+
+#undef MLX5_HWS_MTR_CMPL_NUM
+}
+#else
+static void
+mlx5_aso_poll_cq_mtr_hws(__rte_unused struct mlx5_priv *priv, __rte_unused struct mlx5_aso_sq *sq)
+{
+	MLX5_ASSERT(false);
+}
+#endif
+
+static void
+mlx5_aso_poll_cq_mtr_sws(__rte_unused struct mlx5_priv *priv,
+			 struct mlx5_aso_sq *sq)
+{
+	mlx5_aso_mtr_completion_handle(sq, true);
+}
+
+typedef void (*poll_cq_t)(struct mlx5_priv *, struct mlx5_aso_sq *);
+
 /**
  * Update meter parameter by send WQE.
  *
@@ -980,39 +1050,29 @@ mlx5_aso_mtr_completion_handle(struct mlx5_aso_sq *sq, bool need_lock)
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-mlx5_aso_meter_update_by_wqe(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
-			struct mlx5_aso_mtr *mtr,
-			struct mlx5_mtr_bulk *bulk,
-			void *user_data,
-			bool push)
+mlx5_aso_meter_update_by_wqe(struct mlx5_priv *priv, uint32_t queue,
+			     struct mlx5_aso_mtr *mtr,
+			     struct mlx5_mtr_bulk *bulk,
+			     struct mlx5_hw_q_job *job, bool push)
 {
-	struct mlx5_aso_sq *sq;
-	uint32_t poll_wqe_times = MLX5_MTR_POLL_WQE_CQE_TIMES;
 	bool need_lock;
+	struct mlx5_dev_ctx_shared *sh = priv->sh;
+	struct mlx5_aso_sq *sq =
+		mlx5_aso_mtr_select_sq(sh, queue, mtr, &need_lock);
+	uint32_t poll_wqe_times = MLX5_MTR_POLL_WQE_CQE_TIMES;
+	poll_cq_t poll_mtr_cq =
+		job ? mlx5_aso_poll_cq_mtr_hws : mlx5_aso_poll_cq_mtr_sws;
 	int ret;
 
-	if (likely(sh->config.dv_flow_en == 2) &&
-	    mtr->type == ASO_METER_INDIRECT) {
-		if (queue == MLX5_HW_INV_QUEUE) {
-			sq = &mtr->pool->sq[mtr->pool->nb_sq - 1];
-			need_lock = true;
-		} else {
-			sq = &mtr->pool->sq[queue];
-			need_lock = false;
-		}
-	} else {
-		sq = &sh->mtrmng->pools_mng.sq;
-		need_lock = true;
-	}
 	if (queue != MLX5_HW_INV_QUEUE) {
 		ret = mlx5_aso_mtr_sq_enqueue_single(sh, sq, mtr, bulk,
-						     need_lock, user_data, push);
+						     need_lock, job, push);
 		return ret > 0 ? 0 : -1;
 	}
 	do {
-		mlx5_aso_mtr_completion_handle(sq, need_lock);
+		poll_mtr_cq(priv, sq);
 		if (mlx5_aso_mtr_sq_enqueue_single(sh, sq, mtr, bulk,
-						   need_lock, NULL, true))
+						   need_lock, job, true))
 			return 0;
 		/* Waiting for wqe resource. */
 		rte_delay_us_sleep(MLX5_ASO_WQE_CQE_RESPONSE_DELAY);
@@ -1036,32 +1096,22 @@ mlx5_aso_meter_update_by_wqe(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
 int
-mlx5_aso_mtr_wait(struct mlx5_dev_ctx_shared *sh, uint32_t queue,
-			struct mlx5_aso_mtr *mtr)
+mlx5_aso_mtr_wait(struct mlx5_priv *priv,
+		  struct mlx5_aso_mtr *mtr, bool is_tmpl_api)
 {
+	bool need_lock;
 	struct mlx5_aso_sq *sq;
+	struct mlx5_dev_ctx_shared *sh = priv->sh;
 	uint32_t poll_cqe_times = MLX5_MTR_POLL_WQE_CQE_TIMES;
-	uint8_t state;
-	bool need_lock;
+	uint8_t state = __atomic_load_n(&mtr->state, __ATOMIC_RELAXED);
+	poll_cq_t poll_mtr_cq =
+		is_tmpl_api ? mlx5_aso_poll_cq_mtr_hws : mlx5_aso_poll_cq_mtr_sws;
 
-	if (likely(sh->config.dv_flow_en == 2) &&
-	    mtr->type == ASO_METER_INDIRECT) {
-		if (queue == MLX5_HW_INV_QUEUE) {
-			sq = &mtr->pool->sq[mtr->pool->nb_sq - 1];
-			need_lock = true;
-		} else {
-			sq = &mtr->pool->sq[queue];
-			need_lock = false;
-		}
-	} else {
-		sq = &sh->mtrmng->pools_mng.sq;
-		need_lock = true;
-	}
-	state = __atomic_load_n(&mtr->state, __ATOMIC_RELAXED);
 	if (state == ASO_METER_READY || state == ASO_METER_WAIT_ASYNC)
 		return 0;
+	sq = mlx5_aso_mtr_select_sq(sh, MLX5_HW_INV_QUEUE, mtr, &need_lock);
 	do {
-		mlx5_aso_mtr_completion_handle(sq, need_lock);
+		poll_mtr_cq(priv, sq);
 		if (__atomic_load_n(&mtr->state, __ATOMIC_RELAXED) ==
 					    ASO_METER_READY)
 			return 0;
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 6aaf3aee2a..f43ffb1d4e 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -104,6 +104,12 @@ struct mlx5_tbl_multi_pattern_ctx {
 
 #define MLX5_EMPTY_MULTI_PATTERN_CTX {{{0,}},}
 
+static __rte_always_inline struct mlx5_hw_q_job *
+flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+			const struct rte_flow_action_handle *handle,
+			void *user_data, void *query_data,
+			enum mlx5_hw_job_type type,
+			struct rte_flow_error *error);
 static int
 mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev,
 			       struct rte_flow_template_table *tbl,
@@ -277,21 +283,6 @@ static const struct rte_flow_item_eth ctrl_rx_eth_bcast_spec = {
 	.hdr.ether_type = 0,
 };
 
-static __rte_always_inline struct mlx5_hw_q_job *
-flow_hw_job_get(struct mlx5_priv *priv, uint32_t queue)
-{
-	MLX5_ASSERT(priv->hw_q[queue].job_idx <= priv->hw_q[queue].size);
-	return priv->hw_q[queue].job_idx ?
-	       priv->hw_q[queue].job[--priv->hw_q[queue].job_idx] : NULL;
-}
-
-static __rte_always_inline void
-flow_hw_job_put(struct mlx5_priv *priv, struct mlx5_hw_q_job *job, uint32_t queue)
-{
-	MLX5_ASSERT(priv->hw_q[queue].job_idx < priv->hw_q[queue].size);
-	priv->hw_q[queue].job[priv->hw_q[queue].job_idx++] = job;
-}
-
 static inline enum mlx5dr_matcher_insert_mode
 flow_hw_matcher_insert_mode_get(enum rte_flow_table_insertion_type insert_type)
 {
@@ -1458,7 +1449,7 @@ flow_hw_meter_compile(struct rte_eth_dev *dev,
 	acts->rule_acts[jump_pos].action = (!!group) ?
 				    acts->jump->hws_action :
 				    acts->jump->root_action;
-	if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr))
+	if (mlx5_aso_mtr_wait(priv, aso_mtr, true))
 		return -ENOMEM;
 	return 0;
 }
@@ -1535,7 +1526,7 @@ static rte_be32_t vlan_hdr_to_be32(const struct rte_flow_action *actions)
 static __rte_always_inline struct mlx5_aso_mtr *
 flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
 			 const struct rte_flow_action *action,
-			 void *user_data, bool push)
+			 struct mlx5_hw_q_job *job, bool push)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_aso_mtr_pool *pool = priv->hws_mpool;
@@ -1543,6 +1534,8 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
 	struct mlx5_aso_mtr *aso_mtr;
 	struct mlx5_flow_meter_info *fm;
 	uint32_t mtr_id;
+	uintptr_t handle = (uintptr_t)MLX5_INDIRECT_ACTION_TYPE_METER_MARK <<
+					MLX5_INDIRECT_ACTION_TYPE_OFFSET;
 
 	if (meter_mark->profile == NULL)
 		return NULL;
@@ -1561,15 +1554,16 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
 			  ASO_METER_WAIT : ASO_METER_WAIT_ASYNC;
 	aso_mtr->offset = mtr_id - 1;
 	aso_mtr->init_color = fm->color_aware ? RTE_COLORS : RTE_COLOR_GREEN;
+	job->action = (void *)(handle | mtr_id);
 	/* Update ASO flow meter by wqe. */
-	if (mlx5_aso_meter_update_by_wqe(priv->sh, queue, aso_mtr,
-					 &priv->mtr_bulk, user_data, push)) {
+	if (mlx5_aso_meter_update_by_wqe(priv, queue, aso_mtr,
+					 &priv->mtr_bulk, job, push)) {
 		mlx5_ipool_free(pool->idx_pool, mtr_id);
 		return NULL;
 	}
 	/* Wait for ASO object completion. */
 	if (queue == MLX5_HW_INV_QUEUE &&
-	    mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) {
+	    mlx5_aso_mtr_wait(priv, aso_mtr, true)) {
 		mlx5_ipool_free(pool->idx_pool, mtr_id);
 		return NULL;
 	}
@@ -1587,10 +1581,17 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_aso_mtr_pool *pool = priv->hws_mpool;
 	struct mlx5_aso_mtr *aso_mtr;
+	struct mlx5_hw_q_job *job =
+		flow_hw_action_job_init(priv, queue, NULL, NULL, NULL,
+					MLX5_HW_Q_JOB_TYPE_CREATE, NULL);
 
-	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, NULL, true);
-	if (!aso_mtr)
+	if (!job)
+		return -1;
+	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job, true);
+	if (!aso_mtr) {
+		flow_hw_job_put(priv, job, queue);
 		return -1;
+	}
 
 	/* Compile METER_MARK action */
 	acts[aso_mtr_pos].action = pool->action;
@@ -3099,7 +3100,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
 							 jump->root_action;
 			job->flow->jump = jump;
 			job->flow->fate_type = MLX5_FLOW_FATE_JUMP;
-			if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr))
+			if (mlx5_aso_mtr_wait(priv, aso_mtr, true))
 				return -1;
 			break;
 		case RTE_FLOW_ACTION_TYPE_AGE:
@@ -3777,13 +3778,6 @@ flow_hw_pull_legacy_indirect_comp(struct rte_eth_dev *dev, struct mlx5_hw_q_job
 						job->query.hw);
 			aso_ct->state = ASO_CONNTRACK_READY;
 		}
-	} else {
-		/*
-		 * rte_flow_op_result::user data can point to
-		 * struct mlx5_aso_mtr object as well
-		 */
-		if (queue != CTRL_QUEUE_ID(priv))
-			MLX5_ASSERT(false);
 	}
 }
 
@@ -10067,7 +10061,8 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 {
 	struct mlx5_hw_q_job *job;
 
-	MLX5_ASSERT(queue != MLX5_HW_INV_QUEUE);
+	if (queue == MLX5_HW_INV_QUEUE)
+		queue = CTRL_QUEUE_ID(priv);
 	job = flow_hw_job_get(priv, queue);
 	if (!job) {
 		rte_flow_error_set(error, ENOMEM,
@@ -10082,6 +10077,17 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 	return job;
 }
 
+struct mlx5_hw_q_job *
+mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+			  const struct rte_flow_action_handle *handle,
+			  void *user_data, void *query_data,
+			  enum mlx5_hw_job_type type,
+			  struct rte_flow_error *error)
+{
+	return flow_hw_action_job_init(priv, queue, handle, user_data, query_data,
+				       type, error);
+}
+
 static __rte_always_inline void
 flow_hw_action_finalize(struct rte_eth_dev *dev, uint32_t queue,
 			struct mlx5_hw_q_job *job,
@@ -10141,12 +10147,12 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	const struct rte_flow_action_age *age;
 	struct mlx5_aso_mtr *aso_mtr;
 	cnt_id_t cnt_id;
-	uint32_t mtr_id;
 	uint32_t age_idx;
 	bool push = flow_hw_action_push(attr);
 	bool aso = false;
+	bool force_job = action->type == RTE_FLOW_ACTION_TYPE_METER_MARK;
 
-	if (attr) {
+	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, NULL, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_CREATE,
 					      error);
@@ -10201,9 +10207,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 		aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job, push);
 		if (!aso_mtr)
 			break;
-		mtr_id = (MLX5_INDIRECT_ACTION_TYPE_METER_MARK <<
-			MLX5_INDIRECT_ACTION_TYPE_OFFSET) | (aso_mtr->fm.meter_id);
-		handle = (struct rte_flow_action_handle *)(uintptr_t)mtr_id;
+		handle = (void *)(uintptr_t)job->action;
 		break;
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		handle = flow_dv_action_create(dev, conf, action, error);
@@ -10218,7 +10222,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 				   NULL, "action type not supported");
 		break;
 	}
-	if (job) {
+	if (job && !force_job) {
 		job->action = handle;
 		job->indirect_type = MLX5_HW_INDIRECT_TYPE_LEGACY;
 		flow_hw_action_finalize(dev, queue, job, push, aso,
@@ -10251,15 +10255,17 @@ mlx5_flow_update_meter_mark(struct rte_eth_dev *dev, uint32_t queue,
 		fm->color_aware = meter_mark->color_mode;
 	if (upd_meter_mark->state_valid)
 		fm->is_enable = meter_mark->state;
+	aso_mtr->state = (queue == MLX5_HW_INV_QUEUE) ?
+			 ASO_METER_WAIT : ASO_METER_WAIT_ASYNC;
 	/* Update ASO flow meter by wqe. */
-	if (mlx5_aso_meter_update_by_wqe(priv->sh, queue,
+	if (mlx5_aso_meter_update_by_wqe(priv, queue,
 					 aso_mtr, &priv->mtr_bulk, job, push))
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, "Unable to update ASO meter WQE");
 	/* Wait for ASO object completion. */
 	if (queue == MLX5_HW_INV_QUEUE &&
-	    mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr))
+	    mlx5_aso_mtr_wait(priv, aso_mtr, true))
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, "Unable to wait for ASO meter CQE");
@@ -10305,8 +10311,9 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
 	int ret = 0;
 	bool push = flow_hw_action_push(attr);
 	bool aso = false;
+	bool force_job = type == MLX5_INDIRECT_ACTION_TYPE_METER_MARK;
 
-	if (attr) {
+	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_UPDATE,
 					      error);
@@ -10343,7 +10350,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
 					  "action type not supported");
 		break;
 	}
-	if (job)
+	if (job && !force_job)
 		flow_hw_action_finalize(dev, queue, job, push, aso, ret == 0);
 	return ret;
 }
@@ -10386,8 +10393,9 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 	bool push = flow_hw_action_push(attr);
 	bool aso = false;
 	int ret = 0;
+	bool force_job = type == MLX5_INDIRECT_ACTION_TYPE_METER_MARK;
 
-	if (attr) {
+	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_DESTROY,
 					      error);
@@ -10423,7 +10431,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 		fm = &aso_mtr->fm;
 		fm->is_enable = 0;
 		/* Update ASO flow meter by wqe. */
-		if (mlx5_aso_meter_update_by_wqe(priv->sh, queue, aso_mtr,
+		if (mlx5_aso_meter_update_by_wqe(priv, queue, aso_mtr,
 						 &priv->mtr_bulk, job, push)) {
 			ret = -EINVAL;
 			rte_flow_error_set(error, EINVAL,
@@ -10433,7 +10441,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 		}
 		/* Wait for ASO object completion. */
 		if (queue == MLX5_HW_INV_QUEUE &&
-		    mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) {
+		    mlx5_aso_mtr_wait(priv, aso_mtr, true)) {
 			ret = -EINVAL;
 			rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -10457,7 +10465,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 					  "action type not supported");
 		break;
 	}
-	if (job)
+	if (job && !force_job)
 		flow_hw_action_finalize(dev, queue, job, push, aso, ret == 0);
 	return ret;
 }
diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index beeb868c8c..249dc73691 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -1613,12 +1613,12 @@ mlx5_flow_meter_action_modify(struct mlx5_priv *priv,
 	if (sh->meter_aso_en) {
 		fm->is_enable = !!is_enable;
 		aso_mtr = container_of(fm, struct mlx5_aso_mtr, fm);
-		ret = mlx5_aso_meter_update_by_wqe(sh, MLX5_HW_INV_QUEUE,
+		ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE,
 						   aso_mtr, &priv->mtr_bulk,
 						   NULL, true);
 		if (ret)
 			return ret;
-		ret = mlx5_aso_mtr_wait(sh, MLX5_HW_INV_QUEUE, aso_mtr);
+		ret = mlx5_aso_mtr_wait(priv, aso_mtr, false);
 		if (ret)
 			return ret;
 	} else {
@@ -1864,7 +1864,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	/* If ASO meter supported, update ASO flow meter by wqe. */
 	if (priv->sh->meter_aso_en) {
 		aso_mtr = container_of(fm, struct mlx5_aso_mtr, fm);
-		ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE,
+		ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE,
 						   aso_mtr, &priv->mtr_bulk, NULL, true);
 		if (ret)
 			goto error;
@@ -1926,6 +1926,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	struct mlx5_flow_meter_info *fm;
 	struct mlx5_flow_meter_policy *policy = NULL;
 	struct mlx5_aso_mtr *aso_mtr;
+	struct mlx5_hw_q_job *job;
 	int ret;
 
 	if (!priv->mtr_profile_arr ||
@@ -1971,12 +1972,20 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	fm->shared = !!shared;
 	fm->initialized = 1;
 	/* Update ASO flow meter by wqe. */
-	ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr,
-					   &priv->mtr_bulk, NULL, true);
-	if (ret)
+	job = mlx5_flow_action_job_init(priv, MLX5_HW_INV_QUEUE, NULL, NULL,
+					NULL, MLX5_HW_Q_JOB_TYPE_CREATE, NULL);
+	if (!job)
+		return -rte_mtr_error_set(error, ENOMEM,
+					  RTE_MTR_ERROR_TYPE_MTR_ID,
+					  NULL, "No job context.");
+	ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE, aso_mtr,
+					   &priv->mtr_bulk, job, true);
+	if (ret) {
+		flow_hw_job_put(priv, job, MLX5_HW_INV_QUEUE);
 		return -rte_mtr_error_set(error, ENOTSUP,
-			RTE_MTR_ERROR_TYPE_UNSPECIFIED,
-			NULL, "Failed to create devx meter.");
+					  RTE_MTR_ERROR_TYPE_UNSPECIFIED,
+					  NULL, "Failed to create devx meter.");
+	}
 	fm->active_state = params->meter_enable;
 	__atomic_fetch_add(&fm->profile->ref_cnt, 1, __ATOMIC_RELAXED);
 	__atomic_fetch_add(&policy->ref_cnt, 1, __ATOMIC_RELAXED);
@@ -2627,7 +2636,7 @@ mlx5_flow_meter_attach(struct mlx5_priv *priv,
 		struct mlx5_aso_mtr *aso_mtr;
 
 		aso_mtr = container_of(fm, struct mlx5_aso_mtr, fm);
-		if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) {
+		if (mlx5_aso_mtr_wait(priv, aso_mtr, false)) {
 			return rte_flow_error_set(error, ENOENT,
 					RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					NULL,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.850160106 +0800
+++ 0093-net-mlx5-fix-sync-meter-processing-in-HWS.patch	2024-04-13 20:43:05.057753853 +0800
@@ -1 +1 @@
-From 4359d9d1f76b9ac35e548fe958b59ae4e1cbf11b Mon Sep 17 00:00:00 2001
+From 7192f0ed8230f93e80915d0e37198d710952be9f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4359d9d1f76b9ac35e548fe958b59ae4e1cbf11b ]
@@ -24 +26,0 @@
-Cc: stable@dpdk.org
@@ -31 +33 @@
- drivers/net/mlx5/mlx5_flow_hw.c    |  99 ++++++++--------
+ drivers/net/mlx5/mlx5_flow_hw.c    |  98 ++++++++--------
@@ -33 +35 @@
- 4 files changed, 216 insertions(+), 123 deletions(-)
+ 4 files changed, 215 insertions(+), 123 deletions(-)
@@ -36 +38 @@
-index 2fb3bb65cc..6ff8f322e0 100644
+index 153374802a..e2c6fe0d00 100644
@@ -39 +41 @@
-@@ -2033,6 +2033,30 @@ enum dr_dump_rec_type {
+@@ -1997,6 +1997,30 @@ enum dr_dump_rec_type {
@@ -70 +72 @@
-@@ -2443,11 +2467,12 @@ int mlx5_aso_flow_hit_queue_poll_start(struct mlx5_dev_ctx_shared *sh);
+@@ -2403,11 +2427,12 @@ int mlx5_aso_flow_hit_queue_poll_start(struct mlx5_dev_ctx_shared *sh);
@@ -344 +346 @@
-index c1b09c9c03..8f004b5435 100644
+index 6aaf3aee2a..f43ffb1d4e 100644
@@ -347,3 +349,3 @@
-@@ -183,6 +183,12 @@ mlx5_flow_hw_aux_get_mtr_id(struct rte_flow_hw *flow, struct rte_flow_hw_aux *au
- 		return aux->orig.mtr_id;
- }
+@@ -104,6 +104,12 @@ struct mlx5_tbl_multi_pattern_ctx {
+ 
+ #define MLX5_EMPTY_MULTI_PATTERN_CTX {{{0,}},}
@@ -360,3 +362,3 @@
-@@ -384,21 +390,6 @@ flow_hw_q_dec_flow_ops(struct mlx5_priv *priv, uint32_t queue)
- 	q->ongoing_flow_ops--;
- }
+@@ -277,21 +283,6 @@ static const struct rte_flow_item_eth ctrl_rx_eth_bcast_spec = {
+ 	.hdr.ether_type = 0,
+ };
@@ -382 +384 @@
-@@ -1560,7 +1551,7 @@ flow_hw_meter_compile(struct rte_eth_dev *dev,
+@@ -1458,7 +1449,7 @@ flow_hw_meter_compile(struct rte_eth_dev *dev,
@@ -391 +393 @@
-@@ -1637,7 +1628,7 @@ static rte_be32_t vlan_hdr_to_be32(const struct rte_flow_action *actions)
+@@ -1535,7 +1526,7 @@ static rte_be32_t vlan_hdr_to_be32(const struct rte_flow_action *actions)
@@ -395,3 +397,2 @@
--			 void *user_data, bool push,
-+			 struct mlx5_hw_q_job *job, bool push,
- 			 struct rte_flow_error *error)
+-			 void *user_data, bool push)
++			 struct mlx5_hw_q_job *job, bool push)
@@ -400 +401,2 @@
-@@ -1646,6 +1637,8 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
+ 	struct mlx5_aso_mtr_pool *pool = priv->hws_mpool;
+@@ -1543,6 +1534,8 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
@@ -407,3 +409,3 @@
- 	if (priv->shared_host) {
- 		rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
-@@ -1669,15 +1662,16 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
+ 	if (meter_mark->profile == NULL)
+ 		return NULL;
+@@ -1561,15 +1554,16 @@ flow_hw_meter_mark_alloc(struct rte_eth_dev *dev, uint32_t queue,
@@ -429 +431 @@
-@@ -1696,10 +1690,18 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
+@@ -1587,10 +1581,17 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
@@ -437 +439 @@
--	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, NULL, true, error);
+-	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, NULL, true);
@@ -441,2 +443 @@
-+	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job,
-+					   true, error);
++	aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job, true);
@@ -450 +451 @@
-@@ -3275,7 +3277,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
+@@ -3099,7 +3100,7 @@ flow_hw_actions_construct(struct rte_eth_dev *dev,
@@ -452,2 +453,2 @@
- 			flow->jump = jump;
- 			flow->flags |= MLX5_FLOW_HW_FLOW_FLAG_FATE_JUMP;
+ 			job->flow->jump = jump;
+ 			job->flow->fate_type = MLX5_FLOW_FATE_JUMP;
@@ -459 +460 @@
-@@ -4009,13 +4011,6 @@ flow_hw_pull_legacy_indirect_comp(struct rte_eth_dev *dev, struct mlx5_hw_q_job
+@@ -3777,13 +3778,6 @@ flow_hw_pull_legacy_indirect_comp(struct rte_eth_dev *dev, struct mlx5_hw_q_job
@@ -473 +474 @@
-@@ -11007,7 +11002,8 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -10067,7 +10061,8 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -483 +484 @@
-@@ -11022,6 +11018,17 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -10082,6 +10077,17 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -501 +502 @@
-@@ -11081,12 +11088,12 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10141,12 +10147,12 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -516,2 +517,2 @@
-@@ -11141,9 +11148,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
- 		aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job, push, error);
+@@ -10201,9 +10207,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+ 		aso_mtr = flow_hw_meter_mark_alloc(dev, queue, action, job, push);
@@ -527 +528 @@
-@@ -11158,7 +11163,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10218,7 +10222,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -536 +537 @@
-@@ -11191,15 +11196,17 @@ mlx5_flow_update_meter_mark(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10251,15 +10255,17 @@ mlx5_flow_update_meter_mark(struct rte_eth_dev *dev, uint32_t queue,
@@ -556 +557 @@
-@@ -11245,8 +11252,9 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10305,8 +10311,9 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
@@ -567 +568 @@
-@@ -11283,7 +11291,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10343,7 +10350,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
@@ -576 +577 @@
-@@ -11326,8 +11334,9 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10386,8 +10393,9 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -587 +588 @@
-@@ -11363,7 +11372,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10423,7 +10431,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -596 +597 @@
-@@ -11373,7 +11382,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10433,7 +10441,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -605 +606 @@
-@@ -11397,7 +11406,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10457,7 +10465,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -615 +616 @@
-index 57de95b4b9..4045c4c249 100644
+index beeb868c8c..249dc73691 100644
@@ -618 +619 @@
-@@ -1897,12 +1897,12 @@ mlx5_flow_meter_action_modify(struct mlx5_priv *priv,
+@@ -1613,12 +1613,12 @@ mlx5_flow_meter_action_modify(struct mlx5_priv *priv,
@@ -633 +634 @@
-@@ -2148,7 +2148,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -1864,7 +1864,7 @@ mlx5_flow_meter_create(struct rte_eth_dev *dev, uint32_t meter_id,
@@ -642 +643 @@
-@@ -2210,6 +2210,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -1926,6 +1926,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
@@ -650 +651 @@
-@@ -2255,12 +2256,20 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -1971,12 +1972,20 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
@@ -676 +677 @@
-@@ -2911,7 +2920,7 @@ mlx5_flow_meter_attach(struct mlx5_priv *priv,
+@@ -2627,7 +2636,7 @@ mlx5_flow_meter_attach(struct mlx5_priv *priv,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix indirect action async job initialization' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (91 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix sync meter processing in HWS' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix non-masked indirect list meter translation' " Xueming Li
                     ` (30 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1994df02c988a2f1d70cfd192ecd2098edfc6713

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1994df02c988a2f1d70cfd192ecd2098edfc6713 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 7 Mar 2024 12:19:10 +0200
Subject: [PATCH] net/mlx5: fix indirect action async job initialization
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1a8b80329748033eb3bb9ed7433e0aef1bbcd838 ]

MLX5 PMD driver supports 2 types of indirect actions:
legacy INDIRECT and INDIRECT_LIST.
PMD has different handlers for each of indirection actions types.
Therefore PMD marks async `job::indirect_type` with relevant value.

PMD set the type only during indirect action creation.
Legacy INDIRECT query could have get a job object used previously by
INDIRECT_LIST action. In that case such job object was handled as
INDIRECT_LIST because the `job::indirect_type` was not re-assigned.

The patch sets `job::indirect_type` during the job initialization
according to operation type.

Fixes: 59155721936e ("net/mlx5: fix indirect flow completion processing")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index f43ffb1d4e..6d0f1beeec 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -109,6 +109,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 			const struct rte_flow_action_handle *handle,
 			void *user_data, void *query_data,
 			enum mlx5_hw_job_type type,
+			enum mlx5_hw_indirect_type indirect_type,
 			struct rte_flow_error *error);
 static int
 mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev,
@@ -1583,7 +1584,8 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
 	struct mlx5_aso_mtr *aso_mtr;
 	struct mlx5_hw_q_job *job =
 		flow_hw_action_job_init(priv, queue, NULL, NULL, NULL,
-					MLX5_HW_Q_JOB_TYPE_CREATE, NULL);
+					MLX5_HW_Q_JOB_TYPE_CREATE,
+					MLX5_HW_INDIRECT_TYPE_LEGACY, NULL);
 
 	if (!job)
 		return -1;
@@ -10057,6 +10059,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 			const struct rte_flow_action_handle *handle,
 			void *user_data, void *query_data,
 			enum mlx5_hw_job_type type,
+			enum mlx5_hw_indirect_type indirect_type,
 			struct rte_flow_error *error)
 {
 	struct mlx5_hw_q_job *job;
@@ -10074,6 +10077,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 	job->action = handle;
 	job->user_data = user_data;
 	job->query.user = query_data;
+	job->indirect_type = indirect_type;
 	return job;
 }
 
@@ -10085,7 +10089,7 @@ mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue,
 			  struct rte_flow_error *error)
 {
 	return flow_hw_action_job_init(priv, queue, handle, user_data, query_data,
-				       type, error);
+				       type, MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 }
 
 static __rte_always_inline void
@@ -10155,7 +10159,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, NULL, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_CREATE,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 		if (!job)
 			return NULL;
 	}
@@ -10224,7 +10228,6 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	}
 	if (job && !force_job) {
 		job->action = handle;
-		job->indirect_type = MLX5_HW_INDIRECT_TYPE_LEGACY;
 		flow_hw_action_finalize(dev, queue, job, push, aso,
 					handle != NULL);
 	}
@@ -10316,7 +10319,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
 	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_UPDATE,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 		if (!job)
 			return -rte_errno;
 	}
@@ -10398,7 +10401,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 	if (attr || force_job) {
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_DESTROY,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 		if (!job)
 			return -rte_errno;
 	}
@@ -10711,7 +10714,7 @@ flow_hw_action_handle_query(struct rte_eth_dev *dev, uint32_t queue,
 	if (attr) {
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      data, MLX5_HW_Q_JOB_TYPE_QUERY,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 		if (!job)
 			return -rte_errno;
 	}
@@ -10765,7 +10768,7 @@ flow_hw_async_action_handle_query_update
 		job = flow_hw_action_job_init(priv, queue, handle, user_data,
 					      query,
 					      MLX5_HW_Q_JOB_TYPE_UPDATE_QUERY,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LEGACY, error);
 		if (!job)
 			return -rte_errno;
 	}
@@ -11445,7 +11448,7 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	if (attr) {
 		job = flow_hw_action_job_init(priv, queue, NULL, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_CREATE,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LIST, error);
 		if (!job)
 			return NULL;
 	}
@@ -11465,7 +11468,6 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	}
 	if (job) {
 		job->action = handle;
-		job->indirect_type = MLX5_HW_INDIRECT_TYPE_LIST;
 		flow_hw_action_finalize(dev, queue, job, push, false,
 					handle != NULL);
 	}
@@ -11510,7 +11512,7 @@ flow_hw_async_action_list_handle_destroy
 	if (attr) {
 		job = flow_hw_action_job_init(priv, queue, NULL, user_data,
 					      NULL, MLX5_HW_Q_JOB_TYPE_DESTROY,
-					      error);
+					      MLX5_HW_INDIRECT_TYPE_LIST, error);
 		if (!job)
 			return rte_errno;
 	}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.886808758 +0800
+++ 0094-net-mlx5-fix-indirect-action-async-job-initializatio.patch	2024-04-13 20:43:05.057753853 +0800
@@ -1 +1 @@
-From 1a8b80329748033eb3bb9ed7433e0aef1bbcd838 Mon Sep 17 00:00:00 2001
+From 1994df02c988a2f1d70cfd192ecd2098edfc6713 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1a8b80329748033eb3bb9ed7433e0aef1bbcd838 ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 8f004b5435..b9ba05f695 100644
+index f43ffb1d4e..6d0f1beeec 100644
@@ -32 +34 @@
-@@ -188,6 +188,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -109,6 +109,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -40 +42 @@
-@@ -1692,7 +1693,8 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
+@@ -1583,7 +1584,8 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev,
@@ -50 +52 @@
-@@ -10998,6 +11000,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -10057,6 +10059,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -58 +60 @@
-@@ -11015,6 +11018,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -10074,6 +10077,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -66 +68 @@
-@@ -11026,7 +11030,7 @@ mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue,
+@@ -10085,7 +10089,7 @@ mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue,
@@ -75 +77 @@
-@@ -11096,7 +11100,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10155,7 +10159,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -84 +86 @@
-@@ -11165,7 +11169,6 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10224,7 +10228,6 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -92 +94 @@
-@@ -11257,7 +11260,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10316,7 +10319,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue,
@@ -101 +103 @@
-@@ -11339,7 +11342,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10398,7 +10401,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -110 +112 @@
-@@ -11663,7 +11666,7 @@ flow_hw_action_handle_query(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10711,7 +10714,7 @@ flow_hw_action_handle_query(struct rte_eth_dev *dev, uint32_t queue,
@@ -119 +121 @@
-@@ -11717,7 +11720,7 @@ flow_hw_async_action_handle_query_update
+@@ -10765,7 +10768,7 @@ flow_hw_async_action_handle_query_update
@@ -128 +130 @@
-@@ -12397,7 +12400,7 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -11445,7 +11448,7 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -137 +139 @@
-@@ -12417,7 +12420,6 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -11465,7 +11468,6 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
@@ -145 +147 @@
-@@ -12462,7 +12464,7 @@ flow_hw_async_action_list_handle_destroy
+@@ -11510,7 +11512,7 @@ flow_hw_async_action_list_handle_destroy

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix non-masked indirect list meter translation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (92 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix indirect action async job initialization' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'doc: update link to Windows DevX in mlx5 guide' " Xueming Li
                     ` (29 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=af41defcf7a2252f8383ef3ca2643d6937fe7787

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From af41defcf7a2252f8383ef3ca2643d6937fe7787 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 29 Feb 2024 13:31:19 +0200
Subject: [PATCH] net/mlx5: fix non-masked indirect list meter translation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4c041e2f0595e4a4e176a6d1f1a00c30debbc1fe ]

Template table reuses DR5 action handle for non-masked indirect
actions. Flow rule must explicitly translate non-masked indirect
action and update DR5 handle with the rule indirect object.

Current PMD assumed DR5 handle of non-masked indirect action was
always NULL before the action translation.

The patch always translates non-masked indirect list meter object.

Fixes: e26f50adbf38 ("net/mlx5: support indirect list meter mark action")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 6d0f1beeec..7ed0c0ac9b 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1728,15 +1728,9 @@ flow_hw_translate_indirect_meter(struct rte_eth_dev *dev,
 	const struct rte_flow_indirect_update_flow_meter_mark **flow_conf =
 		(typeof(flow_conf))action_conf->conf;
 
-	/*
-	 * Masked indirect handle set dr5 action during template table
-	 * translation.
-	 */
-	if (!dr_rule->action) {
-		ret = flow_dr_set_meter(priv, dr_rule, action_conf);
-		if (ret)
-			return ret;
-	}
+	ret = flow_dr_set_meter(priv, dr_rule, action_conf);
+	if (ret)
+		return ret;
 	if (!act_data->shared_meter.conf_masked) {
 		if (flow_conf && flow_conf[0] && flow_conf[0]->init_color < RTE_COLORS)
 			flow_dr_mtr_flow_color(dr_rule, flow_conf[0]->init_color);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.916616519 +0800
+++ 0095-net-mlx5-fix-non-masked-indirect-list-meter-translat.patch	2024-04-13 20:43:05.067753840 +0800
@@ -1 +1 @@
-From 4c041e2f0595e4a4e176a6d1f1a00c30debbc1fe Mon Sep 17 00:00:00 2001
+From af41defcf7a2252f8383ef3ca2643d6937fe7787 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4c041e2f0595e4a4e176a6d1f1a00c30debbc1fe ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index b9ba05f695..a4e204695e 100644
+index 6d0f1beeec..7ed0c0ac9b 100644
@@ -29 +31 @@
-@@ -1838,15 +1838,9 @@ flow_hw_translate_indirect_meter(struct rte_eth_dev *dev,
+@@ -1728,15 +1728,9 @@ flow_hw_translate_indirect_meter(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: update link to Windows DevX in mlx5 guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (93 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix non-masked indirect list meter translation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix VLAN ID in flow modify' " Xueming Li
                     ` (28 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Ali Alnubani; +Cc: Tal Shnaiderman, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f01fd28181f5b1e6827ff8a5837983ff6817e01c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f01fd28181f5b1e6827ff8a5837983ff6817e01c Mon Sep 17 00:00:00 2001
From: Ali Alnubani <alialnu@nvidia.com>
Date: Thu, 29 Feb 2024 18:45:26 +0200
Subject: [PATCH] doc: update link to Windows DevX in mlx5 guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5ddc8269192ca7aeec0bf903704c0385ebbd9e87 ]

The older link no longer works.

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
---
 doc/guides/platform/mlx5.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst
index 400000e284..d64599699e 100644
--- a/doc/guides/platform/mlx5.rst
+++ b/doc/guides/platform/mlx5.rst
@@ -230,7 +230,7 @@ DevX SDK Installation
 The DevX SDK must be installed on the machine building the Windows PMD.
 Additional information can be found at
 `How to Integrate Windows DevX in Your Development Environment
-<https://docs.nvidia.com/networking/display/winof2v260/RShim+Drivers+and+Usage#RShimDriversandUsage-DevXInterface>`_.
+<https://docs.nvidia.com/networking/display/winof2v290/devx+interface>`_.
 The minimal supported WinOF2 version is 2.60.
 
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.948421978 +0800
+++ 0096-doc-update-link-to-Windows-DevX-in-mlx5-guide.patch	2024-04-13 20:43:05.067753840 +0800
@@ -1 +1 @@
-From 5ddc8269192ca7aeec0bf903704c0385ebbd9e87 Mon Sep 17 00:00:00 2001
+From f01fd28181f5b1e6827ff8a5837983ff6817e01c Mon Sep 17 00:00:00 2001
@@ -4,0 +5 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -6 +7 @@
-The older link no longer works.
+[ upstream commit 5ddc8269192ca7aeec0bf903704c0385ebbd9e87 ]
@@ -8 +9 @@
-Cc: stable@dpdk.org
+The older link no longer works.
@@ -17 +18 @@
-index a66cf778d1..e9a1f52aca 100644
+index 400000e284..d64599699e 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix VLAN ID in flow modify' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (94 preceding siblings ...)
  2024-04-13 12:49   ` patch 'doc: update link to Windows DevX in mlx5 guide' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix meter policy priority' " Xueming Li
                     ` (27 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=78d38b5d67cfa6270eccc58c38611336bb0d6cff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 78d38b5d67cfa6270eccc58c38611336bb0d6cff Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Fri, 1 Mar 2024 08:04:48 +0200
Subject: [PATCH] net/mlx5: fix VLAN ID in flow modify
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d ]

PMD uses MODIFY_FIELD to implement standalone OF_SET_VLAN_VID flow
action.
PMD assigned immediate VLAN Id value to the `.level` member of the
`rte_flow_action_modify_data` structure instead of `.value`.
That assignment has worked because both members had the same offset in
the hosting structure.

The patch assigns VLAN Id directly to `.value`

Fixes: 773ca0e91ba1 ("net/mlx5: support VLAN push/pop/modify with HWS")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 7ed0c0ac9b..aff1ab74e3 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -6224,7 +6224,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 			rm[set_vlan_vid_ix].conf)->vlan_vid != 0);
 	const struct rte_flow_action_of_set_vlan_vid *conf =
 		ra[set_vlan_vid_ix].conf;
-	rte_be16_t vid = masked ? conf->vlan_vid : 0;
 	int width = mlx5_flow_item_field_width(dev, RTE_FLOW_FIELD_VLAN_ID, 0,
 					       NULL, &error);
 	*spec = (typeof(*spec)) {
@@ -6235,8 +6234,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -6248,11 +6245,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = masked ? (1U << width) - 1 : 0,
-			.offset = 0,
 		},
 		.width = 0xffffffff,
 	};
+	if (masked) {
+		uint32_t mask_val = 0xffffffff;
+
+		rte_memcpy(spec->src.value, &conf->vlan_vid, sizeof(conf->vlan_vid));
+		rte_memcpy(mask->src.value, &mask_val, sizeof(mask_val));
+	}
 	ra[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
 	ra[set_vlan_vid_ix].conf = spec;
 	rm[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
@@ -6279,8 +6280,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -6289,6 +6288,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
 		.conf = &conf
 	};
 
+	rte_memcpy(conf.src.value, &vid, sizeof(vid));
 	return flow_hw_modify_field_construct(job, act_data, hw_acts,
 					      &modify_action);
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.975640342 +0800
+++ 0097-net-mlx5-fix-VLAN-ID-in-flow-modify.patch	2024-04-13 20:43:05.067753840 +0800
@@ -1 +1 @@
-From b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d Mon Sep 17 00:00:00 2001
+From 78d38b5d67cfa6270eccc58c38611336bb0d6cff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index a4e204695e..658f5daf82 100644
+index 7ed0c0ac9b..aff1ab74e3 100644
@@ -28 +30 @@
-@@ -6858,7 +6858,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6224,7 +6224,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -36 +38 @@
-@@ -6869,8 +6868,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6235,8 +6234,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -45 +47 @@
-@@ -6882,11 +6879,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6248,11 +6245,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -63 +65 @@
-@@ -6913,8 +6914,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -6279,8 +6280,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -72 +74 @@
-@@ -6923,6 +6922,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -6289,6 +6288,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -77 +79,2 @@
- 	return flow_hw_modify_field_construct(mhdr_cmd, act_data, hw_acts, &modify_action);
+ 	return flow_hw_modify_field_construct(job, act_data, hw_acts,
+ 					      &modify_action);
@@ -79 +81,0 @@
- 

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix meter policy priority' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (95 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix VLAN ID in flow modify' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: remove duplication of L3 flow item validation' " Xueming Li
                     ` (26 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shun Hao; +Cc: Bing Zhao, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a8b06881d95287ac683eaaa536d368bcbc2ac397

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a8b06881d95287ac683eaaa536d368bcbc2ac397 Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh@nvidia.com>
Date: Fri, 1 Mar 2024 10:46:05 +0200
Subject: [PATCH] net/mlx5: fix meter policy priority
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1cfb78d2c40e3b3cf1bad061f21f306272fffd47 ]

Currently a meter policy's flows are always using the same priority for
all colors, so the red color flow might be before green/yellow ones.
This will impact the performance cause green/yellow packets will check
red flow first and got miss, then match green/yellow flows, introducing
more hops.

This patch fixes this by giving the same priority to flows for all
colors.

Fixes: 363db9b00f ("net/mlx5: handle yellow case in default meter policy")

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 41 +++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c0d9e4fb82..1c85331cb6 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17655,9 +17655,8 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
 		}
 	}
 	tbl_data = container_of(tbl_rsc, struct mlx5_flow_tbl_data_entry, tbl);
-	if (priority < RTE_COLOR_RED)
-		flow_dv_match_meta_reg(matcher.mask.buf,
-			(enum modify_reg)color_reg_c_idx, color_mask, color_mask);
+	flow_dv_match_meta_reg(matcher.mask.buf,
+		(enum modify_reg)color_reg_c_idx, color_mask, color_mask);
 	matcher.priority = priority;
 	matcher.crc = rte_raw_cksum((const void *)matcher.mask.buf,
 				    matcher.mask.size);
@@ -17708,7 +17707,6 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 	int i;
 	int ret = mlx5_flow_get_reg_id(dev, MLX5_MTR_COLOR, 0, &flow_err);
 	struct mlx5_sub_policy_color_rule *color_rule;
-	bool svport_match;
 	struct mlx5_sub_policy_color_rule *tmp_rules[RTE_COLORS] = {NULL};
 
 	if (ret < 0)
@@ -17744,10 +17742,9 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 		/* No use. */
 		attr.priority = i;
 		/* Create matchers for colors. */
-		svport_match = (i != RTE_COLOR_RED) ? match_src_port : false;
 		if (__flow_dv_create_policy_matcher(dev, color_reg_c_idx,
 				MLX5_MTR_POLICY_MATCHER_PRIO, sub_policy,
-				&attr, svport_match, NULL,
+				&attr, match_src_port, NULL,
 				&color_rule->matcher, &flow_err)) {
 			DRV_LOG(ERR, "Failed to create color%u matcher.", i);
 			goto err_exit;
@@ -17757,7 +17754,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
 				color_reg_c_idx, (enum rte_color)i,
 				color_rule->matcher,
 				acts[i].actions_n, acts[i].dv_actions,
-				svport_match, NULL, &color_rule->rule,
+				match_src_port, NULL, &color_rule->rule,
 				&attr)) {
 			DRV_LOG(ERR, "Failed to create color%u rule.", i);
 			goto err_exit;
@@ -18640,7 +18637,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 	struct {
 		struct mlx5_flow_meter_policy *fm_policy;
 		struct mlx5_flow_meter_info *next_fm;
-		struct mlx5_sub_policy_color_rule *tag_rule[MLX5_MTR_RTE_COLORS];
+		struct mlx5_sub_policy_color_rule *tag_rule[RTE_COLORS];
 	} fm_info[MLX5_MTR_CHAIN_MAX_NUM] = { {0} };
 	uint32_t fm_cnt = 0;
 	uint32_t i, j;
@@ -18674,14 +18671,22 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 		mtr_policy = fm_info[i].fm_policy;
 		rte_spinlock_lock(&mtr_policy->sl);
 		sub_policy = mtr_policy->sub_policys[domain][0];
-		for (j = 0; j < MLX5_MTR_RTE_COLORS; j++) {
+		for (j = 0; j < RTE_COLORS; j++) {
 			uint8_t act_n = 0;
-			struct mlx5_flow_dv_modify_hdr_resource *modify_hdr;
+			struct mlx5_flow_dv_modify_hdr_resource *modify_hdr = NULL;
 			struct mlx5_flow_dv_port_id_action_resource *port_action;
+			uint8_t fate_action;
 
-			if (mtr_policy->act_cnt[j].fate_action != MLX5_FLOW_FATE_MTR &&
-			    mtr_policy->act_cnt[j].fate_action != MLX5_FLOW_FATE_PORT_ID)
-				continue;
+			if (j == RTE_COLOR_RED) {
+				fate_action = MLX5_FLOW_FATE_DROP;
+			} else {
+				fate_action = mtr_policy->act_cnt[j].fate_action;
+				modify_hdr = mtr_policy->act_cnt[j].modify_hdr;
+				if (fate_action != MLX5_FLOW_FATE_MTR &&
+				    fate_action != MLX5_FLOW_FATE_PORT_ID &&
+				    fate_action != MLX5_FLOW_FATE_DROP)
+					continue;
+			}
 			color_rule = mlx5_malloc(MLX5_MEM_ZERO,
 						 sizeof(struct mlx5_sub_policy_color_rule),
 						 0, SOCKET_ID_ANY);
@@ -18693,9 +18698,8 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 				goto err_exit;
 			}
 			color_rule->src_port = src_port;
-			modify_hdr = mtr_policy->act_cnt[j].modify_hdr;
 			/* Prepare to create color rule. */
-			if (mtr_policy->act_cnt[j].fate_action == MLX5_FLOW_FATE_MTR) {
+			if (fate_action == MLX5_FLOW_FATE_MTR) {
 				next_fm = fm_info[i].next_fm;
 				if (mlx5_flow_meter_attach(priv, next_fm, &attr, error)) {
 					mlx5_free(color_rule);
@@ -18722,7 +18726,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 				}
 				acts.dv_actions[act_n++] = tbl_data->jump.action;
 				acts.actions_n = act_n;
-			} else {
+			} else if (fate_action == MLX5_FLOW_FATE_PORT_ID) {
 				port_action =
 					mlx5_ipool_get(priv->sh->ipool[MLX5_IPOOL_PORT_ID],
 						       mtr_policy->act_cnt[j].rix_port_id_action);
@@ -18735,6 +18739,9 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
 					acts.dv_actions[act_n++] = modify_hdr->action;
 				acts.dv_actions[act_n++] = port_action->action;
 				acts.actions_n = act_n;
+			} else {
+				acts.dv_actions[act_n++] = mtr_policy->dr_drop_action[domain];
+				acts.actions_n = act_n;
 			}
 			fm_info[i].tag_rule[j] = color_rule;
 			TAILQ_INSERT_TAIL(&sub_policy->color_rules[j], color_rule, next_port);
@@ -18766,7 +18773,7 @@ err_exit:
 		mtr_policy = fm_info[i].fm_policy;
 		rte_spinlock_lock(&mtr_policy->sl);
 		sub_policy = mtr_policy->sub_policys[domain][0];
-		for (j = 0; j < MLX5_MTR_RTE_COLORS; j++) {
+		for (j = 0; j < RTE_COLORS; j++) {
 			color_rule = fm_info[i].tag_rule[j];
 			if (!color_rule)
 				continue;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.008132500 +0800
+++ 0098-net-mlx5-fix-meter-policy-priority.patch	2024-04-13 20:43:05.077753827 +0800
@@ -1 +1 @@
-From 1cfb78d2c40e3b3cf1bad061f21f306272fffd47 Mon Sep 17 00:00:00 2001
+From a8b06881d95287ac683eaaa536d368bcbc2ac397 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1cfb78d2c40e3b3cf1bad061f21f306272fffd47 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 18f09b22be..f1584ed6e0 100644
+index c0d9e4fb82..1c85331cb6 100644
@@ -29 +31 @@
-@@ -17922,9 +17922,8 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
+@@ -17655,9 +17655,8 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev,
@@ -41 +43 @@
-@@ -17975,7 +17974,6 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17708,7 +17707,6 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -49 +51 @@
-@@ -18011,10 +18009,9 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17744,10 +17742,9 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -61 +63 @@
-@@ -18024,7 +18021,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
+@@ -17757,7 +17754,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,
@@ -70 +72 @@
-@@ -18907,7 +18904,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
+@@ -18640,7 +18637,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
@@ -79 +81 @@
-@@ -18941,14 +18938,22 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
+@@ -18674,14 +18671,22 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
@@ -107 +109 @@
-@@ -18960,9 +18965,8 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
+@@ -18693,9 +18698,8 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
@@ -118 +120 @@
-@@ -18989,7 +18993,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
+@@ -18722,7 +18726,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
@@ -127 +129 @@
-@@ -19002,6 +19006,9 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
+@@ -18735,6 +18739,9 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev,
@@ -137 +139 @@
-@@ -19033,7 +19040,7 @@ err_exit:
+@@ -18766,7 +18773,7 @@ err_exit:

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: remove duplication of L3 flow item validation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (96 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix meter policy priority' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix IP-in-IP tunnels recognition' " Xueming Li
                     ` (25 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c551015ebb6f2a9615e6e2583603794232665af5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c551015ebb6f2a9615e6e2583603794232665af5 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 29 Feb 2024 18:05:03 +0200
Subject: [PATCH] net/mlx5: remove duplication of L3 flow item validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 27e44a6f53eccc7d2ce80f6466fa214158f0ee81 ]

Remove code duplications in DV L3 items validation translation.

Fixes: 3193c2494eea ("net/mlx5: fix L4 protocol validation")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 151 +++++++++-----------------------
 1 file changed, 43 insertions(+), 108 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 1c85331cb6..eaadbf577f 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -7248,6 +7248,40 @@ flow_dv_validate_item_flex(struct rte_eth_dev *dev,
 	return 0;
 }
 
+static __rte_always_inline uint8_t
+mlx5_flow_l3_next_protocol(const struct rte_flow_item *l3_item,
+			   enum MLX5_SET_MATCHER key_type)
+{
+#define MLX5_L3_NEXT_PROTOCOL(i, ms)                                            \
+	((i)->type == RTE_FLOW_ITEM_TYPE_IPV4 ?                                  \
+	((const struct rte_flow_item_ipv4 *)(i)->ms)->hdr.next_proto_id :       \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6 ?                                  \
+	((const struct rte_flow_item_ipv6 *)(i)->ms)->hdr.proto :               \
+	(i)->type == RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT ?                         \
+	((const struct rte_flow_item_ipv6_frag_ext *)(i)->ms)->hdr.next_header :\
+	0xff)
+
+	uint8_t next_protocol;
+
+	if (l3_item->mask != NULL && l3_item->spec != NULL) {
+		next_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
+		if (next_protocol)
+			next_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
+		else
+			next_protocol = 0xff;
+	} else if (key_type == MLX5_SET_MATCHER_HS_M && l3_item->mask != NULL) {
+		next_protocol =  MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
+	} else if (key_type == MLX5_SET_MATCHER_HS_V && l3_item->spec != NULL) {
+		next_protocol =  MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
+	} else {
+		/* Reset for inner layer. */
+		next_protocol = 0xff;
+	}
+	return next_protocol;
+
+#undef MLX5_L3_NEXT_PROTOCOL
+}
+
 /**
  * Validate IB BTH item.
  *
@@ -7530,19 +7564,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				return ret;
 			last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :
 					     MLX5_FLOW_LAYER_OUTER_L3_IPV4;
-			if (items->mask != NULL &&
-			    ((const struct rte_flow_item_ipv4 *)
-			     items->mask)->hdr.next_proto_id) {
-				next_protocol =
-					((const struct rte_flow_item_ipv4 *)
-					 (items->spec))->hdr.next_proto_id;
-				next_protocol &=
-					((const struct rte_flow_item_ipv4 *)
-					 (items->mask))->hdr.next_proto_id;
-			} else {
-				/* Reset for inner layer. */
-				next_protocol = 0xff;
-			}
+			next_protocol = mlx5_flow_l3_next_protocol
+				(items, (enum MLX5_SET_MATCHER)-1);
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
 			mlx5_flow_tunnel_ip_check(items, next_protocol,
@@ -7556,22 +7579,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				return ret;
 			last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :
 					     MLX5_FLOW_LAYER_OUTER_L3_IPV6;
-			if (items->mask != NULL &&
-			    ((const struct rte_flow_item_ipv6 *)
-			     items->mask)->hdr.proto) {
-				item_ipv6_proto =
-					((const struct rte_flow_item_ipv6 *)
-					 items->spec)->hdr.proto;
-				next_protocol =
-					((const struct rte_flow_item_ipv6 *)
-					 items->spec)->hdr.proto;
-				next_protocol &=
-					((const struct rte_flow_item_ipv6 *)
-					 items->mask)->hdr.proto;
-			} else {
-				/* Reset for inner layer. */
-				next_protocol = 0xff;
-			}
+			next_protocol = mlx5_flow_l3_next_protocol
+					(items, (enum MLX5_SET_MATCHER)-1);
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:
 			ret = flow_dv_validate_item_ipv6_frag_ext(items,
@@ -7582,19 +7591,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 			last_item = tunnel ?
 					MLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :
 					MLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;
-			if (items->mask != NULL &&
-			    ((const struct rte_flow_item_ipv6_frag_ext *)
-			     items->mask)->hdr.next_header) {
-				next_protocol =
-				((const struct rte_flow_item_ipv6_frag_ext *)
-				 items->spec)->hdr.next_header;
-				next_protocol &=
-				((const struct rte_flow_item_ipv6_frag_ext *)
-				 items->mask)->hdr.next_header;
-			} else {
-				/* Reset for inner layer. */
-				next_protocol = 0xff;
-			}
+			next_protocol = mlx5_flow_l3_next_protocol
+				(items, (enum MLX5_SET_MATCHER)-1);
 			break;
 		case RTE_FLOW_ITEM_TYPE_TCP:
 			ret = mlx5_flow_validate_item_tcp
@@ -13735,28 +13733,7 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
 		wks->priority = MLX5_PRIORITY_MAP_L3;
 		last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :
 				     MLX5_FLOW_LAYER_OUTER_L3_IPV4;
-		if (items->mask != NULL &&
-		    items->spec != NULL &&
-			((const struct rte_flow_item_ipv4 *)
-			 items->mask)->hdr.next_proto_id) {
-			next_protocol =
-				((const struct rte_flow_item_ipv4 *)
-				 (items->spec))->hdr.next_proto_id;
-			next_protocol &=
-				((const struct rte_flow_item_ipv4 *)
-				 (items->mask))->hdr.next_proto_id;
-		} else if (key_type == MLX5_SET_MATCHER_HS_M &&
-			   items->mask != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv4 *)
-					(items->mask))->hdr.next_proto_id;
-		} else if (key_type == MLX5_SET_MATCHER_HS_V &&
-			   items->spec != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv4 *)
-					(items->spec))->hdr.next_proto_id;
-		} else {
-			/* Reset for inner layer. */
-			next_protocol = 0xff;
-		}
+		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6:
 		mlx5_flow_tunnel_ip_check(items, next_protocol,
@@ -13766,56 +13743,14 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
 		wks->priority = MLX5_PRIORITY_MAP_L3;
 		last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :
 				     MLX5_FLOW_LAYER_OUTER_L3_IPV6;
-		if (items->mask != NULL &&
-		    items->spec != NULL &&
-			((const struct rte_flow_item_ipv6 *)
-			 items->mask)->hdr.proto) {
-			next_protocol =
-				((const struct rte_flow_item_ipv6 *)
-				 items->spec)->hdr.proto;
-			next_protocol &=
-				((const struct rte_flow_item_ipv6 *)
-				 items->mask)->hdr.proto;
-		} else if (key_type == MLX5_SET_MATCHER_HS_M &&
-			   items->mask != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv6 *)
-					(items->mask))->hdr.proto;
-		} else if (key_type == MLX5_SET_MATCHER_HS_V &&
-			   items->spec != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv6 *)
-					(items->spec))->hdr.proto;
-		} else {
-			/* Reset for inner layer. */
-			next_protocol = 0xff;
-		}
+		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:
 		flow_dv_translate_item_ipv6_frag_ext
 					(key, items, tunnel, key_type);
 		last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6_FRAG_EXT :
 				     MLX5_FLOW_LAYER_OUTER_L3_IPV6_FRAG_EXT;
-		if (items->mask != NULL &&
-		    items->spec != NULL &&
-			((const struct rte_flow_item_ipv6_frag_ext *)
-			 items->mask)->hdr.next_header) {
-			next_protocol =
-			((const struct rte_flow_item_ipv6_frag_ext *)
-			 items->spec)->hdr.next_header;
-			next_protocol &=
-			((const struct rte_flow_item_ipv6_frag_ext *)
-			 items->mask)->hdr.next_header;
-		} else if (key_type == MLX5_SET_MATCHER_HS_M &&
-			   items->mask != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv6_frag_ext *)
-					(items->mask))->hdr.next_header;
-		} else if (key_type == MLX5_SET_MATCHER_HS_V &&
-			   items->spec != NULL) {
-			next_protocol =  ((const struct rte_flow_item_ipv6_frag_ext *)
-					(items->spec))->hdr.next_header;
-		} else {
-			/* Reset for inner layer. */
-			next_protocol = 0xff;
-		}
+		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
 		break;
 	case RTE_FLOW_ITEM_TYPE_TCP:
 		flow_dv_translate_item_tcp(key, items, tunnel, key_type);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.039898658 +0800
+++ 0099-net-mlx5-remove-duplication-of-L3-flow-item-validati.patch	2024-04-13 20:43:05.087753814 +0800
@@ -1 +1 @@
-From 27e44a6f53eccc7d2ce80f6466fa214158f0ee81 Mon Sep 17 00:00:00 2001
+From c551015ebb6f2a9615e6e2583603794232665af5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 27e44a6f53eccc7d2ce80f6466fa214158f0ee81 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index f1584ed6e0..9e444c8a1c 100644
+index 1c85331cb6..eaadbf577f 100644
@@ -21 +23 @@
-@@ -7488,6 +7488,40 @@ flow_dv_validate_item_flex(struct rte_eth_dev *dev,
+@@ -7248,6 +7248,40 @@ flow_dv_validate_item_flex(struct rte_eth_dev *dev,
@@ -62 +64 @@
-@@ -7770,19 +7804,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7530,19 +7564,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -84 +86 @@
-@@ -7796,22 +7819,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7556,22 +7579,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -109 +111 @@
-@@ -7822,19 +7831,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7582,19 +7591,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -131 +133 @@
-@@ -13997,28 +13995,7 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
+@@ -13735,28 +13733,7 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
@@ -161 +163 @@
-@@ -14028,56 +14005,14 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
+@@ -13766,56 +13743,14 @@ flow_dv_translate_items(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix IP-in-IP tunnels recognition' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (97 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: remove duplication of L3 flow item validation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix DR context release ordering' " Xueming Li
                     ` (24 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9a9f0acac6ac246cbfe95734901fb5b4599bebfd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9a9f0acac6ac246cbfe95734901fb5b4599bebfd Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 29 Feb 2024 18:05:04 +0200
Subject: [PATCH] net/mlx5: fix IP-in-IP tunnels recognition
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2db234e769e121446b7b6d8e97e00212bebf7a3c ]

The patch fixes IP-in-IP tunnel recognition for the following patterns

 / [ipv4|ipv6] proto is [ipv4|ipv6] / end

 / [ipv4|ipv6] / [ipv4|ipv6] /

Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 104 ++++++++++++++++++++++++--------
 1 file changed, 80 insertions(+), 24 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index eaadbf577f..e36443436e 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -267,21 +267,41 @@ struct field_modify_info modify_tcp[] = {
 	{0, 0, 0},
 };
 
-static void
+enum mlx5_l3_tunnel_detection {
+	l3_tunnel_none,
+	l3_tunnel_outer,
+	l3_tunnel_inner
+};
+
+static enum mlx5_l3_tunnel_detection
 mlx5_flow_tunnel_ip_check(const struct rte_flow_item *item __rte_unused,
-			  uint8_t next_protocol, uint64_t *item_flags,
-			  int *tunnel)
+			  uint8_t next_protocol, uint64_t item_flags,
+			  uint64_t *l3_tunnel_flag)
 {
+	enum mlx5_l3_tunnel_detection td = l3_tunnel_none;
+
 	MLX5_ASSERT(item->type == RTE_FLOW_ITEM_TYPE_IPV4 ||
 		    item->type == RTE_FLOW_ITEM_TYPE_IPV6);
-	if (next_protocol == IPPROTO_IPIP) {
-		*item_flags |= MLX5_FLOW_LAYER_IPIP;
-		*tunnel = 1;
-	}
-	if (next_protocol == IPPROTO_IPV6) {
-		*item_flags |= MLX5_FLOW_LAYER_IPV6_ENCAP;
-		*tunnel = 1;
+	if ((item_flags & MLX5_FLOW_LAYER_OUTER_L3) == 0) {
+		switch (next_protocol) {
+		case IPPROTO_IPIP:
+			td = l3_tunnel_outer;
+			*l3_tunnel_flag = MLX5_FLOW_LAYER_IPIP;
+			break;
+		case IPPROTO_IPV6:
+			td = l3_tunnel_outer;
+			*l3_tunnel_flag = MLX5_FLOW_LAYER_IPV6_ENCAP;
+			break;
+		default:
+			break;
+		}
+	} else {
+		td = l3_tunnel_inner;
+		*l3_tunnel_flag = item->type == RTE_FLOW_ITEM_TYPE_IPV4 ?
+				  MLX5_FLOW_LAYER_IPIP :
+				  MLX5_FLOW_LAYER_IPV6_ENCAP;
 	}
+	return td;
 }
 
 static inline struct mlx5_hlist *
@@ -7478,6 +7498,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 		return ret;
 	is_root = (uint64_t)ret;
 	for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
+		enum mlx5_l3_tunnel_detection l3_tunnel_detection;
+		uint64_t l3_tunnel_flag;
 		int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
 		int type = items->type;
 
@@ -7555,8 +7577,16 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				vlan_m = items->mask;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV4:
-			mlx5_flow_tunnel_ip_check(items, next_protocol,
-						  &item_flags, &tunnel);
+			next_protocol = mlx5_flow_l3_next_protocol
+				(items, (enum MLX5_SET_MATCHER)-1);
+			l3_tunnel_detection =
+				mlx5_flow_tunnel_ip_check(items, next_protocol,
+							  item_flags,
+							  &l3_tunnel_flag);
+			if (l3_tunnel_detection == l3_tunnel_inner) {
+				item_flags |= l3_tunnel_flag;
+				tunnel = 1;
+			}
 			ret = flow_dv_validate_item_ipv4(dev, items, item_flags,
 							 last_item, ether_type,
 							 error);
@@ -7564,12 +7594,20 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				return ret;
 			last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :
 					     MLX5_FLOW_LAYER_OUTER_L3_IPV4;
-			next_protocol = mlx5_flow_l3_next_protocol
-				(items, (enum MLX5_SET_MATCHER)-1);
+			if (l3_tunnel_detection == l3_tunnel_outer)
+				item_flags |= l3_tunnel_flag;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
-			mlx5_flow_tunnel_ip_check(items, next_protocol,
-						  &item_flags, &tunnel);
+			next_protocol = mlx5_flow_l3_next_protocol
+				(items, (enum MLX5_SET_MATCHER)-1);
+			l3_tunnel_detection =
+				mlx5_flow_tunnel_ip_check(items, next_protocol,
+							  item_flags,
+							  &l3_tunnel_flag);
+			if (l3_tunnel_detection == l3_tunnel_inner) {
+				item_flags |= l3_tunnel_flag;
+				tunnel = 1;
+			}
 			ret = mlx5_flow_validate_item_ipv6(items, item_flags,
 							   last_item,
 							   ether_type,
@@ -7579,8 +7617,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				return ret;
 			last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :
 					     MLX5_FLOW_LAYER_OUTER_L3_IPV6;
-			next_protocol = mlx5_flow_l3_next_protocol
-					(items, (enum MLX5_SET_MATCHER)-1);
+			if (l3_tunnel_detection == l3_tunnel_outer)
+				item_flags |= l3_tunnel_flag;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:
 			ret = flow_dv_validate_item_ipv6_frag_ext(items,
@@ -13683,6 +13721,8 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
 	int tunnel = !!(wks->item_flags & MLX5_FLOW_LAYER_TUNNEL);
 	int item_type = items->type;
 	uint64_t last_item = wks->last_item;
+	enum mlx5_l3_tunnel_detection l3_tunnel_detection;
+	uint64_t l3_tunnel_flag;
 	int ret;
 
 	switch (item_type) {
@@ -13726,24 +13766,40 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
 					  MLX5_FLOW_LAYER_OUTER_VLAN);
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV4:
-		mlx5_flow_tunnel_ip_check(items, next_protocol,
-					  &wks->item_flags, &tunnel);
+		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
+		l3_tunnel_detection =
+			mlx5_flow_tunnel_ip_check(items, next_protocol,
+						  wks->item_flags,
+						  &l3_tunnel_flag);
+		if (l3_tunnel_detection == l3_tunnel_inner) {
+			wks->item_flags |= l3_tunnel_flag;
+			tunnel = 1;
+		}
 		flow_dv_translate_item_ipv4(key, items, tunnel,
 					    wks->group, key_type);
 		wks->priority = MLX5_PRIORITY_MAP_L3;
 		last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :
 				     MLX5_FLOW_LAYER_OUTER_L3_IPV4;
-		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
+		if (l3_tunnel_detection == l3_tunnel_outer)
+			wks->item_flags |= l3_tunnel_flag;
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6:
-		mlx5_flow_tunnel_ip_check(items, next_protocol,
-					  &wks->item_flags, &tunnel);
+		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
+		l3_tunnel_detection =
+			mlx5_flow_tunnel_ip_check(items, next_protocol,
+						  wks->item_flags,
+						  &l3_tunnel_flag);
+		if (l3_tunnel_detection == l3_tunnel_inner) {
+			wks->item_flags |= l3_tunnel_flag;
+			tunnel = 1;
+		}
 		flow_dv_translate_item_ipv6(key, items, tunnel,
 					    wks->group, key_type);
 		wks->priority = MLX5_PRIORITY_MAP_L3;
 		last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :
 				     MLX5_FLOW_LAYER_OUTER_L3_IPV6;
-		next_protocol = mlx5_flow_l3_next_protocol(items, key_type);
+		if (l3_tunnel_detection == l3_tunnel_outer)
+			wks->item_flags |= l3_tunnel_flag;
 		break;
 	case RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT:
 		flow_dv_translate_item_ipv6_frag_ext
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.074448313 +0800
+++ 0100-net-mlx5-fix-IP-in-IP-tunnels-recognition.patch	2024-04-13 20:43:05.087753814 +0800
@@ -1 +1 @@
-From 2db234e769e121446b7b6d8e97e00212bebf7a3c Mon Sep 17 00:00:00 2001
+From 9a9f0acac6ac246cbfe95734901fb5b4599bebfd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2db234e769e121446b7b6d8e97e00212bebf7a3c ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 9e444c8a1c..80239bebee 100644
+index eaadbf577f..e36443436e 100644
@@ -25 +27 @@
-@@ -275,21 +275,41 @@ struct field_modify_info modify_tcp[] = {
+@@ -267,21 +267,41 @@ struct field_modify_info modify_tcp[] = {
@@ -77 +79 @@
-@@ -7718,6 +7738,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7478,6 +7498,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -86 +88 @@
-@@ -7795,8 +7817,16 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7555,8 +7577,16 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -105 +107 @@
-@@ -7804,12 +7834,20 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7564,12 +7594,20 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -130 +132 @@
-@@ -7819,8 +7857,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
+@@ -7579,8 +7617,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
@@ -141 +143 @@
-@@ -13945,6 +13983,8 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
+@@ -13683,6 +13721,8 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
@@ -150 +152 @@
-@@ -13988,24 +14028,40 @@ flow_dv_translate_items(struct rte_eth_dev *dev,
+@@ -13726,24 +13766,40 @@ flow_dv_translate_items(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix DR context release ordering' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (98 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix IP-in-IP tunnels recognition' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5/hws: fix direct index insert on depend WQE' " Xueming Li
                     ` (23 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Maayan Kashani; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=859bafedf3ae9983e143ee35bcbb8046b91430bc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 859bafedf3ae9983e143ee35bcbb8046b91430bc Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani@nvidia.com>
Date: Wed, 6 Mar 2024 08:02:07 +0200
Subject: [PATCH] net/mlx5: fix DR context release ordering
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d068681b637da6b7857c13711eb1a675b2a341e3 ]

Creating rules on group >0, creates a jump action on the group table.
Non template code releases the group data under shared mlx5dr free code,
And the mlx5dr context was already closed in HWS code.

Remove mlx5dr context release from hws resource release function.

Fixes: b401400db24e ("net/mlx5: add port flow configuration")

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5.c         | 7 +++++++
 drivers/net/mlx5/mlx5_flow_hw.c | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index df0383078d..95f2ed073c 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2268,6 +2268,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 	mlx5_indirect_list_handles_release(dev);
 #ifdef HAVE_MLX5_HWS_SUPPORT
 	flow_hw_destroy_vport_action(dev);
+	/* dr context will be closed after mlx5_os_free_shared_dr. */
 	flow_hw_resource_release(dev);
 	flow_hw_clear_port_info(dev);
 #endif
@@ -2299,6 +2300,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		mlx5_hlist_destroy(priv->mreg_cp_tbl);
 	mlx5_mprq_free_mp(dev);
 	mlx5_os_free_shared_dr(priv);
+#ifdef HAVE_MLX5_HWS_SUPPORT
+	if (priv->dr_ctx) {
+		claim_zero(mlx5dr_context_close(priv->dr_ctx));
+		priv->dr_ctx = NULL;
+	}
+#endif
 	if (priv->rss_conf.rss_key != NULL)
 		mlx5_free(priv->rss_conf.rss_key);
 	if (priv->reta_idx != NULL)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index aff1ab74e3..9de5552bc8 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -9756,13 +9756,11 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 	}
 	mlx5_free(priv->hw_q);
 	priv->hw_q = NULL;
-	claim_zero(mlx5dr_context_close(priv->dr_ctx));
 	if (priv->shared_host) {
 		struct mlx5_priv *host_priv = priv->shared_host->data->dev_private;
 		__atomic_fetch_sub(&host_priv->shared_refcnt, 1, __ATOMIC_RELAXED);
 		priv->shared_host = NULL;
 	}
-	priv->dr_ctx = NULL;
 	mlx5_free(priv->hw_attr);
 	priv->hw_attr = NULL;
 	priv->nb_queue = 0;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.112838763 +0800
+++ 0101-net-mlx5-fix-DR-context-release-ordering.patch	2024-04-13 20:43:05.097753801 +0800
@@ -1 +1 @@
-From d068681b637da6b7857c13711eb1a675b2a341e3 Mon Sep 17 00:00:00 2001
+From 859bafedf3ae9983e143ee35bcbb8046b91430bc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d068681b637da6b7857c13711eb1a675b2a341e3 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 39dc1830d1..8b54843a43 100644
+index df0383078d..95f2ed073c 100644
@@ -26 +28 @@
-@@ -2355,6 +2355,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -2268,6 +2268,7 @@ mlx5_dev_close(struct rte_eth_dev *dev)
@@ -33,2 +35,2 @@
- 	if (priv->tlv_options != NULL) {
-@@ -2391,6 +2392,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+ #endif
+@@ -2299,6 +2300,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
@@ -48 +50 @@
-index 817461017f..c89bd00fb0 100644
+index aff1ab74e3..9de5552bc8 100644
@@ -51 +53 @@
-@@ -10734,13 +10734,11 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+@@ -9756,13 +9756,11 @@ flow_hw_resource_release(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: fix direct index insert on depend WQE' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (99 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix DR context release ordering' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix template clean up of FDB control flow rule' " Xueming Li
                     ` (22 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Alex Vesker; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=3735e8e88c770b49a1588263b2ff5c6bf8b1d9a9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3735e8e88c770b49a1588263b2ff5c6bf8b1d9a9 Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex@nvidia.com>
Date: Wed, 6 Mar 2024 21:21:47 +0100
Subject: [PATCH] net/mlx5/hws: fix direct index insert on depend WQE
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e28392b3adab117a00e780a508049fd3df3d1492 ]

In case a depend WQE was required and direct index was
needed we would not set the direct index on the dep_wqe.
This leads to incorrect insertion to index zero.

Fixes: 38b5bf6452a6 ("net/mlx5/hws: support insert/distribute RTC properties")

Signed-off-by: Alex Vesker <valex@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_rule.c | 15 ++++++++-------
 drivers/net/mlx5/hws/mlx5dr_send.c |  1 +
 drivers/net/mlx5/hws/mlx5dr_send.h |  1 +
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c
index e39137a6ee..77245ad97d 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -58,14 +58,16 @@ static void mlx5dr_rule_init_dep_wqe(struct mlx5dr_send_ring_dep_wqe *dep_wqe,
 				     struct mlx5dr_rule *rule,
 				     const struct rte_flow_item *items,
 				     struct mlx5dr_match_template *mt,
-				     void *user_data)
+				     struct mlx5dr_rule_attr *attr)
 {
 	struct mlx5dr_matcher *matcher = rule->matcher;
 	struct mlx5dr_table *tbl = matcher->tbl;
 	bool skip_rx, skip_tx;
 
 	dep_wqe->rule = rule;
-	dep_wqe->user_data = user_data;
+	dep_wqe->user_data = attr->user_data;
+	dep_wqe->direct_index = mlx5dr_matcher_is_insert_by_idx(matcher) ?
+		attr->rule_idx : 0;
 
 	if (!items) { /* rule update */
 		dep_wqe->rtc_0 = rule->rtc_0;
@@ -292,8 +294,8 @@ static int mlx5dr_rule_create_hws_fw_wqe(struct mlx5dr_rule *rule,
 	}
 
 	mlx5dr_rule_create_init(rule, &ste_attr, &apply, false);
-	mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr->user_data);
-	mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr->user_data);
+	mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr);
+	mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr);
 
 	ste_attr.direct_index = 0;
 	ste_attr.rtc_0 = match_wqe.rtc_0;
@@ -398,7 +400,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 	 * dep_wqe buffers (ctrl, data) are also reused for all STE writes.
 	 */
 	dep_wqe = mlx5dr_send_add_new_dep_wqe(queue);
-	mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr->user_data);
+	mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr);
 
 	ste_attr.wqe_ctrl = &dep_wqe->wqe_ctrl;
 	ste_attr.wqe_data = &dep_wqe->wqe_data;
@@ -460,8 +462,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 			ste_attr.used_id_rtc_1 = &rule->rtc_1;
 			ste_attr.retry_rtc_0 = dep_wqe->retry_rtc_0;
 			ste_attr.retry_rtc_1 = dep_wqe->retry_rtc_1;
-			ste_attr.direct_index = mlx5dr_matcher_is_insert_by_idx(matcher) ?
-						attr->rule_idx : 0;
+			ste_attr.direct_index = dep_wqe->direct_index;
 		} else {
 			apply.next_direct_idx = --ste_attr.direct_index;
 		}
diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index 622d574bfa..4c279ba42a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -50,6 +50,7 @@ void mlx5dr_send_all_dep_wqe(struct mlx5dr_send_engine *queue)
 		ste_attr.used_id_rtc_1 = &dep_wqe->rule->rtc_1;
 		ste_attr.wqe_ctrl = &dep_wqe->wqe_ctrl;
 		ste_attr.wqe_data = &dep_wqe->wqe_data;
+		ste_attr.direct_index = dep_wqe->direct_index;
 
 		mlx5dr_send_ste(queue, &ste_attr);
 
diff --git a/drivers/net/mlx5/hws/mlx5dr_send.h b/drivers/net/mlx5/hws/mlx5dr_send.h
index c1e8616f7e..c4eaea52ab 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.h
+++ b/drivers/net/mlx5/hws/mlx5dr_send.h
@@ -106,6 +106,7 @@ struct mlx5dr_send_ring_dep_wqe {
 	uint32_t rtc_1;
 	uint32_t retry_rtc_0;
 	uint32_t retry_rtc_1;
+	uint32_t direct_index;
 	void *user_data;
 };
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.143061923 +0800
+++ 0102-net-mlx5-hws-fix-direct-index-insert-on-depend-WQE.patch	2024-04-13 20:43:05.097753801 +0800
@@ -1 +1 @@
-From e28392b3adab117a00e780a508049fd3df3d1492 Mon Sep 17 00:00:00 2001
+From 3735e8e88c770b49a1588263b2ff5c6bf8b1d9a9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e28392b3adab117a00e780a508049fd3df3d1492 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index aa00c54e53..f14e1e6ecd 100644
+index e39137a6ee..77245ad97d 100644
@@ -44 +46 @@
-@@ -374,8 +376,8 @@ static int mlx5dr_rule_create_hws_fw_wqe(struct mlx5dr_rule *rule,
+@@ -292,8 +294,8 @@ static int mlx5dr_rule_create_hws_fw_wqe(struct mlx5dr_rule *rule,
@@ -55 +57 @@
-@@ -482,7 +484,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
+@@ -398,7 +400,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
@@ -64 +66 @@
-@@ -544,8 +546,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
+@@ -460,8 +462,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
@@ -75 +77 @@
-index 64138279a1..f749401c6f 100644
+index 622d574bfa..4c279ba42a 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix template clean up of FDB control flow rule' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (100 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5/hws: fix direct index insert on depend WQE' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix flow configure validation' " Xueming Li
                     ` (21 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=b1749f6ed202bc6413c51119aac17a32b41c09eb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b1749f6ed202bc6413c51119aac17a32b41c09eb Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Wed, 6 Mar 2024 21:21:48 +0100
Subject: [PATCH] net/mlx5: fix template clean up of FDB control flow rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 48db3b61c3b81c6efcd343b7929a000eb998cb0b ]

This patch refactors the creation and clean up of templates used for
FDB control flow rules, when HWS is enabled.
All pattern and actions templates, and template tables are stored
in a separate structure, `mlx5_flow_hw_ctrl_fdb`. It is allocated
if and only if E-Switch is enabled.
During HWS clean up, all of these templates are explicitly destroyed,
instead of relying on templates general templates clean up.

Fixes: 1939eb6f660c ("net/mlx5: support flow port action with HWS")
Fixes: 49dffadf4b0c ("net/mlx5: fix LACP redirection in Rx domain")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5.h         |   6 +-
 drivers/net/mlx5/mlx5_flow.h    |  19 +++
 drivers/net/mlx5/mlx5_flow_hw.c | 255 ++++++++++++++++++--------------
 3 files changed, 166 insertions(+), 114 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index e2c6fe0d00..33401d96e4 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1870,11 +1870,7 @@ struct mlx5_priv {
 	rte_spinlock_t hw_ctrl_lock;
 	LIST_HEAD(hw_ctrl_flow, mlx5_hw_ctrl_flow) hw_ctrl_flows;
 	LIST_HEAD(hw_ext_ctrl_flow, mlx5_hw_ctrl_flow) hw_ext_ctrl_flows;
-	struct rte_flow_template_table *hw_esw_sq_miss_root_tbl;
-	struct rte_flow_template_table *hw_esw_sq_miss_tbl;
-	struct rte_flow_template_table *hw_esw_zero_tbl;
-	struct rte_flow_template_table *hw_tx_meta_cpy_tbl;
-	struct rte_flow_template_table *hw_lacp_rx_tbl;
+	struct mlx5_flow_hw_ctrl_fdb *hw_ctrl_fdb;
 	struct rte_flow_pattern_template *hw_tx_repr_tagging_pt;
 	struct rte_flow_actions_template *hw_tx_repr_tagging_at;
 	struct rte_flow_template_table *hw_tx_repr_tagging_tbl;
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index edc273c518..7a5e334a83 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -2446,6 +2446,25 @@ struct mlx5_flow_hw_ctrl_rx {
 						[MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_MAX];
 };
 
+/* Contains all templates required for control flow rules in FDB with HWS. */
+struct mlx5_flow_hw_ctrl_fdb {
+	struct rte_flow_pattern_template *esw_mgr_items_tmpl;
+	struct rte_flow_actions_template *regc_jump_actions_tmpl;
+	struct rte_flow_template_table *hw_esw_sq_miss_root_tbl;
+	struct rte_flow_pattern_template *regc_sq_items_tmpl;
+	struct rte_flow_actions_template *port_actions_tmpl;
+	struct rte_flow_template_table *hw_esw_sq_miss_tbl;
+	struct rte_flow_pattern_template *port_items_tmpl;
+	struct rte_flow_actions_template *jump_one_actions_tmpl;
+	struct rte_flow_template_table *hw_esw_zero_tbl;
+	struct rte_flow_pattern_template *tx_meta_items_tmpl;
+	struct rte_flow_actions_template *tx_meta_actions_tmpl;
+	struct rte_flow_template_table *hw_tx_meta_cpy_tbl;
+	struct rte_flow_pattern_template *lacp_rx_items_tmpl;
+	struct rte_flow_actions_template *lacp_rx_actions_tmpl;
+	struct rte_flow_template_table *hw_lacp_rx_tbl;
+};
+
 #define MLX5_CTRL_PROMISCUOUS    (RTE_BIT32(0))
 #define MLX5_CTRL_ALL_MULTICAST  (RTE_BIT32(1))
 #define MLX5_CTRL_BROADCAST      (RTE_BIT32(2))
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 9de5552bc8..938d9b5824 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8445,6 +8445,72 @@ flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,
 	return flow_hw_table_create(dev, &cfg, &it, 1, &at, 1, error);
 }
 
+/**
+ * Cleans up all template tables and pattern, and actions templates used for
+ * FDB control flow rules.
+ *
+ * @param dev
+ *   Pointer to Ethernet device.
+ */
+static void
+flow_hw_cleanup_ctrl_fdb_tables(struct rte_eth_dev *dev)
+{
+	struct mlx5_priv *priv = dev->data->dev_private;
+	struct mlx5_flow_hw_ctrl_fdb *hw_ctrl_fdb;
+
+	if (!priv->hw_ctrl_fdb)
+		return;
+	hw_ctrl_fdb = priv->hw_ctrl_fdb;
+	/* Clean up templates used for LACP default miss table. */
+	if (hw_ctrl_fdb->hw_lacp_rx_tbl)
+		claim_zero(flow_hw_table_destroy(dev, hw_ctrl_fdb->hw_lacp_rx_tbl, NULL));
+	if (hw_ctrl_fdb->lacp_rx_actions_tmpl)
+		claim_zero(flow_hw_actions_template_destroy(dev, hw_ctrl_fdb->lacp_rx_actions_tmpl,
+			   NULL));
+	if (hw_ctrl_fdb->lacp_rx_items_tmpl)
+		claim_zero(flow_hw_pattern_template_destroy(dev, hw_ctrl_fdb->lacp_rx_items_tmpl,
+			   NULL));
+	/* Clean up templates used for default Tx metadata copy. */
+	if (hw_ctrl_fdb->hw_tx_meta_cpy_tbl)
+		claim_zero(flow_hw_table_destroy(dev, hw_ctrl_fdb->hw_tx_meta_cpy_tbl, NULL));
+	if (hw_ctrl_fdb->tx_meta_actions_tmpl)
+		claim_zero(flow_hw_actions_template_destroy(dev, hw_ctrl_fdb->tx_meta_actions_tmpl,
+			   NULL));
+	if (hw_ctrl_fdb->tx_meta_items_tmpl)
+		claim_zero(flow_hw_pattern_template_destroy(dev, hw_ctrl_fdb->tx_meta_items_tmpl,
+			   NULL));
+	/* Clean up templates used for default FDB jump rule. */
+	if (hw_ctrl_fdb->hw_esw_zero_tbl)
+		claim_zero(flow_hw_table_destroy(dev, hw_ctrl_fdb->hw_esw_zero_tbl, NULL));
+	if (hw_ctrl_fdb->jump_one_actions_tmpl)
+		claim_zero(flow_hw_actions_template_destroy(dev, hw_ctrl_fdb->jump_one_actions_tmpl,
+			   NULL));
+	if (hw_ctrl_fdb->port_items_tmpl)
+		claim_zero(flow_hw_pattern_template_destroy(dev, hw_ctrl_fdb->port_items_tmpl,
+			   NULL));
+	/* Clean up templates used for default SQ miss flow rules - non-root table. */
+	if (hw_ctrl_fdb->hw_esw_sq_miss_tbl)
+		claim_zero(flow_hw_table_destroy(dev, hw_ctrl_fdb->hw_esw_sq_miss_tbl, NULL));
+	if (hw_ctrl_fdb->regc_sq_items_tmpl)
+		claim_zero(flow_hw_pattern_template_destroy(dev, hw_ctrl_fdb->regc_sq_items_tmpl,
+			   NULL));
+	if (hw_ctrl_fdb->port_actions_tmpl)
+		claim_zero(flow_hw_actions_template_destroy(dev, hw_ctrl_fdb->port_actions_tmpl,
+			   NULL));
+	/* Clean up templates used for default SQ miss flow rules - root table. */
+	if (hw_ctrl_fdb->hw_esw_sq_miss_root_tbl)
+		claim_zero(flow_hw_table_destroy(dev, hw_ctrl_fdb->hw_esw_sq_miss_root_tbl, NULL));
+	if (hw_ctrl_fdb->regc_jump_actions_tmpl)
+		claim_zero(flow_hw_actions_template_destroy(dev,
+			   hw_ctrl_fdb->regc_jump_actions_tmpl, NULL));
+	if (hw_ctrl_fdb->esw_mgr_items_tmpl)
+		claim_zero(flow_hw_pattern_template_destroy(dev, hw_ctrl_fdb->esw_mgr_items_tmpl,
+			   NULL));
+	/* Clean up templates structure for FDB control flow rules. */
+	mlx5_free(hw_ctrl_fdb);
+	priv->hw_ctrl_fdb = NULL;
+}
+
 /*
  * Create a table on the root group to for the LACP traffic redirecting.
  *
@@ -8494,110 +8560,109 @@ flow_hw_create_lacp_rx_table(struct rte_eth_dev *dev,
  * @return
  *   0 on success, negative values otherwise
  */
-static __rte_unused int
+static int
 flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
-	struct rte_flow_pattern_template *esw_mgr_items_tmpl = NULL;
-	struct rte_flow_pattern_template *regc_sq_items_tmpl = NULL;
-	struct rte_flow_pattern_template *port_items_tmpl = NULL;
-	struct rte_flow_pattern_template *tx_meta_items_tmpl = NULL;
-	struct rte_flow_pattern_template *lacp_rx_items_tmpl = NULL;
-	struct rte_flow_actions_template *regc_jump_actions_tmpl = NULL;
-	struct rte_flow_actions_template *port_actions_tmpl = NULL;
-	struct rte_flow_actions_template *jump_one_actions_tmpl = NULL;
-	struct rte_flow_actions_template *tx_meta_actions_tmpl = NULL;
-	struct rte_flow_actions_template *lacp_rx_actions_tmpl = NULL;
+	struct mlx5_flow_hw_ctrl_fdb *hw_ctrl_fdb;
 	uint32_t xmeta = priv->sh->config.dv_xmeta_en;
 	uint32_t repr_matching = priv->sh->config.repr_matching;
-	int ret;
 
+	MLX5_ASSERT(priv->hw_ctrl_fdb == NULL);
+	hw_ctrl_fdb = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*hw_ctrl_fdb), 0, SOCKET_ID_ANY);
+	if (!hw_ctrl_fdb) {
+		DRV_LOG(ERR, "port %u failed to allocate memory for FDB control flow templates",
+			dev->data->port_id);
+		rte_errno = ENOMEM;
+		goto err;
+	}
+	priv->hw_ctrl_fdb = hw_ctrl_fdb;
 	/* Create templates and table for default SQ miss flow rules - root table. */
-	esw_mgr_items_tmpl = flow_hw_create_ctrl_esw_mgr_pattern_template(dev, error);
-	if (!esw_mgr_items_tmpl) {
+	hw_ctrl_fdb->esw_mgr_items_tmpl = flow_hw_create_ctrl_esw_mgr_pattern_template(dev, error);
+	if (!hw_ctrl_fdb->esw_mgr_items_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create E-Switch Manager item"
 			" template for control flows", dev->data->port_id);
 		goto err;
 	}
-	regc_jump_actions_tmpl = flow_hw_create_ctrl_regc_jump_actions_template(dev, error);
-	if (!regc_jump_actions_tmpl) {
+	hw_ctrl_fdb->regc_jump_actions_tmpl = flow_hw_create_ctrl_regc_jump_actions_template
+			(dev, error);
+	if (!hw_ctrl_fdb->regc_jump_actions_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create REG_C set and jump action template"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
-	MLX5_ASSERT(priv->hw_esw_sq_miss_root_tbl == NULL);
-	priv->hw_esw_sq_miss_root_tbl = flow_hw_create_ctrl_sq_miss_root_table
-			(dev, esw_mgr_items_tmpl, regc_jump_actions_tmpl, error);
-	if (!priv->hw_esw_sq_miss_root_tbl) {
+	hw_ctrl_fdb->hw_esw_sq_miss_root_tbl = flow_hw_create_ctrl_sq_miss_root_table
+			(dev, hw_ctrl_fdb->esw_mgr_items_tmpl, hw_ctrl_fdb->regc_jump_actions_tmpl,
+			 error);
+	if (!hw_ctrl_fdb->hw_esw_sq_miss_root_tbl) {
 		DRV_LOG(ERR, "port %u failed to create table for default sq miss (root table)"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
 	/* Create templates and table for default SQ miss flow rules - non-root table. */
-	regc_sq_items_tmpl = flow_hw_create_ctrl_regc_sq_pattern_template(dev, error);
-	if (!regc_sq_items_tmpl) {
+	hw_ctrl_fdb->regc_sq_items_tmpl = flow_hw_create_ctrl_regc_sq_pattern_template(dev, error);
+	if (!hw_ctrl_fdb->regc_sq_items_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create SQ item template for"
 			" control flows", dev->data->port_id);
 		goto err;
 	}
-	port_actions_tmpl = flow_hw_create_ctrl_port_actions_template(dev, error);
-	if (!port_actions_tmpl) {
+	hw_ctrl_fdb->port_actions_tmpl = flow_hw_create_ctrl_port_actions_template(dev, error);
+	if (!hw_ctrl_fdb->port_actions_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create port action template"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
-	MLX5_ASSERT(priv->hw_esw_sq_miss_tbl == NULL);
-	priv->hw_esw_sq_miss_tbl = flow_hw_create_ctrl_sq_miss_table(dev, regc_sq_items_tmpl,
-								     port_actions_tmpl, error);
-	if (!priv->hw_esw_sq_miss_tbl) {
+	hw_ctrl_fdb->hw_esw_sq_miss_tbl = flow_hw_create_ctrl_sq_miss_table
+			(dev, hw_ctrl_fdb->regc_sq_items_tmpl, hw_ctrl_fdb->port_actions_tmpl,
+			 error);
+	if (!hw_ctrl_fdb->hw_esw_sq_miss_tbl) {
 		DRV_LOG(ERR, "port %u failed to create table for default sq miss (non-root table)"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
 	/* Create templates and table for default FDB jump flow rules. */
-	port_items_tmpl = flow_hw_create_ctrl_port_pattern_template(dev, error);
-	if (!port_items_tmpl) {
+	hw_ctrl_fdb->port_items_tmpl = flow_hw_create_ctrl_port_pattern_template(dev, error);
+	if (!hw_ctrl_fdb->port_items_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create SQ item template for"
 			" control flows", dev->data->port_id);
 		goto err;
 	}
-	jump_one_actions_tmpl = flow_hw_create_ctrl_jump_actions_template
+	hw_ctrl_fdb->jump_one_actions_tmpl = flow_hw_create_ctrl_jump_actions_template
 			(dev, MLX5_HW_LOWEST_USABLE_GROUP, error);
-	if (!jump_one_actions_tmpl) {
+	if (!hw_ctrl_fdb->jump_one_actions_tmpl) {
 		DRV_LOG(ERR, "port %u failed to create jump action template"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
-	MLX5_ASSERT(priv->hw_esw_zero_tbl == NULL);
-	priv->hw_esw_zero_tbl = flow_hw_create_ctrl_jump_table(dev, port_items_tmpl,
-							       jump_one_actions_tmpl,
-							       error);
-	if (!priv->hw_esw_zero_tbl) {
+	hw_ctrl_fdb->hw_esw_zero_tbl = flow_hw_create_ctrl_jump_table
+			(dev, hw_ctrl_fdb->port_items_tmpl, hw_ctrl_fdb->jump_one_actions_tmpl,
+			 error);
+	if (!hw_ctrl_fdb->hw_esw_zero_tbl) {
 		DRV_LOG(ERR, "port %u failed to create table for default jump to group 1"
 			" for control flows", dev->data->port_id);
 		goto err;
 	}
 	/* Create templates and table for default Tx metadata copy flow rule. */
 	if (!repr_matching && xmeta == MLX5_XMETA_MODE_META32_HWS) {
-		tx_meta_items_tmpl =
+		hw_ctrl_fdb->tx_meta_items_tmpl =
 			flow_hw_create_tx_default_mreg_copy_pattern_template(dev, error);
-		if (!tx_meta_items_tmpl) {
+		if (!hw_ctrl_fdb->tx_meta_items_tmpl) {
 			DRV_LOG(ERR, "port %u failed to Tx metadata copy pattern"
 				" template for control flows", dev->data->port_id);
 			goto err;
 		}
-		tx_meta_actions_tmpl =
+		hw_ctrl_fdb->tx_meta_actions_tmpl =
 			flow_hw_create_tx_default_mreg_copy_actions_template(dev, error);
-		if (!tx_meta_actions_tmpl) {
+		if (!hw_ctrl_fdb->tx_meta_actions_tmpl) {
 			DRV_LOG(ERR, "port %u failed to Tx metadata copy actions"
 				" template for control flows", dev->data->port_id);
 			goto err;
 		}
-		MLX5_ASSERT(priv->hw_tx_meta_cpy_tbl == NULL);
-		priv->hw_tx_meta_cpy_tbl =
-			flow_hw_create_tx_default_mreg_copy_table(dev, tx_meta_items_tmpl,
-								  tx_meta_actions_tmpl, error);
-		if (!priv->hw_tx_meta_cpy_tbl) {
+		hw_ctrl_fdb->hw_tx_meta_cpy_tbl =
+			flow_hw_create_tx_default_mreg_copy_table
+				(dev, hw_ctrl_fdb->tx_meta_items_tmpl,
+				 hw_ctrl_fdb->tx_meta_actions_tmpl, error);
+		if (!hw_ctrl_fdb->hw_tx_meta_cpy_tbl) {
 			DRV_LOG(ERR, "port %u failed to create table for default"
 				" Tx metadata copy flow rule", dev->data->port_id);
 			goto err;
@@ -8605,71 +8670,34 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
 	}
 	/* Create LACP default miss table. */
 	if (!priv->sh->config.lacp_by_user && priv->pf_bond >= 0 && priv->master) {
-		lacp_rx_items_tmpl = flow_hw_create_lacp_rx_pattern_template(dev, error);
-		if (!lacp_rx_items_tmpl) {
+		hw_ctrl_fdb->lacp_rx_items_tmpl =
+				flow_hw_create_lacp_rx_pattern_template(dev, error);
+		if (!hw_ctrl_fdb->lacp_rx_items_tmpl) {
 			DRV_LOG(ERR, "port %u failed to create pattern template"
 				" for LACP Rx traffic", dev->data->port_id);
 			goto err;
 		}
-		lacp_rx_actions_tmpl = flow_hw_create_lacp_rx_actions_template(dev, error);
-		if (!lacp_rx_actions_tmpl) {
+		hw_ctrl_fdb->lacp_rx_actions_tmpl =
+				flow_hw_create_lacp_rx_actions_template(dev, error);
+		if (!hw_ctrl_fdb->lacp_rx_actions_tmpl) {
 			DRV_LOG(ERR, "port %u failed to create actions template"
 				" for LACP Rx traffic", dev->data->port_id);
 			goto err;
 		}
-		priv->hw_lacp_rx_tbl = flow_hw_create_lacp_rx_table(dev, lacp_rx_items_tmpl,
-								    lacp_rx_actions_tmpl, error);
-		if (!priv->hw_lacp_rx_tbl) {
+		hw_ctrl_fdb->hw_lacp_rx_tbl = flow_hw_create_lacp_rx_table
+				(dev, hw_ctrl_fdb->lacp_rx_items_tmpl,
+				 hw_ctrl_fdb->lacp_rx_actions_tmpl, error);
+		if (!hw_ctrl_fdb->hw_lacp_rx_tbl) {
 			DRV_LOG(ERR, "port %u failed to create template table for"
 				" for LACP Rx traffic", dev->data->port_id);
 			goto err;
 		}
 	}
 	return 0;
+
 err:
-	/* Do not overwrite the rte_errno. */
-	ret = -rte_errno;
-	if (ret == 0)
-		ret = rte_flow_error_set(error, EINVAL,
-					 RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
-					 "Failed to create control tables.");
-	if (priv->hw_tx_meta_cpy_tbl) {
-		flow_hw_table_destroy(dev, priv->hw_tx_meta_cpy_tbl, NULL);
-		priv->hw_tx_meta_cpy_tbl = NULL;
-	}
-	if (priv->hw_esw_zero_tbl) {
-		flow_hw_table_destroy(dev, priv->hw_esw_zero_tbl, NULL);
-		priv->hw_esw_zero_tbl = NULL;
-	}
-	if (priv->hw_esw_sq_miss_tbl) {
-		flow_hw_table_destroy(dev, priv->hw_esw_sq_miss_tbl, NULL);
-		priv->hw_esw_sq_miss_tbl = NULL;
-	}
-	if (priv->hw_esw_sq_miss_root_tbl) {
-		flow_hw_table_destroy(dev, priv->hw_esw_sq_miss_root_tbl, NULL);
-		priv->hw_esw_sq_miss_root_tbl = NULL;
-	}
-	if (lacp_rx_actions_tmpl)
-		flow_hw_actions_template_destroy(dev, lacp_rx_actions_tmpl, NULL);
-	if (tx_meta_actions_tmpl)
-		flow_hw_actions_template_destroy(dev, tx_meta_actions_tmpl, NULL);
-	if (jump_one_actions_tmpl)
-		flow_hw_actions_template_destroy(dev, jump_one_actions_tmpl, NULL);
-	if (port_actions_tmpl)
-		flow_hw_actions_template_destroy(dev, port_actions_tmpl, NULL);
-	if (regc_jump_actions_tmpl)
-		flow_hw_actions_template_destroy(dev, regc_jump_actions_tmpl, NULL);
-	if (lacp_rx_items_tmpl)
-		flow_hw_pattern_template_destroy(dev, lacp_rx_items_tmpl, NULL);
-	if (tx_meta_items_tmpl)
-		flow_hw_pattern_template_destroy(dev, tx_meta_items_tmpl, NULL);
-	if (port_items_tmpl)
-		flow_hw_pattern_template_destroy(dev, port_items_tmpl, NULL);
-	if (regc_sq_items_tmpl)
-		flow_hw_pattern_template_destroy(dev, regc_sq_items_tmpl, NULL);
-	if (esw_mgr_items_tmpl)
-		flow_hw_pattern_template_destroy(dev, esw_mgr_items_tmpl, NULL);
-	return ret;
+	flow_hw_cleanup_ctrl_fdb_tables(dev);
+	return -EINVAL;
 }
 
 static void
@@ -9640,6 +9668,7 @@ err:
 	}
 	mlx5_flow_quota_destroy(dev);
 	flow_hw_destroy_send_to_kernel_action(priv);
+	flow_hw_cleanup_ctrl_fdb_tables(dev);
 	flow_hw_free_vport_actions(priv);
 	for (i = 0; i < MLX5_HW_ACTION_FLAG_MAX; i++) {
 		if (priv->hw_drop[i])
@@ -9698,6 +9727,7 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 		return;
 	flow_hw_rxq_flag_set(dev, false);
 	flow_hw_flush_all_ctrl_flows(dev);
+	flow_hw_cleanup_ctrl_fdb_tables(dev);
 	flow_hw_cleanup_tx_repr_tagging(dev);
 	flow_hw_cleanup_ctrl_rx_tables(dev);
 	while (!LIST_EMPTY(&priv->flow_hw_grp)) {
@@ -11983,8 +12013,9 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
 			       proxy_port_id, port_id);
 		return 0;
 	}
-	if (!proxy_priv->hw_esw_sq_miss_root_tbl ||
-	    !proxy_priv->hw_esw_sq_miss_tbl) {
+	if (!proxy_priv->hw_ctrl_fdb ||
+	    !proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_root_tbl ||
+	    !proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_tbl) {
 		DRV_LOG(ERR, "Transfer proxy port (port %u) of port %u was configured, but "
 			     "default flow tables were not created.",
 			     proxy_port_id, port_id);
@@ -12016,7 +12047,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
 	actions[2] = (struct rte_flow_action) {
 		.type = RTE_FLOW_ACTION_TYPE_END,
 	};
-	ret = flow_hw_create_ctrl_flow(dev, proxy_dev, proxy_priv->hw_esw_sq_miss_root_tbl,
+	ret = flow_hw_create_ctrl_flow(dev, proxy_dev,
+				       proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_root_tbl,
 				       items, 0, actions, 0, &flow_info, external);
 	if (ret) {
 		DRV_LOG(ERR, "Port %u failed to create root SQ miss flow rule for SQ %u, ret %d",
@@ -12047,7 +12079,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
 		.type = RTE_FLOW_ACTION_TYPE_END,
 	};
 	flow_info.type = MLX5_HW_CTRL_FLOW_TYPE_SQ_MISS;
-	ret = flow_hw_create_ctrl_flow(dev, proxy_dev, proxy_priv->hw_esw_sq_miss_tbl,
+	ret = flow_hw_create_ctrl_flow(dev, proxy_dev,
+				       proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_tbl,
 				       items, 0, actions, 0, &flow_info, external);
 	if (ret) {
 		DRV_LOG(ERR, "Port %u failed to create HWS SQ miss flow rule for SQ %u, ret %d",
@@ -12093,8 +12126,9 @@ mlx5_flow_hw_esw_destroy_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn)
 	proxy_priv = proxy_dev->data->dev_private;
 	if (!proxy_priv->dr_ctx)
 		return 0;
-	if (!proxy_priv->hw_esw_sq_miss_root_tbl ||
-	    !proxy_priv->hw_esw_sq_miss_tbl)
+	if (!proxy_priv->hw_ctrl_fdb ||
+	    !proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_root_tbl ||
+	    !proxy_priv->hw_ctrl_fdb->hw_esw_sq_miss_tbl)
 		return 0;
 	cf = LIST_FIRST(&proxy_priv->hw_ctrl_flows);
 	while (cf != NULL) {
@@ -12161,7 +12195,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
 			       proxy_port_id, port_id);
 		return 0;
 	}
-	if (!proxy_priv->hw_esw_zero_tbl) {
+	if (!proxy_priv->hw_ctrl_fdb || !proxy_priv->hw_ctrl_fdb->hw_esw_zero_tbl) {
 		DRV_LOG(ERR, "Transfer proxy port (port %u) of port %u was configured, but "
 			     "default flow tables were not created.",
 			     proxy_port_id, port_id);
@@ -12169,7 +12203,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
 		return -rte_errno;
 	}
 	return flow_hw_create_ctrl_flow(dev, proxy_dev,
-					proxy_priv->hw_esw_zero_tbl,
+					proxy_priv->hw_ctrl_fdb->hw_esw_zero_tbl,
 					items, 0, actions, 0, &flow_info, false);
 }
 
@@ -12221,10 +12255,12 @@ mlx5_flow_hw_create_tx_default_mreg_copy_flow(struct rte_eth_dev *dev)
 	};
 
 	MLX5_ASSERT(priv->master);
-	if (!priv->dr_ctx || !priv->hw_tx_meta_cpy_tbl)
+	if (!priv->dr_ctx ||
+	    !priv->hw_ctrl_fdb ||
+	    !priv->hw_ctrl_fdb->hw_tx_meta_cpy_tbl)
 		return 0;
 	return flow_hw_create_ctrl_flow(dev, dev,
-					priv->hw_tx_meta_cpy_tbl,
+					priv->hw_ctrl_fdb->hw_tx_meta_cpy_tbl,
 					eth_all, 0, copy_reg_action, 0, &flow_info, false);
 }
 
@@ -12316,10 +12352,11 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)
 		.type = MLX5_HW_CTRL_FLOW_TYPE_LACP_RX,
 	};
 
-	if (!priv->dr_ctx || !priv->hw_lacp_rx_tbl)
+	if (!priv->dr_ctx || !priv->hw_ctrl_fdb || !priv->hw_ctrl_fdb->hw_lacp_rx_tbl)
 		return 0;
-	return flow_hw_create_ctrl_flow(dev, dev, priv->hw_lacp_rx_tbl, eth_lacp, 0,
-					miss_action, 0, &flow_info, false);
+	return flow_hw_create_ctrl_flow(dev, dev,
+					priv->hw_ctrl_fdb->hw_lacp_rx_tbl,
+					eth_lacp, 0, miss_action, 0, &flow_info, false);
 }
 
 static uint32_t
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.169094189 +0800
+++ 0103-net-mlx5-fix-template-clean-up-of-FDB-control-flow-r.patch	2024-04-13 20:43:05.097753801 +0800
@@ -1 +1 @@
-From 48db3b61c3b81c6efcd343b7929a000eb998cb0b Mon Sep 17 00:00:00 2001
+From b1749f6ed202bc6413c51119aac17a32b41c09eb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 48db3b61c3b81c6efcd343b7929a000eb998cb0b ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 6ff8f322e0..0091a2459c 100644
+index e2c6fe0d00..33401d96e4 100644
@@ -30 +32 @@
-@@ -1894,11 +1894,7 @@ struct mlx5_priv {
+@@ -1870,11 +1870,7 @@ struct mlx5_priv {
@@ -44 +46 @@
-index ff3830a888..34b5e0f45b 100644
+index edc273c518..7a5e334a83 100644
@@ -47 +49 @@
-@@ -2775,6 +2775,25 @@ struct mlx5_flow_hw_ctrl_rx {
+@@ -2446,6 +2446,25 @@ struct mlx5_flow_hw_ctrl_rx {
@@ -74 +76 @@
-index a96c829045..feeb071b4b 100644
+index 9de5552bc8..938d9b5824 100644
@@ -77 +79 @@
-@@ -9363,6 +9363,72 @@ flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,
+@@ -8445,6 +8445,72 @@ flow_hw_create_ctrl_jump_table(struct rte_eth_dev *dev,
@@ -150 +152 @@
-@@ -9412,110 +9478,109 @@ flow_hw_create_lacp_rx_table(struct rte_eth_dev *dev,
+@@ -8494,110 +8560,109 @@ flow_hw_create_lacp_rx_table(struct rte_eth_dev *dev,
@@ -306 +308 @@
-@@ -9523,71 +9588,34 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
+@@ -8605,71 +8670,34 @@ flow_hw_create_ctrl_tables(struct rte_eth_dev *dev, struct rte_flow_error *error
@@ -391,2 +393,2 @@
-@@ -10619,6 +10647,7 @@ err:
- 	action_template_drop_release(dev);
+@@ -9640,6 +9668,7 @@ err:
+ 	}
@@ -399,2 +401,2 @@
-@@ -10681,6 +10710,7 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
- 	dev->flow_fp_ops = &rte_flow_fp_default_ops;
+@@ -9698,6 +9727,7 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
+ 		return;
@@ -406,2 +408,2 @@
- 	action_template_drop_release(dev);
-@@ -13259,8 +13289,9 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
+ 	while (!LIST_EMPTY(&priv->flow_hw_grp)) {
+@@ -11983,8 +12013,9 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
@@ -419 +421 @@
-@@ -13292,7 +13323,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
+@@ -12016,7 +12047,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
@@ -429 +431 @@
-@@ -13323,7 +13355,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
+@@ -12047,7 +12079,8 @@ mlx5_flow_hw_esw_create_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn, bool
@@ -439 +441 @@
-@@ -13369,8 +13402,9 @@ mlx5_flow_hw_esw_destroy_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn)
+@@ -12093,8 +12126,9 @@ mlx5_flow_hw_esw_destroy_sq_miss_flow(struct rte_eth_dev *dev, uint32_t sqn)
@@ -451 +453 @@
-@@ -13437,7 +13471,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
+@@ -12161,7 +12195,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
@@ -460 +462 @@
-@@ -13445,7 +13479,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
+@@ -12169,7 +12203,7 @@ mlx5_flow_hw_esw_create_default_jump_flow(struct rte_eth_dev *dev)
@@ -469 +471 @@
-@@ -13497,10 +13531,12 @@ mlx5_flow_hw_create_tx_default_mreg_copy_flow(struct rte_eth_dev *dev)
+@@ -12221,10 +12255,12 @@ mlx5_flow_hw_create_tx_default_mreg_copy_flow(struct rte_eth_dev *dev)
@@ -484 +486 @@
-@@ -13592,10 +13628,11 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)
+@@ -12316,10 +12352,11 @@ mlx5_flow_hw_lacp_rx_flow(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix flow configure validation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (101 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix template clean up of FDB control flow rule' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: prevent ioctl failure log flooding' " Xueming Li
                     ` (20 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8117b4b2f7fa51f50686aa90939b8d8ac41a4ddc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8117b4b2f7fa51f50686aa90939b8d8ac41a4ddc Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Wed, 6 Mar 2024 21:21:50 +0100
Subject: [PATCH] net/mlx5: fix flow configure validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ff9433b578195be8c6cb44443ad199defdbf3c99 ]

There's an existing limitation in mlx5 PMD, that all configured flow
queues must have the same size. Even though this condition is checked,
some allocations are done before that. This lead to segmentation
fault during rollback on error in rte_flow_configure() implementation.

This patch fixes that by reorganizing validation, so that configuration
options are validated before any allocations are done and
necessary checks for NULL are added to error rollback.

Bugzilla ID: 1199
Fixes: b401400db24e ("net/mlx5: add port flow configuration")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 58 +++++++++++++++++++++++----------
 1 file changed, 41 insertions(+), 17 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 938d9b5824..a54075ed7e 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -9291,6 +9291,38 @@ flow_hw_compare_config(const struct mlx5_flow_hw_attr *hw_attr,
 	return true;
 }
 
+static int
+flow_hw_validate_attributes(const struct rte_flow_port_attr *port_attr,
+			    uint16_t nb_queue,
+			    const struct rte_flow_queue_attr *queue_attr[],
+			    struct rte_flow_error *error)
+{
+	uint32_t size;
+	unsigned int i;
+
+	if (port_attr == NULL)
+		return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+					  "Port attributes must be non-NULL");
+
+	if (nb_queue == 0)
+		return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+					  "At least one flow queue is required");
+
+	if (queue_attr == NULL)
+		return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+					  "Queue attributes must be non-NULL");
+
+	size = queue_attr[0]->size;
+	for (i = 1; i < nb_queue; ++i) {
+		if (queue_attr[i]->size != size)
+			return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+						  NULL,
+						  "All flow queues must have the same size");
+	}
+
+	return 0;
+}
+
 /**
  * Configure port HWS resources.
  *
@@ -9342,10 +9374,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
 	int ret = 0;
 	uint32_t action_flags;
 
-	if (!port_attr || !nb_queue || !queue_attr) {
-		rte_errno = EINVAL;
-		goto err;
-	}
+	if (flow_hw_validate_attributes(port_attr, nb_queue, queue_attr, error))
+		return -rte_errno;
 	/*
 	 * Calling rte_flow_configure() again is allowed if and only if
 	 * provided configuration matches the initially provided one.
@@ -9392,14 +9422,6 @@ flow_hw_configure(struct rte_eth_dev *dev,
 	/* Allocate the queue job descriptor LIFO. */
 	mem_size = sizeof(priv->hw_q[0]) * nb_q_updated;
 	for (i = 0; i < nb_q_updated; i++) {
-		/*
-		 * Check if the queues' size are all the same as the
-		 * limitation from HWS layer.
-		 */
-		if (_queue_attr[i]->size != _queue_attr[0]->size) {
-			rte_errno = EINVAL;
-			goto err;
-		}
 		mem_size += (sizeof(struct mlx5_hw_q_job *) +
 			    sizeof(struct mlx5_hw_q_job) +
 			    sizeof(uint8_t) * MLX5_ENCAP_MAX_LEN +
@@ -9681,12 +9703,14 @@ err:
 	flow_hw_destroy_vlan(dev);
 	if (dr_ctx)
 		claim_zero(mlx5dr_context_close(dr_ctx));
-	for (i = 0; i < nb_q_updated; i++) {
-		rte_ring_free(priv->hw_q[i].indir_iq);
-		rte_ring_free(priv->hw_q[i].indir_cq);
+	if (priv->hw_q) {
+		for (i = 0; i < nb_q_updated; i++) {
+			rte_ring_free(priv->hw_q[i].indir_iq);
+			rte_ring_free(priv->hw_q[i].indir_cq);
+		}
+		mlx5_free(priv->hw_q);
+		priv->hw_q = NULL;
 	}
-	mlx5_free(priv->hw_q);
-	priv->hw_q = NULL;
 	if (priv->acts_ipool) {
 		mlx5_ipool_destroy(priv->acts_ipool);
 		priv->acts_ipool = NULL;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.204017644 +0800
+++ 0104-net-mlx5-fix-flow-configure-validation.patch	2024-04-13 20:43:05.107753788 +0800
@@ -1 +1 @@
-From ff9433b578195be8c6cb44443ad199defdbf3c99 Mon Sep 17 00:00:00 2001
+From 8117b4b2f7fa51f50686aa90939b8d8ac41a4ddc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ff9433b578195be8c6cb44443ad199defdbf3c99 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -22,2 +24,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 62 +++++++++++++++++++++++----------
- 1 file changed, 43 insertions(+), 19 deletions(-)
+ drivers/net/mlx5/mlx5_flow_hw.c | 58 +++++++++++++++++++++++----------
+ 1 file changed, 41 insertions(+), 17 deletions(-)
@@ -26 +28 @@
-index d88959e36d..35f1ed7a03 100644
+index 938d9b5824..a54075ed7e 100644
@@ -29,2 +31,2 @@
-@@ -10289,6 +10289,38 @@ mlx5_hwq_ring_create(uint16_t port_id, uint32_t queue, uint32_t size, const char
- 			       RING_F_SP_ENQ | RING_F_SC_DEQ | RING_F_EXACT_SZ);
+@@ -9291,6 +9291,38 @@ flow_hw_compare_config(const struct mlx5_flow_hw_attr *hw_attr,
+ 	return true;
@@ -68 +70 @@
-@@ -10340,10 +10372,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
+@@ -9342,10 +9374,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
@@ -81 +83 @@
-@@ -10390,14 +10420,6 @@ flow_hw_configure(struct rte_eth_dev *dev,
+@@ -9392,14 +9422,6 @@ flow_hw_configure(struct rte_eth_dev *dev,
@@ -94,6 +96,6 @@
- 			     sizeof(struct mlx5_hw_q_job)) * _queue_attr[i]->size;
- 	}
-@@ -10679,14 +10701,16 @@ err:
- 		__atomic_fetch_sub(&host_priv->shared_refcnt, 1, __ATOMIC_RELAXED);
- 		priv->shared_host = NULL;
- 	}
+ 			    sizeof(struct mlx5_hw_q_job) +
+ 			    sizeof(uint8_t) * MLX5_ENCAP_MAX_LEN +
+@@ -9681,12 +9703,14 @@ err:
+ 	flow_hw_destroy_vlan(dev);
+ 	if (dr_ctx)
+ 		claim_zero(mlx5dr_context_close(dr_ctx));
@@ -103,2 +104,0 @@
--		rte_ring_free(priv->hw_q[i].flow_transfer_pending);
--		rte_ring_free(priv->hw_q[i].flow_transfer_completed);
@@ -109,2 +108,0 @@
-+			rte_ring_free(priv->hw_q[i].flow_transfer_pending);
-+			rte_ring_free(priv->hw_q[i].flow_transfer_completed);

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: prevent ioctl failure log flooding' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (102 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix flow configure validation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix age position in hairpin split' " Xueming Li
                     ` (19 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Eli Britstein; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fc12ccc0475d754caab8eb9d06c8e88d68e98d6d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fc12ccc0475d754caab8eb9d06c8e88d68e98d6d Mon Sep 17 00:00:00 2001
From: Eli Britstein <elibr@nvidia.com>
Date: Thu, 7 Mar 2024 08:13:45 +0200
Subject: [PATCH] net/mlx5: prevent ioctl failure log flooding
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 84ba1440c5dff8d716c1a2643aa3eb5e806619ff ]

The following log is printed in WARNING severity:

mlx5_net: port 1 ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM) failed:
    Operation not supported

Reduce the severity to DEBUG to prevent this log from flooding
when there are hundreds of ports probed without supporting this
flow ctrl query.

Fixes: 1256805dd54d ("net/mlx5: move Linux-specific functions")

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 0ee8c58ba7..4f3e790c0b 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -671,7 +671,7 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	ifr.ifr_data = (void *)&ethpause;
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
 	if (ret) {
-		DRV_LOG(WARNING,
+		DRV_LOG(DEBUG,
 			"port %u ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM) failed:"
 			" %s",
 			dev->data->port_id, strerror(rte_errno));
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.241112995 +0800
+++ 0105-net-mlx5-prevent-ioctl-failure-log-flooding.patch	2024-04-13 20:43:05.107753788 +0800
@@ -1 +1 @@
-From 84ba1440c5dff8d716c1a2643aa3eb5e806619ff Mon Sep 17 00:00:00 2001
+From fc12ccc0475d754caab8eb9d06c8e88d68e98d6d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 84ba1440c5dff8d716c1a2643aa3eb5e806619ff ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index e1bc3f7c2e..1f511d6e00 100644
+index 0ee8c58ba7..4f3e790c0b 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix age position in hairpin split' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (103 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: prevent ioctl failure log flooding' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix drop action release timing' " Xueming Li
                     ` (18 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9aba4dee4d43bfc96d4a15be0b77c9fb9301d513

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9aba4dee4d43bfc96d4a15be0b77c9fb9301d513 Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Thu, 7 Mar 2024 10:09:24 +0200
Subject: [PATCH] net/mlx5: fix age position in hairpin split
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4c89815eab7471b98388dc958b95777d341f05fc ]

When splitting a hairpin rule implicitly, the count action will
be on either Tx or Rx subflow based on the encapsulation checking.

Once there is a flow rule with both count and age action, one counter
will be reused. If there is only age action and the ASO flow hit is
supported, the flow hit will be chosen instead of a counter.

In the previous flow splitting, the age would always be in the Rx
part, while the count would be on the Tx part when there is an encap.

Before this commit, 2 issues can be observed with a hairpin split:
  1. On the root table, one counter was used on both Rx and Tx parts
     for age and count actions. Then one ingress packet will be
     counted twice.
  2. On the non-root table, an extra ASO flow hit was used on the Rx
     part. This would cause some overhead.

The age and count actions should be in the same subflow instead of 2.

Fixes: daed4b6e3db2 ("net/mlx5: use aging by counter when counter exists")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    | 1 +
 drivers/net/mlx5/mlx5_flow_dv.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ee210549e7..ccfd189c1f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5492,6 +5492,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
 			}
 			break;
 		case RTE_FLOW_ACTION_TYPE_COUNT:
+		case RTE_FLOW_ACTION_TYPE_AGE:
 			if (encap) {
 				rte_memcpy(actions_tx, actions,
 					   sizeof(struct rte_flow_action));
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index e36443436e..7688d97813 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -19094,8 +19094,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,
 	LIST_FOREACH(act, &age_info->aged_aso, next) {
 		nb_flows++;
 		if (nb_contexts) {
-			context[nb_flows - 1] =
-						act->age_params.context;
+			context[nb_flows - 1] = act->age_params.context;
 			if (!(--nb_contexts))
 				break;
 		}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.265894063 +0800
+++ 0106-net-mlx5-fix-age-position-in-hairpin-split.patch	2024-04-13 20:43:05.117753775 +0800
@@ -1 +1 @@
-From 4c89815eab7471b98388dc958b95777d341f05fc Mon Sep 17 00:00:00 2001
+From 9aba4dee4d43bfc96d4a15be0b77c9fb9301d513 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4c89815eab7471b98388dc958b95777d341f05fc ]
@@ -26 +28,0 @@
-Cc: stable@dpdk.org
@@ -36 +38 @@
-index 6484874c35..f31fdfbf3d 100644
+index ee210549e7..ccfd189c1f 100644
@@ -39 +41 @@
-@@ -5399,6 +5399,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
+@@ -5492,6 +5492,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
@@ -48 +50 @@
-index 80239bebee..4badde1a9a 100644
+index e36443436e..7688d97813 100644
@@ -51 +53 @@
-@@ -19361,8 +19361,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,
+@@ -19094,8 +19094,7 @@ flow_dv_get_aged_flows(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix drop action release timing' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (104 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix age position in hairpin split' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix warning about copy length' " Xueming Li
                     ` (17 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Suanming Mou, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=2864fd3102de0b12ee38816c850b320482ecfb92

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2864fd3102de0b12ee38816c850b320482ecfb92 Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Fri, 8 Mar 2024 05:22:37 +0200
Subject: [PATCH] net/mlx5: fix drop action release timing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 22a3761b782b7c46ca428209b15b4f7382a40a62 ]

When creating the drop action Devx object, the global counter set
is also used as in the regular or hairpin queue creation.

The drop action should be destroyed before the global counter set
release procedure. Or else, the counter set object is still
referenced and cannot be released successfully. This would cause
the counter set resources to be exhausted after starting and stopping
the ports repeatedly.

Fixes: 65b3cd0dc39b ("net/mlx5: create global drop action")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 95f2ed073c..417e88e848 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -2290,12 +2290,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
 		priv->txqs = NULL;
 	}
 	mlx5_proc_priv_uninit(dev);
+	if (priv->drop_queue.hrxq)
+		mlx5_drop_action_destroy(dev);
 	if (priv->q_counters) {
 		mlx5_devx_cmd_destroy(priv->q_counters);
 		priv->q_counters = NULL;
 	}
-	if (priv->drop_queue.hrxq)
-		mlx5_drop_action_destroy(dev);
 	if (priv->mreg_cp_tbl)
 		mlx5_hlist_destroy(priv->mreg_cp_tbl);
 	mlx5_mprq_free_mp(dev);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.302722515 +0800
+++ 0107-net-mlx5-fix-drop-action-release-timing.patch	2024-04-13 20:43:05.117753775 +0800
@@ -1 +1 @@
-From 22a3761b782b7c46ca428209b15b4f7382a40a62 Mon Sep 17 00:00:00 2001
+From 2864fd3102de0b12ee38816c850b320482ecfb92 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 22a3761b782b7c46ca428209b15b4f7382a40a62 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 8b54843a43..d1a63822a5 100644
+index 95f2ed073c..417e88e848 100644
@@ -28 +30 @@
-@@ -2382,12 +2382,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)
+@@ -2290,12 +2290,12 @@ mlx5_dev_close(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix warning about copy length' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (105 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix drop action release timing' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/bnxt: fix number of Tx queues being created' " Xueming Li
                     ` (16 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Morten Brørup; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=5a8ca987e9aff8b1ca4c3d3fc477a56c33ce4bbd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5a8ca987e9aff8b1ca4c3d3fc477a56c33ce4bbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Br=C3=B8rup?= <mb@smartsharesystems.com>
Date: Mon, 16 Jan 2023 14:07:23 +0100
Subject: [PATCH] net/mlx5: fix warning about copy length
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c19580fb8e9ad6f153d46f731ec7cd2050b3021b ]

Use RTE_PTR_ADD where copying to the offset of a field in a structure
holding multiple fields, to avoid compiler warnings with decorated
rte_memcpy.

Fixes: 16a7dbc4f690 ("net/mlx5: make flow modify action list thread safe")

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 7688d97813..b3ccc2063c 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5965,7 +5965,7 @@ flow_dv_modify_create_cb(void *tool_ctx, void *cb_ctx)
 				   "cannot allocate resource memory");
 		return NULL;
 	}
-	rte_memcpy(&entry->ft_type,
+	rte_memcpy(RTE_PTR_ADD(entry, offsetof(typeof(*entry), ft_type)),
 		   RTE_PTR_ADD(ref, offsetof(typeof(*ref), ft_type)),
 		   key_len + data_len);
 	if (entry->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.328523681 +0800
+++ 0108-net-mlx5-fix-warning-about-copy-length.patch	2024-04-13 20:43:05.127753762 +0800
@@ -1 +1 @@
-From c19580fb8e9ad6f153d46f731ec7cd2050b3021b Mon Sep 17 00:00:00 2001
+From 5a8ca987e9aff8b1ca4c3d3fc477a56c33ce4bbd Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c19580fb8e9ad6f153d46f731ec7cd2050b3021b ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 4badde1a9a..d434c678c8 100644
+index 7688d97813..b3ccc2063c 100644
@@ -26 +28 @@
-@@ -6205,7 +6205,7 @@ flow_dv_modify_create_cb(void *tool_ctx, void *cb_ctx)
+@@ -5965,7 +5965,7 @@ flow_dv_modify_create_cb(void *tool_ctx, void *cb_ctx)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/bnxt: fix number of Tx queues being created' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (106 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix warning about copy length' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix Rx queue ID in Rx callback' " Xueming Li
                     ` (15 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Kishore Padmanabha; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0a44e64c41c87bfd8c4e01dd37b0ec43c3d5f509

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0a44e64c41c87bfd8c4e01dd37b0ec43c3d5f509 Mon Sep 17 00:00:00 2001
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Date: Mon, 13 Nov 2023 11:08:52 -0500
Subject: [PATCH] net/bnxt: fix number of Tx queues being created
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 05b67582cc93128bbf2eb26726d781b8c5c561b3 ]

The number of Tx queues for the representor port is limited by
number of Rx rings instead of Tx rings.

Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_reps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index a7b75b543e..6d6b8252e2 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -739,10 +739,10 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	struct bnxt_tx_queue *parent_txq, *txq;
 	struct bnxt_vf_rep_tx_queue *vfr_txq;
 
-	if (queue_idx >= rep_bp->rx_nr_rings) {
+	if (queue_idx >= rep_bp->tx_nr_rings) {
 		PMD_DRV_LOG(ERR,
 			    "Cannot create Tx rings %d. %d rings available\n",
-			    queue_idx, rep_bp->rx_nr_rings);
+			    queue_idx, rep_bp->tx_nr_rings);
 		return -EINVAL;
 	}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.361514438 +0800
+++ 0109-net-bnxt-fix-number-of-Tx-queues-being-created.patch	2024-04-13 20:43:05.127753762 +0800
@@ -1 +1 @@
-From 05b67582cc93128bbf2eb26726d781b8c5c561b3 Mon Sep 17 00:00:00 2001
+From 0a44e64c41c87bfd8c4e01dd37b0ec43c3d5f509 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 05b67582cc93128bbf2eb26726d781b8c5c561b3 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index edcc27f556..79b3583636 100644
+index a7b75b543e..6d6b8252e2 100644

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/ipsec-secgw: fix Rx queue ID in Rx callback' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (107 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/bnxt: fix number of Tx queues being created' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'doc: fix default IP fragments maximum in programmer guide' " Xueming Li
                     ` (14 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shihong Wang; +Cc: Chaoyong He, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f7909e3c75d813035a9f8238df9be11d96483667

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f7909e3c75d813035a9f8238df9be11d96483667 Mon Sep 17 00:00:00 2001
From: Shihong Wang <shihong.wang@corigine.com>
Date: Mon, 11 Mar 2024 10:32:47 +0800
Subject: [PATCH] examples/ipsec-secgw: fix Rx queue ID in Rx callback
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 179e9b44ac6d64dc10ee3116e44b66f12d43e7a8 ]

The Rx queue ID on the core and on the port are not necessarily
equal, for example, there are two RX queues on core0, queue0 and
queue1, queue0 is the rx_queueid0 on port0 and queue1 is the
rx_queueid0 on port1.

The 'rte_eth_add_rx_callback()' function is based on the port
registration callback function, so should be the RX queue ID on
the port.

Fixes: d04bb1c52647 ("examples/ipsec-secgw: use HW parsed packet type in poll mode")

Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index a61bea400a..45a303850d 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2093,10 +2093,10 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads,
 
 			/* Register Rx callback if ptypes are not supported */
 			if (!ptype_supported &&
-			    !rte_eth_add_rx_callback(portid, queue,
+			    !rte_eth_add_rx_callback(portid, rx_queueid,
 						     parse_ptype_cb, NULL)) {
 				printf("Failed to add rx callback: port=%d, "
-				       "queue=%d\n", portid, queue);
+				       "rx_queueid=%d\n", portid, rx_queueid);
 			}
 
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.386382405 +0800
+++ 0110-examples-ipsec-secgw-fix-Rx-queue-ID-in-Rx-callback.patch	2024-04-13 20:43:05.127753762 +0800
@@ -1 +1 @@
-From 179e9b44ac6d64dc10ee3116e44b66f12d43e7a8 Mon Sep 17 00:00:00 2001
+From f7909e3c75d813035a9f8238df9be11d96483667 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 179e9b44ac6d64dc10ee3116e44b66f12d43e7a8 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix default IP fragments maximum in programmer guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (108 preceding siblings ...)
  2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix Rx queue ID in Rx callback' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/nfp: fix uninitialized variable' " Xueming Li
                     ` (13 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Simei Su; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a5ac9baa7a5d6aae1d79193ce25cd0725173e5b8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a5ac9baa7a5d6aae1d79193ce25cd0725173e5b8 Mon Sep 17 00:00:00 2001
From: Simei Su <simei.su@intel.com>
Date: Fri, 5 Jan 2024 10:44:17 +0800
Subject: [PATCH] doc: fix default IP fragments maximum in programmer guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0219d467bcb1d19b386b5bae8eecd3514ba13fdb ]

Update documentation value to match default value in code base.

Fixes: f8e0f8ce9030 ("ip_frag: increase default maximum of fragments")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 doc/guides/prog_guide/ip_fragment_reassembly_lib.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/prog_guide/ip_fragment_reassembly_lib.rst b/doc/guides/prog_guide/ip_fragment_reassembly_lib.rst
index 314d4adbb8..b14289eb73 100644
--- a/doc/guides/prog_guide/ip_fragment_reassembly_lib.rst
+++ b/doc/guides/prog_guide/ip_fragment_reassembly_lib.rst
@@ -43,7 +43,7 @@ Note that all update/lookup operations on Fragment Table are not thread safe.
 So if different execution contexts (threads/processes) will access the same table simultaneously,
 then some external syncing mechanism have to be provided.
 
-Each table entry can hold information about packets consisting of up to RTE_LIBRTE_IP_FRAG_MAX (by default: 4) fragments.
+Each table entry can hold information about packets consisting of up to RTE_LIBRTE_IP_FRAG_MAX (by default: 8) fragments.
 
 Code example, that demonstrates creation of a new Fragment table:
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.416490366 +0800
+++ 0111-doc-fix-default-IP-fragments-maximum-in-programmer-g.patch	2024-04-13 20:43:05.127753762 +0800
@@ -1 +1 @@
-From 0219d467bcb1d19b386b5bae8eecd3514ba13fdb Mon Sep 17 00:00:00 2001
+From a5ac9baa7a5d6aae1d79193ce25cd0725173e5b8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0219d467bcb1d19b386b5bae8eecd3514ba13fdb ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/nfp: fix uninitialized variable' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (109 preceding siblings ...)
  2024-04-13 12:49   ` patch 'doc: fix default IP fragments maximum in programmer guide' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'app/testpmd: fix auto-completion for indirect action list' " Xueming Li
                     ` (12 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Long Wu, Peng Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=4aa1a6420482dccab127369b01d51d1825fdd71d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4aa1a6420482dccab127369b01d51d1825fdd71d Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 19 Mar 2024 16:55:07 +0800
Subject: [PATCH] net/nfp: fix uninitialized variable
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 77cb47144932a52c34f1825d90a8804c2538817b ]

CI found in the logic of 'nfp_aesgcm_iv_update()', the variable
'cfg_iv' may be used uninitialized in some case.

Coverity issue: 415808
Fixes: 7e13f2dc603e ("net/nfp: fix IPsec data endianness")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_ipsec.c b/drivers/net/nfp/nfp_ipsec.c
index aebdbb2f48..b10cda570b 100644
--- a/drivers/net/nfp/nfp_ipsec.c
+++ b/drivers/net/nfp/nfp_ipsec.c
@@ -523,7 +523,7 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
 	char *iv_b;
 	char *iv_str;
 	const rte_be32_t *iv_value;
-	uint8_t cfg_iv[NFP_ESP_IV_LENGTH];
+	uint8_t cfg_iv[NFP_ESP_IV_LENGTH] = {};
 
 	iv_str = strdup(iv_string);
 	if (iv_str == NULL) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.445391928 +0800
+++ 0112-net-nfp-fix-uninitialized-variable.patch	2024-04-13 20:43:05.137753749 +0800
@@ -1 +1 @@
-From 77cb47144932a52c34f1825d90a8804c2538817b Mon Sep 17 00:00:00 2001
+From 4aa1a6420482dccab127369b01d51d1825fdd71d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 77cb47144932a52c34f1825d90a8804c2538817b ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 205d1d594c..647bc2bb6d 100644
+index aebdbb2f48..b10cda570b 100644
@@ -24 +26 @@
-@@ -526,7 +526,7 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,
+@@ -523,7 +523,7 @@ nfp_aesgcm_iv_update(struct ipsec_add_sa *cfg,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'app/testpmd: fix auto-completion for indirect action list' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (110 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/nfp: fix uninitialized variable' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/ena: fix mbuf double free in fast free mode' " Xueming Li
                     ` (11 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shani Peretz; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50 Mon Sep 17 00:00:00 2001
From: Shani Peretz <shperetz@nvidia.com>
Date: Mon, 18 Mar 2024 11:21:09 +0200
Subject: [PATCH] app/testpmd: fix auto-completion for indirect action list
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c ]

In the process of auto completion of a command in testpmd,
the parser splits the command into tokens, where each token
represents an argument and defines a parsing function.
The parsing function of the indirect_list action argument was returning
before having the opportunity to handle the argument.

The fix ensures that the function appropriately handles
the argument before finishing.

Fixes: 72a3dec7126f ("ethdev: add indirect flow list action")

Signed-off-by: Shani Peretz <shperetz@nvidia.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                    |  1 +
 app/test-pmd/cmdline_flow.c | 46 ++++++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/.mailmap b/.mailmap
index 3b32923fef..57e72894c0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1281,6 +1281,7 @@ Shahed Shaikh <shshaikh@marvell.com> <shahed.shaikh@cavium.com>
 Shai Brandes <shaibran@amazon.com>
 Shailendra Bhatnagar <shailendra.bhatnagar@intel.com>
 Shally Verma <shallyv@marvell.com> <shally.verma@caviumnetworks.com>
+Shani Peretz <shperetz@nvidia.com>
 Shannon Nelson <snelson@pensando.io>
 Shannon Zhao <zhaoshenglong@huawei.com>
 Shaopeng He <shaopeng.he@intel.com>
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index b19b3205f0..681924b379 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -7395,11 +7395,13 @@ static const struct token token_list[] = {
 		.type = "UNSIGNED",
 		.help = "unsigned integer value",
 		.call = parse_indlst_id2ptr,
+		.comp = comp_none,
 	},
 	[INDIRECT_LIST_ACTION_ID2PTR_CONF] = {
 		.type = "UNSIGNED",
 		.help = "unsigned integer value",
 		.call = parse_indlst_id2ptr,
+		.comp = comp_none,
 	},
 	[ACTION_SHARED_INDIRECT] = {
 		.name = "shared_indirect",
@@ -11334,34 +11336,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,
 	uint32_t id;
 	int ret;
 
-	if (!action)
-		return -1;
 	ctx->objdata = 0;
 	ctx->object = &id;
 	ctx->objmask = NULL;
 	ret = parse_int(ctx, token, str, len, ctx->object, sizeof(id));
+	ctx->object = action;
 	if (ret != (int)len)
 		return ret;
-	ctx->object = action;
-	action_conf = (void *)(uintptr_t)action->conf;
-	action_conf->conf = NULL;
-	switch (ctx->curr) {
-	case INDIRECT_LIST_ACTION_ID2PTR_HANDLE:
-	action_conf->handle = (typeof(action_conf->handle))
-				port_action_handle_get_by_id(ctx->port, id);
-		if (!action_conf->handle) {
-			printf("no indirect list handle for id %u\n", id);
-			return -1;
+
+	/* set handle and conf */
+	if (action) {
+		action_conf = (void *)(uintptr_t)action->conf;
+		action_conf->conf = NULL;
+		switch (ctx->curr) {
+		case INDIRECT_LIST_ACTION_ID2PTR_HANDLE:
+		action_conf->handle = (typeof(action_conf->handle))
+					port_action_handle_get_by_id(ctx->port, id);
+			if (!action_conf->handle) {
+				printf("no indirect list handle for id %u\n", id);
+				return -1;
+			}
+			break;
+		case INDIRECT_LIST_ACTION_ID2PTR_CONF:
+			indlst_conf = indirect_action_list_conf_get(id);
+			if (!indlst_conf)
+				return -1;
+			action_conf->conf = (const void **)indlst_conf->conf;
+			break;
+		default:
+			break;
 		}
-		break;
-	case INDIRECT_LIST_ACTION_ID2PTR_CONF:
-		indlst_conf = indirect_action_list_conf_get(id);
-		if (!indlst_conf)
-			return -1;
-		action_conf->conf = (const void **)indlst_conf->conf;
-		break;
-	default:
-		break;
 	}
 	return ret;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.477437587 +0800
+++ 0113-app-testpmd-fix-auto-completion-for-indirect-action-.patch	2024-04-13 20:43:05.137753749 +0800
@@ -1 +1 @@
-From aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c Mon Sep 17 00:00:00 2001
+From f7d1b5cff39f423c2afcb4f8a12c9e2abb63bd50 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit aaa5b54d3890cf32fa1eabbcb3e306ebdc4f938c ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index e189477a2f..a0b19832b5 100644
+index 3b32923fef..57e72894c0 100644
@@ -29 +31 @@
-@@ -1293,6 +1293,7 @@ Shahed Shaikh <shshaikh@marvell.com> <shahed.shaikh@cavium.com>
+@@ -1281,6 +1281,7 @@ Shahed Shaikh <shshaikh@marvell.com> <shahed.shaikh@cavium.com>
@@ -38 +40 @@
-index fd6c51f72d..60ee9337cf 100644
+index b19b3205f0..681924b379 100644
@@ -41 +43 @@
-@@ -7839,11 +7839,13 @@ static const struct token token_list[] = {
+@@ -7395,11 +7395,13 @@ static const struct token token_list[] = {
@@ -55 +57 @@
-@@ -11912,34 +11914,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,
+@@ -11334,34 +11336,36 @@ parse_indlst_id2ptr(struct context *ctx, const struct token *token,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ena: fix mbuf double free in fast free mode' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (111 preceding siblings ...)
  2024-04-13 12:49   ` patch 'app/testpmd: fix auto-completion for indirect action list' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD' " Xueming Li
                     ` (10 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Shai Brandes; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d2d309e5cf0ea384c13c6357a4a0f2b08816214e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d2d309e5cf0ea384c13c6357a4a0f2b08816214e Mon Sep 17 00:00:00 2001
From: Shai Brandes <shaibran@amazon.com>
Date: Wed, 20 Mar 2024 16:52:32 +0200
Subject: [PATCH] net/ena: fix mbuf double free in fast free mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 237407f0c3dff2d0a6bbeb5f35c8b32fe5c8afed ]

Fixed an issue of double free of mbufs which is exposed
in mbuf fast free mode when handling multi-mbuf packets.

The faulty patch mishandled free of non-head mbufs as it
iterated over linked mbufs and collected them into an array,
which was then passed to rte_pktmbuf_free_bulk.
However, rte_pktmbuf_free_bulk already performs an internal iteration
over mbufs that are linked together which led to double free.

Fixes: 89b081e154c5 ("net/ena: fix fast mbuf free")

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/ena/ena_ethdev.c | 39 +++++++++++-------------------------
 1 file changed, 12 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 1e138849cc..e122a55fa4 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -37,10 +37,10 @@
 #define ENA_MIN_RING_DESC	128
 
 /*
- * We should try to keep ENA_CLEANUP_BUF_SIZE lower than
+ * We should try to keep ENA_CLEANUP_BUF_THRESH lower than
  * RTE_MEMPOOL_CACHE_MAX_SIZE, so we can fit this in mempool local cache.
  */
-#define ENA_CLEANUP_BUF_SIZE	256
+#define ENA_CLEANUP_BUF_THRESH	256
 
 #define ENA_PTYPE_HAS_HASH	(RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP)
 
@@ -3105,32 +3105,12 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
 	return 0;
 }
 
-static __rte_always_inline size_t
-ena_tx_cleanup_mbuf_fast(struct rte_mbuf **mbufs_to_clean,
-			 struct rte_mbuf *mbuf,
-			 size_t mbuf_cnt,
-			 size_t buf_size)
-{
-	struct rte_mbuf *m_next;
-
-	while (mbuf != NULL) {
-		m_next = mbuf->next;
-		mbufs_to_clean[mbuf_cnt++] = mbuf;
-		if (mbuf_cnt == buf_size) {
-			rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt);
-			mbuf_cnt = 0;
-		}
-		mbuf = m_next;
-	}
-
-	return mbuf_cnt;
-}
-
 static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
 {
-	struct rte_mbuf *mbufs_to_clean[ENA_CLEANUP_BUF_SIZE];
+	struct rte_mbuf *pkts_to_clean[ENA_CLEANUP_BUF_THRESH];
 	struct ena_ring *tx_ring = (struct ena_ring *)txp;
 	size_t mbuf_cnt = 0;
+	size_t pkt_cnt = 0;
 	unsigned int total_tx_descs = 0;
 	unsigned int total_tx_pkts = 0;
 	uint16_t cleanup_budget;
@@ -3161,8 +3141,13 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
 
 		mbuf = tx_info->mbuf;
 		if (fast_free) {
-			mbuf_cnt = ena_tx_cleanup_mbuf_fast(mbufs_to_clean, mbuf, mbuf_cnt,
-				ENA_CLEANUP_BUF_SIZE);
+			pkts_to_clean[pkt_cnt++] = mbuf;
+			mbuf_cnt += mbuf->nb_segs;
+			if (mbuf_cnt >= ENA_CLEANUP_BUF_THRESH) {
+				rte_pktmbuf_free_bulk(pkts_to_clean, pkt_cnt);
+				mbuf_cnt = 0;
+				pkt_cnt = 0;
+			}
 		} else {
 			rte_pktmbuf_free(mbuf);
 		}
@@ -3185,7 +3170,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
 	}
 
 	if (mbuf_cnt != 0)
-		rte_pktmbuf_free_bulk(mbufs_to_clean, mbuf_cnt);
+		rte_pktmbuf_free_bulk(pkts_to_clean, pkt_cnt);
 
 	/* Notify completion handler that full cleanup was performed */
 	if (free_pkt_cnt == 0 || total_tx_pkts < cleanup_budget)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.518477733 +0800
+++ 0114-net-ena-fix-mbuf-double-free-in-fast-free-mode.patch	2024-04-13 20:43:05.137753749 +0800
@@ -1 +1 @@
-From 237407f0c3dff2d0a6bbeb5f35c8b32fe5c8afed Mon Sep 17 00:00:00 2001
+From d2d309e5cf0ea384c13c6357a4a0f2b08816214e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 237407f0c3dff2d0a6bbeb5f35c8b32fe5c8afed ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 7b697c150a..66fc287faf 100644
+index 1e138849cc..e122a55fa4 100644
@@ -28,2 +30,2 @@
-@@ -48,10 +48,10 @@
- #define MAX_WIDE_LLQ_DEPTH_UNSUPPORTED 0
+@@ -37,10 +37,10 @@
+ #define ENA_MIN_RING_DESC	128
@@ -41 +43 @@
-@@ -3180,32 +3180,12 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
+@@ -3105,32 +3105,12 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
@@ -76 +78 @@
-@@ -3236,8 +3216,13 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
+@@ -3161,8 +3141,13 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
@@ -92 +94 @@
-@@ -3260,7 +3245,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)
+@@ -3185,7 +3170,7 @@ static int ena_tx_cleanup(void *txp, uint32_t free_pkt_cnt)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (112 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/ena: fix mbuf double free in fast free mode' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/igc: fix timesync disable' " Xueming Li
                     ` (9 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Tom Jones; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=07fde8240d6ad3bbf6a42b515d12d8a1bec650ca

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 07fde8240d6ad3bbf6a42b515d12d8a1bec650ca Mon Sep 17 00:00:00 2001
From: Tom Jones <thj@freebsd.org>
Date: Thu, 21 Mar 2024 10:31:33 +0000
Subject: [PATCH] net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 19fede459e0d22f5ac891366465dce07e68196bc ]

Interrupts disabled on FreeBSD for the vmxnet3 driver as they are not
supported. Rx queue interrupts were missed by this change, don't
attempt to enable them on FreeBSD.

Without this change applications enabling interrupts encounter an
immediate abort on FreeBSD.

Fixes: 40d5676ff1ea ("net/vmxnet3: fix initialization on FreeBSD")

Signed-off-by: Tom Jones <thj@freebsd.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                             | 1 +
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/.mailmap b/.mailmap
index 57e72894c0..69ef5145a9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1446,6 +1446,7 @@ Tomasz Kulasek <tomaszx.kulasek@intel.com>
 Tomasz Zawadzki <tomasz.zawadzki@intel.com>
 Tom Barbette <barbette@kth.se> <tom.barbette@ulg.ac.be>
 Tom Crugnale <tcrugnale@sandvine.com>
+Tom Jones <thj@freebsd.org>
 Tom Millington <tmillington@solarflare.com>
 Tom Rix <trix@redhat.com>
 Tomer Shmilovich <tshmilovich@nvidia.com>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 7032f0e324..70ae9c6035 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1932,11 +1932,13 @@ done:
 static int
 vmxnet3_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
+#ifndef RTE_EXEC_ENV_FREEBSD
 	struct vmxnet3_hw *hw = dev->data->dev_private;
 
 	vmxnet3_enable_intr(hw,
 			    rte_intr_vec_list_index_get(dev->intr_handle,
 							       queue_id));
+#endif
 
 	return 0;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.557236082 +0800
+++ 0115-net-vmxnet3-ignore-Rx-queue-interrupt-setup-on-FreeB.patch	2024-04-13 20:43:05.147753736 +0800
@@ -1 +1 @@
-From 19fede459e0d22f5ac891366465dce07e68196bc Mon Sep 17 00:00:00 2001
+From 07fde8240d6ad3bbf6a42b515d12d8a1bec650ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 19fede459e0d22f5ac891366465dce07e68196bc ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index a0b19832b5..491af1f6ff 100644
+index 57e72894c0..69ef5145a9 100644
@@ -27 +29 @@
-@@ -1458,6 +1458,7 @@ Tomasz Kulasek <tomaszx.kulasek@intel.com>
+@@ -1446,6 +1446,7 @@ Tomasz Kulasek <tomaszx.kulasek@intel.com>
@@ -36 +38 @@
-index 2707b25148..ce7c347254 100644
+index 7032f0e324..70ae9c6035 100644
@@ -39 +41 @@
-@@ -1936,11 +1936,13 @@ done:
+@@ -1932,11 +1932,13 @@ done:

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/igc: fix timesync disable' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (113 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5/hws: fix memory access in L3 decapsulation' " Xueming Li
                     ` (8 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: Tingting Liao, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0291a1f49edd9b9cecdc41f2989200a7e061d9c9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0291a1f49edd9b9cecdc41f2989200a7e061d9c9 Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma@intel.com>
Date: Fri, 15 Mar 2024 09:06:31 +0800
Subject: [PATCH] net/igc: fix timesync disable
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6e4b297c22baad9c347fbf00dc7589a0a077dd00 ]

When disabling timesync, we should clear the IGC_RXPBS_CFG_TS_EN bit
of IGC_RXPBS, the patch fixes this.

Fixes: 4f6fbbf6f17d ("net/igc: support IEEE 1588 PTP")

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Tested-by: Tingting Liao <tingtingx.liao@intel.com>
---
 .mailmap                     | 1 +
 drivers/net/igc/igc_ethdev.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 69ef5145a9..24c4ad3b85 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1434,6 +1434,7 @@ Timothy Redaelli <tredaelli@redhat.com>
 Tim Shearer <tim.shearer@overturenetworks.com>
 Ting-Kai Ku <ting-kai.ku@intel.com>
 Ting Xu <ting.xu@intel.com>
+Tingting Liao <tingtingx.liao@intel.com>
 Tiwei Bie <tiwei.bie@intel.com> <btw@mail.ustc.edu.cn>
 Todd Fujinaka <todd.fujinaka@intel.com>
 Tomasz Cel <tomaszx.cel@intel.com>
diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index 58c4f80927..690736b6d1 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -2853,7 +2853,7 @@ eth_igc_timesync_disable(struct rte_eth_dev *dev)
 	IGC_WRITE_REG(hw, IGC_TSYNCRXCTL, 0);
 
 	val = IGC_READ_REG(hw, IGC_RXPBS);
-	val &= IGC_RXPBS_CFG_TS_EN;
+	val &= ~IGC_RXPBS_CFG_TS_EN;
 	IGC_WRITE_REG(hw, IGC_RXPBS, val);
 
 	val = IGC_READ_REG(hw, IGC_SRRCTL(0));
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.586245344 +0800
+++ 0116-net-igc-fix-timesync-disable.patch	2024-04-13 20:43:05.147753736 +0800
@@ -1 +1 @@
-From 6e4b297c22baad9c347fbf00dc7589a0a077dd00 Mon Sep 17 00:00:00 2001
+From 0291a1f49edd9b9cecdc41f2989200a7e061d9c9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6e4b297c22baad9c347fbf00dc7589a0a077dd00 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 491af1f6ff..f53fb59513 100644
+index 69ef5145a9..24c4ad3b85 100644
@@ -23 +25 @@
-@@ -1446,6 +1446,7 @@ Timothy Redaelli <tredaelli@redhat.com>
+@@ -1434,6 +1434,7 @@ Timothy Redaelli <tredaelli@redhat.com>
@@ -32 +34 @@
-index 08e9e16ae5..87d7f7caa0 100644
+index 58c4f80927..690736b6d1 100644
@@ -35 +37 @@
-@@ -2855,7 +2855,7 @@ eth_igc_timesync_disable(struct rte_eth_dev *dev)
+@@ -2853,7 +2853,7 @@ eth_igc_timesync_disable(struct rte_eth_dev *dev)

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5/hws: fix memory access in L3 decapsulation' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (114 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/igc: fix timesync disable' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'net/mlx5: fix sync flow meter action' " Xueming Li
                     ` (7 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Alex Vesker; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=aeebcd33c070db072666eb2dbdf587f3c0319a49

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From aeebcd33c070db072666eb2dbdf587f3c0319a49 Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex@nvidia.com>
Date: Fri, 22 Mar 2024 12:01:59 +0200
Subject: [PATCH] net/mlx5/hws: fix memory access in L3 decapsulation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1738b65b89ba5c80c452cb9acdaad4af892e802d ]

In case decapL3 action is created we would access header
data even in case the SHARED flag is not set, this would
lead to an invalid memory access.

Fixes: 3a6c50215c07 ("net/mlx5/hws: support multi-pattern")

Signed-off-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index 862ee3e332..d21bca294c 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -1465,7 +1465,9 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action,
 
 	/* Create a full modify header action list in case shared */
 	mlx5dr_action_prepare_decap_l3_actions(hdrs->sz, mh_data, &num_of_actions);
-	mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions);
+
+	if (action->flags & MLX5DR_ACTION_FLAG_SHARED)
+		mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions);
 
 	/* All DecapL3 cases require the same max arg size */
 	arg_obj = mlx5dr_arg_create_modify_header_arg(ctx,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.617256604 +0800
+++ 0117-net-mlx5-hws-fix-memory-access-in-L3-decapsulation.patch	2024-04-13 20:43:05.147753736 +0800
@@ -1 +1 @@
-From 1738b65b89ba5c80c452cb9acdaad4af892e802d Mon Sep 17 00:00:00 2001
+From aeebcd33c070db072666eb2dbdf587f3c0319a49 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1738b65b89ba5c80c452cb9acdaad4af892e802d ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 084d4d606e..562fb5cbb4 100644
+index 862ee3e332..d21bca294c 100644
@@ -22 +24 @@
-@@ -1775,7 +1775,9 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action,
+@@ -1465,7 +1465,9 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/mlx5: fix sync flow meter action' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (115 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5/hws: fix memory access in L3 decapsulation' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:49   ` patch 'doc: fix typo in profiling guide' " Xueming Li
                     ` (6 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Dariusz Sosnowski, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=df1119d4a906b1644c231059579315d84ee9772c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From df1119d4a906b1644c231059579315d84ee9772c Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Tue, 19 Mar 2024 13:24:55 +0200
Subject: [PATCH] net/mlx5: fix sync flow meter action
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dc7faa135188ede2455c66e79110538f1f92e08c ]

PMD implements sync METER flow action as async.
Queue selected for sync operations is `MLX5_HW_INV_QUEUE`.
That dummy queue value is translated into `CTRL_QUEUE_ID(priv)`.
Async job allocation converts INV queue into the real value, but
job release does not.

This patch fixes the queue value provided to `flow_hw_job_put()`.

This patch also removes dead code found in METER_MARK
destroy handler.

Coverity issue: 415804, 415806
Fixes: 4359d9d1f76b ("net/mlx5: fix sync meter processing in HWS")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c    | 5 +----
 drivers/net/mlx5/mlx5_flow_meter.c | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index a54075ed7e..47fbbd0818 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -10497,10 +10497,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
 				NULL, "Unable to wait for ASO meter CQE");
 			break;
 		}
-		if (!job)
-			mlx5_ipool_free(pool->idx_pool, idx);
-		else
-			aso = true;
+		aso = true;
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_RSS:
 		ret = flow_dv_action_destroy(dev, handle, error);
diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index 249dc73691..7bf5018c70 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -1981,7 +1981,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
 	ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE, aso_mtr,
 					   &priv->mtr_bulk, job, true);
 	if (ret) {
-		flow_hw_job_put(priv, job, MLX5_HW_INV_QUEUE);
+		flow_hw_job_put(priv, job, CTRL_QUEUE_ID(priv));
 		return -rte_mtr_error_set(error, ENOTSUP,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED,
 					  NULL, "Failed to create devx meter.");
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.648623763 +0800
+++ 0118-net-mlx5-fix-sync-flow-meter-action.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From dc7faa135188ede2455c66e79110538f1f92e08c Mon Sep 17 00:00:00 2001
+From df1119d4a906b1644c231059579315d84ee9772c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dc7faa135188ede2455c66e79110538f1f92e08c ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 35f1ed7a03..9ebbe664d1 100644
+index a54075ed7e..47fbbd0818 100644
@@ -32 +34 @@
-@@ -11494,10 +11494,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
+@@ -10497,10 +10497,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue,
@@ -45 +47 @@
-index 4045c4c249..ca361f7efa 100644
+index 249dc73691..7bf5018c70 100644
@@ -48 +50 @@
-@@ -2265,7 +2265,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,
+@@ -1981,7 +1981,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id,

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix typo in profiling guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (116 preceding siblings ...)
  2024-04-13 12:49   ` patch 'net/mlx5: fix sync flow meter action' " Xueming Li
@ 2024-04-13 12:49   ` Xueming Li
  2024-04-13 12:50   ` patch 'doc: fix typo in packet framework " Xueming Li
                     ` (5 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:49 UTC (permalink / raw)
  To: Emi Aoki; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e85092f875045a9212de39a05876925e166cf3ef

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e85092f875045a9212de39a05876925e166cf3ef Mon Sep 17 00:00:00 2001
From: Emi Aoki <embm29@gmail.com>
Date: Thu, 21 Mar 2024 19:02:25 -0400
Subject: [PATCH] doc: fix typo in profiling guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a67ce452919a3381ccdc53af7bcc0196838b3586 ]

Caught by codespell.

Fixes: 9d5ba88c2d41 ("doc: add ARM profiling methods")

Signed-off-by: Emi Aoki <embm29@gmail.com>
---
 .mailmap                              | 1 +
 doc/guides/prog_guide/profile_app.rst | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 24c4ad3b85..32a69b6bd0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -369,6 +369,7 @@ Elad Persiko <eladpe@mellanox.com>
 Elena Agostini <eagostini@nvidia.com>
 Eli Britstein <elibr@nvidia.com> <elibr@mellanox.com>
 Elza Mathew <elza.mathew@intel.com>
+Emi Aoki <embm29@gmail.com>
 Emma Finn <emma.finn@intel.com>
 Emma Kenny <emma.kenny@intel.com>
 Emmanuel Roullit <emmanuel.roullit@gmail.com>
diff --git a/doc/guides/prog_guide/profile_app.rst b/doc/guides/prog_guide/profile_app.rst
index 14292d4c25..a6b5fb4d5e 100644
--- a/doc/guides/prog_guide/profile_app.rst
+++ b/doc/guides/prog_guide/profile_app.rst
@@ -59,7 +59,7 @@ addition to the standard events, ``perf`` can be used to profile arm64
 specific PMU (Performance Monitor Unit) events through raw events (``-e``
 ``-rXX``).
 
-For more derails refer to the
+For more details refer to the
 `ARM64 specific PMU events enumeration <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100095_0002_04_en/way1382543438508.html>`_.
 
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.677867325 +0800
+++ 0119-doc-fix-typo-in-profiling-guide.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From a67ce452919a3381ccdc53af7bcc0196838b3586 Mon Sep 17 00:00:00 2001
+From e85092f875045a9212de39a05876925e166cf3ef Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a67ce452919a3381ccdc53af7bcc0196838b3586 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index f53fb59513..67687d21b1 100644
+index 24c4ad3b85..32a69b6bd0 100644
@@ -21 +23 @@
-@@ -373,6 +373,7 @@ Elad Persiko <eladpe@mellanox.com>
+@@ -369,6 +369,7 @@ Elad Persiko <eladpe@mellanox.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'doc: fix typo in packet framework guide' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (117 preceding siblings ...)
  2024-04-13 12:49   ` patch 'doc: fix typo in profiling guide' " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  2024-04-13 12:50   ` patch 'test/power: fix typo in error message' " Xueming Li
                     ` (4 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Flore Norceide; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ed3a625fe6ce5f6890578c9fa9385f624a459d0f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ed3a625fe6ce5f6890578c9fa9385f624a459d0f Mon Sep 17 00:00:00 2001
From: Flore Norceide <florestecien@gmail.com>
Date: Thu, 21 Mar 2024 19:03:52 -0400
Subject: [PATCH] doc: fix typo in packet framework guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e4e1f2f7d24240d476cfa757e218d1532759b65d ]

Caught by codespell

Fixes: fc1f2750a3ec ("doc: programmers guide")

Signed-off-by: Flore Norceide <florestecien@gmail.com>
---
 .mailmap                                   | 1 +
 doc/guides/prog_guide/packet_framework.rst | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 32a69b6bd0..1798486ef9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -407,6 +407,7 @@ Fidaullah Noonari <fidaullah.noonari@emumba.com>
 Fiona Trahe <fiona.trahe@intel.com>
 Flavia Musatescu <flavia.musatescu@intel.com>
 Flavio Leitner <fbl@redhat.com> <fbl@sysclose.org>
+Flore Norceide <florestecien@gmail.com>
 Forrest Shi <xuelin.shi@nxp.com>
 Francesco Mancino <francesco.mancino@tutus.se>
 Francesco Santoro <francesco.santoro@6wind.com>
diff --git a/doc/guides/prog_guide/packet_framework.rst b/doc/guides/prog_guide/packet_framework.rst
index ebc69d8c3e..9987ead6c5 100644
--- a/doc/guides/prog_guide/packet_framework.rst
+++ b/doc/guides/prog_guide/packet_framework.rst
@@ -509,7 +509,7 @@ the number of L2 or L3 cache memory misses is greatly reduced, hence one of the
 This is because the cost of L2/L3 cache memory miss on memory read accesses is high, as usually due to data dependency between instructions,
 the CPU execution units have to stall until the read operation is completed from L3 cache memory or external DRAM memory.
 By using prefetch instructions, the latency of memory read accesses is hidden,
-provided that it is preformed early enough before the respective data structure is actually used.
+provided that it is performed early enough before the respective data structure is actually used.
 
 By splitting the processing into several stages that are executed on different packets (the packets from the input burst are interlaced),
 enough work is created to allow the prefetch instructions to complete successfully (before the prefetched data structures are actually accessed) and
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.700743595 +0800
+++ 0120-doc-fix-typo-in-packet-framework-guide.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From e4e1f2f7d24240d476cfa757e218d1532759b65d Mon Sep 17 00:00:00 2001
+From ed3a625fe6ce5f6890578c9fa9385f624a459d0f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e4e1f2f7d24240d476cfa757e218d1532759b65d ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 67687d21b1..ac50264e66 100644
+index 32a69b6bd0..1798486ef9 100644
@@ -21 +23 @@
-@@ -411,6 +411,7 @@ Fidaullah Noonari <fidaullah.noonari@emumba.com>
+@@ -407,6 +407,7 @@ Fidaullah Noonari <fidaullah.noonari@emumba.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test/power: fix typo in error message' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (118 preceding siblings ...)
  2024-04-13 12:50   ` patch 'doc: fix typo in packet framework " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  2024-04-13 12:50   ` patch 'test/cfgfile: fix typo in error messages' " Xueming Li
                     ` (3 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Fidel Castro; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=f48e923b46ad51ce27c3da06827c297b04de0439

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f48e923b46ad51ce27c3da06827c297b04de0439 Mon Sep 17 00:00:00 2001
From: Fidel Castro <fidelcastro.s@hotmail.com>
Date: Thu, 21 Mar 2024 18:35:52 -0400
Subject: [PATCH] test/power: fix typo in error message
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4e335241a44cf8e3a34c0549293ca73d272b6c05 ]

Caught by codespell.

Fixes: 2653bee888b4 ("test/power: check all environment types")

Signed-off-by: Fidel Castro <fidelcastro.s@hotmail.com>
---
 .mailmap              | 1 +
 app/test/test_power.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 1798486ef9..9654531a59 100644
--- a/.mailmap
+++ b/.mailmap
@@ -404,6 +404,7 @@ Fengtian Guo <fengtian.guo@6wind.com>
 Ferdinand Thiessen <rpm@fthiessen.de>
 Ferruh Yigit <ferruh.yigit@amd.com> <ferruh.yigit@intel.com> <ferruh.yigit@xilinx.com> <ferruhy@gmail.com>
 Fidaullah Noonari <fidaullah.noonari@emumba.com>
+Fidel Castro <fidelcastro.s@hotmail.com>
 Fiona Trahe <fiona.trahe@intel.com>
 Flavia Musatescu <flavia.musatescu@intel.com>
 Flavio Leitner <fbl@redhat.com> <fbl@sysclose.org>
diff --git a/app/test/test_power.c b/app/test/test_power.c
index f1e80299d3..403adc22d6 100644
--- a/app/test/test_power.c
+++ b/app/test/test_power.c
@@ -143,7 +143,7 @@ test_power(void)
 		/* Test setting a valid environment */
 		ret = rte_power_set_env(envs[i]);
 		if (ret != 0) {
-			printf("Unexpectedly unsucceeded on setting a valid environment\n");
+			printf("Unexpectedly unsuccessful on setting a valid environment\n");
 			return -1;
 		}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.727263560 +0800
+++ 0121-test-power-fix-typo-in-error-message.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From 4e335241a44cf8e3a34c0549293ca73d272b6c05 Mon Sep 17 00:00:00 2001
+From f48e923b46ad51ce27c3da06827c297b04de0439 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4e335241a44cf8e3a34c0549293ca73d272b6c05 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index ac50264e66..6bb0855236 100644
+index 1798486ef9..9654531a59 100644
@@ -21 +23 @@
-@@ -408,6 +408,7 @@ Fengtian Guo <fengtian.guo@6wind.com>
+@@ -404,6 +404,7 @@ Fengtian Guo <fengtian.guo@6wind.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'test/cfgfile: fix typo in error messages' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (119 preceding siblings ...)
  2024-04-13 12:50   ` patch 'test/power: fix typo in error message' " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  2024-04-13 12:50   ` patch 'examples/ipsec-secgw: fix typo in error message' " Xueming Li
                     ` (2 subsequent siblings)
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Holly Nichols; +Cc: Vinh Tran, Thomas Monjalon, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cf631810bf09ef47221ac6f3981497f20e2621fc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cf631810bf09ef47221ac6f3981497f20e2621fc Mon Sep 17 00:00:00 2001
From: Holly Nichols <hollynichols04@gmail.com>
Date: Thu, 21 Mar 2024 19:05:29 -0400
Subject: [PATCH] test/cfgfile: fix typo in error messages
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fbca1ad85f7725b876d032cb732b3332d247e1f4 ]

Caught by codespell.

Fixes: c54e7234bc9e ("test/cfgfile: add basic unit tests")

Signed-off-by: Holly Nichols <hollynichols04@gmail.com>
Signed-off-by: Vinh Tran <vinh.t.tran10@gmail.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 .mailmap                | 2 ++
 app/test/test_cfgfile.c | 8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/.mailmap b/.mailmap
index 9654531a59..6e34fe6566 100644
--- a/.mailmap
+++ b/.mailmap
@@ -523,6 +523,7 @@ Hiral Shah <hshah@marvell.com>
 Hiroki Shirokura <slank.dev@gmail.com>
 Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
 Hiroyuki Mikita <h.mikita89@gmail.com>
+Holly Nichols <hollynichols04@gmail.com>
 Hongbo Zheng <zhenghongbo3@huawei.com>
 Hongjun Ni <hongjun.ni@intel.com>
 Hongzhi Guo <guohongzhi1@huawei.com>
@@ -1499,6 +1500,7 @@ Vincent Guo <guopengfei160@163.com>
 Vincent Jardin <vincent.jardin@6wind.com>
 Vincent Li <vincent.mc.li@gmail.com>
 Vincent S. Cojot <vcojot@redhat.com>
+Vinh Tran <vinh.t.tran10@gmail.com>
 Vipin Varghese <vipin.varghese@amd.com> <vipin.varghese@intel.com>
 Vipul Ashri <vipul.ashri@oracle.com>
 Visa Hankala <visa@hankala.org>
diff --git a/app/test/test_cfgfile.c b/app/test/test_cfgfile.c
index 2f596affee..a5e3d8699c 100644
--- a/app/test/test_cfgfile.c
+++ b/app/test/test_cfgfile.c
@@ -168,7 +168,7 @@ test_cfgfile_invalid_section_header(void)
 	struct rte_cfgfile *cfgfile;
 
 	cfgfile = rte_cfgfile_load(CFG_FILES_ETC "/invalid_section.ini", 0);
-	TEST_ASSERT_NULL(cfgfile, "Expected failured did not occur");
+	TEST_ASSERT_NULL(cfgfile, "Expected failure did not occur");
 
 	return 0;
 }
@@ -185,7 +185,7 @@ test_cfgfile_invalid_comment(void)
 
 	cfgfile = rte_cfgfile_load_with_params(CFG_FILES_ETC "/sample2.ini", 0,
 					       &params);
-	TEST_ASSERT_NULL(cfgfile, "Expected failured did not occur");
+	TEST_ASSERT_NULL(cfgfile, "Expected failure did not occur");
 
 	return 0;
 }
@@ -196,7 +196,7 @@ test_cfgfile_invalid_key_value_pair(void)
 	struct rte_cfgfile *cfgfile;
 
 	cfgfile = rte_cfgfile_load(CFG_FILES_ETC "/empty_key_value.ini", 0);
-	TEST_ASSERT_NULL(cfgfile, "Expected failured did not occur");
+	TEST_ASSERT_NULL(cfgfile, "Expected failure did not occur");
 
 	return 0;
 }
@@ -236,7 +236,7 @@ test_cfgfile_missing_section(void)
 	struct rte_cfgfile *cfgfile;
 
 	cfgfile = rte_cfgfile_load(CFG_FILES_ETC "/missing_section.ini", 0);
-	TEST_ASSERT_NULL(cfgfile, "Expected failured did not occur");
+	TEST_ASSERT_NULL(cfgfile, "Expected failure did not occur");
 
 	return 0;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.752317327 +0800
+++ 0122-test-cfgfile-fix-typo-in-error-messages.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From fbca1ad85f7725b876d032cb732b3332d247e1f4 Mon Sep 17 00:00:00 2001
+From cf631810bf09ef47221ac6f3981497f20e2621fc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fbca1ad85f7725b876d032cb732b3332d247e1f4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 6bb0855236..f3a25a7402 100644
+index 9654531a59..6e34fe6566 100644
@@ -23 +25 @@
-@@ -528,6 +528,7 @@ Hiral Shah <hshah@marvell.com>
+@@ -523,6 +523,7 @@ Hiral Shah <hshah@marvell.com>
@@ -31 +33 @@
-@@ -1513,6 +1514,7 @@ Vincent Guo <guopengfei160@163.com>
+@@ -1499,6 +1500,7 @@ Vincent Guo <guopengfei160@163.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'examples/ipsec-secgw: fix typo in error message' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (120 preceding siblings ...)
  2024-04-13 12:50   ` patch 'test/cfgfile: fix typo in error messages' " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  2024-04-13 12:50   ` patch 'dts: strip whitespaces from stdout and stderr' " Xueming Li
  2024-04-13 12:50   ` patch 'net/ena/base: fix metrics excessive memory consumption' " Xueming Li
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Masoumeh Farhadi Nia; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=abc68161348cb4242069279f9d068044d9219442

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From abc68161348cb4242069279f9d068044d9219442 Mon Sep 17 00:00:00 2001
From: Masoumeh Farhadi Nia <masoumeh.farhadinia@gmail.com>
Date: Thu, 21 Mar 2024 18:41:35 -0400
Subject: [PATCH] examples/ipsec-secgw: fix typo in error message
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0dc91038201be67714f92a0fd0e0e7ed4f25c6a0 ]

Caught by codespell.

Fixes: 7622291b641d ("examples/ipsec-secgw: allow to specify neighbour MAC address")

Signed-off-by: Masoumeh Farhadi Nia <masoumeh.farhadinia@gmail.com>
---
 .mailmap                      | 1 +
 examples/ipsec-secgw/parser.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 6e34fe6566..f3b429b747 100644
--- a/.mailmap
+++ b/.mailmap
@@ -901,6 +901,7 @@ Martin Weiser <martin.weiser@allegro-packets.com>
 Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@intel.com> <martyna.szapar@intel.com>
 Maryam Tahhan <maryam.tahhan@intel.com>
 Masoud Hasanifard <masoudhasanifard@gmail.com>
+Masoumeh Farhadi Nia <masoumeh.farhadinia@gmail.com>
 Matan Azrad <matan@nvidia.com> <matan@mellanox.com>
 Matej Vido <matejvido@gmail.com> <vido@cesnet.cz>
 Mateusz Kowalski <mateusz.kowalski@intel.com>
diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index 98f8176651..2bd6df335b 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -388,7 +388,7 @@ cfg_parse_neigh(void *parsed_result, __rte_unused struct cmdline *cl,
 	rc = parse_mac(res->mac, &mac);
 	APP_CHECK(rc == 0, st, "invalid ether addr:%s", res->mac);
 	rc = add_dst_ethaddr(res->port, &mac);
-	APP_CHECK(rc == 0, st, "invalid port numer:%hu", res->port);
+	APP_CHECK(rc == 0, st, "invalid port number:%hu", res->port);
 	if (st->status < 0)
 		return;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.783850286 +0800
+++ 0123-examples-ipsec-secgw-fix-typo-in-error-message.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From 0dc91038201be67714f92a0fd0e0e7ed4f25c6a0 Mon Sep 17 00:00:00 2001
+From abc68161348cb4242069279f9d068044d9219442 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0dc91038201be67714f92a0fd0e0e7ed4f25c6a0 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index f3a25a7402..3843868716 100644
+index 6e34fe6566..f3b429b747 100644
@@ -21 +23 @@
-@@ -908,6 +908,7 @@ Martin Weiser <martin.weiser@allegro-packets.com>
+@@ -901,6 +901,7 @@ Martin Weiser <martin.weiser@allegro-packets.com>

^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'dts: strip whitespaces from stdout and stderr' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (121 preceding siblings ...)
  2024-04-13 12:50   ` patch 'examples/ipsec-secgw: fix typo in error message' " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  2024-04-13 12:50   ` patch 'net/ena/base: fix metrics excessive memory consumption' " Xueming Li
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: Jeremy Spewock, Patrick Robb, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a20a3c1129aff09b2058b37d3f463e4879e46b74

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a20a3c1129aff09b2058b37d3f463e4879e46b74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
Date: Tue, 13 Feb 2024 12:14:39 +0100
Subject: [PATCH] dts: strip whitespaces from stdout and stderr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

There could be a newline at the end of stdout or stderr of a remotely
executed command. These cause issues when used later, such as when
joining paths from such commands - a newline in the middle of a path is
not valid.

Fixes: ad80f550dbc5 ("dts: add SSH command verification")
Cc: stable@dpdk.org

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>
Acked-by: Patrick Robb <probb@iol.unh.edu>
---
 .../remote_session/remote/remote_session.py   | 24 +++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/dts/framework/remote_session/remote/remote_session.py b/dts/framework/remote_session/remote/remote_session.py
index 719f7d1ef7..68894a9686 100644
--- a/dts/framework/remote_session/remote/remote_session.py
+++ b/dts/framework/remote_session/remote/remote_session.py
@@ -3,8 +3,8 @@
 # Copyright(c) 2022-2023 PANTHEON.tech s.r.o.
 # Copyright(c) 2022-2023 University of New Hampshire
 
-import dataclasses
 from abc import ABC, abstractmethod
+from dataclasses import InitVar, dataclass, field
 from pathlib import PurePath
 
 from framework.config import NodeConfiguration
@@ -13,7 +13,7 @@ from framework.logger import DTSLOG
 from framework.settings import SETTINGS
 
 
-@dataclasses.dataclass(slots=True, frozen=True)
+@dataclass(slots=True, frozen=True)
 class CommandResult:
     """
     The result of remote execution of a command.
@@ -21,9 +21,25 @@ class CommandResult:
 
     name: str
     command: str
-    stdout: str
-    stderr: str
+    init_stdout: InitVar[str]
+    init_stderr: InitVar[str]
     return_code: int
+    stdout: str = field(init=False)
+    stderr: str = field(init=False)
+
+    def __post_init__(self, init_stdout: str, init_stderr: str) -> None:
+        """Strip the whitespaces from stdout and stderr.
+
+        The generated __init__ method uses object.__setattr__() when the dataclass is frozen,
+        so that's what we use here as well.
+
+        In order to get access to dataclass fields in the __post_init__ method,
+        we have to type them as InitVars. These InitVars are included in the __init__ method's
+        signature, so we have to exclude the actual stdout and stderr fields
+        from the __init__ method's signature, so that we have the proper number of arguments.
+        """
+        object.__setattr__(self, "stdout", init_stdout.strip())
+        object.__setattr__(self, "stderr", init_stderr.strip())
 
     def __str__(self) -> str:
         return (
-- 
2.34.1


^ permalink raw reply	[flat|nested] 263+ messages in thread

* patch 'net/ena/base: fix metrics excessive memory consumption' has been queued to stable release 23.11.1
  2024-04-13 12:48 ` patch " Xueming Li
                     ` (122 preceding siblings ...)
  2024-04-13 12:50   ` patch 'dts: strip whitespaces from stdout and stderr' " Xueming Li
@ 2024-04-13 12:50   ` Xueming Li
  123 siblings, 0 replies; 263+ messages in thread
From: Xueming Li @ 2024-04-13 12:50 UTC (permalink / raw)
  To: Shai Brandes; +Cc: Amit Bernstein, dpdk stable

Hi,

FYI, your patch has been queued to stable release 23.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/15/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=cfa8a4cb909e07cbb34941358f4d912c879dca34

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cfa8a4cb909e07cbb34941358f4d912c879dca34 Mon Sep 17 00:00:00 2001
From: Shai Brandes <shaibran@amazon.com>
Date: Mon, 8 Apr 2024 15:15:25 +0300
Subject: [PATCH] net/ena/base: fix metrics excessive memory consumption
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c8a1898f82f8c04cbe1d3e2d0eec0705386c23f7 ]

The driver accidentally allocates a huge memory
buffer for the customer metrics because it uses
an uninitialized variable for the buffer length.
This can lead to excessive memory footprint for
the driver which can even fail to initialize in
case of insufficient memory.

Bugzilla ID: 1400
Fixes: f73f53f7dc7a ("net/ena: upgrade HAL")
Cc: stable@dpdk.org

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 drivers/net/ena/base/ena_com.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 57ccde9545..2f438597e6 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -3141,16 +3141,18 @@ int ena_com_allocate_debug_area(struct ena_com_dev *ena_dev,
 int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev)
 {
 	struct ena_customer_metrics *customer_metrics = &ena_dev->customer_metrics;
+	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
+	customer_metrics->buffer_virt_addr = NULL;
 
 	ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev,
 			       customer_metrics->buffer_len,
 			       customer_metrics->buffer_virt_addr,
 			       customer_metrics->buffer_dma_addr,
 			       customer_metrics->buffer_dma_handle);
-	if (unlikely(customer_metrics->buffer_virt_addr == NULL))
+	if (unlikely(customer_metrics->buffer_virt_addr == NULL)) {
+		customer_metrics->buffer_len = 0;
 		return ENA_COM_NO_MEM;
-
-	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
+	}
 
 	return 0;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:08.830253026 +0800
+++ 0125-net-ena-base-fix-metrics-excessive-memory-consumptio.patch	2024-04-13 20:43:05.157753723 +0800
@@ -1 +1 @@
-From c8a1898f82f8c04cbe1d3e2d0eec0705386c23f7 Mon Sep 17 00:00:00 2001
+From cfa8a4cb909e07cbb34941358f4d912c879dca34 Mon Sep 17 00:00:00 2001
@@ -3,2 +3,3 @@
-Date: Tue, 12 Mar 2024 20:07:09 +0200
-Subject: [PATCH] net/ena: improve style and readability
+Date: Mon, 8 Apr 2024 15:15:25 +0300
+Subject: [PATCH] net/ena/base: fix metrics excessive memory consumption
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -6,2 +7,12 @@
-This patch makes several changes to improve
-the style and readability of the code.
+[ upstream commit c8a1898f82f8c04cbe1d3e2d0eec0705386c23f7 ]
+
+The driver accidentally allocates a huge memory
+buffer for the customer metrics because it uses
+an uninitialized variable for the buffer length.
+This can lead to excessive memory footprint for
+the driver which can even fail to initialize in
+case of insufficient memory.
+
+Bugzilla ID: 1400
+Fixes: f73f53f7dc7a ("net/ena: upgrade HAL")
+Cc: stable@dpdk.org
@@ -12,3 +23,2 @@
- drivers/net/ena/base/ena_com.c       | 13 +++++--------
- drivers/net/ena/base/ena_plat_dpdk.h |  2 +-
- 2 files changed, 6 insertions(+), 9 deletions(-)
+ drivers/net/ena/base/ena_com.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
@@ -17 +27 @@
-index b98540ba63..2db21e7895 100644
+index 57ccde9545..2f438597e6 100644
@@ -20,28 +30,2 @@
-@@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
- 
- 		/* PHC is in active state, update statistics according to req_id and error_flags */
- 		if ((READ_ONCE16(read_resp->req_id) != phc->req_id) ||
--		    (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) {
-+		    (read_resp->error_flags & ENA_PHC_ERROR_FLAGS))
- 			/* Device didn't update req_id during blocking time or timestamp is invalid,
- 			 * this indicates on a device error
- 			 */
- 			phc->stats.phc_err++;
--		} else {
-+		else
- 			/* Device updated req_id during blocking time with valid timestamp */
- 			phc->stats.phc_exp++;
--		}
- 	}
- 
- 	/* Setting relative timeouts */
-@@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)
- 		timestamp = (u64)aenq_common->timestamp_low |
- 			((u64)aenq_common->timestamp_high << 32);
- 
--		ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n",
-+		ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n",
- 			    aenq_common->group,
- 			    aenq_common->syndrome,
- 			    timestamp);
-@@ -3233,16 +3232,15 @@ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev)
+@@ -3141,16 +3141,18 @@ int ena_com_allocate_debug_area(struct ena_com_dev *ena_dev,
+ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev)
@@ -50 +33,0 @@
- 
@@ -51,0 +35,2 @@
++	customer_metrics->buffer_virt_addr = NULL;
+ 
@@ -58 +43,2 @@
-+	if (unlikely(!customer_metrics->buffer_virt_addr))
++	if (unlikely(customer_metrics->buffer_virt_addr == NULL)) {
++		customer_metrics->buffer_len = 0;
@@ -60,2 +45,0 @@
- 
--	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
@@ -63,2 +47,2 @@
- 	return 0;
- }
+-	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
++	}
@@ -66,6 +50 @@
-@@ -3285,7 +3283,6 @@ void ena_com_delete_customer_metrics_buffer(struct ena_com_dev *ena_dev)
- 				      customer_metrics->buffer_dma_addr,
- 				      customer_metrics->buffer_dma_handle);
- 		customer_metrics->buffer_virt_addr = NULL;
--		customer_metrics->buffer_len = 0;
- 	}
+ 	return 0;
@@ -73,14 +51,0 @@
- 
-diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
-index bb21e1bf01..9e365b0f3b 100644
---- a/drivers/net/ena/base/ena_plat_dpdk.h
-+++ b/drivers/net/ena/base/ena_plat_dpdk.h
-@@ -40,7 +40,7 @@ typedef uint64_t dma_addr_t;
- #define ETIME ETIMEDOUT
- #endif
- 
--#define ENA_PRIU64 PRIu64
-+#define ENA_PRIu64 PRIu64
- #define ena_atomic32_t rte_atomic32_t
- #define ena_mem_handle_t const struct rte_memzone *
- 

^ permalink raw reply	[flat|nested] 263+ messages in thread

end of thread, other threads:[~2024-04-13 13:01 UTC | newest]

Thread overview: 263+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05  9:45 patches have been queued to stable release 23.11.1 Xueming Li
2024-03-05  9:45 ` patch 'buildtools/cmdline: fix generated code for IP addresses' has " Xueming Li
2024-03-05  9:45 ` patch 'buildtools/cmdline: fix IP address initializer' " Xueming Li
2024-03-05  9:45 ` patch 'hash: remove some dead code' " Xueming Li
2024-03-05  9:45 ` patch 'regexdev: fix logtype register' " Xueming Li
2024-03-05  9:45 ` patch 'lib: use dedicated logtypes and macros' " Xueming Li
2024-03-05  9:45 ` patch 'lib: add newline in logs' " Xueming Li
2024-03-05  9:45 ` patch 'lib: remove redundant newline from " Xueming Li
2024-03-05  9:45 ` patch 'dma/dpaa2: fix logtype register' " Xueming Li
2024-03-05  9:45 ` patch 'net/i40e: remove redundant judgment in flow parsing' " Xueming Li
2024-03-05  9:45 ` patch 'net/iavf: fix memory leak on security context error' " Xueming Li
2024-03-05  9:45 ` patch 'net/ixgbe: fix memoy leak after device init failure' " Xueming Li
2024-03-05  9:45 ` patch 'net/ice: fix link update' " Xueming Li
2024-03-05  9:45 ` patch 'net/ice: fix tunnel TSO capabilities' " Xueming Li
2024-03-05  9:45 ` patch 'net/iavf: fix no polling mode switching' " Xueming Li
2024-03-05  9:45 ` patch 'net/iavf: fix crash on VF start' " Xueming Li
2024-03-05  9:45 ` patch 'net/ice: fix memory leaks' " Xueming Li
2024-03-05  9:45 ` patch 'kernel/freebsd: fix module build on FreeBSD 14' " Xueming Li
2024-03-05  9:45 ` patch 'build: fix reasons conflict' " Xueming Li
2024-03-05  9:46 ` patch 'app/graph: fix build reason' " Xueming Li
2024-03-05  9:46 ` patch 'telemetry: fix connected clients count' " Xueming Li
2024-03-05  9:46 ` patch 'telemetry: fix empty JSON dictionaries' " Xueming Li
2024-03-05  9:46 ` patch 'gro: fix reordering of packets' " Xueming Li
2024-03-05  9:46 ` patch 'ci: update versions of actions in GHA' " Xueming Li
2024-03-05  9:46 ` patch 'eal/x86: add AMD vendor check for TSC calibration' " Xueming Li
2024-03-05 11:17   ` Tummala, Sivaprasad
2024-03-05  9:46 ` patch 'doc: remove cmdline polling mode deprecation notice' " Xueming Li
2024-03-05  9:46 ` patch 'eal: verify strdup return' " Xueming Li
2024-03-05  9:46 ` patch 'bus/dpaa: " Xueming Li
2024-03-05  9:46 ` patch 'bus/fslmc: " Xueming Li
2024-03-05  9:46 ` patch 'bus/vdev: " Xueming Li
2024-03-05  9:46 ` patch 'dma/idxd: " Xueming Li
2024-03-05  9:46 ` patch 'event/cnxk: " Xueming Li
2024-03-05  9:46 ` patch 'net/failsafe: fix memory leak in args parsing' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: verify strdup return' " Xueming Li
2024-03-05  9:46 ` patch 'app/dumpcap: " Xueming Li
2024-03-05  9:46 ` patch 'app/pdump: " Xueming Li
2024-03-05  9:46 ` patch 'app/crypto-perf: " Xueming Li
2024-03-05  9:46 ` patch 'app/dma-perf: " Xueming Li
2024-03-05  9:46 ` patch 'app/testpmd: " Xueming Li
2024-03-05  9:46 ` patch 'test: " Xueming Li
2024-03-05  9:46 ` patch 'examples/qos_sched: fix memory leak in args parsing' " Xueming Li
2024-03-05  9:46 ` patch 'examples/vhost: verify strdup return' " Xueming Li
2024-03-05  9:46 ` patch 'pipeline: fix calloc parameters' " Xueming Li
2024-03-05  9:46 ` patch 'eventdev: " Xueming Li
2024-03-05  9:46 ` patch 'dmadev: " Xueming Li
2024-03-05  9:46 ` patch 'rawdev: " Xueming Li
2024-03-05  9:46 ` patch 'common/mlx5: " Xueming Li
2024-03-05  9:46 ` patch 'net/bnx2x: " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: " Xueming Li
2024-03-05  9:46 ` patch 'net/sfc: " Xueming Li
2024-03-05  9:46 ` patch 'build: fix linker warnings about undefined symbols' " Xueming Li
2024-03-05  9:46 ` patch 'build: link static libs with whole-archive in subproject' " Xueming Li
2024-03-05  9:46 ` patch 'rcu: use atomic operation on acked token' " Xueming Li
2024-03-05  9:46 ` patch 'rcu: fix acked token in debug log' " Xueming Li
2024-03-05  9:46 ` patch 'net: fix TCP/UDP checksum with padding data' " Xueming Li
2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in datapath' " Xueming Li
2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in VDUSE setup' " Xueming Li
2024-03-05  9:46 ` patch 'vhost: fix virtqueue access check in vhost-user " Xueming Li
2024-03-05  9:46 ` patch 'net/virtio: remove duplicate queue xstats' " Xueming Li
2024-03-05  9:46 ` patch 'vhost: fix deadlock during vDPA SW live migration' " Xueming Li
2024-03-05  9:46 ` patch 'vdpa/mlx5: fix queue enable drain CQ' " Xueming Li
2024-03-05  9:46 ` patch 'vhost: fix memory leak in Virtio Tx split path' " Xueming Li
2024-03-05  9:46 ` patch 'cryptodev: remove unused extern variable' " Xueming Li
2024-03-05  9:46 ` patch 'examples/ipsec-secgw: fix width of variables' " Xueming Li
2024-03-05  9:46 ` patch 'common/cnxk: fix memory leak in CPT init' " Xueming Li
2024-03-05  9:46 ` patch 'crypto/cnxk: fix CN9K ECDH public key verification' " Xueming Li
2024-03-05  9:46 ` patch 'app/crypto-perf: fix next segment mbuf' " Xueming Li
2024-03-05  9:46 ` patch 'app/crypto-perf: fix data comparison' " Xueming Li
2024-03-05  9:46 ` patch 'app/crypto-perf: fix encrypt operation verification' " Xueming Li
2024-03-05  9:46 ` patch 'event/cnxk: fix dequeue timeout configuration' " Xueming Li
2024-03-05  9:46 ` patch 'test/event: skip test if no driver is present' " Xueming Li
2024-03-05  9:46 ` patch 'doc: fix commands in eventdev test tool guide' " Xueming Li
2024-03-05  9:46 ` patch 'ethdev: fix NVGRE encap flow action description' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for device initialization' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for CoreNIC firmware' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for PF initialization' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for flower firmware' " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of CoreNIC " Xueming Li
2024-03-05  9:46 ` patch 'net/nfp: fix resource leak for exit of flower " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix resource leak for VF' " Xueming Li
2024-03-05  9:47 ` patch 'net/af_xdp: fix memzone leak on config failure' " Xueming Li
2024-03-05  9:47 ` patch 'net/memif: fix crash with Tx burst larger than 255' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: refactor VF mailbox message struct' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: refactor PF " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: refactor send mailbox function' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: refactor handle " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: fix VF multiple count on one reset' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: fix disable command with firmware' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: fix reset level comparison' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix Rx memory leak' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix Rx descriptor' " Xueming Li
2024-03-05  9:47 ` patch 'net/hns3: remove QinQ insert support for VF' " Xueming Li
2024-03-05  9:47 ` patch 'doc: add --latencystats option in testpmd guide' " Xueming Li
2024-03-05  9:47 ` patch 'app/testpmd: hide --bitrate-stats in help if disabled' " Xueming Li
2024-03-05  9:47 ` patch 'net/vmxnet3: fix initialization on FreeBSD' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix device close' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix device resource freeing' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: free switch domain ID on close' " Xueming Li
2024-03-05  9:47 ` patch 'net/mana: prevent values overflow returned from RDMA layer' " Xueming Li
2024-03-05  9:47 ` patch 'drivers/net: fix buffer overflow for packet types list' " Xueming Li
2024-03-05  9:47 ` patch 'app/testpmd: fix crash in multi-process forwarding' " Xueming Li
2024-03-05  9:47 ` patch 'net/ionic: fix missing volatile type for cqe pointers' " Xueming Li
2024-03-05  9:47 ` patch 'net/ionic: fix RSS query' " Xueming Li
2024-03-05  9:47 ` patch 'net/ionic: fix device close' " Xueming Li
2024-03-05  9:47 ` patch 'net/bonding: fix flow count query' " Xueming Li
2024-03-05  9:47 ` patch 'net/mana: fix memory leak on MR allocation' " Xueming Li
2024-03-05  9:47 ` patch 'net/mana: handle MR cache expansion failure' " Xueming Li
2024-03-05  9:47 ` patch 'common/sfc_efx/base: use C11 static assert' " Xueming Li
2024-03-05  9:47 ` patch 'net/memif: fix extra mbuf refcnt update in zero copy Tx' " Xueming Li
2024-03-05  9:47 ` patch 'net/softnic: fix include of log library' " Xueming Li
2024-03-05  9:47 ` patch 'net/gve: fix DQO for chained descriptors' " Xueming Li
2024-03-05  9:47 ` patch 'net: add macros for VLAN metadata parsing' " Xueming Li
2024-03-05  9:47 ` patch 'net/netvsc: fix " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: fix array overflow' " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: fix 50G and 100G forced speed' " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: fix speed change from 200G to 25G on Thor' " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: fix backward firmware compatibility' " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: modify locking for representor Tx' " Xueming Li
2024-03-05  9:47 ` patch 'net/bnxt: fix deadlock in ULP timer callback' " Xueming Li
2024-03-05  9:47 ` patch 'ml/cnxk: fix xstats calculation' " Xueming Li
2024-03-05  9:47 ` patch 'net/cnxk: fix flow RSS configuration' " Xueming Li
2024-03-05  9:47 ` patch 'net/thunderx: fix DMAC control register update' " Xueming Li
2024-03-05  9:47 ` patch 'common/cnxk: fix mbox region copy' " Xueming Li
2024-03-05  9:47 ` patch 'common/cnxk: fix VLAN check for inner header' " Xueming Li
2024-03-05  9:47 ` patch 'net/cnxk: fix aged flow query' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: fix jump action validation' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: fix flow tag modification' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5/hws: fix ESP flow matching validation' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE TLV option management' " Xueming Li
2024-03-05  9:47 ` patch 'common/mlx5: fix duplicate read of general capabilities' " Xueming Li
2024-03-05  9:47 ` patch 'common/mlx5: fix query sample info capability' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: remove GENEVE options length limitation' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: fix GENEVE option item translation' " Xueming Li
2024-03-05  9:47 ` patch 'net/mlx5: fix stats query crash in secondary process' " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix NFD3 metadata " Xueming Li
2024-03-05  9:47 ` patch 'net/nfp: fix NFDk " Xueming Li
2024-03-05  9:47 ` patch 'app/testpmd: fix GRO packets flush on timeout' " Xueming Li
2024-04-13 12:48 ` patch " Xueming Li
2024-04-13 12:48   ` patch 'doc: fix configuration in baseband 5GNR driver guide' " Xueming Li
2024-04-13 12:48   ` patch 'event/dlb2: remove superfluous memcpy' " Xueming Li
2024-04-13 12:48   ` patch 'test/event: fix crash in Tx adapter freeing' " Xueming Li
2024-04-13 12:48   ` patch 'eventdev: improve Doxygen comments on configure struct' " Xueming Li
2024-04-13 12:48   ` patch 'eventdev: fix Doxygen processing of vector " Xueming Li
2024-04-13 12:48   ` patch 'eventdev/crypto: fix enqueueing' " Xueming Li
2024-04-13 12:48   ` patch 'app/crypto-perf: fix copy segment size' " Xueming Li
2024-04-13 12:48   ` patch 'app/crypto-perf: fix out-of-place mbuf " Xueming Li
2024-04-13 12:48   ` patch 'app/crypto-perf: add missing op resubmission' " Xueming Li
2024-04-13 12:48   ` patch 'doc: fix typos in cryptodev overview' " Xueming Li
2024-04-13 12:48   ` patch 'common/qat: fix legacy flag' " Xueming Li
2024-04-13 12:48   ` patch 'vhost: fix VDUSE device destruction failure' " Xueming Li
2024-04-13 12:48   ` patch 'net/af_xdp: fix leak on XSK configuration " Xueming Li
2024-04-13 12:48   ` patch 'app/testpmd: fix flow modify tag typo' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix modify flex item' " Xueming Li
2024-04-13 12:48   ` patch 'app/testpmd: return if no packets in GRO heavy weight mode' " Xueming Li
2024-04-13 12:48   ` patch 'app/testpmd: fix async flow create failure handling' " Xueming Li
2024-04-13 12:48   ` patch 'net/tap: do not overwrite flow API errors' " Xueming Li
2024-04-13 12:48   ` patch 'net/tap: fix traffic control handle calculation' " Xueming Li
2024-04-13 12:48   ` patch 'net/bnxt: fix null pointer dereference' " Xueming Li
2024-04-13 12:48   ` patch 'net/ixgbevf: fix RSS init for x550 NICs' " Xueming Li
2024-04-13 12:48   ` patch 'net/iavf: remove error logs for VLAN offloading' " Xueming Li
2024-04-13 12:48   ` patch 'net/ixgbe: increase VF reset timeout' " Xueming Li
2024-04-13 12:48   ` patch 'net/i40e: remove incorrect 16B descriptor read block' " Xueming Li
2024-04-13 12:48   ` patch 'net/iavf: " Xueming Li
2024-04-13 12:48   ` patch 'net/ice: " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix inline device pointer check' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: fix Rx packet format check condition' " Xueming Li
2024-04-13 12:48   ` patch 'net/bnx2x: fix warnings about memcpy lengths' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: remove CN9K inline IPsec FP opcodes' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: fix buffer size configuration' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix Tx MTU " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: fix MTU limit' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix RSS RETA configuration' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: fix indirect mbuf handling in Tx' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: add cookies check for multi-segment offload' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix mbox struct attributes' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: fix mbuf fields in multi-segment Tx' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix link config for SDP' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: remove dead code' " Xueming Li
2024-04-13 12:48   ` patch 'common/cnxk: fix possible out-of-bounds access' " Xueming Li
2024-04-13 12:48   ` patch 'net/cnxk: improve Tx performance for SW mbuf free' " Xueming Li
2024-04-13 12:48   ` patch 'doc: fix aging poll frequency option in cnxk guide' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5/hws: skip item when inserting rules by index' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5/hws: check not supported fields in VXLAN' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN item in non-relaxed mode' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix use after free when releasing Tx queues' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix error packets drop in regular Rx' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: prevent querying aged flows on uninit port' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5/hws: fix VLAN inner type' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix condition of LACP miss flow' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix conntrack action handle representation' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix connection tracking action validation' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix HWS registers initialization' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5/hws: enable multiple integrity items' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix VLAN handling in meter split' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix parameters verification in HWS table create' " Xueming Li
2024-04-13 12:48   ` patch 'net/mlx5: fix flow counter cache starvation' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix counters map in bonding mode' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix flow action template expansion' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: remove device status check in flow creation' " Xueming Li
2024-04-13 12:49   ` patch 'test: fix probing in secondary process' " Xueming Li
2024-04-13 12:49   ` patch 'bus/vdev: fix devargs " Xueming Li
2024-04-13 12:49   ` patch 'config: fix CPU instruction set for cross-build' " Xueming Li
2024-04-13 12:49   ` patch 'test/mbuf: fix external mbuf case with assert enabled' " Xueming Li
2024-04-13 12:49   ` patch 'test: assume C source files are UTF-8 encoded' " Xueming Li
2024-04-13 12:49   ` patch 'test: do not count skipped tests as executed' " Xueming Li
2024-04-13 12:49   ` patch 'examples/packet_ordering: fix Rx with reorder mode disabled' " Xueming Li
2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx over not ready port' " Xueming Li
2024-04-13 12:49   ` patch 'dts: fix smoke tests driver regex' " Xueming Li
2024-04-13 12:49   ` patch 'examples/l3fwd: fix Rx queue configuration' " Xueming Li
2024-04-13 12:49   ` patch 'net/virtio: fix vDPA device init advertising control queue' " Xueming Li
2024-04-13 12:49   ` patch 'build: pass cflags in subproject' " Xueming Li
2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix cryptodev to SA mapping' " Xueming Li
2024-04-13 12:49   ` patch 'crypto/qat: fix crash with CCM null AAD pointer' " Xueming Li
2024-04-13 12:49   ` patch 'net/hns3: enable PFC for all user priorities' " Xueming Li
2024-04-13 12:49   ` patch 'doc: add traffic manager in features table' " Xueming Li
2024-04-13 12:49   ` patch 'app/testpmd: fix async indirect action list creation' " Xueming Li
2024-04-13 12:49   ` patch 'doc: add link speeds configuration in features table' " Xueming Li
2024-04-13 12:49   ` patch 'net/nfp: fix getting firmware VNIC version' " Xueming Li
2024-04-13 12:49   ` patch 'net/nfp: fix IPsec data endianness' " Xueming Li
2024-04-13 12:49   ` patch 'net/ena: fix fast mbuf free' " Xueming Li
2024-04-13 12:49   ` patch 'net/ena/base: limit exponential backoff' " Xueming Li
2024-04-13 12:49   ` patch 'net/ena/base: restructure interrupt handling' " Xueming Li
2024-04-13 12:49   ` patch 'net/nfp: fix switch domain free check' " Xueming Li
2024-04-13 12:49   ` patch 'net/nfp: fix initialization failure flow' " Xueming Li
2024-04-13 12:49   ` patch 'app/testpmd: fix --stats-period option check' " Xueming Li
2024-04-13 12:49   ` patch 'app/testpmd: fix burst option parsing' " Xueming Li
2024-04-13 12:49   ` patch 'app/testpmd: fix error message for invalid option' " Xueming Li
2024-04-13 12:49   ` patch 'net/hns3: support new device' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix HWS meter actions availability' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix sync meter processing in HWS' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix indirect action async job initialization' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix non-masked indirect list meter translation' " Xueming Li
2024-04-13 12:49   ` patch 'doc: update link to Windows DevX in mlx5 guide' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix VLAN ID in flow modify' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix meter policy priority' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: remove duplication of L3 flow item validation' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix IP-in-IP tunnels recognition' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix DR context release ordering' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5/hws: fix direct index insert on depend WQE' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix template clean up of FDB control flow rule' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix flow configure validation' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: prevent ioctl failure log flooding' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix age position in hairpin split' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix drop action release timing' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix warning about copy length' " Xueming Li
2024-04-13 12:49   ` patch 'net/bnxt: fix number of Tx queues being created' " Xueming Li
2024-04-13 12:49   ` patch 'examples/ipsec-secgw: fix Rx queue ID in Rx callback' " Xueming Li
2024-04-13 12:49   ` patch 'doc: fix default IP fragments maximum in programmer guide' " Xueming Li
2024-04-13 12:49   ` patch 'net/nfp: fix uninitialized variable' " Xueming Li
2024-04-13 12:49   ` patch 'app/testpmd: fix auto-completion for indirect action list' " Xueming Li
2024-04-13 12:49   ` patch 'net/ena: fix mbuf double free in fast free mode' " Xueming Li
2024-04-13 12:49   ` patch 'net/vmxnet3: ignore Rx queue interrupt setup on FreeBSD' " Xueming Li
2024-04-13 12:49   ` patch 'net/igc: fix timesync disable' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5/hws: fix memory access in L3 decapsulation' " Xueming Li
2024-04-13 12:49   ` patch 'net/mlx5: fix sync flow meter action' " Xueming Li
2024-04-13 12:49   ` patch 'doc: fix typo in profiling guide' " Xueming Li
2024-04-13 12:50   ` patch 'doc: fix typo in packet framework " Xueming Li
2024-04-13 12:50   ` patch 'test/power: fix typo in error message' " Xueming Li
2024-04-13 12:50   ` patch 'test/cfgfile: fix typo in error messages' " Xueming Li
2024-04-13 12:50   ` patch 'examples/ipsec-secgw: fix typo in error message' " Xueming Li
2024-04-13 12:50   ` patch 'dts: strip whitespaces from stdout and stderr' " Xueming Li
2024-04-13 12:50   ` patch 'net/ena/base: fix metrics excessive memory consumption' " Xueming Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).