patches for DPDK stable branches
 help / color / mirror / Atom feed
* patch has been queued to stable release 22.11.2
@ 2023-02-27  6:21 Xueming Li
  2023-02-27  6:21 ` patch 'drivers: fix symbol exports when map is omitted' " Xueming Li
                   ` (3 more replies)
  0 siblings, 4 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:21 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/23. So please
shout if anyone has objections.

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

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dc7302e733911234b7b0d5e147e3812ba7a2a92f Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@nvidia.com>
Date: Mon, 27 Feb 2023 14:08:40 +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 ***

Ajit Khaparde (1):
  doc: fix firmware list in bnxt guide

Alex Vesker (2):
  common/mlx5: fix offset of a field
  net/mlx5/hws: fix memory leak on general pool DB init

Alexander Kozyrev (3):
  net/mlx5: fix error CQE dumping for vectorized Rx
  net/mlx5: ignore non-critical syndromes for Rx queue
  net/mlx5: check compressed CQE opcode in vectorized Rx

Alvaro Karsz (1):
  bus/fslmc: fix deadlock on MC send command timeout

Andy Pei (2):
  vdpa/ifc: fix argument compatibility check
  vdpa/ifc: fix reconnection in SW-assisted live migration

Anoob Joseph (4):
  app/crypto-perf: fix number of segments
  app/crypto-perf: fix session freeing
  app/crypto-perf: fix SPI zero
  app/crypto-perf: fix IPsec direction

Ashish Sadanandan (1):
  eal/linux: fix hugetlbfs sub-directories discovery

Ben Magistro (1):
  app/dumpcap: fix storing port identifier

Bruce Richardson (6):
  dma/ioat: fix device stop if no copies done
  dma/ioat: fix indexes after restart
  dma/ioat: fix error reporting on restart
  build: fix toolchain definition
  examples/cmdline: fix build with GCC 12
  examples/qos_sched: fix Tx port config when link down

Chaoyong He (3):
  net/nfp: store counter reset before zeroing flow query
  net/nfp: fix teardown of flows sharing a mask ID
  net/nfp: fix VNI of VXLAN encap action

Chengwen Feng (5):
  mem: fix hugepage info mapping
  raw/ifpga/base: fix init with multi-process
  telemetry: fix repeat display when callback don't init dict
  net/hns3: declare flow rule keeping capability
  eal/freebsd: fix lock in alarm callback

Ciara Power (2):
  crypto/qat: fix stream cipher direction
  crypto/ipsec_mb: fix ZUC-256 maximum tag length

Dariusz Sosnowski (1):
  net/mlx5: fix available tag registers calculation for HWS

David Marchand (14):
  drivers: fix symbol exports when map is omitted
  devtools: fix name check with mbox files
  hash: fix GFNI implementation build with GCC 12
  crypto/qat: fix build for generic x86 with GCC 12
  fbarray: fix metadata dump
  gpudev: fix deadlocks when registering callback
  graph: fix node shrink
  net/ena: fix deadlock in RSS RETA update
  crypto/ccp: remove some printf
  crypto/ccp: remove some dead code for UIO
  crypto/ccp: fix IOVA handling
  net/cnxk: fix deadlock in security session creation
  net/iavf: protect insertion in flow list
  app/testpmd: fix crash on cleanup

Edwin Brossette (1):
  net/bnxt: fix link state change interrupt config

Erik Gabriel Carrillo (1):
  eventdev/timer: fix overflow

Fan Zhang (1):
  cryptodev: fix sym session mempool creation description

Fengnan Chang (1):
  eal: cleanup alarm and hotplug before memory detach

Ferruh Yigit (3):
  kni: fix build on RHEL 9.1
  app/testpmd: fix forwarding stats for Tx dropped
  app/testpmd: fix link check condition on port start

Ganapati Kundapura (4):
  eventdev/crypto: fix enqueue count
  eventdev/crypto: fix offset used while flushing events
  eventdev/crypto: fix overflow in circular buffer
  eventdev/crypto: fix failed events

Gowrishankar Muthukrishnan (1):
  crypto/cnxk: fix digest for empty input data

Gregory Etelson (1):
  app/testpmd: fix interactive mode with no ports

Hernan Vargas (4):
  baseband/acc: fix memory leak on acc100 close
  baseband/acc: fix acc100 iteration counter in TB
  baseband/acc: fix multiplexing acc100 operations
  baseband/acc: fix acc100 queue mapping to 64 bits

Honnappa Nagarahalli (1):
  eal: use same atomic intrinsics for GCC and clang

Huisong Li (22):
  net/hns3: fix inaccurate RTC time to read
  telemetry: move include after guard
  ethdev: fix telemetry data truncation
  mempool: fix telemetry data truncation
  cryptodev: fix telemetry data truncation
  mem: fix telemetry data truncation
  net/hns3: fix log about indirection table size
  net/hns3: extract common function to query device
  net/hns3: refactor set RSS hash algorithm and key interface
  net/hns3: fix RSS key size compatibility
  net/hns3: fix clearing RSS configuration
  net/hns3: use RSS filter list to check duplicated rule
  net/hns3: remove useless code when destroy valid RSS rule
  net/hns3: fix warning on flush or destroy rule
  net/hns3: fix config struct used for conversion
  net/hns3: fix duplicate RSS rule check
  net/hns3: fix burst mode query with dummy function
  net/hns3: add debug info for Rx/Tx dummy function
  net/hns3: remove debug condition for Tx prepare
  net/hns3: separate Tx prepare from getting Tx function
  net/hns3: make getting Tx function static
  net/hns3: extract common functions to set Rx/Tx

Ivan Malov (3):
  net/sfc: export pick transfer proxy callback to representors
  net/sfc: fix MAC address entry leak in transfer flow parsing
  net/sfc: enforce fate action in transfer flow rules

Jiawei Wang (1):
  net/mlx5: fix flow sample with ConnectX-5

Jiawen Wu (6):
  net/txgbe: fix default signal quality value for KX/KX4
  net/txgbe: fix packet type to parse from offload flags
  net/ngbe: fix packet type to parse from offload flags
  net/ngbe: add spinlock protection on YT PHY
  net/txgbe: fix interrupt loss
  net/txgbe: fix Rx buffer size in config register

Jie Hai (1):
  test/mbuf: fix mbuf reset test

Jin Liu (1):
  net/nfp: restrict flow flush to the port

Jingjing Wu (2):
  net/idpf: fix mbuf leak in split Tx
  net/idpf: fix driver infos

Kaiwen Deng (1):
  net/ixgbe: enable IPv6 mask in flow rules

Kalesh AP (1):
  net/bnxt: fix Tx queue stats after queue stop and start

Kiran Kumar K (1):
  common/cnxk: fix IPv6 extension matching

Kommula Shiva Shankar (1):
  common/cnxk: fix aura ID handling

Long Wu (1):
  net/nfp: fix Tx packet drop for large data length

Maxime Coquelin (4):
  vhost: decrease log level for unimplemented requests
  vhost: fix possible FD leaks
  vhost: fix possible FD leaks on truncation
  net/virtio-user: fix device starting failure handling

Megha Ajmera (2):
  examples/qos_sched: fix debug mode
  sched: fix alignment of structs in subport

Michael Baum (3):
  compressdev: fix end of driver list
  app/compress-perf: fix some typos
  app/compress-perf: fix testing single operation

Michal Schmidt (1):
  net/iavf: fix VLAN offload with AVX2

Mike Baucom (1):
  net/bnxt: fix Rx queue stats after queue stop and start

Mike Pattrick (1):
  net/iavf: add lock for VF commands

Naga Harish K S V (1):
  eventdev/eth_tx: fix devices loop

Nicolas Chautru (3):
  app/bbdev: fix build with optional flag
  app/bbdev: fix build with optional flag
  app/bbdev: add allocation checks

Nithin Dabilpuram (1):
  net/cnxk: fix packet type for IPv6 packets post decryption

Pablo de Lara (1):
  crypto/qat: fix build

Pavan Nikhilesh (2):
  event/cnxk: fix burst timer arm
  event/cnxk: fix timer operations in secondary process

Peng Zhang (1):
  net/nfp: fix firmware name derived from PCI name

Qiming Yang (1):
  net/i40e: reduce interrupt interval in multi-driver mode

Rahul Bhansali (1):
  event/cnxk: wait for CPT flow control on WQE path

Richard Donkin (1):
  net/nfp: fix max DMA length

Ruifeng Wang (1):
  crypto/openssl: fix warning on copy length

Satheesh Paul (2):
  common/cnxk: fix dual VLAN parsing
  common/cnxk: fix channel mask for SDP interfaces

Shijith Thotton (2):
  examples/l2fwd-event: fix worker cleanup
  eventdev/eth_rx: fix getting adapter instance

Shiyang He (1):
  net/ixgbe: fix firmware version consistency

Stephen Hemminger (1):
  crypto/ipsec_mb: remove unnecessary null check

Steve Yang (2):
  net/i40e: fix validation of flow transfer attribute
  net/ice: fix validation of flow transfer attribute

Suanming Mou (2):
  net/mlx5: fix GENEVE resource overwrite
  common/mlx5: improve AES-XTS tweak capability check

Sunil Kumar Kori (2):
  common/cnxk: reduce channel count per LMAC
  net/cnxk: validate RED threshold config

Thomas Monjalon (4):
  doc: fix dependency setup in l2fwd-cat example guide
  devtools: fix escaped space in grep pattern
  build: fix dependencies lookup
  doc: fix description of L2TPV2 flow item

Tyler Retzlaff (1):
  eal/windows: mark memory config as complete

Venkat Duvvuru (1):
  net/bnxt: fix RSS hash in mbuf

Viacheslav Ovsiienko (3):
  net/mlx5: fix wait descriptor opcode for ConnectX-7
  net/mlx5: fix warning for Tx scheduling option
  net/mlx5: fix read device clock in real time mode

Vikash Poddar (1):
  test/crypto: fix typo in AES test

Volodymyr Fialko (5):
  test/crypto: add missing MAC-I to PDCP vectors
  eventdev/crypto: fix function symbol export
  drivers/bus: fix leak for devices without driver
  reorder: invalidate buffer from ready queue in drain
  test/reorder: fix double free of drained buffers

Wenwu Ma (1):
  vhost: fix net header settings in datapath

Zhichao Zeng (2):
  net/iavf: fix outer UDP checksum offload
  net/iavf: fix building data desc

 .github/workflows/build.yml                   |   3 +-
 .mailmap                                      |   6 +
 .travis.yml                                   |   3 +-
 app/dumpcap/main.c                            |   1 +
 app/test-bbdev/test_bbdev_perf.c              |  92 +++-
 app/test-compress-perf/comp_perf_options.h    |   6 +-
 .../comp_perf_options_parse.c                 |   8 +-
 .../comp_perf_test_common.c                   | 126 ++++--
 .../comp_perf_test_cyclecount.c               |  71 +--
 .../comp_perf_test_throughput.c               |  64 +--
 .../comp_perf_test_verify.c                   |  64 ++-
 app/test-compress-perf/main.c                 |   8 +
 app/test-crypto-perf/cperf_ops.c              |  37 +-
 app/test-crypto-perf/cperf_options.h          |   1 +
 app/test-crypto-perf/cperf_options_parsing.c  |  15 +
 app/test-crypto-perf/cperf_test_common.c      |   8 +-
 app/test-crypto-perf/cperf_test_latency.c     |  27 +-
 app/test-crypto-perf/cperf_test_verify.c      |  25 +-
 app/test-pmd/testpmd.c                        |  46 +-
 app/test/test_cryptodev_aes_test_vectors.h    |  16 +-
 ...est_cryptodev_security_pdcp_test_vectors.h |   8 +-
 app/test/test_mbuf.c                          |   1 +
 app/test/test_reorder.c                       |   2 +
 config/meson.build                            |   6 +-
 devtools/check-git-log.sh                     |   2 +-
 devtools/checkpatches.sh                      |   2 +-
 doc/guides/nics/bnxt.rst                      |   1 +
 doc/guides/prog_guide/cryptodev_lib.rst       |  42 +-
 .../prog_guide/img/cryptodev_sym_sess.svg     | 417 ------------------
 doc/guides/prog_guide/rte_flow.rst            |  13 +-
 doc/guides/sample_app_ug/l2_forward_cat.rst   |   9 +-
 drivers/baseband/acc/rte_acc100_pmd.c         |  17 +-
 drivers/baseband/turbo_sw/meson.build         |  10 +-
 drivers/bus/fslmc/mc/mc_sys.c                 |   5 +-
 drivers/bus/pci/pci_common.c                  |   3 +-
 drivers/bus/vdev/vdev.c                       |   5 +-
 drivers/common/cnxk/roc_mbox.h                |   2 +-
 drivers/common/cnxk/roc_nix_inl_dev.c         |   2 +-
 drivers/common/cnxk/roc_npc.c                 |   9 +-
 drivers/common/cnxk/roc_npc_mcam.c            |  19 +-
 drivers/common/cnxk/roc_npc_parse.c           | 240 +++++++---
 drivers/common/cnxk/roc_npc_priv.h            |  19 +-
 drivers/common/cnxk/roc_npc_utils.c           |   2 +-
 drivers/common/mlx5/mlx5_common.h             |   1 +
 drivers/common/mlx5/mlx5_devx_cmds.c          |   4 +-
 drivers/common/mlx5/mlx5_prm.h                |  16 +-
 drivers/common/mlx5/version.map               |   1 +
 drivers/compress/mlx5/mlx5_compress.c         |   4 +-
 drivers/compress/qat/dev/qat_comp_pmd_gen1.c  |   2 +-
 drivers/compress/qat/dev/qat_comp_pmd_gen4.c  |   2 +-
 drivers/crypto/ccp/ccp_crypto.c               | 105 +----
 drivers/crypto/ccp/ccp_dev.c                  |  16 +-
 drivers/crypto/ccp/ccp_pci.c                  |  33 --
 drivers/crypto/ccp/ccp_pci.h                  |   3 -
 drivers/crypto/ccp/rte_ccp_pmd.c              |   5 +-
 drivers/crypto/cnxk/cnxk_se.h                 |  46 +-
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c        |   5 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c        |   2 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h   |   2 +-
 drivers/crypto/openssl/rte_openssl_pmd.c      |   2 +-
 drivers/crypto/qat/qat_sym_session.c          |   8 +-
 drivers/dma/ioat/ioat_dmadev.c                |  31 +-
 drivers/event/cnxk/cn9k_worker.h              |   1 +
 drivers/event/cnxk/cnxk_tim_evdev.c           |   7 +
 drivers/event/cnxk/cnxk_tim_worker.h          |  81 ++--
 drivers/net/bnxt/bnxt_ethdev.c                |   2 +-
 drivers/net/bnxt/bnxt_rxq.c                   |   6 +
 drivers/net/bnxt/bnxt_rxr.c                   |   1 -
 drivers/net/bnxt/bnxt_txr.c                   |   6 +
 drivers/net/cnxk/cn9k_ethdev_sec.c            |   1 +
 drivers/net/cnxk/cn9k_rx.h                    |  17 +-
 drivers/net/cnxk/cn9k_tx.h                    |  10 +
 drivers/net/cnxk/cnxk_ethdev_cman.c           |   5 +
 drivers/net/ena/ena_rss.c                     |   1 +
 drivers/net/hns3/hns3_common.c                |  94 +++-
 drivers/net/hns3/hns3_common.h                |   2 +
 drivers/net/hns3/hns3_ethdev.c                |  83 +---
 drivers/net/hns3/hns3_ethdev_vf.c             |  84 +---
 drivers/net/hns3/hns3_flow.c                  | 224 +++++-----
 drivers/net/hns3/hns3_mp.c                    |   4 +-
 drivers/net/hns3/hns3_ptp.c                   |  12 +-
 drivers/net/hns3/hns3_rss.c                   |  63 ++-
 drivers/net/hns3/hns3_rss.h                   |   7 +-
 drivers/net/hns3/hns3_rxtx.c                  | 108 +++--
 drivers/net/hns3/hns3_rxtx.h                  |   5 +-
 drivers/net/i40e/i40e_ethdev.h                |   2 +-
 drivers/net/i40e/i40e_flow.c                  |   8 +
 drivers/net/iavf/iavf.h                       |   1 +
 drivers/net/iavf/iavf_generic_flow.c          |   3 +-
 drivers/net/iavf/iavf_rxtx.c                  |  22 +-
 drivers/net/iavf/iavf_rxtx_vec_avx2.c         |   5 +-
 drivers/net/iavf/iavf_vchnl.c                 | 106 +++--
 drivers/net/ice/ice_generic_flow.c            |   8 +
 drivers/net/idpf/idpf_ethdev.c                |   6 +-
 drivers/net/idpf/idpf_rxtx.c                  |  29 +-
 drivers/net/ixgbe/ixgbe_ethdev.c              |  31 +-
 drivers/net/ixgbe/ixgbe_flow.c                |   4 +
 drivers/net/mlx5/hws/mlx5dr_pool.c            |   7 -
 drivers/net/mlx5/linux/mlx5_ethdev_os.c       |  68 +++
 drivers/net/mlx5/mlx5.c                       |   9 +-
 drivers/net/mlx5/mlx5.h                       |   4 +
 drivers/net/mlx5/mlx5_flow.c                  |   5 +-
 drivers/net/mlx5/mlx5_flow_dv.c               |   7 +-
 drivers/net/mlx5/mlx5_flow_hw.c               |  46 +-
 drivers/net/mlx5/mlx5_rx.c                    | 133 ++++--
 drivers/net/mlx5/mlx5_rx.h                    |   4 +-
 drivers/net/mlx5/mlx5_rxtx_vec.c              |  13 +-
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h      |  16 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h         |  10 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h          |   9 +-
 drivers/net/mlx5/mlx5_tx.h                    |   2 +-
 drivers/net/mlx5/mlx5_txpp.c                  |  15 +-
 drivers/net/mlx5/windows/mlx5_ethdev_os.c     |  30 ++
 drivers/net/nfp/nfp_ethdev.c                  |   2 +-
 drivers/net/nfp/nfp_flow.c                    |  33 +-
 drivers/net/nfp/nfp_flow.h                    |   1 +
 drivers/net/nfp/nfp_rxtx.c                    |  24 +-
 drivers/net/ngbe/base/ngbe_phy_yt.c           |  36 ++
 drivers/net/ngbe/base/ngbe_type.h             |   1 +
 drivers/net/ngbe/ngbe_rxtx.c                  |  92 +---
 drivers/net/sfc/sfc_mae.c                     |  18 +
 drivers/net/sfc/sfc_repr.c                    |  26 ++
 drivers/net/txgbe/base/txgbe_phy.c            |   7 +-
 drivers/net/txgbe/txgbe_ethdev.c              |   5 +-
 drivers/net/txgbe/txgbe_rxtx.c                |  26 +-
 drivers/net/virtio/virtio_user_ethdev.c       |  11 +-
 drivers/raw/ifpga/base/opae_hw_api.c          |   4 +-
 drivers/regex/cn9k/meson.build                |   4 +-
 drivers/vdpa/ifc/ifcvf_vdpa.c                 |   7 +
 examples/cmdline/parse_obj_list.h             |   3 +-
 examples/l2fwd-event/l2fwd_event.c            |   4 +-
 examples/qos_sched/init.c                     |  12 +
 kernel/linux/kni/compat.h                     |   4 +-
 lib/compressdev/rte_compressdev.h             |   2 +-
 lib/cryptodev/rte_cryptodev.c                 |   2 +-
 lib/cryptodev/rte_cryptodev.h                 |  17 +-
 lib/eal/common/eal_common_fbarray.c           |   3 +-
 lib/eal/common/eal_common_memory.c            |  10 +-
 lib/eal/freebsd/eal.c                         |   2 +-
 lib/eal/freebsd/eal_alarm.c                   |   6 +-
 lib/eal/freebsd/eal_hugepage_info.c           |   2 +-
 lib/eal/include/generic/rte_atomic.h          |  12 -
 lib/eal/linux/eal.c                           |   4 +-
 lib/eal/linux/eal_hugepage_info.c             |  17 +-
 lib/eal/windows/eal.c                         |   3 +
 lib/ethdev/rte_ethdev.c                       |  12 +-
 lib/eventdev/rte_event_crypto_adapter.c       |  25 +-
 lib/eventdev/rte_event_crypto_adapter.h       |   4 +
 lib/eventdev/rte_event_eth_rx_adapter.c       |  12 +-
 lib/eventdev/rte_event_eth_tx_adapter.c       |   2 +-
 lib/eventdev/rte_event_timer_adapter.c        |  97 ++--
 lib/eventdev/version.map                      |   1 +
 lib/gpudev/gpudev.c                           |   5 +-
 lib/graph/node.c                              |   8 +-
 lib/hash/rte_thash_x86_gfni.h                 |   6 +-
 lib/mempool/rte_mempool.c                     |  24 +-
 lib/reorder/rte_reorder.c                     |   1 +
 lib/sched/rte_sched.c                         |   6 +-
 lib/telemetry/rte_telemetry.h                 |   5 +-
 lib/telemetry/telemetry.c                     |   2 +-
 lib/vhost/socket.c                            |   8 +-
 lib/vhost/vhost_user.c                        |  44 +-
 lib/vhost/virtio_net.c                        |   6 +
 163 files changed, 2084 insertions(+), 1762 deletions(-)
 delete mode 100644 doc/guides/prog_guide/img/cryptodev_sym_sess.svg

--
2.25.1

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

* patch 'drivers: fix symbol exports when map is omitted' has been queued to stable release 22.11.2
  2023-02-27  6:21 patch has been queued to stable release 22.11.2 Xueming Li
@ 2023-02-27  6:21 ` Xueming Li
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:21 UTC (permalink / raw)
  To: David Marchand
  Cc: Luca Boccassi, Ferruh Yigit, Bruce Richardson, Aaron Conole, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/07e68b092cbc347b4ec420e4e74e07e8cfb19064

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 07e68b092cbc347b4ec420e4e74e07e8cfb19064 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 29 Nov 2022 11:00:57 +0100
Subject: [PATCH] drivers: fix symbol exports when map is omitted
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc ]

ld exports any global symbol by default if no version script is passed.
As a consequence, the incriminated change let any public symbol leak
out of the driver shared libraries.

Hide again those symbols by providing a default map file which
unexports any global symbol using a local: * catch-all statement.

The checks are skipped for this default map file as it is intentionnally
an empty map (see commit b67bdda86cd4 ("devtools: catch empty symbol
maps")) and there is nothing else to check in this map.

This change impacts the exported symbols, hence, bump the version in the
ABI check to the v22.11.1 from the 22.11 LTS branch.

Fixes: 7dde9c844a37 ("drivers: omit symbol map when unneeded")

Reported-by: Luca Boccassi <luca.boccassi@microsoft.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
---
 .github/workflows/build.yml | 3 ++-
 .travis.yml                 | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 82d83f4030..04a975c787 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,7 +25,8 @@ jobs:
       MINGW: ${{ matrix.config.cross == 'mingw' }}
       MINI: ${{ matrix.config.mini != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
-      REF_GIT_TAG: none
+      REF_GIT_REPO: https://dpdk.org/git/dpdk-stable
+      REF_GIT_TAG: v22.11.1
       RISCV64: ${{ matrix.config.cross == 'riscv64' }}
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
 
diff --git a/.travis.yml b/.travis.yml
index 4bb5bf629e..0ea1242d97 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,7 +42,8 @@ script: ./.ci/${TRAVIS_OS_NAME}-build.sh
 env:
   global:
     - LIBABIGAIL_VERSION=libabigail-1.8
-    - REF_GIT_TAG=none
+    - REF_GIT_REPO=https://dpdk.org/git/dpdk-stable
+    - REF_GIT_TAG=v22.11.1
 
 jobs:
   include:
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.038294200 +0800
+++ 0001-drivers-fix-symbol-exports-when-map-is-omitted.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc Mon Sep 17 00:00:00 2001
+From 07e68b092cbc347b4ec420e4e74e07e8cfb19064 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bfc43a0f681c9069a6e1ef9d18027b0fcfc24afc ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -29,7 +31,3 @@
- .github/workflows/build.yml   |  3 +-
- .travis.yml                   |  3 +-
- devtools/check-symbol-maps.sh |  2 +-
- drivers/meson.build           | 68 +++++++++++++++++++----------------
- drivers/version.map           |  3 ++
- 5 files changed, 45 insertions(+), 34 deletions(-)
- create mode 100644 drivers/version.map
+ .github/workflows/build.yml | 3 ++-
+ .travis.yml                 | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
@@ -38 +36 @@
-index 9527ad1f8c..6bad94098e 100644
+index 82d83f4030..04a975c787 100644
@@ -45 +43 @@
--      REF_GIT_TAG: v22.11
+-      REF_GIT_TAG: none
@@ -52 +50 @@
-index b99444620f..0936788dc7 100644
+index 4bb5bf629e..0ea1242d97 100644
@@ -58,2 +56,2 @@
-     - LIBABIGAIL_VERSION=libabigail-2.1
--    - REF_GIT_TAG=v22.11
+     - LIBABIGAIL_VERSION=libabigail-1.8
+-    - REF_GIT_TAG=none
@@ -65,104 +62,0 @@
-diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh
-index 0a6062de26..8c116bfa9c 100755
---- a/devtools/check-symbol-maps.sh
-+++ b/devtools/check-symbol-maps.sh
-@@ -8,7 +8,7 @@ cd $(dirname $0)/..
- export LC_ALL=C
- 
- if [ $# = 0 ] ; then
--    set -- $(find lib drivers -name '*.map')
-+    set -- $(find lib drivers -name '*.map' -a ! -path drivers/version.map)
- fi
- 
- ret=0
-diff --git a/drivers/meson.build b/drivers/meson.build
-index c4ff3ff1ba..5188302057 100644
---- a/drivers/meson.build
-+++ b/drivers/meson.build
-@@ -210,40 +210,46 @@ foreach subpath:subdirs
- 
-         lk_deps = []
-         lk_args = []
--        if fs.is_file(version_map)
--            def_file = custom_target(lib_name + '_def',
--                    command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
--                    input: version_map,
--                    output: '@0@_exports.def'.format(lib_name))
--
--            mingw_map = custom_target(lib_name + '_mingw',
--                    command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
--                    input: version_map,
--                    output: '@0@_mingw.map'.format(lib_name))
--
--            lk_deps = [version_map, def_file, mingw_map]
--            if is_windows
--                if is_ms_linker
--                    lk_args = ['-Wl,/def:' + def_file.full_path()]
--                    if meson.version().version_compare('<0.54.0')
--                        lk_args += ['-Wl,/implib:drivers\\' + implib]
--                    endif
--                else
--                    lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
-+        if not fs.is_file(version_map)
-+            version_map = '@0@/version.map'.format(meson.current_source_dir())
-+            lk_deps += [version_map]
-+        else
-+            lk_deps += [version_map]
-+            if not is_windows and developer_mode
-+                # on unix systems check the output of the
-+                # check-symbols.sh script, using it as a
-+                # dependency of the .so build
-+                lk_deps += custom_target(lib_name + '.sym_chk',
-+                        command: [check_symbols, version_map, '@INPUT@'],
-+                        capture: true,
-+                        input: static_lib,
-+                        output: lib_name + '.sym_chk')
-+            endif
-+        endif
-+
-+        def_file = custom_target(lib_name + '_def',
-+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
-+                input: version_map,
-+                output: '@0@_exports.def'.format(lib_name))
-+
-+        mingw_map = custom_target(lib_name + '_mingw',
-+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],
-+                input: version_map,
-+                output: '@0@_mingw.map'.format(lib_name))
-+
-+        lk_deps += [def_file, mingw_map]
-+
-+        if is_windows
-+            if is_ms_linker
-+                lk_args = ['-Wl,/def:' + def_file.full_path()]
-+                if meson.version().version_compare('<0.54.0')
-+                    lk_args += ['-Wl,/implib:drivers\\' + implib]
-                 endif
-             else
--                lk_args = ['-Wl,--version-script=' + version_map]
--                if developer_mode
--                    # on unix systems check the output of the
--                    # check-symbols.sh script, using it as a
--                    # dependency of the .so build
--                    lk_deps += custom_target(lib_name + '.sym_chk',
--                            command: [check_symbols, version_map, '@INPUT@'],
--                            capture: true,
--                            input: static_lib,
--                            output: lib_name + '.sym_chk')
--                endif
-+                lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]
-             endif
-+        else
-+            lk_args = ['-Wl,--version-script=' + version_map]
-         endif
- 
-         shared_lib = shared_library(lib_name, sources,
-diff --git a/drivers/version.map b/drivers/version.map
-new file mode 100644
-index 0000000000..78c3585d7c
---- /dev/null
-+++ b/drivers/version.map
-@@ -0,0 +1,3 @@
-+DPDK_23 {
-+	local: *;
-+};

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

* patch 'devtools: fix name check with mbox files' has been queued to stable release 22.11.2
  2023-02-27  6:21 patch has been queued to stable release 22.11.2 Xueming Li
  2023-02-27  6:21 ` patch 'drivers: fix symbol exports when map is omitted' " Xueming Li
@ 2023-02-27  6:58 ` Xueming Li
  2023-02-27  6:58   ` patch 'eal/windows: mark memory config as complete' " Xueming Li
                     ` (157 more replies)
  2023-04-09 15:23 ` patch " Xueming Li
  2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
  3 siblings, 158 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c12e76d298ef4edb6e9d0d0314d4005305d50a5f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 29 Nov 2022 14:59:00 +0100
Subject: [PATCH] devtools: fix name check with mbox files
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9656c6dc83eba1ad26c5e5946eb90d8edddcc312 ]

When passing a patch downloaded as mbox, the mail headers were being
scanned which resulted in mailing list and other unrelated mail
addresses being checked against the contributors list.

Filter them by focusing on the mail body (separated from the headers
with the first empty line).

Fixes: e83d41f0694d ("mailmap: add list of contributors")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index be1cb03ea7..1dee094c7a 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -254,7 +254,7 @@ check_names() { # <patch>
 	old_IFS=$IFS
 	IFS='
 '
-	for contributor in $(sed -rn '1,/^--- / {s/.*: (.*<.*@.*>)/\1/p}' $1); do
+	for contributor in $(sed -rn '/^$/,/^--- / {s/.*: (.*<.*@.*>)/\1/p}' $1); do
 		! grep -qE "^$contributor($| <)" .mailmap || continue
 		name=${contributor%% <*}
 		if grep -q "^$name <" .mailmap; then
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.067427300 +0800
+++ 0002-devtools-fix-name-check-with-mbox-files.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 9656c6dc83eba1ad26c5e5946eb90d8edddcc312 Mon Sep 17 00:00:00 2001
+From c12e76d298ef4edb6e9d0d0314d4005305d50a5f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9656c6dc83eba1ad26c5e5946eb90d8edddcc312 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'eal/windows: mark memory config as complete' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'kni: fix build on RHEL 9.1' " Xueming Li
                     ` (156 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: Stephen Hemminger, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fc98f9c6d73e9fb81c46720b656af059172f8fa8 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Fri, 16 Dec 2022 09:16:39 -0800
Subject: [PATCH] eal/windows: mark memory config as complete
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 40032e5e0787fb311cc89c45bd681740b0c9e266 ]

Memory configuration was not being marked as completed.
Add the missing call to rte_eal_init() for Windows.

This allows rte_thread_register to work on Windows and lcores_autotest
to be built and run Windows which also exercises the
rte_ctrl_thread_create API on Windows.

Fixes: 5c307ba2a5b1 ("eal: register non-EAL threads as lcores")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/windows/eal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
index adb929a014..56fadc7afe 100644
--- a/lib/eal/windows/eal.c
+++ b/lib/eal/windows/eal.c
@@ -462,6 +462,9 @@ rte_eal_init(int argc, char **argv)
 	 */
 	rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
 	rte_eal_mp_wait_lcore();
+
+	eal_mcfg_complete();
+
 	return fctret;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.104870400 +0800
+++ 0003-eal-windows-mark-memory-config-as-complete.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 40032e5e0787fb311cc89c45bd681740b0c9e266 Mon Sep 17 00:00:00 2001
+From fc98f9c6d73e9fb81c46720b656af059172f8fa8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 40032e5e0787fb311cc89c45bd681740b0c9e266 ]

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

* patch 'kni: fix build on RHEL 9.1' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
  2023-02-27  6:58   ` patch 'eal/windows: mark memory config as complete' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'hash: fix GFNI implementation build with GCC 12' " Xueming Li
                     ` (155 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Daxue Gao, David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c8af2a4ad56645e30130088661380338e06b3462 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Fri, 6 Jan 2023 20:13:14 +0000
Subject: [PATCH] kni: fix build on RHEL 9.1
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8b07816b396f2075f44b4ffa65ecbd0d5a624661 ]

Linux kernel in the RHEL9.1 seems backported Linux commit 2655926aea9b
("net: Remove netif_rx_any_context() and netif_rx_ni().") that drops
netif_rx_ni().

This was fixed in DPDK for vanilla kernel with the commit
c98600d4bed6 ("kni: fix build with Linux 5.18").

Add RHEL9.1 check for the netif_rx_ni() usage to fix build error.

Bugzilla ID: 1076

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 kernel/linux/kni/compat.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 3a86d12bbc..7aa6cd9fca 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -146,6 +146,8 @@
 #define HAVE_ETH_HW_ADDR_SET
 #endif

-#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
+#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE && \
+	(!(defined(RHEL_RELEASE_CODE) && \
+	 RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE))
 #define HAVE_NETIF_RX_NI
 #endif
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.138294800 +0800
+++ 0004-kni-fix-build-on-RHEL-9.1.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 8b07816b396f2075f44b4ffa65ecbd0d5a624661 Mon Sep 17 00:00:00 2001
+From c8af2a4ad56645e30130088661380338e06b3462 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8b07816b396f2075f44b4ffa65ecbd0d5a624661 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

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

* patch 'hash: fix GFNI implementation build with GCC 12' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
  2023-02-27  6:58   ` patch 'eal/windows: mark memory config as complete' " Xueming Li
  2023-02-27  6:58   ` patch 'kni: fix build on RHEL 9.1' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'doc: fix dependency setup in l2fwd-cat example guide' " Xueming Li
                     ` (154 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 760cf7543c59ce255a2f6a914ecd539654b52518 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 9 Jan 2023 11:03:37 +0100
Subject: [PATCH] hash: fix GFNI implementation build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fe2c18a0a8b22703dec3add385a371ad819d7872 ]

On a system that has AVX512F and GFNI, compiling fails with:

In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:71,
                 from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32,
                 from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_vect.h:31,
                 from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_memcpy.h:17,
                 from ../../../git/pub/dpdk.org/main/lib/mempool/rte_mempool.h:48,
                 from ../../../git/pub/dpdk.org/main/lib/mbuf/rte_mbuf.h:38,
                 from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:33,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:25,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:7:
In function ‘_mm512_mask_permutexvar_epi8’,
    inlined from ‘__rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
    inlined from ‘rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
    inlined from ‘rte_thash_adjust_tuple’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
	error: ‘tuple_bytes’ may be used uninitialized [-Werror=maybe-uninitialized]
   97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |                                                      (__v64qi) __A,
      |                                                      ~~~~~~~~~~~~~~
   99 |                                                      (__v64qi) __W,
      |                                                      ~~~~~~~~~~~~~~
  100 |                                                      (__mmask64) __M);
      |                                                      ~~~~~~~~~~~~~~~~

And:

In file included from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_gfni.h:17,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:27:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
	In function ‘rte_thash_adjust_tuple’:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:91:33:
	note: ‘tuple_bytes’ was declared here
   91 |         __m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
      |                                 ^~~~~~~~~~~
In function ‘_mm512_mask_permutexvar_epi8’,
    inlined from ‘__rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
    inlined from ‘rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
    inlined from ‘rte_thash_adjust_tuple’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
	error: ‘permute_mask’ may be used uninitialized [-Werror=maybe-uninitialized]
   97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |                                                      (__v64qi) __A,
      |                                                      ~~~~~~~~~~~~~~
   99 |                                                      (__v64qi) __W,
      |                                                      ~~~~~~~~~~~~~~
  100 |                                                      (__mmask64) __M);
      |                                                      ~~~~~~~~~~~~~~~~
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
	In function ‘rte_thash_adjust_tuple’:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:92:30:
	note: ‘permute_mask’ was declared here
   92 |         __mmask64 load_mask, permute_mask, permute_mask_2;
      |                              ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Set those variables to 0.

Fixes: 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/hash/rte_thash_x86_gfni.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/hash/rte_thash_x86_gfni.h b/lib/hash/rte_thash_x86_gfni.h
index 880739b710..7bb76ac1bb 100644
--- a/lib/hash/rte_thash_x86_gfni.h
+++ b/lib/hash/rte_thash_x86_gfni.h
@@ -88,8 +88,10 @@ __rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple,
 	const __m512i shift_8 = _mm512_set1_epi8(8);
 	__m512i xor_acc = _mm512_setzero_si512();
 	__m512i perm_bytes = _mm512_setzero_si512();
-	__m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
-	__mmask64 load_mask, permute_mask, permute_mask_2;
+	__m512i vals, matrixes, tuple_bytes_2;
+	__m512i tuple_bytes = _mm512_setzero_si512();
+	__mmask64 load_mask, permute_mask_2;
+	__mmask64 permute_mask = 0;
 	int chunk_len = 0, i = 0;
 	uint8_t mtrx_msk;
 	const int prepend = 3;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.168700100 +0800
+++ 0005-hash-fix-GFNI-implementation-build-with-GCC-12.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From fe2c18a0a8b22703dec3add385a371ad819d7872 Mon Sep 17 00:00:00 2001
+From 760cf7543c59ce255a2f6a914ecd539654b52518 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fe2c18a0a8b22703dec3add385a371ad819d7872 ]
@@ -76 +78,0 @@
-Cc: stable@dpdk.org

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

* patch 'doc: fix dependency setup in l2fwd-cat example guide' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (2 preceding siblings ...)
  2023-02-27  6:58   ` patch 'hash: fix GFNI implementation build with GCC 12' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'devtools: fix escaped space in grep pattern' " Xueming Li
                     ` (153 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b6d9ddee2cc375c344be6a190b8db4ece8834d0a Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Fri, 30 Dec 2022 21:52:15 +0100
Subject: [PATCH] doc: fix dependency setup in l2fwd-cat example guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8c8bb7f04dfcb50140a508f883e1129e0bb185ba ]

The environment variable PQOS_INSTALL_PATH is not used anymore,
but the documentation was not updated.

Fixes: fda34680eb9a ("examples: remove legacy sections of makefiles")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/sample_app_ug/l2_forward_cat.rst | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/doc/guides/sample_app_ug/l2_forward_cat.rst b/doc/guides/sample_app_ug/l2_forward_cat.rst
index 3ada3575ba..51621b692f 100644
--- a/doc/guides/sample_app_ug/l2_forward_cat.rst
+++ b/doc/guides/sample_app_ug/l2_forward_cat.rst
@@ -50,13 +50,12 @@ Compiling the Application
     * https://github.com/01org/intel-cmt-cat


-#. To compile the application export the path to PQoS lib
-   and the DPDK source tree and go to the example directory:
+To compile the application, export the path to PQoS lib:

-   .. code-block:: console
-
-       export PQOS_INSTALL_PATH=/path/to/libpqos
+.. code-block:: console

+   export CFLAGS=-I/path/to/intel-cmt-cat/include
+   export LDFLAGS=-L/path/to/intel-cmt-cat/lib

 To compile the sample application see :doc:`compiling`.

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.197635700 +0800
+++ 0006-doc-fix-dependency-setup-in-l2fwd-cat-example-guide.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 8c8bb7f04dfcb50140a508f883e1129e0bb185ba Mon Sep 17 00:00:00 2001
+From b6d9ddee2cc375c344be6a190b8db4ece8834d0a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8c8bb7f04dfcb50140a508f883e1129e0bb185ba ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'devtools: fix escaped space in grep pattern' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (3 preceding siblings ...)
  2023-02-27  6:58   ` patch 'doc: fix dependency setup in l2fwd-cat example guide' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'crypto/cnxk: fix digest for empty input data' " Xueming Li
                     ` (152 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a996e9816f988d3109b38588a6f1197bbf13214b Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tue, 10 Jan 2023 22:23:27 +0100
Subject: [PATCH] devtools: fix escaped space in grep pattern
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7f6b150cb79dad10b82fe004e5b2310e39507381 ]

Since grep 3.8, a warning is printed if a space is escaped in a pattern:
	grep: warning: stray \ before white space

There was an occurence of such extra backslash in check-git-log.sh.

Fixes: d448efa259e9 ("devtools: export dictionary for commit title check")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 01d8aa0717..e26205814b 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -120,7 +120,7 @@ words="$selfdir/words-case.txt"
 for word in $(cat $words); do
 	bad=$(echo "$headlines" | grep -iw $word | grep -vw $word)
 	if [ "$word" = "Tx" ]; then
-		bad=$(echo $bad | grep -v 'OCTEON\ TX')
+		bad=$(echo $bad | grep -v 'OCTEON TX')
 	fi
 	for bad_line in $bad; do
 		bad_word=$(echo $bad_line | cut -d":" -f2 | grep -iwo $word)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.226826600 +0800
+++ 0007-devtools-fix-escaped-space-in-grep-pattern.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 7f6b150cb79dad10b82fe004e5b2310e39507381 Mon Sep 17 00:00:00 2001
+From a996e9816f988d3109b38588a6f1197bbf13214b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7f6b150cb79dad10b82fe004e5b2310e39507381 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/cnxk: fix digest for empty input data' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (4 preceding siblings ...)
  2023-02-27  6:58   ` patch 'devtools: fix escaped space in grep pattern' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix number of segments' " Xueming Li
                     ` (151 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Anoob Joseph, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 193ff405b3aa595ca72cfeafdb267be8bcbcbdff Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 20 Dec 2022 20:02:23 +0530
Subject: [PATCH] crypto/cnxk: fix digest for empty input data
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2aa77c160f9f6485c95850986e6359355e462de1 ]

For an empty input data, digest value is incorrectly generated from
previous auth op, in case executed. This is due to incorrect gather
component used.

Fixes: 7c19abdd0cf1 ("common/cnxk: support 103XX CPT")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/crypto/cnxk/cnxk_se.h | 46 ++++++++++++++---------------------
 1 file changed, 18 insertions(+), 28 deletions(-)

diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index b07fc22858..32e2b2cd64 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -244,7 +244,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
 	uint32_t extra_len = extra_buf ? extra_buf->size : 0;
 	uint32_t size = *psize;

-	for (j = 0; (j < from->buf_cnt) && size; j++) {
+	for (j = 0; j < from->buf_cnt; j++) {
 		struct roc_se_sglist_comp *to = &list[i >> 2];
 		uint32_t buf_sz = from->bufs[j].size;
 		void *vaddr = from->bufs[j].vaddr;
@@ -311,6 +311,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
 		if (extra_offset)
 			extra_offset -= size;
 		i++;
+
+		if (unlikely(!size))
+			break;
 	}

 	*psize = size;
@@ -367,7 +370,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
 	uint32_t extra_len = extra_buf ? extra_buf->size : 0;
 	uint32_t size = *psize;

-	for (j = 0; (j < from->buf_cnt) && size; j++) {
+	rte_prefetch2(psize);
+
+	for (j = 0; j < from->buf_cnt; j++) {
 		struct roc_se_sg2list_comp *to = &list[i / 3];
 		uint32_t buf_sz = from->bufs[j].size;
 		void *vaddr = from->bufs[j].vaddr;
@@ -433,6 +438,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
 		if (extra_offset)
 			extra_offset -= size;
 		i++;
+
+		if (unlikely(!size))
+			break;
 	}

 	*psize = size;
@@ -884,20 +892,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa

 	/* input data */
 	size = data_len;
-	if (size) {
-		i = fill_sg_comp_from_iov(gather_comp, i, params->src_iov, 0,
-					  &size, NULL, 0);
-		if (unlikely(size)) {
-			plt_dp_err("Insufficient dst IOV size, short by %dB",
-				   size);
-			return -1;
-		}
-	} else {
-		/*
-		 * Looks like we need to support zero data
-		 * gather ptr in case of hash & hmac
-		 */
-		i++;
+	i = fill_sg_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0);
+	if (unlikely(size)) {
+		plt_dp_err("Insufficient dst IOV size, short by %dB", size);
+		return -1;
 	}
 	((uint16_t *)in_buffer)[2] = rte_cpu_to_be_16(i);
 	g_size_bytes = ((i + 3) / 4) * sizeof(struct roc_se_sglist_comp);
@@ -1008,18 +1006,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa

 	/* input data */
 	size = data_len;
-	if (size) {
-		i = fill_sg2_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0);
-		if (unlikely(size)) {
-			plt_dp_err("Insufficient dst IOV size, short by %dB", size);
-			return -1;
-		}
-	} else {
-		/*
-		 * Looks like we need to support zero data
-		 * gather ptr in case of hash & hmac
-		 */
-		i++;
+	i = fill_sg2_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0);
+	if (unlikely(size)) {
+		plt_dp_err("Insufficient dst IOV size, short by %dB", size);
+		return -1;
 	}
 	cpt_inst_w5.s.gather_sz = ((i + 2) / 3);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.255257500 +0800
+++ 0008-crypto-cnxk-fix-digest-for-empty-input-data.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 2aa77c160f9f6485c95850986e6359355e462de1 Mon Sep 17 00:00:00 2001
+From 193ff405b3aa595ca72cfeafdb267be8bcbcbdff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2aa77c160f9f6485c95850986e6359355e462de1 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index ce4c2bb585..2944d3c287 100644
+index b07fc22858..32e2b2cd64 100644
@@ -23 +25 @@
-@@ -247,7 +247,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
+@@ -244,7 +244,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
@@ -32 +34 @@
-@@ -314,6 +314,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
+@@ -311,6 +311,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i,
@@ -42 +44 @@
-@@ -370,7 +373,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
+@@ -367,7 +370,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
@@ -53 +55 @@
-@@ -436,6 +441,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
+@@ -433,6 +438,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_
@@ -63 +65 @@
-@@ -887,20 +895,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa
+@@ -884,20 +892,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa
@@ -88 +90 @@
-@@ -1011,18 +1009,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa
+@@ -1008,18 +1006,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa

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

* patch 'app/crypto-perf: fix number of segments' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (5 preceding siblings ...)
  2023-02-27  6:58   ` patch 'crypto/cnxk: fix digest for empty input data' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix session freeing' " Xueming Li
                     ` (150 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a932cd545f38484c3cbb3e222c9f4dfd1e1f3b24 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Tue, 20 Dec 2022 10:25:33 +0530
Subject: [PATCH] app/crypto-perf: fix number of segments
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e03ecc56edd72acb077e2b9bb95ae34f54172a0c ]

When segment size is provided, the total number of segments would be
calculated. Segment size updates due to headroom/tailroom need to be
accounted for when determining total number of segments required.

Fixes: c1670ae0022b ("app/crypto-perf: honour min headroom/tailroom")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_common.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c
index 27646cd619..932aab16df 100644
--- a/app/test-crypto-perf/cperf_test_common.c
+++ b/app/test-crypto-perf/cperf_test_common.c
@@ -197,9 +197,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,
 				RTE_CACHE_LINE_ROUNDUP(crypto_op_total_size);
 	uint32_t mbuf_size = sizeof(struct rte_mbuf) + options->segment_sz;
 	uint32_t max_size = options->max_buffer_size + options->digest_sz;
-	uint16_t segments_nb = (max_size % options->segment_sz) ?
-			(max_size / options->segment_sz) + 1 :
-			max_size / options->segment_sz;
+	uint32_t segment_data_len = options->segment_sz - options->headroom_sz -
+				    options->tailroom_sz;
+	uint16_t segments_nb = (max_size % segment_data_len) ?
+				(max_size / segment_data_len) + 1 :
+				(max_size / segment_data_len);
 	uint32_t obj_size = crypto_op_total_size_padded +
 				(mbuf_size * segments_nb);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.290388200 +0800
+++ 0009-app-crypto-perf-fix-number-of-segments.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From e03ecc56edd72acb077e2b9bb95ae34f54172a0c Mon Sep 17 00:00:00 2001
+From a932cd545f38484c3cbb3e222c9f4dfd1e1f3b24 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e03ecc56edd72acb077e2b9bb95ae34f54172a0c ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/crypto-perf: fix session freeing' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (6 preceding siblings ...)
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix number of segments' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix SPI zero' " Xueming Li
                     ` (149 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Mon, 2 Jan 2023 17:16:53 +0530
Subject: [PATCH] app/crypto-perf: fix session freeing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ]

Use the right API for session freeing. Sessions can be asymmetric,
symmetric or security.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")
Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_test_latency.c | 27 +++++++++++++++++------
 app/test-crypto-perf/cperf_test_verify.c  | 25 ++++++++++++++++-----
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index 49bf421c01..406e082e4e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -43,15 +43,28 @@ struct priv_op_data {
 static void
 cperf_latency_test_free(struct cperf_latency_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess)
-			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
-
-		rte_mempool_free(ctx->pool);
+	if (ctx == NULL)
+		return;

-		rte_free(ctx->res);
-		rte_free(ctx);
+	if (ctx->sess != NULL) {
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess);
+#ifdef RTE_LIB_SECURITY
+		else if (ctx->options->op_type == CPERF_PDCP ||
+			 ctx->options->op_type == CPERF_DOCSIS ||
+			 ctx->options->op_type == CPERF_IPSEC) {
+			struct rte_security_ctx *sec_ctx =
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx, ctx->sess);
+		}
+#endif
+		else
+			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
 	}
+
+	rte_mempool_free(ctx->pool);
+	rte_free(ctx->res);
+	rte_free(ctx);
 }

 void *
diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index c03e1d5ba5..8042c94e04 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -38,14 +38,27 @@ struct cperf_op_result {
 static void
 cperf_verify_test_free(struct cperf_verify_ctx *ctx)
 {
-	if (ctx) {
-		if (ctx->sess)
-			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
-
-		rte_mempool_free(ctx->pool);
+	if (ctx == NULL)
+		return;

-		rte_free(ctx);
+	if (ctx->sess != NULL) {
+		if (ctx->options->op_type == CPERF_ASYM_MODEX)
+			rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess);
+#ifdef RTE_LIB_SECURITY
+		else if (ctx->options->op_type == CPERF_PDCP ||
+			 ctx->options->op_type == CPERF_DOCSIS ||
+			 ctx->options->op_type == CPERF_IPSEC) {
+			struct rte_security_ctx *sec_ctx =
+				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			rte_security_session_destroy(sec_ctx, ctx->sess);
+		}
+#endif
+		else
+			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
 	}
+
+	rte_mempool_free(ctx->pool);
+	rte_free(ctx);
 }

 void *
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.320968600 +0800
+++ 0010-app-crypto-perf-fix-session-freeing.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From c5b531d6ee03e552301aa6295531ae2312a16c6e Mon Sep 17 00:00:00 2001
+From bbba565c73c986a16612ac45389951fc570fe9cb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c5b531d6ee03e552301aa6295531ae2312a16c6e ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/crypto-perf: fix SPI zero' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (7 preceding siblings ...)
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix session freeing' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix IPsec direction' " Xueming Li
                     ` (148 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 683ce01b194846b68571bfcca8f482922bc0b764 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Mon, 2 Jan 2023 17:16:54 +0530
Subject: [PATCH] app/crypto-perf: fix SPI zero
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2218e0780f22519a5be2ef97c80c37798c797857 ]

As per IPsec specification (RFC 4303) SPI zero is reserved. Using
lcore_id directly would mean SPI 0 would also be attempted. This may
lead to failure on an otherwise compliant implementation.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 61a3967697..4a1c9feb1c 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -722,7 +722,7 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 		.action_type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
 		.protocol = RTE_SECURITY_PROTOCOL_IPSEC,
 		{.ipsec = {
-			.spi = rte_lcore_id(),
+			.spi = rte_lcore_id() + 1,
 			/**< For testing sake, lcore_id is taken as SPI so that
 			 * for every core a different session is created.
 			 */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.348656700 +0800
+++ 0011-app-crypto-perf-fix-SPI-zero.patch	2023-02-27 14:08:40.719237000 +0800
@@ -1 +1 @@
-From 2218e0780f22519a5be2ef97c80c37798c797857 Mon Sep 17 00:00:00 2001
+From 683ce01b194846b68571bfcca8f482922bc0b764 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2218e0780f22519a5be2ef97c80c37798c797857 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/crypto-perf: fix IPsec direction' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (8 preceding siblings ...)
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix SPI zero' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix enqueue count' " Xueming Li
                     ` (147 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b81247d47bcf7493b1b7354f2ccf4997d99e783b Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj@marvell.com>
Date: Mon, 2 Jan 2023 17:16:55 +0530
Subject: [PATCH] app/crypto-perf: fix IPsec direction
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 212304008255fa3aa9d380d912488e4552ea7c68 ]

The default value of options->auth_op & options->cipher_op are such that
an unconditional check for the same would always return true. Hence, the
direction is always determined to be outbound/egress.

The field options->aead_algo should be checked prior to checking above
fields. Since the same check would be required in datapath, introduce a
new flag in options for the same.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_ops.c             | 35 +++++++++++---------
 app/test-crypto-perf/cperf_options.h         |  1 +
 app/test-crypto-perf/cperf_options_parsing.c | 15 +++++++++
 3 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 4a1c9feb1c..93b9bfb240 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -42,8 +42,7 @@ test_ipsec_vec_populate(struct rte_mbuf *m, const struct cperf_options *options,
 {
 	struct rte_ipv4_hdr *ip = rte_pktmbuf_mtod(m, struct rte_ipv4_hdr *);

-	if ((options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ||
-		(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)) {
+	if (options->is_outbound) {
 		memcpy(ip, test_vector->plaintext.data,
 		       sizeof(struct rte_ipv4_hdr));

@@ -645,8 +644,9 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 		const struct cperf_test_vector *test_vector,
 		uint16_t iv_offset)
 {
-	struct rte_crypto_sym_xform xform = {0};
 	struct rte_crypto_sym_xform auth_xform = {0};
+	struct rte_crypto_sym_xform *crypto_xform;
+	struct rte_crypto_sym_xform xform = {0};

 	if (options->aead_algo != 0) {
 		/* Setup AEAD Parameters */
@@ -660,10 +660,10 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 		xform.aead.iv.length = test_vector->aead_iv.length;
 		xform.aead.digest_length = options->digest_sz;
 		xform.aead.aad_length = options->aead_aad_sz;
+		crypto_xform = &xform;
 	} else if (options->cipher_algo != 0 && options->auth_algo != 0) {
 		/* Setup Cipher Parameters */
 		xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-		xform.next = NULL;
 		xform.cipher.algo = options->cipher_algo;
 		xform.cipher.op = options->cipher_op;
 		xform.cipher.iv.offset = iv_offset;
@@ -680,7 +680,6 @@ create_ipsec_session(struct rte_mempool *sess_mp,

 		/* Setup Auth Parameters */
 		auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-		auth_xform.next = NULL;
 		auth_xform.auth.algo = options->auth_algo;
 		auth_xform.auth.op = options->auth_op;
 		auth_xform.auth.iv.offset = iv_offset +
@@ -699,7 +698,15 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 			auth_xform.auth.iv.length = 0;
 		}

-		xform.next = &auth_xform;
+		if (options->is_outbound) {
+			crypto_xform = &xform;
+			xform.next = &auth_xform;
+			auth_xform.next = NULL;
+		} else {
+			crypto_xform = &auth_xform;
+			auth_xform.next = &xform;
+			xform.next = NULL;
+		}
 	} else {
 		return NULL;
 	}
@@ -729,23 +736,19 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 			.salt = CPERF_IPSEC_SALT,
 			.options = { 0 },
 			.replay_win_sz = 0,
-			.direction =
-				((options->cipher_op ==
-					RTE_CRYPTO_CIPHER_OP_ENCRYPT) &&
-				(options->auth_op ==
-					RTE_CRYPTO_AUTH_OP_GENERATE)) ||
-				(options->aead_op ==
-					RTE_CRYPTO_AEAD_OP_ENCRYPT) ?
-				RTE_SECURITY_IPSEC_SA_DIR_EGRESS :
-				RTE_SECURITY_IPSEC_SA_DIR_INGRESS,
 			.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
 			.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
 			.tunnel = tunnel,
 		} },
 		.userdata = NULL,
-		.crypto_xform = &xform
+		.crypto_xform = crypto_xform,
 	};

+	if (options->is_outbound)
+		sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS;
+	else
+		sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS;
+
 	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
 				rte_cryptodev_get_sec_ctx(dev_id);

diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h
index 613d6d31e2..6966e0b286 100644
--- a/app/test-crypto-perf/cperf_options.h
+++ b/app/test-crypto-perf/cperf_options.h
@@ -105,6 +105,7 @@ struct cperf_options {
 	uint32_t out_of_place:1;
 	uint32_t silent:1;
 	uint32_t csv:1;
+	uint32_t is_outbound:1;

 	enum rte_crypto_cipher_algorithm cipher_algo;
 	enum rte_crypto_cipher_operation cipher_op;
diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index bc5e312c81..cb91bcc3c5 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -1318,6 +1318,21 @@ cperf_options_check(struct cperf_options *options)
 		if (check_docsis_buffer_length(options) < 0)
 			return -EINVAL;
 	}
+
+	if (options->op_type == CPERF_IPSEC) {
+		if (options->aead_algo) {
+			if (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT)
+				options->is_outbound = 1;
+			else
+				options->is_outbound = 0;
+		} else {
+			if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT &&
+			    options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE)
+				options->is_outbound = 1;
+			else
+				options->is_outbound = 0;
+		}
+	}
 #endif

 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.379350300 +0800
+++ 0012-app-crypto-perf-fix-IPsec-direction.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From 212304008255fa3aa9d380d912488e4552ea7c68 Mon Sep 17 00:00:00 2001
+From b81247d47bcf7493b1b7354f2ccf4997d99e783b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 212304008255fa3aa9d380d912488e4552ea7c68 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'eventdev/crypto: fix enqueue count' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (9 preceding siblings ...)
  2023-02-27  6:58   ` patch 'app/crypto-perf: fix IPsec direction' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix offset used while flushing events' " Xueming Li
                     ` (146 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d66216823d92894880591cfd53142f733724e73c Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Wed, 7 Dec 2022 00:49:42 -0600
Subject: [PATCH] eventdev/crypto: fix enqueue count
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 04dac736432fe304196818d696540e4d016bad93 ]

crypto_enq_count is updated on failure to enqueue ops to cryptodev.
Updated crypto_enq_count on successful enqueue of ops to cryptodev.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 3c585d7b0d..b10595fbbb 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -497,6 +497,9 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 								cdev_id,
 								qp_id,
 								&nb_enqueued);
+			stats->crypto_enq_count += nb_enqueued;
+			n += nb_enqueued;
+
 			/**
 			 * If some crypto ops failed to flush to cdev and
 			 * space for another batch is not available, stop
@@ -507,9 +510,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 							&qp_info->cbuf)))
 				adapter->stop_enq_to_cryptodev = true;
 		}
-
-		stats->crypto_enq_count += nb_enqueued;
-		n += nb_enqueued;
 	}

 	return n;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.407027300 +0800
+++ 0013-eventdev-crypto-fix-enqueue-count.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From 04dac736432fe304196818d696540e4d016bad93 Mon Sep 17 00:00:00 2001
+From d66216823d92894880591cfd53142f733724e73c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 04dac736432fe304196818d696540e4d016bad93 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 134470bf05..eaff5778a6 100644
+index 3c585d7b0d..b10595fbbb 100644
@@ -22 +24 @@
-@@ -485,6 +485,9 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
+@@ -497,6 +497,9 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
@@ -32 +34 @@
-@@ -495,9 +498,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
+@@ -507,9 +510,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,

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

* patch 'eventdev/crypto: fix offset used while flushing events' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (10 preceding siblings ...)
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix enqueue count' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix overflow in circular buffer' " Xueming Li
                     ` (145 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e1ca28205f1b781a12ec52c49fbd5c63ab07db2b Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Wed, 7 Dec 2022 00:49:43 -0600
Subject: [PATCH] eventdev/crypto: fix offset used while flushing events
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit da73a2a0d10f270acf3bb9c90f79545d27e8f562 ]

Events enqueued to eventdev from the beginning of the circular buffer.
This leads to invalid or already freed events getting enqueued to eventdev
from the circular buffer.

Fixed by enqueuing the events to eventdev from the head pointer of
circular buffer.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index b10595fbbb..535b087e0d 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -681,7 +681,7 @@ eca_circular_buffer_flush_to_evdev(struct event_crypto_adapter *adapter,
 	else
 		return 0;  /* buffer empty */

-	nb_ops_flushed =  eca_ops_enqueue_burst(adapter, ops, n);
+	nb_ops_flushed =  eca_ops_enqueue_burst(adapter, &ops[*headp], n);
 	bufp->count -= nb_ops_flushed;
 	if (!bufp->count) {
 		*headp = 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.440554900 +0800
+++ 0014-eventdev-crypto-fix-offset-used-while-flushing-event.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From da73a2a0d10f270acf3bb9c90f79545d27e8f562 Mon Sep 17 00:00:00 2001
+From e1ca28205f1b781a12ec52c49fbd5c63ab07db2b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit da73a2a0d10f270acf3bb9c90f79545d27e8f562 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index eaff5778a6..c08984b8cf 100644
+index b10595fbbb..535b087e0d 100644
@@ -26 +28 @@
-@@ -669,7 +669,7 @@ eca_circular_buffer_flush_to_evdev(struct event_crypto_adapter *adapter,
+@@ -681,7 +681,7 @@ eca_circular_buffer_flush_to_evdev(struct event_crypto_adapter *adapter,

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

* patch 'eventdev/crypto: fix overflow in circular buffer' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (11 preceding siblings ...)
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix offset used while flushing events' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix failed events' " Xueming Li
                     ` (144 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ddaec3cd54de2c4e71fca83e4afd98138f447b2b Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Wed, 7 Dec 2022 00:49:44 -0600
Subject: [PATCH] eventdev/crypto: fix overflow in circular buffer
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f442c040017aa221778aa558cc111bd3c8c8f71b ]

In case of crypto enqueue failures, even though back pressure
flag is set to stop further dequeue from eventdev, the current
logic does not stop dequeueing events for max_nb events.

This is fixed by checking the back pressure just before
dequeuing events from event device.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 535b087e0d..f3940b915f 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -585,14 +585,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,
 	if (adapter->mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW)
 		return 0;

-	if (unlikely(adapter->stop_enq_to_cryptodev)) {
-		nb_enqueued += eca_crypto_enq_flush(adapter);
+	for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) {

-		if (unlikely(adapter->stop_enq_to_cryptodev))
-			goto skip_event_dequeue_burst;
-	}
+		if (unlikely(adapter->stop_enq_to_cryptodev)) {
+			nb_enqueued += eca_crypto_enq_flush(adapter);
+
+			if (unlikely(adapter->stop_enq_to_cryptodev))
+				break;
+		}

-	for (nb_enq = 0; nb_enq < max_enq; nb_enq += n) {
 		stats->event_poll_count++;
 		n = rte_event_dequeue_burst(event_dev_id,
 					    event_port_id, ev, BATCH_SIZE, 0);
@@ -603,8 +604,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,
 		nb_enqueued += eca_enq_to_cryptodev(adapter, ev, n);
 	}

-skip_event_dequeue_burst:
-
 	if ((++adapter->transmit_loop_count &
 		(CRYPTO_ENQ_FLUSH_THRESHOLD - 1)) == 0) {
 		nb_enqueued += eca_crypto_enq_flush(adapter);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.469232900 +0800
+++ 0015-eventdev-crypto-fix-overflow-in-circular-buffer.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From f442c040017aa221778aa558cc111bd3c8c8f71b Mon Sep 17 00:00:00 2001
+From ddaec3cd54de2c4e71fca83e4afd98138f447b2b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f442c040017aa221778aa558cc111bd3c8c8f71b ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index c08984b8cf..31b825570f 100644
+index 535b087e0d..f3940b915f 100644
@@ -26 +28 @@
-@@ -573,14 +573,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,
+@@ -585,14 +585,15 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,
@@ -48 +50 @@
-@@ -591,8 +592,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,
+@@ -603,8 +604,6 @@ eca_crypto_adapter_enq_run(struct event_crypto_adapter *adapter,

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

* patch 'eventdev/crypto: fix failed events' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (12 preceding siblings ...)
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix overflow in circular buffer' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'eventdev/eth_tx: fix devices loop' " Xueming Li
                     ` (143 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ganapati Kundapura; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4c388e80e9bb843c8f1b39356f49a4047c294c63 Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date: Wed, 7 Dec 2022 00:49:45 -0600
Subject: [PATCH] eventdev/crypto: fix failed events
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4b04134cbb92ce7b73902375239b52c2d4aa5d5d ]

Circular buffer stores events failed to enqueue to eventdev for
retrying later. Current implementation adds the same crypto op
to circular buffer instead of pointing all the ops in a batch.

This fix updates the pointer to pointing to correct ops in the batch.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index f3940b915f..4e1dbefb8e 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -765,7 +765,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,
 				for (i = nb_enqueued; i < n; i++)
 					eca_circular_buffer_add(
 						&adapter->ebuf,
-						ops[nb_enqueued]);
+						ops[i]);

 check:
 				nb_deq += n;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.498791800 +0800
+++ 0016-eventdev-crypto-fix-failed-events.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From 4b04134cbb92ce7b73902375239b52c2d4aa5d5d Mon Sep 17 00:00:00 2001
+From 4c388e80e9bb843c8f1b39356f49a4047c294c63 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4b04134cbb92ce7b73902375239b52c2d4aa5d5d ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 31b825570f..5d962a1391 100644
+index f3940b915f..4e1dbefb8e 100644
@@ -25 +27 @@
-@@ -753,7 +753,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,
+@@ -765,7 +765,7 @@ eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,

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

* patch 'eventdev/eth_tx: fix devices loop' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (13 preceding siblings ...)
  2023-02-27  6:58   ` patch 'eventdev/crypto: fix failed events' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'examples/l2fwd-event: fix worker cleanup' " Xueming Li
                     ` (142 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Naga Harish K S V; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 478bec21d0b46f3dd243e4d028f596d7cde7d733 Mon Sep 17 00:00:00 2001
From: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Date: Sat, 7 Jan 2023 10:40:58 -0600
Subject: [PATCH] eventdev/eth_tx: fix devices loop
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a870c7e863a5996eb842befa30c6a7d3f9729fcf ]

Adapter service function is using RTE_ETH_FOREACH_DEV() macro for
looping through all available eth devices and flushing any pending
buffered packets.

When Traffic Management nodes (vports) are added and deleted dynamically,
there is a possibility of accessing the device info memory beyond the
allocated limit which can result in segfaults. Fixed the logic to
prevent illegal memory access.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
---
 lib/eventdev/rte_event_eth_tx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index 88309d2aaa..ba7a1c7f1b 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -676,7 +676,7 @@ txa_service_func(void *args)
 		RTE_ETH_FOREACH_DEV(i) {
 			uint16_t q;

-			if (i == txa->dev_count)
+			if (i >= txa->dev_count)
 				break;

 			dev = tdi[i].dev;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.525170700 +0800
+++ 0017-eventdev-eth_tx-fix-devices-loop.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From a870c7e863a5996eb842befa30c6a7d3f9729fcf Mon Sep 17 00:00:00 2001
+From 478bec21d0b46f3dd243e4d028f596d7cde7d733 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a870c7e863a5996eb842befa30c6a7d3f9729fcf ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index c780ee1264..6e9bcb1b79 100644
+index 88309d2aaa..ba7a1c7f1b 100644
@@ -27 +29 @@
-@@ -678,7 +678,7 @@ txa_service_func(void *args)
+@@ -676,7 +676,7 @@ txa_service_func(void *args)

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

* patch 'examples/l2fwd-event: fix worker cleanup' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (14 preceding siblings ...)
  2023-02-27  6:58   ` patch 'eventdev/eth_tx: fix devices loop' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'crypto/qat: fix stream cipher direction' " Xueming Li
                     ` (141 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Shijith Thotton; +Cc: Pavan Nikhilesh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e2c05f462108d5eb4b54a2617f664d8515d30630 Mon Sep 17 00:00:00 2001
From: Shijith Thotton <sthotton@marvell.com>
Date: Mon, 12 Dec 2022 21:18:59 +0530
Subject: [PATCH] examples/l2fwd-event: fix worker cleanup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7af8167af5c8a89aded16b847d830105007c8fe3 ]

Fixed function call arguments of l2fwd worker cleanup. Number of events
enqueued and dequeued are set the opposite.

Fixes: 622ebb6b4a7d ("examples/l2fwd-event: clean up worker state before exit")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/l2fwd-event/l2fwd_event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c
index 63450537fe..4b5a032e35 100644
--- a/examples/l2fwd-event/l2fwd_event.c
+++ b/examples/l2fwd-event/l2fwd_event.c
@@ -284,7 +284,7 @@ l2fwd_event_loop_burst(struct l2fwd_resources *rsrc,
 		}
 	}

-	l2fwd_event_worker_cleanup(event_d_id, port_id, ev, nb_rx, nb_tx, 0);
+	l2fwd_event_worker_cleanup(event_d_id, port_id, ev, nb_tx, nb_rx, 0);
 }

 static __rte_always_inline void
@@ -468,7 +468,7 @@ l2fwd_event_loop_vector(struct l2fwd_resources *rsrc, const uint32_t flags)
 		}
 	}

-	l2fwd_event_worker_cleanup(event_d_id, port_id, ev, nb_rx, nb_tx, 1);
+	l2fwd_event_worker_cleanup(event_d_id, port_id, ev, nb_tx, nb_rx, 1);
 }

 static void __rte_noinline
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.553085400 +0800
+++ 0018-examples-l2fwd-event-fix-worker-cleanup.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From 7af8167af5c8a89aded16b847d830105007c8fe3 Mon Sep 17 00:00:00 2001
+From e2c05f462108d5eb4b54a2617f664d8515d30630 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7af8167af5c8a89aded16b847d830105007c8fe3 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/qat: fix stream cipher direction' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (15 preceding siblings ...)
  2023-02-27  6:58   ` patch 'examples/l2fwd-event: fix worker cleanup' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'crypto/qat: fix build for generic x86 with GCC 12' " Xueming Li
                     ` (140 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Ciara Power; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b527b4c1680e682a7429895afdd10f0c78149c96 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Wed, 21 Dec 2022 14:05:55 +0000
Subject: [PATCH] crypto/qat: fix stream cipher direction
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 96ef7feb7a63ee74a99e221d255d91e8af3cf196 ]

Stream ciphers use ENCRYPT mode in HW for both encryption and
decryption operations. This patch adds in an overwrite to always set
ENCRYPT mode for these algorithms.

Fixes: d9b7d5bbc845 ("crypto/qat: add ZUC EEA3/EIA3 capability")

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 0ebc66f89e..c91acc1e9b 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1849,9 +1849,10 @@ int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	} else if (cdesc->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_SNOW_3G_UEA2
 		|| cdesc->qat_cipher_alg ==
-			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3)
+			ICP_QAT_HW_CIPHER_ALGO_ZUC_3G_128_EEA3) {
 		key_convert = ICP_QAT_HW_CIPHER_KEY_CONVERT;
-	else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
+		cdesc->qat_dir = ICP_QAT_HW_CIPHER_ENCRYPT;
+	} else if (cdesc->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT)
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
 	else if (cdesc->qat_mode == ICP_QAT_HW_CIPHER_AEAD_MODE)
 		key_convert = ICP_QAT_HW_CIPHER_NO_CONVERT;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.579686900 +0800
+++ 0019-crypto-qat-fix-stream-cipher-direction.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From 96ef7feb7a63ee74a99e221d255d91e8af3cf196 Mon Sep 17 00:00:00 2001
+From b527b4c1680e682a7429895afdd10f0c78149c96 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 96ef7feb7a63ee74a99e221d255d91e8af3cf196 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index ea1b729076..978ee49dce 100644
+index 0ebc66f89e..c91acc1e9b 100644
@@ -22 +24 @@
-@@ -1884,9 +1884,10 @@ int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,
+@@ -1849,9 +1849,10 @@ int qat_sym_cd_cipher_set(struct qat_sym_session *cdesc,

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

* patch 'crypto/qat: fix build for generic x86 with GCC 12' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (16 preceding siblings ...)
  2023-02-27  6:58   ` patch 'crypto/qat: fix stream cipher direction' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'crypto/qat: fix build' " Xueming Li
                     ` (139 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a636c949963fed2c3e8ce28e48aaab13d95bcb3f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 9 Jan 2023 11:34:36 +0100
Subject: [PATCH] crypto/qat: fix build for generic x86 with GCC 12
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ad7d6eea316d0d13cc0293f7c5df8dda6696f6b2 ]

Similar to commit 04361fe2aca8 ("crypto/qat: fix build with GCC 12").
The issue appears when building with the "generic" target we have in
devtools/test-meson-builds.sh.

Fixes: 3227bc7138f5 ("crypto/qat: use intel-ipsec-mb for partial hash and AES")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index c91acc1e9b..dfff1f4afb 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1331,6 +1331,8 @@ static int qat_sym_do_precomputes_ipsec_mb(enum icp_qat_hw_auth_algo hash_alg,
 	/* init ipad and opad from key and xor with fixed values */
 	memset(ipad, 0, block_size);
 	memset(opad, 0, block_size);
+	RTE_VERIFY(auth_keylen <= sizeof(ipad));
+	RTE_VERIFY(auth_keylen <= sizeof(opad));
 	rte_memcpy(ipad, auth_key, auth_keylen);
 	rte_memcpy(opad, auth_key, auth_keylen);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.607459600 +0800
+++ 0020-crypto-qat-fix-build-for-generic-x86-with-GCC-12.patch	2023-02-27 14:08:40.729237000 +0800
@@ -1 +1 @@
-From ad7d6eea316d0d13cc0293f7c5df8dda6696f6b2 Mon Sep 17 00:00:00 2001
+From a636c949963fed2c3e8ce28e48aaab13d95bcb3f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ad7d6eea316d0d13cc0293f7c5df8dda6696f6b2 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 978ee49dce..622a3120f8 100644
+index c91acc1e9b..dfff1f4afb 100644
@@ -23 +25 @@
-@@ -1366,6 +1366,8 @@ static int qat_sym_do_precomputes_ipsec_mb(enum icp_qat_hw_auth_algo hash_alg,
+@@ -1331,6 +1331,8 @@ static int qat_sym_do_precomputes_ipsec_mb(enum icp_qat_hw_auth_algo hash_alg,

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

* patch 'crypto/qat: fix build' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (17 preceding siblings ...)
  2023-02-27  6:58   ` patch 'crypto/qat: fix build for generic x86 with GCC 12' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'bus/fslmc: fix deadlock on MC send command timeout' " Xueming Li
                     ` (138 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: Thomas Monjalon, Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a0b1faaad2070f0965d21cf83196bfb06c4a3f4a Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Date: Wed, 18 Jan 2023 11:05:58 +0000
Subject: [PATCH] crypto/qat: fix build
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2a211079a92e962bbd0ec81e425a6ffc32890e67 ]

When building QAT PMD, the following issue comes up:

intel-ipsec-mb.h:333: error: "AES_BLOCK_SIZE" redefined
  333 | #define AES_BLOCK_SIZE          IMB_AES_BLOCK_SIZE
In file included from drivers/crypto/qat/qat_sym_session.c:8:
/usr/include/openssl/aes.h:26: previous definition
   26 | # define AES_BLOCK_SIZE 16

By defining NO_COMPAT_IMB_API_053, it prevents legacy macros
like AES_BLOCK_SIZE from being defined from IPSec MB library,
avoiding the redefinition.

Fixes: 3227bc7138f5 ("crypto/qat: use intel-ipsec-mb for partial hash and AES")

Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 drivers/crypto/qat/qat_sym_session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index dfff1f4afb..46a30d6539 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -10,6 +10,7 @@
 #include <openssl/evp.h>	/* Needed for bpi runt block processing */

 #ifdef RTE_QAT_LIBIPSECMB
+#define NO_COMPAT_IMB_API_053
 #if defined(RTE_ARCH_ARM)
 #include <ipsec-mb.h>
 #else
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.639405000 +0800
+++ 0021-crypto-qat-fix-build.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 2a211079a92e962bbd0ec81e425a6ffc32890e67 Mon Sep 17 00:00:00 2001
+From a0b1faaad2070f0965d21cf83196bfb06c4a3f4a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2a211079a92e962bbd0ec81e425a6ffc32890e67 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 622a3120f8..466482d225 100644
+index dfff1f4afb..46a30d6539 100644

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

* patch 'bus/fslmc: fix deadlock on MC send command timeout' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (18 preceding siblings ...)
  2023-02-27  6:58   ` patch 'crypto/qat: fix build' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'fbarray: fix metadata dump' " Xueming Li
                     ` (137 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Alvaro Karsz; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 23a5b25c8aca04fc1e79890b3e92c3f646c5a72d Mon Sep 17 00:00:00 2001
From: Alvaro Karsz <alvaro.karsz@solid-run.com>
Date: Wed, 4 Jan 2023 09:40:51 +0200
Subject: [PATCH] bus/fslmc: fix deadlock on MC send command timeout
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 06cce2876a37ac6161652bd121ce1ff03d52cce5 ]

Bug in function mc_send_command: a spinlock is not unlocked in case
of timeouts.

Fixes: 79711846f676 ("bus/fslmc: add timeout in MC send command")

Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 .mailmap                      | 1 +
 drivers/bus/fslmc/mc/mc_sys.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 75884b6fe2..db7440407b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -64,6 +64,7 @@ Ali Volkan Atli <volkan.atli@argela.com.tr>
 Allain Legacy <allain.legacy@windriver.com>
 Allen Hubbe <allen.hubbe@amd.com>
 Alok Makhariya <alok.makhariya@nxp.com>
+Alvaro Karsz <alvaro.karsz@solid-run.com>
 Alvin Zhang <alvinx.zhang@intel.com>
 Aman Singh <aman.deep.singh@intel.com>
 Amaranath Somalapuram <asomalap@amd.com>
diff --git a/drivers/bus/fslmc/mc/mc_sys.c b/drivers/bus/fslmc/mc/mc_sys.c
index ab9a074835..76fdcd5c8a 100644
--- a/drivers/bus/fslmc/mc/mc_sys.c
+++ b/drivers/bus/fslmc/mc/mc_sys.c
@@ -77,8 +77,11 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
 		total_time = rte_get_timer_cycles() - start_time;
 	} while (status == MC_CMD_STATUS_READY && total_time <= time_to_wait);

-	if (status == MC_CMD_STATUS_READY)
+	if (status == MC_CMD_STATUS_READY) {
+		rte_spinlock_unlock(&mc_portal_lock);
+
 		return mc_status_to_error(MC_CMD_STATUS_TIMEOUT);
+	}

 	/* Read the response back into the command buffer */
 	mc_read_response(mc_io->regs, cmd);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.670737000 +0800
+++ 0022-bus-fslmc-fix-deadlock-on-MC-send-command-timeout.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 06cce2876a37ac6161652bd121ce1ff03d52cce5 Mon Sep 17 00:00:00 2001
+From 23a5b25c8aca04fc1e79890b3e92c3f646c5a72d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 06cce2876a37ac6161652bd121ce1ff03d52cce5 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'fbarray: fix metadata dump' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (19 preceding siblings ...)
  2023-02-27  6:58   ` patch 'bus/fslmc: fix deadlock on MC send command timeout' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'gpudev: fix deadlocks when registering callback' " Xueming Li
                     ` (136 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1586e3b7bcf2bd502a67d6b45e51df8ec96c09d8 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 3 Jan 2023 11:48:48 +0100
Subject: [PATCH] fbarray: fix metadata dump
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 70eb4069b05c82494155a89eb8d08d8d2f57b059 ]

If the passed fbarray is invalid, its lock was not taken before
releasing.

Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/common/eal_common_fbarray.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index f11f87979f..169e66e04b 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -1482,7 +1482,7 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)

 	if (fully_validate(arr->name, arr->elt_sz, arr->len)) {
 		fprintf(f, "Invalid file-backed array\n");
-		goto out;
+		return;
 	}

 	/* prevent array from changing under us */
@@ -1496,6 +1496,5 @@ rte_fbarray_dump_metadata(struct rte_fbarray *arr, FILE *f)

 	for (i = 0; i < msk->n_masks; i++)
 		fprintf(f, "msk idx %i: 0x%016" PRIx64 "\n", i, msk->data[i]);
-out:
 	rte_rwlock_read_unlock(&arr->rwlock);
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.700249900 +0800
+++ 0023-fbarray-fix-metadata-dump.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 70eb4069b05c82494155a89eb8d08d8d2f57b059 Mon Sep 17 00:00:00 2001
+From 1586e3b7bcf2bd502a67d6b45e51df8ec96c09d8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 70eb4069b05c82494155a89eb8d08d8d2f57b059 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'gpudev: fix deadlocks when registering callback' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (20 preceding siblings ...)
  2023-02-27  6:58   ` patch 'fbarray: fix metadata dump' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'graph: fix node shrink' " Xueming Li
                     ` (135 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Elena Agostini, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 3 Jan 2023 11:49:00 +0100
Subject: [PATCH] gpudev: fix deadlocks when registering callback
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ]

gpu_callback_lock was not released in some branches of the register
helper.
While at it, set rte_errno in one of those branches.

Fixes: 18cb07563165 ("gpudev: add event notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Elena Agostini <eagostini@nvidia.com>
---
 lib/gpudev/gpudev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 805719d00c..8f12abef23 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -408,6 +408,7 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event,
 					callback->function == function &&
 					callback->user_data == user_data) {
 				GPU_LOG(INFO, "callback already registered");
+				rte_rwlock_write_unlock(&gpu_callback_lock);
 				return 0;
 			}
 		}
@@ -415,7 +416,9 @@ rte_gpu_callback_register(int16_t dev_id, enum rte_gpu_event event,
 		callback = malloc(sizeof(*callback));
 		if (callback == NULL) {
 			GPU_LOG(ERR, "cannot allocate callback");
-			return -ENOMEM;
+			rte_rwlock_write_unlock(&gpu_callback_lock);
+			rte_errno = ENOMEM;
+			return -rte_errno;
 		}
 		callback->function = function;
 		callback->user_data = user_data;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.726526900 +0800
+++ 0024-gpudev-fix-deadlocks-when-registering-callback.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 75d75530072e95a56799f0a8af261fc2eaf564ab Mon Sep 17 00:00:00 2001
+From b9a14f6737000ffc6badaf72e5da6ba2194e285c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 75d75530072e95a56799f0a8af261fc2eaf564ab ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'graph: fix node shrink' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (21 preceding siblings ...)
  2023-02-27  6:58   ` patch 'gpudev: fix deadlocks when registering callback' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/nfp: fix Tx packet drop for large data length' " Xueming Li
                     ` (134 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Kiran Kumar K, Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5ef77a12217ad71734f44c8a84781f5a61cfb5ac Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 19 Jan 2023 11:32:34 +0100
Subject: [PATCH] graph: fix node shrink
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 ]

If the node id check failed, graph_lock was not taken before releasing.

Fixes: c59dac2ca14a ("graph: implement node operations")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/graph/node.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/graph/node.c b/lib/graph/node.c
index fc6345de07..149414dcd9 100644
--- a/lib/graph/node.c
+++ b/lib/graph/node.c
@@ -300,16 +300,16 @@ rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
 		if (node->id == id) {
 			if (node->nb_edges < size) {
 				rte_errno = E2BIG;
-				goto fail;
+			} else {
+				node->nb_edges = size;
+				rc = size;
 			}
-			node->nb_edges = size;
-			rc = size;
 			break;
 		}
 	}

-fail:
 	graph_spinlock_unlock();
+fail:
 	return rc;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.755061600 +0800
+++ 0025-graph-fix-node-shrink.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 Mon Sep 17 00:00:00 2001
+From 5ef77a12217ad71734f44c8a84781f5a61cfb5ac Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 99cc0a9ab6730d4df70dba4b19e78e87ad7ba110 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/nfp: fix Tx packet drop for large data length' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (22 preceding siblings ...)
  2023-02-27  6:58   ` patch 'graph: fix node shrink' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/nfp: fix firmware name derived from PCI name' " Xueming Li
                     ` (133 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Long Wu; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a87a84560cf4b5825c85dcdb7d8e1cad0931cce6 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Tue, 29 Nov 2022 09:21:22 +0800
Subject: [PATCH] net/nfp: fix Tx packet drop for large data length
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b108863e40bacf20cdb461b50b88c4ec0bb5e143 ]

If dma_len is larger than NFDK_DESC_TX_DMA_LEN_HEAD, the value of
"dma_len & NFDK_DESC_TX_DMA_LEN_HEAD" maybe less than packet head length
and the packet will be dropped.

Fill maximum dma_len in first Tx descriptor to make sure the whole head
is included in the first descriptor.

In addition, add comments to better explain the code flow.

Fixes: c73dced48c8c ("net/nfp: add NFDk Tx")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 01cffdfde0..e2cdb9e27e 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -1063,6 +1063,7 @@ nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq, struct rte_mbuf *pkt)
 	if (unlikely(n_descs > NFDK_TX_DESC_GATHER_MAX))
 		return -EINVAL;

+	/* Under count by 1 (don't count meta) for the round down to work out */
 	n_descs += !!(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG);

 	if (round_down(txq->wr_p, NFDK_TX_DESC_BLOCK_CNT) !=
@@ -1219,8 +1220,19 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk
 		} else {
 			type = NFDK_DESC_TX_TYPE_GATHER;
 		}
+
+		/* Implicitly truncates to chunk in below logic */
 		dma_len -= 1;
-		dlen_type = (NFDK_DESC_TX_DMA_LEN_HEAD & dma_len) |
+
+		/*
+		 * We will do our best to pass as much data as we can in descriptor
+		 * and we need to make sure the first descriptor includes whole
+		 * head since there is limitation in firmware side. Sometimes the
+		 * value of 'dma_len & NFDK_DESC_TX_DMA_LEN_HEAD' will be less
+		 * than packet head len.
+		 */
+		dlen_type = (dma_len > NFDK_DESC_TX_DMA_LEN_HEAD ?
+				NFDK_DESC_TX_DMA_LEN_HEAD : dma_len) |
 			(NFDK_DESC_TX_TYPE_HEAD & (type << 12));
 		ktxds->dma_len_type = rte_cpu_to_le_16(dlen_type);
 		dma_addr = rte_mbuf_data_iova(pkt);
@@ -1230,10 +1242,18 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk
 		ktxds->dma_addr_lo = rte_cpu_to_le_32(dma_addr & 0xffffffff);
 		ktxds++;

+		/*
+		 * Preserve the original dlen_type, this way below the EOP logic
+		 * can use dlen_type.
+		 */
 		tmp_dlen = dlen_type & NFDK_DESC_TX_DMA_LEN_HEAD;
 		dma_len -= tmp_dlen;
 		dma_addr += tmp_dlen + 1;

+		/*
+		 * The rest of the data (if any) will be in larger DMA descriptors
+		 * and is handled with the dma_len loop.
+		 */
 		while (pkt) {
 			if (*lmbuf)
 				rte_pktmbuf_free_seg(*lmbuf);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.782981000 +0800
+++ 0026-net-nfp-fix-Tx-packet-drop-for-large-data-length.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From b108863e40bacf20cdb461b50b88c4ec0bb5e143 Mon Sep 17 00:00:00 2001
+From a87a84560cf4b5825c85dcdb7d8e1cad0931cce6 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b108863e40bacf20cdb461b50b88c4ec0bb5e143 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/nfp: fix firmware name derived from PCI name' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (23 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/nfp: fix Tx packet drop for large data length' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/ena: fix deadlock in RSS RETA update' " Xueming Li
                     ` (132 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Peng Zhang; +Cc: Chaoyong He, Niklas Söderlund, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f029ceb7aaacc5aa941e8b7145fdf64b2bc338a5 Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang@corigine.com>
Date: Thu, 8 Dec 2022 11:31:16 +0800
Subject: [PATCH] net/nfp: fix firmware name derived from PCI name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 ]

Driver looks for a firmware file whose name is derived from the PCI
name, the firmware file name format is described in the driver document.

But the firmware name used in the code is slightly different than the
name in documentation,
document has 'pci-0000:04:00.0.nffw' vs code has 'pci-04:00.0.nffw'.

After this commit, driver will look for firmware file consistent with
what is documented (in nfp.rst).

Fixes: 896c265ef954 ("net/nfp: use new CPP interface")

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/nfp/nfp_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 0956ea81df..f22ae24b53 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -724,7 +724,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 		goto load_fw;
 	/* Then try the PCI name */
 	snprintf(fw_name, sizeof(fw_name), "%s/pci-%s.nffw", DEFAULT_FW_PATH,
-			dev->device.name);
+			dev->name);

 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	if (rte_firmware_read(fw_name, &fw_buf, &fsize) == 0)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.813833500 +0800
+++ 0027-net-nfp-fix-firmware-name-derived-from-PCI-name.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 Mon Sep 17 00:00:00 2001
+From f029ceb7aaacc5aa941e8b7145fdf64b2bc338a5 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3ddb4cc0914a13d6dd47a497c1f61919b3ed1c20 ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ena: fix deadlock in RSS RETA update' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (24 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/nfp: fix firmware name derived from PCI name' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/hns3: fix inaccurate RTC time to read' " Xueming Li
                     ` (131 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: David Marchand; +Cc: Fan Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 36ec039309e62ddc9b22bdb50a4f96929df5ee1e Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 5 Jan 2023 14:57:33 +0100
Subject: [PATCH] net/ena: fix deadlock in RSS RETA update
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 195e0f2497ad608a68b46b279e87b68adfd9fe23 ]

Add missing lock release in case of internal failure.

Fixes: e3595539e0e0 ("net/ena: proxy AQ calls to primary process")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Fan Zhang <fanzhang.oss@gmail.com>
---
 drivers/net/ena/ena_rss.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c
index b682d01c20..d0ba9d5c0a 100644
--- a/drivers/net/ena/ena_rss.c
+++ b/drivers/net/ena/ena_rss.c
@@ -105,6 +105,7 @@ int ena_rss_reta_update(struct rte_eth_dev *dev,
 			if (unlikely(rc != 0)) {
 				PMD_DRV_LOG(ERR,
 					"Cannot fill indirection table\n");
+				rte_spinlock_unlock(&adapter->admin_lock);
 				return rc;
 			}
 		}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.842114000 +0800
+++ 0028-net-ena-fix-deadlock-in-RSS-RETA-update.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 195e0f2497ad608a68b46b279e87b68adfd9fe23 Mon Sep 17 00:00:00 2001
+From 36ec039309e62ddc9b22bdb50a4f96929df5ee1e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 195e0f2497ad608a68b46b279e87b68adfd9fe23 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: fix inaccurate RTC time to read' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (25 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/ena: fix deadlock in RSS RETA update' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/nfp: store counter reset before zeroing flow query' " Xueming Li
                     ` (130 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 58db4361dc585b453a6808ef5ada1002476cdf08 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 9 Jan 2023 16:23:44 +0800
Subject: [PATCH] net/hns3: fix inaccurate RTC time to read
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 ]

The sequence of reading current RTC time register doesn't meet
the hardware requirements, which causes this time obtained is
the one before modifying RTC time.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ptp.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c
index 6bbd85ba23..db3c007b12 100644
--- a/drivers/net/hns3/hns3_ptp.c
+++ b/drivers/net/hns3/hns3_ptp.c
@@ -216,17 +216,21 @@ hns3_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 int
 hns3_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
 {
+#define HNS3_PTP_SEC_H_OFFSET	32
+#define HNS3_PTP_SEC_H_MASK	0xFFFF
+
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint32_t sec_hi, sec_lo;
 	uint64_t ns, sec;

 	if (!hns3_dev_get_support(hw, PTP))
 		return -ENOTSUP;

-	sec = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_L);
-	sec |= (uint64_t)(hns3_read_dev(hw, HNS3_CURR_TIME_OUT_H) & 0xFFFF)
-		<< 32;
-
 	ns = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_NS);
+	sec_hi = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_H) & HNS3_PTP_SEC_H_MASK;
+	sec_lo = hns3_read_dev(hw, HNS3_CURR_TIME_OUT_L);
+	sec = ((uint64_t)sec_hi << HNS3_PTP_SEC_H_OFFSET) | sec_lo;
+
 	ns += sec * NSEC_PER_SEC;
 	*ts = rte_ns_to_timespec(ns);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.872754400 +0800
+++ 0029-net-hns3-fix-inaccurate-RTC-time-to-read.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 Mon Sep 17 00:00:00 2001
+From 58db4361dc585b453a6808ef5ada1002476cdf08 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6170abd5c0cc3d8cf4e358c4200ed7737d639d10 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/nfp: store counter reset before zeroing flow query' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (26 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/hns3: fix inaccurate RTC time to read' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'net/nfp: fix teardown of flows sharing a mask ID' " Xueming Li
                     ` (129 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 375086efb5ad85cceee8ab3398125639d8544f80 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Fri, 9 Dec 2022 16:17:47 +0800
Subject: [PATCH] net/nfp: store counter reset before zeroing flow query
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3fe4706ad0d8e86adcd9088939c66d74ad6d7d56 ]

The reset flag in the query structure are cleared by mistake, cause
the flow count never be reset, so the query API will always has count
value even the flow has stopped, and this will cause the flow never
been aged.

Fixes: 30ecce522732 ("net/nfp: support flow API")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 6f79d950db..d1d209ce13 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3809,6 +3809,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 		struct rte_flow *nfp_flow,
 		void *data)
 {
+	bool reset;
 	uint32_t ctx_id;
 	struct rte_flow *flow;
 	struct nfp_flow_priv *priv;
@@ -3823,6 +3824,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 	}

 	query = (struct rte_flow_query_count *)data;
+	reset = query->reset;
 	memset(query, 0, sizeof(*query));

 	ctx_id = rte_be_to_cpu_32(nfp_flow->payload.meta->host_ctx_id);
@@ -3834,7 +3836,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev,
 		query->bytes = stats->bytes;
 		query->hits_set = 1;
 		query->bytes_set = 1;
-		if (query->reset != 0) {
+		if (reset) {
 			stats->pkts = 0;
 			stats->bytes = 0;
 		}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.899153400 +0800
+++ 0030-net-nfp-store-counter-reset-before-zeroing-flow-quer.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From 3fe4706ad0d8e86adcd9088939c66d74ad6d7d56 Mon Sep 17 00:00:00 2001
+From 375086efb5ad85cceee8ab3398125639d8544f80 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3fe4706ad0d8e86adcd9088939c66d74ad6d7d56 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/nfp: fix teardown of flows sharing a mask ID' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (27 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/nfp: store counter reset before zeroing flow query' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:58   ` patch 'app/testpmd: fix interactive mode with no ports' " Xueming Li
                     ` (128 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1df8c209233c5689b766f6389b78c0104fd480b4 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 24 Jan 2023 15:16:31 +0800
Subject: [PATCH] net/nfp: fix teardown of flows sharing a mask ID
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ea2883336d11516b6c7e81f208a65be4b133997f ]

The same data in mask section of different flow add/delete control
messages will share the same mask ID of mask table.  The first flow
add control message and the last flow delete control message for a
specific mask ID should have the NFP_FL_META_FLAG_MANAGE_MASK flag set,
this will indicate to the flower firmware to allocate/deallocate the
mask table entry.

The original logic wrongly process the flow delete control message,
and caused the first flow delete control message to have the
NFP_FL_META_FLAG_MANAGE_MASK flagset, thus the flower firmware
deallocate the mask table entry on the first delete. This in turn
prevented all the other flows sharing the same mask ID from offloading.

Fixes: ac09376096d8 ("net/nfp: add structures and functions for flow offload")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index d1d209ce13..8784e01628 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -285,7 +285,7 @@ nfp_check_mask_remove(struct nfp_flow_priv *priv,

 		rte_free(mask_entry);
 		if (meta_flags)
-			*meta_flags &= ~NFP_FL_META_FLAG_MANAGE_MASK;
+			*meta_flags |= NFP_FL_META_FLAG_MANAGE_MASK;
 	}

 	return true;
@@ -3592,6 +3592,7 @@ nfp_flow_teardown(struct nfp_flow_priv *priv,
 	nfp_flow_meta = nfp_flow->payload.meta;
 	mask_data = nfp_flow->payload.mask_data;
 	mask_len = nfp_flow_meta->mask_len << NFP_FL_LW_SIZ;
+	nfp_flow_meta->flags &= ~NFP_FL_META_FLAG_MANAGE_MASK;
 	if (!nfp_check_mask_remove(priv, mask_data, mask_len,
 			&nfp_flow_meta->flags)) {
 		PMD_DRV_LOG(ERR, "nfp mask del check failed.");
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.928000200 +0800
+++ 0031-net-nfp-fix-teardown-of-flows-sharing-a-mask-ID.patch	2023-02-27 14:08:40.739237000 +0800
@@ -1 +1 @@
-From ea2883336d11516b6c7e81f208a65be4b133997f Mon Sep 17 00:00:00 2001
+From 1df8c209233c5689b766f6389b78c0104fd480b4 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ea2883336d11516b6c7e81f208a65be4b133997f ]
@@ -23 +25,0 @@
-Cc: stable@dpdk.org
@@ -32 +34 @@
-index d6c8c89921..ff2e21c817 100644
+index d1d209ce13..8784e01628 100644
@@ -44 +46 @@
-@@ -3653,6 +3653,7 @@ nfp_flow_teardown(struct nfp_flow_priv *priv,
+@@ -3592,6 +3592,7 @@ nfp_flow_teardown(struct nfp_flow_priv *priv,

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

* patch 'app/testpmd: fix interactive mode with no ports' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (28 preceding siblings ...)
  2023-02-27  6:58   ` patch 'net/nfp: fix teardown of flows sharing a mask ID' " Xueming Li
@ 2023-02-27  6:58   ` Xueming Li
  2023-02-27  6:59   ` patch 'telemetry: move include after guard' " Xueming Li
                     ` (127 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:58 UTC (permalink / raw)
  To: Gregory Etelson; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8ab731497d62848d74a06e6f80ad41e2da5ff54c Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson@nvidia.com>
Date: Thu, 19 Jan 2023 19:45:59 +0200
Subject: [PATCH] app/testpmd: fix interactive mode with no ports
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7e40372522c5a129da616d1420ff582968b81b46 ]

Testpmd terminated unconditionally if it failed to start all ports.

The patch allows testpmd to get into the command line,
if the interactive mode was requested.

Fixes: 6937d2103e22 ("app/testpmd: add option to not start device")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 134d79a555..e366f81a0f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4483,8 +4483,13 @@ main(int argc, char** argv)
 		}
 	}

-	if (!no_device_start && start_port(RTE_PORT_ALL) != 0)
-		rte_exit(EXIT_FAILURE, "Start ports failed\n");
+	if (!no_device_start && start_port(RTE_PORT_ALL) != 0) {
+		if (!interactive) {
+			rte_eal_cleanup();
+			rte_exit(EXIT_FAILURE, "Start ports failed\n");
+		}
+		fprintf(stderr, "Start ports failed\n");
+	}

 	/* set all ports to promiscuous mode by default */
 	RTE_ETH_FOREACH_DEV(port_id) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.957126300 +0800
+++ 0032-app-testpmd-fix-interactive-mode-with-no-ports.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 7e40372522c5a129da616d1420ff582968b81b46 Mon Sep 17 00:00:00 2001
+From 8ab731497d62848d74a06e6f80ad41e2da5ff54c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7e40372522c5a129da616d1420ff582968b81b46 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'telemetry: move include after guard' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (29 preceding siblings ...)
  2023-02-27  6:58   ` patch 'app/testpmd: fix interactive mode with no ports' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'ethdev: fix telemetry data truncation' " Xueming Li
                     ` (126 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Huisong Li
  Cc: Morten Brørup, Chengwen Feng, Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4f9c6db77bad1c99bc921eddeeceb8092f0d796b Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:41 +0800
Subject: [PATCH] telemetry: move include after guard
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f7b74387be1de6803716262d7988794accd6d39f ]

The "stdint.h" header is outside '_RTE_TELEMETRY_H_' macro, which cause
this header is unconditional. So this patch moves this header to inside
'_RTE_TELEMETRY_H_'.

Fixes: 99a2dd955fba ("lib: remove librte_ prefix from directory names")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/telemetry/rte_telemetry.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h
index d9918c4e96..40e9a3bf9d 100644
--- a/lib/telemetry/rte_telemetry.h
+++ b/lib/telemetry/rte_telemetry.h
@@ -2,9 +2,6 @@
  * Copyright(c) 2018 Intel Corporation
  */

-#include <stdint.h>
-
-
 #ifndef _RTE_TELEMETRY_H_
 #define _RTE_TELEMETRY_H_

@@ -12,6 +9,8 @@
 extern "C" {
 #endif

+#include <stdint.h>
+
 /** Maximum length for string used in object. */
 #define RTE_TEL_MAX_STRING_LEN 128
 /** Maximum length of string. */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:41.988096700 +0800
+++ 0033-telemetry-move-include-after-guard.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From f7b74387be1de6803716262d7988794accd6d39f Mon Sep 17 00:00:00 2001
+From 4f9c6db77bad1c99bc921eddeeceb8092f0d796b Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f7b74387be1de6803716262d7988794accd6d39f ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'ethdev: fix telemetry data truncation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (30 preceding siblings ...)
  2023-02-27  6:59   ` patch 'telemetry: move include after guard' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'mempool: " Xueming Li
                     ` (125 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Huisong Li; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bd11b88f8be6957df859aef36356fab02ec7755d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:42 +0800
Subject: [PATCH] ethdev: fix telemetry data truncation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7db3f2af573287abb9201d46a92b4ca3ebc5d9ad ]

The 'u32' and 'u64' data can not assigned to 'int' type variable.
They need to use the 'u64' APIs to add.

Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/ethdev/rte_ethdev.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 5d5e18db1e..a40d396677 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6037,9 +6037,9 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
 			eth_dev->data->nb_tx_queues);
 	rte_tel_data_add_dict_int(d, "port_id", eth_dev->data->port_id);
 	rte_tel_data_add_dict_int(d, "mtu", eth_dev->data->mtu);
-	rte_tel_data_add_dict_int(d, "rx_mbuf_size_min",
+	rte_tel_data_add_dict_u64(d, "rx_mbuf_size_min",
 			eth_dev->data->min_rx_buf_size);
-	rte_tel_data_add_dict_int(d, "rx_mbuf_alloc_fail",
+	rte_tel_data_add_dict_u64(d, "rx_mbuf_alloc_fail",
 			eth_dev->data->rx_mbuf_alloc_failed);
 	rte_ether_format_addr(mac_addr, sizeof(mac_addr),
 			eth_dev->data->mac_addrs);
@@ -6068,12 +6068,12 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
 	rte_tel_data_add_dict_container(d, "rxq_state", rxq_state, 0);
 	rte_tel_data_add_dict_container(d, "txq_state", txq_state, 0);
 	rte_tel_data_add_dict_int(d, "numa_node", eth_dev->data->numa_node);
-	rte_tel_data_add_dict_int(d, "dev_flags", eth_dev->data->dev_flags);
-	rte_tel_data_add_dict_int(d, "rx_offloads",
+	rte_tel_data_add_dict_u64(d, "dev_flags", eth_dev->data->dev_flags);
+	rte_tel_data_add_dict_u64(d, "rx_offloads",
 			eth_dev->data->dev_conf.rxmode.offloads);
-	rte_tel_data_add_dict_int(d, "tx_offloads",
+	rte_tel_data_add_dict_u64(d, "tx_offloads",
 			eth_dev->data->dev_conf.txmode.offloads);
-	rte_tel_data_add_dict_int(d, "ethdev_rss_hf",
+	rte_tel_data_add_dict_u64(d, "ethdev_rss_hf",
 			eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf);

 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.015058700 +0800
+++ 0034-ethdev-fix-telemetry-data-truncation.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 7db3f2af573287abb9201d46a92b4ca3ebc5d9ad Mon Sep 17 00:00:00 2001
+From bd11b88f8be6957df859aef36356fab02ec7755d Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7db3f2af573287abb9201d46a92b4ca3ebc5d9ad ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'mempool: fix telemetry data truncation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (31 preceding siblings ...)
  2023-02-27  6:59   ` patch 'ethdev: fix telemetry data truncation' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'cryptodev: " Xueming Li
                     ` (124 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Huisong Li; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 16f272c96f1bcbc470629f825d67bcf20a598a31 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:43 +0800
Subject: [PATCH] mempool: fix telemetry data truncation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4eebfcf70a21b2b608e3bb9f20b5ee23338172ec ]

The 'u32' and 'u64' data can not assigned to 'int' type variable.
They need to use the 'u64' APIs to add.

Fixes: 2f5c4025abb3 ("mempool: add telemetry endpoint")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/mempool/rte_mempool.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index f33f455790..950d01ffac 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1500,27 +1500,27 @@ mempool_info_cb(struct rte_mempool *mp, void *arg)
 		return;

 	rte_tel_data_add_dict_string(info->d, "name", mp->name);
-	rte_tel_data_add_dict_int(info->d, "pool_id", mp->pool_id);
-	rte_tel_data_add_dict_int(info->d, "flags", mp->flags);
+	rte_tel_data_add_dict_u64(info->d, "pool_id", mp->pool_id);
+	rte_tel_data_add_dict_u64(info->d, "flags", mp->flags);
 	rte_tel_data_add_dict_int(info->d, "socket_id", mp->socket_id);
-	rte_tel_data_add_dict_int(info->d, "size", mp->size);
-	rte_tel_data_add_dict_int(info->d, "cache_size", mp->cache_size);
-	rte_tel_data_add_dict_int(info->d, "elt_size", mp->elt_size);
-	rte_tel_data_add_dict_int(info->d, "header_size", mp->header_size);
-	rte_tel_data_add_dict_int(info->d, "trailer_size", mp->trailer_size);
-	rte_tel_data_add_dict_int(info->d, "private_data_size",
+	rte_tel_data_add_dict_u64(info->d, "size", mp->size);
+	rte_tel_data_add_dict_u64(info->d, "cache_size", mp->cache_size);
+	rte_tel_data_add_dict_u64(info->d, "elt_size", mp->elt_size);
+	rte_tel_data_add_dict_u64(info->d, "header_size", mp->header_size);
+	rte_tel_data_add_dict_u64(info->d, "trailer_size", mp->trailer_size);
+	rte_tel_data_add_dict_u64(info->d, "private_data_size",
 				  mp->private_data_size);
 	rte_tel_data_add_dict_int(info->d, "ops_index", mp->ops_index);
-	rte_tel_data_add_dict_int(info->d, "populated_size",
+	rte_tel_data_add_dict_u64(info->d, "populated_size",
 				  mp->populated_size);

 	mz = mp->mz;
 	rte_tel_data_add_dict_string(info->d, "mz_name", mz->name);
-	rte_tel_data_add_dict_int(info->d, "mz_len", mz->len);
-	rte_tel_data_add_dict_int(info->d, "mz_hugepage_sz",
+	rte_tel_data_add_dict_u64(info->d, "mz_len", mz->len);
+	rte_tel_data_add_dict_u64(info->d, "mz_hugepage_sz",
 				  mz->hugepage_sz);
 	rte_tel_data_add_dict_int(info->d, "mz_socket_id", mz->socket_id);
-	rte_tel_data_add_dict_int(info->d, "mz_flags", mz->flags);
+	rte_tel_data_add_dict_u64(info->d, "mz_flags", mz->flags);
 }

 static int
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.046453300 +0800
+++ 0035-mempool-fix-telemetry-data-truncation.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 4eebfcf70a21b2b608e3bb9f20b5ee23338172ec Mon Sep 17 00:00:00 2001
+From 16f272c96f1bcbc470629f825d67bcf20a598a31 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4eebfcf70a21b2b608e3bb9f20b5ee23338172ec ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'cryptodev: fix telemetry data truncation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (32 preceding siblings ...)
  2023-02-27  6:59   ` patch 'mempool: " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'mem: " Xueming Li
                     ` (123 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Huisong Li; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 453a4d30ed1e8e3607800b703d1e0106373ff129 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:44 +0800
Subject: [PATCH] cryptodev: fix telemetry data truncation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 45038f04ab577db8844ef54d7f523119be6c205f ]

The 'u32' data can not assigned to 'int' type variable. The 'u32' data
needs to use the 'u64' APIs to add.

Fixes: d3d98f5ce9d0 ("cryptodev: support telemetry")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/cryptodev/rte_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 2165a0688c..515d0df5ce 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2692,7 +2692,7 @@ cryptodev_handle_dev_info(const char *cmd __rte_unused,
 	rte_tel_data_start_dict(d);
 	rte_tel_data_add_dict_string(d, "device_name",
 		cryptodev_info.device->name);
-	rte_tel_data_add_dict_int(d, "max_nb_queue_pairs",
+	rte_tel_data_add_dict_u64(d, "max_nb_queue_pairs",
 		cryptodev_info.max_nb_queue_pairs);

 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.074390000 +0800
+++ 0036-cryptodev-fix-telemetry-data-truncation.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 45038f04ab577db8844ef54d7f523119be6c205f Mon Sep 17 00:00:00 2001
+From 453a4d30ed1e8e3607800b703d1e0106373ff129 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 45038f04ab577db8844ef54d7f523119be6c205f ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 742a4c512e..22e7122613 100644
+index 2165a0688c..515d0df5ce 100644
@@ -26 +28 @@
-@@ -2859,7 +2859,7 @@ cryptodev_handle_dev_info(const char *cmd __rte_unused,
+@@ -2692,7 +2692,7 @@ cryptodev_handle_dev_info(const char *cmd __rte_unused,

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

* patch 'mem: fix telemetry data truncation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (33 preceding siblings ...)
  2023-02-27  6:59   ` patch 'cryptodev: " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'examples/qos_sched: fix debug mode' " Xueming Li
                     ` (122 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Huisong Li; +Cc: Morten Brørup, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0e846591b5028863a505897da4423d75a7edb609 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Mon, 19 Dec 2022 15:06:45 +0800
Subject: [PATCH] mem: fix telemetry data truncation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6243e36b837b754c33017718cf79f7574a52b09c ]

The 'u32' and 'u64' data can not assigned to 'int' type variable.
They need to use the 'u64' APIs to add.

Fixes: e6732d0d6e26 ("mem: add telemetry infos")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/eal/common/eal_common_memory.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index 688dc615d7..8e427bf4b4 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -1139,7 +1139,7 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params,
 	malloc_heap_get_stats(heap, &sock_stats);

 	rte_tel_data_start_dict(d);
-	rte_tel_data_add_dict_int(d, "Head id", heap_id);
+	rte_tel_data_add_dict_u64(d, "Head id", heap_id);
 	rte_tel_data_add_dict_string(d, "Name", heap->name);
 	rte_tel_data_add_dict_u64(d, "Heap_size",
 				  sock_stats.heap_totalsz_bytes);
@@ -1201,13 +1201,13 @@ handle_eal_memzone_info_request(const char *cmd __rte_unused,
 	mz = rte_fbarray_get(&mcfg->memzones, mz_idx);

 	rte_tel_data_start_dict(d);
-	rte_tel_data_add_dict_int(d, "Zone", mz_idx);
+	rte_tel_data_add_dict_u64(d, "Zone", mz_idx);
 	rte_tel_data_add_dict_string(d, "Name", mz->name);
-	rte_tel_data_add_dict_int(d, "Length", mz->len);
+	rte_tel_data_add_dict_u64(d, "Length", mz->len);
 	snprintf(addr, ADDR_STR, "%p", mz->addr);
 	rte_tel_data_add_dict_string(d, "Address", addr);
 	rte_tel_data_add_dict_int(d, "Socket", mz->socket_id);
-	rte_tel_data_add_dict_int(d, "Flags", mz->flags);
+	rte_tel_data_add_dict_u64(d, "Flags", mz->flags);

 	/* go through each page occupied by this memzone */
 	msl = rte_mem_virt2memseg_list(mz->addr);
@@ -1222,7 +1222,7 @@ handle_eal_memzone_info_request(const char *cmd __rte_unused,
 	ms_idx = RTE_PTR_DIFF(mz->addr, msl->base_va) / page_sz;
 	ms = rte_fbarray_get(&msl->memseg_arr, ms_idx);

-	rte_tel_data_add_dict_int(d, "Hugepage_size", page_sz);
+	rte_tel_data_add_dict_u64(d, "Hugepage_size", page_sz);
 	snprintf(addr, ADDR_STR, "%p", ms->addr);
 	rte_tel_data_add_dict_string(d, "Hugepage_base", addr);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.103342200 +0800
+++ 0037-mem-fix-telemetry-data-truncation.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 6243e36b837b754c33017718cf79f7574a52b09c Mon Sep 17 00:00:00 2001
+From 0e846591b5028863a505897da4423d75a7edb609 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6243e36b837b754c33017718cf79f7574a52b09c ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/qos_sched: fix debug mode' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (34 preceding siblings ...)
  2023-02-27  6:59   ` patch 'mem: " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'app/dumpcap: fix storing port identifier' " Xueming Li
                     ` (121 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Megha Ajmera; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cb3c0ba47e45f4ae2dd395c3c3291cfb15a73970 Mon Sep 17 00:00:00 2001
From: Megha Ajmera <megha.ajmera@intel.com>
Date: Thu, 5 Jan 2023 12:28:53 +0000
Subject: [PATCH] examples/qos_sched: fix debug mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit af13b8711aa43a851d2c12e5d3f8f87dd047307e ]

This issue is happening due to non-initialization of some
fields in “rte_eth_rxconf” structure in our application.
Doing a memset to zero before initialization in HQoS application.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/qos_sched/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 0709aec10c..d28350e14a 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -79,6 +79,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 	if (app_inited_port_mask & (1u << portid))
 		return 0;

+	memset(&rx_conf, 0, sizeof(struct rte_eth_rxconf));
 	rx_conf.rx_thresh.pthresh = rx_thresh.pthresh;
 	rx_conf.rx_thresh.hthresh = rx_thresh.hthresh;
 	rx_conf.rx_thresh.wthresh = rx_thresh.wthresh;
@@ -86,6 +87,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)
 	rx_conf.rx_drop_en = 0;
 	rx_conf.rx_deferred_start = 0;

+	memset(&tx_conf, 0, sizeof(struct rte_eth_txconf));
 	tx_conf.tx_thresh.pthresh = tx_thresh.pthresh;
 	tx_conf.tx_thresh.hthresh = tx_thresh.hthresh;
 	tx_conf.tx_thresh.wthresh = tx_thresh.wthresh;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.131667400 +0800
+++ 0038-examples-qos_sched-fix-debug-mode.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From af13b8711aa43a851d2c12e5d3f8f87dd047307e Mon Sep 17 00:00:00 2001
+From cb3c0ba47e45f4ae2dd395c3c3291cfb15a73970 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit af13b8711aa43a851d2c12e5d3f8f87dd047307e ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/dumpcap: fix storing port identifier' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (35 preceding siblings ...)
  2023-02-27  6:59   ` patch 'examples/qos_sched: fix debug mode' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'build: fix dependencies lookup' " Xueming Li
                     ` (120 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ben Magistro; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 573de4f522af407466956c71c61af5418a6d6b37 Mon Sep 17 00:00:00 2001
From: Ben Magistro <koncept1@gmail.com>
Date: Tue, 3 Jan 2023 19:38:10 -0800
Subject: [PATCH] app/dumpcap: fix storing port identifier
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dbb27d6fd88ed9e8177d9e49347905dbd2bae300 ]

When dumpcap adds an interface, the port was not being preserved. This
results in the structure being initialized and the port field being set
to 0 regardless of what port was actually selected. This unset field is
then used in both the enable and cleanup calls. This could result in the
capture occurring on the wrong interface.

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

Signed-off-by: Ben Magistro <koncept1@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/dumpcap/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 2eb8414efa..4751ca26b8 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -202,6 +202,7 @@ static void add_interface(uint16_t port, const char *name)
 		rte_exit(EXIT_FAILURE, "no memory for interface\n");

 	memset(intf, 0, sizeof(*intf));
+	intf->port = port;
 	rte_strscpy(intf->name, name, sizeof(intf->name));

 	printf("Capturing on '%s'\n", name);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.171153900 +0800
+++ 0039-app-dumpcap-fix-storing-port-identifier.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From dbb27d6fd88ed9e8177d9e49347905dbd2bae300 Mon Sep 17 00:00:00 2001
+From 573de4f522af407466956c71c61af5418a6d6b37 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dbb27d6fd88ed9e8177d9e49347905dbd2bae300 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index d1c70f769b..5ccafd4c3c 100644
+index 2eb8414efa..4751ca26b8 100644
@@ -25 +27 @@
-@@ -208,6 +208,7 @@ static void add_interface(uint16_t port, const char *name)
+@@ -202,6 +202,7 @@ static void add_interface(uint16_t port, const char *name)

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

* patch 'build: fix dependencies lookup' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (36 preceding siblings ...)
  2023-02-27  6:59   ` patch 'app/dumpcap: fix storing port identifier' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vdpa/ifc: fix argument compatibility check' " Xueming Li
                     ` (119 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ab2779057ed8f8dc5bdb49b1f85a964d4b00f9e7 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Sun, 15 Jan 2023 17:53:15 +0100
Subject: [PATCH] build: fix dependencies lookup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 97cfdbfa28ae32d7667d76807233375ffd04adff ]

The first parameter of the Meson function "find_library()"
should be the library name without the "lib" prefix.

Otherwise Meson prints this warning:
	WARNING: find_library('libexecinfo') starting in "lib"
	only works by accident and is not portable

Fixes: 1cd512b2f532 ("build: detect execinfo library on Linux")
Fixes: e1defba4cf66 ("raw/ifpga/base: support device tree")
Fixes: a489f5dbf437 ("baseband/turbo_sw: support meson build")
Fixes: 72c00ae9dba7 ("regex/cn9k: use cnxk infrastructure")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build                    |  4 ++--
 drivers/baseband/turbo_sw/meson.build | 10 +++++-----
 drivers/regex/cn9k/meson.build        |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 6d9ffd4f4b..239d3ea0ec 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -191,7 +191,7 @@ if find_libnuma
 endif

 has_libfdt = 0
-fdt_dep = cc.find_library('libfdt', required: false)
+fdt_dep = cc.find_library('fdt', required: false)
 if fdt_dep.found() and cc.has_header('fdt.h')
     dpdk_conf.set10('RTE_HAS_LIBFDT', true)
     has_libfdt = 1
@@ -199,7 +199,7 @@ if fdt_dep.found() and cc.has_header('fdt.h')
     dpdk_extra_ldflags += '-lfdt'
 endif

-libexecinfo = cc.find_library('libexecinfo', required: false)
+libexecinfo = cc.find_library('execinfo', required: false)
 if libexecinfo.found() and cc.has_header('execinfo.h')
     add_project_link_arguments('-lexecinfo', language: 'c')
     dpdk_extra_ldflags += '-lexecinfo'
diff --git a/drivers/baseband/turbo_sw/meson.build b/drivers/baseband/turbo_sw/meson.build
index 417ec63394..aeb9a76f9e 100644
--- a/drivers/baseband/turbo_sw/meson.build
+++ b/drivers/baseband/turbo_sw/meson.build
@@ -6,11 +6,11 @@ dep_turbo = dependency('flexran_sdk_turbo', required: false)
 dep_dec5g = dependency('flexran_sdk_ldpc_decoder_5gnr', required: false)

 if dep_turbo.found()
-    ext_deps += cc.find_library('libstdc++', required: true)
-    ext_deps += cc.find_library('libirc', required: true)
-    ext_deps += cc.find_library('libimf', required: true)
-    ext_deps += cc.find_library('libipps', required: true)
-    ext_deps += cc.find_library('libsvml', required: true)
+    ext_deps += cc.find_library('stdc++', required: true)
+    ext_deps += cc.find_library('irc', required: true)
+    ext_deps += cc.find_library('imf', required: true)
+    ext_deps += cc.find_library('ipps', required: true)
+    ext_deps += cc.find_library('svml', required: true)
     ext_deps += dep_turbo
     ext_deps += dependency('flexran_sdk_crc', required: true)
     ext_deps += dependency('flexran_sdk_rate_matching', required: true)
diff --git a/drivers/regex/cn9k/meson.build b/drivers/regex/cn9k/meson.build
index 06c906710c..19b2e70111 100644
--- a/drivers/regex/cn9k/meson.build
+++ b/drivers/regex/cn9k/meson.build
@@ -8,10 +8,10 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif

-lib = cc.find_library('librxp_compiler', required: false)
+lib = cc.find_library('rxp_compiler', required: false)
 if lib.found()
     ext_deps += lib
-    ext_deps += cc.find_library('libstdc++', required: true)
+    ext_deps += cc.find_library('stdc++', required: true)
     cflags += ['-DREE_COMPILER_SDK']
 endif

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.200119800 +0800
+++ 0040-build-fix-dependencies-lookup.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 97cfdbfa28ae32d7667d76807233375ffd04adff Mon Sep 17 00:00:00 2001
+From ab2779057ed8f8dc5bdb49b1f85a964d4b00f9e7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 97cfdbfa28ae32d7667d76807233375ffd04adff ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index b9ec685f28..26f3168bc9 100644
+index 6d9ffd4f4b..239d3ea0ec 100644
@@ -46 +48 @@
- if libexecinfo.found()
+ if libexecinfo.found() and cc.has_header('execinfo.h')

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

* patch 'vdpa/ifc: fix argument compatibility check' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (37 preceding siblings ...)
  2023-02-27  6:59   ` patch 'build: fix dependencies lookup' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' " Xueming Li
                     ` (118 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Andy Pei; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a347909ae202aff278a619e5b692b43eb5c55d33 Mon Sep 17 00:00:00 2001
From: Andy Pei <andy.pei@intel.com>
Date: Thu, 1 Dec 2022 15:32:20 +0800
Subject: [PATCH] vdpa/ifc: fix argument compatibility check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 97d2dfc4e15caf654eb84ede24f4c1a43793e850 ]

"sw_fallback_lm=0" means driver does not provide live migration assistance.
so hardware assistance is needed to support live migration.
However registers for live migration in BAR4 are not implemented.
In the case, we just return error after display some logs.

Fixes: 4c3f55cc23ea ("net/ifc: add LM mode parameter")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 49d68ad1b1..9468f66638 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1746,6 +1746,11 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			goto error;
 	}
 	internal->sw_lm = sw_fallback_lm;
+	if (!internal->sw_lm && !internal->hw.lm_cfg) {
+		DRV_LOG(ERR, "Device %s does not support HW assist live migration, please enable sw-live-migration!",
+			pci_dev->name);
+		goto error;
+	}

 	pthread_mutex_lock(&internal_list_lock);
 	TAILQ_INSERT_TAIL(&internal_list, list, next);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.230197000 +0800
+++ 0041-vdpa-ifc-fix-argument-compatibility-check.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From 97d2dfc4e15caf654eb84ede24f4c1a43793e850 Mon Sep 17 00:00:00 2001
+From a347909ae202aff278a619e5b692b43eb5c55d33 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 97d2dfc4e15caf654eb84ede24f4c1a43793e850 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (38 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vdpa/ifc: fix argument compatibility check' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vhost: fix net header settings in datapath' " Xueming Li
                     ` (117 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Andy Pei; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 72820dd60fcdd138a2aa7e66181b8a8e7c6e32a7 Mon Sep 17 00:00:00 2001
From: Andy Pei <andy.pei@intel.com>
Date: Mon, 12 Dec 2022 15:12:45 +0800
Subject: [PATCH] vdpa/ifc: fix reconnection in SW-assisted live migration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ef3be7e237dd707f46870b09b93f88f8ee5e75c6 ]

In the case using argument "sw-live-migration=1" to enable SW assisted live
migration, we take QEMU as front end for example, after source VM migrates
to destination VM, we keep vdpa process for source VM there, we kill the
QEMU process for source VM, and restart the QEMU process for source VM.
In this case, vdpa driver will not perform DMA map and data path will not
work properly.

The above case works fine in the case "sw-live-migration=0".

The root cause is that current code driver does not set running flag to 0.
Driver treats device as ruuning and does not perform DMA map.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 9468f66638..35520ea3ae 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1044,6 +1044,8 @@ ifcvf_sw_fallback_switchover(struct ifcvf_internal *internal)

 	vdpa_disable_vfio_intr(internal);

+	rte_atomic32_set(&internal->running, 0);
+
 	ret = rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, false);
 	if (ret && ret != -ENOTSUP)
 		goto error;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.257545900 +0800
+++ 0042-vdpa-ifc-fix-reconnection-in-SW-assisted-live-migrat.patch	2023-02-27 14:08:40.749237000 +0800
@@ -1 +1 @@
-From ef3be7e237dd707f46870b09b93f88f8ee5e75c6 Mon Sep 17 00:00:00 2001
+From 72820dd60fcdd138a2aa7e66181b8a8e7c6e32a7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ef3be7e237dd707f46870b09b93f88f8ee5e75c6 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org

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

* patch 'vhost: fix net header settings in datapath' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (39 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'app/bbdev: fix build with optional flag' " Xueming Li
                     ` (116 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Wenwu Ma; +Cc: Wei Ling, Cheng Jiang, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From be1187e1a647c69e887cb08e65dbd4c38c57d3fb Mon Sep 17 00:00:00 2001
From: Wenwu Ma <wenwux.ma@intel.com>
Date: Wed, 4 Jan 2023 10:39:45 +0800
Subject: [PATCH] vhost: fix net header settings in datapath
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b9c1ec8577936419c8801dfad61e848b3535295f ]

In vhost sync batch enqueue, the "num_buffers" of
virtio net header is not be set, but it should be
set to 1 if the mrg_rxbuf feature is turned on,
This patch fix the issue.

Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Acked-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/virtio_net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index 9abf752f30..a3dbf8cb10 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1453,6 +1453,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
 			sizeof(struct virtio_net_hdr_mrg_rxbuf);
 	}

+	if (rxvq_is_mergeable(dev)) {
+		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
+			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
+		}
+	}
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.287661700 +0800
+++ 0043-vhost-fix-net-header-settings-in-datapath.patch	2023-02-27 14:08:40.759237000 +0800
@@ -1 +1 @@
-From b9c1ec8577936419c8801dfad61e848b3535295f Mon Sep 17 00:00:00 2001
+From be1187e1a647c69e887cb08e65dbd4c38c57d3fb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b9c1ec8577936419c8801dfad61e848b3535295f ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/bbdev: fix build with optional flag' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (40 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vhost: fix net header settings in datapath' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` Xueming Li
                     ` (115 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1e82bbe91de0797bfa124299cb47c8a034c53d93 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Tue, 13 Dec 2022 08:18:53 -0800
Subject: [PATCH] app/bbdev: fix build with optional flag
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1228c85649353bcc390dde5b4eed2cf12377eff4 ]

Incorrect bbdev member name used in test code under
RTE_BBDEV_OFFLOAD_COST build flag.

Fixes: 4f08028c5e24 ("bbdev: expose queue related warning and status")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index b285d3f3a7..1859952901 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4933,8 +4933,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id,
 	stats->dequeued_count = q_stats->dequeued_count;
 	stats->enqueue_err_count = q_stats->enqueue_err_count;
 	stats->dequeue_err_count = q_stats->dequeue_err_count;
-	stats->enqueue_warning_count = q_stats->enqueue_warning_count;
-	stats->dequeue_warning_count = q_stats->dequeue_warning_count;
+	stats->enqueue_warn_count = q_stats->enqueue_warn_count;
+	stats->dequeue_warn_count = q_stats->dequeue_warn_count;
 	stats->acc_offload_cycles = q_stats->acc_offload_cycles;

 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.317413200 +0800
+++ 0044-app-bbdev-fix-build-with-optional-flag.patch	2023-02-27 14:08:40.759237000 +0800
@@ -1 +1 @@
-From 1228c85649353bcc390dde5b4eed2cf12377eff4 Mon Sep 17 00:00:00 2001
+From 1e82bbe91de0797bfa124299cb47c8a034c53d93 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1228c85649353bcc390dde5b4eed2cf12377eff4 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/bbdev: fix build with optional flag' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (41 preceding siblings ...)
  2023-02-27  6:59   ` patch 'app/bbdev: fix build with optional flag' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'app/bbdev: add allocation checks' " Xueming Li
                     ` (114 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9f13ab03f61e31a991801ad82f28a03bfde08e7a Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Tue, 13 Dec 2022 08:18:54 -0800
Subject: [PATCH] app/bbdev: fix build with optional flag
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4a07b2311d853c39b3645fa07c24f2535d73a065 ]

Missing implementation for offload test with FFT.
Only build when the optional build flag RTE_BBDEV_OFFLOAD_COST
is set.

Fixes: 0acdb9866756 ("test/bbdev: add FFT operations cases")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 81 ++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 1859952901..90eff6364e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4940,6 +4940,87 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id,
 	return 0;
 }

+static int
+offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs,
+		struct rte_bbdev_fft_op *ref_op, uint16_t dev_id,
+		uint16_t queue_id, const uint16_t num_to_process,
+		uint16_t burst_sz, struct test_time_stats *time_st)
+{
+	int i, dequeued, ret;
+	struct rte_bbdev_fft_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];
+	uint64_t enq_start_time, deq_start_time;
+	uint64_t enq_sw_last_time, deq_last_time;
+	struct rte_bbdev_stats stats;
+
+	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
+		uint16_t enq = 0, deq = 0;
+
+		if (unlikely(num_to_process - dequeued < burst_sz))
+			burst_sz = num_to_process - dequeued;
+
+		rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
+			copy_reference_fft_op(ops_enq, burst_sz, dequeued,
+					bufs->inputs,
+					bufs->hard_outputs, bufs->soft_outputs,
+					ref_op);
+
+		/* Start time meas for enqueue function offload latency */
+		enq_start_time = rte_rdtsc_precise();
+		do {
+			enq += rte_bbdev_enqueue_fft_ops(dev_id, queue_id,
+					&ops_enq[enq], burst_sz - enq);
+		} while (unlikely(burst_sz != enq));
+
+		ret = get_bbdev_queue_stats(dev_id, queue_id, &stats);
+		TEST_ASSERT_SUCCESS(ret,
+				"Failed to get stats for queue (%u) of device (%u)",
+				queue_id, dev_id);
+
+		enq_sw_last_time = rte_rdtsc_precise() - enq_start_time -
+				stats.acc_offload_cycles;
+		time_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time,
+				enq_sw_last_time);
+		time_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time,
+				enq_sw_last_time);
+		time_st->enq_sw_total_time += enq_sw_last_time;
+
+		time_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time,
+				stats.acc_offload_cycles);
+		time_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time,
+				stats.acc_offload_cycles);
+		time_st->enq_acc_total_time += stats.acc_offload_cycles;
+
+		/* give time for device to process ops */
+		rte_delay_us(WAIT_OFFLOAD_US);
+
+		/* Start time meas for dequeue function offload latency */
+		deq_start_time = rte_rdtsc_precise();
+		/* Dequeue one operation */
+		do {
+			deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id,
+					&ops_deq[deq], enq);
+		} while (unlikely(deq == 0));
+
+		deq_last_time = rte_rdtsc_precise() - deq_start_time;
+		time_st->deq_max_time = RTE_MAX(time_st->deq_max_time,
+				deq_last_time);
+		time_st->deq_min_time = RTE_MIN(time_st->deq_min_time,
+				deq_last_time);
+		time_st->deq_total_time += deq_last_time;
+
+		/* Dequeue remaining operations if needed*/
+		while (burst_sz != deq)
+			deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id,
+					&ops_deq[deq], burst_sz - deq);
+
+		rte_bbdev_fft_op_free_bulk(ops_enq, deq);
+		dequeued += deq;
+	}
+
+	return i;
+}
+
 static int
 offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
 		struct rte_bbdev_dec_op *ref_op, uint16_t dev_id,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.350194900 +0800
+++ 0045-app-bbdev-fix-build-with-optional-flag.patch	2023-02-27 14:08:40.759237000 +0800
@@ -1 +1 @@
-From 4a07b2311d853c39b3645fa07c24f2535d73a065 Mon Sep 17 00:00:00 2001
+From 9f13ab03f61e31a991801ad82f28a03bfde08e7a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4a07b2311d853c39b3645fa07c24f2535d73a065 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/bbdev: add allocation checks' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (42 preceding siblings ...)
  2023-02-27  6:59   ` Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'baseband/acc: fix memory leak on acc100 close' " Xueming Li
                     ` (113 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e44360ae858a4f5b947abe96f66ba98cc324f287 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Tue, 13 Dec 2022 08:18:55 -0800
Subject: [PATCH] app/bbdev: add allocation checks
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 ]

Adding check for error on return of the
rte_bbdev_*_op_alloc_bulk calls in bbdev-test.

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 90eff6364e..e001074861 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;

-		rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_fft_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -5039,7 +5040,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;

-		rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -5124,7 +5126,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool,
 		if (unlikely(num_to_process - dequeued < burst_sz))
 			burst_sz = num_to_process - dequeued;

-		rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
+		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.381913400 +0800
+++ 0046-app-bbdev-add-allocation-checks.patch	2023-02-27 14:08:40.759237000 +0800
@@ -1 +1 @@
-From 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 Mon Sep 17 00:00:00 2001
+From e44360ae858a4f5b947abe96f66ba98cc324f287 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8abe31b1d9d9448ab4ab1d98a22314a2fa9fbfc6 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'baseband/acc: fix memory leak on acc100 close' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (43 preceding siblings ...)
  2023-02-27  6:59   ` patch 'app/bbdev: add allocation checks' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 iteration counter in TB' " Xueming Li
                     ` (112 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f770622597b0ea82fd76d58c1225115219eb25e4 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:03 -0800
Subject: [PATCH] baseband/acc: fix memory leak on acc100 close
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1bc7f26ebd45da2ab2740a00c991100dc8f0037d ]

Explicitly call rte_free for harq_layout pointer in dev_close function
to prevent memory leak.

Fixes: ba2262fe16c ("baseband/acc100: fix close cleanup")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc100_pmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index ba8247d47e..0177a9e0ea 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -622,6 +622,7 @@ acc100_dev_close(struct rte_bbdev *dev)
 		rte_free(d->tail_ptrs);
 		rte_free(d->info_ring);
 		rte_free(d->sw_rings_base);
+		rte_free(d->harq_layout);
 		d->sw_rings_base = NULL;
 		d->tail_ptrs = NULL;
 		d->info_ring = NULL;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.416533800 +0800
+++ 0047-baseband-acc-fix-memory-leak-on-acc100-close.patch	2023-02-27 14:08:40.759237000 +0800
@@ -1 +1 @@
-From 1bc7f26ebd45da2ab2740a00c991100dc8f0037d Mon Sep 17 00:00:00 2001
+From f770622597b0ea82fd76d58c1225115219eb25e4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1bc7f26ebd45da2ab2740a00c991100dc8f0037d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index b3164529dd..146a22bd64 100644
+index ba8247d47e..0177a9e0ea 100644
@@ -22 +24 @@
-@@ -620,6 +620,7 @@ acc100_dev_close(struct rte_bbdev *dev)
+@@ -622,6 +622,7 @@ acc100_dev_close(struct rte_bbdev *dev)

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

* patch 'baseband/acc: fix acc100 iteration counter in TB' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (44 preceding siblings ...)
  2023-02-27  6:59   ` patch 'baseband/acc: fix memory leak on acc100 close' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'baseband/acc: fix multiplexing acc100 operations' " Xueming Li
                     ` (111 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3c330a28d7af148967b1932b4004c45359cd805c Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:04 -0800
Subject: [PATCH] baseband/acc: fix acc100 iteration counter in TB
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 12f2bce128a1766765619357f707430c506c7bc6 ]

Use ldpc or turbo iteration counter based on the operation type.

Fixes: 5ad5060f8f7 ("baseband/acc100: add LDPC processing functions")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc100_pmd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 0177a9e0ea..d77d3b77b5 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -4035,8 +4035,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
 		/* CRC invalid if error exists */
 		if (!op->status)
 			op->status |= rsp.crc_status << RTE_BBDEV_CRC_ERROR;
-		op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
-				op->turbo_dec.iter_count);
+		if (q->op_type == RTE_BBDEV_OP_LDPC_DEC)
+			op->ldpc_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->ldpc_dec.iter_count);
+		else
+			op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->turbo_dec.iter_count);

 		/* Check if this is the last desc in batch (Atomic Queue) */
 		if (desc->req.last_desc_in_batch) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.449052700 +0800
+++ 0048-baseband-acc-fix-acc100-iteration-counter-in-TB.patch	2023-02-27 14:08:40.769237000 +0800
@@ -1 +1 @@
-From 12f2bce128a1766765619357f707430c506c7bc6 Mon Sep 17 00:00:00 2001
+From 3c330a28d7af148967b1932b4004c45359cd805c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 12f2bce128a1766765619357f707430c506c7bc6 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 146a22bd64..a00314c957 100644
+index 0177a9e0ea..d77d3b77b5 100644
@@ -21 +23 @@
-@@ -4033,8 +4033,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
+@@ -4035,8 +4035,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,

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

* patch 'baseband/acc: fix multiplexing acc100 operations' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (45 preceding siblings ...)
  2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 iteration counter in TB' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 queue mapping to 64 bits' " Xueming Li
                     ` (110 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8f06dfc3818e7b8bba79520d8bfdf495c6b2ecbb Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:05 -0800
Subject: [PATCH] baseband/acc: fix multiplexing acc100 operations
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9b81119311f7372f230d3dbb7bfa45f9053de2dd ]

Function to check if multiplexing is possible for multiple operations in
one descriptor returns number of enqueued ops.

Fixes: 32e8b7ea35d ("baseband/acc100: refactor to segregate common code")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc100_pmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index d77d3b77b5..2f65f290b5 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -3423,9 +3423,9 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,
 		}
 		avail--;
 		enq = RTE_MIN(left, ACC_MUX_5GDL_DESC);
-		if (check_mux(&ops[i], enq)) {
-			ret = enqueue_ldpc_enc_n_op_cb(q, &ops[i],
-					desc_idx, enq);
+		enq = check_mux(&ops[i], enq);
+		if (enq > 1) {
+			ret = enqueue_ldpc_enc_n_op_cb(q, &ops[i], desc_idx, enq);
 			if (ret < 0) {
 				acc_enqueue_invalid(q_data);
 				break;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.485999300 +0800
+++ 0049-baseband-acc-fix-multiplexing-acc100-operations.patch	2023-02-27 14:08:40.769237000 +0800
@@ -1 +1 @@
-From 9b81119311f7372f230d3dbb7bfa45f9053de2dd Mon Sep 17 00:00:00 2001
+From 8f06dfc3818e7b8bba79520d8bfdf495c6b2ecbb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9b81119311f7372f230d3dbb7bfa45f9053de2dd ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index a00314c957..eb18cc2215 100644
+index d77d3b77b5..2f65f290b5 100644
@@ -22 +24 @@
-@@ -3421,9 +3421,9 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,
+@@ -3423,9 +3423,9 @@ acc100_enqueue_ldpc_enc_cb(struct rte_bbdev_queue_data *q_data,

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

* patch 'baseband/acc: fix acc100 queue mapping to 64 bits' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (46 preceding siblings ...)
  2023-02-27  6:59   ` patch 'baseband/acc: fix multiplexing acc100 operations' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/ccp: remove some printf' " Xueming Li
                     ` (109 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f3d0a011e32075f67f563d2bc5b9a28ec5ca35c0 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 12 Jan 2023 11:36:06 -0800
Subject: [PATCH] baseband/acc: fix acc100 queue mapping to 64 bits
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 94e3adfcf2784749289496e0a797576296f103fd ]

Fix potential overflow for Q mapping extension to 64 bits.

Fixes: 32e8b7ea35d ("baseband/acc100: refactor to segregate common code")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc100_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 2f65f290b5..1ca95f4440 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -664,7 +664,7 @@ acc100_find_free_queue_idx(struct rte_bbdev *dev,
 	for (aq_idx = 0; aq_idx < qtop->num_aqs_per_groups; aq_idx++) {
 		if (((d->q_assigned_bit_map[group_idx] >> aq_idx) & 0x1) == 0) {
 			/* Mark the Queue as assigned */
-			d->q_assigned_bit_map[group_idx] |= (1 << aq_idx);
+			d->q_assigned_bit_map[group_idx] |= (1ULL << aq_idx);
 			/* Report the AQ Index */
 			return (group_idx << ACC100_GRP_ID_SHIFT) + aq_idx;
 		}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.521529700 +0800
+++ 0050-baseband-acc-fix-acc100-queue-mapping-to-64-bits.patch	2023-02-27 14:08:40.769237000 +0800
@@ -1 +1 @@
-From 94e3adfcf2784749289496e0a797576296f103fd Mon Sep 17 00:00:00 2001
+From f3d0a011e32075f67f563d2bc5b9a28ec5ca35c0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 94e3adfcf2784749289496e0a797576296f103fd ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index eb18cc2215..3660d3b240 100644
+index 2f65f290b5..1ca95f4440 100644
@@ -21 +23 @@
-@@ -662,7 +662,7 @@ acc100_find_free_queue_idx(struct rte_bbdev *dev,
+@@ -664,7 +664,7 @@ acc100_find_free_queue_idx(struct rte_bbdev *dev,

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

* patch 'crypto/ccp: remove some printf' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (47 preceding siblings ...)
  2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 queue mapping to 64 bits' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/ccp: remove some dead code for UIO' " Xueming Li
                     ` (108 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Sunil Uttarwar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4e76b627566902b8b8667e52cac950ad34eb7f22 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 4 Oct 2022 11:51:29 +0200
Subject: [PATCH] crypto/ccp: remove some printf
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e946ca8e727424b511fe4ea278d8bec76b800e7a ]

A DPDK application must _not_ use printf.
Use log framework.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com>
---
 drivers/crypto/ccp/ccp_dev.c     | 4 ++--
 drivers/crypto/ccp/ccp_pci.c     | 3 ++-
 drivers/crypto/ccp/rte_ccp_pmd.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 424ead82c3..9c9cb81236 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -362,7 +362,7 @@ ccp_find_lsb_regions(struct ccp_queue *cmd_q, uint64_t status)
 		if (ccp_get_bit(&cmd_q->lsbmask, j))
 			weight++;

-	printf("Queue %d can access %d LSB regions  of mask  %lu\n",
+	CCP_LOG_DBG("Queue %d can access %d LSB regions  of mask  %lu\n",
 	       (int)cmd_q->id, weight, cmd_q->lsbmask);

 	return weight ? 0 : -EINVAL;
@@ -709,7 +709,7 @@ ccp_probe_devices(struct rte_pci_device *pci_dev,
 		snprintf(dirname, sizeof(dirname), "%s/%s",
 			     SYSFS_PCI_DEVICES, d->d_name);
 		if (is_ccp_device(dirname, ccp_id, &ccp_type)) {
-			printf("CCP : Detected CCP device with ID = 0x%x\n",
+			CCP_LOG_DBG("CCP : Detected CCP device with ID = 0x%x\n",
 			       ccp_id[ccp_type].device_id);
 			ret = ccp_probe_device(ccp_type, pci_dev);
 			if (ret == 0)
diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c
index 38029a9081..c941e222c7 100644
--- a/drivers/crypto/ccp/ccp_pci.c
+++ b/drivers/crypto/ccp/ccp_pci.c
@@ -11,6 +11,7 @@
 #include <rte_string_fns.h>

 #include "ccp_pci.h"
+#include "ccp_pmd_private.h"

 static const char * const uio_module_names[] = {
 	"igb_uio",
@@ -41,7 +42,7 @@ ccp_check_pci_uio_module(void)
 		rewind(fp);
 	}
 	fclose(fp);
-	printf("Insert igb_uio or uio_pci_generic kernel module(s)");
+	CCP_LOG_DBG("Insert igb_uio or uio_pci_generic kernel module(s)");
 	return -1;/* uio not inserted */
 }

diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index 221a0a5235..bcb621234c 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -237,7 +237,7 @@ cryptodev_ccp_create(const char *name,
 		goto init_error;
 	}

-	printf("CCP : Crypto device count = %d\n", cryptodev_cnt);
+	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
 	dev->device = &pci_dev->device;
 	dev->device->driver = &pci_drv->driver;
 	dev->driver_id = ccp_cryptodev_driver_id;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.556945200 +0800
+++ 0051-crypto-ccp-remove-some-printf.patch	2023-02-27 14:08:40.769237000 +0800
@@ -1 +1 @@
-From e946ca8e727424b511fe4ea278d8bec76b800e7a Mon Sep 17 00:00:00 2001
+From 4e76b627566902b8b8667e52cac950ad34eb7f22 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e946ca8e727424b511fe4ea278d8bec76b800e7a ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/ccp: remove some dead code for UIO' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (48 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/ccp: remove some printf' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/ccp: fix IOVA handling' " Xueming Li
                     ` (107 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Sunil Uttarwar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f11d779c24e7923f868f19c63b0e18f527210c47 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 4 Oct 2022 11:51:30 +0200
Subject: [PATCH] crypto/ccp: remove some dead code for UIO
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b211d968f77097c868eb963a7de11b1a244b1a65 ]

uio_fd is unused.

Fixes: 09a0fd736a08 ("crypto/ccp: enable IOMMU")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com>
---
 drivers/crypto/ccp/ccp_dev.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 9c9cb81236..410e62121e 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -653,7 +653,6 @@ static int
 ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
 {
 	struct ccp_device *ccp_dev = NULL;
-	int uio_fd = -1;

 	ccp_dev = rte_zmalloc("ccp_device", sizeof(*ccp_dev),
 			      RTE_CACHE_LINE_SIZE);
@@ -671,8 +670,6 @@ ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
 	return 0;
 fail:
 	CCP_LOG_ERR("CCP Device probe failed");
-	if (uio_fd >= 0)
-		close(uio_fd);
 	rte_free(ccp_dev);
 	return -1;
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.586610000 +0800
+++ 0052-crypto-ccp-remove-some-dead-code-for-UIO.patch	2023-02-27 14:08:40.769237000 +0800
@@ -1 +1 @@
-From b211d968f77097c868eb963a7de11b1a244b1a65 Mon Sep 17 00:00:00 2001
+From f11d779c24e7923f868f19c63b0e18f527210c47 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b211d968f77097c868eb963a7de11b1a244b1a65 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/ccp: fix IOVA handling' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (49 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/ccp: remove some dead code for UIO' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/openssl: fix warning on copy length' " Xueming Li
                     ` (106 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Sunil Uttarwar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2d28201221df4758ab2c2124c07a3d935bd4999b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 4 Oct 2022 11:51:31 +0200
Subject: [PATCH] crypto/ccp: fix IOVA handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9631fb8f10dfafb0547fbf9127b162e62b2bef43 ]

Using IOVA or physical addresses is something that the user (via
--iova-mode=) or the bus code decides.

The crypto/ccp PCI driver should only use rte_mem_virt2iova.
It should not try to decide what to use solely based on the kmod
the PCI device is bound to.

While at it, the global variable sha_ctx looks unsafe and unneeded.
Remove it.

Fixes: 09a0fd736a08 ("crypto/ccp: enable IOMMU")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com>
---
 drivers/crypto/ccp/ccp_crypto.c  | 105 ++++++-------------------------
 drivers/crypto/ccp/ccp_dev.c     |   9 +--
 drivers/crypto/ccp/ccp_pci.c     |  34 ----------
 drivers/crypto/ccp/ccp_pci.h     |   3 -
 drivers/crypto/ccp/rte_ccp_pmd.c |   3 -
 5 files changed, 19 insertions(+), 135 deletions(-)

diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index b21b32e507..2758187d93 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -33,8 +33,6 @@
 #include <openssl/err.h>
 #include <openssl/hmac.h>

-extern int iommu_mode;
-void *sha_ctx;
 /* SHA initial context values */
 uint32_t ccp_sha1_init[SHA_COMMON_DIGEST_SIZE / sizeof(uint32_t)] = {
 	SHA1_H4, SHA1_H3,
@@ -748,13 +746,8 @@ ccp_configure_session_cipher(struct ccp_session *sess,
 		CCP_LOG_ERR("Invalid CCP Engine");
 		return -ENOTSUP;
 	}
-	if (iommu_mode == 2) {
-		sess->cipher.nonce_phys = rte_mem_virt2iova(sess->cipher.nonce);
-		sess->cipher.key_phys = rte_mem_virt2iova(sess->cipher.key_ccp);
-	} else {
-		sess->cipher.nonce_phys = rte_mem_virt2phy(sess->cipher.nonce);
-		sess->cipher.key_phys = rte_mem_virt2phy(sess->cipher.key_ccp);
-	}
+	sess->cipher.nonce_phys = rte_mem_virt2iova(sess->cipher.nonce);
+	sess->cipher.key_phys = rte_mem_virt2iova(sess->cipher.key_ccp);
 	return 0;
 }

@@ -793,7 +786,6 @@ ccp_configure_session_auth(struct ccp_session *sess,
 		sess->auth.ctx = (void *)ccp_sha1_init;
 		sess->auth.ctx_len = CCP_SB_BYTES;
 		sess->auth.offset = CCP_SB_BYTES - SHA1_DIGEST_SIZE;
-		rte_memcpy(sha_ctx, sess->auth.ctx, SHA_COMMON_DIGEST_SIZE);
 		break;
 	case RTE_CRYPTO_AUTH_SHA1_HMAC:
 		if (sess->auth_opt) {
@@ -832,7 +824,6 @@ ccp_configure_session_auth(struct ccp_session *sess,
 		sess->auth.ctx = (void *)ccp_sha224_init;
 		sess->auth.ctx_len = CCP_SB_BYTES;
 		sess->auth.offset = CCP_SB_BYTES - SHA224_DIGEST_SIZE;
-		rte_memcpy(sha_ctx, sess->auth.ctx, SHA256_DIGEST_SIZE);
 		break;
 	case RTE_CRYPTO_AUTH_SHA224_HMAC:
 		if (sess->auth_opt) {
@@ -895,7 +886,6 @@ ccp_configure_session_auth(struct ccp_session *sess,
 		sess->auth.ctx = (void *)ccp_sha256_init;
 		sess->auth.ctx_len = CCP_SB_BYTES;
 		sess->auth.offset = CCP_SB_BYTES - SHA256_DIGEST_SIZE;
-		rte_memcpy(sha_ctx, sess->auth.ctx, SHA256_DIGEST_SIZE);
 		break;
 	case RTE_CRYPTO_AUTH_SHA256_HMAC:
 		if (sess->auth_opt) {
@@ -958,7 +948,6 @@ ccp_configure_session_auth(struct ccp_session *sess,
 		sess->auth.ctx = (void *)ccp_sha384_init;
 		sess->auth.ctx_len = CCP_SB_BYTES << 1;
 		sess->auth.offset = (CCP_SB_BYTES << 1) - SHA384_DIGEST_SIZE;
-		rte_memcpy(sha_ctx, sess->auth.ctx, SHA512_DIGEST_SIZE);
 		break;
 	case RTE_CRYPTO_AUTH_SHA384_HMAC:
 		if (sess->auth_opt) {
@@ -1023,7 +1012,6 @@ ccp_configure_session_auth(struct ccp_session *sess,
 		sess->auth.ctx = (void *)ccp_sha512_init;
 		sess->auth.ctx_len = CCP_SB_BYTES << 1;
 		sess->auth.offset = (CCP_SB_BYTES << 1) - SHA512_DIGEST_SIZE;
-		rte_memcpy(sha_ctx, sess->auth.ctx, SHA512_DIGEST_SIZE);
 		break;
 	case RTE_CRYPTO_AUTH_SHA512_HMAC:
 		if (sess->auth_opt) {
@@ -1173,13 +1161,8 @@ ccp_configure_session_aead(struct ccp_session *sess,
 		CCP_LOG_ERR("Unsupported aead algo");
 		return -ENOTSUP;
 	}
-	if (iommu_mode == 2) {
-		sess->cipher.nonce_phys = rte_mem_virt2iova(sess->cipher.nonce);
-		sess->cipher.key_phys = rte_mem_virt2iova(sess->cipher.key_ccp);
-	} else {
-		sess->cipher.nonce_phys = rte_mem_virt2phy(sess->cipher.nonce);
-		sess->cipher.key_phys = rte_mem_virt2phy(sess->cipher.key_ccp);
-	}
+	sess->cipher.nonce_phys = rte_mem_virt2iova(sess->cipher.nonce);
+	sess->cipher.key_phys = rte_mem_virt2iova(sess->cipher.key_ccp);
 	return 0;
 }

@@ -1592,14 +1575,8 @@ ccp_perform_hmac(struct rte_crypto_op *op,
 					      op->sym->auth.data.offset);
 	append_ptr = (void *)rte_pktmbuf_append(op->sym->m_src,
 						session->auth.ctx_len);
-	if (iommu_mode == 2) {
-		dest_addr = (phys_addr_t)rte_mem_virt2iova(append_ptr);
-		pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)addr);
-	} else {
-		dest_addr = (phys_addr_t)rte_mem_virt2phy(append_ptr);
-		pst.src_addr = (phys_addr_t)rte_mem_virt2phy((void *)addr);
-	}
-	dest_addr_t = dest_addr;
+	dest_addr_t = dest_addr = (phys_addr_t)rte_mem_virt2iova(append_ptr);
+	pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)addr);

 	/** Load PHash1 to LSB*/
 	pst.dest_addr = (phys_addr_t)(cmd_q->sb_sha * CCP_SB_BYTES);
@@ -1681,10 +1658,7 @@ ccp_perform_hmac(struct rte_crypto_op *op,

 	/** Load PHash2 to LSB*/
 	addr += session->auth.ctx_len;
-	if (iommu_mode == 2)
-		pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)addr);
-	else
-		pst.src_addr = (phys_addr_t)rte_mem_virt2phy((void *)addr);
+	pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)addr);
 	pst.dest_addr = (phys_addr_t)(cmd_q->sb_sha * CCP_SB_BYTES);
 	pst.len = session->auth.ctx_len;
 	pst.dir = 1;
@@ -1770,14 +1744,8 @@ ccp_perform_sha(struct rte_crypto_op *op,
 					      op->sym->auth.data.offset);
 	append_ptr = (void *)rte_pktmbuf_append(op->sym->m_src,
 						session->auth.ctx_len);
-	if (iommu_mode == 2) {
-		dest_addr = (phys_addr_t)rte_mem_virt2iova(append_ptr);
-		pst.src_addr = (phys_addr_t)sha_ctx;
-	} else {
-		dest_addr = (phys_addr_t)rte_mem_virt2phy(append_ptr);
-		pst.src_addr = (phys_addr_t)rte_mem_virt2phy((void *)
-						     session->auth.ctx);
-	}
+	pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)session->auth.ctx);
+	dest_addr = (phys_addr_t)rte_mem_virt2iova(append_ptr);

 	/** Passthru sha context*/

@@ -1865,15 +1833,8 @@ ccp_perform_sha3_hmac(struct rte_crypto_op *op,
 		CCP_LOG_ERR("CCP MBUF append failed\n");
 		return -1;
 	}
-	if (iommu_mode == 2) {
-		dest_addr = (phys_addr_t)rte_mem_virt2iova((void *)append_ptr);
-		ctx_paddr = (phys_addr_t)rte_mem_virt2iova(
-					session->auth.pre_compute);
-	} else {
-		dest_addr = (phys_addr_t)rte_mem_virt2phy((void *)append_ptr);
-		ctx_paddr = (phys_addr_t)rte_mem_virt2phy(
-					session->auth.pre_compute);
-	}
+	dest_addr = (phys_addr_t)rte_mem_virt2iova((void *)append_ptr);
+	ctx_paddr = (phys_addr_t)rte_mem_virt2iova(session->auth.pre_compute);
 	dest_addr_t = dest_addr + (session->auth.ctx_len / 2);
 	desc = &cmd_q->qbase_desc[cmd_q->qidx];
 	memset(desc, 0, Q_DESC_SIZE);
@@ -2009,13 +1970,8 @@ ccp_perform_sha3(struct rte_crypto_op *op,
 		CCP_LOG_ERR("CCP MBUF append failed\n");
 		return -1;
 	}
-	if (iommu_mode == 2) {
-		dest_addr = (phys_addr_t)rte_mem_virt2iova((void *)append_ptr);
-		ctx_paddr = (phys_addr_t)rte_mem_virt2iova((void *)ctx_addr);
-	} else {
-		dest_addr = (phys_addr_t)rte_mem_virt2phy((void *)append_ptr);
-		ctx_paddr = (phys_addr_t)rte_mem_virt2phy((void *)ctx_addr);
-	}
+	dest_addr = (phys_addr_t)rte_mem_virt2iova((void *)append_ptr);
+	ctx_paddr = (phys_addr_t)rte_mem_virt2iova((void *)ctx_addr);

 	ctx_addr = session->auth.sha3_ctx;

@@ -2089,13 +2045,7 @@ ccp_perform_aes_cmac(struct rte_crypto_op *op,

 		ctx_addr = session->auth.pre_compute;
 		memset(ctx_addr, 0, AES_BLOCK_SIZE);
-		if (iommu_mode == 2)
-			pst.src_addr = (phys_addr_t)rte_mem_virt2iova(
-							(void *)ctx_addr);
-		else
-			pst.src_addr = (phys_addr_t)rte_mem_virt2phy(
-							(void *)ctx_addr);
-
+		pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)ctx_addr);
 		pst.dest_addr = (phys_addr_t)(cmd_q->sb_iv * CCP_SB_BYTES);
 		pst.len = CCP_SB_BYTES;
 		pst.dir = 1;
@@ -2133,12 +2083,7 @@ ccp_perform_aes_cmac(struct rte_crypto_op *op,
 	} else {
 		ctx_addr = session->auth.pre_compute + CCP_SB_BYTES;
 		memset(ctx_addr, 0, AES_BLOCK_SIZE);
-		if (iommu_mode == 2)
-			pst.src_addr = (phys_addr_t)rte_mem_virt2iova(
-							(void *)ctx_addr);
-		else
-			pst.src_addr = (phys_addr_t)rte_mem_virt2phy(
-							(void *)ctx_addr);
+		pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *)ctx_addr);
 		pst.dest_addr = (phys_addr_t)(cmd_q->sb_iv * CCP_SB_BYTES);
 		pst.len = CCP_SB_BYTES;
 		pst.dir = 1;
@@ -2328,12 +2273,7 @@ ccp_perform_3des(struct rte_crypto_op *op,

 		rte_memcpy(lsb_buf + (CCP_SB_BYTES - session->iv.length),
 			   iv, session->iv.length);
-		if (iommu_mode == 2)
-			pst.src_addr = (phys_addr_t)rte_mem_virt2iova(
-							(void *) lsb_buf);
-		else
-			pst.src_addr = (phys_addr_t)rte_mem_virt2phy(
-							(void *) lsb_buf);
+		pst.src_addr = (phys_addr_t)rte_mem_virt2iova((void *) lsb_buf);
 		pst.dest_addr = (phys_addr_t)(cmd_q->sb_iv * CCP_SB_BYTES);
 		pst.len = CCP_SB_BYTES;
 		pst.dir = 1;
@@ -2356,11 +2296,7 @@ ccp_perform_3des(struct rte_crypto_op *op,
 	else
 		dest_addr = src_addr;

-	if (iommu_mode == 2)
-		key_addr = rte_mem_virt2iova(session->cipher.key_ccp);
-	else
-		key_addr = rte_mem_virt2phy(session->cipher.key_ccp);
-
+	key_addr = rte_mem_virt2iova(session->cipher.key_ccp);
 	desc = &cmd_q->qbase_desc[cmd_q->qidx];

 	memset(desc, 0, Q_DESC_SIZE);
@@ -2746,12 +2682,7 @@ process_ops_to_enqueue(struct ccp_qp *qp,
 	b_info->lsb_buf_idx = 0;
 	b_info->desccnt = 0;
 	b_info->cmd_q = cmd_q;
-	if (iommu_mode == 2)
-		b_info->lsb_buf_phys =
-			(phys_addr_t)rte_mem_virt2iova((void *)b_info->lsb_buf);
-	else
-		b_info->lsb_buf_phys =
-			(phys_addr_t)rte_mem_virt2phy((void *)b_info->lsb_buf);
+	b_info->lsb_buf_phys = (phys_addr_t)rte_mem_virt2iova((void *)b_info->lsb_buf);

 	rte_atomic64_sub(&b_info->cmd_q->free_slots, slots_req);

diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 410e62121e..14c54929c4 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -23,7 +23,6 @@
 #include "ccp_pci.h"
 #include "ccp_pmd_private.h"

-int iommu_mode;
 struct ccp_list ccp_list = TAILQ_HEAD_INITIALIZER(ccp_list);
 static int ccp_dev_id;

@@ -652,7 +651,7 @@ is_ccp_device(const char *dirname,
 static int
 ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
 {
-	struct ccp_device *ccp_dev = NULL;
+	struct ccp_device *ccp_dev;

 	ccp_dev = rte_zmalloc("ccp_device", sizeof(*ccp_dev),
 			      RTE_CACHE_LINE_SIZE);
@@ -683,16 +682,10 @@ ccp_probe_devices(struct rte_pci_device *pci_dev,
 	struct dirent *d;
 	DIR *dir;
 	int ret = 0;
-	int module_idx = 0;
 	uint16_t domain;
 	uint8_t bus, devid, function;
 	char dirname[PATH_MAX];

-	module_idx = ccp_check_pci_uio_module();
-	if (module_idx < 0)
-		return -1;
-
-	iommu_mode = module_idx;
 	TAILQ_INIT(&ccp_list);
 	dir = opendir(SYSFS_PCI_DEVICES);
 	if (dir == NULL)
diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c
index c941e222c7..bd1a037f76 100644
--- a/drivers/crypto/ccp/ccp_pci.c
+++ b/drivers/crypto/ccp/ccp_pci.c
@@ -11,40 +11,6 @@
 #include <rte_string_fns.h>

 #include "ccp_pci.h"
-#include "ccp_pmd_private.h"
-
-static const char * const uio_module_names[] = {
-	"igb_uio",
-	"uio_pci_generic",
-	"vfio_pci"
-};
-
-int
-ccp_check_pci_uio_module(void)
-{
-	FILE *fp;
-	int i;
-	char buf[BUFSIZ];
-
-	fp = fopen(PROC_MODULES, "r");
-	if (fp == NULL)
-		return -1;
-	i = 0;
-	while (uio_module_names[i] != NULL) {
-		while (fgets(buf, sizeof(buf), fp) != NULL) {
-			if (!strncmp(buf, uio_module_names[i],
-				     strlen(uio_module_names[i]))) {
-				fclose(fp);
-				return i;
-			}
-		}
-		i++;
-		rewind(fp);
-	}
-	fclose(fp);
-	CCP_LOG_DBG("Insert igb_uio or uio_pci_generic kernel module(s)");
-	return -1;/* uio not inserted */
-}

 /*
  * split up a pci address into its constituent parts.
diff --git a/drivers/crypto/ccp/ccp_pci.h b/drivers/crypto/ccp/ccp_pci.h
index 6736bf8ad3..d9a8b9dcc6 100644
--- a/drivers/crypto/ccp/ccp_pci.h
+++ b/drivers/crypto/ccp/ccp_pci.h
@@ -10,9 +10,6 @@
 #include <bus_pci_driver.h>

 #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
-#define PROC_MODULES "/proc/modules"
-
-int ccp_check_pci_uio_module(void);

 int ccp_parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,
 			      uint8_t *bus, uint8_t *devid, uint8_t *function);
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index bcb621234c..661a796116 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -22,7 +22,6 @@
 static unsigned int ccp_pmd_init_done;
 uint8_t ccp_cryptodev_driver_id;
 uint8_t cryptodev_cnt;
-extern void *sha_ctx;

 struct ccp_pmd_init_params {
 	struct rte_cryptodev_pmd_init_params def_p;
@@ -200,7 +199,6 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 		return -ENODEV;

 	ccp_pmd_init_done = 0;
-	rte_free(sha_ctx);

 	RTE_LOG(INFO, PMD, "Closing ccp device %s on numa socket %u\n",
 			name, rte_socket_id());
@@ -287,7 +285,6 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		.auth_opt = CCP_PMD_AUTH_OPT_CCP,
 	};

-	sha_ctx = (void *)rte_malloc(NULL, SHA512_DIGEST_SIZE, 64);
 	if (ccp_pmd_init_done) {
 		RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
 		return -EFAULT;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.615257100 +0800
+++ 0053-crypto-ccp-fix-IOVA-handling.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From 9631fb8f10dfafb0547fbf9127b162e62b2bef43 Mon Sep 17 00:00:00 2001
+From 2d28201221df4758ab2c2124c07a3d935bd4999b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9631fb8f10dfafb0547fbf9127b162e62b2bef43 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/openssl: fix warning on copy length' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (50 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/ccp: fix IOVA handling' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/ipsec_mb: remove unnecessary null check' " Xueming Li
                     ` (105 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ruifeng Wang; +Cc: Feifei Wang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 24dc362291a26d0450a72193a4e06839bb743bdc Mon Sep 17 00:00:00 2001
From: Ruifeng Wang <ruifeng.wang@arm.com>
Date: Mon, 9 Jan 2023 11:40:21 +0800
Subject: [PATCH] crypto/openssl: fix warning on copy length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f481e9272a2f7c980519eac773acf0a9af23ea34 ]

When building with gcc 11.2.0, the compiler warns as follows:
In function 'memcpy',
    inlined from 'openssl_set_session_auth_parameters' at
      ../drivers/crypto/openssl/rte_openssl_pmd.c:699:3,
    inlined from 'openssl_set_session_parameters' at
      ../drivers/crypto/openssl/rte_openssl_pmd.c:826:9:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:29:10: warning:
'__builtin_memcpy' forming offset [4, 8] is out of the bounds [0, 4]

Fixed the warning by copying up to string / buffer size.

Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 05449b6e98..abcb641a44 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -696,7 +696,7 @@ openssl_set_session_auth_parameters(struct openssl_session *sess,
 		algo = digest_name_get(xform->auth.algo);
 		if (!algo)
 			return -EINVAL;
-		rte_memcpy(algo_name, algo, (sizeof(algo)+1));
+		strlcpy(algo_name, algo, sizeof(algo_name));

 		mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
 		sess->auth.hmac.ctx = EVP_MAC_CTX_new(mac);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.647901900 +0800
+++ 0054-crypto-openssl-fix-warning-on-copy-length.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From f481e9272a2f7c980519eac773acf0a9af23ea34 Mon Sep 17 00:00:00 2001
+From 24dc362291a26d0450a72193a4e06839bb743bdc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f481e9272a2f7c980519eac773acf0a9af23ea34 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/ipsec_mb: remove unnecessary null check' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (51 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/openssl: fix warning on copy length' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'test/crypto: fix typo in AES test' " Xueming Li
                     ` (104 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Tyler Retzlaff, Fan Zhang, Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 11f862d6051c0225043c55cd1aed9d169e54b73b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 13 Jan 2023 10:44:25 -0800
Subject: [PATCH] crypto/ipsec_mb: remove unnecessary null check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2245ccf74674e73dc4352fa348f0aa3958dcd67a ]

The function rte_ring_free() accepts NULL as valid input
like free() and other functions.

Found with null_free_check.cocci.

Fixes: 16d6ebb65d59 ("crypto/ipsec_mb: fix null checks")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Fan Zhang <fanzhang.oss@gmail.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
index 71e02cd051..3e52f95674 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
@@ -139,15 +139,12 @@ int
 ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 {
 	struct ipsec_mb_qp *qp = dev->data->queue_pairs[qp_id];
-	struct rte_ring *r = NULL;

 	if (!qp)
 		return 0;

 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		r = rte_ring_lookup(qp->name);
-		if (r)
-			rte_ring_free(r);
+		rte_ring_free(rte_ring_lookup(qp->name));

 #if IMB_VERSION(1, 1, 0) > IMB_VERSION_NUM
 		if (qp->mb_mgr)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.676390000 +0800
+++ 0055-crypto-ipsec_mb-remove-unnecessary-null-check.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From 2245ccf74674e73dc4352fa348f0aa3958dcd67a Mon Sep 17 00:00:00 2001
+From 11f862d6051c0225043c55cd1aed9d169e54b73b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2245ccf74674e73dc4352fa348f0aa3958dcd67a ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'test/crypto: fix typo in AES test' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (52 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/ipsec_mb: remove unnecessary null check' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'test/crypto: add missing MAC-I to PDCP vectors' " Xueming Li
                     ` (103 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Vikash Poddar; +Cc: Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ca39bc233733e6a6633fce0ac8ad862d906f47f9 Mon Sep 17 00:00:00 2001
From: Vikash Poddar <vikash.chandrax.poddar@intel.com>
Date: Mon, 30 Jan 2023 12:03:03 +0000
Subject: [PATCH] test/crypto: fix typo in AES test
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e57cdbec6f94558697e50402e4bfe1dce6186d52 ]

Fix the spelling of scater to scatter in cryptodev AES test vector
header file

Fixes: 2692b02e03b2 ("test/crypto: add multi-segment out-of-place AES-XTS")

Signed-off-by: Vikash Poddar <vikash.chandrax.poddar@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 .mailmap                                   |  1 +
 app/test/test_cryptodev_aes_test_vectors.h | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/.mailmap b/.mailmap
index db7440407b..e68cc9a6b4 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1387,6 +1387,7 @@ Vijay Kumar Srivastava <vsrivast@xilinx.com>
 Vijay Srivastava <vijays@solarflare.com>
 Vikas Aggarwal <vikas.aggarwal@caviumnetworks.com>
 Vikas Gupta <vikas.gupta@broadcom.com>
+Vikash Poddar <vikash.chandrax.poddar@intel.com>
 Vimal Chungath <vcchunga@amazon.com>
 Vincent Guo <guopengfei160@163.com>
 Vincent Jardin <vincent.jardin@6wind.com>
diff --git a/app/test/test_cryptodev_aes_test_vectors.h b/app/test/test_cryptodev_aes_test_vectors.h
index ea7b21ce53..f3686beeb5 100644
--- a/app/test/test_cryptodev_aes_test_vectors.h
+++ b/app/test/test_cryptodev_aes_test_vectors.h
@@ -4969,7 +4969,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
-			      " Dataunit 512) Scater gather OOP",
+			      " Dataunit 512) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -4979,7 +4979,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
-			      " Dataunit 512) Scater gather OOP",
+			      " Dataunit 512) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_512,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -4989,7 +4989,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Encryption (512-byte plaintext"
-			      " Dataunit 0) Scater gather OOP",
+			      " Dataunit 0) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -4999,7 +4999,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Decryption (512-byte plaintext"
-			      " Dataunit 0) Scater gather OOP",
+			      " Dataunit 0) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_512_du_0,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -5009,7 +5009,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
-			      " Dataunit 4096) Scater gather OOP",
+			      " Dataunit 4096) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -5019,7 +5019,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
-			      " Dataunit 4096) Scater gather OOP",
+			      " Dataunit 4096) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_4096,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -5029,7 +5029,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Encryption (4096-byte plaintext"
-			      " Dataunit 0) Scater gather OOP",
+			      " Dataunit 0) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
@@ -5039,7 +5039,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
 	},
 	{
 		.test_descr = "AES-256-XTS Decryption (4096-byte plaintext"
-			      " Dataunit 0) Scater gather OOP",
+			      " Dataunit 0) Scatter gather OOP",
 		.test_data = &aes_test_data_xts_wrapped_key_48_pt_4096_du_0,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.feature_mask = BLOCKCIPHER_TEST_FEATURE_OOP |
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.706345400 +0800
+++ 0056-test-crypto-fix-typo-in-AES-test.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From e57cdbec6f94558697e50402e4bfe1dce6186d52 Mon Sep 17 00:00:00 2001
+From ca39bc233733e6a6633fce0ac8ad862d906f47f9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e57cdbec6f94558697e50402e4bfe1dce6186d52 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 6a91c11be4..5015494210 100644
+index db7440407b..e68cc9a6b4 100644
@@ -23 +25 @@
-@@ -1389,6 +1389,7 @@ Vijay Kumar Srivastava <vsrivast@xilinx.com>
+@@ -1387,6 +1387,7 @@ Vijay Kumar Srivastava <vsrivast@xilinx.com>

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

* patch 'test/crypto: add missing MAC-I to PDCP vectors' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (53 preceding siblings ...)
  2023-02-27  6:59   ` patch 'test/crypto: fix typo in AES test' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'cryptodev: fix sym session mempool creation description' " Xueming Li
                     ` (102 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cbd714b1f9049bca073a4178e945e6c1bfa31837 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Tue, 24 Jan 2023 17:39:24 +0100
Subject: [PATCH] test/crypto: add missing MAC-I to PDCP vectors
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7b2ae9efa223b220f4699c1940a6ed530e063bf8 ]

Existing PDCP 12-bit C/U-plane output vectors with NULL encryption + NULL
integrity do not contain the MAC-I (32-bit of all zeros according to the
specification).
Vectors for other SN length (5, 18 bits) have the MAC-I set.

Fixes: d883e6e7131b ("test/crypto: add PDCP C-Plane encap cases")
Fixes: cca7d1f78524 ("test/crypto: add PDCP U-Plane encap with integrity cases")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test/test_cryptodev_security_pdcp_test_vectors.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test/test_cryptodev_security_pdcp_test_vectors.h b/app/test/test_cryptodev_security_pdcp_test_vectors.h
index 6fdc4cd9e3..56d4884529 100644
--- a/app/test/test_cryptodev_security_pdcp_test_vectors.h
+++ b/app/test/test_cryptodev_security_pdcp_test_vectors.h
@@ -5560,7 +5560,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* Control Plane w/NULL enc. + NULL int. DL LONG SN */
 	(uint8_t[]){0xA0, 0x00, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5568,7 +5568,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* Control Plane w/NULL enc. + SNOW f9 int. UL LONG SN */
 	(uint8_t[]){0x00, 0x01, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5954,7 +5954,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* User Plane w/NULL enc. + NULL int. DL for 12-bit SN */
 	(uint8_t[]){0xA0, 0x00, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
@@ -5962,7 +5962,7 @@ static uint8_t *pdcp_test_data_out[] = {
 		    0xC2, 0xE2, 0x91, 0x91, 0xA3, 0x9C, 0xE6, 0x30, 0x69, 0x70,
 		    0x33, 0x8A, 0x15, 0xD0, 0x36, 0x47, 0x0E, 0x8F, 0xEE, 0x2C,
 		    0x96, 0x0C, 0xD7, 0x7D, 0x70, 0x1B, 0x01, 0x7F, 0x96, 0x46,
-		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD},
+		    0x53, 0xB0, 0xA4, 0x7A, 0xF9, 0xDD, 0x00, 0x00, 0x00, 0x00},
 	/* User Plane w/NULL enc. + SNOW f9 int. UL for 12-bit SN */
 	(uint8_t[]){0x80, 0x01, 0x86, 0xB8, 0xF8, 0xDB, 0x2D, 0x3F, 0x23, 0x82,
 		    0x53, 0xFD, 0x37, 0xDE, 0x88, 0x63, 0x08, 0x4F, 0xD3, 0x71,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.742989600 +0800
+++ 0057-test-crypto-add-missing-MAC-I-to-PDCP-vectors.patch	2023-02-27 14:08:40.779237000 +0800
@@ -1 +1 @@
-From 7b2ae9efa223b220f4699c1940a6ed530e063bf8 Mon Sep 17 00:00:00 2001
+From cbd714b1f9049bca073a4178e945e6c1bfa31837 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7b2ae9efa223b220f4699c1940a6ed530e063bf8 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'cryptodev: fix sym session mempool creation description' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (54 preceding siblings ...)
  2023-02-27  6:59   ` patch 'test/crypto: add missing MAC-I to PDCP vectors' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'compressdev: fix end of driver list' " Xueming Li
                     ` (101 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Fan Zhang; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ce54658be7c99586d9430c420a6475bd79b3d608 Mon Sep 17 00:00:00 2001
From: Fan Zhang <fanzhang.oss@gmail.com>
Date: Fri, 6 Jan 2023 13:05:00 +0000
Subject: [PATCH] cryptodev: fix sym session mempool creation description
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9a8569ac0f9ee929d78f4353946fc6bdece21082 ]

After the session mempool creation API is changed, some
description is no longer valid. This patch fixes the
descriptions in both API comment and the programmer's guide.

Fixes: bdce2564dbf7 ("cryptodev: rework session framework")

Signed-off-by: Fan Zhang <fanzhang.oss@gmail.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 doc/guides/prog_guide/cryptodev_lib.rst       |  42 +-
 .../prog_guide/img/cryptodev_sym_sess.svg     | 417 ------------------
 lib/cryptodev/rte_cryptodev.h                 |  17 +-
 3 files changed, 27 insertions(+), 449 deletions(-)
 delete mode 100644 doc/guides/prog_guide/img/cryptodev_sym_sess.svg

diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 01aad842a9..0d9f7059ea 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -499,37 +499,29 @@ a flow. Crypto sessions cache this immutable data in a optimal way for the
 underlying PMD and this allows further acceleration of the offload of
 Crypto workloads.

-.. figure:: img/cryptodev_sym_sess.*
-
 The Crypto device framework provides APIs to create session mempool and allocate
 and initialize sessions for crypto devices, where sessions are mempool objects.
 The application has to use ``rte_cryptodev_sym_session_pool_create()`` to
-create the session header mempool that creates a mempool with proper element
-size automatically and stores necessary information for safely accessing the
-session in the mempool's private data field.
-
-To create a mempool for storing session private data, the application has two
-options. The first is to create another mempool with elt size equal to or
-bigger than the maximum session private data size of all crypto devices that
-will share the same session header. The creation of the mempool shall use the
-traditional ``rte_mempool_create()`` with the correct ``elt_size``. The other
-option is to change the ``elt_size`` parameter in
-``rte_cryptodev_sym_session_pool_create()`` to the correct value. The first
-option is more complex to implement but may result in better memory usage as
-a session header normally takes smaller memory footprint as the session private
-data.
+create the session mempool header and the private data with the size specified
+by the user through the ``elt_size`` parameter in the function.
+The session private data is for the driver to initialize and access
+during crypto operations, hence the ``elt_size`` should be big enough
+for all drivers that will share this mempool.
+To obtain the proper session private data size of a crypto device,
+the user can call ``rte_cryptodev_sym_get_private_session_size()`` function.
+In case of heterogeneous crypto devices which will share the same session mempool,
+the maximum session private data size of them should be passed.

 Once the session mempools have been created, ``rte_cryptodev_sym_session_create()``
-is used to allocate an uninitialized session from the given mempool.
-The session then must be initialized using ``rte_cryptodev_sym_session_init()``
-for each of the required crypto devices. A symmetric transform chain
-is used to specify the operation and its parameters. See the section below for
-details on transforms.
+is used to allocate and initialize the session from the given mempool.
+The created session can ONLY be used by the crypto devices sharing the same driver ID
+as the device ID passed into the function as the parameter.
+In addition, a symmetric transform chain is used to specify the operation and its parameters.
+See the section below for details on transforms.

-When a session is no longer used, user must call ``rte_cryptodev_sym_session_clear()``
-for each of the crypto devices that are using the session, to free all driver
-private session data. Once this is done, session should be freed using
-``rte_cryptodev_sym_session_free`` which returns them to their mempool.
+When a session is no longer used, user must call ``rte_cryptodev_sym_session_free()``
+to uninitialize the session data and return the session
+back to the mempool it belongs.


 Transforms and Transform Chaining
diff --git a/doc/guides/prog_guide/img/cryptodev_sym_sess.svg b/doc/guides/prog_guide/img/cryptodev_sym_sess.svg
deleted file mode 100644
index 9b522458c8..0000000000
--- a/doc/guides/prog_guide/img/cryptodev_sym_sess.svg
+++ /dev/null
@@ -1,417 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Generated by Microsoft Visio, SVG Export cryptodev_sym_sess.svg Page-1 -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="4.8933434in"
-   height="3.8972795in"
-   viewBox="0 0 352.31955 280.60496"
-   xml:space="preserve"
-   class="st10"
-   version="1.1"
-   id="svg70"
-   sodipodi:docname="cryptodev_sym_sess.svg"
-   style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3"
-   inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"><metadata
-     id="metadata74"><rdf:RDF><cc:Work
-         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><sodipodi:namedview
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1"
-     objecttolerance="10"
-     gridtolerance="10"
-     guidetolerance="10"
-     inkscape:pageopacity="0"
-     inkscape:pageshadow="2"
-     inkscape:window-width="1920"
-     inkscape:window-height="956"
-     id="namedview72"
-     showgrid="false"
-     inkscape:zoom="1.7495789"
-     inkscape:cx="208.74719"
-     inkscape:cy="170.80248"
-     inkscape:window-x="0"
-     inkscape:window-y="27"
-     inkscape:window-maximized="1"
-     inkscape:current-layer="shape18-1-4" /><style
-     type="text/css"
-     id="style2"><![CDATA[
-		.st1 {fill:url(#grad0-4);stroke:#386288;stroke-width:0.75}
-		.st2 {fill:#386288;font-family:Calibri;font-size:0.833336em}
-		.st3 {visibility:visible}
-		.st4 {fill:#bdd0e9;fill-opacity:0.25;filter:url(#filter_2);stroke:#bdd0e9;stroke-opacity:0.25}
-		.st5 {fill:#a6b6cd;stroke:#41719c;stroke-width:0.75}
-		.st6 {fill:#41719c;font-family:Calibri;font-size:0.833336em}
-		.st7 {fill:#ffffff;stroke:#41719c;stroke-width:0.75}
-		.st8 {font-size:0.799995em}
-		.st9 {font-size:0.799995em;font-weight:bold}
-		.st10 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}
-	]]></style><defs
-     id="Patterns_And_Gradients"><marker
-       inkscape:isstock="true"
-       style="overflow:visible"
-       id="marker5421"
-       refX="0"
-       refY="0"
-       orient="auto"
-       inkscape:stockid="Arrow2Lend"><path
-         transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
-         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
-         style="fill:#41719c;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
-         id="path5419"
-         inkscape:connector-curvature="0" /></marker><marker
-       inkscape:stockid="Arrow2Lend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow2Lend"
-       style="overflow:visible"
-       inkscape:isstock="true"><path
-         id="path5004"
-         style="fill:#41719c;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
-         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
-         transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
-         inkscape:connector-curvature="0" /></marker><marker
-       inkscape:stockid="Arrow1Lend"
-       orient="auto"
-       refY="0"
-       refX="0"
-       id="Arrow1Lend"
-       style="overflow:visible"
-       inkscape:isstock="true"><path
-         id="path4986"
-         d="M 0,0 5,-5 -12.5,0 5,5 Z"
-         style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
-         transform="matrix(-0.8,0,0,-0.8,-10,0)"
-         inkscape:connector-curvature="0" /></marker><linearGradient
-       id="grad0-4"
-       x1="0"
-       y1="0"
-       x2="1"
-       y2="0"
-       gradientTransform="rotate(60,0.5,0.5)"><stop
-         offset="0"
-         stop-color="#e8ebef"
-         stop-opacity="1"
-         id="stop4" /><stop
-         offset="0.24"
-         stop-color="#f4f5f7"
-         stop-opacity="1"
-         id="stop6" /><stop
-         offset="0.54"
-         stop-color="#feffff"
-         stop-opacity="1"
-         id="stop8" /></linearGradient><filter
-       id="filter_2-4"><feGaussianBlur
-         stdDeviation="2"
-         id="feGaussianBlur12-0" /></filter><linearGradient
-       inkscape:collect="always"
-       xlink:href="#grad0-4"
-       id="linearGradient189"
-       gradientTransform="scale(0.8787489,1.1379815)"
-       x1="-0.42674366"
-       y1="0.98859203"
-       x2="176.71146"
-       y2="0.98859203"
-       gradientUnits="userSpaceOnUse" /><filter
-       id="filter_2-5"><feGaussianBlur
-         stdDeviation="2"
-         id="feGaussianBlur12-8" /></filter><filter
-       id="filter_2-3"><feGaussianBlur
-         stdDeviation="2"
-         id="feGaussianBlur12-2" /></filter><linearGradient
-       inkscape:collect="always"
-       xlink:href="#grad0-4"
-       id="linearGradient189-7"
-       gradientTransform="scale(0.8787489,1.1379815)"
-       x1="-0.42674366"
-       y1="0.98859203"
-       x2="176.71146"
-       y2="0.98859203"
-       gradientUnits="userSpaceOnUse" /><linearGradient
-       inkscape:collect="always"
-       xlink:href="#grad0-4"
-       id="linearGradient500"
-       gradientTransform="matrix(0.87785006,0,0,2.0116303,15.940232,20.619826)"
-       x1="-0.42674366"
-       y1="0.98859203"
-       x2="176.71146"
-       y2="0.98859203"
-       gradientUnits="userSpaceOnUse" /></defs><defs
-     id="Filters"><filter
-       id="filter_2"><feGaussianBlur
-         stdDeviation="2"
-         id="feGaussianBlur12" /></filter></defs><g
-     transform="matrix(1,0,0,0.46836022,-12.05774,-7.0354309)"
-     id="shape18-1"><title
-       id="title18">Rounded Rectangle.12</title><desc
-       id="desc20">Crypto Symmetric Session</desc><path
-       inkscape:connector-curvature="0"
-       style="fill:url(#linearGradient500);stroke:#386288;stroke-width:0.99665654"
-       id="path22"
-       class="st1"
-       d="M 22.713297,378.28219 H 163.92871 a 6.7704177,11.980443 0 0 0 6.76307,-11.96745 V 35.256532 A 6.7704177,11.980443 0 0 0 163.92871,23.271405 H 22.713297 A 6.7704177,11.980443 0 0 0 15.940232,35.256532 V 366.31474 a 6.7704177,11.980443 0 0 0 6.773065,11.96745 z" /></g><g
-     transform="matrix(1,0,0,0.41409874,-2.136529,-9.5289258)"
-     id="shape19-6"><title
-       id="title27">Rounded Rectangle.13</title><desc
-       id="desc29">Private Session Data</desc></g><path
-     d="m 16.65204,162.41822 h 123.21341 a 5.9074955,17.266947 0 0 0 5.90824,-17.2399 V 38.904442 A 5.9074955,17.266947 0 0 0 139.86545,21.635299 H 16.65204 A 5.9074955,17.266947 0 0 0 10.743795,38.904442 V 145.17832 a 5.9074955,17.266947 0 0 0 5.908245,17.2399 z"
-     class="st7"
-     id="path43"
-     inkscape:connector-curvature="0"
-     style="fill:#ffffff;stroke:#41719c;stroke-width:1.28185344" /><rect
-     style="fill:none;fill-opacity:1;stroke:#41719c;stroke-width:0.7760548;stroke-opacity:1"
-     id="rect4604"
-     width="15.963434"
-     height="15.954105"
-     x="25.091528"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7"
-     width="15.963433"
-     height="15.954105"
-     x="41.054958"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7-6"
-     width="15.963433"
-     height="15.954105"
-     x="57.018402"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7-6-9"
-     width="15.963433"
-     height="15.954105"
-     x="72.981834"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7-6-9-8"
-     width="15.963433"
-     height="15.954105"
-     x="88.945259"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7-6-9-8-9"
-     width="15.963433"
-     height="15.954105"
-     x="104.90869"
-     y="121.37455" /><rect
-     style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#41719c;stroke-width:0.7760548;stroke-linecap:square;stroke-miterlimit:3;stroke-opacity:1"
-     id="rect4604-7-6-9-8-9-6"
-     width="15.963433"
-     height="15.954105"
-     x="120.87212"
-     y="121.37455" /><text
-     x="50.562523"
-     y="49.898369"
-     class="st6"
-     id="text65-3"
-     style="font-size:22.36531448px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#41719c;fill-rule:evenodd;stroke-width:2.23652411;stroke-linecap:square;stroke-miterlimit:3"
-     transform="scale(0.47106923,2.1228302)" />
-<text
-     id="text4129"
-     y="80.842018"
-     x="27.862804"
-     style="font-style:normal;font-weight:normal;font-size:30.00008965px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.75000226"
-     xml:space="preserve"><tspan
-       style="stroke-width:0.75000226"
-       y="107.38506"
-       x="27.862804"
-       id="tspan4127"
-       sodipodi:role="line"></tspan></text>
-<text
-     id="text4139"
-     y="72.697174"
-     x="25.290758"
-     style="font-style:normal;font-weight:normal;font-size:30.00008965px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.75000226"
-     xml:space="preserve"><tspan
-       style="stroke-width:0.75000226"
-       y="99.240219"
-       x="25.290758"
-       id="tspan4137"
-       sodipodi:role="line"></tspan></text>
-<path
-     style="fill:none;fill-opacity:1;stroke:#41719c;stroke-width:0.86738265px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
-     d="m 128.80127,137.90141 -0.20704,20.06801 44.6966,-0.10399 0.20705,-93.424256 16.84434,0.62379"
-     id="path5030"
-     inkscape:connector-curvature="0"
-     sodipodi:nodetypes="ccccc" /><g
-     transform="matrix(1,0,0,0.57815109,191.45876,-0.65041967)"
-     id="shape18-1-4"><title
-       id="title18-4">Rounded Rectangle.12</title><desc
-       id="desc20-6">Crypto Symmetric Session</desc><path
-       style="fill:url(#linearGradient189);stroke:#386288;stroke-width:0.75"
-       id="path22-0"
-       class="st1"
-       d="m 6.78,202.33 h 141.36 a 6.77735,6.77735 -180 0 0 6.77,-6.77 V 8.28 A 6.77735,6.77735 -180 0 0 148.14,1.5 H 6.78 A 6.77735,6.77735 -180 0 0 0,8.28 v 187.28 a 6.77735,6.77735 -180 0 0 6.78,6.77 z"
-       inkscape:connector-curvature="0" /><text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;fill:#386288;stroke-width:1.40298378"
-       id="text24-5"
-       class="st2"
-       y="17.335487"
-       x="26.317923">Crypto Driver Private Session</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-3"
-       class="st2"
-       y="19.076277"
-       x="-240.04274">Crypto Symmetric Session</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-5"
-       class="st2"
-       y="46.557648"
-       x="-241.24557">uint16_t nb_drivers;</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-6"
-       class="st2"
-       y="98.349464"
-       x="-240.04272">struct {</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-2"
-       class="st2"
-       y="115.26107"
-       x="-204.55865">void *data;</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-9"
-       class="st2"
-       y="144.3279"
-       x="-240.04274">} session_data[];</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-5-1"
-       class="st2"
-       y="58.945786"
-       x="-240.51538">uint16_t user_data_sz;</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-5-2"
-       class="st2"
-       y="189.4823"
-       x="-185.78569">user_data</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-5-1-4"
-       class="st2"
-       y="129.23468"
-       x="-204.95244">uint16_t refcnt;</text>
-<text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;overflow:visible;color-interpolation-filters:sRGB;fill:#386288;fill-rule:evenodd;stroke-width:1.40298378;stroke-linecap:square;stroke-miterlimit:3"
-       id="text24-5-5-1-4-3"
-       class="st2"
-       y="72.641953"
-       x="-242.00067">uint64_t opaque_data;</text>
-</g><g
-     transform="matrix(1.022976,0,0,0.71529071,199.82034,-39.936699)"
-     id="shape19-6-5"><title
-       id="title27-2">Rounded Rectangle.13</title><desc
-       id="desc29-0">Private Session Data</desc><g
-       style="visibility:visible"
-       class="st3"
-       transform="translate(0.345598,1.97279)"
-       id="shadow19-7-1"><path
-         style="fill:#bdd0e9;fill-opacity:0.25;stroke:#bdd0e9;stroke-opacity:0.25;filter:url(#filter_2)"
-         id="path31-8"
-         class="st4"
-         d="m 5.91,202.33 h 123.25 a 5.90925,5.90925 -180 0 0 5.91,-5.9 v -92.78 a 5.90925,5.90925 -180 0 0 -5.91,-5.91 H 5.91 A 5.90925,5.90925 -180 0 0 0,103.65 v 92.78 a 5.90925,5.90925 -180 0 0 5.91,5.9 z"
-         inkscape:connector-curvature="0" /></g><path
-       style="fill:#a6b6cd;stroke:#41719c;stroke-width:0.75"
-       id="path34-8"
-       class="st5"
-       d="m 5.91,202.33 h 123.25 a 5.90925,5.90925 -180 0 0 5.91,-5.9 v -92.78 a 5.90925,5.90925 -180 0 0 -5.91,-5.91 H 5.91 A 5.90925,5.90925 -180 0 0 0,103.65 v 92.78 a 5.90925,5.90925 -180 0 0 5.91,5.9 z"
-       inkscape:connector-curvature="0" /><text
-       transform="scale(0.76039781,1.3151011)"
-       style="font-size:13.15105343px;font-family:Calibri;fill:#41719c;stroke-width:1.31510115"
-       id="text36-7"
-       class="st6"
-       y="119.96548"
-       x="34.639763">Private Session Data</text>
-</g><g
-     transform="matrix(1,0,0,0.57815109,191.61478,163.41083)"
-     id="shape18-1-4-7"><title
-       id="title18-4-3">Rounded Rectangle.12</title><desc
-       id="desc20-6-5">Crypto Symmetric Session</desc><path
-       style="fill:url(#linearGradient189-7);stroke:#386288;stroke-width:0.75"
-       id="path22-0-8"
-       class="st1"
-       d="m 6.78,202.33 h 141.36 a 6.77735,6.77735 -180 0 0 6.77,-6.77 V 8.28 A 6.77735,6.77735 -180 0 0 148.14,1.5 H 6.78 A 6.77735,6.77735 -180 0 0 0,8.28 v 187.28 a 6.77735,6.77735 -180 0 0 6.78,6.77 z"
-       inkscape:connector-curvature="0" /><text
-       transform="scale(0.71276665,1.4029837)"
-       style="font-size:14.02988338px;font-family:Calibri;fill:#386288;stroke-width:1.40298378"
-       id="text24-5-1"
-       class="st2"
-       y="17.335487"
-       x="26.317923">Crypto Driver Private Session</text>
-</g><g
-     transform="matrix(1.022976,0,0,0.71529071,199.97637,124.12455)"
-     id="shape19-6-5-1"><title
-       id="title27-2-4">Rounded Rectangle.13</title><desc
-       id="desc29-0-9">Private Session Data</desc><g
-       style="visibility:visible"
-       class="st3"
-       transform="translate(0.345598,1.97279)"
-       id="shadow19-7-1-8"><path
-         style="fill:#bdd0e9;fill-opacity:0.25;stroke:#bdd0e9;stroke-opacity:0.25;filter:url(#filter_2-3)"
-         id="path31-8-4"
-         class="st4"
-         d="m 5.91,202.33 h 123.25 a 5.90925,5.90925 -180 0 0 5.91,-5.9 v -92.78 a 5.90925,5.90925 -180 0 0 -5.91,-5.91 H 5.91 A 5.90925,5.90925 -180 0 0 0,103.65 v 92.78 a 5.90925,5.90925 -180 0 0 5.91,5.9 z"
-         inkscape:connector-curvature="0" /></g><path
-       style="fill:#a6b6cd;stroke:#41719c;stroke-width:0.75"
-       id="path34-8-3"
-       class="st5"
-       d="m 5.91,202.33 h 123.25 a 5.90925,5.90925 -180 0 0 5.91,-5.9 v -92.78 a 5.90925,5.90925 -180 0 0 -5.91,-5.91 H 5.91 A 5.90925,5.90925 -180 0 0 0,103.65 v 92.78 a 5.90925,5.90925 -180 0 0 5.91,5.9 z"
-       inkscape:connector-curvature="0" /><text
-       transform="scale(0.76039781,1.3151011)"
-       style="font-size:13.15105343px;font-family:Calibri;fill:#41719c;stroke-width:1.31510115"
-       id="text36-7-6"
-       class="st6"
-       y="119.96548"
-       x="34.639763">Private Session Data</text>
-</g><text
-     id="text5070"
-     y="145.4136"
-     x="248.24945"
-     style="font-style:normal;font-weight:normal;font-size:30.00008774px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.75000221"
-     xml:space="preserve"><tspan
-       style="stroke-width:0.75000221"
-       y="171.95665"
-       x="248.24945"
-       id="tspan5068"
-       sodipodi:role="line" /></text>
-<text
-     id="text5074"
-     y="142.68553"
-     x="251.28064"
-     style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:22.00006485px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.75000221"
-     xml:space="preserve"><tspan
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:22.00006485px;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;stroke-width:0.75000221"
-       y="142.68553"
-       x="251.28064"
-       id="tspan5072"
-       sodipodi:role="line">...</tspan></text>
-<path
-     inkscape:connector-curvature="0"
-     id="path5076"
-     d="m 32.13263,137.96494 1.19624,93.60569 156.25849,0.0883"
-     style="fill:none;stroke:#41719c;stroke-width:0.56864393px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5421)" /></svg>
\ No newline at end of file
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 86d792e2e7..ed4112c625 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -911,11 +911,14 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);
  * @param nb_elts
  *   The number of elements in the mempool.
  * @param elt_size
- *   The size of the element. This value will be ignored if it is smaller than
- *   the minimum session header size required for the system. For the user who
- *   want to use the same mempool for sym session and session private data it
- *   can be the maximum value of all existing devices' private data and session
- *   header sizes.
+ *   The size of the element. This should be the size of the cryptodev PMD
+ *   session private data obtained through
+ *   rte_cryptodev_sym_get_private_session_size() function call.
+ *   For the user who wants to use the same mempool for heterogeneous PMDs
+ *   this value should be the maximum value of their private session sizes.
+ *   Please note the created mempool will have bigger elt size than this
+ *   value as necessary session header and the possible padding are filled
+ *   into each elt.
  * @param cache_size
  *   The number of per-lcore cache elements
  * @param priv_size
@@ -926,8 +929,8 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);
  *   constraint for the reserved zone.
  *
  * @return
- *  - On success return size of the session
- *  - On failure returns 0
+ *  - On success returns the created session mempool pointer
+ *  - On failure returns NULL
  */
 __rte_experimental
 struct rte_mempool *
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.777531500 +0800
+++ 0058-cryptodev-fix-sym-session-mempool-creation-descripti.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 9a8569ac0f9ee929d78f4353946fc6bdece21082 Mon Sep 17 00:00:00 2001
+From ce54658be7c99586d9430c420a6475bd79b3d608 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9a8569ac0f9ee929d78f4353946fc6bdece21082 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -506 +508 @@
-index bbb854ccb9..27cdec8495 100644
+index 86d792e2e7..ed4112c625 100644
@@ -509 +511 @@
-@@ -982,11 +982,14 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);
+@@ -911,11 +911,14 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);
@@ -529 +531 @@
-@@ -997,8 +1000,8 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);
+@@ -926,8 +929,8 @@ rte_cryptodev_get_sec_ctx(uint8_t dev_id);

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

* patch 'compressdev: fix end of driver list' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (55 preceding siblings ...)
  2023-02-27  6:59   ` patch 'cryptodev: fix sym session mempool creation description' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'crypto/ipsec_mb: fix ZUC-256 maximum tag length' " Xueming Li
                     ` (100 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Michael Baum; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 031b48d67099780ecfcdcedddf414592010ab11f Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Wed, 1 Feb 2023 17:35:30 +0200
Subject: [PATCH] compressdev: fix end of driver list
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ]

The "rte_compressdev_info_get()" function retrieves the contextual
information of a device.
The output structure "dev_info" contains a list of devices supported
capabilities for each supported algorithm.

In this function description, it says the element after the last valid
element has op field set to "RTE_COMP_ALGO_LIST_END".
On the other hand, when this function used by
"rte_compressdev_capability_get()" function, it uses
"RTE_COMP_ALGO_UNSPECIFIED" as end of list as same as the
"RTE_COMP_END_OF_CAPABILITIES_LIST()".

The mlx5 and qat PMDs use "RTE_COMP_ALGO_LIST_END" as the end of
capabilities list. When "rte_compressdev_capability_get()" function is
called with unsupported algorithm, it might read memory out of bound.

This patch change the "rte_compressdev_info_get()" function description
to say using "RTE_COMP_ALGO_UNSPECIFIED" as the end of capabilities
list.
In addition, it moves both mlx5 and qat PMDs to use
"RTE_COMP_ALGO_UNSPECIFIED" through
"RTE_COMP_END_OF_CAPABILITIES_LIST()" macro.

Fixes: 5d432f364078 ("compressdev: add device capabilities")
Fixes: 2d148597ce76 ("compress/qat: add gen-specific implementation")
Fixes: 384bac8d6555 ("compress/mlx5: add supported capabilities")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 drivers/compress/mlx5/mlx5_compress.c        | 4 +---
 drivers/compress/qat/dev/qat_comp_pmd_gen1.c | 2 +-
 drivers/compress/qat/dev/qat_comp_pmd_gen4.c | 2 +-
 lib/compressdev/rte_compressdev.h            | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index fb2bda9745..459e4b5e8a 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -96,9 +96,7 @@ static const struct rte_compressdev_capabilities mlx5_caps[] = {
 				      RTE_COMP_FF_HUFFMAN_DYNAMIC,
 		.window_size = {.min = 10, .max = 15, .increment = 1},
 	},
-	{
-		.algo = RTE_COMP_ALGO_LIST_END,
-	}
+	RTE_COMP_END_OF_CAPABILITIES_LIST()
 };

 static void
diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
index 12d9d89072..3a8484eef1 100644
--- a/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen1.c
@@ -26,7 +26,7 @@ const struct rte_compressdev_capabilities qat_gen1_comp_capabilities[] = {
 				RTE_COMP_FF_OOP_LB_IN_SGL_OUT |
 				RTE_COMP_FF_STATEFUL_DECOMPRESSION,
 	 .window_size = {.min = 15, .max = 15, .increment = 0} },
-	{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };
+	 RTE_COMP_END_OF_CAPABILITIES_LIST() };

 static int
 qat_comp_dev_config_gen1(struct rte_compressdev *dev,
diff --git a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
index 79b2ceb414..05906f13e0 100644
--- a/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
+++ b/drivers/compress/qat/dev/qat_comp_pmd_gen4.c
@@ -25,7 +25,7 @@ qat_gen4_comp_capabilities[] = {
 				RTE_COMP_FF_OOP_SGL_IN_LB_OUT |
 				RTE_COMP_FF_OOP_LB_IN_SGL_OUT,
 	 .window_size = {.min = 15, .max = 15, .increment = 0} },
-	{RTE_COMP_ALGO_LIST_END, 0, {0, 0, 0} } };
+	 RTE_COMP_END_OF_CAPABILITIES_LIST() };

 static int
 qat_comp_dev_config_gen4(struct rte_compressdev *dev,
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 42bda9fc79..7eb5c58798 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -353,7 +353,7 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * @note The capabilities field of dev_info is set to point to the first
  * element of an array of struct rte_compressdev_capabilities.
  * The element after the last valid element has it's op field set to
- * RTE_COMP_ALGO_LIST_END.
+ * RTE_COMP_ALGO_UNSPECIFIED.
  */
 __rte_experimental
 void
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.808209700 +0800
+++ 0059-compressdev-fix-end-of-driver-list.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 33b84a2efca7ac188def108ba8b981daa7572b9a Mon Sep 17 00:00:00 2001
+From 031b48d67099780ecfcdcedddf414592010ab11f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 33b84a2efca7ac188def108ba8b981daa7572b9a ]
@@ -32 +34,0 @@
-Cc: stable@dpdk.org

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

* patch 'crypto/ipsec_mb: fix ZUC-256 maximum tag length' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (56 preceding siblings ...)
  2023-02-27  6:59   ` patch 'compressdev: fix end of driver list' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/bnxt: fix Tx queue stats after queue stop and start' " Xueming Li
                     ` (99 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ciara Power; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d357ef8a3ca371bb82f53443d9a909f1050652ca Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Tue, 31 Jan 2023 17:20:27 +0000
Subject: [PATCH] crypto/ipsec_mb: fix ZUC-256 maximum tag length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d3802886aaa76604833da59fa2df7cd519e59982 ]

The AESNI_MB PMD supports 8 and 16 byte tag lengths for ZUC-256 when
intel-ipsec-mb version is 1.3 or newer.
The conditional check to enable these tag lengths had the incorrect
operator, which enabled 8 and 16 byte tag lengths for versions below 1.2,
which is not supported.

Fixes: 7babda4316f9 ("crypto/ipsec_mb: support all tag sizes for ZUC-EIA3-256")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Brian Dooley <brian.dooley@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c      | 2 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 147a38932d..ac20d01937 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -199,7 +199,7 @@ aesni_mb_set_session_auth_parameters(const IMB_MGR *mb_mgr,
 			}
 		} else if (xform->auth.key.length == 32) {
 			sess->auth.algo = IMB_AUTH_ZUC256_EIA3_BITLEN;
-#if IMB_VERSION(1, 2, 0) > IMB_VERSION_NUM
+#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
 			if (sess->auth.req_digest_len != 4 &&
 					sess->auth.req_digest_len != 8 &&
 					sess->auth.req_digest_len != 16) {
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
index 55fafbbbec..8a7c74f621 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h
@@ -566,7 +566,7 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
 				},
 				.digest_size = {
 					.min = 4,
-#if IMB_VERSION(1, 2, 0) > IMB_VERSION_NUM
+#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
 					.max = 16,
 					.increment = 4
 #else
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.836380500 +0800
+++ 0060-crypto-ipsec_mb-fix-ZUC-256-maximum-tag-length.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From d3802886aaa76604833da59fa2df7cd519e59982 Mon Sep 17 00:00:00 2001
+From d357ef8a3ca371bb82f53443d9a909f1050652ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d3802886aaa76604833da59fa2df7cd519e59982 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/bnxt: fix Tx queue stats after queue stop and start' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (57 preceding siblings ...)
  2023-02-27  6:59   ` patch 'crypto/ipsec_mb: fix ZUC-256 maximum tag length' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/bnxt: fix Rx " Xueming Li
                     ` (98 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Kalesh AP; +Cc: Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bc1682ee55ff05be0fdb5915d1e6876a4886bd2e Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:12 +0530
Subject: [PATCH] net/bnxt: fix Tx queue stats after queue stop and start
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ]

The Tx queue stats are being reported incorrectly due to a workaround
for ring counters sometimes being reported as zero.  When a queue is
stopped and started, the ring counter is reset to zero.  The workaround
interprets the zero as incorrect, and sets the reported ring count as
the previously read value (from before the queue being restared).  This
shows up as negative counters in testpmd's "show fwd stats" command.
The fix clears the prev counter for the queue when the queue is started.

Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 67e016775c..21c2217092 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -560,6 +560,12 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	if (rc)
 		return rc;

+	/* reset the previous stats for the tx_queue since the counters
+	 * will be cleared when the queue is started.
+	 */
+	memset(&bp->prev_tx_ring_stats[tx_queue_id], 0,
+	       sizeof(struct bnxt_ring_stats));
+
 	bnxt_free_hwrm_tx_ring(bp, tx_queue_id);
 	rc = bnxt_alloc_hwrm_tx_ring(bp, tx_queue_id);
 	if (rc)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.873453500 +0800
+++ 0061-net-bnxt-fix-Tx-queue-stats-after-queue-stop-and-sta.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c Mon Sep 17 00:00:00 2001
+From bc1682ee55ff05be0fdb5915d1e6876a4886bd2e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9bd8998fe09736a048e367e1ef7543dd8b5dfd2c ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/bnxt: fix Rx queue stats after queue stop and start' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (58 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/bnxt: fix Tx queue stats after queue stop and start' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/bnxt: fix RSS hash in mbuf' " Xueming Li
                     ` (97 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Mike Baucom
  Cc: Somnath Kotur, Kishore Padmanabha, Randy Schacher, Ajit Khaparde,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3f1568d969125f2414fa057827db7aae56eca777 Mon Sep 17 00:00:00 2001
From: Mike Baucom <michael.baucom@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:13 +0530
Subject: [PATCH] net/bnxt: fix Rx queue stats after queue stop and start
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c ]

The Rx queue stats are being reported incorrectly due to a workaround
for ring counters sometimes being reported as zero.  When a queue is
stopped and started, the ring counter is reset to zero.  The workaround
interprets the zero as incorrect, and sets the reported ring count as
the previously read value (from before the queue being restared).  This
shows up as negative counters in testpmd's "show fwd stats" command.
The fix clears the prev counter for the queue when the queue is started.

Fixes: 219842b9990c ("net/bnxt: workaround spurious zero stats in Thor")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index fabbbd4560..99758dd304 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -471,6 +471,12 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 		return -EINVAL;
 	}

+	/* reset the previous stats for the rx_queue since the counters
+	 * will be cleared when the queue is started.
+	 */
+	memset(&bp->prev_rx_ring_stats[rx_queue_id], 0,
+	       sizeof(struct bnxt_ring_stats));
+
 	/* Set the queue state to started here.
 	 * We check the status of the queue while posting buffer.
 	 * If queue is it started, we do not post buffers for Rx.
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.902448700 +0800
+++ 0062-net-bnxt-fix-Rx-queue-stats-after-queue-stop-and-sta.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c Mon Sep 17 00:00:00 2001
+From 3f1568d969125f2414fa057827db7aae56eca777 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0180d3040e4a7734dc9987ff6c49ec1daedcdf8c ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/bnxt: fix RSS hash in mbuf' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (59 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/bnxt: fix Rx " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'doc: fix firmware list in bnxt guide' " Xueming Li
                     ` (96 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Venkat Duvvuru; +Cc: Kalesh AP, Kishore Padmanabha, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a4d58197b26c4c6f363146f481f2160cb47627d5 Mon Sep 17 00:00:00 2001
From: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Date: Wed, 1 Feb 2023 09:50:14 +0530
Subject: [PATCH] net/bnxt: fix RSS hash in mbuf
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 031102f531e87e25174d4744c4ced92e5b291891 ]

By clearing mbuf->hash.fdir.id in the data path, the driver is
corrupting the RSS hash value populated in the mbuf as they
are defined as a union.

This patch fixes the problem by removing the code that clears
mbuf->hash.fdir.id.

Fixes: 17b6c8386d73 ("net/bnxt: fix mark handling")

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index daaf9ffc1e..0eebddb05d 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -813,7 +813,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,

 skip_mark:
 	mbuf->hash.fdir.hi = 0;
-	mbuf->hash.fdir.id = 0;

 	return 0;
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.929833200 +0800
+++ 0063-net-bnxt-fix-RSS-hash-in-mbuf.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 031102f531e87e25174d4744c4ced92e5b291891 Mon Sep 17 00:00:00 2001
+From a4d58197b26c4c6f363146f481f2160cb47627d5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 031102f531e87e25174d4744c4ced92e5b291891 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'doc: fix firmware list in bnxt guide' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (60 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/bnxt: fix RSS hash in mbuf' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'eventdev/crypto: fix function symbol export' " Xueming Li
                     ` (95 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 48870212adffd82fa62187eeb9f258f398572fca Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Thu, 2 Feb 2023 10:13:41 -0800
Subject: [PATCH] doc: fix firmware list in bnxt guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 24cb38d1481e47a0a3eb44777935c18539b2882d ]

The supported firmware version information was not aligned correctly.
This patch fixes it.

Fixes: b845c295cd13 ("doc: update Broadcom bnxt guide")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/nics/bnxt.rst | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 293eab8787..0b09b0c50a 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -912,6 +912,7 @@ Shown below are Ethernet Network Adapters and their supported firmware versions
 * ``BCM57500 NetXtreme-E\ |reg| Family`` ... Firmware 219.0.0 or later

 Shown below are DPDK LTS releases and their supported firmware versions:
+
 * ``DPDK Release 19.11`` ... Firmware 219.0.103 or later
 * ``DPDK Release 20.11`` ... Firmware 219.0.103 or later
 * ``DPDK Release 21.11`` ... Firmware 221.0.101 or later
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.956656300 +0800
+++ 0064-doc-fix-firmware-list-in-bnxt-guide.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 24cb38d1481e47a0a3eb44777935c18539b2882d Mon Sep 17 00:00:00 2001
+From 48870212adffd82fa62187eeb9f258f398572fca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 24cb38d1481e47a0a3eb44777935c18539b2882d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'eventdev/crypto: fix function symbol export' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (61 preceding siblings ...)
  2023-02-27  6:59   ` patch 'doc: fix firmware list in bnxt guide' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'event/cnxk: wait for CPT flow control on WQE path' " Xueming Li
                     ` (94 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Abhinandan Gujjar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5e9f154f812ef7d24a300c5935d6afbb55f15763 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Wed, 18 Jan 2023 11:21:47 +0100
Subject: [PATCH] eventdev/crypto: fix function symbol export
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9adbdb12b669c975840dd1746835d1e2dd0fb309 ]

Add missing function rte_event_crypto_adapter_vector_limits_get()
to version.map.

Fixes: c1749bc5ee10 ("eventdev: introduce event cryptodev vector type")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.h | 4 ++++
 lib/eventdev/version.map                | 1 +
 2 files changed, 5 insertions(+)

diff --git a/lib/eventdev/rte_event_crypto_adapter.h b/lib/eventdev/rte_event_crypto_adapter.h
index 83d154a6ce..2a69290097 100644
--- a/lib/eventdev/rte_event_crypto_adapter.h
+++ b/lib/eventdev/rte_event_crypto_adapter.h
@@ -595,6 +595,9 @@ int
 rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Retrieve vector limits for a given event dev and crypto dev pair.
  * @see rte_event_crypto_adapter_vector_limits
  *
@@ -610,6 +613,7 @@ rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
  *  - 0: Success.
  *  - <0: Error code on failure.
  */
+__rte_experimental
 int rte_event_crypto_adapter_vector_limits_get(
 	uint8_t dev_id, uint16_t cdev_id,
 	struct rte_event_crypto_adapter_vector_limits *limits);
diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
index dd63ec6f68..c155af6d50 100644
--- a/lib/eventdev/version.map
+++ b/lib/eventdev/version.map
@@ -110,6 +110,7 @@ EXPERIMENTAL {
 	rte_event_eth_rx_adapter_event_port_get;

 	# added in 22.07
+	rte_event_crypto_adapter_vector_limits_get;
 	rte_event_port_quiesce;
 	rte_event_queue_attr_set;

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:42.987819700 +0800
+++ 0065-eventdev-crypto-fix-function-symbol-export.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 9adbdb12b669c975840dd1746835d1e2dd0fb309 Mon Sep 17 00:00:00 2001
+From 5e9f154f812ef7d24a300c5935d6afbb55f15763 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9adbdb12b669c975840dd1746835d1e2dd0fb309 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 0c610b8e04..fad4543506 100644
+index 83d154a6ce..2a69290097 100644
@@ -23 +25 @@
-@@ -609,6 +609,9 @@ int
+@@ -595,6 +595,9 @@ int
@@ -33 +35 @@
-@@ -624,6 +627,7 @@ rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+@@ -610,6 +613,7 @@ rte_event_crypto_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
@@ -42 +44 @@
-index 4405cd38eb..3add5e3088 100644
+index dd63ec6f68..c155af6d50 100644

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

* patch 'event/cnxk: wait for CPT flow control on WQE path' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (62 preceding siblings ...)
  2023-02-27  6:59   ` patch 'eventdev/crypto: fix function symbol export' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'eventdev/eth_rx: fix getting adapter instance' " Xueming Li
                     ` (93 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Rahul Bhansali; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0a78560065dbab6199f0fbd477fafdffe102024a Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali@marvell.com>
Date: Thu, 19 Jan 2023 11:23:15 +0530
Subject: [PATCH] event/cnxk: wait for CPT flow control on WQE path
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d6ef4695c3b449259b29225e62bb6116ad420227 ]

Wait for CPT flow control on WQE path to avoid CPT queue
overflow and thereby a CPT misc interrupt.

Fixes: 1a7da795f64a ("net/cnxk: support Tx security offload on cn9k")

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/event/cnxk/cn9k_worker.h |  1 +
 drivers/net/cnxk/cn9k_tx.h       | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/event/cnxk/cn9k_worker.h b/drivers/event/cnxk/cn9k_worker.h
index 4c3932da47..d3c5180fbc 100644
--- a/drivers/event/cnxk/cn9k_worker.h
+++ b/drivers/event/cnxk/cn9k_worker.h
@@ -730,6 +730,7 @@ cn9k_sso_hws_xmit_sec_one(const struct cn9k_eth_txq *txq, uint64_t base,

 	rte_io_wmb();
 	cn9k_sso_txq_fc_wait(txq);
+	cn9k_nix_sec_fc_wait_one(txq);

 	/* Write CPT instruction to lmt line */
 	vst1q_u64(lmt_addr, cmd01);
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 404edd6aed..7362025a34 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -388,6 +388,16 @@ cn9k_nix_xmit_prep_lmt(uint64_t *cmd, void *lmt_addr, const uint32_t flags)
 	roc_lmt_mov(lmt_addr, cmd, cn9k_nix_tx_ext_subs(flags));
 }

+static __rte_always_inline void
+cn9k_nix_sec_fc_wait_one(const struct cn9k_eth_txq *txq)
+{
+	uint64_t nb_desc = txq->cpt_desc;
+	uint64_t *fc = txq->cpt_fc;
+
+	while (nb_desc <= __atomic_load_n(fc, __ATOMIC_RELAXED))
+		;
+}
+
 static __rte_always_inline uint64_t
 cn9k_nix_xmit_submit_lmt(const rte_iova_t io_addr)
 {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.016620200 +0800
+++ 0066-event-cnxk-wait-for-CPT-flow-control-on-WQE-path.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From d6ef4695c3b449259b29225e62bb6116ad420227 Mon Sep 17 00:00:00 2001
+From 0a78560065dbab6199f0fbd477fafdffe102024a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d6ef4695c3b449259b29225e62bb6116ad420227 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'eventdev/eth_rx: fix getting adapter instance' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (63 preceding siblings ...)
  2023-02-27  6:59   ` patch 'event/cnxk: wait for CPT flow control on WQE path' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'event/cnxk: fix burst timer arm' " Xueming Li
                     ` (92 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Shijith Thotton; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 77f50c0971336fb8216ce87875a48561db0ccb2f Mon Sep 17 00:00:00 2001
From: Shijith Thotton <sthotton@marvell.com>
Date: Tue, 3 Jan 2023 18:39:04 +0530
Subject: [PATCH] eventdev/eth_rx: fix getting adapter instance
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0aedd85f9a2aa9f70dfdad56b6fba2d183470a99 ]

The API to get rx adapter instance is returning error for event devices
with internal port capability and eth_rx_adapter_instance_get op
undefined. But as the Rx adapter is internally maintaining the queue
information needed to find the instance id, event devices can opt out
from defining the op. Modified code to match this logic.

Fixes: a1793ee8aba0 ("eventdev/eth_rx: add adapter instance get API")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index cf7bbd4d69..170823a03c 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -3415,14 +3415,10 @@ rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id,
 		if (!rte_event_eth_rx_adapter_caps_get(rx_adapter->eventdev_id,
 						      eth_dev_id,
 						      &caps)) {
-			if (caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) {
-				ret = rxa_dev_instance_get(rx_adapter) ?
-						rxa_dev_instance_get(rx_adapter)
-								(eth_dev_id,
-								 rx_queue_id,
-								 rxa_inst_id)
-							: -EINVAL;
-			}
+			if (caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT &&
+			    rxa_dev_instance_get(rx_adapter))
+				ret = rxa_dev_instance_get(rx_adapter)(eth_dev_id, rx_queue_id,
+								       rxa_inst_id);
 		}

 		/* return if entry found */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.049972800 +0800
+++ 0067-eventdev-eth_rx-fix-getting-adapter-instance.patch	2023-02-27 14:08:40.789237000 +0800
@@ -1 +1 @@
-From 0aedd85f9a2aa9f70dfdad56b6fba2d183470a99 Mon Sep 17 00:00:00 2001
+From 77f50c0971336fb8216ce87875a48561db0ccb2f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0aedd85f9a2aa9f70dfdad56b6fba2d183470a99 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 71e81ee3e1..1bbce4ede2 100644
+index cf7bbd4d69..170823a03c 100644
@@ -24 +26 @@
-@@ -3418,14 +3418,10 @@ rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id,
+@@ -3415,14 +3415,10 @@ rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id,

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

* patch 'event/cnxk: fix burst timer arm' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (64 preceding siblings ...)
  2023-02-27  6:59   ` patch 'eventdev/eth_rx: fix getting adapter instance' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'event/cnxk: fix timer operations in secondary process' " Xueming Li
                     ` (91 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 903d4a18a1b6c53797015fa4488abdd2db059c26 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Thu, 2 Feb 2023 13:40:24 +0530
Subject: [PATCH] event/cnxk: fix burst timer arm
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d8ae421431312a966e924a3064fdc43a92b3264e ]

Fix timer burst arm routine writing improper updates to the bucket.

Fixes: 5f644e1bd14c ("event/cnxk: add timer arm timeout burst")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/cnxk/cnxk_tim_worker.h | 81 ++++++++++++++--------------
 1 file changed, 42 insertions(+), 39 deletions(-)

diff --git a/drivers/event/cnxk/cnxk_tim_worker.h b/drivers/event/cnxk/cnxk_tim_worker.h
index eda84c6f31..6be31f6f9d 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.h
+++ b/drivers/event/cnxk/cnxk_tim_worker.h
@@ -270,7 +270,8 @@ __retry:
 			} while (hbt_state & BIT_ULL(33));
 #endif

-			if (!(hbt_state & BIT_ULL(34))) {
+			if (!(hbt_state & BIT_ULL(34)) ||
+			    !(hbt_state & GENMASK(31, 0))) {
 				cnxk_tim_bkt_dec_lock(bkt);
 				goto __retry;
 			}
@@ -352,7 +353,8 @@ __retry:
 			} while (hbt_state & BIT_ULL(33));
 #endif

-			if (!(hbt_state & BIT_ULL(34))) {
+			if (!(hbt_state & BIT_ULL(34)) ||
+			    !(hbt_state & GENMASK(31, 0))) {
 				cnxk_tim_bkt_dec_lock(bkt);
 				goto __retry;
 			}
@@ -449,10 +451,10 @@ cnxk_tim_add_entry_brst(struct cnxk_tim_ring *const tim_ring,
 	struct cnxk_tim_ent *chunk = NULL;
 	struct cnxk_tim_bkt *mirr_bkt;
 	struct cnxk_tim_bkt *bkt;
-	uint16_t chunk_remainder;
+	int16_t chunk_remainder;
 	uint16_t index = 0;
 	uint64_t lock_sema;
-	int16_t rem, crem;
+	int16_t rem;
 	uint8_t lock_cnt;

 __retry:
@@ -460,31 +462,6 @@ __retry:

 	/* Only one thread beyond this. */
 	lock_sema = cnxk_tim_bkt_inc_lock(bkt);
-	lock_cnt = (uint8_t)((lock_sema >> TIM_BUCKET_W1_S_LOCK) &
-			     TIM_BUCKET_W1_M_LOCK);
-
-	if (lock_cnt) {
-		cnxk_tim_bkt_dec_lock(bkt);
-#ifdef RTE_ARCH_ARM64
-		asm volatile(PLT_CPU_FEATURE_PREAMBLE
-			     "		ldxrb %w[lock_cnt], [%[lock]]	\n"
-			     "		tst %w[lock_cnt], 255		\n"
-			     "		beq dne%=			\n"
-			     "		sevl				\n"
-			     "rty%=:	wfe				\n"
-			     "		ldxrb %w[lock_cnt], [%[lock]]	\n"
-			     "		tst %w[lock_cnt], 255		\n"
-			     "		bne rty%=			\n"
-			     "dne%=:					\n"
-			     : [lock_cnt] "=&r"(lock_cnt)
-			     : [lock] "r"(&bkt->lock)
-			     : "memory");
-#else
-		while (__atomic_load_n(&bkt->lock, __ATOMIC_RELAXED))
-			;
-#endif
-		goto __retry;
-	}

 	/* Bucket related checks. */
 	if (unlikely(cnxk_tim_bkt_get_hbt(lock_sema))) {
@@ -509,21 +486,46 @@ __retry:
 			} while (hbt_state & BIT_ULL(33));
 #endif

-			if (!(hbt_state & BIT_ULL(34))) {
+			if (!(hbt_state & BIT_ULL(34)) ||
+			    !(hbt_state & GENMASK(31, 0))) {
 				cnxk_tim_bkt_dec_lock(bkt);
 				goto __retry;
 			}
 		}
 	}

+	lock_cnt = (uint8_t)((lock_sema >> TIM_BUCKET_W1_S_LOCK) &
+			     TIM_BUCKET_W1_M_LOCK);
+	if (lock_cnt) {
+		cnxk_tim_bkt_dec_lock(bkt);
+#ifdef RTE_ARCH_ARM64
+		asm volatile(PLT_CPU_FEATURE_PREAMBLE
+			     "		ldxrb %w[lock_cnt], [%[lock]]	\n"
+			     "		tst %w[lock_cnt], 255		\n"
+			     "		beq dne%=			\n"
+			     "		sevl				\n"
+			     "rty%=:	wfe				\n"
+			     "		ldxrb %w[lock_cnt], [%[lock]]	\n"
+			     "		tst %w[lock_cnt], 255		\n"
+			     "		bne rty%=			\n"
+			     "dne%=:					\n"
+			     : [lock_cnt] "=&r"(lock_cnt)
+			     : [lock] "r"(&bkt->lock)
+			     : "memory");
+#else
+		while (__atomic_load_n(&bkt->lock, __ATOMIC_RELAXED))
+			;
+#endif
+		goto __retry;
+	}
+
 	chunk_remainder = cnxk_tim_bkt_fetch_rem(lock_sema);
 	rem = chunk_remainder - nb_timers;
 	if (rem < 0) {
-		crem = tim_ring->nb_chunk_slots - chunk_remainder;
-		if (chunk_remainder && crem) {
+		if (chunk_remainder > 0) {
 			chunk = ((struct cnxk_tim_ent *)
 					 mirr_bkt->current_chunk) +
-				crem;
+				tim_ring->nb_chunk_slots - chunk_remainder;

 			index = cnxk_tim_cpy_wrk(index, chunk_remainder, chunk,
 						 tim, ents, bkt);
@@ -537,18 +539,19 @@ __retry:
 			chunk = cnxk_tim_insert_chunk(bkt, mirr_bkt, tim_ring);

 		if (unlikely(chunk == NULL)) {
-			cnxk_tim_bkt_dec_lock(bkt);
+			cnxk_tim_bkt_dec_lock_relaxed(bkt);
 			rte_errno = ENOMEM;
 			tim[index]->state = RTE_EVENT_TIMER_ERROR;
-			return crem;
+			return index;
 		}
 		*(uint64_t *)(chunk + tim_ring->nb_chunk_slots) = 0;
 		mirr_bkt->current_chunk = (uintptr_t)chunk;
-		cnxk_tim_cpy_wrk(index, nb_timers, chunk, tim, ents, bkt);
+		index = cnxk_tim_cpy_wrk(index, nb_timers, chunk, tim, ents,
+					 bkt) -
+			index;

-		rem = nb_timers - chunk_remainder;
-		cnxk_tim_bkt_set_rem(bkt, tim_ring->nb_chunk_slots - rem);
-		cnxk_tim_bkt_add_nent(bkt, rem);
+		cnxk_tim_bkt_set_rem(bkt, tim_ring->nb_chunk_slots - index);
+		cnxk_tim_bkt_add_nent(bkt, index);
 	} else {
 		chunk = (struct cnxk_tim_ent *)mirr_bkt->current_chunk;
 		chunk += (tim_ring->nb_chunk_slots - chunk_remainder);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.079835900 +0800
+++ 0068-event-cnxk-fix-burst-timer-arm.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From d8ae421431312a966e924a3064fdc43a92b3264e Mon Sep 17 00:00:00 2001
+From 903d4a18a1b6c53797015fa4488abdd2db059c26 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d8ae421431312a966e924a3064fdc43a92b3264e ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -17 +19 @@
-index 16909ef06d..5fa1acca90 100644
+index eda84c6f31..6be31f6f9d 100644
@@ -20 +22 @@
-@@ -272,7 +272,8 @@ __retry:
+@@ -270,7 +270,8 @@ __retry:
@@ -30 +32 @@
-@@ -354,7 +355,8 @@ __retry:
+@@ -352,7 +353,8 @@ __retry:
@@ -40 +42 @@
-@@ -451,10 +453,10 @@ cnxk_tim_add_entry_brst(struct cnxk_tim_ring *const tim_ring,
+@@ -449,10 +451,10 @@ cnxk_tim_add_entry_brst(struct cnxk_tim_ring *const tim_ring,
@@ -53 +55 @@
-@@ -462,31 +464,6 @@ __retry:
+@@ -460,31 +462,6 @@ __retry:
@@ -85 +87 @@
-@@ -511,21 +488,46 @@ __retry:
+@@ -509,21 +486,46 @@ __retry:
@@ -136 +138 @@
-@@ -539,18 +541,19 @@ __retry:
+@@ -537,18 +539,19 @@ __retry:

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

* patch 'event/cnxk: fix timer operations in secondary process' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (65 preceding siblings ...)
  2023-02-27  6:59   ` patch 'event/cnxk: fix burst timer arm' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/cnxk: fix packet type for IPv6 packets post decryption' " Xueming Li
                     ` (90 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From efb6eccf8e49d3086945f42c1f2c3eff28476e15 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula@marvell.com>
Date: Sun, 5 Feb 2023 12:03:47 +0530
Subject: [PATCH] event/cnxk: fix timer operations in secondary process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5f3d1c4ad7c35fb1eeb654b27019798ee6245a4b ]

Fix event timer fast-path ops not being initialized in secondary
process.

Fixes: dd519f83dd96 ("event/cnxk: add timer adapter capabilities")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/cnxk/cnxk_tim_evdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c
index 5dd79cbd47..c155764b77 100644
--- a/drivers/event/cnxk/cnxk_tim_evdev.c
+++ b/drivers/event/cnxk/cnxk_tim_evdev.c
@@ -381,6 +381,7 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
 		  cnxk_sso_set_priv_mem_t priv_mem_fn)
 {
 	struct cnxk_tim_evdev *dev = cnxk_tim_priv_get();
+	struct cnxk_tim_ring *tim_ring;

 	RTE_SET_USED(flags);

@@ -403,6 +404,12 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
 	dev->event_dev = (struct rte_eventdev *)(uintptr_t)evdev;
 	*caps = RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT |
 		RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC;
+
+	tim_ring = ((struct rte_event_timer_adapter_data
+			     *)((char *)caps - offsetof(struct rte_event_timer_adapter_data, caps)))
+			   ->adapter_priv;
+	if (tim_ring != NULL && rte_eal_process_type() == RTE_PROC_SECONDARY)
+		cnxk_tim_set_fp_ops(tim_ring);
 	*ops = &cnxk_tim_ops;

 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.109134400 +0800
+++ 0069-event-cnxk-fix-timer-operations-in-secondary-process.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 5f3d1c4ad7c35fb1eeb654b27019798ee6245a4b Mon Sep 17 00:00:00 2001
+From efb6eccf8e49d3086945f42c1f2c3eff28476e15 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5f3d1c4ad7c35fb1eeb654b27019798ee6245a4b ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 6ff3ca72f7..f2862f3292 100644
+index 5dd79cbd47..c155764b77 100644
@@ -21 +23 @@
-@@ -378,6 +378,7 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
+@@ -381,6 +381,7 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
@@ -29 +31 @@
-@@ -400,6 +401,12 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,
+@@ -403,6 +404,12 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,

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

* patch 'net/cnxk: fix packet type for IPv6 packets post decryption' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (66 preceding siblings ...)
  2023-02-27  6:59   ` patch 'event/cnxk: fix timer operations in secondary process' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'common/cnxk: fix aura ID handling' " Xueming Li
                     ` (89 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 87725aa6d219f1fada76eec913983296be1e3276 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 28 Nov 2022 15:24:37 +0530
Subject: [PATCH] net/cnxk: fix packet type for IPv6 packets post decryption
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 02b19349fa231846f79d118718fce2d23b4564d4 ]

Update ptype properly for IPv6 packets post inline decryption.

Fixes: 4440eb88ddfc ("net/cnxk: use full context IPsec structures")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn9k_rx.h | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/cnxk/cn9k_rx.h b/drivers/net/cnxk/cn9k_rx.h
index 1a9f920b41..0e23609df5 100644
--- a/drivers/net/cnxk/cn9k_rx.h
+++ b/drivers/net/cnxk/cn9k_rx.h
@@ -260,8 +260,8 @@ nix_rx_sec_mbuf_err_update(const union nix_rx_parse_u *rx, uint16_t res,
 }

 static __rte_always_inline uint64_t
-nix_rx_sec_mbuf_update(const struct nix_cqe_hdr_s *cq, struct rte_mbuf *m,
-		       uintptr_t sa_base, uint64_t *rearm_val, uint16_t *len)
+nix_rx_sec_mbuf_update(const struct nix_cqe_hdr_s *cq, struct rte_mbuf *m, uintptr_t sa_base,
+		       uint64_t *rearm_val, uint16_t *len, uint32_t packet_type)
 {
 	uintptr_t res_sg0 = ((uintptr_t)cq + ROC_ONF_IPSEC_INB_RES_OFF - 8);
 	const union nix_rx_parse_u *rx =
@@ -315,15 +315,18 @@ nix_rx_sec_mbuf_update(const struct nix_cqe_hdr_s *cq, struct rte_mbuf *m,
 	ip = (struct rte_ipv4_hdr *)(data + ROC_ONF_IPSEC_INB_SPI_SEQ_SZ +
 				     ROC_ONF_IPSEC_INB_MAX_L2_SZ);

+	packet_type = (packet_type & ~(RTE_PTYPE_L3_MASK | RTE_PTYPE_TUNNEL_MASK));
 	if (((ip->version_ihl & 0xf0) >> RTE_IPV4_IHL_MULTIPLIER) ==
 	    IPVERSION) {
 		*len = rte_be_to_cpu_16(ip->total_length) + lcptr;
+		packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
 	} else {
 		PLT_ASSERT(((ip->version_ihl & 0xf0) >>
 			    RTE_IPV4_IHL_MULTIPLIER) == 6);
 		ip6 = (struct rte_ipv6_hdr *)ip;
 		*len = rte_be_to_cpu_16(ip6->payload_len) +
 		       sizeof(struct rte_ipv6_hdr) + lcptr;
+		packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
 	}

 	/* Update data offset */
@@ -332,6 +335,7 @@ nix_rx_sec_mbuf_update(const struct nix_cqe_hdr_s *cq, struct rte_mbuf *m,
 	*rearm_val = *rearm_val & ~(BIT_ULL(16) - 1);
 	*rearm_val |= data_off;

+	m->packet_type = packet_type;
 	return RTE_MBUF_F_RX_SEC_OFFLOAD;
 }

@@ -363,14 +367,7 @@ cn9k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
 		/* Get SA Base from lookup mem */
 		sa_base = cnxk_nix_sa_base_get(port, lookup_mem);

-		ol_flags |= nix_rx_sec_mbuf_update(cq, mbuf, sa_base, &val,
-						   &len);
-
-		/* Only Tunnel inner IPv4 is supported */
-		packet_type = (packet_type &
-			       ~(RTE_PTYPE_L3_MASK | RTE_PTYPE_TUNNEL_MASK));
-		packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
-		mbuf->packet_type = packet_type;
+		ol_flags |= nix_rx_sec_mbuf_update(cq, mbuf, sa_base, &val, &len, packet_type);
 		goto skip_parse;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.140408200 +0800
+++ 0070-net-cnxk-fix-packet-type-for-IPv6-packets-post-decry.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 02b19349fa231846f79d118718fce2d23b4564d4 Mon Sep 17 00:00:00 2001
+From 87725aa6d219f1fada76eec913983296be1e3276 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 02b19349fa231846f79d118718fce2d23b4564d4 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'common/cnxk: fix aura ID handling' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (67 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/cnxk: fix packet type for IPv6 packets post decryption' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/cnxk: fix deadlock in security session creation' " Xueming Li
                     ` (88 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Kommula Shiva Shankar; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 78c0d2ab8533419fc34ccc8d3383b7cb871440a7 Mon Sep 17 00:00:00 2001
From: Kommula Shiva Shankar <kshankar@marvell.com>
Date: Mon, 28 Nov 2022 15:24:40 +0530
Subject: [PATCH] common/cnxk: fix aura ID handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 773fdfa6fc324070451887bff271a7ea5a44e6f2 ]

Fix the  aura handle to aura id while initialising
inline dev SSO XAQ aura

Fixes: 6f30ac80ca6b ("common/cnxk: use XAQ create API for inline device")

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
---
 drivers/common/cnxk/roc_nix_inl_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c
index c3d94dd0da..4ab4209dba 100644
--- a/drivers/common/cnxk/roc_nix_inl_dev.c
+++ b/drivers/common/cnxk/roc_nix_inl_dev.c
@@ -265,7 +265,7 @@ nix_inl_sso_setup(struct nix_inl_dev *inl_dev)
 	}

 	/* Setup xaq for hwgrps */
-	rc = sso_hwgrp_alloc_xaq(dev, inl_dev->xaq.aura_handle, 1);
+	rc = sso_hwgrp_alloc_xaq(dev, roc_npa_aura_handle_to_aura(inl_dev->xaq.aura_handle), 1);
 	if (rc) {
 		plt_err("Failed to setup hwgrp xaq aura, rc=%d", rc);
 		goto destroy_pool;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.171441000 +0800
+++ 0071-common-cnxk-fix-aura-ID-handling.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 773fdfa6fc324070451887bff271a7ea5a44e6f2 Mon Sep 17 00:00:00 2001
+From 78c0d2ab8533419fc34ccc8d3383b7cb871440a7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 773fdfa6fc324070451887bff271a7ea5a44e6f2 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/cnxk: fix deadlock in security session creation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (68 preceding siblings ...)
  2023-02-27  6:59   ` patch 'common/cnxk: fix aura ID handling' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'common/cnxk: fix dual VLAN parsing' " Xueming Li
                     ` (87 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: David Marchand; +Cc: Fan Zhang, Nithin Dabilpuram, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f40c4f3e0b781597345143a87e1bc79b7b8a5362 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 5 Jan 2023 14:57:18 +0100
Subject: [PATCH] net/cnxk: fix deadlock in security session creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 649aa9d1d6bb9b4773c1d26f13ee48ed5ad7bbde ]

Releasing the lock was missing in this branch.

Fixes: 4440eb88ddfc ("net/cnxk: use full context IPsec structures")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Fan Zhang <fanzhang.oss@gmail.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/net/cnxk/cn9k_ethdev_sec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/cnxk/cn9k_ethdev_sec.c b/drivers/net/cnxk/cn9k_ethdev_sec.c
index 67966a4e49..327f221e38 100644
--- a/drivers/net/cnxk/cn9k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn9k_ethdev_sec.c
@@ -556,6 +556,7 @@ cn9k_eth_sec_session_create(void *device,

 	if (!dev->outb.lf_base) {
 		plt_err("Could not allocate security session private data");
+		rte_spinlock_unlock(lock);
 		return -ENOMEM;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.200134700 +0800
+++ 0072-net-cnxk-fix-deadlock-in-security-session-creation.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 649aa9d1d6bb9b4773c1d26f13ee48ed5ad7bbde Mon Sep 17 00:00:00 2001
+From f40c4f3e0b781597345143a87e1bc79b7b8a5362 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 649aa9d1d6bb9b4773c1d26f13ee48ed5ad7bbde ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'common/cnxk: fix dual VLAN parsing' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (69 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/cnxk: fix deadlock in security session creation' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'common/cnxk: fix IPv6 extension matching' " Xueming Li
                     ` (86 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Kiran Kumar K, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5444957e577f1b9591662fbd4e2d2c4f2e1194c5 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Wed, 11 Jan 2023 11:08:14 +0530
Subject: [PATCH] common/cnxk: fix dual VLAN parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 474124865694177da3d4e0a60c4686c6d5ac1e56 ]

Flow parsing was not handling pattern matching on the
fields of inner VLAN even though MKEX profile could be
extracting inner VLAN fields. Code has been modified
to handle matching fields on two VLAN tags.

Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc_parse.c | 240 +++++++++++++++++++++-------
 drivers/common/cnxk/roc_npc_priv.h  |  16 +-
 drivers/common/cnxk/roc_npc_utils.c |   2 +-
 3 files changed, 186 insertions(+), 72 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index ff00c746d6..670f920117 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -238,10 +238,185 @@ npc_parse_la(struct npc_parse_state *pst)

 #define NPC_MAX_SUPPORTED_VLANS 3

+static int
+npc_parse_vlan_count(const struct roc_npc_item_info *pattern,
+		     const struct roc_npc_item_info **pattern_list,
+		     const struct roc_npc_flow_item_vlan **vlan_items, int *vlan_count)
+{
+	*vlan_count = 0;
+	while (pattern->type == ROC_NPC_ITEM_TYPE_VLAN) {
+		if (*vlan_count > NPC_MAX_SUPPORTED_VLANS - 1)
+			return NPC_ERR_PATTERN_NOTSUP;
+
+		/* Don't support ranges */
+		if (pattern->last != NULL)
+			return NPC_ERR_INVALID_RANGE;
+
+		/* If spec is NULL, both mask and last must be NULL, this
+		 * makes it to match ANY value (eq to mask = 0).
+		 * Setting either mask or last without spec is an error
+		 */
+		if (pattern->spec == NULL) {
+			if (pattern->last != NULL && pattern->mask != NULL)
+				return NPC_ERR_INVALID_SPEC;
+		}
+
+		pattern_list[*vlan_count] = pattern;
+		vlan_items[*vlan_count] = pattern->spec;
+		(*vlan_count)++;
+
+		pattern++;
+		pattern = npc_parse_skip_void_and_any_items(pattern);
+	}
+
+	return 0;
+}
+
+static int
+npc_parse_vlan_ltype_get(struct npc_parse_state *pst,
+			 const struct roc_npc_flow_item_vlan **vlan_item, int vlan_count,
+			 int *ltype, int *lflags)
+{
+	switch (vlan_count) {
+	case 1:
+		*ltype = NPC_LT_LB_CTAG;
+		if (vlan_item[0] && vlan_item[0]->has_more_vlan)
+			*ltype = NPC_LT_LB_STAG_QINQ;
+		break;
+	case 2:
+		if (vlan_item[1] && vlan_item[1]->has_more_vlan) {
+			if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] &
+			      0x3ULL << NPC_LFLAG_LB_OFFSET))
+				return NPC_ERR_PATTERN_NOTSUP;
+
+			/* This lflag value will match either one of
+			 * NPC_F_LB_L_WITH_STAG_STAG,
+			 * NPC_F_LB_L_WITH_QINQ_CTAG,
+			 * NPC_F_LB_L_WITH_QINQ_QINQ and
+			 * NPC_F_LB_L_WITH_ITAG (0b0100 to 0b0111). For
+			 * NPC_F_LB_L_WITH_ITAG, ltype is NPC_LT_LB_ETAG
+			 * hence will not match.
+			 */
+
+			*lflags = NPC_F_LB_L_WITH_QINQ_CTAG & NPC_F_LB_L_WITH_QINQ_QINQ &
+				  NPC_F_LB_L_WITH_STAG_STAG;
+		}
+		*ltype = NPC_LT_LB_STAG_QINQ;
+		break;
+	case 3:
+		if (vlan_item[2] && vlan_item[2]->has_more_vlan)
+			return NPC_ERR_PATTERN_NOTSUP;
+		if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] & 0x3ULL << NPC_LFLAG_LB_OFFSET))
+			return NPC_ERR_PATTERN_NOTSUP;
+		*ltype = NPC_LT_LB_STAG_QINQ;
+		*lflags = NPC_F_STAG_STAG_CTAG;
+		break;
+	default:
+		return NPC_ERR_PATTERN_NOTSUP;
+	}
+
+	return 0;
+}
+
+static int
+npc_update_vlan_parse_state(struct npc_parse_state *pst, const struct roc_npc_item_info *pattern,
+			    int lid, int lt, uint8_t lflags, int vlan_count)
+{
+	uint8_t vlan_spec[NPC_MAX_SUPPORTED_VLANS * sizeof(struct roc_vlan_hdr)];
+	uint8_t vlan_mask[NPC_MAX_SUPPORTED_VLANS * sizeof(struct roc_vlan_hdr)];
+	int rc = 0, i, offset = NPC_TPID_LENGTH;
+	struct npc_parse_item_info parse_info;
+	char hw_mask[NPC_MAX_EXTRACT_HW_LEN];
+
+	memset(vlan_spec, 0, sizeof(struct roc_vlan_hdr) * NPC_MAX_SUPPORTED_VLANS);
+	memset(vlan_mask, 0, sizeof(struct roc_vlan_hdr) * NPC_MAX_SUPPORTED_VLANS);
+	memset(&parse_info, 0, sizeof(parse_info));
+
+	if (vlan_count > 2)
+		vlan_count = 2;
+
+	for (i = 0; i < vlan_count; i++) {
+		if (pattern[i].spec)
+			memcpy(vlan_spec + offset, pattern[i].spec, sizeof(struct roc_vlan_hdr));
+		if (pattern[i].mask)
+			memcpy(vlan_mask + offset, pattern[i].mask, sizeof(struct roc_vlan_hdr));
+
+		offset += 4;
+	}
+
+	parse_info.def_mask = NULL;
+	parse_info.spec = vlan_spec;
+	parse_info.mask = vlan_mask;
+	parse_info.def_mask = NULL;
+	parse_info.hw_hdr_len = 0;
+
+	lid = NPC_LID_LB;
+	parse_info.hw_mask = hw_mask;
+
+	if (lt == NPC_LT_LB_CTAG)
+		parse_info.len = sizeof(struct roc_vlan_hdr) + NPC_TPID_LENGTH;
+
+	if (lt == NPC_LT_LB_STAG_QINQ)
+		parse_info.len = sizeof(struct roc_vlan_hdr) * 2 + NPC_TPID_LENGTH;
+
+	memset(hw_mask, 0, sizeof(hw_mask));
+
+	parse_info.hw_mask = &hw_mask;
+	npc_get_hw_supp_mask(pst, &parse_info, lid, lt);
+
+	rc = npc_mask_is_supported(parse_info.mask, parse_info.hw_mask, parse_info.len);
+	if (!rc)
+		return NPC_ERR_INVALID_MASK;
+
+	/* Point pattern to last item consumed */
+	pst->pattern = pattern;
+	return npc_update_parse_state(pst, &parse_info, lid, lt, lflags);
+}
+
+static int
+npc_parse_lb_vlan(struct npc_parse_state *pst)
+{
+	const struct roc_npc_flow_item_vlan *vlan_items[NPC_MAX_SUPPORTED_VLANS];
+	const struct roc_npc_item_info *pattern_list[NPC_MAX_SUPPORTED_VLANS];
+	const struct roc_npc_item_info *last_pattern;
+	int vlan_count = 0, rc = 0;
+	int lid, lt, lflags;
+
+	lid = NPC_LID_LB;
+	lflags = 0;
+	last_pattern = pst->pattern;
+
+	rc = npc_parse_vlan_count(pst->pattern, pattern_list, vlan_items, &vlan_count);
+	if (rc)
+		return rc;
+
+	rc = npc_parse_vlan_ltype_get(pst, vlan_items, vlan_count, &lt, &lflags);
+	if (rc)
+		return rc;
+
+	if (vlan_count == 3) {
+		if (pattern_list[2]->spec != NULL && pattern_list[2]->mask != NULL &&
+		    pattern_list[2]->last != NULL)
+			return NPC_ERR_PATTERN_NOTSUP;
+
+		/* Matching can be done only for two tags. */
+		vlan_count = 2;
+		last_pattern++;
+	}
+
+	rc = npc_update_vlan_parse_state(pst, pattern_list[0], lid, lt, lflags, vlan_count);
+	if (rc)
+		return rc;
+
+	if (vlan_count > 1)
+		pst->pattern = last_pattern + vlan_count;
+
+	return 0;
+}
+
 int
 npc_parse_lb(struct npc_parse_state *pst)
 {
-	const struct roc_npc_flow_item_vlan *vlan_item[NPC_MAX_SUPPORTED_VLANS];
 	const struct roc_npc_item_info *pattern = pst->pattern;
 	const struct roc_npc_item_info *last_pattern;
 	const struct roc_npc_flow_item_raw *raw_spec;
@@ -250,7 +425,6 @@ npc_parse_lb(struct npc_parse_state *pst)
 	char hw_mask[NPC_MAX_EXTRACT_HW_LEN];
 	struct npc_parse_item_info info;
 	int lid, lt, lflags, len = 0;
-	int nr_vlans = 0;
 	int rc;

 	info.def_mask = NULL;
@@ -267,68 +441,10 @@ npc_parse_lb(struct npc_parse_state *pst)
 		/* RTE vlan is either 802.1q or 802.1ad,
 		 * this maps to either CTAG/STAG. We need to decide
 		 * based on number of VLANS present. Matching is
-		 * supported on first tag only.
+		 * supported on first two tags.
 		 */
-		info.hw_mask = NULL;
-		info.len = sizeof(vlan_item[0]->hdr);
-
-		pattern = pst->pattern;
-		while (pattern->type == ROC_NPC_ITEM_TYPE_VLAN) {
-			if (nr_vlans > NPC_MAX_SUPPORTED_VLANS - 1)
-				return NPC_ERR_PATTERN_NOTSUP;
-
-			vlan_item[nr_vlans] = pattern->spec;
-			nr_vlans++;

-			/* Basic validation of Second/Third vlan item */
-			if (nr_vlans > 1) {
-				rc = npc_parse_item_basic(pattern, &info);
-				if (rc != 0)
-					return rc;
-			}
-			last_pattern = pattern;
-			pattern++;
-			pattern = npc_parse_skip_void_and_any_items(pattern);
-		}
-
-		switch (nr_vlans) {
-		case 1:
-			lt = NPC_LT_LB_CTAG;
-			if (vlan_item[0] && vlan_item[0]->has_more_vlan)
-				lt = NPC_LT_LB_STAG_QINQ;
-			break;
-		case 2:
-			if (vlan_item[1] && vlan_item[1]->has_more_vlan) {
-				if (!(pst->npc->keyx_supp_nmask[pst->nix_intf] &
-				      0x3ULL << NPC_LFLAG_LB_OFFSET))
-					return NPC_ERR_PATTERN_NOTSUP;
-
-				/* This lflag value will match either one of
-				 * NPC_F_LB_L_WITH_STAG_STAG,
-				 * NPC_F_LB_L_WITH_QINQ_CTAG,
-				 * NPC_F_LB_L_WITH_QINQ_QINQ and
-				 * NPC_F_LB_L_WITH_ITAG (0b0100 to 0b0111). For
-				 * NPC_F_LB_L_WITH_ITAG, ltype is NPC_LT_LB_ETAG
-				 * hence will not match.
-				 */
-
-				lflags = NPC_F_LB_L_WITH_QINQ_CTAG &
-					 NPC_F_LB_L_WITH_QINQ_QINQ &
-					 NPC_F_LB_L_WITH_STAG_STAG;
-			} else {
-				lflags = NPC_F_LB_L_WITH_CTAG;
-			}
-			lt = NPC_LT_LB_STAG_QINQ;
-			break;
-		case 3:
-			if (vlan_item[2] && vlan_item[2]->has_more_vlan)
-				return NPC_ERR_PATTERN_NOTSUP;
-			lt = NPC_LT_LB_STAG_QINQ;
-			lflags = NPC_F_STAG_STAG_CTAG;
-			break;
-		default:
-			return NPC_ERR_PATTERN_NOTSUP;
-		}
+		return npc_parse_lb_vlan(pst);
 	} else if (pst->pattern->type == ROC_NPC_ITEM_TYPE_E_TAG) {
 		/* we can support ETAG and match a subsequent CTAG
 		 * without any matching support.
diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index 1a597280d1..23acb7b01d 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -416,17 +416,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam,
 int npc_mcam_alloc_entries(struct npc *npc, int ref_mcam, int *alloc_entry,
 			   int req_count, int prio, int *resp_count);

-int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam,
-			   bool enable);
+int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam, bool enable);
 int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam);
 int npc_flow_enable_all_entries(struct npc *npc, bool enable);
-int npc_update_parse_state(struct npc_parse_state *pst,
-			   struct npc_parse_item_info *info, int lid, int lt,
-			   uint8_t flags);
-void npc_get_hw_supp_mask(struct npc_parse_state *pst,
-			  struct npc_parse_item_info *info, int lid, int lt);
-int npc_parse_item_basic(const struct roc_npc_item_info *item,
-			 struct npc_parse_item_info *info);
+int npc_update_parse_state(struct npc_parse_state *pst, struct npc_parse_item_info *info, int lid,
+			   int lt, uint8_t flags);
+void npc_get_hw_supp_mask(struct npc_parse_state *pst, struct npc_parse_item_info *info, int lid,
+			  int lt);
+int npc_mask_is_supported(const char *mask, const char *hw_mask, int len);
+int npc_parse_item_basic(const struct roc_npc_item_info *item, struct npc_parse_item_info *info);
 int npc_parse_meta_items(struct npc_parse_state *pst);
 int npc_parse_mark_item(struct npc_parse_state *pst);
 int npc_parse_pre_l2(struct npc_parse_state *pst);
diff --git a/drivers/common/cnxk/roc_npc_utils.c b/drivers/common/cnxk/roc_npc_utils.c
index 8bdabc116d..fda3073cba 100644
--- a/drivers/common/cnxk/roc_npc_utils.c
+++ b/drivers/common/cnxk/roc_npc_utils.c
@@ -88,7 +88,7 @@ npc_get_hw_supp_mask(struct npc_parse_state *pst,
 	}
 }

-static inline int
+inline int
 npc_mask_is_supported(const char *mask, const char *hw_mask, int len)
 {
 	/*
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.226436400 +0800
+++ 0073-common-cnxk-fix-dual-VLAN-parsing.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 474124865694177da3d4e0a60c4686c6d5ac1e56 Mon Sep 17 00:00:00 2001
+From 5444957e577f1b9591662fbd4e2d2c4f2e1194c5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 474124865694177da3d4e0a60c4686c6d5ac1e56 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index c1af5f3087..d8f9271fa8 100644
+index ff00c746d6..670f920117 100644
@@ -26 +28 @@
-@@ -239,10 +239,185 @@ npc_parse_la(struct npc_parse_state *pst)
+@@ -238,10 +238,185 @@ npc_parse_la(struct npc_parse_state *pst)
@@ -213 +215 @@
-@@ -251,7 +426,6 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -250,7 +425,6 @@ npc_parse_lb(struct npc_parse_state *pst)
@@ -221 +223 @@
-@@ -268,68 +442,10 @@ npc_parse_lb(struct npc_parse_state *pst)
+@@ -267,68 +441,10 @@ npc_parse_lb(struct npc_parse_state *pst)
@@ -293 +295 @@
-index fe19329a7f..2a7d3137fb 100644
+index 1a597280d1..23acb7b01d 100644
@@ -296,3 +298,3 @@
-@@ -418,17 +418,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam,
- int npc_mcam_alloc_entries(struct mbox *mbox, int ref_mcam, int *alloc_entry, int req_count,
- 			   int prio, int *resp_count, bool is_conti);
+@@ -416,17 +416,15 @@ int npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam,
+ int npc_mcam_alloc_entries(struct npc *npc, int ref_mcam, int *alloc_entry,
+ 			   int req_count, int prio, int *resp_count);
@@ -303 +305 @@
- int npc_mcam_write_entry(struct mbox *mbox, struct roc_npc_flow *mcam);
+ int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam);

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

* patch 'common/cnxk: fix IPv6 extension matching' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (70 preceding siblings ...)
  2023-02-27  6:59   ` patch 'common/cnxk: fix dual VLAN parsing' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'common/cnxk: reduce channel count per LMAC' " Xueming Li
                     ` (85 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Kiran Kumar K; +Cc: Satheesh Paul, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4060bba354cd9a09cacdb8c1482a258d25adabec Mon Sep 17 00:00:00 2001
From: Kiran Kumar K <kirankumark@marvell.com>
Date: Thu, 12 Jan 2023 12:06:20 +0530
Subject: [PATCH] common/cnxk: fix IPv6 extension matching
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a9b37dece978538aea728842af23be940a82485d ]

While configuring IPv6 flow, IPv6 ext ltype should be
matched along with IPv6. Adding changes to fix this issue.

Fixes: 474e275b1bc6 ("common/cnxk: support extensions attributes in IPv6 item")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc_mcam.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index a725cabc57..ceb0a733f0 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -701,15 +701,16 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)
 	 * because for AH and ESP, LC LFLAG is zero and we don't want to match
 	 * zero in LFLAG.
 	 */
-	lcflag_offset =
-		__builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
-				   ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
-	lcflag_offset *= 4;
-
-	mask = (0xfULL << lcflag_offset);
-	val = pst->flow->mcam_data[0] & mask;
-	if (val)
-		pst->flow->mcam_mask[0] |= mask;
+	if (pst->npc->keyx_supp_nmask[pst->nix_intf] & (1ULL << NPC_LFLAG_LC_OFFSET)) {
+		lcflag_offset = __builtin_popcount(pst->npc->keyx_supp_nmask[pst->nix_intf] &
+						   ((1ULL << NPC_LFLAG_LC_OFFSET) - 1));
+		lcflag_offset *= 4;
+
+		mask = (0xfULL << lcflag_offset);
+		val = pst->flow->mcam_data[0] & mask;
+		if (val)
+			pst->flow->mcam_mask[0] |= mask;
+	}
 }

 int
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.257499900 +0800
+++ 0074-common-cnxk-fix-IPv6-extension-matching.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From a9b37dece978538aea728842af23be940a82485d Mon Sep 17 00:00:00 2001
+From 4060bba354cd9a09cacdb8c1482a258d25adabec Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a9b37dece978538aea728842af23be940a82485d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index c419ce3a4c..0abd8872b1 100644
+index a725cabc57..ceb0a733f0 100644
@@ -22 +24 @@
-@@ -727,15 +727,16 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)
+@@ -701,15 +701,16 @@ npc_set_ipv6ext_ltype_mask(struct npc_parse_state *pst)

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

* patch 'common/cnxk: reduce channel count per LMAC' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (71 preceding siblings ...)
  2023-02-27  6:59   ` patch 'common/cnxk: fix IPv6 extension matching' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/cnxk: validate RED threshold config' " Xueming Li
                     ` (84 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d7d670cbe2370d5e71a694669597ffa11071949e Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <skori@marvell.com>
Date: Wed, 4 Jan 2023 11:37:12 +0530
Subject: [PATCH] common/cnxk: reduce channel count per LMAC
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 869f5bc370d70874b8a49b34aff39709a2b6f8fe ]

Due to limitation, imposed by latest AF kernel driver, maximum number of
channel supported per LMAC is reduced to 8. Because of this change
application gets failed to initialize for more channels.

Also this limitation impacts PFC functional behaviour.

So patch just aligns the supported number of channel with AF kernel
driver.

Fixes: 20d02329cdc2 ("common/cnxk: support priority flow control")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/common/cnxk/roc_mbox.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h
index 8b0384c737..fd9d3e73cd 100644
--- a/drivers/common/cnxk/roc_mbox.h
+++ b/drivers/common/cnxk/roc_mbox.h
@@ -1169,7 +1169,7 @@ struct nix_bp_cfg_req {
  * so maximum 256 channels are possible.
  */
 #define NIX_MAX_CHAN	 256
-#define NIX_CGX_MAX_CHAN 16
+#define NIX_CGX_MAX_CHAN 8
 #define NIX_LBK_MAX_CHAN 1
 struct nix_bp_cfg_rsp {
 	struct mbox_msghdr hdr;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.288445800 +0800
+++ 0075-common-cnxk-reduce-channel-count-per-LMAC.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 869f5bc370d70874b8a49b34aff39709a2b6f8fe Mon Sep 17 00:00:00 2001
+From d7d670cbe2370d5e71a694669597ffa11071949e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 869f5bc370d70874b8a49b34aff39709a2b6f8fe ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 0989bddc3b..b74eb71275 100644
+index 8b0384c737..fd9d3e73cd 100644
@@ -27 +29 @@
-@@ -1173,7 +1173,7 @@ struct nix_bp_cfg_req {
+@@ -1169,7 +1169,7 @@ struct nix_bp_cfg_req {

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

* patch 'net/cnxk: validate RED threshold config' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (72 preceding siblings ...)
  2023-02-27  6:59   ` patch 'common/cnxk: reduce channel count per LMAC' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'mem: fix hugepage info mapping' " Xueming Li
                     ` (83 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 23cb90427af131777e961f63d715b3c520e9a123 Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <skori@marvell.com>
Date: Mon, 2 Jan 2023 22:13:53 +0530
Subject: [PATCH] net/cnxk: validate RED threshold config
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9fd66d79d3e27dfb28e04d10e0ee63dfc64820c9 ]

Added validation to check minimum and maximum RED threshold
values, passed by user.

Fixes: b7d3a0fe71eb ("net/cnxk: support congestion management operations")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev_cman.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev_cman.c b/drivers/net/cnxk/cnxk_ethdev_cman.c
index d5e647c64d..a7ccdfb756 100644
--- a/drivers/net/cnxk/cnxk_ethdev_cman.c
+++ b/drivers/net/cnxk/cnxk_ethdev_cman.c
@@ -68,6 +68,11 @@ nix_cman_config_validate(struct rte_eth_dev *eth_dev, const struct rte_eth_cman_
 		return -EINVAL;
 	}

+	if (config->mode_param.red.min_th > config->mode_param.red.max_th) {
+		plt_err("RED minimum threshold must be less or equal to maximum threshold");
+		return -EINVAL;
+	}
+
 	return 0;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.323543100 +0800
+++ 0076-net-cnxk-validate-RED-threshold-config.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 9fd66d79d3e27dfb28e04d10e0ee63dfc64820c9 Mon Sep 17 00:00:00 2001
+From 23cb90427af131777e961f63d715b3c520e9a123 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9fd66d79d3e27dfb28e04d10e0ee63dfc64820c9 ]
@@ -10 +12,0 @@
-CC: stable@dpdk.org

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

* patch 'mem: fix hugepage info mapping' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (73 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/cnxk: validate RED threshold config' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'raw/ifpga/base: fix init with multi-process' " Xueming Li
                     ` (82 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 08019befc3dfa3fe24081ed86ff6e5bbd00192f0 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 6 Feb 2023 10:53:10 +0000
Subject: [PATCH] mem: fix hugepage info mapping
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]

The map_shared_memory() function should treat mmap MAP_FAILED as NULL
because callers compare it with NULL to determine whether the map is
failed.

Fixes: 764bf26873b9 ("add FreeBSD support")
Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/freebsd/eal_hugepage_info.c | 2 +-
 lib/eal/linux/eal_hugepage_info.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c
index 9dbe375bd3..e58e618469 100644
--- a/lib/eal/freebsd/eal_hugepage_info.c
+++ b/lib/eal/freebsd/eal_hugepage_info.c
@@ -33,7 +33,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	}
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }

 static void *
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index a1b6cb31ff..24411d9c5b 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -50,7 +50,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE,
 			MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }

 static void *
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.355949200 +0800
+++ 0077-mem-fix-hugepage-info-mapping.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 66e7ac416f3d62c5ee773ff02c115a24da9f1991 Mon Sep 17 00:00:00 2001
+From 08019befc3dfa3fe24081ed86ff6e5bbd00192f0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'raw/ifpga/base: fix init with multi-process' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (74 preceding siblings ...)
  2023-02-27  6:59   ` patch 'mem: fix hugepage info mapping' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'telemetry: fix repeat display when callback don't init dict' " Xueming Li
                     ` (81 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f5803ba5c5572d022512b2682925b2f945bef2d6 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 6 Feb 2023 10:53:11 +0000
Subject: [PATCH] raw/ifpga/base: fix init with multi-process
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]

The MAP_FAILED should be used to determine whether the mapping is
successful.

Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/raw/ifpga/base/opae_hw_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/ifpga/base/opae_hw_api.c b/drivers/raw/ifpga/base/opae_hw_api.c
index 1117c3e160..6d48d227d6 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.c
+++ b/drivers/raw/ifpga/base/opae_hw_api.c
@@ -380,7 +380,7 @@ static pthread_mutex_t *opae_adapter_mutex_open(struct opae_adapter *adapter)
 				PROT_READ | PROT_WRITE, MAP_SHARED,
 				shm_id, 0);
 		adapter->lock = (pthread_mutex_t *)ptr;
-		if (ptr) {
+		if (ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, ptr);
@@ -499,7 +499,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
 		adapter->shm.size = size;
 		adapter->shm.ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
 							MAP_SHARED, shm_id, 0);
-		if (adapter->shm.ptr) {
+		if (adapter->shm.ptr != MAP_FAILED) {
 			dev_info(NULL,
 					"shared memory %s address is %p\n",
 					shm_name, adapter->shm.ptr);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.391302000 +0800
+++ 0078-raw-ifpga-base-fix-init-with-multi-process.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 Mon Sep 17 00:00:00 2001
+From f5803ba5c5572d022512b2682925b2f945bef2d6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'telemetry: fix repeat display when callback don't init dict' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (75 preceding siblings ...)
  2023-02-27  6:59   ` patch 'raw/ifpga/base: fix init with multi-process' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'eal/linux: fix hugetlbfs sub-directories discovery' " Xueming Li
                     ` (80 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0343d4cb72d1f9dbdd26d30e7c8c7c86132ea626 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 9 Feb 2023 01:25:33 +0000
Subject: [PATCH] telemetry: fix repeat display when callback don't init dict
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]

When a telemetry callback doesn't initialize the telemetry data
structure and returns a non-negative number, the telemetry will repeat
to display the last result. This patch zero the data structure to avoid
the problem.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/telemetry/telemetry.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8fbb4f3060..7b905355cd 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -333,7 +333,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s)
 static void
 perform_command(telemetry_cb fn, const char *cmd, const char *param, int s)
 {
-	struct rte_tel_data data;
+	struct rte_tel_data data = {0};

 	int ret = fn(cmd, param, &data);
 	if (ret < 0) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.428442100 +0800
+++ 0079-telemetry-fix-repeat-display-when-callback-don-t-ini.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From ff50c4f9136781bae9089c596e0a12d113e1d474 Mon Sep 17 00:00:00 2001
+From 0343d4cb72d1f9dbdd26d30e7c8c7c86132ea626 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ff50c4f9136781bae9089c596e0a12d113e1d474 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 655191bcf1..7bceadcee7 100644
+index 8fbb4f3060..7b905355cd 100644

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

* patch 'eal/linux: fix hugetlbfs sub-directories discovery' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (76 preceding siblings ...)
  2023-02-27  6:59   ` patch 'telemetry: fix repeat display when callback don't init dict' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'drivers/bus: fix leak for devices without driver' " Xueming Li
                     ` (79 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ashish Sadanandan; +Cc: John Levon, Julien Meunier, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From acacb53810bc6949ab5517b75e947cdd6e482e06 Mon Sep 17 00:00:00 2001
From: Ashish Sadanandan <ashish.sadanandan@gmail.com>
Date: Sun, 8 Jan 2023 18:52:39 -0700
Subject: [PATCH] eal/linux: fix hugetlbfs sub-directories discovery
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f9d1ef28619a2dd16cafca36f5a5ca6d3315c5fc ]

The code added for allowing --huge-dir to specify hugetlbfs
sub-directories has a bug where it incorrectly matches mounts that
contain a prefix of the specified --huge-dir.

Consider --huge-dir=/dev/hugepages1G is passed to rte_eal_init. Given
the following hugetlbfs mounts

$ mount | grep hugetlbfs
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
hugetlbfs on /dev/hugepages1G type hugetlbfs (rw,relatime,pagesize=1024M)
hugetlbfs on /mnt/huge type hugetlbfs (rw,relatime,pagesize=2M)

get_hugepage_dir is first called with hugepage_sz=2097152. While
iterating over all mount points, /dev/hugepages is incorrectly
determined to be a match because it's a prefix of --huge-dir. The caller
then obtains an exclusive lock on --huge-dir.

In the next call to get_hugepage_dir, hugepage_sz=1073741824. This call
correctly determines /dev/hugepages1G is a match. The caller again
attempts to obtain an exclusive lock on --huge-dir and deadlocks because
it's already holding a lock.

This has been corrected by ensuring any matched mount point is either an
exact match or a parent path of --huge-dir.

Fixes: 24d5a1ce6b85 ("eal/linux: allow hugetlbfs sub-directories")

Signed-off-by: Ashish Sadanandan <ashish.sadanandan@gmail.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Tested-by: Julien Meunier <julien.meunier@nokia.com>
---
 lib/eal/linux/eal_hugepage_info.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index 24411d9c5b..581d9dfc91 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -214,6 +214,8 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 	char buf[BUFSIZ];
 	const struct internal_config *internal_conf =
 		eal_get_internal_configuration();
+	const size_t hugepage_dir_len = (internal_conf->hugepage_dir != NULL) ?
+		strlen(internal_conf->hugepage_dir) : 0;
 	struct stat st;

 	/*
@@ -233,6 +235,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)

 	while (fgets(buf, sizeof(buf), fd)){
 		const char *pagesz_str;
+		size_t mountpt_len = 0;

 		if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
 				split_tok) != _FIELDNAME_MAX) {
@@ -265,12 +268,16 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 			break;
 		}

+		mountpt_len = strlen(splitstr[MOUNTPT]);
+
 		/*
-		 * Ignore any mount that doesn't contain the --huge-dir
-		 * directory.
+		 * Ignore any mount that doesn't contain the --huge-dir directory
+		 * or where mount point is not a parent path of --huge-dir
 		 */
 		if (strncmp(internal_conf->hugepage_dir, splitstr[MOUNTPT],
-			strlen(splitstr[MOUNTPT])) != 0) {
+				mountpt_len) != 0 ||
+			(hugepage_dir_len > mountpt_len &&
+				internal_conf->hugepage_dir[mountpt_len] != '/')) {
 			continue;
 		}

@@ -278,7 +285,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)
 		 * We found a match, but only prefer it if it's a longer match
 		 * (so /mnt/1 is preferred over /mnt for matching /mnt/1/2)).
 		 */
-		if (strlen(splitstr[MOUNTPT]) > strlen(found))
+		if (mountpt_len > strlen(found))
 			strlcpy(found, splitstr[MOUNTPT], len);
 	} /* end while fgets */

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.458882900 +0800
+++ 0080-eal-linux-fix-hugetlbfs-sub-directories-discovery.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From f9d1ef28619a2dd16cafca36f5a5ca6d3315c5fc Mon Sep 17 00:00:00 2001
+From acacb53810bc6949ab5517b75e947cdd6e482e06 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f9d1ef28619a2dd16cafca36f5a5ca6d3315c5fc ]
@@ -32 +34,0 @@
-Cc: stable@dpdk.org

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

* patch 'drivers/bus: fix leak for devices without driver' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (77 preceding siblings ...)
  2023-02-27  6:59   ` patch 'eal/linux: fix hugetlbfs sub-directories discovery' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'test/mbuf: fix mbuf reset test' " Xueming Li
                     ` (78 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Kevin Laatz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cc69b3523ec0d264f254c1d4451bfc6534a6a801 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Thu, 9 Feb 2023 14:22:07 +0100
Subject: [PATCH] drivers/bus: fix leak for devices without driver
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit deb44af7066a17b1d2bab180cbe98ccae6e253ca ]

During the bus scan, memory for device configuration is allocated.
Currently, if a driver wasn't attached to the device during initialization,
memory for that device will not be released at bus cleanup.
This patch address this issue and releases the memory for all allocated
devices.

Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/bus/pci/pci_common.c | 3 ++-
 drivers/bus/vdev/vdev.c      | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index bc3a7f39fe..e32a9d517a 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -448,7 +448,7 @@ pci_cleanup(void)
 		int ret = 0;

 		if (drv == NULL || drv->remove == NULL)
-			continue;
+			goto free;

 		ret = drv->remove(dev);
 		if (ret < 0) {
@@ -458,6 +458,7 @@ pci_cleanup(void)
 		dev->driver = NULL;
 		dev->device.driver = NULL;

+free:
 		/* free interrupt handles */
 		rte_intr_instance_free(dev->intr_handle);
 		dev->intr_handle = NULL;
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 41bc07dde7..7974b27295 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -578,18 +578,19 @@ vdev_cleanup(void)
 		int ret = 0;

 		if (dev->device.driver == NULL)
-			continue;
+			goto free;

 		drv = container_of(dev->device.driver, const struct rte_vdev_driver, driver);

 		if (drv->remove == NULL)
-			continue;
+			goto free;

 		ret = drv->remove(dev);
 		if (ret < 0)
 			error = -1;

 		dev->device.driver = NULL;
+free:
 		free(dev);
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.488801400 +0800
+++ 0081-drivers-bus-fix-leak-for-devices-without-driver.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From deb44af7066a17b1d2bab180cbe98ccae6e253ca Mon Sep 17 00:00:00 2001
+From cc69b3523ec0d264f254c1d4451bfc6534a6a801 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit deb44af7066a17b1d2bab180cbe98ccae6e253ca ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'test/mbuf: fix mbuf reset test' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (78 preceding siblings ...)
  2023-02-27  6:59   ` patch 'drivers/bus: fix leak for devices without driver' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'eventdev/timer: fix overflow' " Xueming Li
                     ` (77 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Jie Hai; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fd3e2fb61736ea04d559e5540b52919e4b7cc660 Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1@huawei.com>
Date: Tue, 31 Jan 2023 10:48:51 +0800
Subject: [PATCH] test/mbuf: fix mbuf reset test
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 ]

Retest "mbuf_autotest" will fail because the mbuf pool was
not freed after previous test successful done.
This patch fixes it.

Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")

Signed-off-by: Jie Hai <haijie1@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 53fe898a38..6cbb03b0af 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2764,6 +2764,7 @@ test_nb_segs_and_next_reset(void)
 			m2->nb_segs != 1 || m2->next != NULL)
 		GOTO_FAIL("nb_segs or next was not reset properly");

+	rte_mempool_free(pool);
 	return 0;

 fail:
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.517044500 +0800
+++ 0082-test-mbuf-fix-mbuf-reset-test.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 Mon Sep 17 00:00:00 2001
+From fd3e2fb61736ea04d559e5540b52919e4b7cc660 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bf47fb83a61a4bc6bf45e1ec6e3ddd239a856190 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'eventdev/timer: fix overflow' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (79 preceding siblings ...)
  2023-02-27  6:59   ` patch 'test/mbuf: fix mbuf reset test' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'eal: cleanup alarm and hotplug before memory detach' " Xueming Li
                     ` (76 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Erik Gabriel Carrillo; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f7825956c03a7e1b86cc07a26fc6f24dfb1d0275 Mon Sep 17 00:00:00 2001
From: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Date: Thu, 9 Feb 2023 09:13:49 -0600
Subject: [PATCH] eventdev/timer: fix overflow
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca ]

The software timer adapter converts event timer timeout ticks to a
number of TSC cycles at which an rte_timer should expire. The
computation uses an integer multiplication that can result in overflow.

If necessary, reduce the timeout_nsecs value by the number of whole
seconds it contains to keep the value of the multiplier within a
range that will not result in overflow.  Add the saved value back later
to get the final result. Also, move the logic that checks the timeout
range into the function that performs the above computation.

Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
---
 lib/eventdev/rte_event_timer_adapter.c | 97 ++++++++++++++++----------
 1 file changed, 59 insertions(+), 38 deletions(-)

diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index a0f14bf861..b07b3837d5 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -17,6 +17,7 @@
 #include <rte_timer.h>
 #include <rte_service_component.h>
 #include <rte_telemetry.h>
+#include <rte_reciprocal.h>

 #include "event_timer_adapter_pmd.h"
 #include "eventdev_pmd.h"
@@ -699,13 +700,51 @@ swtim_callback(struct rte_timer *tim)
 	}
 }

-static __rte_always_inline uint64_t
+static __rte_always_inline int
 get_timeout_cycles(struct rte_event_timer *evtim,
-		   const struct rte_event_timer_adapter *adapter)
+		   const struct rte_event_timer_adapter *adapter,
+		   uint64_t *timeout_cycles)
 {
-	struct swtim *sw = swtim_pmd_priv(adapter);
-	uint64_t timeout_ns = evtim->timeout_ticks * sw->timer_tick_ns;
-	return timeout_ns * rte_get_timer_hz() / NSECPERSEC;
+	static struct rte_reciprocal_u64 nsecpersec_inverse;
+	static uint64_t timer_hz;
+	uint64_t rem_cycles, secs_cycles = 0;
+	uint64_t secs, timeout_nsecs;
+	uint64_t nsecpersec;
+	struct swtim *sw;
+
+	sw = swtim_pmd_priv(adapter);
+	nsecpersec = (uint64_t)NSECPERSEC;
+
+	timeout_nsecs = evtim->timeout_ticks * sw->timer_tick_ns;
+	if (timeout_nsecs > sw->max_tmo_ns)
+		return -1;
+	if (timeout_nsecs < sw->timer_tick_ns)
+		return -2;
+
+	/* Set these values in the first invocation */
+	if (!timer_hz) {
+		timer_hz = rte_get_timer_hz();
+		nsecpersec_inverse = rte_reciprocal_value_u64(nsecpersec);
+	}
+
+	/* If timeout_nsecs > nsecpersec, decrease timeout_nsecs by the number
+	 * of whole seconds it contains and convert that value to a number
+	 * of cycles. This keeps timeout_nsecs in the interval [0..nsecpersec)
+	 * in order to avoid overflow when we later multiply by timer_hz.
+	 */
+	if (timeout_nsecs > nsecpersec) {
+		secs = rte_reciprocal_divide_u64(timeout_nsecs,
+						 &nsecpersec_inverse);
+		secs_cycles = secs * timer_hz;
+		timeout_nsecs -= secs * nsecpersec;
+	}
+
+	rem_cycles = rte_reciprocal_divide_u64(timeout_nsecs * timer_hz,
+					       &nsecpersec_inverse);
+
+	*timeout_cycles = secs_cycles + rem_cycles;
+
+	return 0;
 }

 /* This function returns true if one or more (adapter) ticks have occurred since
@@ -739,23 +778,6 @@ swtim_did_tick(struct swtim *sw)
 	return false;
 }

-/* Check that event timer timeout value is in range */
-static __rte_always_inline int
-check_timeout(struct rte_event_timer *evtim,
-	      const struct rte_event_timer_adapter *adapter)
-{
-	uint64_t tmo_nsec;
-	struct swtim *sw = swtim_pmd_priv(adapter);
-
-	tmo_nsec = evtim->timeout_ticks * sw->timer_tick_ns;
-	if (tmo_nsec > sw->max_tmo_ns)
-		return -1;
-	if (tmo_nsec < sw->timer_tick_ns)
-		return -2;
-
-	return 0;
-}
-
 /* Check that event timer event queue sched type matches destination event queue
  * sched type
  */
@@ -1140,21 +1162,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 			break;
 		}

-		ret = check_timeout(evtims[i], adapter);
-		if (unlikely(ret == -1)) {
-			__atomic_store_n(&evtims[i]->state,
-					RTE_EVENT_TIMER_ERROR_TOOLATE,
-					__ATOMIC_RELAXED);
-			rte_errno = EINVAL;
-			break;
-		} else if (unlikely(ret == -2)) {
-			__atomic_store_n(&evtims[i]->state,
-					RTE_EVENT_TIMER_ERROR_TOOEARLY,
-					__ATOMIC_RELAXED);
-			rte_errno = EINVAL;
-			break;
-		}
-
 		if (unlikely(check_destination_event_queue(evtims[i],
 							   adapter) < 0)) {
 			__atomic_store_n(&evtims[i]->state,
@@ -1170,7 +1177,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
 		evtims[i]->impl_opaque[0] = (uintptr_t)tim;
 		evtims[i]->impl_opaque[1] = (uintptr_t)adapter;

-		cycles = get_timeout_cycles(evtims[i], adapter);
+		ret = get_timeout_cycles(evtims[i], adapter, &cycles);
+		if (unlikely(ret == -1)) {
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOLATE,
+					__ATOMIC_RELAXED);
+			rte_errno = EINVAL;
+			break;
+		} else if (unlikely(ret == -2)) {
+			__atomic_store_n(&evtims[i]->state,
+					RTE_EVENT_TIMER_ERROR_TOOEARLY,
+					__ATOMIC_RELAXED);
+			rte_errno = EINVAL;
+			break;
+		}
+
 		ret = rte_timer_alt_reset(sw->timer_data_id, tim, cycles,
 					  type, lcore_id, NULL, evtims[i]);
 		if (ret < 0) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.560124200 +0800
+++ 0083-eventdev-timer-fix-overflow.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca Mon Sep 17 00:00:00 2001
+From f7825956c03a7e1b86cc07a26fc6f24dfb1d0275 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 13aba5f88d2e1bd8644a2d52fd6b1e4fc73fc3ca ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 7f4f347369..23eb1d4a7d 100644
+index a0f14bf861..b07b3837d5 100644
@@ -28 +30 @@
-@@ -18,6 +18,7 @@
+@@ -17,6 +17,7 @@
@@ -36 +38 @@
-@@ -734,13 +735,51 @@ swtim_callback(struct rte_timer *tim)
+@@ -699,13 +700,51 @@ swtim_callback(struct rte_timer *tim)
@@ -93 +95 @@
-@@ -774,23 +813,6 @@ swtim_did_tick(struct swtim *sw)
+@@ -739,23 +778,6 @@ swtim_did_tick(struct swtim *sw)
@@ -117 +119 @@
-@@ -1210,21 +1232,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1140,21 +1162,6 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
@@ -139 +141 @@
-@@ -1240,7 +1247,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,
+@@ -1170,7 +1177,21 @@ __swtim_arm_burst(const struct rte_event_timer_adapter *adapter,

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

* patch 'eal: cleanup alarm and hotplug before memory detach' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (80 preceding siblings ...)
  2023-02-27  6:59   ` patch 'eventdev/timer: fix overflow' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vhost: decrease log level for unimplemented requests' " Xueming Li
                     ` (75 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Fengnan Chang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0772cc1d89c8e74cd4ee09650676d1a23467039e Mon Sep 17 00:00:00 2001
From: Fengnan Chang <changfengnan@bytedance.com>
Date: Wed, 21 Dec 2022 11:41:52 +0800
Subject: [PATCH] eal: cleanup alarm and hotplug before memory detach
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cc75968228576250159918ec1531eecc606bc423 ]

Alarm and multiprocess hotplug still need access hugepage memory,
if alarm event processed after memory detach, it may cause SEGV.
So cleanup alarm and multiprocess hotplug before memory detach.

Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources")

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
---
 .mailmap              | 1 +
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.mailmap b/.mailmap
index e68cc9a6b4..736f62c206 100644
--- a/.mailmap
+++ b/.mailmap
@@ -372,6 +372,7 @@ Farah Smith <farah.smith@broadcom.com>
 Fei Chen <chenwei.0515@bytedance.com>
 Feifei Wang <feifei.wang2@arm.com> <feifei.wang@arm.com>
 Fei Qin <fei.qin@corigine.com>
+Fengnan Chang <changfengnan@bytedance.com>
 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>
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 607684c1a3..390e4257ff 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -896,9 +896,9 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1372,11 +1372,11 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	eal_mp_dev_hotplug_cleanup();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	eal_mp_dev_hotplug_cleanup();
 	rte_eal_malloc_heap_cleanup();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	rte_eal_log_cleanup();
 	return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.588132300 +0800
+++ 0084-eal-cleanup-alarm-and-hotplug-before-memory-detach.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From cc75968228576250159918ec1531eecc606bc423 Mon Sep 17 00:00:00 2001
+From 0772cc1d89c8e74cd4ee09650676d1a23467039e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cc75968228576250159918ec1531eecc606bc423 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 5015494210..9501257c17 100644
+index e68cc9a6b4..736f62c206 100644
@@ -34 +36 @@
-index 930340128d..7db4239c51 100644
+index 607684c1a3..390e4257ff 100644
@@ -49 +51 @@
-index d4c3507d16..fabafbc39b 100644
+index 8c118d0d9f..c76f026023 100644
@@ -52 +54 @@
-@@ -1374,11 +1374,11 @@ rte_eal_cleanup(void)
+@@ -1372,11 +1372,11 @@ rte_eal_cleanup(void)

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

* patch 'vhost: decrease log level for unimplemented requests' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (81 preceding siblings ...)
  2023-02-27  6:59   ` patch 'eal: cleanup alarm and hotplug before memory detach' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks' " Xueming Li
                     ` (74 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, Kevin Traynor, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cf313170bf580ef921b9c3df614f2fd57542c49e Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Mon, 6 Feb 2023 16:07:33 +0100
Subject: [PATCH] vhost: decrease log level for unimplemented requests
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 43ccd55fdd6ab34b55060045594cc21aefa74383 ]

This patch changes VHOST_USER_SET_VRING_ERR and
VHOST_USER_SET_LOG_FD "not implemented" log levels from
INFO to DEBUG, as implementing these requests is not
mandatory. Having them being displayed at INFO level
may induce some confusion to the end-user.

Fixes: fd29c33b651a ("vhost: handle unsupported message types in functions")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
---
 lib/vhost/vhost_user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 9902ae9944..76058c3ee5 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -1809,7 +1809,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev,

 	if (!(ctx->msg.payload.u64 & VHOST_USER_VRING_NOFD_MASK))
 		close(ctx->fds[0]);
-	VHOST_LOG_CONFIG(dev->ifname, INFO, "not implemented\n");
+	VHOST_LOG_CONFIG(dev->ifname, DEBUG, "not implemented\n");

 	return RTE_VHOST_MSG_RESULT_OK;
 }
@@ -2326,7 +2326,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev,
 		return RTE_VHOST_MSG_RESULT_ERR;

 	close(ctx->fds[0]);
-	VHOST_LOG_CONFIG(dev->ifname, INFO, "not implemented.\n");
+	VHOST_LOG_CONFIG(dev->ifname, DEBUG, "not implemented.\n");

 	return RTE_VHOST_MSG_RESULT_OK;
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.622360000 +0800
+++ 0085-vhost-decrease-log-level-for-unimplemented-requests.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From 43ccd55fdd6ab34b55060045594cc21aefa74383 Mon Sep 17 00:00:00 2001
+From cf313170bf580ef921b9c3df614f2fd57542c49e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 43ccd55fdd6ab34b55060045594cc21aefa74383 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 8c1d60b76b..b4236820a2 100644
+index 9902ae9944..76058c3ee5 100644
@@ -26 +28 @@
-@@ -1818,7 +1818,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev,
+@@ -1809,7 +1809,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev,
@@ -35 +37 @@
-@@ -2340,7 +2340,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev,
+@@ -2326,7 +2326,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev,

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

* patch 'vhost: fix possible FD leaks' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (82 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vhost: decrease log level for unimplemented requests' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks on truncation' " Xueming Li
                     ` (73 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From eab1940f972ccb8b4abc045254693e268b5a0fcf Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 7 Feb 2023 17:22:39 +0100
Subject: [PATCH] vhost: fix possible FD leaks
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 585283f9a703fcd994dbf9aca07dea9445319862 ]

On failure, read_vhost_message() only closed the message
FDs if the header size was unexpected, but there are other
cases where it is required. For example in the case the
payload size read from the header is greater than the
expected maximum payload size.

This patch fixes this by closing all messages FDs in all
error cases. It also improve error logging by displaying
the request name when failure happens if possible.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/vhost/vhost_user.c | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 76058c3ee5..8df66e68b3 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2817,29 +2817,36 @@ read_vhost_message(struct virtio_net *dev, int sockfd, struct  vhu_msg_context *

 	ret = read_fd_message(dev->ifname, sockfd, (char *)&ctx->msg, VHOST_USER_HDR_SIZE,
 		ctx->fds, VHOST_MEMORY_MAX_NREGIONS, &ctx->fd_num);
-	if (ret <= 0) {
-		return ret;
-	} else if (ret != VHOST_USER_HDR_SIZE) {
+	if (ret <= 0)
+		goto out;
+
+	if (ret != VHOST_USER_HDR_SIZE) {
 		VHOST_LOG_CONFIG(dev->ifname, ERR, "Unexpected header size read\n");
-		close_msg_fds(ctx);
-		return -1;
+		ret = -1;
+		goto out;
 	}

 	if (ctx->msg.size) {
 		if (ctx->msg.size > sizeof(ctx->msg.payload)) {
 			VHOST_LOG_CONFIG(dev->ifname, ERR, "invalid msg size: %d\n",
 				ctx->msg.size);
-			return -1;
+			ret = -1;
+			goto out;
 		}
 		ret = read(sockfd, &ctx->msg.payload, ctx->msg.size);
 		if (ret <= 0)
-			return ret;
+			goto out;
 		if (ret != (int)ctx->msg.size) {
 			VHOST_LOG_CONFIG(dev->ifname, ERR, "read control message failed\n");
-			return -1;
+			ret = -1;
+			goto out;
 		}
 	}

+out:
+	if (ret <= 0)
+		close_msg_fds(ctx);
+
 	return ret;
 }

@@ -2987,13 +2994,10 @@ vhost_user_msg_handler(int vid, int fd)
 		}
 	}

+	ctx.msg.request.master = VHOST_USER_NONE;
 	ret = read_vhost_message(dev, fd, &ctx);
-	if (ret <= 0) {
-		if (ret < 0)
-			VHOST_LOG_CONFIG(dev->ifname, ERR, "vhost read message failed\n");
-		else
-			VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n");
-
+	if (ret == 0) {
+		VHOST_LOG_CONFIG(dev->ifname, INFO, "vhost peer closed\n");
 		return -1;
 	}

@@ -3003,6 +3007,14 @@ vhost_user_msg_handler(int vid, int fd)
 	else
 		msg_handler = NULL;

+	if (ret < 0) {
+		VHOST_LOG_CONFIG(dev->ifname, ERR, "vhost read message %s%s%sfailed\n",
+				msg_handler != NULL ? "for " : "",
+				msg_handler != NULL ? msg_handler->description : "",
+				msg_handler != NULL ? " " : "");
+		return -1;
+	}
+
 	if (msg_handler != NULL && msg_handler->description != NULL) {
 		if (request != VHOST_USER_IOTLB_MSG)
 			VHOST_LOG_CONFIG(dev->ifname, INFO,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.654922800 +0800
+++ 0086-vhost-fix-possible-FD-leaks.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From 585283f9a703fcd994dbf9aca07dea9445319862 Mon Sep 17 00:00:00 2001
+From eab1940f972ccb8b4abc045254693e268b5a0fcf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 585283f9a703fcd994dbf9aca07dea9445319862 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index b4236820a2..d702d082dd 100644
+index 76058c3ee5..8df66e68b3 100644
@@ -30 +32 @@
-@@ -2831,29 +2831,36 @@ read_vhost_message(struct virtio_net *dev, int sockfd, struct  vhu_msg_context *
+@@ -2817,29 +2817,36 @@ read_vhost_message(struct virtio_net *dev, int sockfd, struct  vhu_msg_context *
@@ -75 +77 @@
-@@ -3031,13 +3038,10 @@ vhost_user_msg_handler(int vid, int fd)
+@@ -2987,13 +2994,10 @@ vhost_user_msg_handler(int vid, int fd)
@@ -92 +94 @@
-@@ -3047,6 +3051,14 @@ vhost_user_msg_handler(int vid, int fd)
+@@ -3003,6 +3007,14 @@ vhost_user_msg_handler(int vid, int fd)

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

* patch 'vhost: fix possible FD leaks on truncation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (83 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/virtio-user: fix device starting failure handling' " Xueming Li
                     ` (72 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: David Marchand, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 78d828c2475d7cb1e6492688d62a5949ad67288e Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Tue, 7 Feb 2023 17:22:40 +0100
Subject: [PATCH] vhost: fix possible FD leaks on truncation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 218daf1664561eca787369c13e1a9ea5cdaad2a8 ]

This patch fixes possible FDs leaks when truncation happens
on either the message buffer or its control data. Indeed,
by returning early, it did not let a chance to retrieve the
FDs passed as ancillary data, and so caused a potential FDs
leak.

This patch fixes this by extracting the FDs from the
ancillary data as long as recvmsg() call succeeded. It also
improves the logs to differentiate between MSG_TRUNC and
MSG_CTRUNC.

Fixes: bf472259dde6 ("vhost: fix possible denial of service by leaking FDs")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 lib/vhost/socket.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 863a6f6d52..669c322e12 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -129,10 +129,12 @@ read_fd_message(char *ifname, int sockfd, char *buf, int buflen, int *fds, int m
 		return ret;
 	}

-	if (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) {
+	if (msgh.msg_flags & MSG_TRUNC)
 		VHOST_LOG_CONFIG(ifname, ERR, "truncated msg (fd %d)\n", sockfd);
-		return -1;
-	}
+
+	/* MSG_CTRUNC may be caused by LSM misconfiguration */
+	if (msgh.msg_flags & MSG_CTRUNC)
+		VHOST_LOG_CONFIG(ifname, ERR, "truncated control data (fd %d)\n", sockfd);

 	for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg != NULL;
 		cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.685852700 +0800
+++ 0087-vhost-fix-possible-FD-leaks-on-truncation.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From 218daf1664561eca787369c13e1a9ea5cdaad2a8 Mon Sep 17 00:00:00 2001
+From 78d828c2475d7cb1e6492688d62a5949ad67288e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 218daf1664561eca787369c13e1a9ea5cdaad2a8 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/virtio-user: fix device starting failure handling' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (84 preceding siblings ...)
  2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks on truncation' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/hns3: declare flow rule keeping capability' " Xueming Li
                     ` (71 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 58910572e8b2d796508a61cccd5a3344cc2249e2 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin@redhat.com>
Date: Thu, 9 Feb 2023 10:17:01 +0100
Subject: [PATCH] net/virtio-user: fix device starting failure handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c1a6f787b04e470ebe9b5a3891022195eb2bc555 ]

If the device fails to start, read the status from the
device and return early.

Fixes: 57912824615f ("net/virtio-user: support vhost status setting")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index d32abec327..78b1ed9ace 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -90,10 +90,15 @@ virtio_user_set_status(struct virtio_hw *hw, uint8_t status)
 	if (status & VIRTIO_CONFIG_STATUS_FEATURES_OK &&
 			~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK)
 		virtio_user_dev_set_features(dev);
-	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)
-		virtio_user_start_device(dev);
-	else if (status == VIRTIO_CONFIG_STATUS_RESET)
+
+	if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) {
+		if (virtio_user_start_device(dev)) {
+			virtio_user_dev_update_status(dev);
+			return;
+		}
+	} else if (status == VIRTIO_CONFIG_STATUS_RESET) {
 		virtio_user_reset(hw);
+	}

 	virtio_user_dev_set_status(dev, status);
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.712403600 +0800
+++ 0088-net-virtio-user-fix-device-starting-failure-handling.patch	2023-02-27 14:08:40.809237000 +0800
@@ -1 +1 @@
-From c1a6f787b04e470ebe9b5a3891022195eb2bc555 Mon Sep 17 00:00:00 2001
+From 58910572e8b2d796508a61cccd5a3344cc2249e2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c1a6f787b04e470ebe9b5a3891022195eb2bc555 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: declare flow rule keeping capability' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (85 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/virtio-user: fix device starting failure handling' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'doc: fix description of L2TPV2 flow item' " Xueming Li
                     ` (70 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5876103dd269e967abd2d0cf697fa5f5b9f8f12f Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 15 Dec 2022 01:41:41 +0000
Subject: [PATCH] net/hns3: declare flow rule keeping capability
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 27fd46521517cae0f456dad850a04f18de0690f8 ]

The driver supports create flow rules when device is stopped, and
re-setup flow rules when restarting, so declare support
RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP.

The driver also supports to create indirect actions when device is
stopped, and keeps the indirect actions when restarting, so declare
support RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 7adc6a4972..da0a481f15 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -90,10 +90,11 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	if (hns3_dev_get_support(hw, OUTER_UDP_CKSUM))
 		info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM;

+	info->dev_capa = RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP |
+			 RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP;
 	if (hns3_dev_get_support(hw, INDEP_TXRX))
-		info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
-				 RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
-	info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
+		info->dev_capa |= RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
+				  RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;

 	if (hns3_dev_get_support(hw, PTP))
 		info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.740798600 +0800
+++ 0089-net-hns3-declare-flow-rule-keeping-capability.patch	2023-02-27 14:08:40.819237000 +0800
@@ -1 +1 @@
-From 27fd46521517cae0f456dad850a04f18de0690f8 Mon Sep 17 00:00:00 2001
+From 5876103dd269e967abd2d0cf697fa5f5b9f8f12f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 27fd46521517cae0f456dad850a04f18de0690f8 ]
@@ -13,2 +15,0 @@
-
-Cc: stable@dpdk.org

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

* patch 'doc: fix description of L2TPV2 flow item' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (86 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/hns3: declare flow rule keeping capability' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'app/testpmd: fix forwarding stats for Tx dropped' " Xueming Li
                     ` (69 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Andrew Rybchenko, Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8eefe1d245d757bdea432ca52ef5d6e38dc8c079 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Tue, 25 Oct 2022 23:44:09 +0200
Subject: [PATCH] doc: fix description of L2TPV2 flow item
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a7d0dd8693417fbecb0debe7b4aec96dbafed51a ]

The flow item structure includes the protocol definition
from the directory lib/net/, so it is reflected in the guide.

Section title underlining is also fixed around.

Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 doc/guides/prog_guide/rte_flow.rst | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..40d3f5bd44 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1513,22 +1513,15 @@ rte_flow_flex_item_create() routine.
   value and mask.

 Item: ``L2TPV2``
-^^^^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^

 Matches a L2TPv2 header.

-- ``flags_version``: flags(12b), version(4b).
-- ``length``: total length of the message.
-- ``tunnel_id``: identifier for the control connection.
-- ``session_id``: identifier for a session within a tunnel.
-- ``ns``: sequence number for this date or control message.
-- ``nr``: sequence number expected in the next control message to be received.
-- ``offset_size``: offset of payload data.
-- ``offset_padding``: offset padding, variable length.
+- ``hdr``:  header definition (``rte_l2tpv2.h``).
 - Default ``mask`` matches flags_version only.

 Item: ``PPP``
-^^^^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^

 Matches a PPP header.

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.770334600 +0800
+++ 0090-doc-fix-description-of-L2TPV2-flow-item.patch	2023-02-27 14:08:40.819237000 +0800
@@ -1 +1 @@
-From a7d0dd8693417fbecb0debe7b4aec96dbafed51a Mon Sep 17 00:00:00 2001
+From 8eefe1d245d757bdea432ca52ef5d6e38dc8c079 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a7d0dd8693417fbecb0debe7b4aec96dbafed51a ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 59dfec1139..e465662da3 100644
+index 3e6242803d..40d3f5bd44 100644
@@ -26 +28 @@
-@@ -1498,22 +1498,15 @@ rte_flow_flex_item_create() routine.
+@@ -1513,22 +1513,15 @@ rte_flow_flex_item_create() routine.

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

* patch 'app/testpmd: fix forwarding stats for Tx dropped' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (87 preceding siblings ...)
  2023-02-27  6:59   ` patch 'doc: fix description of L2TPV2 flow item' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  6:59   ` patch 'net/txgbe: fix default signal quality value for KX/KX4' " Xueming Li
                     ` (68 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Joshua Washington, Huisong Li, Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a1d3811bc0ca7d7031319f2fc4a1fbee8a6d14b5 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Tue, 31 Jan 2023 11:56:03 +0000
Subject: [PATCH] app/testpmd: fix forwarding stats for Tx dropped
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]

There is an inconsistency at displaying Tx dropped value for per port
forwarding stats and accumulated forwarding stats.

While displaying per port TX-dropped value, it only takes
'ports_stats[pt_id].tx_dropped' into account,
but for accumulated TX-dropped results it takes both
'ports_stats[pt_id].tx_dropped' & 'stats.oerrors' into account.

To fix, make both per port and accumulated stats display 'tx_dropped'
and 'stats.oerrors' (ports_stats[pt_id].tx_dropped + stats.oerrors).

Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")

Reported-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/testpmd.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e366f81a0f..3c404c8a6e 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2056,6 +2056,8 @@ fwd_stats_display(void)
 			fwd_cycles += fs->core_cycles;
 	}
 	for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
+		uint64_t tx_dropped = 0;
+
 		pt_id = fwd_ports_ids[i];
 		port = &ports[pt_id];

@@ -2077,8 +2079,9 @@ fwd_stats_display(void)
 		total_recv += stats.ipackets;
 		total_xmit += stats.opackets;
 		total_rx_dropped += stats.imissed;
-		total_tx_dropped += ports_stats[pt_id].tx_dropped;
-		total_tx_dropped += stats.oerrors;
+		tx_dropped += ports_stats[pt_id].tx_dropped;
+		tx_dropped += stats.oerrors;
+		total_tx_dropped += tx_dropped;
 		total_rx_nombuf  += stats.rx_nombuf;

 		printf("\n  %s Forward statistics for port %-2d %s\n",
@@ -2105,8 +2108,8 @@ fwd_stats_display(void)

 		printf("  TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64
 		       "TX-total: %-"PRIu64"\n",
-		       stats.opackets, ports_stats[pt_id].tx_dropped,
-		       stats.opackets + ports_stats[pt_id].tx_dropped);
+		       stats.opackets, tx_dropped,
+		       stats.opackets + tx_dropped);

 		if (record_burst_stats) {
 			if (ports_stats[pt_id].rx_stream)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.803353700 +0800
+++ 0091-app-testpmd-fix-forwarding-stats-for-Tx-dropped.patch	2023-02-27 14:08:40.819237000 +0800
@@ -1 +1 @@
-From c3fd1e6089cce14ad3f941ab5df0501e03b3356c Mon Sep 17 00:00:00 2001
+From a1d3811bc0ca7d7031319f2fc4a1fbee8a6d14b5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c3fd1e6089cce14ad3f941ab5df0501e03b3356c ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 86fa9c16ba..f3e29a5b4b 100644
+index e366f81a0f..3c404c8a6e 100644
@@ -32,2 +34,2 @@
-@@ -2061,6 +2061,8 @@ fwd_stats_display(void)
- 			fwd_cycles += fs->busy_cycles;
+@@ -2056,6 +2056,8 @@ fwd_stats_display(void)
+ 			fwd_cycles += fs->core_cycles;
@@ -41 +43 @@
-@@ -2082,8 +2084,9 @@ fwd_stats_display(void)
+@@ -2077,8 +2079,9 @@ fwd_stats_display(void)
@@ -53 +55 @@
-@@ -2110,8 +2113,8 @@ fwd_stats_display(void)
+@@ -2105,8 +2108,8 @@ fwd_stats_display(void)

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

* patch 'net/txgbe: fix default signal quality value for KX/KX4' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (88 preceding siblings ...)
  2023-02-27  6:59   ` patch 'app/testpmd: fix forwarding stats for Tx dropped' " Xueming Li
@ 2023-02-27  6:59   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/txgbe: fix packet type to parse from offload flags' " Xueming Li
                     ` (67 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  6:59 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e7149d390bde6ed9db0ecb32883cce1b34a49ba1 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:25 +0800
Subject: [PATCH] net/txgbe: fix default signal quality value for KX/KX4
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7211175417d4f6a7b03a0e7e7355dc62fced8512 ]

On old firmware versions, the default value of signal quality(TX_EQ) is
configured by the driver. Fix it for KX/KX4 mode.

Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_phy.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index 9f46d5bdb0..87935abdaa 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -1693,9 +1693,10 @@ txgbe_set_link_to_kx4(struct txgbe_hw *hw, bool autoneg)
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 	} else if (hw->fw_version <= TXGBE_FW_N_TXEQ) {
 		value = (0x1804 & ~0x3F3F);
+		value |= 40 << 8;
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);

-		value = (0x50 & ~0x7F) | 40 | (1 << 6);
+		value = (0x50 & ~0x7F) | (1 << 6);
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 	}
 out:
@@ -1907,10 +1908,10 @@ txgbe_set_link_to_kx(struct txgbe_hw *hw,
 		value |= hw->phy.ffe_post | (1 << 6);
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 	} else if (hw->fw_version <= TXGBE_FW_N_TXEQ) {
-		value = (0x1804 & ~0x3F3F) | (24 << 8) | 4;
+		value = (0x1804 & ~0x3F3F) | (40 << 8);
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL0, value);

-		value = (0x50 & ~0x7F) | 16 | (1 << 6);
+		value = (0x50 & ~0x7F) | (1 << 6);
 		wr32_epcs(hw, TXGBE_PHY_TX_EQ_CTL1, value);
 	}
 out:
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.836867800 +0800
+++ 0092-net-txgbe-fix-default-signal-quality-value-for-KX-KX.patch	2023-02-27 14:08:40.819237000 +0800
@@ -1 +1 @@
-From 7211175417d4f6a7b03a0e7e7355dc62fced8512 Mon Sep 17 00:00:00 2001
+From e7149d390bde6ed9db0ecb32883cce1b34a49ba1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7211175417d4f6a7b03a0e7e7355dc62fced8512 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/txgbe: fix packet type to parse from offload flags' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (89 preceding siblings ...)
  2023-02-27  6:59   ` patch 'net/txgbe: fix default signal quality value for KX/KX4' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/ngbe: " Xueming Li
                     ` (66 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c96c4e1b9e4058e655db4b3d5849ffbcfe6f249a Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:26 +0800
Subject: [PATCH] net/txgbe: fix packet type to parse from offload flags
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0e32d6edd47914d38857c34d97416b9c91929020 ]

Context descriptors which contains the length of each packet layer and
the packet type are needed when Tx checksum offload or TSO is on. If the
packet type and length do not strictly match, it will cause Tx ring hang.

In some external applications, developers may fill in wrong packet_type
in rte_mbuf for Tx path. For example, they encap/decap the packets but
did not refill the packet_type. To prevent this, change it to parse from
ol_flags.

Fixes: ca46fcd753b1 ("net/txgbe: support Tx with hardware offload")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_rxtx.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index ac1bba08a3..021f281fbb 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -516,20 +516,21 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)
 	return cmdtype;
 }

-static inline uint8_t
-tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
+static inline uint32_t
+tx_desc_ol_flags_to_ptype(uint64_t oflags)
 {
+	uint32_t ptype;
 	bool tun;

-	if (ptype)
-		return txgbe_encode_ptype(ptype);
-
 	/* Only support flags in TXGBE_TX_OFFLOAD_MASK */
 	tun = !!(oflags & RTE_MBUF_F_TX_TUNNEL_MASK);

 	/* L2 level */
 	ptype = RTE_PTYPE_L2_ETHER;
 	if (oflags & RTE_MBUF_F_TX_VLAN)
+		ptype |= (tun ? RTE_PTYPE_INNER_L2_ETHER_VLAN : RTE_PTYPE_L2_ETHER_VLAN);
+
+	if (oflags & RTE_MBUF_F_TX_QINQ) /* tunnel + QINQ is not supported */
 		ptype |= RTE_PTYPE_L2_ETHER_VLAN;

 	/* L3 level */
@@ -587,6 +588,16 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
 		break;
 	}

+	return ptype;
+}
+
+static inline uint8_t
+tx_desc_ol_flags_to_ptid(uint64_t oflags)
+{
+	uint32_t ptype;
+
+	ptype = tx_desc_ol_flags_to_ptype(oflags);
+
 	return txgbe_encode_ptype(ptype);
 }

@@ -776,8 +787,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		/* If hardware offload required */
 		tx_ol_req = ol_flags & TXGBE_TX_OFFLOAD_MASK;
 		if (tx_ol_req) {
-			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req,
-					tx_pkt->packet_type);
+			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req);
 			if (tx_offload.ptid & TXGBE_PTID_PKT_TUN)
 				tx_offload.ptid |= txgbe_parse_tun_ptid(tx_pkt);
 			tx_offload.l2_len = tx_pkt->l2_len;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.865873500 +0800
+++ 0093-net-txgbe-fix-packet-type-to-parse-from-offload-flag.patch	2023-02-27 14:08:40.819237000 +0800
@@ -1 +1 @@
-From 0e32d6edd47914d38857c34d97416b9c91929020 Mon Sep 17 00:00:00 2001
+From c96c4e1b9e4058e655db4b3d5849ffbcfe6f249a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0e32d6edd47914d38857c34d97416b9c91929020 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ngbe: fix packet type to parse from offload flags' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (90 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/txgbe: fix packet type to parse from offload flags' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/ngbe: add spinlock protection on YT PHY' " Xueming Li
                     ` (65 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 767d609db761c5f511da65e68aa335058c0781b5 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:27 +0800
Subject: [PATCH] net/ngbe: fix packet type to parse from offload flags
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fa402b1e02b71a20aabef27733cbb75431363620 ]

Context descriptors which contains the length of each packet layer and
the packet type are needed when Tx checksum offload or TSO is on. If the
packet type and length do not strictly match, it will cause Tx ring hang.

In some external applications, developers may fill in wrong packet_type
in rte_mbuf for Tx path. For example, they encap/decap the packets but
did not refill the packet_type. To prevent this, change it to parse from
ol_flags.

And remove redundant tunnel type since the NIC does not support it.

Fixes: 9f3206140274 ("net/ngbe: support TSO")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ngbe/ngbe_rxtx.c | 92 +++++++++---------------------------
 1 file changed, 23 insertions(+), 69 deletions(-)

diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c
index 9fd24fa444..0c678e1557 100644
--- a/drivers/net/ngbe/ngbe_rxtx.c
+++ b/drivers/net/ngbe/ngbe_rxtx.c
@@ -24,15 +24,11 @@

 /* Bit Mask to indicate what bits required for building Tx context */
 static const u64 NGBE_TX_OFFLOAD_MASK = (RTE_MBUF_F_TX_IP_CKSUM |
-		RTE_MBUF_F_TX_OUTER_IPV6 |
-		RTE_MBUF_F_TX_OUTER_IPV4 |
 		RTE_MBUF_F_TX_IPV6 |
 		RTE_MBUF_F_TX_IPV4 |
 		RTE_MBUF_F_TX_VLAN |
 		RTE_MBUF_F_TX_L4_MASK |
 		RTE_MBUF_F_TX_TCP_SEG |
-		RTE_MBUF_F_TX_TUNNEL_MASK |
-		RTE_MBUF_F_TX_OUTER_IP_CKSUM |
 		NGBE_TX_IEEE1588_TMST);

 #define NGBE_TX_OFFLOAD_NOTSUP_MASK \
@@ -333,34 +329,15 @@ ngbe_set_xmit_ctx(struct ngbe_tx_queue *txq,
 	}

 	vlan_macip_lens = NGBE_TXD_IPLEN(tx_offload.l3_len >> 1);
-
-	if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
-		tx_offload_mask.outer_tun_len |= ~0;
-		tx_offload_mask.outer_l2_len |= ~0;
-		tx_offload_mask.outer_l3_len |= ~0;
-		tx_offload_mask.l2_len |= ~0;
-		tunnel_seed = NGBE_TXD_ETUNLEN(tx_offload.outer_tun_len >> 1);
-		tunnel_seed |= NGBE_TXD_EIPLEN(tx_offload.outer_l3_len >> 2);
-
-		switch (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
-		case RTE_MBUF_F_TX_TUNNEL_IPIP:
-			/* for non UDP / GRE tunneling, set to 0b */
-			break;
-		default:
-			PMD_TX_LOG(ERR, "Tunnel type not supported");
-			return;
-		}
-		vlan_macip_lens |= NGBE_TXD_MACLEN(tx_offload.outer_l2_len);
-	} else {
-		tunnel_seed = 0;
-		vlan_macip_lens |= NGBE_TXD_MACLEN(tx_offload.l2_len);
-	}
+	vlan_macip_lens |= NGBE_TXD_MACLEN(tx_offload.l2_len);

 	if (ol_flags & RTE_MBUF_F_TX_VLAN) {
 		tx_offload_mask.vlan_tci |= ~0;
 		vlan_macip_lens |= NGBE_TXD_VLAN(tx_offload.vlan_tci);
 	}

+	tunnel_seed = 0;
+
 	txq->ctx_cache[ctx_idx].flags = ol_flags;
 	txq->ctx_cache[ctx_idx].tx_offload.data[0] =
 		tx_offload_mask.data[0] & tx_offload.data[0];
@@ -449,16 +426,10 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags)
 	return cmdtype;
 }

-static inline uint8_t
-tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
+static inline uint32_t
+tx_desc_ol_flags_to_ptype(uint64_t oflags)
 {
-	bool tun;
-
-	if (ptype)
-		return ngbe_encode_ptype(ptype);
-
-	/* Only support flags in NGBE_TX_OFFLOAD_MASK */
-	tun = !!(oflags & RTE_MBUF_F_TX_TUNNEL_MASK);
+	uint32_t ptype;

 	/* L2 level */
 	ptype = RTE_PTYPE_L2_ETHER;
@@ -466,41 +437,36 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype)
 		ptype |= RTE_PTYPE_L2_ETHER_VLAN;

 	/* L3 level */
-	if (oflags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IP_CKSUM))
-		ptype |= RTE_PTYPE_L3_IPV4;
-	else if (oflags & (RTE_MBUF_F_TX_OUTER_IPV6))
-		ptype |= RTE_PTYPE_L3_IPV6;
-
 	if (oflags & (RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM))
-		ptype |= (tun ? RTE_PTYPE_INNER_L3_IPV4 : RTE_PTYPE_L3_IPV4);
+		ptype |= RTE_PTYPE_L3_IPV4;
 	else if (oflags & (RTE_MBUF_F_TX_IPV6))
-		ptype |= (tun ? RTE_PTYPE_INNER_L3_IPV6 : RTE_PTYPE_L3_IPV6);
+		ptype |= RTE_PTYPE_L3_IPV6;

 	/* L4 level */
 	switch (oflags & (RTE_MBUF_F_TX_L4_MASK)) {
 	case RTE_MBUF_F_TX_TCP_CKSUM:
-		ptype |= (tun ? RTE_PTYPE_INNER_L4_TCP : RTE_PTYPE_L4_TCP);
+		ptype |= RTE_PTYPE_L4_TCP;
 		break;
 	case RTE_MBUF_F_TX_UDP_CKSUM:
-		ptype |= (tun ? RTE_PTYPE_INNER_L4_UDP : RTE_PTYPE_L4_UDP);
+		ptype |= RTE_PTYPE_L4_UDP;
 		break;
 	case RTE_MBUF_F_TX_SCTP_CKSUM:
-		ptype |= (tun ? RTE_PTYPE_INNER_L4_SCTP : RTE_PTYPE_L4_SCTP);
+		ptype |= RTE_PTYPE_L4_SCTP;
 		break;
 	}

 	if (oflags & RTE_MBUF_F_TX_TCP_SEG)
-		ptype |= (tun ? RTE_PTYPE_INNER_L4_TCP : RTE_PTYPE_L4_TCP);
-
-	/* Tunnel */
-	switch (oflags & RTE_MBUF_F_TX_TUNNEL_MASK) {
-	case RTE_MBUF_F_TX_TUNNEL_IPIP:
-	case RTE_MBUF_F_TX_TUNNEL_IP:
-		ptype |= RTE_PTYPE_L2_ETHER |
-			 RTE_PTYPE_L3_IPV4 |
-			 RTE_PTYPE_TUNNEL_IP;
-		break;
-	}
+		ptype |= RTE_PTYPE_L4_TCP;
+
+	return ptype;
+}
+
+static inline uint8_t
+tx_desc_ol_flags_to_ptid(uint64_t oflags)
+{
+	uint32_t ptype;
+
+	ptype = tx_desc_ol_flags_to_ptype(oflags);

 	return ngbe_encode_ptype(ptype);
 }
@@ -622,16 +588,12 @@ ngbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		/* If hardware offload required */
 		tx_ol_req = ol_flags & NGBE_TX_OFFLOAD_MASK;
 		if (tx_ol_req) {
-			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req,
-					tx_pkt->packet_type);
+			tx_offload.ptid = tx_desc_ol_flags_to_ptid(tx_ol_req);
 			tx_offload.l2_len = tx_pkt->l2_len;
 			tx_offload.l3_len = tx_pkt->l3_len;
 			tx_offload.l4_len = tx_pkt->l4_len;
 			tx_offload.vlan_tci = tx_pkt->vlan_tci;
 			tx_offload.tso_segsz = tx_pkt->tso_segsz;
-			tx_offload.outer_l2_len = tx_pkt->outer_l2_len;
-			tx_offload.outer_l3_len = tx_pkt->outer_l3_len;
-			tx_offload.outer_tun_len = 0;

 			/* If new context need be built or reuse the exist ctx*/
 			ctx = what_ctx_update(txq, tx_ol_req, tx_offload);
@@ -752,10 +714,6 @@ ngbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 				 */
 				pkt_len -= (tx_offload.l2_len +
 					tx_offload.l3_len + tx_offload.l4_len);
-				pkt_len -=
-					(tx_pkt->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
-					? tx_offload.outer_l2_len +
-					  tx_offload.outer_l3_len : 0;
 			}

 			/*
@@ -1939,12 +1897,8 @@ ngbe_get_tx_port_offloads(struct rte_eth_dev *dev)
 		RTE_ETH_TX_OFFLOAD_UDP_CKSUM   |
 		RTE_ETH_TX_OFFLOAD_TCP_CKSUM   |
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM  |
-		RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
 		RTE_ETH_TX_OFFLOAD_TCP_TSO     |
 		RTE_ETH_TX_OFFLOAD_UDP_TSO	   |
-		RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO	|
-		RTE_ETH_TX_OFFLOAD_IP_TNL_TSO	|
-		RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO	|
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS;

 	if (hw->is_pf)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.895428200 +0800
+++ 0094-net-ngbe-fix-packet-type-to-parse-from-offload-flags.patch	2023-02-27 14:08:40.829237000 +0800
@@ -1 +1 @@
-From fa402b1e02b71a20aabef27733cbb75431363620 Mon Sep 17 00:00:00 2001
+From 767d609db761c5f511da65e68aa335058c0781b5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fa402b1e02b71a20aabef27733cbb75431363620 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ngbe: add spinlock protection on YT PHY' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (91 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/ngbe: " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/txgbe: fix interrupt loss' " Xueming Li
                     ` (64 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c22430a6e5ad6bb5f6b1975f64085b28ff53995b Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:28 +0800
Subject: [PATCH] net/ngbe: add spinlock protection on YT PHY
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 31a28a99fd8af98ceb4771c14dc0f4169f5fa991 ]

For yt8521s/yt8531s PHY, if other registers are accessing between
reads/writes of ext field registers, the value of ext filed registers
will get weird for unknown reasons. So it's protected when all of ext
field registers accessing.

Fixes: 44e97550ca68 ("net/ngbe: identify and reset PHY")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_phy_yt.c | 36 +++++++++++++++++++++++++++++
 drivers/net/ngbe/base/ngbe_type.h   |  1 +
 2 files changed, 37 insertions(+)

diff --git a/drivers/net/ngbe/base/ngbe_phy_yt.c b/drivers/net/ngbe/base/ngbe_phy_yt.c
index c88946f7c3..726d6c8ef5 100644
--- a/drivers/net/ngbe/base/ngbe_phy_yt.c
+++ b/drivers/net/ngbe/base/ngbe_phy_yt.c
@@ -100,11 +100,15 @@ s32 ngbe_write_phy_reg_sds_ext_yt(struct ngbe_hw *hw,

 s32 ngbe_init_phy_yt(struct ngbe_hw *hw)
 {
+	rte_spinlock_init(&hw->phy_lock);
+
+	rte_spinlock_lock(&hw->phy_lock);
 	/* close sds area register */
 	ngbe_write_phy_reg_ext_yt(hw, YT_SMI_PHY, 0, 0);
 	/* enable interrupts */
 	ngbe_write_phy_reg_mdi(hw, YT_INTR, 0,
 				YT_INTR_ENA_MASK | YT_SDS_INTR_ENA_MASK);
+	rte_spinlock_unlock(&hw->phy_lock);

 	hw->phy.set_phy_power(hw, false);

@@ -123,7 +127,9 @@ s32 ngbe_setup_phy_link_yt(struct ngbe_hw *hw, u32 speed,
 	hw->phy.autoneg_advertised = 0;

 	/* check chip_mode first */
+	rte_spinlock_lock(&hw->phy_lock);
 	ngbe_read_phy_reg_ext_yt(hw, YT_CHIP, 0, &value);
+	rte_spinlock_unlock(&hw->phy_lock);
 	if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(0)) {
 		/* UTP to rgmii */
 		if (!hw->mac.autoneg) {
@@ -146,11 +152,14 @@ s32 ngbe_setup_phy_link_yt(struct ngbe_hw *hw, u32 speed,
 			}
 			/* duplex full */
 			value |= YT_BCR_DUPLEX | YT_BCR_RESET;
+			rte_spinlock_lock(&hw->phy_lock);
 			ngbe_write_phy_reg_mdi(hw, YT_BCR, 0, value);
+			rte_spinlock_unlock(&hw->phy_lock);

 			goto skip_an;
 		}

+		rte_spinlock_lock(&hw->phy_lock);
 		/*disable 100/10base-T Self-negotiation ability*/
 		ngbe_read_phy_reg_mdi(hw, YT_ANA, 0, &value);
 		value &= ~(YT_ANA_100BASET_FULL | YT_ANA_100BASET_HALF |
@@ -189,6 +198,7 @@ s32 ngbe_setup_phy_link_yt(struct ngbe_hw *hw, u32 speed,
 		ngbe_read_phy_reg_mdi(hw, YT_BCR, 0, &value);
 		value |= YT_BCR_RESET | YT_BCR_ANE | YT_BCR_RESTART_AN;
 		ngbe_write_phy_reg_mdi(hw, YT_BCR, 0, value);
+		rte_spinlock_unlock(&hw->phy_lock);
 skip_an:
 		hw->phy.set_phy_power(hw, true);
 	} else if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(1)) {
@@ -199,6 +209,7 @@ skip_an:
 		value = YT_RGMII_CONF1_RXDELAY |
 			YT_RGMII_CONF1_TXDELAY_FE |
 			YT_RGMII_CONF1_TXDELAY;
+		rte_spinlock_lock(&hw->phy_lock);
 		ngbe_write_phy_reg_ext_yt(hw, YT_RGMII_CONF1, 0, value);
 		value = YT_CHIP_MODE_SEL(1) |
 			YT_CHIP_SW_LDO_EN |
@@ -225,17 +236,21 @@ skip_an:
 			value = YT_BCR_RESET | YT_BCR_DUPLEX |
 				YT_BCR_SPEED_SELECT1;
 		hw->phy.write_reg(hw, YT_BCR, 0, value);
+		rte_spinlock_unlock(&hw->phy_lock);

 		hw->phy.set_phy_power(hw, true);
 	} else if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(2)) {
 		hw->phy.set_phy_power(hw, true);

+		rte_spinlock_lock(&hw->phy_lock);
 		hw->phy.read_reg(hw, YT_SPST, 0, &value);
+		rte_spinlock_unlock(&hw->phy_lock);
 		if (value & YT_SPST_LINK) {
 			/* fiber up */
 			hw->phy.autoneg_advertised |= NGBE_LINK_SPEED_1GB_FULL;
 		} else {
 			/* utp up */
+			rte_spinlock_lock(&hw->phy_lock);
 			/*disable 100/10base-T Self-negotiation ability*/
 			ngbe_read_phy_reg_mdi(hw, YT_ANA, 0, &value);
 			value &= ~(YT_ANA_100BASET_FULL | YT_ANA_100BASET_HALF |
@@ -279,10 +294,12 @@ skip_an:
 			ngbe_read_phy_reg_mdi(hw, YT_BCR, 0, &value);
 			value |= YT_BCR_RESET;
 			ngbe_write_phy_reg_mdi(hw, YT_BCR, 0, value);
+			rte_spinlock_unlock(&hw->phy_lock);
 		}
 	} else if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(4)) {
 		hw->phy.autoneg_advertised |= NGBE_LINK_SPEED_1GB_FULL;

+		rte_spinlock_lock(&hw->phy_lock);
 		ngbe_read_phy_reg_ext_yt(hw, YT_RGMII_CONF1, 0, &value);
 		value |= YT_RGMII_CONF1_MODE;
 		ngbe_write_phy_reg_ext_yt(hw, YT_RGMII_CONF1, 0, value);
@@ -297,6 +314,7 @@ skip_an:
 		ngbe_read_phy_reg_ext_yt(hw, YT_CHIP, 0, &value);
 		value &= ~YT_SMI_PHY_SW_RST;
 		ngbe_write_phy_reg_ext_yt(hw, YT_CHIP, 0, value);
+		rte_spinlock_unlock(&hw->phy_lock);

 		hw->phy.set_phy_power(hw, true);
 	} else if ((value & YT_CHIP_MODE_MASK) == YT_CHIP_MODE_SEL(5)) {
@@ -320,7 +338,9 @@ skip_an:
 			}
 			/* duplex full */
 			value |= YT_BCR_DUPLEX | YT_BCR_RESET;
+			rte_spinlock_lock(&hw->phy_lock);
 			hw->phy.write_reg(hw, YT_BCR, 0, value);
+			rte_spinlock_unlock(&hw->phy_lock);

 			goto skip_an_sr;
 		}
@@ -339,19 +359,23 @@ skip_an:

 		/* duplex full */
 		value |= YT_BCR_DUPLEX | YT_BCR_RESET;
+		rte_spinlock_lock(&hw->phy_lock);
 		hw->phy.write_reg(hw, YT_BCR, 0, value);

 		/* software reset to make the above configuration take effect */
 		hw->phy.read_reg(hw, YT_BCR, 0, &value);
 		value |= YT_BCR_RESET | YT_BCR_ANE | YT_BCR_RESTART_AN;
 		hw->phy.write_reg(hw, 0x0, 0, value);
+		rte_spinlock_unlock(&hw->phy_lock);

 skip_an_sr:
 		hw->phy.set_phy_power(hw, true);
 	}

+	rte_spinlock_lock(&hw->phy_lock);
 	ngbe_write_phy_reg_ext_yt(hw, YT_SMI_PHY, 0, 0);
 	ngbe_read_phy_reg_mdi(hw, YT_INTR_STATUS, 0, &value);
+	rte_spinlock_unlock(&hw->phy_lock);

 	return 0;
 }
@@ -366,6 +390,7 @@ s32 ngbe_reset_phy_yt(struct ngbe_hw *hw)
 		hw->phy.type != ngbe_phy_yt8521s_sfi)
 		return NGBE_ERR_PHY_TYPE;

+	rte_spinlock_lock(&hw->phy_lock);
 	/* check chip_mode first */
 	ngbe_read_phy_reg_ext_yt(hw, YT_CHIP, 0, &ctrl);
 	if (ctrl & YT_CHIP_MODE_MASK) {
@@ -395,6 +420,7 @@ s32 ngbe_reset_phy_yt(struct ngbe_hw *hw)
 			msleep(1);
 		}
 	}
+	rte_spinlock_unlock(&hw->phy_lock);

 	if (i == YT_PHY_RST_WAIT_PERIOD) {
 		DEBUGOUT("PHY reset polling failed to complete.");
@@ -409,7 +435,9 @@ s32 ngbe_get_phy_advertised_pause_yt(struct ngbe_hw *hw, u8 *pause_bit)
 	u16 value;
 	s32 status = 0;

+	rte_spinlock_lock(&hw->phy_lock);
 	status = hw->phy.read_reg(hw, YT_ANA, 0, &value);
+	rte_spinlock_unlock(&hw->phy_lock);
 	value &= YT_FANA_PAUSE_MASK;
 	*pause_bit = (u8)(value >> 7);

@@ -421,7 +449,9 @@ s32 ngbe_get_phy_lp_advertised_pause_yt(struct ngbe_hw *hw, u8 *pause_bit)
 	u16 value;
 	s32 status = 0;

+	rte_spinlock_lock(&hw->phy_lock);
 	status = hw->phy.read_reg(hw, YT_LPAR, 0, &value);
+	rte_spinlock_unlock(&hw->phy_lock);
 	value &= YT_FLPAR_PAUSE_MASK;
 	*pause_bit = (u8)(value >> 7);

@@ -433,10 +463,12 @@ s32 ngbe_set_phy_pause_adv_yt(struct ngbe_hw *hw, u16 pause_bit)
 	u16 value;
 	s32 status = 0;

+	rte_spinlock_lock(&hw->phy_lock);
 	status = hw->phy.read_reg(hw, YT_ANA, 0, &value);
 	value &= ~YT_FANA_PAUSE_MASK;
 	value |= pause_bit;
 	status = hw->phy.write_reg(hw, YT_ANA, 0, value);
+	rte_spinlock_unlock(&hw->phy_lock);

 	return status;
 }
@@ -453,6 +485,7 @@ s32 ngbe_check_phy_link_yt(struct ngbe_hw *hw,
 	/* Initialize speed and link to default case */
 	*link_up = false;
 	*speed = NGBE_LINK_SPEED_UNKNOWN;
+	rte_spinlock_lock(&hw->phy_lock);

 	ngbe_write_phy_reg_ext_yt(hw, YT_SMI_PHY, 0, 0);
 	ngbe_read_phy_reg_mdi(hw, YT_INTR_STATUS, 0, &insr);
@@ -472,6 +505,7 @@ s32 ngbe_check_phy_link_yt(struct ngbe_hw *hw,
 			*link_up = true;
 	}

+	rte_spinlock_unlock(&hw->phy_lock);
 	if (*link_up) {
 		if (phy_speed == YT_SPST_SPEED_1000M)
 			*speed = NGBE_LINK_SPEED_1GB_FULL;
@@ -488,6 +522,7 @@ s32 ngbe_set_phy_power_yt(struct ngbe_hw *hw, bool on)
 {
 	u16 value = 0;

+	rte_spinlock_lock(&hw->phy_lock);
 	/* power down/up in fiber mode */
 	hw->phy.read_reg(hw, YT_BCR, 0, &value);
 	if (on)
@@ -504,6 +539,7 @@ s32 ngbe_set_phy_power_yt(struct ngbe_hw *hw, bool on)
 	else
 		value |= YT_BCR_PWDN;
 	ngbe_write_phy_reg_mdi(hw, YT_BCR, 0, value);
+	rte_spinlock_unlock(&hw->phy_lock);

 	return 0;
 }
diff --git a/drivers/net/ngbe/base/ngbe_type.h b/drivers/net/ngbe/base/ngbe_type.h
index aa5c41146c..05804eeab7 100644
--- a/drivers/net/ngbe/base/ngbe_type.h
+++ b/drivers/net/ngbe/base/ngbe_type.h
@@ -433,6 +433,7 @@ struct ngbe_hw {
 	bool gpio_ctl;
 	u32 led_conf;
 	bool init_phy;
+	rte_spinlock_t phy_lock;
 	struct {
 		u64 rx_qp_packets;
 		u64 tx_qp_packets;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.923887900 +0800
+++ 0095-net-ngbe-add-spinlock-protection-on-YT-PHY.patch	2023-02-27 14:08:40.829237000 +0800
@@ -1 +1 @@
-From 31a28a99fd8af98ceb4771c14dc0f4169f5fa991 Mon Sep 17 00:00:00 2001
+From c22430a6e5ad6bb5f6b1975f64085b28ff53995b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 31a28a99fd8af98ceb4771c14dc0f4169f5fa991 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/txgbe: fix interrupt loss' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (92 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/ngbe: add spinlock protection on YT PHY' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix log about indirection table size' " Xueming Li
                     ` (63 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 547a2c7a554afa70424215c3d5c8fa60d41c693c Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Thu, 2 Feb 2023 17:21:31 +0800
Subject: [PATCH] net/txgbe: fix interrupt loss
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 ]

Disable interrupt in the interrupt handling process will sometimes cause
interrupts to be lost.

Fixes: 2fc745e6b606 ("net/txgbe: add interrupt operation")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 86ef979b29..55777cb10a 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2949,9 +2949,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
 		rte_intr_type_get(intr_handle) != RTE_INTR_HANDLE_VFIO_MSIX)
 		wr32(hw, TXGBE_PX_INTA, 1);

-	/* clear all cause mask */
-	txgbe_disable_intr(hw);
-
 	/* read-on-clear nic registers here */
 	eicr = ((u32 *)hw->isb_mem)[TXGBE_ISB_MISC];
 	PMD_DRV_LOG(DEBUG, "eicr %x", eicr);
@@ -2974,6 +2971,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
 	if (eicr & TXGBE_ICRMISC_GPIO)
 		intr->flags |= TXGBE_FLAG_PHY_INTERRUPT;

+
+	((u32 *)hw->isb_mem)[TXGBE_ISB_MISC] = 0;
 	return 0;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.954138600 +0800
+++ 0096-net-txgbe-fix-interrupt-loss.patch	2023-02-27 14:08:40.829237000 +0800
@@ -1 +1 @@
-From a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 Mon Sep 17 00:00:00 2001
+From 547a2c7a554afa70424215c3d5c8fa60d41c693c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a4315c1434b6bf78a9e04bf5fa34d02e9b3afd35 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index ce7cf2506d..6e939b8ce3 100644
+index 86ef979b29..55777cb10a 100644
@@ -21 +23 @@
-@@ -2972,9 +2972,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+@@ -2949,9 +2949,6 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
@@ -31,3 +33,3 @@
-@@ -3000,6 +2997,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
- 	if (eicr & TXGBE_ICRMISC_HEAT)
- 		intr->flags |= TXGBE_FLAG_OVERHEAT;
+@@ -2974,6 +2971,8 @@ txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev,
+ 	if (eicr & TXGBE_ICRMISC_GPIO)
+ 		intr->flags |= TXGBE_FLAG_PHY_INTERRUPT;
@@ -35 +36,0 @@
-+	((u32 *)hw->isb_mem)[TXGBE_ISB_MISC] = 0;
@@ -36,0 +38 @@
++	((u32 *)hw->isb_mem)[TXGBE_ISB_MISC] = 0;

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

* patch 'net/hns3: fix log about indirection table size' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (93 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/txgbe: fix interrupt loss' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: extract common function to query device' " Xueming Li
                     ` (62 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ffc3022e2d5128017b9f8e392302d18ec4c0503f Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:51 +0800
Subject: [PATCH] net/hns3: fix log about indirection table size
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b55516a94246364f272db802f5dfb9aeb8d3a2f2 ]

The error log about indirection table size during initialization phase
of PF and VF is unreasonable.

In addition, VF driver should use error level to print this log.

Fixes: 0fce2c46dc16 ("net/hns3: fix RSS indirection table size")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 2 +-
 drivers/net/hns3/hns3_ethdev_vf.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index d326f70129..eb809cd8c9 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2679,7 +2679,7 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
 {
 	if (hw->rss_ind_tbl_size == 0 ||
 	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_err(hw, "the size of hash lookup table configured (%u) exceeds the maximum(%u)",
+		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
 			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
 		return -EINVAL;
 	}
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index d220522c43..e43815607a 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -718,8 +718,8 @@ hns3vf_check_dev_specifications(struct hns3_hw *hw)
 {
 	if (hw->rss_ind_tbl_size == 0 ||
 	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_warn(hw, "the size of hash lookup table configured (%u) exceeds the maximum(%u)",
-			  hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
+		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
 		return -EINVAL;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.985359100 +0800
+++ 0097-net-hns3-fix-log-about-indirection-table-size.patch	2023-02-27 14:08:40.829237000 +0800
@@ -1 +1 @@
-From b55516a94246364f272db802f5dfb9aeb8d3a2f2 Mon Sep 17 00:00:00 2001
+From ffc3022e2d5128017b9f8e392302d18ec4c0503f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b55516a94246364f272db802f5dfb9aeb8d3a2f2 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: extract common function to query device' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (94 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix log about indirection table size' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: refactor set RSS hash algorithm and key interface' " Xueming Li
                     ` (61 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 14d988ad25a775f3f0ebad992770426184222713 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:52 +0800
Subject: [PATCH] net/hns3: extract common function to query device
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 52a4e960b49c526dd1ad7c1e91ebcfa664a38e6d ]

Extract common function to query device specifications used by VF and
PF.

Fixes: 9c740336f024 ("net/hns3: get device specifications from firmware")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_common.c    | 75 +++++++++++++++++++++++++++++++
 drivers/net/hns3/hns3_common.h    |  2 +
 drivers/net/hns3/hns3_ethdev.c    | 63 --------------------------
 drivers/net/hns3/hns3_ethdev_vf.c | 65 +--------------------------
 4 files changed, 79 insertions(+), 126 deletions(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index da0a481f15..74d537d8d0 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -10,6 +10,7 @@
 #include "hns3_logs.h"
 #include "hns3_regs.h"
 #include "hns3_rxtx.h"
+#include "hns3_dcb.h"
 #include "hns3_common.h"

 int
@@ -846,3 +847,77 @@ hns3_get_pci_revision_id(struct hns3_hw *hw, uint8_t *revision_id)

 	return 0;
 }
+
+void
+hns3_set_default_dev_specifications(struct hns3_hw *hw)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+
+	hw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;
+	hw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;
+	hw->rss_key_size = HNS3_RSS_KEY_SIZE;
+	hw->intr.int_ql_max = HNS3_INTR_QL_NONE;
+
+	if (hns->is_vf)
+		return;
+
+	hw->max_tm_rate = HNS3_ETHER_MAX_RATE;
+}
+
+static void
+hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
+{
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+	struct hns3_dev_specs_0_cmd *req0;
+	struct hns3_dev_specs_1_cmd *req1;
+
+	req0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;
+	req1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;
+
+	hw->max_non_tso_bd_num = req0->max_non_tso_bd_num;
+	hw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);
+	hw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);
+	hw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);
+	hw->min_tx_pkt_len = req1->min_tx_pkt_len;
+
+	if (hns->is_vf)
+		return;
+
+	hw->max_tm_rate = rte_le_to_cpu_32(req0->max_tm_rate);
+}
+
+static int
+hns3_check_dev_specifications(struct hns3_hw *hw)
+{
+	if (hw->rss_ind_tbl_size == 0 ||
+	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
+		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+int
+hns3_query_dev_specifications(struct hns3_hw *hw)
+{
+	struct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];
+	int ret;
+	int i;
+
+	for (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {
+		hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,
+					  true);
+		desc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);
+	}
+	hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);
+
+	ret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);
+	if (ret)
+		return ret;
+
+	hns3_parse_dev_specifications(hw, desc);
+
+	return hns3_check_dev_specifications(hw);
+}
diff --git a/drivers/net/hns3/hns3_common.h b/drivers/net/hns3/hns3_common.h
index 5aa001f0cc..8eaeda26e7 100644
--- a/drivers/net/hns3/hns3_common.h
+++ b/drivers/net/hns3/hns3_common.h
@@ -60,5 +60,7 @@ void hns3_unmap_rx_interrupt(struct rte_eth_dev *dev);
 int hns3_restore_rx_interrupt(struct hns3_hw *hw);

 int hns3_get_pci_revision_id(struct hns3_hw *hw, uint8_t *revision_id);
+void hns3_set_default_dev_specifications(struct hns3_hw *hw);
+int hns3_query_dev_specifications(struct hns3_hw *hw);

 #endif /* HNS3_COMMON_H */
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index eb809cd8c9..ab565ce128 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2647,69 +2647,6 @@ hns3_parse_speed(int speed_cmd, uint32_t *speed)
 	return 0;
 }

-static void
-hns3_set_default_dev_specifications(struct hns3_hw *hw)
-{
-	hw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;
-	hw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;
-	hw->rss_key_size = HNS3_RSS_KEY_SIZE;
-	hw->max_tm_rate = HNS3_ETHER_MAX_RATE;
-	hw->intr.int_ql_max = HNS3_INTR_QL_NONE;
-}
-
-static void
-hns3_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
-{
-	struct hns3_dev_specs_0_cmd *req0;
-	struct hns3_dev_specs_1_cmd *req1;
-
-	req0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;
-	req1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;
-
-	hw->max_non_tso_bd_num = req0->max_non_tso_bd_num;
-	hw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);
-	hw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);
-	hw->max_tm_rate = rte_le_to_cpu_32(req0->max_tm_rate);
-	hw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);
-	hw->min_tx_pkt_len = req1->min_tx_pkt_len;
-}
-
-static int
-hns3_check_dev_specifications(struct hns3_hw *hw)
-{
-	if (hw->rss_ind_tbl_size == 0 ||
-	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
-			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int
-hns3_query_dev_specifications(struct hns3_hw *hw)
-{
-	struct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];
-	int ret;
-	int i;
-
-	for (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {
-		hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,
-					  true);
-		desc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);
-	}
-	hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);
-
-	ret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);
-	if (ret)
-		return ret;
-
-	hns3_parse_dev_specifications(hw, desc);
-
-	return hns3_check_dev_specifications(hw);
-}
-
 static int
 hns3_get_capability(struct hns3_hw *hw)
 {
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index e43815607a..d3c1bdf2c5 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -688,67 +688,6 @@ hns3vf_interrupt_handler(void *param)
 	hns3vf_enable_irq0(hw);
 }

-static void
-hns3vf_set_default_dev_specifications(struct hns3_hw *hw)
-{
-	hw->max_non_tso_bd_num = HNS3_MAX_NON_TSO_BD_PER_PKT;
-	hw->rss_ind_tbl_size = HNS3_RSS_IND_TBL_SIZE;
-	hw->rss_key_size = HNS3_RSS_KEY_SIZE;
-	hw->intr.int_ql_max = HNS3_INTR_QL_NONE;
-}
-
-static void
-hns3vf_parse_dev_specifications(struct hns3_hw *hw, struct hns3_cmd_desc *desc)
-{
-	struct hns3_dev_specs_0_cmd *req0;
-	struct hns3_dev_specs_1_cmd *req1;
-
-	req0 = (struct hns3_dev_specs_0_cmd *)desc[0].data;
-	req1 = (struct hns3_dev_specs_1_cmd *)desc[1].data;
-
-	hw->max_non_tso_bd_num = req0->max_non_tso_bd_num;
-	hw->rss_ind_tbl_size = rte_le_to_cpu_16(req0->rss_ind_tbl_size);
-	hw->rss_key_size = rte_le_to_cpu_16(req0->rss_key_size);
-	hw->intr.int_ql_max = rte_le_to_cpu_16(req0->intr_ql_max);
-	hw->min_tx_pkt_len = req1->min_tx_pkt_len;
-}
-
-static int
-hns3vf_check_dev_specifications(struct hns3_hw *hw)
-{
-	if (hw->rss_ind_tbl_size == 0 ||
-	    hw->rss_ind_tbl_size > HNS3_RSS_IND_TBL_SIZE_MAX) {
-		hns3_err(hw, "the indirection table size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
-			 hw->rss_ind_tbl_size, HNS3_RSS_IND_TBL_SIZE_MAX);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int
-hns3vf_query_dev_specifications(struct hns3_hw *hw)
-{
-	struct hns3_cmd_desc desc[HNS3_QUERY_DEV_SPECS_BD_NUM];
-	int ret;
-	int i;
-
-	for (i = 0; i < HNS3_QUERY_DEV_SPECS_BD_NUM - 1; i++) {
-		hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS,
-					  true);
-		desc[i].flag |= rte_cpu_to_le_16(HNS3_CMD_FLAG_NEXT);
-	}
-	hns3_cmd_setup_basic_desc(&desc[i], HNS3_OPC_QUERY_DEV_SPECS, true);
-
-	ret = hns3_cmd_send(hw, desc, HNS3_QUERY_DEV_SPECS_BD_NUM);
-	if (ret)
-		return ret;
-
-	hns3vf_parse_dev_specifications(hw, desc);
-
-	return hns3vf_check_dev_specifications(hw);
-}
-
 void
 hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported)
 {
@@ -826,7 +765,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 		return ret;

 	if (hw->revision < PCI_REVISION_ID_HIP09_A) {
-		hns3vf_set_default_dev_specifications(hw);
+		hns3_set_default_dev_specifications(hw);
 		hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
 		hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
 		hw->tso_mode = HNS3_TSO_SW_CAL_PSEUDO_H_CSUM;
@@ -837,7 +776,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
 		return 0;
 	}

-	ret = hns3vf_query_dev_specifications(hw);
+	ret = hns3_query_dev_specifications(hw);
 	if (ret) {
 		PMD_INIT_LOG(ERR,
 			     "failed to query dev specifications, ret = %d",
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.022828600 +0800
+++ 0098-net-hns3-extract-common-function-to-query-device.patch	2023-02-27 14:08:40.839237000 +0800
@@ -1 +1 @@
-From 52a4e960b49c526dd1ad7c1e91ebcfa664a38e6d Mon Sep 17 00:00:00 2001
+From 14d988ad25a775f3f0ebad992770426184222713 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 52a4e960b49c526dd1ad7c1e91ebcfa664a38e6d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: refactor set RSS hash algorithm and key interface' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (95 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: extract common function to query device' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix RSS key size compatibility' " Xueming Li
                     ` (60 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 36d6105f51c1a99385bf118968304777f38e1c7e Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:53 +0800
Subject: [PATCH] net/hns3: refactor set RSS hash algorithm and key interface
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 88347111eb53bc54c598dde81715a06ca1dbd132 ]

The hns3_rss_set_algo_key() is used to set RSS hash algorithm and key to
hardware.
The maximum execution time of the command sent to the firmware is
proportional to the length of the key.
However, now this times is fixed, which isn't good for key expansion.

In addition, hash algorithm comes from rss_info::hash_algo maintained in
the driver, which also isn't good for the usage of this function.

Interface is updated to get hash algorithm and key length as input
parameters.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  3 ++-
 drivers/net/hns3/hns3_rss.c  | 48 ++++++++++++++++--------------------
 drivers/net/hns3/hns3_rss.h  |  4 ++-
 3 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index a2c1589c39..95609f8483 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1494,7 +1494,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 	if (ret)
 		return ret;

-	ret = hns3_rss_set_algo_key(hw, rss_config->key);
+	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+				    rss_config->key, HNS3_RSS_KEY_SIZE);
 	if (ret)
 		return ret;

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index ca5a129234..3db7bf0445 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -277,45 +277,37 @@ static const struct {

 /*
  * rss_generic_config command function, opcode:0x0D01.
- * Used to set algorithm, key_offset and hash key of rss.
+ * Used to set algorithm and hash key of RSS.
  */
 int
-hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key)
+hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+		      const uint8_t *key, uint8_t key_len)
 {
-#define HNS3_KEY_OFFSET_MAX	3
-#define HNS3_SET_HASH_KEY_BYTE_FOUR	2
-
 	struct hns3_rss_generic_config_cmd *req;
 	struct hns3_cmd_desc desc;
-	uint32_t key_offset, key_size;
-	const uint8_t *key_cur;
-	uint8_t cur_offset;
+	const uint8_t *cur_key;
+	uint16_t cur_key_size;
+	uint16_t max_bd_num;
+	uint16_t idx;
 	int ret;

 	req = (struct hns3_rss_generic_config_cmd *)desc.data;

-	/*
-	 * key_offset=0, hash key byte0~15 is set to hardware.
-	 * key_offset=1, hash key byte16~31 is set to hardware.
-	 * key_offset=2, hash key byte32~39 is set to hardware.
-	 */
-	for (key_offset = 0; key_offset < HNS3_KEY_OFFSET_MAX; key_offset++) {
+	max_bd_num = DIV_ROUND_UP(key_len, HNS3_RSS_HASH_KEY_NUM);
+	for (idx = 0; idx < max_bd_num; idx++) {
 		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_GENERIC_CONFIG,
 					  false);

-		req->hash_config |=
-			(hw->rss_info.hash_algo & HNS3_RSS_HASH_ALGO_MASK);
-		req->hash_config |= (key_offset << HNS3_RSS_HASH_KEY_OFFSET_B);
+		req->hash_config |= (hash_algo & HNS3_RSS_HASH_ALGO_MASK);
+		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);

-		if (key_offset == HNS3_SET_HASH_KEY_BYTE_FOUR)
-			key_size = HNS3_RSS_KEY_SIZE - HNS3_RSS_HASH_KEY_NUM *
-			HNS3_SET_HASH_KEY_BYTE_FOUR;
+		if (idx == max_bd_num - 1)
+			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
 		else
-			key_size = HNS3_RSS_HASH_KEY_NUM;
+			cur_key_size = HNS3_RSS_HASH_KEY_NUM;

-		cur_offset = key_offset * HNS3_RSS_HASH_KEY_NUM;
-		key_cur = key + cur_offset;
-		memcpy(req->hash_key, key_cur, key_size);
+		cur_key = key + idx * HNS3_RSS_HASH_KEY_NUM;
+		memcpy(req->hash_key, cur_key, cur_key_size);

 		ret = hns3_cmd_send(hw, &desc, 1);
 		if (ret) {
@@ -518,7 +510,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 		goto set_tuple_fail;

 	if (key) {
-		ret = hns3_rss_set_algo_key(hw, key);
+		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+					    key, HNS3_RSS_KEY_SIZE);
 		if (ret)
 			goto set_algo_key_fail;
 	}
@@ -795,8 +788,9 @@ hns3_config_rss(struct hns3_adapter *hns)
 		break;
 	}

-	/* Configure RSS hash algorithm and hash key offset */
-	ret = hns3_rss_set_algo_key(hw, hash_key);
+	/* Configure RSS hash algorithm and hash key */
+	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo, hash_key,
+				    HNS3_RSS_KEY_SIZE);
 	if (ret)
 		return ret;

diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 8e8b056f4e..b7f62ca1ee 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -109,6 +109,8 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
-int hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key);
+int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+			  const uint8_t *key, uint8_t key_len);
+

 #endif /* HNS3_RSS_H */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.061767500 +0800
+++ 0099-net-hns3-refactor-set-RSS-hash-algorithm-and-key-int.patch	2023-02-27 14:08:40.839237000 +0800
@@ -1 +1 @@
-From 88347111eb53bc54c598dde81715a06ca1dbd132 Mon Sep 17 00:00:00 2001
+From 36d6105f51c1a99385bf118968304777f38e1c7e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 88347111eb53bc54c598dde81715a06ca1dbd132 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -30 +32 @@
-index e88f9b7e45..ac094c839f 100644
+index a2c1589c39..95609f8483 100644

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

* patch 'net/hns3: fix RSS key size compatibility' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (96 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: refactor set RSS hash algorithm and key interface' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix clearing RSS configuration' " Xueming Li
                     ` (59 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9126ed75beaa67eff3fb74cc1f920de488710d6c Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:54 +0800
Subject: [PATCH] net/hns3: fix RSS key size compatibility
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5172f9c464aa315a9d45b9177af71b4f99d55cdb ]

For better compatibility, the RSS key size of PF and VF are obtained
from firmware. However, the outdated HNS3_RSS_KEY_SIZE macro is still
utilized in many locations as the key size.

Fixes: 9c740336f024 ("net/hns3: get device specifications from firmware")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 12 +++++++++++-
 drivers/net/hns3/hns3_flow.c   | 26 ++++++++++++--------------
 drivers/net/hns3/hns3_rss.c    | 23 +++++++++++------------
 drivers/net/hns3/hns3_rss.h    |  3 ++-
 4 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index 74d537d8d0..a0c9e66c2c 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -130,7 +130,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
 	};

 	info->reta_size = hw->rss_ind_tbl_size;
-	info->hash_key_size = HNS3_RSS_KEY_SIZE;
+	info->hash_key_size = hw->rss_key_size;
 	info->flow_type_rss_offloads = HNS3_ETH_RSS_SUPPORT;

 	info->default_rxportconf.burst_size = HNS3_DEFAULT_PORT_CONF_BURST_SIZE;
@@ -896,6 +896,16 @@ hns3_check_dev_specifications(struct hns3_hw *hw)
 		return -EINVAL;
 	}

+	if (hw->rss_key_size == 0 || hw->rss_key_size > HNS3_RSS_KEY_SIZE_MAX) {
+		hns3_err(hw, "the RSS key size obtained (%u) is invalid, and should not be zero or exceed the maximum(%u)",
+			 hw->rss_key_size, HNS3_RSS_KEY_SIZE_MAX);
+		return -EINVAL;
+	}
+
+	if (hw->rss_key_size > HNS3_RSS_KEY_SIZE)
+		hns3_warn(hw, "the RSS key size obtained (%u) is greater than the default key size (%u)",
+			  hw->rss_key_size, HNS3_RSS_KEY_SIZE);
+
 	return 0;
 }

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 95609f8483..a18ec7650d 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1406,10 +1406,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "a nonzero RSS encapsulation level is not supported");
-	if (rss->key_len && rss->key_len != RTE_DIM(rss_conf->key))
+	if (rss->key_len && rss->key_len != hw->rss_key_size)
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "RSS hash key must be exactly 40 bytes");
+					  "invalid RSS key length");

 	if (!hns3_rss_input_tuple_supported(hw, rss))
 		return rte_flow_error_set(error, EINVAL,
@@ -1443,16 +1443,6 @@ hns3_disable_rss(struct hns3_hw *hw)
 	return 0;
 }

-static void
-hns3_adjust_rss_key(struct hns3_hw *hw, struct rte_flow_action_rss *rss_conf)
-{
-	if (rss_conf->key == NULL || rss_conf->key_len < HNS3_RSS_KEY_SIZE) {
-		hns3_warn(hw, "Default RSS hash key to be set");
-		rss_conf->key = hns3_hash_key;
-		rss_conf->key_len = HNS3_RSS_KEY_SIZE;
-	}
-}
-
 static int
 hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
 			 uint8_t *hash_algo)
@@ -1485,9 +1475,16 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
 static int
 hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
+	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
+	bool use_default_key = false;
 	int ret;

-	hns3_adjust_rss_key(hw, rss_config);
+	if (rss_config->key == NULL || rss_config->key_len != hw->rss_key_size) {
+		hns3_warn(hw, "Default RSS hash key to be set");
+		memcpy(rss_key, hns3_hash_key,
+			RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
+		use_default_key = true;
+	}

 	ret = hns3_parse_rss_algorithm(hw, &rss_config->func,
 				       &hw->rss_info.hash_algo);
@@ -1495,7 +1492,8 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		return ret;

 	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
-				    rss_config->key, HNS3_RSS_KEY_SIZE);
+				    use_default_key ? rss_key : rss_config->key,
+				    hw->rss_key_size);
 	if (ret)
 		return ret;

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 3db7bf0445..d6e0754273 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -316,7 +316,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 		}
 	}
 	/* Update the shadow RSS key with user specified */
-	memcpy(hw->rss_info.key, key, HNS3_RSS_KEY_SIZE);
+	memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	return 0;
 }

@@ -498,9 +498,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	uint8_t *key = rss_conf->rss_key;
 	int ret;

-	if (key && key_len != HNS3_RSS_KEY_SIZE) {
+	if (key && key_len != hw->rss_key_size) {
 		hns3_err(hw, "the hash key len(%u) is invalid, must be %u",
-			 key_len, HNS3_RSS_KEY_SIZE);
+			 key_len, hw->rss_key_size);
 		return -EINVAL;
 	}

@@ -511,7 +511,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,

 	if (key) {
 		ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
-					    key, HNS3_RSS_KEY_SIZE);
+					    key, hw->rss_key_size);
 		if (ret)
 			goto set_algo_key_fail;
 	}
@@ -547,9 +547,9 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	rss_conf->rss_hf = rss_cfg->conf.types;

 	/* Get the RSS Key required by the user */
-	if (rss_conf->rss_key && rss_conf->rss_key_len >= HNS3_RSS_KEY_SIZE) {
-		memcpy(rss_conf->rss_key, rss_cfg->key, HNS3_RSS_KEY_SIZE);
-		rss_conf->rss_key_len = HNS3_RSS_KEY_SIZE;
+	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
+		memcpy(rss_conf->rss_key, rss_cfg->key, hw->rss_key_size);
+		rss_conf->rss_key_len = hw->rss_key_size;
 	}
 	rte_spinlock_unlock(&hw->lock);

@@ -754,8 +754,8 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
 	/* Default hash algorithm */
 	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_TOEPLITZ;

-	/* Default RSS key */
-	memcpy(rss_cfg->key, hns3_hash_key, HNS3_RSS_KEY_SIZE);
+	memcpy(rss_cfg->key, hns3_hash_key,
+		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));

 	/* Initialize RSS indirection table */
 	for (i = 0; i < hw->rss_ind_tbl_size; i++)
@@ -788,9 +788,8 @@ hns3_config_rss(struct hns3_adapter *hns)
 		break;
 	}

-	/* Configure RSS hash algorithm and hash key */
-	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo, hash_key,
-				    HNS3_RSS_KEY_SIZE);
+	ret = hns3_rss_set_algo_key(hw, rss_cfg->hash_algo,
+				    hash_key, hw->rss_key_size);
 	if (ret)
 		return ret;

diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index b7f62ca1ee..d6f81996f4 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -29,6 +29,7 @@
 #define HNS3_RSS_IND_TBL_SIZE	512 /* The size of hash lookup table */
 #define HNS3_RSS_IND_TBL_SIZE_MAX 2048
 #define HNS3_RSS_KEY_SIZE	40
+#define HNS3_RSS_KEY_SIZE_MAX	128
 #define HNS3_RSS_SET_BITMAP_MSK	0xffff

 #define HNS3_RSS_HASH_ALGO_TOEPLITZ	0
@@ -41,7 +42,7 @@ struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
-	uint8_t key[HNS3_RSS_KEY_SIZE];  /* Hash key */
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
 	bool valid; /* check if RSS rule is valid */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.097650000 +0800
+++ 0100-net-hns3-fix-RSS-key-size-compatibility.patch	2023-02-27 14:08:40.839237000 +0800
@@ -1 +1 @@
-From 5172f9c464aa315a9d45b9177af71b4f99d55cdb Mon Sep 17 00:00:00 2001
+From 9126ed75beaa67eff3fb74cc1f920de488710d6c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5172f9c464aa315a9d45b9177af71b4f99d55cdb ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -53 +55 @@
-index ac094c839f..de38a42048 100644
+index 95609f8483..a18ec7650d 100644

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

* patch 'net/hns3: fix clearing RSS configuration' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (97 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix RSS key size compatibility' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: use RSS filter list to check duplicated rule' " Xueming Li
                     ` (58 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 93fa374ce4a570fd12e16756f4654e7e2bd01f67 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:55 +0800
Subject: [PATCH] net/hns3: fix clearing RSS configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1aa5222454725001939ff571e685225f6cf85653 ]

When a RSS rule has an unsupported action, the RSS configuration is
cleared by mistake.

Remove clearing RSS configuration in this case.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index a18ec7650d..c338eab049 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1421,12 +1421,10 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,

 	/* Check if the next not void action is END */
 	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
-		memset(rss_conf, 0, sizeof(struct hns3_rss_conf));
+	if (act->type != RTE_FLOW_ACTION_TYPE_END)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION,
 					  act, "Not supported action.");
-	}

 	return 0;
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.128525300 +0800
+++ 0101-net-hns3-fix-clearing-RSS-configuration.patch	2023-02-27 14:08:40.839237000 +0800
@@ -1 +1 @@
-From 1aa5222454725001939ff571e685225f6cf85653 Mon Sep 17 00:00:00 2001
+From 93fa374ce4a570fd12e16756f4654e7e2bd01f67 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1aa5222454725001939ff571e685225f6cf85653 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index de38a42048..5711757684 100644
+index a18ec7650d..c338eab049 100644

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

* patch 'net/hns3: use RSS filter list to check duplicated rule' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (98 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix clearing RSS configuration' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: remove useless code when destroy valid RSS " Xueming Li
                     ` (57 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d45c8fe41594c5d7f35ec66e73201a7f62a4153d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:56 +0800
Subject: [PATCH] net/hns3: use RSS filter list to check duplicated rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ]

All rules from user are saved in RSS filter list, so use RSS
filter list to check duplicated rule.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index c338eab049..303275ae93 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1300,7 +1300,7 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		!memcmp(comp->key, with->key, with->key_len);

 	return (func_is_same && rss_key_is_same &&
-		comp->types == (with->types & HNS3_ETH_RSS_SUPPORT) &&
+		comp->types == with->types &&
 		comp->level == with->level &&
 		comp->queue_num == with->queue_num &&
 		!memcmp(comp->queue, with->queue,
@@ -1596,15 +1596,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	}

 	/* Set hash algorithm and flow types by the user's config */
-	ret = hns3_hw_rss_hash_set(hw, &rss_flow_conf);
-	if (ret)
-		return ret;
-
-	ret = hns3_rss_conf_copy(rss_info, &rss_flow_conf);
-	if (ret)
-		hns3_err(hw, "RSS config init fail(%d)", ret);
-
-	return ret;
+	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
 }

 static int
@@ -1676,17 +1668,32 @@ hns3_restore_filter(struct hns3_adapter *hns)
 	return hns3_restore_rss_filter(hw);
 }

+static bool
+hns3_rss_action_is_dup(struct hns3_hw *hw,
+		       const struct rte_flow_action_rss *act)
+{
+	struct hns3_rss_conf_ele *filter;
+
+	TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) {
+		if (!filter->filter_info.valid)
+			continue;
+
+		if (hns3_action_rss_same(&filter->filter_info.conf, act))
+			return true;
+	}
+
+	return false;
+}
+
 static int
 hns3_flow_parse_rss(struct rte_eth_dev *dev,
 		    const struct hns3_rss_conf *conf, bool add)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	bool ret;

-	ret = hns3_action_rss_same(&hw->rss_info.conf, &conf->conf);
-	if (ret) {
-		hns3_err(hw, "Enter duplicate RSS configuration : %d", ret);
+	if (hns3_rss_action_is_dup(hw, &conf->conf)) {
+		hns3_err(hw, "duplicate RSS configuration");
 		return -EINVAL;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.156250400 +0800
+++ 0102-net-hns3-use-RSS-filter-list-to-check-duplicated-rul.patch	2023-02-27 14:08:40.839237000 +0800
@@ -1 +1 @@
-From 6afde23d843ecf67453eaf69924bd79873f6f207 Mon Sep 17 00:00:00 2001
+From d45c8fe41594c5d7f35ec66e73201a7f62a4153d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6afde23d843ecf67453eaf69924bd79873f6f207 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 5711757684..4cca675c53 100644
+index c338eab049..303275ae93 100644

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

* patch 'net/hns3: remove useless code when destroy valid RSS rule' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (99 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: use RSS filter list to check duplicated rule' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix warning on flush or destroy " Xueming Li
                     ` (56 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2e99d819d3a0890c9bb718f06891c6d8d080758c Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:57 +0800
Subject: [PATCH] net/hns3: remove useless code when destroy valid RSS rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 546031ba551485c3e3aa57c3698975c2852cbef1 ]

When all rules are flushed the hw::rss_info::conf::func set to
RTE_ETH_HASH_FUNCTION_MAX and hw::rss_info::conf::queue set to NULL
which indicates no flow rules is issued.
See: commit eb158fc756a5 ("net/hns3: fix config when creating RSS rule
after flush").

Actually, the way determining whether there are rules has been changed
by walking the flow RSS list.
See: commit 705a50800334 ("net/hns3: fix RSS filter restore").

In addition, the rte_flow_action_rss from user isn't saved to 'conf' in
hw->rss_info now. So this code can be removed.

Fixes: eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush")
Fixes: 705a50800334 ("net/hns3: fix RSS filter restore")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 303275ae93..7adde16cbc 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1279,19 +1279,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 	bool rss_key_is_same;
 	bool func_is_same;

-	/*
-	 * When user flush all RSS rule, RSS func is set invalid with
-	 * RTE_ETH_HASH_FUNCTION_MAX. Then the user create a flow after
-	 * flushed, any validate RSS func is different with it before
-	 * flushed. Others, when user create an action RSS with RSS func
-	 * specified RTE_ETH_HASH_FUNCTION_DEFAULT, the func is the same
-	 * between continuous RSS flow.
-	 */
-	if (comp->func == RTE_ETH_HASH_FUNCTION_MAX)
-		func_is_same = false;
-	else
-		func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
-				(comp->func == with->func) : true;
+	func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
+			(comp->func == with->func) : true;

 	if (with->key_len == 0 || with->key == NULL)
 		rss_key_is_same = 1;
@@ -1533,7 +1522,6 @@ static int
 hns3_config_rss_filter(struct hns3_hw *hw,
 		       const struct hns3_rss_conf *conf, bool add)
 {
-	struct hns3_rss_conf *rss_info;
 	uint64_t flow_types;
 	uint16_t num;
 	int ret;
@@ -1560,7 +1548,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	/* Update the useful flow types */
 	rss_flow_conf.types = flow_types;

-	rss_info = &hw->rss_info;
 	if (!add) {
 		if (!conf->valid)
 			return 0;
@@ -1571,15 +1558,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 			return ret;
 		}

-		if (rss_flow_conf.queue_num) {
-			/*
-			 * Due the content of queue pointer have been reset to
-			 * 0, the rss_info->conf.queue should be set to NULL
-			 */
-			rss_info->conf.queue = NULL;
-			rss_info->conf.queue_num = 0;
-		}
-
 		return 0;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.186903300 +0800
+++ 0103-net-hns3-remove-useless-code-when-destroy-valid-RSS-.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From 546031ba551485c3e3aa57c3698975c2852cbef1 Mon Sep 17 00:00:00 2001
+From 2e99d819d3a0890c9bb718f06891c6d8d080758c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 546031ba551485c3e3aa57c3698975c2852cbef1 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -30 +32 @@
-index 4cca675c53..3809fcc2d7 100644
+index 303275ae93..7adde16cbc 100644

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

* patch 'net/hns3: fix warning on flush or destroy rule' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (100 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: remove useless code when destroy valid RSS " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix config struct used for conversion' " Xueming Li
                     ` (55 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f2de3c967d767ff57abad370b9162514ede58414 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:58 +0800
Subject: [PATCH] net/hns3: fix warning on flush or destroy rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd ]

Although flow rules will no longer be used when user flush all rules
or destroy a rule a warning is generated like:
"modified RSS types based on hardware support, requested:0x137f83fffc
configured:0x3ffc".

Prevent warning for flush or destroy rule case.

Fixes: ec674cb742e5 ("net/hns3: fix flushing RSS rule")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 7adde16cbc..fbc38dd3d4 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1537,17 +1537,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 		.queue = conf->conf.queue,
 	};

-	/* Filter the unsupported flow types */
-	flow_types = conf->conf.types ?
-		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.conf.types;
-	if (flow_types != rss_flow_conf.types)
-		hns3_warn(hw, "modified RSS types based on hardware support, "
-			      "requested:0x%" PRIx64 " configured:0x%" PRIx64,
-			  rss_flow_conf.types, flow_types);
-	/* Update the useful flow types */
-	rss_flow_conf.types = flow_types;
-
 	if (!add) {
 		if (!conf->valid)
 			return 0;
@@ -1573,6 +1562,17 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 			return ret;
 	}

+	/* Filter the unsupported flow types */
+	flow_types = conf->conf.types ?
+		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
+		     hw->rss_info.conf.types;
+	if (flow_types != rss_flow_conf.types)
+		hns3_warn(hw, "modified RSS types based on hardware support,"
+			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
+			  rss_flow_conf.types, flow_types);
+	/* Update the useful flow types */
+	rss_flow_conf.types = flow_types;
+
 	/* Set hash algorithm and flow types by the user's config */
 	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.216325700 +0800
+++ 0104-net-hns3-fix-warning-on-flush-or-destroy-rule.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd Mon Sep 17 00:00:00 2001
+From f2de3c967d767ff57abad370b9162514ede58414 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a7bf2789168c8d49ca4dec5bb7bb0b3f765fc1bd ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 3809fcc2d7..632247b846 100644
+index 7adde16cbc..fbc38dd3d4 100644

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

* patch 'net/hns3: fix config struct used for conversion' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (101 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix warning on flush or destroy " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix duplicate RSS rule check' " Xueming Li
                     ` (54 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5c129d88989ba3c08c0a34d9145a11e0e31cf588 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:02:59 +0800
Subject: [PATCH] net/hns3: fix config struct used for conversion
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ]

When the type in 'struct rte_flow_action' is RTE_FLOW_ACTION_TYPE_RSS,
the 'conf' pointer references the 'struct rte_flow_action_rss' instead
of the 'struct hns3_rss_conf' in driver. But driver uses 'struct
hns3_rss_conf' to convert this 'conf' pointer to get RSS action
configuration.

In addition, RSS filter configuration is directly cloned to RSS filter
node instead of coping it after successfully setting to hardware.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 59 ++++++++++++++----------------------
 1 file changed, 22 insertions(+), 37 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index fbc38dd3d4..a30b19cfdb 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -95,8 +95,8 @@ static const struct rte_flow_action *
 hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 			     const struct rte_flow_action actions[])
 {
+	const struct rte_flow_action_rss *rss_act;
 	const struct rte_flow_action *act = NULL;
-	const struct hns3_rss_conf *rss;
 	bool have_eth = false;

 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
@@ -115,8 +115,8 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 		}
 	}

-	rss = act->conf;
-	if (have_eth && rss->conf.queue_num) {
+	rss_act = act->conf;
+	if (have_eth && rss_act->queue_num) {
 		/*
 		 * Pattern have ETH and action's queue_num > 0, indicate this is
 		 * queue region configuration.
@@ -1296,30 +1296,6 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 			sizeof(*with->queue) * with->queue_num));
 }

-static int
-hns3_rss_conf_copy(struct hns3_rss_conf *out,
-		   const struct rte_flow_action_rss *in)
-{
-	if (in->key_len > RTE_DIM(out->key) ||
-	    in->queue_num > RTE_DIM(out->queue))
-		return -EINVAL;
-	if (in->key == NULL && in->key_len)
-		return -EINVAL;
-	out->conf = (struct rte_flow_action_rss) {
-		.func = in->func,
-		.level = in->level,
-		.types = in->types,
-		.key_len = in->key_len,
-		.queue_num = in->queue_num,
-	};
-	out->conf.queue = memcpy(out->queue, in->queue,
-				sizeof(*in->queue) * in->queue_num);
-	if (in->key)
-		out->conf.key = memcpy(out->key, in->key, in->key_len);
-
-	return 0;
-}
-
 static bool
 hns3_rss_input_tuple_supported(struct hns3_hw *hw,
 			       const struct rte_flow_action_rss *rss)
@@ -1733,9 +1709,10 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 			  struct rte_flow *flow)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	const struct rte_flow_action_rss *rss_act;
 	struct hns3_rss_conf_ele *rss_filter_ptr;
 	struct hns3_rss_conf_ele *filter_ptr;
-	const struct hns3_rss_conf *rss_conf;
+	struct hns3_rss_conf *new_conf;
 	int ret;

 	rss_filter_ptr = rte_zmalloc("hns3 rss filter",
@@ -1745,19 +1722,27 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 		return -ENOMEM;
 	}

-	/*
-	 * After all the preceding tasks are successfully configured, configure
-	 * rules to the hardware to simplify the rollback of rules in the
-	 * hardware.
-	 */
-	rss_conf = (const struct hns3_rss_conf *)act->conf;
-	ret = hns3_flow_parse_rss(dev, rss_conf, true);
+	rss_act = (const struct rte_flow_action_rss *)act->conf;
+	new_conf = &rss_filter_ptr->filter_info;
+	memcpy(&new_conf->conf, rss_act, sizeof(*rss_act));
+	if (rss_act->queue_num > 0) {
+		memcpy(new_conf->queue, rss_act->queue,
+		       rss_act->queue_num * sizeof(new_conf->queue[0]));
+		new_conf->conf.queue = new_conf->queue;
+	}
+	if (rss_act->key_len > 0) {
+		if (rss_act->key != NULL) {
+			memcpy(new_conf->key, rss_act->key,
+			       rss_act->key_len * sizeof(new_conf->key[0]));
+			new_conf->conf.key = new_conf->key;
+		}
+	}
+
+	ret = hns3_flow_parse_rss(dev, new_conf, true);
 	if (ret != 0) {
 		rte_free(rss_filter_ptr);
 		return ret;
 	}
-
-	hns3_rss_conf_copy(&rss_filter_ptr->filter_info, &rss_conf->conf);
 	rss_filter_ptr->filter_info.valid = true;

 	/*
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.249532800 +0800
+++ 0105-net-hns3-fix-config-struct-used-for-conversion.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From 815c7db53167f7ee1573dca18fa7f889e44764d4 Mon Sep 17 00:00:00 2001
+From 5c129d88989ba3c08c0a34d9145a11e0e31cf588 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 815c7db53167f7ee1573dca18fa7f889e44764d4 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 632247b846..dd762c02cb 100644
+index fbc38dd3d4..a30b19cfdb 100644

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

* patch 'net/hns3: fix duplicate RSS rule check' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (102 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix config struct used for conversion' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/sfc: export pick transfer proxy callback to representors' " Xueming Li
                     ` (53 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6ae7e4345ee40b5a3abcce0eb28f717b4c3b202a Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Tue, 31 Jan 2023 21:03:00 +0800
Subject: [PATCH] net/hns3: fix duplicate RSS rule check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]

Currently, the interface for verifying duplicate RSS rules has
some problems:
1) If the value of 'func' in configuring RSS rule is default
   value, this rule is mistakenly considered as a duplicate rule.
2) If key length is zero or 'key' is NULL in configuring RSS rule
   this rule is also mistakenly considered as a duplicate rule.
3) If 'key' or 'queue' in struct rte_flow_action_rss being NULL
   is used to memcpy, which may cause segment fault.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 63 +++++++++++++++++++++++++++---------
 1 file changed, 47 insertions(+), 16 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index a30b19cfdb..e80ec0f053 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1272,28 +1272,59 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
 	}
 }

+static bool
+hns3_flow_rule_key_same(const struct rte_flow_action_rss *comp,
+			const struct rte_flow_action_rss *with)
+{
+	if (comp->key_len != with->key_len)
+		return false;
+
+	if (with->key_len == 0)
+		return true;
+
+	if (comp->key == NULL && with->key == NULL)
+		return true;
+
+	if (!(comp->key != NULL && with->key != NULL))
+		return false;
+
+	return !memcmp(comp->key, with->key, with->key_len);
+}
+
+static bool
+hns3_flow_rule_queues_same(const struct rte_flow_action_rss *comp,
+			   const struct rte_flow_action_rss *with)
+{
+	if (comp->queue_num != with->queue_num)
+		return false;
+
+	if (with->queue_num == 0)
+		return true;
+
+	if (comp->queue == NULL && with->queue == NULL)
+		return true;
+
+	if (!(comp->queue != NULL && with->queue != NULL))
+		return false;
+
+	return !memcmp(comp->queue, with->queue, with->queue_num);
+}
+
 static bool
 hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 		     const struct rte_flow_action_rss *with)
 {
-	bool rss_key_is_same;
-	bool func_is_same;
+	bool same_level;
+	bool same_types;
+	bool same_func;

-	func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ?
-			(comp->func == with->func) : true;
+	same_level = (comp->level == with->level);
+	same_types = (comp->types == with->types);
+	same_func = (comp->func == with->func);

-	if (with->key_len == 0 || with->key == NULL)
-		rss_key_is_same = 1;
-	else
-		rss_key_is_same = comp->key_len == with->key_len &&
-		!memcmp(comp->key, with->key, with->key_len);
-
-	return (func_is_same && rss_key_is_same &&
-		comp->types == with->types &&
-		comp->level == with->level &&
-		comp->queue_num == with->queue_num &&
-		!memcmp(comp->queue, with->queue,
-			sizeof(*with->queue) * with->queue_num));
+	return same_level && same_types && same_func &&
+		hns3_flow_rule_key_same(comp, with) &&
+		hns3_flow_rule_queues_same(comp, with);
 }

 static bool
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.277581600 +0800
+++ 0106-net-hns3-fix-duplicate-RSS-rule-check.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From 150fd8f839e332d68aa7b60646c2033084544cb7 Mon Sep 17 00:00:00 2001
+From 6ae7e4345ee40b5a3abcce0eb28f717b4c3b202a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 150fd8f839e332d68aa7b60646c2033084544cb7 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index dd762c02cb..881d70613c 100644
+index a30b19cfdb..e80ec0f053 100644

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

* patch 'net/sfc: export pick transfer proxy callback to representors' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (103 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix duplicate RSS rule check' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'app/testpmd: fix link check condition on port start' " Xueming Li
                     ` (52 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Ivan Malov
  Cc: Andy Moreton, Viacheslav Galaktionov, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e4f7453ec1c7efacf4ae92fdae243ed9a3410840 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Tue, 31 Jan 2023 15:08:39 +0400
Subject: [PATCH] net/sfc: export pick transfer proxy callback to representors
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d5a478f3b2ba3b2e6efebf36219eaff79b52bad1 ]

Currently, the "pick transfer proxy ethdev" callback is only
advertised for non-representor (in example, main PF) ethdevs.
That does not sit well with the original idea of this method,
which is to let applications discover the privileged port to
use for transfer flow management instead of any given ethdev.
Applications trying to leverage this API on sfc representors
receive an error and cannot configure transfer flow offloads.

Fix the problem by exporting the method to representor ports.

Fixes: 26706314d418 ("net/sfc: implement transfer proxy port callback")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_repr.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 417d0073cb..4b03b101d8 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -9,6 +9,8 @@

 #include <stdint.h>

+#include <rte_flow_driver.h>
+#include <rte_flow.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
@@ -888,6 +890,29 @@ sfc_repr_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	return 0;
 }

+static int
+sfc_repr_flow_pick_transfer_proxy(struct rte_eth_dev *dev,
+				  uint16_t *transfer_proxy_port,
+				  struct rte_flow_error *error)
+{
+	struct sfc_repr_shared *srs = sfc_repr_shared_by_eth_dev(dev);
+
+	return rte_flow_pick_transfer_proxy(srs->pf_port_id,
+					    transfer_proxy_port, error);
+}
+
+const struct rte_flow_ops sfc_repr_flow_ops = {
+	.pick_transfer_proxy = sfc_repr_flow_pick_transfer_proxy,
+};
+
+static int
+sfc_repr_dev_flow_ops_get(struct rte_eth_dev *dev __rte_unused,
+			  const struct rte_flow_ops **ops)
+{
+	*ops = &sfc_repr_flow_ops;
+	return 0;
+}
+
 static const struct eth_dev_ops sfc_repr_dev_ops = {
 	.dev_configure			= sfc_repr_dev_configure,
 	.dev_start			= sfc_repr_dev_start,
@@ -901,6 +926,7 @@ static const struct eth_dev_ops sfc_repr_dev_ops = {
 	.rx_queue_release		= sfc_repr_rx_queue_release,
 	.tx_queue_setup			= sfc_repr_tx_queue_setup,
 	.tx_queue_release		= sfc_repr_tx_queue_release,
+	.flow_ops_get			= sfc_repr_dev_flow_ops_get,
 };


--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.307456100 +0800
+++ 0107-net-sfc-export-pick-transfer-proxy-callback-to-repre.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From d5a478f3b2ba3b2e6efebf36219eaff79b52bad1 Mon Sep 17 00:00:00 2001
+From e4f7453ec1c7efacf4ae92fdae243ed9a3410840 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d5a478f3b2ba3b2e6efebf36219eaff79b52bad1 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/testpmd: fix link check condition on port start' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (104 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/sfc: export pick transfer proxy callback to representors' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/nfp: fix max DMA length' " Xueming Li
                     ` (51 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f418af17fc9927e2f9b854f6c5ab21105c1af94a Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Fri, 27 Jan 2023 22:45:13 +0000
Subject: [PATCH] app/testpmd: fix link check condition on port start
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cdede073a515432fc168d252d93f9a2d333ce8a0 ]

In testpmd port start function, 'need_check_link_status' variable is
used to detect if a link check is required after port is started.

Intention is if at least one port is started, link check should be
called, and initially 'need_check_link_status' used as following:
```
start_port
	need_check_link_status <- 0
	for each p in port
		ret <- config & start p
		if ret is failure
			break
		need_check_link_status <- 1
	if need_check_link_status
		check link
	else
		log failure message
```

Later above logic is modified [1] because when there is no port at all,
'need_check_link_status' remains zero and it causes and error message
although this is a valid use case.

For this code updated as following:

```
start_port
	need_check_link_status <- -1
	for each p in port
		need_check_link_status <- 0
		ret <- config & start p
		if ret is failure
			break
		need_check_link_status <- 1
	if need_check_link_status == 1
		check link
	else if need_check_link_status == 0
		log failure message
```

This modification works fine if 'start_port()' called for a single port,
but function support both single port and all ports with 'RTE_PORT_ALL'
parameter to the function.

When it is called for all ports, above logic is wrong because
'need_check_link_status' value reset on each iteration of the loop.

For multi port case, if last port fails to start,
'need_check_link_status' will be zero and no link check will be done and
it will log a wrong error message.

Overall there are three cases to cover:
* No port exist at all
* All ports are already started
* At least one port started successfully

To cover all three cases, one option is to use 'need_check_link_status'
have multiple values to reflect above cases.
But meaning of values are not obvious which can lead more issues in the
future.

Instead converting 'need_check_link_status' to multiple boolean
variables whose names are self explanatory.

This fixes issue and link check called if at least one port started
successfully as intended.
Also log message only printed when at least one port exists and all
ports are already in started state.

[1]
Fixes: 92d2703e2c43 ("app/testpmd: fix log with no bound device")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/testpmd.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3c404c8a6e..538609d890 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2883,7 +2883,7 @@ update_bonding_port_dev_conf(portid_t bond_pid)
 int
 start_port(portid_t pid)
 {
-	int diag, need_check_link_status = -1;
+	int diag;
 	portid_t pi;
 	portid_t p_pi = RTE_MAX_ETHPORTS;
 	portid_t pl[RTE_MAX_ETHPORTS];
@@ -2894,6 +2894,9 @@ start_port(portid_t pid)
 	queueid_t qi;
 	struct rte_port *port;
 	struct rte_eth_hairpin_cap cap;
+	bool at_least_one_port_exist = false;
+	bool all_ports_already_started = true;
+	bool at_least_one_port_successfully_started = false;

 	if (port_id_is_invalid(pid, ENABLED_WARN))
 		return 0;
@@ -2909,11 +2912,13 @@ start_port(portid_t pid)
 			continue;
 		}

-		need_check_link_status = 0;
+		at_least_one_port_exist = true;
+
 		port = &ports[pi];
-		if (port->port_status == RTE_PORT_STOPPED)
+		if (port->port_status == RTE_PORT_STOPPED) {
 			port->port_status = RTE_PORT_HANDLING;
-		else {
+			all_ports_already_started = false;
+		} else {
 			fprintf(stderr, "Port %d is now not stopped\n", pi);
 			continue;
 		}
@@ -3133,15 +3138,14 @@ start_port(portid_t pid)
 			printf("Port %d: " RTE_ETHER_ADDR_PRT_FMT "\n", pi,
 					RTE_ETHER_ADDR_BYTES(&port->eth_addr));

-		/* at least one port started, need checking link status */
-		need_check_link_status = 1;
+		at_least_one_port_successfully_started = true;

 		pl[cfg_pi++] = pi;
 	}

-	if (need_check_link_status == 1 && !no_link_check)
+	if (at_least_one_port_successfully_started && !no_link_check)
 		check_all_ports_link_status(RTE_PORT_ALL);
-	else if (need_check_link_status == 0)
+	else if (at_least_one_port_exist & all_ports_already_started)
 		fprintf(stderr, "Please stop the ports first\n");

 	if (hairpin_mode & 0xf) {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.335173400 +0800
+++ 0108-app-testpmd-fix-link-check-condition-on-port-start.patch	2023-02-27 14:08:40.849237000 +0800
@@ -1 +1 @@
-From cdede073a515432fc168d252d93f9a2d333ce8a0 Mon Sep 17 00:00:00 2001
+From f418af17fc9927e2f9b854f6c5ab21105c1af94a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cdede073a515432fc168d252d93f9a2d333ce8a0 ]
@@ -77 +79,0 @@
-Cc: stable@dpdk.org
@@ -86 +88 @@
-index f3e29a5b4b..d93d07ae09 100644
+index 3c404c8a6e..538609d890 100644
@@ -89 +91 @@
-@@ -2920,7 +2920,7 @@ update_bonding_port_dev_conf(portid_t bond_pid)
+@@ -2883,7 +2883,7 @@ update_bonding_port_dev_conf(portid_t bond_pid)
@@ -98 +100 @@
-@@ -2931,6 +2931,9 @@ start_port(portid_t pid)
+@@ -2894,6 +2894,9 @@ start_port(portid_t pid)
@@ -108 +110 @@
-@@ -2946,11 +2949,13 @@ start_port(portid_t pid)
+@@ -2909,11 +2912,13 @@ start_port(portid_t pid)
@@ -125 +127 @@
-@@ -3170,15 +3175,14 @@ start_port(portid_t pid)
+@@ -3133,15 +3138,14 @@ start_port(portid_t pid)

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

* patch 'net/nfp: fix max DMA length' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (105 preceding siblings ...)
  2023-02-27  7:00   ` patch 'app/testpmd: fix link check condition on port start' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: fix burst mode query with dummy function' " Xueming Li
                     ` (50 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Richard Donkin; +Cc: Chaoyong He, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6c9834cd2add682187ee948a485cd0e70158815a Mon Sep 17 00:00:00 2001
From: Richard Donkin <richard.donkin@corigine.com>
Date: Fri, 3 Feb 2023 10:23:28 +0800
Subject: [PATCH] net/nfp: fix max DMA length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4a44ca26db4f8492be4bda462adfd5d1b70e06c2 ]

The DMA transfer length is allowed to be as large as
NFDK_TX_MAX_DATA_PER_HEAD. The existing check would not allow a simple-
type descriptor to be created for a packet of size
NFDK_TX_MAX_DATA_PER_HEAD, but it would also not enable gather-type
descriptors to be created correctly later.

Change the limit of simple-type descriptors to include packets of size
NFDK_TX_MAX_DATA_PER_HEAD.

In practice this fixes traffic with packets of size 4096. Previously
such packets would not be transmitted correctly.

Fixes: c73dced48c8c ("net/nfp: add NFDk Tx")

Signed-off-by: Richard Donkin <richard.donkin@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index e2cdb9e27e..9e20917b5e 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -1215,7 +1215,7 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk
 		if ((hw->cap & NFP_NET_CFG_CTRL_LSO_ANY) &&
 				(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG)) {
 			type = NFDK_DESC_TX_TYPE_TSO;
-		} else if (!pkt->next && dma_len < NFDK_TX_MAX_DATA_PER_HEAD) {
+		} else if (pkt->next == NULL && dma_len <= NFDK_TX_MAX_DATA_PER_HEAD) {
 			type = NFDK_DESC_TX_TYPE_SIMPLE;
 		} else {
 			type = NFDK_DESC_TX_TYPE_GATHER;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.365147900 +0800
+++ 0109-net-nfp-fix-max-DMA-length.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From 4a44ca26db4f8492be4bda462adfd5d1b70e06c2 Mon Sep 17 00:00:00 2001
+From 6c9834cd2add682187ee948a485cd0e70158815a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4a44ca26db4f8492be4bda462adfd5d1b70e06c2 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index 79a66b6e44..b3beb33109 100644
+index e2cdb9e27e..9e20917b5e 100644
@@ -31 +33 @@
-@@ -1476,7 +1476,7 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk
+@@ -1215,7 +1215,7 @@ nfp_net_nfdk_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pk
@@ -35 +37 @@
--		} else if (pkt->next == NULL && dma_len < NFDK_TX_MAX_DATA_PER_HEAD) {
+-		} else if (!pkt->next && dma_len < NFDK_TX_MAX_DATA_PER_HEAD) {

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

* patch 'net/hns3: fix burst mode query with dummy function' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (106 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/nfp: fix max DMA length' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: add debug info for Rx/Tx " Xueming Li
                     ` (49 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c6b36e818356bf81a6e4d8b38689603b6e9b21ea Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:25 +0800
Subject: [PATCH] net/hns3: fix burst mode query with dummy function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 10f91af5a5b370df922f888826a4387abebe1cde ]

The rte_eth_rx/tx_burst_mode_get API will fail when Rx/Tx
function is dummy.

Fixes: 7ef933908f04 ("net/hns3: add simple Tx path")
Fixes: 521ab3e93361 ("net/hns3: add simple Rx path")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 38 ++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index f1163ce8a9..feef9e1c7b 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2786,6 +2786,7 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 		{ hns3_recv_scattered_pkts,	"Scalar Scattered" },
 		{ hns3_recv_pkts_vec,		"Vector Neon"   },
 		{ hns3_recv_pkts_vec_sve,	"Vector Sve"    },
+		{ rte_eth_pkt_burst_dummy,	"Dummy"         },
 	};

 	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
@@ -4272,24 +4273,31 @@ int
 hns3_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 		       struct rte_eth_burst_mode *mode)
 {
+	static const struct {
+		eth_tx_burst_t pkt_burst;
+		const char *info;
+	} burst_infos[] = {
+		{ hns3_xmit_pkts_simple,	"Scalar Simple" },
+		{ hns3_xmit_pkts,		"Scalar"        },
+		{ hns3_xmit_pkts_vec,		"Vector Neon"   },
+		{ hns3_xmit_pkts_vec_sve,	"Vector Sve"    },
+		{ rte_eth_pkt_burst_dummy,	"Dummy"         },
+	};
+
 	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
-	const char *info = NULL;
-
-	if (pkt_burst == hns3_xmit_pkts_simple)
-		info = "Scalar Simple";
-	else if (pkt_burst == hns3_xmit_pkts)
-		info = "Scalar";
-	else if (pkt_burst == hns3_xmit_pkts_vec)
-		info = "Vector Neon";
-	else if (pkt_burst == hns3_xmit_pkts_vec_sve)
-		info = "Vector Sve";
-
-	if (info == NULL)
-		return -EINVAL;
+	int ret = -EINVAL;
+	unsigned int i;

-	snprintf(mode->info, sizeof(mode->info), "%s", info);
+	for (i = 0; i < RTE_DIM(burst_infos); i++) {
+		if (pkt_burst == burst_infos[i].pkt_burst) {
+			snprintf(mode->info, sizeof(mode->info), "%s",
+				 burst_infos[i].info);
+			ret = 0;
+			break;
+		}
+	}

-	return 0;
+	return ret;
 }

 static bool
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.391761900 +0800
+++ 0110-net-hns3-fix-burst-mode-query-with-dummy-function.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From 10f91af5a5b370df922f888826a4387abebe1cde Mon Sep 17 00:00:00 2001
+From c6b36e818356bf81a6e4d8b38689603b6e9b21ea Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 10f91af5a5b370df922f888826a4387abebe1cde ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: add debug info for Rx/Tx dummy function' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (107 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: fix burst mode query with dummy function' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: remove debug condition for Tx prepare' " Xueming Li
                     ` (48 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 873d6edb18fcc979272ebbb66b7458add6fb2fb2 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:26 +0800
Subject: [PATCH] net/hns3: add debug info for Rx/Tx dummy function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a8f52a5cf13715c61dfe224815c7f4e4858be82f ]

Now dummy function can be report by rte_eth_rx/tx_burst_mode_get.
So this patch adds debug info for Rx/Tx dummy function.

Fixes: 7feb2aee0e2c ("net/hns3: log selected datapath")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index feef9e1c7b..2524f4c3c2 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4420,13 +4420,13 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 					hns3_get_tx_function(eth_dev, &prep);
 		eth_dev->tx_pkt_prepare = prep;
 		eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
-		hns3_trace_rxtx_function(eth_dev);
 	} else {
 		eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
 		eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
 		eth_dev->tx_pkt_prepare = NULL;
 	}

+	hns3_trace_rxtx_function(eth_dev);
 	hns3_eth_dev_fp_ops_config(eth_dev);
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.423262700 +0800
+++ 0111-net-hns3-add-debug-info-for-Rx-Tx-dummy-function.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From a8f52a5cf13715c61dfe224815c7f4e4858be82f Mon Sep 17 00:00:00 2001
+From 873d6edb18fcc979272ebbb66b7458add6fb2fb2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a8f52a5cf13715c61dfe224815c7f4e4858be82f ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: remove debug condition for Tx prepare' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (108 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: add debug info for Rx/Tx " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: separate Tx prepare from getting Tx function' " Xueming Li
                     ` (47 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 418d6cbc3563bc74e78a48b221a4a92bdd008454 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:27 +0800
Subject: [PATCH] net/hns3: remove debug condition for Tx prepare
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a8d240786e1af129fdf789391d574bf4a7fe60e6 ]

The Tx prepare in driver is always needed if RTE_LIBRTE_ETHDEV_DEBUG
is defined. But it doesn't matter with this macro. Let's remove it.

Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 2524f4c3c2..921d72d69d 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4311,11 +4311,6 @@ hns3_tx_check_simple_support(struct rte_eth_dev *dev)
 static bool
 hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
 {
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
-	RTE_SET_USED(dev);
-	/* always perform tx_prepare when debug */
-	return true;
-#else
 #define HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK (\
 		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | \
 		RTE_ETH_TX_OFFLOAD_TCP_CKSUM | \
@@ -4333,7 +4328,6 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
 		return true;

 	return false;
-#endif
 }

 eth_tx_burst_t
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.454773100 +0800
+++ 0112-net-hns3-remove-debug-condition-for-Tx-prepare.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From a8d240786e1af129fdf789391d574bf4a7fe60e6 Mon Sep 17 00:00:00 2001
+From 418d6cbc3563bc74e78a48b221a4a92bdd008454 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a8d240786e1af129fdf789391d574bf4a7fe60e6 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: separate Tx prepare from getting Tx function' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (109 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: remove debug condition for Tx prepare' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: make getting Tx function static' " Xueming Li
                     ` (46 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1df48cce5e848e1f042ee6ee48cc52f57f8d0878 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:28 +0800
Subject: [PATCH] net/hns3: separate Tx prepare from getting Tx function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6a934ba4c6c48691b119a878981a4e3748766518 ]

Separate getting tx prepare from hns3_get_tx_function by extracting
an independent function.

Fixes: d7ec2c076579 ("net/hns3: select Tx prepare based on Tx offload")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 32 ++++++++++++++------------------
 drivers/net/hns3/hns3_rxtx.h |  3 +--
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 921d72d69d..9b2bd02857 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4324,26 +4324,30 @@ hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
 		RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO)

 	uint64_t tx_offload = dev->data->dev_conf.txmode.offloads;
+
 	if (tx_offload & HNS3_DEV_TX_CSKUM_TSO_OFFLOAD_MASK)
 		return true;

 	return false;
 }

+static eth_tx_prep_t
+hns3_get_tx_prepare(struct rte_eth_dev *dev)
+{
+	return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
+}
+
 eth_tx_burst_t
-hns3_get_tx_function(struct rte_eth_dev *dev, eth_tx_prep_t *prep)
+hns3_get_tx_function(struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	bool vec_allowed, sve_allowed, simple_allowed;
-	bool vec_support, tx_prepare_needed;
+	bool vec_support;

 	vec_support = hns3_tx_check_vec_support(dev) == 0;
 	vec_allowed = vec_support && hns3_get_default_vec_support();
 	sve_allowed = vec_support && hns3_get_sve_support();
 	simple_allowed = hns3_tx_check_simple_support(dev);
-	tx_prepare_needed = hns3_get_tx_prep_needed(dev);
-
-	*prep = NULL;

 	if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_VEC && vec_allowed)
 		return hns3_xmit_pkts_vec;
@@ -4351,19 +4355,14 @@ hns3_get_tx_function(struct rte_eth_dev *dev, eth_tx_prep_t *prep)
 		return hns3_xmit_pkts_vec_sve;
 	if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_SIMPLE && simple_allowed)
 		return hns3_xmit_pkts_simple;
-	if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON) {
-		if (tx_prepare_needed)
-			*prep = hns3_prep_pkts;
+	if (hns->tx_func_hint == HNS3_IO_FUNC_HINT_COMMON)
 		return hns3_xmit_pkts;
-	}

 	if (vec_allowed)
 		return hns3_xmit_pkts_vec;
 	if (simple_allowed)
 		return hns3_xmit_pkts_simple;

-	if (tx_prepare_needed)
-		*prep = hns3_prep_pkts;
 	return hns3_xmit_pkts;
 }

@@ -4403,7 +4402,6 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
 	struct hns3_adapter *hns = eth_dev->data->dev_private;
-	eth_tx_prep_t prep = NULL;

 	if (hns->hw.adapter_state == HNS3_NIC_STARTED &&
 	    __atomic_load_n(&hns->hw.reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -4411,8 +4409,8 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 		eth_dev->rx_descriptor_status = hns3_dev_rx_descriptor_status;
 		eth_dev->tx_pkt_burst = hw->set_link_down ?
 					rte_eth_pkt_burst_dummy :
-					hns3_get_tx_function(eth_dev, &prep);
-		eth_dev->tx_pkt_prepare = prep;
+					hns3_get_tx_function(eth_dev);
+		eth_dev->tx_pkt_prepare = hns3_get_tx_prepare(eth_dev);
 		eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
 	} else {
 		eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
@@ -4758,10 +4756,8 @@ hns3_stop_tx_datapath(struct rte_eth_dev *dev)
 void
 hns3_start_tx_datapath(struct rte_eth_dev *dev)
 {
-	eth_tx_prep_t prep = NULL;
-
-	dev->tx_pkt_burst = hns3_get_tx_function(dev, &prep);
-	dev->tx_pkt_prepare = prep;
+	dev->tx_pkt_burst = hns3_get_tx_function(dev);
+	dev->tx_pkt_prepare = hns3_get_tx_prepare(dev);
 	hns3_eth_dev_fp_ops_config(dev);

 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index ea1a805491..38c3581312 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -740,8 +740,7 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
 const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
 void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev,
-				    eth_tx_prep_t *prep);
+eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);

 uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
 void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.488539800 +0800
+++ 0113-net-hns3-separate-Tx-prepare-from-getting-Tx-functio.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From 6a934ba4c6c48691b119a878981a4e3748766518 Mon Sep 17 00:00:00 2001
+From 1df48cce5e848e1f042ee6ee48cc52f57f8d0878 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6a934ba4c6c48691b119a878981a4e3748766518 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: make getting Tx function static' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (110 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: separate Tx prepare from getting Tx function' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/hns3: extract common functions to set Rx/Tx' " Xueming Li
                     ` (45 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 13f062ec55ac8a26cbac51b969e1fe864d17ff32 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:29 +0800
Subject: [PATCH] net/hns3: make getting Tx function static
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2aec7beaba05cd82cd951f0c6bbaecb82d533ce0 ]

The hns3_get_tx_function() is an intrinsic function now and should
not be open to other files.

Fixes: 96c33cfb06cf ("net/hns3: fix Rx/Tx functions update")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 2 +-
 drivers/net/hns3/hns3_rxtx.h | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 9b2bd02857..def22bcd30 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4337,7 +4337,7 @@ hns3_get_tx_prepare(struct rte_eth_dev *dev)
 	return hns3_get_tx_prep_needed(dev) ? hns3_prep_pkts : NULL;
 }

-eth_tx_burst_t
+static eth_tx_burst_t
 hns3_get_tx_function(struct rte_eth_dev *dev)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index 38c3581312..1bdc124b7b 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -740,8 +740,6 @@ int hns3_tx_burst_mode_get(struct rte_eth_dev *dev,
 const uint32_t *hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 void hns3_init_rx_ptype_tble(struct rte_eth_dev *dev);
 void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev);
-eth_tx_burst_t hns3_get_tx_function(struct rte_eth_dev *dev);
-
 uint32_t hns3_get_tqp_intr_reg_offset(uint16_t tqp_intr_id);
 void hns3_set_queue_intr_gl(struct hns3_hw *hw, uint16_t queue_id,
 			    uint8_t gl_idx, uint16_t gl_value);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.521868400 +0800
+++ 0114-net-hns3-make-getting-Tx-function-static.patch	2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From 2aec7beaba05cd82cd951f0c6bbaecb82d533ce0 Mon Sep 17 00:00:00 2001
+From 13f062ec55ac8a26cbac51b969e1fe864d17ff32 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2aec7beaba05cd82cd951f0c6bbaecb82d533ce0 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/hns3: extract common functions to set Rx/Tx' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (111 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: make getting Tx function static' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/sfc: fix MAC address entry leak in transfer flow parsing' " Xueming Li
                     ` (44 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 56789776c674d47587b9809e61602fca517861be Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Sat, 11 Feb 2023 17:18:30 +0800
Subject: [PATCH] net/hns3: extract common functions to set Rx/Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ]

Extract two common functions to set Rx/Tx function in order to
reduce duplicate codes.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c    | 20 ++++----------------
 drivers/net/hns3/hns3_ethdev_vf.c | 19 ++++---------------
 drivers/net/hns3/hns3_mp.c        |  4 ++--
 drivers/net/hns3/hns3_rxtx.c      | 28 ++++++++++++++++++++++++++++
 drivers/net/hns3/hns3_rxtx.h      |  2 ++
 5 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index ab565ce128..6babf67fce 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -5052,8 +5052,7 @@ hns3_dev_start(struct rte_eth_dev *dev)
 	rte_spinlock_unlock(&hw->lock);

 	hns3_rx_scattered_calc(dev);
-	hns3_set_rxtx_function(dev);
-	hns3_mp_req_start_rxtx(dev);
+	hns3_start_rxtx_datapath(dev);

 	/* Enable interrupt of all rx queues before enabling queues */
 	hns3_dev_all_rx_queue_intr_enable(hw, true);
@@ -5131,12 +5130,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
 	dev->data->dev_started = 0;

 	hw->adapter_state = HNS3_NIC_STOPPING;
-	hns3_set_rxtx_function(dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(dev);
-	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(dev);

 	rte_spinlock_lock(&hw->lock);
 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -5752,12 +5746,7 @@ hns3_stop_service(struct hns3_adapter *hns)
 		rte_eal_alarm_cancel(hns3_service_handler, eth_dev);
 		hns3_update_linkstatus_and_event(hw, false);
 	}
-
-	hns3_set_rxtx_function(eth_dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(eth_dev);

 	rte_spinlock_lock(&hw->lock);
 	if (hns->hw.adapter_state == HNS3_NIC_STARTED ||
@@ -5790,8 +5779,7 @@ hns3_start_service(struct hns3_adapter *hns)
 	    hw->reset.level == HNS3_GLOBAL_RESET)
 		hns3_set_rst_done(hw);
 	eth_dev = &rte_eth_devices[hw->data->port_id];
-	hns3_set_rxtx_function(eth_dev);
-	hns3_mp_req_start_rxtx(eth_dev);
+	hns3_start_rxtx_datapath(eth_dev);
 	if (hw->adapter_state == HNS3_NIC_STARTED) {
 		/*
 		 * This API parent function already hold the hns3_hw.lock, the
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index d3c1bdf2c5..d051a1357b 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -1572,12 +1572,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
 	dev->data->dev_started = 0;

 	hw->adapter_state = HNS3_NIC_STOPPING;
-	hns3_set_rxtx_function(dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(dev);
-	/* Prevent crashes when queues are still in use. */
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(dev);

 	rte_spinlock_lock(&hw->lock);
 	if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) == 0) {
@@ -1731,8 +1726,7 @@ hns3vf_dev_start(struct rte_eth_dev *dev)
 	rte_spinlock_unlock(&hw->lock);

 	hns3_rx_scattered_calc(dev);
-	hns3_set_rxtx_function(dev);
-	hns3_mp_req_start_rxtx(dev);
+	hns3_start_rxtx_datapath(dev);

 	/* Enable interrupt of all rx queues before enabling queues */
 	hns3_dev_all_rx_queue_intr_enable(hw, true);
@@ -1902,11 +1896,7 @@ hns3vf_stop_service(struct hns3_adapter *hns)
 	}
 	hw->mac.link_status = RTE_ETH_LINK_DOWN;

-	hns3_set_rxtx_function(eth_dev);
-	rte_wmb();
-	/* Disable datapath on secondary process. */
-	hns3_mp_req_stop_rxtx(eth_dev);
-	rte_delay_ms(hw->cfg_max_queues);
+	hns3_stop_rxtx_datapath(eth_dev);

 	rte_spinlock_lock(&hw->lock);
 	if (hw->adapter_state == HNS3_NIC_STARTED ||
@@ -1938,8 +1928,7 @@ hns3vf_start_service(struct hns3_adapter *hns)
 	struct rte_eth_dev *eth_dev;

 	eth_dev = &rte_eth_devices[hw->data->port_id];
-	hns3_set_rxtx_function(eth_dev);
-	hns3_mp_req_start_rxtx(eth_dev);
+	hns3_start_rxtx_datapath(eth_dev);

 	rte_eal_alarm_set(HNS3VF_KEEP_ALIVE_INTERVAL, hns3vf_keep_alive_handler,
 			  eth_dev);
diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c
index 7184f9ad58..556f1941c6 100644
--- a/drivers/net/hns3/hns3_mp.c
+++ b/drivers/net/hns3/hns3_mp.c
@@ -89,12 +89,12 @@ mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer)
 	case HNS3_MP_REQ_START_RXTX:
 		PMD_INIT_LOG(INFO, "port %u starting datapath",
 			     dev->data->port_id);
-		hns3_set_rxtx_function(dev);
+		hns3_start_rxtx_datapath(dev);
 		break;
 	case HNS3_MP_REQ_STOP_RXTX:
 		PMD_INIT_LOG(INFO, "port %u stopping datapath",
 			     dev->data->port_id);
-		hns3_set_rxtx_function(dev);
+		hns3_stop_rxtx_datapath(dev);
 		break;
 	case HNS3_MP_REQ_START_TX:
 		PMD_INIT_LOG(INFO, "port %u starting Tx datapath",
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index def22bcd30..4065c519c3 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -4765,3 +4765,31 @@ hns3_start_tx_datapath(struct rte_eth_dev *dev)

 	hns3_mp_req_start_tx(dev);
 }
+
+void
+hns3_stop_rxtx_datapath(struct rte_eth_dev *dev)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	hns3_set_rxtx_function(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
+	rte_wmb();
+	/* Disable datapath on secondary process. */
+	hns3_mp_req_stop_rxtx(dev);
+	/* Prevent crashes when queues are still in use. */
+	rte_delay_ms(hw->cfg_max_queues);
+}
+
+void
+hns3_start_rxtx_datapath(struct rte_eth_dev *dev)
+{
+	hns3_set_rxtx_function(dev);
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return;
+
+	hns3_mp_req_start_rxtx(dev);
+}
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index 1bdc124b7b..fa39f6481a 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -773,5 +773,7 @@ int hns3_dev_tx_descriptor_status(void *tx_queue, uint16_t offset);
 void hns3_tx_push_init(struct rte_eth_dev *dev);
 void hns3_stop_tx_datapath(struct rte_eth_dev *dev);
 void hns3_start_tx_datapath(struct rte_eth_dev *dev);
+void hns3_stop_rxtx_datapath(struct rte_eth_dev *dev);
+void hns3_start_rxtx_datapath(struct rte_eth_dev *dev);

 #endif /* HNS3_RXTX_H */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.557177800 +0800
+++ 0115-net-hns3-extract-common-functions-to-set-Rx-Tx.patch	2023-02-27 14:08:40.869237000 +0800
@@ -1 +1 @@
-From 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 Mon Sep 17 00:00:00 2001
+From 56789776c674d47587b9809e61602fca517861be Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4ba28c957a16bbfe5b2a8d49dfda1c85387d7602 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/sfc: fix MAC address entry leak in transfer flow parsing' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (112 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/hns3: extract common functions to set Rx/Tx' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/sfc: enforce fate action in transfer flow rules' " Xueming Li
                     ` (43 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Ivan Malov
  Cc: Viacheslav Galaktionov, Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From be7d6baf283b04ed23727b931494931c019bf6c6 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Tue, 14 Feb 2023 17:06:59 +0400
Subject: [PATCH] net/sfc: fix MAC address entry leak in transfer flow parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 97f7e36ad946986a14903db68b6770aacaf53ae1 ]

When the action parsing helper discovers it can "attach" to
an existing action set, it must invoke "delete" on the MAC
address(es) that it has "attached" to during parsing. That
is because the action set itself (i.e. not the flow rule
entry) holds a reference of the address(es).

Fixes: 4c6005999e41 ("net/sfc: support MAC address edits in transfer flows")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 421bb6da95..5611a0174f 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -3912,6 +3912,8 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,

 	spec_mae->action_set = sfc_mae_action_set_attach(sa, &ctx);
 	if (spec_mae->action_set != NULL) {
+		sfc_mae_mac_addr_del(sa, ctx.src_mac);
+		sfc_mae_mac_addr_del(sa, ctx.dst_mac);
 		sfc_mae_encap_header_del(sa, ctx.encap_header);
 		efx_mae_action_set_spec_fini(sa->nic, ctx.spec);
 		return 0;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.594528000 +0800
+++ 0116-net-sfc-fix-MAC-address-entry-leak-in-transfer-flow-.patch	2023-02-27 14:08:40.869237000 +0800
@@ -1 +1 @@
-From 97f7e36ad946986a14903db68b6770aacaf53ae1 Mon Sep 17 00:00:00 2001
+From be7d6baf283b04ed23727b931494931c019bf6c6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 97f7e36ad946986a14903db68b6770aacaf53ae1 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index aab697b204..c254562696 100644
+index 421bb6da95..5611a0174f 100644

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

* patch 'net/sfc: enforce fate action in transfer flow rules' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (113 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/sfc: fix MAC address entry leak in transfer flow parsing' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/txgbe: fix Rx buffer size in config register' " Xueming Li
                     ` (42 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Ivan Malov
  Cc: Viacheslav Galaktionov, Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3a842fbbb73ba55c64da1e01ca030907f7a760fd Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Tue, 14 Feb 2023 17:12:47 +0400
Subject: [PATCH] net/sfc: enforce fate action in transfer flow rules
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3b8e8f046b6754dfa7157675699ea0f5c65bba36 ]

According to DPDK documentation, not specifying a
fate action in a flow rule results in undefined
behaviour. Define right behaviour in the driver.

Fixes: 0839236d0391 ("net/sfc: support flow action drop in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 5611a0174f..82d5a95ec4 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -3910,6 +3910,21 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 		SFC_ASSERT(B_FALSE);
 	}

+	/*
+	 * A DPDK flow entry must specify a fate action, which the parser
+	 * converts into a DELIVER action in a libefx action set. An
+	 * attempt to replace the action in the action set should
+	 * fail. If it succeeds then report an error, as the
+	 * parsed flow entry did not contain a fate action.
+	 */
+	rc = efx_mae_action_set_populate_drop(ctx.spec);
+	if (rc == 0) {
+		rc = rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+					"no fate action found");
+		goto fail_check_fate_action;
+	}
+
 	spec_mae->action_set = sfc_mae_action_set_attach(sa, &ctx);
 	if (spec_mae->action_set != NULL) {
 		sfc_mae_mac_addr_del(sa, ctx.src_mac);
@@ -3926,6 +3941,7 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 	return 0;

 fail_action_set_add:
+fail_check_fate_action:
 fail_workaround_tunnel_delivery:
 fail_nb_count:
 	sfc_mae_encap_header_del(sa, ctx.encap_header);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.625341800 +0800
+++ 0117-net-sfc-enforce-fate-action-in-transfer-flow-rules.patch	2023-02-27 14:08:40.869237000 +0800
@@ -1 +1 @@
-From 3b8e8f046b6754dfa7157675699ea0f5c65bba36 Mon Sep 17 00:00:00 2001
+From 3a842fbbb73ba55c64da1e01ca030907f7a760fd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3b8e8f046b6754dfa7157675699ea0f5c65bba36 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index c254562696..3daeed81b9 100644
+index 5611a0174f..82d5a95ec4 100644

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

* patch 'net/txgbe: fix Rx buffer size in config register' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (114 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/sfc: enforce fate action in transfer flow rules' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix available tag registers calculation for HWS' " Xueming Li
                     ` (41 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a93bb50b6c95b0b202df23f9eb263d6edf9436d4 Mon Sep 17 00:00:00 2001
From: Jiawen Wu <jiawenwu@trustnetic.com>
Date: Wed, 15 Feb 2023 10:00:56 +0800
Subject: [PATCH] net/txgbe: fix Rx buffer size in config register
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d ]

When round up buffer size to 1K, to configure the register, hardware
will receive packets exceeding the buffer size in LRO mode. It will
cause a segment fault in the receive function.

Fixes: be797cbf4582 ("net/txgbe: add Rx and Tx init")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 021f281fbb..427f8b82ac 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -4392,7 +4392,7 @@ txgbe_dev_rx_init(struct rte_eth_dev *dev)
 		 */
 		buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mb_pool) -
 			RTE_PKTMBUF_HEADROOM);
-		buf_size = ROUND_UP(buf_size, 0x1 << 10);
+		buf_size = ROUND_DOWN(buf_size, 0x1 << 10);
 		srrctl |= TXGBE_RXCFG_PKTLEN(buf_size);

 		wr32(hw, TXGBE_RXCFG(rxq->reg_idx), srrctl);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.656228000 +0800
+++ 0118-net-txgbe-fix-Rx-buffer-size-in-config-register.patch	2023-02-27 14:08:40.869237000 +0800
@@ -1 +1 @@
-From 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d Mon Sep 17 00:00:00 2001
+From a93bb50b6c95b0b202df23f9eb263d6edf9436d4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8a3ef4b89e6dd0247355fdf3a77ff7ec1db28d8d ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: fix available tag registers calculation for HWS' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (115 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/txgbe: fix Rx buffer size in config register' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix GENEVE resource overwrite' " Xueming Li
                     ` (40 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Bing Zhao, Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dcb16c48e0bda0839c1cc1ad6e955a290614d69b Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Tue, 22 Nov 2022 12:53:20 +0000
Subject: [PATCH] net/mlx5: fix available tag registers calculation for HWS
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1888b455dfe2b31d09fbce61e671507313ed451e ]

Before this patch, if two ports in separate switch domains
were probed by an application, the shared array of available TAG
registers was calculated incorrectly.

When the intersection of supported REG_C registers and
available TAG registers was calculated,
capabilities were checked against an index of the TAG array,
not the register stored under that index.

This patch fixes this behavior by comparing capabilities mask
against registers stored in the TAG array.
Available TAG registers calculation is also refactored
to simplify the code.

Fixes: 8a89038f40ca ("net/mlx5: provide available tag registers")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 46 +++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index a3c8056515..20c71ff7f0 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -7178,9 +7178,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)
 	uint32_t meta_mode = priv->sh->config.dv_xmeta_en;
 	uint8_t masks = (uint8_t)priv->sh->cdev->config.hca_attr.set_reg_c;
 	uint32_t i, j;
-	enum modify_reg copy[MLX5_FLOW_HW_TAGS_MAX] = {REG_NON};
+	uint8_t reg_off;
 	uint8_t unset = 0;
-	uint8_t copy_masks = 0;
+	uint8_t common_masks = 0;

 	/*
 	 * The CAPA is global for common device but only used in net.
@@ -7195,29 +7195,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)
 	if (meta_mode == MLX5_XMETA_MODE_META32_HWS)
 		unset |= 1 << (REG_C_1 - REG_C_0);
 	masks &= ~unset;
+	/*
+	 * If available tag registers were previously calculated,
+	 * calculate a bitmask with an intersection of sets of:
+	 * - registers supported by current port,
+	 * - previously calculated available tag registers.
+	 */
 	if (mlx5_flow_hw_avl_tags_init_cnt) {
 		MLX5_ASSERT(mlx5_flow_hw_aso_tag == priv->mtr_color_reg);
 		for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) {
-			if (mlx5_flow_hw_avl_tags[i] != REG_NON && !!((1 << i) & masks)) {
-				copy[mlx5_flow_hw_avl_tags[i] - REG_C_0] =
-						mlx5_flow_hw_avl_tags[i];
-				copy_masks |= (1 << (mlx5_flow_hw_avl_tags[i] - REG_C_0));
-			}
-		}
-		if (copy_masks != masks) {
-			j = 0;
-			for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++)
-				if (!!((1 << i) & copy_masks))
-					mlx5_flow_hw_avl_tags[j++] = copy[i];
-		}
-	} else {
-		j = 0;
-		for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) {
-			if (!!((1 << i) & masks))
-				mlx5_flow_hw_avl_tags[j++] =
-					(enum modify_reg)(i + (uint32_t)REG_C_0);
+			if (mlx5_flow_hw_avl_tags[i] == REG_NON)
+				continue;
+			reg_off = mlx5_flow_hw_avl_tags[i] - REG_C_0;
+			if ((1 << reg_off) & masks)
+				common_masks |= (1 << reg_off);
 		}
+		if (common_masks != masks)
+			masks = common_masks;
+		else
+			goto after_avl_tags;
+	}
+	j = 0;
+	for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) {
+		if ((1 << i) & masks)
+			mlx5_flow_hw_avl_tags[j++] = (enum modify_reg)(i + (uint32_t)REG_C_0);
 	}
+	/* Clear the rest of unusable tag indexes. */
+	for (; j < MLX5_FLOW_HW_TAGS_MAX; j++)
+		mlx5_flow_hw_avl_tags[j] = REG_NON;
+after_avl_tags:
 	priv->sh->hws_tags = 1;
 	mlx5_flow_hw_aso_tag = (enum modify_reg)priv->mtr_color_reg;
 	mlx5_flow_hw_avl_tags_init_cnt++;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.688866200 +0800
+++ 0119-net-mlx5-fix-available-tag-registers-calculation-for.patch	2023-02-27 14:08:40.879237000 +0800
@@ -1 +1 @@
-From 1888b455dfe2b31d09fbce61e671507313ed451e Mon Sep 17 00:00:00 2001
+From dcb16c48e0bda0839c1cc1ad6e955a290614d69b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1888b455dfe2b31d09fbce61e671507313ed451e ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -31 +33 @@
-index 6893431011..2930f3b0b9 100644
+index a3c8056515..20c71ff7f0 100644
@@ -34 +36 @@
-@@ -7180,9 +7180,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)
+@@ -7178,9 +7178,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)
@@ -46 +48 @@
-@@ -7197,29 +7197,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)
+@@ -7195,29 +7195,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)

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

* patch 'net/mlx5: fix GENEVE resource overwrite' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (116 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix available tag registers calculation for HWS' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'common/mlx5: improve AES-XTS tweak capability check' " Xueming Li
                     ` (39 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4434048bbecd86cafba6e27af7f4ff3871b1773f Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Wed, 23 Nov 2022 13:57:12 +0200
Subject: [PATCH] net/mlx5: fix GENEVE resource overwrite
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 579c00411ac87970b685de80239bc35b74e7a33e ]

Currently, one rte_flow may be split to multiple sub mlx5_flows.
While GENEVE option resource was allocated in the first mlx5_flow,
the flag will be overwritten by next sub mlx5_flow. This caused
GENEVE option resource leakage.

This commit adds the check of GENEVE option resource to avoid the
GENEVE option flag be overwritten.

Fixes: cd4ab742064a ("net/mlx5: split flow item matcher and value translation")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 62c38b87a1..7ca909999b 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -13717,7 +13717,12 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
 	 * is the suffix flow.
 	 */
 	dev_flow->handle->layers |= wks.item_flags;
-	dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
+	/*
+	 * Update geneve_tlv_option flag only it is set in workspace.
+	 * Avoid be overwritten by other sub mlx5_flows.
+	 */
+	if (wks.geneve_tlv_option)
+		dev_flow->flow->geneve_tlv_option = wks.geneve_tlv_option;
 	return 0;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.723854500 +0800
+++ 0120-net-mlx5-fix-GENEVE-resource-overwrite.patch	2023-02-27 14:08:40.889237000 +0800
@@ -1 +1 @@
-From 579c00411ac87970b685de80239bc35b74e7a33e Mon Sep 17 00:00:00 2001
+From 4434048bbecd86cafba6e27af7f4ff3871b1773f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 579c00411ac87970b685de80239bc35b74e7a33e ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index bf98c26018..9e5db6b945 100644
+index 62c38b87a1..7ca909999b 100644
@@ -27 +29 @@
-@@ -13793,7 +13793,12 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,
+@@ -13717,7 +13717,12 @@ flow_dv_translate_items_sws(struct rte_eth_dev *dev,

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

* patch 'common/mlx5: improve AES-XTS tweak capability check' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (117 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix GENEVE resource overwrite' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'common/mlx5: fix offset of a field' " Xueming Li
                     ` (38 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f3282a003f3181b8d2b52736f04bab2a6d490d5c Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm@nvidia.com>
Date: Tue, 6 Dec 2022 03:17:24 +0200
Subject: [PATCH] common/mlx5: improve AES-XTS tweak capability check
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cedb44dc87bb6f23f6381684ed9f5999613095b6 ]

Bluefield-3 and above devices use aes_xts_multi_block_be_tweak
bit to indicate AES-XTS capability. The devices below use
aes_xts_single_block_le_tweak bit.

This commit adds the AES-XTS attribute set while one of the
bits is set to make the attribute compatible with all the
devices.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 4 +++-
 drivers/common/mlx5/mlx5_prm.h       | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 59cebb530f..e3a4927d0f 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1013,7 +1013,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
 	attr->flow_access_aso_opc_mod = MLX5_GET(cmd_hca_cap, hcattr,
 			flow_access_aso_opc_mod);
 	if (attr->crypto) {
-		attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts);
+		attr->aes_xts = MLX5_GET(cmd_hca_cap, hcattr, aes_xts) ||
+		MLX5_GET(cmd_hca_cap, hcattr, aes_xts_multi_block_be_tweak) ||
+		MLX5_GET(cmd_hca_cap, hcattr, aes_xts_single_block_le_tweak);
 		hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc,
 				MLX5_GET_HCA_CAP_OP_MOD_CRYPTO |
 				MLX5_HCA_CAP_OPMOD_GET_CUR);
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 2b5c43ee6e..6ec5185a7c 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -1679,7 +1679,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {
 	u8 log_min_hairpin_wq_data_sz[0x5];
 	u8 reserved_at_3e8[0x3];
 	u8 log_max_vlan_list[0x5];
-	u8 reserved_at_3f0[0x3];
+	u8 reserved_at_3f0[0x1];
+	u8 aes_xts_single_block_le_tweak[1];
+	u8 aes_xts_multi_block_be_tweak[1];
 	u8 log_max_current_mc_list[0x5];
 	u8 reserved_at_3f8[0x3];
 	u8 log_max_current_uc_list[0x5];
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.764873100 +0800
+++ 0121-common-mlx5-improve-AES-XTS-tweak-capability-check.patch	2023-02-27 14:08:40.889237000 +0800
@@ -1 +1 @@
-From cedb44dc87bb6f23f6381684ed9f5999613095b6 Mon Sep 17 00:00:00 2001
+From f3282a003f3181b8d2b52736f04bab2a6d490d5c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cedb44dc87bb6f23f6381684ed9f5999613095b6 ]
@@ -13,2 +15,0 @@
-
-Cc: stable@dpdk.org

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

* patch 'common/mlx5: fix offset of a field' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (118 preceding siblings ...)
  2023-02-27  7:00   ` patch 'common/mlx5: improve AES-XTS tweak capability check' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix flow sample with ConnectX-5' " Xueming Li
                     ` (37 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Alex Vesker; +Cc: Erez Shitrit, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 575cfce6a7a8fab4c7c200db67fa521f56e2b70a Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex@nvidia.com>
Date: Thu, 8 Dec 2022 13:08:59 +0200
Subject: [PATCH] common/mlx5: fix offset of a field
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d1cbb4063c1c320673435fced7edd5ce6e465d5c ]

The offset of format_select_dw_8_6_ext was incorrect.
Update the reserved offsets to correct value.

Fixes: 365cdf5f8ce7 ("net/mlx5/hws: add command layer")

Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_prm.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 6ec5185a7c..3732fd0871 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -2123,10 +2123,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits {
 	u8 hairpin_sq_wqe_bb_size[0x5];
 	u8 hairpin_sq_wq_in_host_mem[0x1];
 	u8 hairpin_data_buffer_locked[0x1];
-	u8 reserved_at_16a[0x36];
-	u8 reserved_at_1a0[0xb];
+	u8 reserved_at_16a[0x16];
+	u8 reserved_at_180[0x20];
+	u8 reserved_at_1a0[0xa];
 	u8 format_select_dw_8_6_ext[0x1];
-	u8 reserved_at_1ac[0x14];
+	u8 reserved_at_1ac[0x15];
 	u8 general_obj_types_127_64[0x40];
 	u8 reserved_at_200[0x53];
 	u8 flow_counter_bulk_log_max_alloc[0x5];
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.797006800 +0800
+++ 0122-common-mlx5-fix-offset-of-a-field.patch	2023-02-27 14:08:40.889237000 +0800
@@ -1 +1 @@
-From d1cbb4063c1c320673435fced7edd5ce6e465d5c Mon Sep 17 00:00:00 2001
+From 575cfce6a7a8fab4c7c200db67fa521f56e2b70a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d1cbb4063c1c320673435fced7edd5ce6e465d5c ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: fix flow sample with ConnectX-5' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (119 preceding siblings ...)
  2023-02-27  7:00   ` patch 'common/mlx5: fix offset of a field' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix wait descriptor opcode for ConnectX-7' " Xueming Li
                     ` (36 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jiawei Wang; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d5be08262127a74d41e2db1f740dbdc099b1399d Mon Sep 17 00:00:00 2001
From: Jiawei Wang <jiaweiw@nvidia.com>
Date: Fri, 9 Dec 2022 16:34:06 +0200
Subject: [PATCH] net/mlx5: fix flow sample with ConnectX-5
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7aa6d7998a9e59dc510e4e5706f675493855ff27 ]

The sample flow tried to get the reserved metadata register for
the match implicitly, and if the reserved metadata register was
invalid then back to use the application tag.

The assertion failure was caused while getting registered due to
the reserved metadata regC is invalid on CX-5 trusted device(VF/SF).

This patch adds the checking for reserved metadata register before
getting the register, to avoid assertion failure.

Fixes: 9a726360dd30 ("net/mlx5: fix sample flow action on trusted device")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a0cf677fb0..1768ec3cdb 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -6125,13 +6125,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
 		/* Prepare the prefix tag action. */
 		append_index++;
 		set_tag = (void *)(actions_pre + actions_n + append_index);
-		ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error);
 		/* Trust VF/SF on CX5 not supported meter so that the reserved
 		 * metadata regC is REG_NON, back to use application tag
 		 * index 0.
 		 */
-		if (unlikely(ret == REG_NON))
+		if (unlikely(priv->mtr_color_reg == REG_NON))
 			ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, 0, error);
+		else
+			ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error);
 		if (ret < 0)
 			return ret;
 		mlx5_ipool_malloc(priv->sh->ipool
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.826674300 +0800
+++ 0123-net-mlx5-fix-flow-sample-with-ConnectX-5.patch	2023-02-27 14:08:40.899237000 +0800
@@ -1 +1 @@
-From 7aa6d7998a9e59dc510e4e5706f675493855ff27 Mon Sep 17 00:00:00 2001
+From d5be08262127a74d41e2db1f740dbdc099b1399d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7aa6d7998a9e59dc510e4e5706f675493855ff27 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 51547aa78f..ea2016598e 100644
+index a0cf677fb0..1768ec3cdb 100644
@@ -29 +31 @@
-@@ -6186,13 +6186,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,
+@@ -6125,13 +6125,14 @@ flow_sample_split_prep(struct rte_eth_dev *dev,

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

* patch 'net/mlx5: fix wait descriptor opcode for ConnectX-7' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (120 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix flow sample with ConnectX-5' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix warning for Tx scheduling option' " Xueming Li
                     ` (35 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a04fa37e6e4756cc9f8c22ed1517c979b92a1c2f Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Tue, 3 Jan 2023 13:10:41 +0200
Subject: [PATCH] net/mlx5: fix wait descriptor opcode for ConnectX-7
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2c7cb21a42fa64d68c0bc026f89f1ce561764da2 ]

Since ConnectX-7 the special hardware capability to schedule
packet sending on specified time is provided. It uses special
WAIT WQE (hardware descriptor) with wait condition defined
by opcode. The CYCLIC_BIGGER was wrongly used instead of
CYCLIC_SMALLER. This caused arbitrary and stale time shift
in traffic scheduling.

Fixes: 49e8797619e40 ("net/mlx5: support wait on time in Tx")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_tx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h
index a44050a1ce..a056be7ca8 100644
--- a/drivers/net/mlx5/mlx5_tx.h
+++ b/drivers/net/mlx5/mlx5_tx.h
@@ -817,7 +817,7 @@ mlx5_tx_wseg_init(struct mlx5_txq_data *restrict txq,
 	struct mlx5_wqe_wseg *ws;

 	ws = RTE_PTR_ADD(wqe, MLX5_WSEG_SIZE);
-	ws->operation = rte_cpu_to_be_32(MLX5_WAIT_COND_CYCLIC_BIGGER);
+	ws->operation = rte_cpu_to_be_32(MLX5_WAIT_COND_CYCLIC_SMALLER);
 	ws->lkey = RTE_BE32(0);
 	ws->va_high = RTE_BE32(0);
 	ws->va_low = RTE_BE32(0);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.859320300 +0800
+++ 0124-net-mlx5-fix-wait-descriptor-opcode-for-ConnectX-7.patch	2023-02-27 14:08:40.899237000 +0800
@@ -1 +1 @@
-From 2c7cb21a42fa64d68c0bc026f89f1ce561764da2 Mon Sep 17 00:00:00 2001
+From a04fa37e6e4756cc9f8c22ed1517c979b92a1c2f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2c7cb21a42fa64d68c0bc026f89f1ce561764da2 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: fix warning for Tx scheduling option' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (121 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix wait descriptor opcode for ConnectX-7' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix read device clock in real time mode' " Xueming Li
                     ` (34 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 35eadc22bc9c1657c520c8fe333b0d0ff848fe89 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Tue, 3 Jan 2023 13:11:13 +0200
Subject: [PATCH] net/mlx5: fix warning for Tx scheduling option
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 95cbaaa1065f86db389db37036d1f56ce09d8cb2 ]

Since ConnectX-7 hardware supports the send scheduling
on explicitly specified timestamp, if this feature support
is detected by PMD the tx_skew devarg becomes applicable
and appropriate warning should not be emitted.

Fixes: 49e8797619e40 ("net/mlx5: support wait on time in Tx")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@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 e55be8720e..3ae35587b6 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1401,7 +1401,8 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh,
 		rte_errno = ENODEV;
 		return -rte_errno;
 	}
-	if (!config->tx_pp && config->tx_skew) {
+	if (!config->tx_pp && config->tx_skew &&
+	    !sh->cdev->config.hca_attr.wait_on_time) {
 		DRV_LOG(WARNING,
 			"\"tx_skew\" doesn't affect without \"tx_pp\".");
 	}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.888502800 +0800
+++ 0125-net-mlx5-fix-warning-for-Tx-scheduling-option.patch	2023-02-27 14:08:40.899237000 +0800
@@ -1 +1 @@
-From 95cbaaa1065f86db389db37036d1f56ce09d8cb2 Mon Sep 17 00:00:00 2001
+From 35eadc22bc9c1657c520c8fe333b0d0ff848fe89 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 95cbaaa1065f86db389db37036d1f56ce09d8cb2 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: fix read device clock in real time mode' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (122 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix warning for Tx scheduling option' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5/hws: fix memory leak on general pool DB init' " Xueming Li
                     ` (33 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Viacheslav Ovsiienko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 394ba3cfc4fdd2cee49902603983d58849a8e9e1 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Tue, 3 Jan 2023 13:11:45 +0200
Subject: [PATCH] net/mlx5: fix read device clock in real time mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9b31fc9007f9d706288b7d9852a86d2a5d0cd355 ]

Since ConnectX-6DX the real time timestamp mode is supported.
The rte_eth_read_clock() routine queries current timestamp
value from the PMD.

The mlx5 PMD has special infrastructure to schedule packet
sending in real time mode which can be engaged with tx_pp devarg.
This infrastructure provides the timestamp reading from the special
queue CEQs directly from the host memory in user space, without
involving kernel calls.

The ConnectX-7 NIC has hardware capability to schedule packet
sending without special infrastructure and tx_pp devarg can be
omitted. If there is no tx_pp devarg specified the mlx5 uses kernel
calls to query current timestamp value. The kernel can be completely
unaware about engaged real time mode, also kernel might use its
internal queue CQEs to get timestamps, that is neither precise nor
reliable, inconsistent values might be returned, causing send
scheduling malfunction.

The HCA PCI BAR provides the real time direct reading from hardware.
This patch maps PCI resource to the process address space on demand
and allows reading the real time timestamp values from the NIC
directly.

Fixes: b94d93ca73803 ("net/mlx5: support reading device clock")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/mlx5_common.h         |  1 +
 drivers/common/mlx5/mlx5_prm.h            |  5 +-
 drivers/common/mlx5/version.map           |  1 +
 drivers/net/mlx5/linux/mlx5_ethdev_os.c   | 68 +++++++++++++++++++++++
 drivers/net/mlx5/mlx5.c                   |  6 +-
 drivers/net/mlx5/mlx5.h                   |  4 ++
 drivers/net/mlx5/mlx5_txpp.c              | 15 ++++-
 drivers/net/mlx5/windows/mlx5_ethdev_os.c | 30 ++++++++++
 8 files changed, 127 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index d6e91b5296..c7bd703497 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -221,6 +221,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
  *   - 0 on success.
  *   - Negative value and rte_errno is set otherwise.
  */
+__rte_internal
 int mlx5_dev_to_pci_str(const struct rte_device *dev, char *addr, size_t size);

 /*
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 3732fd0871..dab70b9469 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -3043,6 +3043,7 @@ struct mlx5_ifc_health_buffer_bits {
 	u8 ext_synd[0x10];
 };

+/* HCA PCI BAR resource structure. */
 struct mlx5_ifc_initial_seg_bits {
 	u8 fw_rev_minor[0x10];
 	u8 fw_rev_major[0x10];
@@ -3070,7 +3071,9 @@ struct mlx5_ifc_initial_seg_bits {
 	u8 clear_int[0x1];
 	u8 health_syndrome[0x8];
 	u8 health_counter[0x18];
-	u8 reserved_8[0x17fc0];
+	u8 reserved_8[0x160];
+	u8 real_time[0x40];
+	u8 reserved_9[0x17e20];
 };

 struct mlx5_ifc_create_cq_out_bits {
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 4f72900519..03c8ce5593 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -14,6 +14,7 @@ INTERNAL {

 	mlx5_dev_is_pci;
 	mlx5_dev_is_vf_pci;
+	mlx5_dev_to_pci_str;
 	mlx5_dev_mempool_unregister;
 	mlx5_dev_mempool_subscribe;

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 72268c0c8a..f1ff6f49f9 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -28,6 +28,7 @@
 #include <bus_pci_driver.h>
 #include <rte_mbuf.h>
 #include <rte_common.h>
+#include <rte_eal_paging.h>
 #include <rte_interrupts.h>
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
@@ -1776,3 +1777,70 @@ exit:
 	mlx5_free(sset_info);
 	return ret;
 }
+
+/**
+ * Unmaps HCA PCI BAR from the current process address space.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ */
+void mlx5_txpp_unmap_hca_bar(struct rte_eth_dev *dev)
+{
+	struct mlx5_proc_priv *ppriv = dev->process_private;
+
+	if (ppriv && ppriv->hca_bar) {
+		rte_mem_unmap(ppriv->hca_bar, MLX5_ST_SZ_BYTES(initial_seg));
+		ppriv->hca_bar = NULL;
+	}
+}
+
+/**
+ * Maps HCA PCI BAR to the current process address space.
+ * Stores pointer in the process private structure allowing
+ * to read internal and real time counter directly from the HW.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ *
+ * @return
+ *   0 on success and not NULL pointer to mapped area in process structure.
+ *   negative otherwise and NULL pointer
+ */
+int mlx5_txpp_map_hca_bar(struct rte_eth_dev *dev)
+{
+	struct mlx5_proc_priv *ppriv = dev->process_private;
+	char pci_addr[PCI_PRI_STR_SIZE] = { 0 };
+	void *base, *expected = NULL;
+	int fd, ret;
+
+	if (!ppriv) {
+		rte_errno = ENOMEM;
+		return -rte_errno;
+	}
+	if (ppriv->hca_bar)
+		return 0;
+	ret = mlx5_dev_to_pci_str(dev->device, pci_addr, sizeof(pci_addr));
+	if (ret < 0)
+		return -rte_errno;
+	/* Open PCI device resource 0 - HCA initialize segment */
+	MKSTR(name, "/sys/bus/pci/devices/%s/resource0", pci_addr);
+	fd = open(name, O_RDWR | O_SYNC);
+	if (fd == -1) {
+		rte_errno = ENOTSUP;
+		return -ENOTSUP;
+	}
+	base = rte_mem_map(NULL, MLX5_ST_SZ_BYTES(initial_seg),
+			   RTE_PROT_READ, RTE_MAP_SHARED, fd, 0);
+	close(fd);
+	if (!base) {
+		rte_errno = ENOTSUP;
+		return -ENOTSUP;
+	}
+	/* Check there is no concurrent mapping in other thread. */
+	if (!__atomic_compare_exchange_n(&ppriv->hca_bar, &expected,
+					 base, false,
+					 __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+		rte_mem_unmap(base, MLX5_ST_SZ_BYTES(initial_seg));
+	return 0;
+}
+
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 3ae35587b6..b8643cebdd 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1977,8 +1977,12 @@ mlx5_proc_priv_init(struct rte_eth_dev *dev)
 void
 mlx5_proc_priv_uninit(struct rte_eth_dev *dev)
 {
-	if (!dev->process_private)
+	struct mlx5_proc_priv *ppriv = dev->process_private;
+
+	if (!ppriv)
 		return;
+	if (ppriv->hca_bar)
+		mlx5_txpp_unmap_hca_bar(dev);
 	mlx5_free(dev->process_private);
 	dev->process_private = NULL;
 }
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 31982002ee..16b33e1548 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1463,6 +1463,8 @@ struct mlx5_dev_ctx_shared {
  * Caution, secondary process may rebuild the struct during port start.
  */
 struct mlx5_proc_priv {
+	void *hca_bar;
+	/* Mapped HCA PCI BAR area. */
 	size_t uar_table_sz;
 	/* Size of UAR register table. */
 	struct mlx5_uar_data uar_table[];
@@ -2163,6 +2165,8 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev,
 			       struct rte_eth_xstat_name *xstats_names,
 			       unsigned int n, unsigned int n_used);
 void mlx5_txpp_interrupt_handler(void *cb_arg);
+int mlx5_txpp_map_hca_bar(struct rte_eth_dev *dev);
+void mlx5_txpp_unmap_hca_bar(struct rte_eth_dev *dev);

 /* mlx5_rxtx.c */

diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index f853a67f58..63d98dbde9 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -969,6 +969,8 @@ mlx5_txpp_read_clock(struct rte_eth_dev *dev, uint64_t *timestamp)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_dev_ctx_shared *sh = priv->sh;
+	struct mlx5_proc_priv *ppriv;
+	uint64_t ts;
 	int ret;

 	if (sh->txpp.refcnt) {
@@ -979,7 +981,6 @@ mlx5_txpp_read_clock(struct rte_eth_dev *dev, uint64_t *timestamp)
 			rte_int128_t u128;
 			struct mlx5_cqe_ts cts;
 		} to;
-		uint64_t ts;

 		mlx5_atomic_read_cqe((rte_int128_t *)&cqe->timestamp, &to.u128);
 		if (to.cts.op_own >> 4) {
@@ -994,6 +995,18 @@ mlx5_txpp_read_clock(struct rte_eth_dev *dev, uint64_t *timestamp)
 		*timestamp = ts;
 		return 0;
 	}
+	/* Check and try to map HCA PIC BAR to allow reading real time. */
+	ppriv = dev->process_private;
+	if (ppriv && !ppriv->hca_bar &&
+	    sh->dev_cap.rt_timestamp && mlx5_dev_is_pci(dev->device))
+		mlx5_txpp_map_hca_bar(dev);
+	/* Check if we can read timestamp directly from hardware. */
+	if (ppriv && ppriv->hca_bar) {
+		ts = MLX5_GET64(initial_seg, ppriv->hca_bar, real_time);
+		ts = mlx5_txpp_convert_rx_ts(sh, ts);
+		*timestamp = ts;
+		return 0;
+	}
 	/* Not supported in isolated mode - kernel does not see the CQEs. */
 	if (priv->isolated || rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return -ENOTSUP;
diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
index 88d8213f55..a31e1b5494 100644
--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
@@ -416,3 +416,33 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev)
 	RTE_SET_USED(dev);
 	return -ENOTSUP;
 }
+
+/**
+ * Unmaps HCA PCI BAR from the current process address space.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ */
+void mlx5_txpp_unmap_hca_bar(struct rte_eth_dev *dev)
+{
+	RTE_SET_USED(dev);
+}
+
+/**
+ * Maps HCA PCI BAR to the current process address space.
+ * Stores pointer in the process private structure allowing
+ * to read internal and real time counter directly from the HW.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ *
+ * @return
+ *   0 on success and not NULL pointer to mapped area in process structure.
+ *   negative otherwise and NULL pointer
+ */
+int mlx5_txpp_map_hca_bar(struct rte_eth_dev *dev)
+{
+	RTE_SET_USED(dev);
+	rte_errno = ENOTSUP;
+	return -ENOTSUP;
+}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.917311900 +0800
+++ 0126-net-mlx5-fix-read-device-clock-in-real-time-mode.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From 9b31fc9007f9d706288b7d9852a86d2a5d0cd355 Mon Sep 17 00:00:00 2001
+From 394ba3cfc4fdd2cee49902603983d58849a8e9e1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9b31fc9007f9d706288b7d9852a86d2a5d0cd355 ]
@@ -31 +33,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5/hws: fix memory leak on general pool DB init' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (123 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix read device clock in real time mode' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: fix error CQE dumping for vectorized Rx' " Xueming Li
                     ` (32 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Alex Vesker; +Cc: Erez Shitrit, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9e0308d5ef3c884ed4a76db16735d2dec2cfc279 Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex@nvidia.com>
Date: Wed, 11 Jan 2023 21:49:03 +0200
Subject: [PATCH] net/mlx5/hws: fix memory leak on general pool DB init
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 86ed522a82059896263ca8c7488403fccf62c6a7 ]

On elemend db init we allocated the element_manager
which was unused and not freed.

Fixes: b4dd7bcb0dcbe ("net/mlx5/hws: add pool and buddy")

Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_pool.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.c b/drivers/net/mlx5/hws/mlx5dr_pool.c
index fdbd3d438d..af6a5c743b 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pool.c
+++ b/drivers/net/mlx5/hws/mlx5dr_pool.c
@@ -464,13 +464,6 @@ static void mlx5dr_pool_general_element_db_uninit(struct mlx5dr_pool *pool)
  */
 static int mlx5dr_pool_general_element_db_init(struct mlx5dr_pool *pool)
 {
-	pool->db.element_manager = simple_calloc(1, sizeof(*pool->db.element_manager));
-	if (!pool->db.element_manager) {
-		DR_LOG(ERR, "No mem for general elemnt_manager");
-		rte_errno = ENOMEM;
-		return rte_errno;
-	}
-
 	pool->p_db_uninit = &mlx5dr_pool_general_element_db_uninit;
 	pool->p_get_chunk = &mlx5dr_pool_general_element_db_get_chunk;
 	pool->p_put_chunk = &mlx5dr_pool_general_element_db_put_chunk;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.956006200 +0800
+++ 0127-net-mlx5-hws-fix-memory-leak-on-general-pool-DB-init.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From 86ed522a82059896263ca8c7488403fccf62c6a7 Mon Sep 17 00:00:00 2001
+From 9e0308d5ef3c884ed4a76db16735d2dec2cfc279 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 86ed522a82059896263ca8c7488403fccf62c6a7 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: fix error CQE dumping for vectorized Rx' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (124 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5/hws: fix memory leak on general pool DB init' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: ignore non-critical syndromes for Rx queue' " Xueming Li
                     ` (31 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 47f5a0e5f344238a631891594827f21340b5759e Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 27 Jan 2023 05:22:11 +0200
Subject: [PATCH] net/mlx5: fix error CQE dumping for vectorized Rx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 633684e0d0defdd7649132797cc14329f71f678c ]

There is a dump file with debug information created
for an error CQE to help with troubleshooting later.
It starts with the last CQE, which, presumably is the error CQE.
But this is only true for the scalar Rx burst routing since
we handle CQEs there one by one and detect the error immediately.
For vectorized Rx bursts, we may already move to another CQE
when we detect the error since we handle CQEs in batches there.
Go back to the error CQE in this case to dump proper CQE.

Fixes: 88c0733535 ("net/mlx5: extend Rx completion with error handling")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rx.c       | 16 +++++++++++-----
 drivers/net/mlx5/mlx5_rx.h       |  3 ++-
 drivers/net/mlx5/mlx5_rxtx_vec.c | 12 +++++++-----
 3 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 917c517b83..7612d15f01 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -425,12 +425,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
  * @param[in] vec
  *   1 when called from vectorized Rx burst, need to prepare mbufs for the RQ.
  *   0 when called from non-vectorized Rx burst.
+ * @param[in] err_n
+ *   Number of CQEs to check for an error.
  *
  * @return
  *   MLX5_RECOVERY_ERROR_RET in case of recovery error, otherwise the CQE status.
  */
 int
-mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
+mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 {
 	const uint16_t cqe_n = 1 << rxq->cqe_n;
 	const uint16_t cqe_mask = cqe_n - 1;
@@ -442,13 +444,18 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
 		volatile struct mlx5_cqe *cqe;
 		volatile struct mlx5_err_cqe *err_cqe;
 	} u = {
-		.cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_mask],
+		.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec) & cqe_mask],
 	};
 	struct mlx5_mp_arg_queue_state_modify sm;
-	int ret;
+	int ret, i;

 	switch (rxq->err_state) {
 	case MLX5_RXQ_ERR_STATE_NO_ERROR:
+		for (i = 0; i < (int)err_n; i++) {
+			u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask];
+			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR)
+				break;
+		}
 		rxq->err_state = MLX5_RXQ_ERR_STATE_NEED_RESET;
 		/* Fall-through */
 	case MLX5_RXQ_ERR_STATE_NEED_RESET:
@@ -507,7 +514,6 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec)
 					rxq->elts_ci : rxq->rq_ci;
 				uint32_t elt_idx;
 				struct rte_mbuf **elt;
-				int i;
 				unsigned int n = elts_n - (elts_ci -
 							  rxq->rq_pi);

@@ -628,7 +634,7 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			if (unlikely(ret != MLX5_CQE_STATUS_SW_OWN)) {
 				if (unlikely(ret == MLX5_CQE_STATUS_ERR ||
 					     rxq->err_state)) {
-					ret = mlx5_rx_err_handle(rxq, 0);
+					ret = mlx5_rx_err_handle(rxq, 0, 1);
 					if (ret == MLX5_CQE_STATUS_HW_OWN ||
 					    ret == MLX5_RECOVERY_ERROR_RET)
 						return MLX5_ERROR_CQE_RET;
diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
index e078aaf3dc..4ba53ebc48 100644
--- a/drivers/net/mlx5/mlx5_rx.h
+++ b/drivers/net/mlx5/mlx5_rx.h
@@ -286,7 +286,8 @@ int mlx5_hrxq_modify(struct rte_eth_dev *dev, uint32_t hxrq_idx,

 uint16_t mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n);
 void mlx5_rxq_initialize(struct mlx5_rxq_data *rxq);
-__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec);
+__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq,
+				      uint8_t vec, uint16_t err_n);
 void mlx5_mprq_buf_free(struct mlx5_mprq_buf *buf);
 uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts,
 			    uint16_t pkts_n);
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index 0e2eab068a..c6be2be763 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -74,7 +74,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 	rxq->stats.ipackets -= (pkts_n - n);
 	rxq->stats.ibytes -= err_bytes;
 #endif
-	mlx5_rx_err_handle(rxq, 1);
+	mlx5_rx_err_handle(rxq, 1, pkts_n);
 	return n;
 }

@@ -253,8 +253,6 @@ rxq_copy_mprq_mbuf_v(struct mlx5_rxq_data *rxq,
 	}
 	rxq->rq_pi += i;
 	rxq->cq_ci += i;
-	rte_io_wmb();
-	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	if (rq_ci != rxq->rq_ci) {
 		rxq->rq_ci = rq_ci;
 		rte_io_wmb();
@@ -361,8 +359,6 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 			rxq->decompressed -= n;
 		}
 	}
-	rte_io_wmb();
-	*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	*no_cq = !rcvd_pkt;
 	return rcvd_pkt;
 }
@@ -390,6 +386,7 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	bool no_cq = false;

 	do {
+		err = 0;
 		nb_rx = rxq_burst_v(rxq, pkts + tn, pkts_n - tn,
 				    &err, &no_cq);
 		if (unlikely(err | rxq->err_state))
@@ -397,6 +394,8 @@ mlx5_rx_burst_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		tn += nb_rx;
 		if (unlikely(no_cq))
 			break;
+		rte_io_wmb();
+		*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	} while (tn != pkts_n);
 	return tn;
 }
@@ -524,6 +523,7 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	bool no_cq = false;

 	do {
+		err = 0;
 		nb_rx = rxq_burst_mprq_v(rxq, pkts + tn, pkts_n - tn,
 					 &err, &no_cq);
 		if (unlikely(err | rxq->err_state))
@@ -531,6 +531,8 @@ mlx5_rx_burst_mprq_vec(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		tn += nb_rx;
 		if (unlikely(no_cq))
 			break;
+		rte_io_wmb();
+		*rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
 	} while (tn != pkts_n);
 	return tn;
 }
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:44.987426800 +0800
+++ 0128-net-mlx5-fix-error-CQE-dumping-for-vectorized-Rx.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From 633684e0d0defdd7649132797cc14329f71f678c Mon Sep 17 00:00:00 2001
+From 47f5a0e5f344238a631891594827f21340b5759e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 633684e0d0defdd7649132797cc14329f71f678c ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: ignore non-critical syndromes for Rx queue' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (125 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: fix error CQE dumping for vectorized Rx' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/mlx5: check compressed CQE opcode in vectorized Rx' " Xueming Li
                     ` (30 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 547b239a2189a839aac62d3bd1d64a471b7f7777 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 27 Jan 2023 05:22:43 +0200
Subject: [PATCH] net/mlx5: ignore non-critical syndromes for Rx queue
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit aa67ed3084588e6ca12e9709a6cab021f0ffeba7 ]

For non-fatal syndromes like LOCAL_LENGTH_ERR, the Rx queue reset
shouldn't be triggered. Rx queue could continue with the next packets
without any recovery. Only three syndromes warrant Rx queue reset:
LOCAL_QP_OP_ERR, LOCAL_PROT_ERR and WR_FLUSH_ERR.
Do not initiate a Rx queue reset in any other cases.
Skip all non-critical error CQEs and continue with packet processing.

Fixes: 88c0733535 ("net/mlx5: extend Rx completion with error handling")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rx.c       | 123 ++++++++++++++++++++++++-------
 drivers/net/mlx5/mlx5_rx.h       |   5 +-
 drivers/net/mlx5/mlx5_rxtx_vec.c |   3 +-
 3 files changed, 102 insertions(+), 29 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 7612d15f01..99a08ef5f1 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -39,7 +39,8 @@ rxq_cq_to_pkt_type(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,

 static __rte_always_inline int
 mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
-		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe);
+		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe,
+		 uint16_t *skip_cnt, bool mprq);

 static __rte_always_inline uint32_t
 rxq_cq_to_ol_flags(volatile struct mlx5_cqe *cqe);
@@ -408,10 +409,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
 	*rxq->rq_db = rte_cpu_to_be_32(rxq->rq_ci);
 }

+#define MLX5_ERROR_CQE_MASK 0x40000000
 /* Must be negative. */
-#define MLX5_ERROR_CQE_RET (-1)
+#define MLX5_REGULAR_ERROR_CQE_RET (-5)
+#define MLX5_CRITICAL_ERROR_CQE_RET (-4)
 /* Must not be negative. */
 #define MLX5_RECOVERY_ERROR_RET 0
+#define MLX5_RECOVERY_IGNORE_RET 1
+#define MLX5_RECOVERY_COMPLETED_RET 2

 /**
  * Handle a Rx error.
@@ -429,10 +434,14 @@ mlx5_rxq_initialize(struct mlx5_rxq_data *rxq)
  *   Number of CQEs to check for an error.
  *
  * @return
- *   MLX5_RECOVERY_ERROR_RET in case of recovery error, otherwise the CQE status.
+ *   MLX5_RECOVERY_ERROR_RET in case of recovery error,
+ *   MLX5_RECOVERY_IGNORE_RET in case of non-critical error syndrome,
+ *   MLX5_RECOVERY_COMPLETED_RET in case of recovery is completed,
+ *   otherwise the CQE status after ignored error syndrome or queue reset.
  */
 int
-mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
+mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
+		   uint16_t err_n, uint16_t *skip_cnt)
 {
 	const uint16_t cqe_n = 1 << rxq->cqe_n;
 	const uint16_t cqe_mask = cqe_n - 1;
@@ -447,14 +456,35 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 		.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec) & cqe_mask],
 	};
 	struct mlx5_mp_arg_queue_state_modify sm;
+	bool critical_syndrome = false;
 	int ret, i;

 	switch (rxq->err_state) {
+	case MLX5_RXQ_ERR_STATE_IGNORE:
+		ret = check_cqe(u.cqe, cqe_n, rxq->cq_ci - vec);
+		if (ret != MLX5_CQE_STATUS_ERR) {
+			rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+			return ret;
+		}
+		/* Fall-through */
 	case MLX5_RXQ_ERR_STATE_NO_ERROR:
 		for (i = 0; i < (int)err_n; i++) {
 			u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask];
-			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR)
+			if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR) {
+				if (u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
+				    u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
+				    u.err_cqe->syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR)
+					critical_syndrome = true;
 				break;
+			}
+		}
+		if (!critical_syndrome) {
+			if (rxq->err_state == MLX5_RXQ_ERR_STATE_NO_ERROR) {
+				*skip_cnt = 0;
+				if (i == err_n)
+					rxq->err_state = MLX5_RXQ_ERR_STATE_IGNORE;
+			}
+			return MLX5_RECOVERY_IGNORE_RET;
 		}
 		rxq->err_state = MLX5_RXQ_ERR_STATE_NEED_RESET;
 		/* Fall-through */
@@ -546,6 +576,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
 			}
 			mlx5_rxq_initialize(rxq);
 			rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+			return MLX5_RECOVERY_COMPLETED_RET;
 		}
 		return ret;
 	default:
@@ -565,19 +596,24 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec, uint16_t err_n)
  * @param[out] mcqe
  *   Store pointer to mini-CQE if compressed. Otherwise, the pointer is not
  *   written.
- *
+ * @param[out] skip_cnt
+ *   Number of packets skipped due to recoverable errors.
+ * @param mprq
+ *   Indication if it is called from MPRQ.
  * @return
- *   0 in case of empty CQE, MLX5_ERROR_CQE_RET in case of error CQE,
- *   otherwise the packet size in regular RxQ, and striding byte
- *   count format in mprq case.
+ *   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.
  */
 static inline int
 mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
-		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe)
+		 uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe,
+		 uint16_t *skip_cnt, bool mprq)
 {
 	struct rxq_zip *zip = &rxq->zip;
 	uint16_t cqe_n = cqe_cnt + 1;
-	int len;
+	int len = 0, ret = 0;
 	uint16_t idx, end;

 	do {
@@ -626,7 +662,6 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 		 * compressed.
 		 */
 		} else {
-			int ret;
 			int8_t op_own;
 			uint32_t cq_ci;

@@ -634,10 +669,12 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			if (unlikely(ret != MLX5_CQE_STATUS_SW_OWN)) {
 				if (unlikely(ret == MLX5_CQE_STATUS_ERR ||
 					     rxq->err_state)) {
-					ret = mlx5_rx_err_handle(rxq, 0, 1);
-					if (ret == MLX5_CQE_STATUS_HW_OWN ||
-					    ret == MLX5_RECOVERY_ERROR_RET)
-						return MLX5_ERROR_CQE_RET;
+					ret = mlx5_rx_err_handle(rxq, 0, 1, skip_cnt);
+					if (ret == MLX5_CQE_STATUS_HW_OWN)
+						return MLX5_ERROR_CQE_MASK;
+					if (ret == MLX5_RECOVERY_ERROR_RET ||
+						ret == MLX5_RECOVERY_COMPLETED_RET)
+						return MLX5_CRITICAL_ERROR_CQE_RET;
 				} else {
 					return 0;
 				}
@@ -690,8 +727,15 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
 			}
 		}
 		if (unlikely(rxq->err_state)) {
+			if (rxq->err_state == MLX5_RXQ_ERR_STATE_IGNORE &&
+			    ret == MLX5_CQE_STATUS_SW_OWN) {
+				rxq->err_state = MLX5_RXQ_ERR_STATE_NO_ERROR;
+				return len & MLX5_ERROR_CQE_MASK;
+			}
 			cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
 			++rxq->stats.idropped;
+			(*skip_cnt) += mprq ? (len & MLX5_MPRQ_STRIDE_NUM_MASK) >>
+				MLX5_MPRQ_STRIDE_NUM_SHIFT : 1;
 		} else {
 			return len;
 		}
@@ -843,6 +887,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	int len = 0; /* keep its value across iterations. */

 	while (pkts_n) {
+		uint16_t skip_cnt;
 		unsigned int idx = rq_ci & wqe_cnt;
 		volatile struct mlx5_wqe_data_seg *wqe =
 			&((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx];
@@ -881,11 +926,24 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		}
 		if (!pkt) {
 			cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
-			len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe);
-			if (len <= 0) {
-				rte_mbuf_raw_free(rep);
-				if (unlikely(len == MLX5_ERROR_CQE_RET))
+			len = mlx5_rx_poll_len(rxq, cqe, cqe_cnt, &mcqe, &skip_cnt, false);
+			if (unlikely(len & MLX5_ERROR_CQE_MASK)) {
+				if (len == MLX5_CRITICAL_ERROR_CQE_RET) {
+					rte_mbuf_raw_free(rep);
 					rq_ci = rxq->rq_ci << sges_n;
+					break;
+				}
+				rq_ci >>= sges_n;
+				rq_ci += skip_cnt;
+				rq_ci <<= sges_n;
+				idx = rq_ci & wqe_cnt;
+				wqe = &((volatile struct mlx5_wqe_data_seg *)rxq->wqes)[idx];
+				seg = (*rxq->elts)[idx];
+				cqe = &(*rxq->cqes)[rxq->cq_ci & cqe_cnt];
+				len = len & ~MLX5_ERROR_CQE_MASK;
+			}
+			if (len == 0) {
+				rte_mbuf_raw_free(rep);
 				break;
 			}
 			pkt = seg;
@@ -1095,6 +1153,7 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		uint16_t strd_cnt;
 		uint16_t strd_idx;
 		uint32_t byte_cnt;
+		uint16_t skip_cnt;
 		volatile struct mlx5_mini_cqe8 *mcqe = NULL;
 		enum mlx5_rqx_code rxq_code;

@@ -1107,14 +1166,26 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			buf = (*rxq->mprq_bufs)[rq_ci & wq_mask];
 		}
 		cqe = &(*rxq->cqes)[rxq->cq_ci & cq_mask];
-		ret = mlx5_rx_poll_len(rxq, cqe, cq_mask, &mcqe);
+		ret = mlx5_rx_poll_len(rxq, cqe, cq_mask, &mcqe, &skip_cnt, true);
+		if (unlikely(ret & MLX5_ERROR_CQE_MASK)) {
+			if (ret == MLX5_CRITICAL_ERROR_CQE_RET) {
+				rq_ci = rxq->rq_ci;
+				consumed_strd = rxq->consumed_strd;
+				break;
+			}
+			consumed_strd += skip_cnt;
+			while (consumed_strd >= strd_n) {
+				/* Replace WQE if the buffer is still in use. */
+				mprq_buf_replace(rxq, rq_ci & wq_mask);
+				/* Advance to the next WQE. */
+				consumed_strd -= strd_n;
+				++rq_ci;
+				buf = (*rxq->mprq_bufs)[rq_ci & wq_mask];
+			}
+			cqe = &(*rxq->cqes)[rxq->cq_ci & cq_mask];
+		}
 		if (ret == 0)
 			break;
-		if (unlikely(ret == MLX5_ERROR_CQE_RET)) {
-			rq_ci = rxq->rq_ci;
-			consumed_strd = rxq->consumed_strd;
-			break;
-		}
 		byte_cnt = ret;
 		len = (byte_cnt & MLX5_MPRQ_LEN_MASK) >> MLX5_MPRQ_LEN_SHIFT;
 		MLX5_ASSERT((int)len >= (rxq->crc_present << 2));
diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
index 4ba53ebc48..6b42e27c89 100644
--- a/drivers/net/mlx5/mlx5_rx.h
+++ b/drivers/net/mlx5/mlx5_rx.h
@@ -62,6 +62,7 @@ enum mlx5_rxq_err_state {
 	MLX5_RXQ_ERR_STATE_NO_ERROR = 0,
 	MLX5_RXQ_ERR_STATE_NEED_RESET,
 	MLX5_RXQ_ERR_STATE_NEED_READY,
+	MLX5_RXQ_ERR_STATE_IGNORE,
 };

 enum mlx5_rqx_code {
@@ -286,8 +287,8 @@ int mlx5_hrxq_modify(struct rte_eth_dev *dev, uint32_t hxrq_idx,

 uint16_t mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n);
 void mlx5_rxq_initialize(struct mlx5_rxq_data *rxq);
-__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq,
-				      uint8_t vec, uint16_t err_n);
+__rte_noinline int mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
+				      uint16_t err_n, uint16_t *skip_cnt);
 void mlx5_mprq_buf_free(struct mlx5_mprq_buf *buf);
 uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts,
 			    uint16_t pkts_n);
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index c6be2be763..667475a93e 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -51,6 +51,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 			 uint16_t pkts_n)
 {
 	uint16_t n = 0;
+	uint16_t skip_cnt;
 	unsigned int i;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 	uint32_t err_bytes = 0;
@@ -74,7 +75,7 @@ rxq_handle_pending_error(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
 	rxq->stats.ipackets -= (pkts_n - n);
 	rxq->stats.ibytes -= err_bytes;
 #endif
-	mlx5_rx_err_handle(rxq, 1, pkts_n);
+	mlx5_rx_err_handle(rxq, 1, pkts_n, &skip_cnt);
 	return n;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.017406100 +0800
+++ 0129-net-mlx5-ignore-non-critical-syndromes-for-Rx-queue.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From aa67ed3084588e6ca12e9709a6cab021f0ffeba7 Mon Sep 17 00:00:00 2001
+From 547b239a2189a839aac62d3bd1d64a471b7f7777 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit aa67ed3084588e6ca12e9709a6cab021f0ffeba7 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/mlx5: check compressed CQE opcode in vectorized Rx' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (126 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: ignore non-critical syndromes for Rx queue' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/iavf: fix outer UDP checksum offload' " Xueming Li
                     ` (29 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4c6cddb596d67ed9c39617a5f8f557bd69d38f96 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 27 Jan 2023 05:23:14 +0200
Subject: [PATCH] net/mlx5: check compressed CQE opcode in vectorized Rx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1f903ebe2c05366aed6a453b6e7636945fc87285 ]

The CQE opcode is never checked for a compressed CQE in
the vectorized Rx burst routines. It is assumed that
compressed CQEs are always valid and skipped error checking.

This is obviously not the case and error CQEs may be
compressed together as well. Need to check for the
MLX5_CQE_RESP_ERR opcode and mark all the packets as
bad ones in the compression session if it is there.

Note that this issue is not applicable to the scalar Rx burst.

Fixes: 6cb559d67b ("net/mlx5: add vectorized Rx/Tx burst for x86")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 16 +++++++++++++---
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h    | 10 +++++++---
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h     |  9 ++++++---
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
index 683a8f9a6c..204d17a8f2 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h
@@ -783,7 +783,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
-	unsigned int pos;
+	unsigned int pos, adj;
 	uint64_t n = 0;
 	uint64_t comp_idx = MLX5_VPMD_DESCS_PER_LOOP;
 	uint16_t nocmp_n = 0;
@@ -866,7 +866,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 		__vector unsigned char pkt_mb0, pkt_mb1, pkt_mb2, pkt_mb3;
 		__vector unsigned char op_own, op_own_tmp1, op_own_tmp2;
 		__vector unsigned char opcode, owner_mask, invalid_mask;
-		__vector unsigned char comp_mask;
+		__vector unsigned char comp_mask, mini_mask;
 		__vector unsigned char mask;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		const __vector unsigned char lower_half = {
@@ -1174,6 +1174,16 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			(__vector unsigned long)mask);

 		/* D.3 check error in opcode. */
+		adj = (comp_idx != MLX5_VPMD_DESCS_PER_LOOP && comp_idx == n);
+		mask = (__vector unsigned char)(__vector unsigned long){
+			(adj * sizeof(uint16_t) * 8), 0};
+		lshift = vec_splat((__vector unsigned long)mask, 0);
+		shmask = vec_cmpgt(shmax, lshift);
+		mini_mask = (__vector unsigned char)
+			vec_sl((__vector unsigned long)invalid_mask, lshift);
+		mini_mask = (__vector unsigned char)
+			vec_sel((__vector unsigned long)shmask,
+			(__vector unsigned long)mini_mask, shmask);
 		opcode = (__vector unsigned char)
 			vec_cmpeq((__vector unsigned int)resp_err_check,
 			(__vector unsigned int)opcode);
@@ -1182,7 +1192,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 			(__vector unsigned int)zero);
 		opcode = (__vector unsigned char)
 			vec_andc((__vector unsigned long)opcode,
-			(__vector unsigned long)invalid_mask);
+			(__vector unsigned long)mini_mask);

 		/* D.4 mark if any error is set */
 		*err |= ((__vector unsigned long)opcode)[0];
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
index f7bbde4e0e..41b9cf5444 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_neon.h
@@ -524,7 +524,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
-	unsigned int pos;
+	unsigned int pos, adj;
 	uint64_t n = 0;
 	uint64_t comp_idx = MLX5_VPMD_DESCS_PER_LOOP;
 	uint16_t nocmp_n = 0;
@@ -616,7 +616,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 	     pos += MLX5_VPMD_DESCS_PER_LOOP) {
 		uint16x4_t op_own;
 		uint16x4_t opcode, owner_mask, invalid_mask;
-		uint16x4_t comp_mask;
+		uint16x4_t comp_mask, mini_mask;
 		uint16x4_t mask;
 		uint16x4_t byte_cnt;
 		uint32x4_t ptype_info, flow_tag;
@@ -780,8 +780,12 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 				   -1UL >> (n * sizeof(uint16_t) * 8) : 0);
 		invalid_mask = vorr_u16(invalid_mask, mask);
 		/* D.3 check error in opcode. */
+		adj = (comp_idx != MLX5_VPMD_DESCS_PER_LOOP && comp_idx == n);
+		mask = vcreate_u16(adj ?
+			   -1UL >> ((n + 1) * sizeof(uint16_t) * 8) : -1UL);
+		mini_mask = vand_u16(invalid_mask, mask);
 		opcode = vceq_u16(resp_err_check, opcode);
-		opcode = vbic_u16(opcode, invalid_mask);
+		opcode = vbic_u16(opcode, mini_mask);
 		/* D.4 mark if any error is set */
 		*err |= vget_lane_u64(vreinterpret_u64_u16(opcode), 0);
 		/* C.4 fill in mbuf - rearm_data and packet_type. */
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
index 185d2695db..ab69af0c55 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
+++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.h
@@ -523,7 +523,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 {
 	const uint16_t q_n = 1 << rxq->cqe_n;
 	const uint16_t q_mask = q_n - 1;
-	unsigned int pos;
+	unsigned int pos, adj;
 	uint64_t n = 0;
 	uint64_t comp_idx = MLX5_VPMD_DESCS_PER_LOOP;
 	uint16_t nocmp_n = 0;
@@ -591,7 +591,7 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 		__m128i pkt_mb0, pkt_mb1, pkt_mb2, pkt_mb3;
 		__m128i op_own, op_own_tmp1, op_own_tmp2;
 		__m128i opcode, owner_mask, invalid_mask;
-		__m128i comp_mask;
+		__m128i comp_mask, mini_mask;
 		__m128i mask;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		__m128i byte_cnt;
@@ -729,9 +729,12 @@ rxq_cq_process_v(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cq,
 		mask = _mm_sll_epi64(ones, mask);
 		invalid_mask = _mm_or_si128(invalid_mask, mask);
 		/* D.3 check error in opcode. */
+		adj = (comp_idx != MLX5_VPMD_DESCS_PER_LOOP && comp_idx == n);
+		mask = _mm_set_epi64x(0, adj * sizeof(uint16_t) * 8);
+		mini_mask = _mm_sll_epi64(invalid_mask, mask);
 		opcode = _mm_cmpeq_epi32(resp_err_check, opcode);
 		opcode = _mm_packs_epi32(opcode, zero);
-		opcode = _mm_andnot_si128(invalid_mask, opcode);
+		opcode = _mm_andnot_si128(mini_mask, opcode);
 		/* D.4 mark if any error is set */
 		*err |= _mm_cvtsi128_si64(opcode);
 		/* D.5 fill in mbuf - rearm_data and packet_type. */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.045696900 +0800
+++ 0130-net-mlx5-check-compressed-CQE-opcode-in-vectorized-R.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From 1f903ebe2c05366aed6a453b6e7636945fc87285 Mon Sep 17 00:00:00 2001
+From 4c6cddb596d67ed9c39617a5f8f557bd69d38f96 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1f903ebe2c05366aed6a453b6e7636945fc87285 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/iavf: fix outer UDP checksum offload' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (127 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/mlx5: check compressed CQE opcode in vectorized Rx' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/i40e: reduce interrupt interval in multi-driver mode' " Xueming Li
                     ` (28 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Zhichao Zeng; +Cc: Ke Xu, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6e50af124fb99278fe3cea4ff7d87bebca856704 Mon Sep 17 00:00:00 2001
From: Zhichao Zeng <zhichaox.zeng@intel.com>
Date: Tue, 13 Dec 2022 09:45:11 +0800
Subject: [PATCH] net/iavf: fix outer UDP checksum offload
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit feb4f66b5a8c8fc32a7e721368728dd53f541e3b ]

Currently, when dealing with UDP tunnel pkts checksum offloading,
the outer-udp checksum will be offloaded by default. So the
'csum set outer-udp hw/sw' command does not work.

This patch fixes judgment of the EIPT flag and enables the
'csum set outer-udp hw/sw' command by adding judgment for the
outer-udp checksum offload flag.

Fixes: 0c550022fb82 ("net/iavf: fix Tx descriptors for IPsec")

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Tested-by: Ke Xu <ke1.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index cf87a6beda..8d49967538 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2453,8 +2453,11 @@ iavf_fill_ctx_desc_tunnelling_field(volatile uint64_t *qw0,
 		 * Calculate the tunneling UDP checksum.
 		 * Shall be set only if L4TUNT = 01b and EIPT is not zero
 		 */
-		if (!(eip_typ & IAVF_TX_CTX_EXT_IP_NONE) &&
-		    (eip_typ & IAVF_TXD_CTX_UDP_TUNNELING))
+		if ((eip_typ & (IAVF_TX_CTX_EXT_IP_IPV6 |
+					IAVF_TX_CTX_EXT_IP_IPV4 |
+					IAVF_TX_CTX_EXT_IP_IPV4_NO_CSUM)) &&
+				(eip_typ & IAVF_TXD_CTX_UDP_TUNNELING) &&
+				(m->ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM))
 			eip_typ |= IAVF_TXD_CTX_QW0_L4T_CS_MASK;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.074284200 +0800
+++ 0131-net-iavf-fix-outer-UDP-checksum-offload.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From feb4f66b5a8c8fc32a7e721368728dd53f541e3b Mon Sep 17 00:00:00 2001
+From 6e50af124fb99278fe3cea4ff7d87bebca856704 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit feb4f66b5a8c8fc32a7e721368728dd53f541e3b ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/i40e: reduce interrupt interval in multi-driver mode' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (128 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/iavf: fix outer UDP checksum offload' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/idpf: fix mbuf leak in split Tx' " Xueming Li
                     ` (27 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Qiming Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 489ddd71b3ef50674334fabd96ce9a8175befdc2 Mon Sep 17 00:00:00 2001
From: Qiming Yang <qiming.yang@intel.com>
Date: Fri, 16 Dec 2022 03:11:40 +0000
Subject: [PATCH] net/i40e: reduce interrupt interval in multi-driver mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d730fd0a9fa98e2600cea53208f60d4d0f2cc301 ]

This patch change the interrupt interval from 8160us to 32us
to improve the performance of multi-driver mode.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index fe943a45ff..7c4cc44a27 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1497,7 +1497,7 @@ i40e_calc_itr_interval(bool is_pf, bool is_multi_drv)
 	uint16_t interval = 0;

 	if (is_multi_drv) {
-		interval = I40E_QUEUE_ITR_INTERVAL_MAX;
+		interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
 	} else {
 		if (is_pf)
 			interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.103572100 +0800
+++ 0132-net-i40e-reduce-interrupt-interval-in-multi-driver-m.patch	2023-02-27 14:08:40.909237000 +0800
@@ -1 +1 @@
-From d730fd0a9fa98e2600cea53208f60d4d0f2cc301 Mon Sep 17 00:00:00 2001
+From 489ddd71b3ef50674334fabd96ce9a8175befdc2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d730fd0a9fa98e2600cea53208f60d4d0f2cc301 ]
@@ -8,2 +10,0 @@
-
-Cc: stable@dpdk.org

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

* patch 'net/idpf: fix mbuf leak in split Tx' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (129 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/i40e: reduce interrupt interval in multi-driver mode' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/idpf: fix driver infos' " Xueming Li
                     ` (26 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: Beilei Xing, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 96ccb4c28795fde0b0d1d4db727bb04df9e09acd Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Fri, 6 Jan 2023 09:04:59 +0000
Subject: [PATCH] net/idpf: fix mbuf leak in split Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9e199987a3143a7d705f2c06213e0cf4b9380653 ]

When context descriptor is used during sending packets, mbuf
is not freed correctly, it will cause mempool be exhausted.
This patch refines the free function.

Fixes: 770f4dfe0f79 ("net/idpf: support basic Tx data path")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/idpf/idpf_rxtx.c | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index b4a396c3f5..5aef8ba2b6 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -1508,6 +1508,7 @@ idpf_split_tx_free(struct idpf_tx_queue *cq)
 	struct idpf_tx_entry *txe;
 	struct idpf_tx_queue *txq;
 	uint16_t gen, qid, q_head;
+	uint16_t nb_desc_clean;
 	uint8_t ctype;

 	txd = &compl_ring[next];
@@ -1525,20 +1526,24 @@ idpf_split_tx_free(struct idpf_tx_queue *cq)

 	switch (ctype) {
 	case IDPF_TXD_COMPLT_RE:
-		if (q_head == 0)
-			txq->last_desc_cleaned = txq->nb_tx_desc - 1;
-		else
-			txq->last_desc_cleaned = q_head - 1;
-		if (unlikely((txq->last_desc_cleaned % 32) == 0)) {
+		/* clean to q_head which indicates be fetched txq desc id + 1.
+		 * TODO: need to refine and remove the if condition.
+		 */
+		if (unlikely(q_head % 32)) {
 			PMD_DRV_LOG(ERR, "unexpected desc (head = %u) completion.",
 						q_head);
 			return;
 		}
-
+		if (txq->last_desc_cleaned > q_head)
+			nb_desc_clean = (txq->nb_tx_desc - txq->last_desc_cleaned) +
+				q_head;
+		else
+			nb_desc_clean = q_head - txq->last_desc_cleaned;
+		txq->nb_free += nb_desc_clean;
+		txq->last_desc_cleaned = q_head;
 		break;
 	case IDPF_TXD_COMPLT_RS:
-		txq->nb_free++;
-		txq->nb_used--;
+		/* q_head indicates sw_id when ctype is 2 */
 		txe = &txq->sw_ring[q_head];
 		if (txe->mbuf != NULL) {
 			rte_pktmbuf_free_seg(txe->mbuf);
@@ -1693,12 +1698,16 @@ idpf_splitq_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		/* fill the last descriptor with End of Packet (EOP) bit */
 		txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_EOP;

-		if (unlikely((tx_id % 32) == 0))
-			txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_RE;
 		if (ol_flags & IDPF_TX_CKSUM_OFFLOAD_MASK)
 			txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_CS_EN;
 		txq->nb_free = (uint16_t)(txq->nb_free - nb_used);
 		txq->nb_used = (uint16_t)(txq->nb_used + nb_used);
+
+		if (txq->nb_used >= 32) {
+			txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_RE;
+			/* Update txq RE bit counters */
+			txq->nb_used = 0;
+		}
 	}

 	/* update the tail pointer if any packets were processed */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.132215400 +0800
+++ 0133-net-idpf-fix-mbuf-leak-in-split-Tx.patch	2023-02-27 14:08:40.919237000 +0800
@@ -1 +1 @@
-From 9e199987a3143a7d705f2c06213e0cf4b9380653 Mon Sep 17 00:00:00 2001
+From 96ccb4c28795fde0b0d1d4db727bb04df9e09acd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9e199987a3143a7d705f2c06213e0cf4b9380653 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/idpf: fix driver infos' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (130 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/idpf: fix mbuf leak in split Tx' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/ixgbe: fix firmware version consistency' " Xueming Li
                     ` (25 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jingjing Wu; +Cc: Beilei Xing, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bfa995565226744098206f0c7f3dfc987db9e540 Mon Sep 17 00:00:00 2001
From: Jingjing Wu <jingjing.wu@intel.com>
Date: Fri, 6 Jan 2023 09:05:00 +0000
Subject: [PATCH] net/idpf: fix driver infos
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5b377bf64df62f70122f23e80236c09e7426467f ]

This patch fixes idpf driver init symbols.

Fixes: 549343c25db8 ("net/idpf: support device initialization")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 8b347631ce..67d2d49490 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1313,7 +1313,11 @@ static struct rte_pci_driver rte_idpf_pmd = {
  */
 RTE_PMD_REGISTER_PCI(net_idpf, rte_idpf_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_idpf, pci_id_idpf_map);
-RTE_PMD_REGISTER_KMOD_DEP(net_ice, "* igb_uio | uio_pci_generic | vfio-pci");
+RTE_PMD_REGISTER_KMOD_DEP(net_idpf, "* igb_uio | vfio-pci");
+RTE_PMD_REGISTER_PARAM_STRING(net_idpf,
+			      IDPF_TX_SINGLE_Q "=<0|1> "
+			      IDPF_RX_SINGLE_Q "=<0|1> "
+			      IDPF_VPORT "=[vport_set0,[vport_set1],...]");

 RTE_LOG_REGISTER_SUFFIX(idpf_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(idpf_logtype_driver, driver, NOTICE);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.160062100 +0800
+++ 0134-net-idpf-fix-driver-infos.patch	2023-02-27 14:08:40.919237000 +0800
@@ -1 +1 @@
-From 5b377bf64df62f70122f23e80236c09e7426467f Mon Sep 17 00:00:00 2001
+From bfa995565226744098206f0c7f3dfc987db9e540 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5b377bf64df62f70122f23e80236c09e7426467f ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index f7b3f8f515..89af27ca34 100644
+index 8b347631ce..67d2d49490 100644
@@ -22 +24 @@
-@@ -1251,7 +1251,11 @@ static struct rte_pci_driver rte_idpf_pmd = {
+@@ -1313,7 +1313,11 @@ static struct rte_pci_driver rte_idpf_pmd = {

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

* patch 'net/ixgbe: fix firmware version consistency' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (131 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/idpf: fix driver infos' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/iavf: add lock for VF commands' " Xueming Li
                     ` (24 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Shiyang He; +Cc: Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dbe54bfd9b93675ae887b0081bca4ac4d51e1917 Mon Sep 17 00:00:00 2001
From: Shiyang He <shiyangx.he@intel.com>
Date: Mon, 9 Jan 2023 06:53:09 +0000
Subject: [PATCH] net/ixgbe: fix firmware version consistency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b5c4535d5d9a6cf363f548503c2c755be0ab656b ]

This patch follows the code of ixgbe kernel driver so that it keeps the
firmware version obtained by dpdk-ethtool consistent with that obtained
by linux-ethtool.

Fixes: 8b0b56574269 ("net/ixgbe: add firmware version get")

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 .mailmap                         |  1 +
 drivers/net/ixgbe/ixgbe_ethdev.c | 31 ++++++++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/.mailmap b/.mailmap
index 736f62c206..eb5bd55eb1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1212,6 +1212,7 @@ Shiqi Liu <835703180@qq.com>
 Shiri Kuzin <shirik@nvidia.com> <shirik@mellanox.com>
 Shivanshu Shukla <shivanshu.shukla@intel.com>
 Shiweixian <shiweixian@huawei.com>
+Shiyang He <shiyangx.he@intel.com>
 Shlomi Gridish <sgridish@marvell.com>
 Shougang Wang <shougangx.wang@intel.com>
 Shraddha Joshi <jshraddha@vmware.com>
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ae9f65b334..65655b9212 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3852,23 +3852,32 @@ static int
 ixgbe_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	u16 eeprom_verh, eeprom_verl;
-	u32 etrack_id;
+	struct ixgbe_nvm_version nvm_ver;
 	int ret;

-	ixgbe_read_eeprom(hw, 0x2e, &eeprom_verh);
-	ixgbe_read_eeprom(hw, 0x2d, &eeprom_verl);
+	ixgbe_get_oem_prod_version(hw, &nvm_ver);
+	if (nvm_ver.oem_valid) {
+		snprintf(fw_version, fw_size, "%x.%x.%x",
+			 nvm_ver.oem_major, nvm_ver.oem_minor,
+			 nvm_ver.oem_release);
+		return 0;
+	}
+
+	ixgbe_get_etk_id(hw, &nvm_ver);
+	ixgbe_get_orom_version(hw, &nvm_ver);

-	etrack_id = (eeprom_verh << 16) | eeprom_verl;
-	ret = snprintf(fw_version, fw_size, "0x%08x", etrack_id);
+	if (nvm_ver.or_valid) {
+		snprintf(fw_version, fw_size, "0x%08x, %d.%d.%d",
+			 nvm_ver.etk_id, nvm_ver.or_major,
+			 nvm_ver.or_build, nvm_ver.or_patch);
+		return 0;
+	}
+
+	ret = snprintf(fw_version, fw_size, "0x%08x", nvm_ver.etk_id);
 	if (ret < 0)
 		return -EINVAL;

-	ret += 1; /* add the size of '\0' */
-	if (fw_size < (size_t)ret)
-		return ret;
-	else
-		return 0;
+	return (fw_size < (size_t)ret++) ? ret : 0;
 }

 static int
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.190105500 +0800
+++ 0135-net-ixgbe-fix-firmware-version-consistency.patch	2023-02-27 14:08:40.919237000 +0800
@@ -1 +1 @@
-From b5c4535d5d9a6cf363f548503c2c755be0ab656b Mon Sep 17 00:00:00 2001
+From dbe54bfd9b93675ae887b0081bca4ac4d51e1917 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b5c4535d5d9a6cf363f548503c2c755be0ab656b ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index b797fec215..cb9bd28bd3 100644
+index 736f62c206..eb5bd55eb1 100644
@@ -27 +29 @@
-@@ -1217,6 +1217,7 @@ Shiqi Liu <835703180@qq.com>
+@@ -1212,6 +1212,7 @@ Shiqi Liu <835703180@qq.com>
@@ -36 +38 @@
-index 3f8da11bd1..88118bc305 100644
+index ae9f65b334..65655b9212 100644
@@ -39 +41 @@
-@@ -3853,23 +3853,32 @@ static int
+@@ -3852,23 +3852,32 @@ static int

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

* patch 'net/iavf: add lock for VF commands' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (132 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/ixgbe: fix firmware version consistency' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/i40e: fix validation of flow transfer attribute' " Xueming Li
                     ` (23 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Mike Pattrick; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5aacd2a62c110e4ec9820edb2fc9bc24e3e6e81d Mon Sep 17 00:00:00 2001
From: Mike Pattrick <mkp@redhat.com>
Date: Wed, 28 Dec 2022 18:00:25 -0500
Subject: [PATCH] net/iavf: add lock for VF commands
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ]

iavf admin queue commands aren't thread-safe. Bugs surrounding this
issue can manifest in a variety of ways but frequently pend_cmd is
over written. Simultaneously executing commands can result in a
misconfigured device or DPDK sleeping in a thread for 2 second.

Despite this limitation, vf commands may be executed from both
iavf_dev_alarm_handler() in a control thread and the applications main
thread. This is trivial to simulate in the testpmd application by
creating a bond of vf's in active backup mode, and then turning the
bond off and then on again repeatedly.

Previously [1] was proposed as a potential solution, but this commit did
not resolve all potential issues concerning the admin queue and has been
reverted from the stable branch. I propose adding locks until a more
complete solution is available.

[1] commit cb5c1b91f76f ("net/iavf: add thread for event callbacks")

Fixes: 48de41ca11f0 ("net/avf: enable link status update")
Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message")

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf.h       |   1 +
 drivers/net/iavf/iavf_vchnl.c | 106 ++++++++++++++++++++--------------
 2 files changed, 63 insertions(+), 44 deletions(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index 1edebab8dc..aa18650ffa 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -262,6 +262,7 @@ struct iavf_info {
 	struct iavf_qv_map *qv_map; /* queue vector mapping */
 	struct iavf_flow_list flow_list;
 	rte_spinlock_t flow_ops_lock;
+	rte_spinlock_t aq_lock;
 	struct iavf_parser_list rss_parser_list;
 	struct iavf_parser_list dist_parser_list;
 	struct iavf_parser_list ipsec_crypto_parser_list;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index f92daf97f2..9adaadb173 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -397,6 +397,20 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args,
 	return err;
 }

+static int
+iavf_execute_vf_cmd_safe(struct iavf_adapter *adapter,
+	struct iavf_cmd_info *args, int async)
+{
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);
+	int ret;
+
+	rte_spinlock_lock(&vf->aq_lock);
+	ret = iavf_execute_vf_cmd(adapter, args, async);
+	rte_spinlock_unlock(&vf->aq_lock);
+
+	return ret;
+}
+
 static void
 iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 			uint16_t msglen)
@@ -554,7 +568,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter)
 	args.in_args_size = 0;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " OP_ENABLE_VLAN_STRIPPING");
@@ -575,7 +589,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter)
 	args.in_args_size = 0;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " OP_DISABLE_VLAN_STRIPPING");
@@ -604,7 +618,7 @@ iavf_check_api_version(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_INIT_LOG(ERR, "Fail to execute command of OP_VERSION");
 		return err;
@@ -665,7 +679,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)
 	args.in_args = (uint8_t *)&caps;
 	args.in_args_size = sizeof(caps);

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);

 	if (err) {
 		PMD_DRV_LOG(ERR,
@@ -710,7 +724,7 @@ iavf_get_supported_rxdid(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_GET_SUPPORTED_RXDIDS");
@@ -754,7 +768,7 @@ iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable)
 	args.in_args_size = sizeof(vlan_strip);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    enable ? "VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2" :
@@ -794,7 +808,7 @@ iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable)
 	args.in_args_size = sizeof(vlan_insert);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    enable ? "VIRTCHNL_OP_ENABLE_VLAN_INSERTION_V2" :
@@ -837,7 +851,7 @@ iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
 	args.in_args_size = sizeof(vlan_filter);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    add ? "OP_ADD_VLAN_V2" :  "OP_DEL_VLAN_V2");
@@ -858,7 +872,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	ret = iavf_execute_vf_cmd(adapter, &args, 0);
+	ret = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (ret) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS");
@@ -889,7 +903,7 @@ iavf_enable_queues(struct iavf_adapter *adapter)
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_ENABLE_QUEUES");
@@ -917,7 +931,7 @@ iavf_disable_queues(struct iavf_adapter *adapter)
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_DISABLE_QUEUES");
@@ -953,7 +967,7 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,
 	args.in_args_size = sizeof(queue_select);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of %s",
 			    on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES");
@@ -995,7 +1009,7 @@ iavf_enable_queues_lv(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_ENABLE_QUEUES_V2");
@@ -1039,7 +1053,7 @@ iavf_disable_queues_lv(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_DISABLE_QUEUES_V2");
@@ -1085,7 +1099,7 @@ iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of %s",
 			    on ? "OP_ENABLE_QUEUES_V2" : "OP_DISABLE_QUEUES_V2");
@@ -1117,7 +1131,7 @@ iavf_configure_rss_lut(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_CONFIG_RSS_LUT");
@@ -1149,7 +1163,7 @@ iavf_configure_rss_key(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_CONFIG_RSS_KEY");
@@ -1247,7 +1261,7 @@ iavf_configure_queues(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " VIRTCHNL_OP_CONFIG_VSI_QUEUES");
@@ -1288,7 +1302,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command OP_CONFIG_IRQ_MAP");

@@ -1329,7 +1343,7 @@ iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num,
 	args.in_args_size = len;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command OP_MAP_QUEUE_VECTOR");

@@ -1389,7 +1403,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
 		args.in_args_size = len;
 		args.out_buffer = vf->aq_resp;
 		args.out_size = IAVF_AQ_BUF_SZ;
-		err = iavf_execute_vf_cmd(adapter, &args, 0);
+		err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 		if (err)
 			PMD_DRV_LOG(ERR, "fail to execute command %s",
 				    add ? "OP_ADD_ETHER_ADDRESS" :
@@ -1419,7 +1433,7 @@ iavf_query_stats(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_GET_STATS");
 		*pstats = NULL;
@@ -1457,7 +1471,7 @@ iavf_config_promisc(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);

 	if (err) {
 		PMD_DRV_LOG(ERR,
@@ -1500,7 +1514,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
 	args.in_args_size = sizeof(cmd_buffer);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    add ? "OP_ADD_ETH_ADDR" :  "OP_DEL_ETH_ADDR");
@@ -1527,7 +1541,7 @@ iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add)
 	args.in_args_size = sizeof(cmd_buffer);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 			    add ? "OP_ADD_VLAN" :  "OP_DEL_VLAN");
@@ -1554,7 +1568,7 @@ iavf_fdir_add(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_FDIR_FILTER");
 		return err;
@@ -1614,7 +1628,7 @@ iavf_fdir_del(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command OP_DEL_FDIR_FILTER");
 		return err;
@@ -1661,7 +1675,7 @@ iavf_fdir_check(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to check flow director rule");
 		return err;
@@ -1704,7 +1718,7 @@ iavf_flow_sub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to execute command of "
 				 "OP_FLOW_SUBSCRIBE");
@@ -1755,7 +1769,7 @@ iavf_flow_unsub(struct iavf_adapter *adapter, struct iavf_fsub_conf *filter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to execute command of "
 				 "OP_FLOW_UNSUBSCRIBE");
@@ -1798,7 +1812,7 @@ iavf_flow_sub_check(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to check flow subscription rule");
 		return err;
@@ -1838,7 +1852,7 @@ iavf_add_del_rss_cfg(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of %s",
@@ -1861,7 +1875,7 @@ iavf_get_hena_caps(struct iavf_adapter *adapter, uint64_t *caps)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_GET_RSS_HENA_CAPS");
@@ -1887,7 +1901,7 @@ iavf_set_hena(struct iavf_adapter *adapter, uint64_t hena)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_SET_RSS_HENA");
@@ -1908,7 +1922,7 @@ iavf_get_qos_cap(struct iavf_adapter *adapter)
 	args.in_args_size = 0;
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);

 	if (err) {
 		PMD_DRV_LOG(ERR,
@@ -1941,7 +1955,7 @@ int iavf_set_q_tc_map(struct rte_eth_dev *dev,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " VIRTCHNL_OP_CONFIG_TC_MAP");
@@ -1964,7 +1978,7 @@ int iavf_set_q_bw(struct rte_eth_dev *dev,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err)
 		PMD_DRV_LOG(ERR, "Failed to execute command of"
 			    " VIRTCHNL_OP_CONFIG_QUEUE_BW");
@@ -2009,7 +2023,7 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
 		i * sizeof(struct virtchnl_ether_addr);
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);

 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
@@ -2053,13 +2067,17 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num)
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
 		/* disable interrupt to avoid the admin queue message to be read
 		 * before iavf_read_msg_from_pf.
+		 *
+		 * don't disable interrupt handler until ready to execute vf cmd.
 		 */
+		rte_spinlock_lock(&vf->aq_lock);
 		rte_intr_disable(pci_dev->intr_handle);
 		err = iavf_execute_vf_cmd(adapter, &args, 0);
 		rte_intr_enable(pci_dev->intr_handle);
+		rte_spinlock_unlock(&vf->aq_lock);
 	} else {
 		rte_eal_alarm_cancel(iavf_dev_alarm_handler, dev);
-		err = iavf_execute_vf_cmd(adapter, &args, 0);
+		err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 		rte_eal_alarm_set(IAVF_ALARM_INTERVAL,
 				  iavf_dev_alarm_handler, dev);
 	}
@@ -2098,7 +2116,7 @@ iavf_get_max_rss_queue_region(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to execute command of VIRTCHNL_OP_GET_MAX_RSS_QREGION");
 		return err;
@@ -2129,7 +2147,7 @@ iavf_ipsec_crypto_request(struct iavf_adapter *adapter,
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 1);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 1);
 	if (err) {
 		PMD_DRV_LOG(ERR, "fail to execute command %s",
 				"OP_INLINE_IPSEC_CRYPTO");
@@ -2163,7 +2181,7 @@ iavf_set_vf_quanta_size(struct iavf_adapter *adapter, u16 start_queue_id, u16 nu
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to execute command VIRTCHNL_OP_CONFIG_QUANTA");
 		return err;
@@ -2189,7 +2207,7 @@ iavf_get_ptp_cap(struct iavf_adapter *adapter)
 	args.out_buffer = vf->aq_resp;
 	args.out_size = IAVF_AQ_BUF_SZ;

-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of OP_1588_PTP_GET_CAPS");
@@ -2217,7 +2235,7 @@ iavf_get_phc_time(struct iavf_rx_queue *rxq)
 	args.out_size = IAVF_AQ_BUF_SZ;

 	rte_spinlock_lock(&vf->phc_time_aq_lock);
-	err = iavf_execute_vf_cmd(adapter, &args, 0);
+	err = iavf_execute_vf_cmd_safe(adapter, &args, 0);
 	if (err) {
 		PMD_DRV_LOG(ERR,
 			    "Failed to execute command of VIRTCHNL_OP_1588_PTP_GET_TIME");
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.227471100 +0800
+++ 0136-net-iavf-add-lock-for-VF-commands.patch	2023-02-27 14:08:40.919237000 +0800
@@ -1 +1 @@
-From 91bf37d250aacfc9512a33ce9ec6d4783766804e Mon Sep 17 00:00:00 2001
+From 5aacd2a62c110e4ec9820edb2fc9bc24e3e6e81d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 91bf37d250aacfc9512a33ce9ec6d4783766804e ]
@@ -26 +28,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/i40e: fix validation of flow transfer attribute' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (133 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/iavf: add lock for VF commands' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/ice: " Xueming Li
                     ` (22 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Steve Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 199591d8d1605679fde91ffa052d9d63792f49c1 Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang@intel.com>
Date: Mon, 26 Dec 2022 00:37:14 +0000
Subject: [PATCH] net/i40e: fix validation of flow transfer attribute
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a ]

i40e doesn't support transfer attribute of flow rule,
ignore it when validating rule attributes.

Fixes: 86eb05d6350b ("net/i40e: add flow validate function")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 65a826d51c..67df77890a 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1236,6 +1236,14 @@ i40e_flow_parse_attr(const struct rte_flow_attr *attr,
 		return -rte_errno;
 	}

+	/* Not supported */
+	if (attr->transfer) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+				   attr, "Not support transfer.");
+		return -rte_errno;
+	}
+
 	/* Not supported */
 	if (attr->priority) {
 		rte_flow_error_set(error, EINVAL,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.256643500 +0800
+++ 0137-net-i40e-fix-validation-of-flow-transfer-attribute.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a Mon Sep 17 00:00:00 2001
+From 199591d8d1605679fde91ffa052d9d63792f49c1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 74d20de6101f60d3d2b345abcd4ab5bfd2b6076a ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 3c550733f2..877e49151e 100644
+index 65a826d51c..67df77890a 100644

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

* patch 'net/ice: fix validation of flow transfer attribute' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (134 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/i40e: fix validation of flow transfer attribute' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/iavf: protect insertion in flow list' " Xueming Li
                     ` (21 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Steve Yang; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e13bcf76455789f6a776f2bf1cda35b4fe51765a Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang@intel.com>
Date: Mon, 26 Dec 2022 00:37:15 +0000
Subject: [PATCH] net/ice: fix validation of flow transfer attribute
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a6153cf2c3b98bfd4035dc3ad304b5d75a56940b ]

ice doesn't support transfer attribute of flow rule,
ignore it when validating rule attributes.

Fixes: d76116a4678f ("net/ice: add generic flow API")

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index d496c28dec..86a32f8cb1 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -2030,6 +2030,14 @@ ice_flow_valid_attr(struct ice_adapter *ad,
 		return -rte_errno;
 	}

+	/* Not supported */
+	if (attr->transfer) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
+				   attr, "Not support transfer.");
+		return -rte_errno;
+	}
+
 	/* Check pipeline mode support to set classification stage */
 	if (ad->devargs.pipe_mode_support) {
 		if (attr->priority == 0)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.285624700 +0800
+++ 0138-net-ice-fix-validation-of-flow-transfer-attribute.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From a6153cf2c3b98bfd4035dc3ad304b5d75a56940b Mon Sep 17 00:00:00 2001
+From e13bcf76455789f6a776f2bf1cda35b4fe51765a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a6153cf2c3b98bfd4035dc3ad304b5d75a56940b ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/iavf: protect insertion in flow list' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (135 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/ice: " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/iavf: fix building data desc' " Xueming Li
                     ` (20 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: David Marchand; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 644d38523a3014e944ff90327fd41347b3ae5a0c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 5 Jan 2023 14:57:43 +0100
Subject: [PATCH] net/iavf: protect insertion in flow list
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d79c3b264e31465695bc4c6279381522060a22f6 ]

Add missing lock acquire.

Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_generic_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index f33c764764..6f6e95fc45 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -2278,11 +2278,12 @@ iavf_flow_create(struct rte_eth_dev *dev,
 	}

 	flow->engine = engine;
+	rte_spinlock_lock(&vf->flow_ops_lock);
 	TAILQ_INSERT_TAIL(&vf->flow_list, flow, node);
+	rte_spinlock_unlock(&vf->flow_ops_lock);
 	PMD_DRV_LOG(INFO, "Succeeded to create (%d) flow", engine->type);

 free_flow:
-	rte_spinlock_unlock(&vf->flow_ops_lock);
 	return flow;
 }

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.313320200 +0800
+++ 0139-net-iavf-protect-insertion-in-flow-list.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From d79c3b264e31465695bc4c6279381522060a22f6 Mon Sep 17 00:00:00 2001
+From 644d38523a3014e944ff90327fd41347b3ae5a0c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d79c3b264e31465695bc4c6279381522060a22f6 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/iavf: fix building data desc' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (136 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/iavf: protect insertion in flow list' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/ixgbe: enable IPv6 mask in flow rules' " Xueming Li
                     ` (19 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Zhichao Zeng; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 79781cd64628e19f61c9d25d9809f7e94dfb74b6 Mon Sep 17 00:00:00 2001
From: Zhichao Zeng <zhichaox.zeng@intel.com>
Date: Thu, 12 Jan 2023 17:31:51 +0800
Subject: [PATCH] net/iavf: fix building data desc
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d082b37d081e6de467700128f217e14b5e852bf6 ]

Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable
L4 checksum offload when TSO/UFO is enabled to prevent the MDD.

Fixes: 1e728b01120c ("net/iavf: rework Tx path")

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 8d49967538..3d9224b38d 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2619,10 +2619,21 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1,
 		offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
 	}

-	if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
-		command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+	if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
+		if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG)
+			command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+		else
+			command |= IAVF_TX_DESC_CMD_L4T_EOFT_UDP;
 		offset |= (m->l4_len >> 2) <<
 			      IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
+
+		*qw1 = rte_cpu_to_le_64((((uint64_t)command <<
+			IAVF_TXD_DATA_QW1_CMD_SHIFT) & IAVF_TXD_DATA_QW1_CMD_MASK) |
+			(((uint64_t)offset << IAVF_TXD_DATA_QW1_OFFSET_SHIFT) &
+			IAVF_TXD_DATA_QW1_OFFSET_MASK) |
+			((uint64_t)l2tag1 << IAVF_TXD_DATA_QW1_L2TAG1_SHIFT));
+
+		return;
 	}

 	/* Enable L4 checksum offloads */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.339447500 +0800
+++ 0140-net-iavf-fix-building-data-desc.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From d082b37d081e6de467700128f217e14b5e852bf6 Mon Sep 17 00:00:00 2001
+From 79781cd64628e19f61c9d25d9809f7e94dfb74b6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d082b37d081e6de467700128f217e14b5e852bf6 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ixgbe: enable IPv6 mask in flow rules' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (137 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/iavf: fix building data desc' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/iavf: fix VLAN offload with AVX2' " Xueming Li
                     ` (18 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Yuan Peng, Qiming Yang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3c047b3d86831405cfaf21f5b7581ce728147df4 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Sat, 28 Jan 2023 15:15:19 +0800
Subject: [PATCH] net/ixgbe: enable IPv6 mask in flow rules
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cba954b7bedaa7d0baea1ddc39fd0199015f583c ]

Add IPv6 addr mask and L4 mask support for rte_flow APIs.

IPv6 flow rules do not take effect in ixgbe when set
IPv6 addr mask and L4 mask to default value as 0xFF.

Set IPv6 addr mask and L4 mask as 0 to enable fields
can fix this issue.

Fixes: 11777435c727 ("net/ixgbe: parse flow director filter")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ixgbe/ixgbe_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 110ff34fcc..d2ba87df27 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1645,6 +1645,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	memset(&rule->mask, 0xFF, sizeof(struct ixgbe_hw_fdir_mask));
 	rule->mask.vlan_tci_mask = 0;
 	rule->mask.flex_bytes_mask = 0;
+	rule->mask.dst_port_mask = 0;
+	rule->mask.src_port_mask = 0;
+	rule->mask.src_ipv6_mask = 0;
+	rule->mask.dst_ipv6_mask = 0;

 	/**
 	 * The first not void item should be
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.367883600 +0800
+++ 0141-net-ixgbe-enable-IPv6-mask-in-flow-rules.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From cba954b7bedaa7d0baea1ddc39fd0199015f583c Mon Sep 17 00:00:00 2001
+From 3c047b3d86831405cfaf21f5b7581ce728147df4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cba954b7bedaa7d0baea1ddc39fd0199015f583c ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index fe710b7900..79c84044af 100644
+index 110ff34fcc..d2ba87df27 100644

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

* patch 'net/iavf: fix VLAN offload with AVX2' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (138 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/ixgbe: enable IPv6 mask in flow rules' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'app/compress-perf: fix some typos' " Xueming Li
                     ` (17 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: Maxime Coquelin, Wenzhuo Lu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From c0280459158695a9d64bd6a43fc27c3eb7b8bff8 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Thu, 8 Dec 2022 13:19:16 +0100
Subject: [PATCH] net/iavf: fix VLAN offload with AVX2
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit eb24917428a1db11d6736e8c076077a47b991f01 ]

It has been observed that mbufs of some received VLAN packets had the
VLAN tag correctly set in vlan_tci, but ol_flags were missing the
VLAN-indicating flags.

_mm256_shuffle_epi8 operates as two independent 128-bit operations,
not as a single 256-bit operation. To have the RTE_MBUF_F_RX_VLAN* flags
reflected in the resulting vlan_flags for all 8 rx descriptors, the
input l2tag2_flags_shuf must contain the required pattern in both
128-bit halves.

Fixes: 3a1aca384d3a ("net/iavf: fix VLAN tag extraction handling")

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 .mailmap                              | 1 +
 drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index eb5bd55eb1..c5ee0741b7 100644
--- a/.mailmap
+++ b/.mailmap
@@ -888,6 +888,7 @@ Michal Litwicki <michalx.litwicki@intel.com>
 Michal Mazurek <maz@semihalf.com>
 Michal Michalik <michal.michalik@intel.com>
 Michał Mirosław <michal.miroslaw@atendesoftware.pl> <mirq-linux@rere.qmqm.pl>
+Michal Schmidt <mschmidt@redhat.com>
 Michal Swiatkowski <michal.swiatkowski@intel.com>
 Michal Wilczynski <michal.wilczynski@intel.com>
 Michel Machado <michel@digirati.com.br>
diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx2.c b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
index 862f6eb0c0..b4ebac9d34 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_avx2.c
+++ b/drivers/net/iavf/iavf_rxtx_vec_avx2.c
@@ -1074,7 +1074,10 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq,
 					_mm256_set_epi8(0, 0, 0, 0,
 							0, 0, 0, 0,
 							0, 0, 0, 0,
-							0, 0, 0, 0,
+							0, 0,
+							RTE_MBUF_F_RX_VLAN |
+							RTE_MBUF_F_RX_VLAN_STRIPPED,
+							0,
 							/* end up 128-bits */
 							0, 0, 0, 0,
 							0, 0, 0, 0,
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.394777600 +0800
+++ 0142-net-iavf-fix-VLAN-offload-with-AVX2.patch	2023-02-27 14:08:40.929237000 +0800
@@ -1 +1 @@
-From eb24917428a1db11d6736e8c076077a47b991f01 Mon Sep 17 00:00:00 2001
+From c0280459158695a9d64bd6a43fc27c3eb7b8bff8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit eb24917428a1db11d6736e8c076077a47b991f01 ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index 2cb7f5accb..e111e05bc2 100644
+index eb5bd55eb1..c5ee0741b7 100644
@@ -31 +33 @@
-@@ -894,6 +894,7 @@ Michal Litwicki <michalx.litwicki@intel.com>
+@@ -888,6 +888,7 @@ Michal Litwicki <michalx.litwicki@intel.com>

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

* patch 'app/compress-perf: fix some typos' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (139 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/iavf: fix VLAN offload with AVX2' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'app/compress-perf: fix testing single operation' " Xueming Li
                     ` (16 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Michael Baum; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 17f428169341e03012445d3cebe45ecea32159b8 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 14 Feb 2023 19:40:27 +0200
Subject: [PATCH] app/compress-perf: fix some typos
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1643fc9b077ebb55b13a2c4469b75c251499acdc ]

Fix some typos in comments and prints in this app.

Fixes: e0b6287c035d ("app/compress-perf: add parser")
Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")
Fixes: 971d89f5116b ("app/compress-perf: prevent output buffer overflow")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-compress-perf/comp_perf_options_parse.c   | 4 ++--
 app/test-compress-perf/comp_perf_test_cyclecount.c | 2 +-
 app/test-compress-perf/comp_perf_test_verify.c     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index 019eddb7bd..9b9d4e6554 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -491,7 +491,7 @@ parse_huffman_enc(struct comp_test_data *test_data, const char *arg)
 	int id = get_str_key_id_mapping(huffman_namemap,
 			RTE_DIM(huffman_namemap), arg);
 	if (id < 0) {
-		RTE_LOG(ERR, USER1, "Invalid Huffmane encoding specified\n");
+		RTE_LOG(ERR, USER1, "Invalid Huffman encoding specified\n");
 		return -1;
 	}

@@ -507,7 +507,7 @@ parse_level(struct comp_test_data *test_data, const char *arg)

 	/*
 	 * Try parsing the argument as a range, if it fails,
-	 * arse it as a list
+	 * parse it as a list
 	 */
 	if (parse_range(arg, &test_data->level_lst.min,
 			&test_data->level_lst.max,
diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index 7473cb6277..ce457fefbb 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -563,7 +563,7 @@ cperf_cyclecount_test_runner(void *test_ctx)
 		"    [D-e] - decompression enqueue\n"
 		"    [D-d] - decompression dequeue\n"
 		"  - Cycles section: number of cycles per 'op' for the following operations:\n"
-		"    setup/op - memory allocation, op configuration and memory dealocation\n"
+		"    setup/op - memory allocation, op configuration and memory deallocation\n"
 		"    [C-e] - compression enqueue\n"
 		"    [C-d] - compression dequeue\n"
 		"    [D-e] - decompression enqueue\n"
diff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c
index 8964442891..6b61a9194f 100644
--- a/app/test-compress-perf/comp_perf_test_verify.c
+++ b/app/test-compress-perf/comp_perf_test_verify.c
@@ -226,7 +226,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				  op->status ==
 				  RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
 					RTE_LOG(ERR, USER1,
-"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+"Out of space error occurred due to incompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
 					res = -1;
 					goto end;
 				} else if (op->status !=
@@ -311,7 +311,7 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				  op->status ==
 				  RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
 					RTE_LOG(ERR, USER1,
-"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+"Out of space error occurred due to incompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
 					res = -1;
 					goto end;
 				} else if (op->status !=
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.435874700 +0800
+++ 0143-app-compress-perf-fix-some-typos.patch	2023-02-27 14:08:40.939237000 +0800
@@ -1 +1 @@
-From 1643fc9b077ebb55b13a2c4469b75c251499acdc Mon Sep 17 00:00:00 2001
+From 17f428169341e03012445d3cebe45ecea32159b8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1643fc9b077ebb55b13a2c4469b75c251499acdc ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/compress-perf: fix testing single operation' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (140 preceding siblings ...)
  2023-02-27  7:00   ` patch 'app/compress-perf: fix some typos' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'common/cnxk: fix channel mask for SDP interfaces' " Xueming Li
                     ` (15 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ad62d3f41062dd1cd4354c75ad89fae6fc289b12 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 14 Feb 2023 19:40:28 +0200
Subject: [PATCH] app/compress-perf: fix testing single operation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c ]

Part of the application options is to test only compress and only
decompress but actually the application ignores this user option and
tries to test always both compress and decompress.

Allow testing only compress and only decompress.

Fixes: e0b6287c035d ("app/compress-perf: add parser")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-compress-perf/comp_perf_options.h    |   6 +-
 .../comp_perf_options_parse.c                 |   4 +-
 .../comp_perf_test_common.c                   | 126 +++++++++++++-----
 .../comp_perf_test_cyclecount.c               |  69 ++++++----
 .../comp_perf_test_throughput.c               |  64 +++++----
 .../comp_perf_test_verify.c                   |  60 ++++++---
 app/test-compress-perf/main.c                 |   8 ++
 7 files changed, 223 insertions(+), 114 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h
index 57dd146330..d00b299247 100644
--- a/app/test-compress-perf/comp_perf_options.h
+++ b/app/test-compress-perf/comp_perf_options.h
@@ -32,9 +32,9 @@ enum cperf_test_type {
 };

 enum comp_operation {
-	COMPRESS_ONLY,
-	DECOMPRESS_ONLY,
-	COMPRESS_DECOMPRESS
+	COMPRESS = (1 << 0),
+	DECOMPRESS = (1 << 1),
+	COMPRESS_DECOMPRESS = (COMPRESS | DECOMPRESS),
 };

 struct range_list {
diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index 9b9d4e6554..303e714cda 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -446,11 +446,11 @@ parse_op_type(struct comp_test_data *test_data, const char *arg)
 	struct name_id_map optype_namemap[] = {
 		{
 			"comp",
-			COMPRESS_ONLY
+			COMPRESS
 		},
 		{
 			"decomp",
-			DECOMPRESS_ONLY
+			DECOMPRESS
 		},
 		{
 			"comp_and_decomp",
diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index b402a0d839..cd60958944 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -227,23 +227,43 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 {
 	uint16_t comp_mbuf_size;
 	uint16_t decomp_mbuf_size;
+	size_t comp_data_size;
+	size_t decomp_data_size;
+	size_t output_data_sz;

 	test_data->out_seg_sz = find_buf_size(test_data->seg_sz);

-	/* Number of segments for input and output
-	 * (compression and decompression)
-	 */
-	test_data->total_segs = DIV_CEIL(test_data->input_data_sz,
-			test_data->seg_sz);
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Number of segments for input and output
+		 * (compression and decompression)
+		 */
+		test_data->total_segs = DIV_CEIL(test_data->input_data_sz,
+						 test_data->seg_sz);
+	} else {
+		/*
+		 * When application does decompression only, input data is
+		 * compressed and smaller than the output. The expected size of
+		 * uncompressed data given by the user in segment size argument.
+		 */
+		test_data->total_segs = test_data->max_sgl_segs;
+	}
+
+	output_data_sz = (size_t) test_data->out_seg_sz * test_data->total_segs;
+	output_data_sz =
+		RTE_MAX(output_data_sz, (size_t) MIN_COMPRESSED_BUF_SIZE);

 	if (test_data->use_external_mbufs != 0) {
 		if (comp_perf_allocate_external_mbufs(test_data, mem) < 0)
 			return -1;
 		comp_mbuf_size = 0;
 		decomp_mbuf_size = 0;
-	} else {
+	} else if (test_data->test_op & COMPRESS) {
 		comp_mbuf_size = test_data->out_seg_sz + RTE_PKTMBUF_HEADROOM;
 		decomp_mbuf_size = test_data->seg_sz + RTE_PKTMBUF_HEADROOM;
+	} else {
+		comp_mbuf_size = test_data->seg_sz + RTE_PKTMBUF_HEADROOM;
+		decomp_mbuf_size = test_data->out_seg_sz + RTE_PKTMBUF_HEADROOM;
 	}

 	char pool_name[32] = "";
@@ -287,26 +307,28 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 		return -1;
 	}

-	/*
-	 * Compressed data might be a bit larger than input data,
-	 * if data cannot be compressed
-	 */
-	mem->compressed_data = rte_zmalloc_socket(NULL,
-				RTE_MAX(
-				    (size_t) test_data->out_seg_sz *
-							  test_data->total_segs,
-				    (size_t) MIN_COMPRESSED_BUF_SIZE),
-				0,
-				rte_socket_id());
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Compressed data might be a bit larger than input data,
+		 * if data cannot be compressed
+		 */
+		comp_data_size = output_data_sz;
+		decomp_data_size = test_data->input_data_sz;
+	} else {
+		comp_data_size = test_data->input_data_sz;
+		decomp_data_size = output_data_sz;
+	}
+
+	mem->compressed_data = rte_zmalloc_socket(NULL, comp_data_size, 0,
+						  rte_socket_id());
 	if (mem->compressed_data == NULL) {
 		RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
 				"file could not be allocated\n");
 		return -1;
 	}

-	mem->decompressed_data = rte_zmalloc_socket(NULL,
-				test_data->input_data_sz, 0,
-				rte_socket_id());
+	mem->decompressed_data = rte_zmalloc_socket(NULL, decomp_data_size, 0,
+						    rte_socket_id());
 	if (mem->decompressed_data == NULL) {
 		RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
 				"file could not be allocated\n");
@@ -351,6 +373,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 	uint16_t segs_per_mbuf = 0;
 	uint32_t cmz = 0;
 	uint32_t dmz = 0;
+	bool decompress_only = !!(test_data->test_op == DECOMPRESS);

 	for (i = 0; i < mem->total_bufs; i++) {
 		/* Allocate data in input mbuf and copy data from input file */
@@ -361,8 +384,6 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			return -1;
 		}

-		data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
-
 		if (test_data->use_external_mbufs != 0) {
 			rte_pktmbuf_attach_extbuf(mem->decomp_bufs[i],
 					mem->decomp_memzones[dmz]->addr,
@@ -372,16 +393,23 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			dmz++;
 		}

+		if (!decompress_only)
+			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+		else
+			data_sz = test_data->out_seg_sz;
+
 		data_addr = (uint8_t *) rte_pktmbuf_append(
 					mem->decomp_bufs[i], data_sz);
 		if (data_addr == NULL) {
 			RTE_LOG(ERR, USER1, "Could not append data\n");
 			return -1;
 		}
-		rte_memcpy(data_addr, input_data_ptr, data_sz);

-		input_data_ptr += data_sz;
-		remaining_data -= data_sz;
+		if (!decompress_only) {
+			rte_memcpy(data_addr, input_data_ptr, data_sz);
+			input_data_ptr += data_sz;
+			remaining_data -= data_sz;
+		}

 		/* Already one segment in the mbuf */
 		segs_per_mbuf = 1;
@@ -398,8 +426,6 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				return -1;
 			}

-			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
-
 			if (test_data->use_external_mbufs != 0) {
 				rte_pktmbuf_attach_extbuf(
 					next_seg,
@@ -410,6 +436,12 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				dmz++;
 			}

+			if (!decompress_only)
+				data_sz = RTE_MIN(remaining_data,
+						  test_data->seg_sz);
+			else
+				data_sz = test_data->out_seg_sz;
+
 			data_addr = (uint8_t *)rte_pktmbuf_append(next_seg,
 				data_sz);

@@ -418,9 +450,11 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				return -1;
 			}

-			rte_memcpy(data_addr, input_data_ptr, data_sz);
-			input_data_ptr += data_sz;
-			remaining_data -= data_sz;
+			if (!decompress_only) {
+				rte_memcpy(data_addr, input_data_ptr, data_sz);
+				input_data_ptr += data_sz;
+				remaining_data -= data_sz;
+			}

 			if (rte_pktmbuf_chain(mem->decomp_bufs[i],
 					next_seg) < 0) {
@@ -447,16 +481,26 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			cmz++;
 		}

-		data_addr = (uint8_t *) rte_pktmbuf_append(
-					mem->comp_bufs[i],
-					test_data->out_seg_sz);
+		if (decompress_only)
+			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+		else
+			data_sz = test_data->out_seg_sz;
+
+		data_addr = (uint8_t *) rte_pktmbuf_append(mem->comp_bufs[i],
+							   data_sz);
 		if (data_addr == NULL) {
 			RTE_LOG(ERR, USER1, "Could not append data\n");
 			return -1;
 		}

+		if (decompress_only) {
+			rte_memcpy(data_addr, input_data_ptr, data_sz);
+			input_data_ptr += data_sz;
+			remaining_data -= data_sz;
+		}
+
 		/* Chain mbufs if needed for output mbufs */
-		for (j = 1; j < segs_per_mbuf; j++) {
+		for (j = 1; j < segs_per_mbuf && remaining_data > 0; j++) {
 			struct rte_mbuf *next_seg =
 				rte_pktmbuf_alloc(mem->comp_buf_pool);

@@ -476,13 +520,25 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 				cmz++;
 			}

+			if (decompress_only)
+				data_sz = RTE_MIN(remaining_data,
+						  test_data->seg_sz);
+			else
+				data_sz = test_data->out_seg_sz;
+
 			data_addr = (uint8_t *)rte_pktmbuf_append(next_seg,
-				test_data->out_seg_sz);
+								  data_sz);
 			if (data_addr == NULL) {
 				RTE_LOG(ERR, USER1, "Could not append data\n");
 				return -1;
 			}

+			if (decompress_only) {
+				rte_memcpy(data_addr, input_data_ptr, data_sz);
+				input_data_ptr += data_sz;
+				remaining_data -= data_sz;
+			}
+
 			if (rte_pktmbuf_chain(mem->comp_bufs[i],
 					next_seg) < 0) {
 				RTE_LOG(ERR, USER1, "Could not chain mbufs\n");
diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index ce457fefbb..ce6c4d7605 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -514,38 +514,55 @@ cperf_cyclecount_test_runner(void *test_ctx)
 	if (cperf_verify_test_runner(&ctx->ver))
 		return EXIT_FAILURE;

-	/*
-	 * Run the tests twice, discarding the first performance
-	 * results, before the cache is warmed up
-	 */
-
-	/* C O M P R E S S */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0)
-			return EXIT_FAILURE;
-	}
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_COMPRESS) < 0)
+				return EXIT_FAILURE;
+		}

-	ops_enq_retries_comp = ctx->ops_enq_retries;
-	ops_deq_retries_comp = ctx->ops_deq_retries;
+		ops_enq_retries_comp = ctx->ops_enq_retries;
+		ops_deq_retries_comp = ctx->ops_deq_retries;

-	duration_enq_per_op_comp = ctx->duration_enq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
-	duration_deq_per_op_comp = ctx->duration_deq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_enq_per_op_comp = ctx->duration_enq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_deq_per_op_comp = ctx->duration_deq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+	} else {
+		ops_enq_retries_comp = 0;
+		ops_deq_retries_comp = 0;

-	/* D E C O M P R E S S */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0)
-			return EXIT_FAILURE;
+		duration_enq_per_op_comp = 0;
+		duration_deq_per_op_comp = 0;
 	}

-	ops_enq_retries_decomp = ctx->ops_enq_retries;
-	ops_deq_retries_decomp = ctx->ops_deq_retries;
+	if (test_data->test_op & DECOMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0)
+				return EXIT_FAILURE;
+		}

-	duration_enq_per_op_decomp = ctx->duration_enq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
-	duration_deq_per_op_decomp = ctx->duration_deq /
-			(ctx->ver.mem.total_bufs * test_data->num_iter);
+		ops_enq_retries_decomp = ctx->ops_enq_retries;
+		ops_deq_retries_decomp = ctx->ops_deq_retries;
+
+		duration_enq_per_op_decomp = ctx->duration_enq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+		duration_deq_per_op_decomp = ctx->duration_deq /
+				(ctx->ver.mem.total_bufs * test_data->num_iter);
+	} else {
+		ops_enq_retries_decomp = 0;
+		ops_deq_retries_decomp = 0;
+
+		duration_enq_per_op_decomp = 0;
+		duration_deq_per_op_decomp = 0;
+	}

 	duration_setup_per_op = ctx->duration_op /
 			(ctx->ver.mem.total_bufs * test_data->num_iter);
diff --git a/app/test-compress-perf/comp_perf_test_throughput.c b/app/test-compress-perf/comp_perf_test_throughput.c
index 79cd2b2bf2..c9f8237626 100644
--- a/app/test-compress-perf/comp_perf_test_throughput.c
+++ b/app/test-compress-perf/comp_perf_test_throughput.c
@@ -359,41 +359,53 @@ cperf_throughput_test_runner(void *test_ctx)
 	 * First the verification part is needed
 	 */
 	if (cperf_verify_test_runner(&ctx->ver)) {
-		ret =  EXIT_FAILURE;
+		ret = EXIT_FAILURE;
 		goto end;
 	}

-	/*
-	 * Run the tests twice, discarding the first performance
-	 * results, before the cache is warmed up
-	 */
-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
-			ret = EXIT_FAILURE;
-			goto end;
+	if (test_data->test_op & COMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
+				ret = EXIT_FAILURE;
+				goto end;
+			}
 		}
-	}

-	for (i = 0; i < 2; i++) {
-		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
-			ret = EXIT_FAILURE;
-			goto end;
-		}
+		ctx->comp_tsc_byte =
+			(double)(ctx->comp_tsc_duration[test_data->level]) /
+						       test_data->input_data_sz;
+		ctx->comp_gbps = rte_get_tsc_hz() / ctx->comp_tsc_byte * 8 /
+								     1000000000;
+	} else {
+		ctx->comp_tsc_byte = 0;
+		ctx->comp_gbps = 0;
 	}

-	ctx->comp_tsc_byte =
-			(double)(ctx->comp_tsc_duration[test_data->level]) /
-					test_data->input_data_sz;
+	if (test_data->test_op & DECOMPRESS) {
+		/*
+		 * Run the test twice, discarding the first performance
+		 * results, before the cache is warmed up
+		 */
+		for (i = 0; i < 2; i++) {
+			if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
+				ret = EXIT_FAILURE;
+				goto end;
+			}
+		}

-	ctx->decomp_tsc_byte =
+		ctx->decomp_tsc_byte =
 			(double)(ctx->decomp_tsc_duration[test_data->level]) /
-					test_data->input_data_sz;
-
-	ctx->comp_gbps = rte_get_tsc_hz() / ctx->comp_tsc_byte * 8 /
-			1000000000;
-
-	ctx->decomp_gbps = rte_get_tsc_hz() / ctx->decomp_tsc_byte * 8 /
-			1000000000;
+						       test_data->input_data_sz;
+		ctx->decomp_gbps = rte_get_tsc_hz() / ctx->decomp_tsc_byte * 8 /
+								     1000000000;
+	} else {
+		ctx->decomp_tsc_byte = 0;
+		ctx->decomp_gbps = 0;
+	}

 	exp = 0;
 	if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,
diff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c
index 6b61a9194f..7d6b6abecd 100644
--- a/app/test-compress-perf/comp_perf_test_verify.c
+++ b/app/test-compress-perf/comp_perf_test_verify.c
@@ -114,7 +114,8 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 		output_data_sz = &ctx->decomp_data_sz;
 		input_bufs = mem->comp_bufs;
 		output_bufs = mem->decomp_bufs;
-		out_seg_sz = test_data->seg_sz;
+		out_seg_sz = (test_data->test_op & COMPRESS) ?
+			     test_data->seg_sz : test_data->out_seg_sz;
 	}

 	/* Create private xform */
@@ -392,44 +393,59 @@ cperf_verify_test_runner(void *test_ctx)
 	int ret = EXIT_SUCCESS;
 	static uint16_t display_once;
 	uint32_t lcore = rte_lcore_id();
+	uint16_t exp = 0;

 	ctx->mem.lcore_id = lcore;

 	test_data->ratio = 0;

-	if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
-		ret = EXIT_FAILURE;
-		goto end;
+	if (test_data->test_op & COMPRESS) {
+		if (main_loop(ctx, RTE_COMP_COMPRESS) < 0) {
+			ret = EXIT_FAILURE;
+			goto end;
+		}
 	}

-	if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
-		ret = EXIT_FAILURE;
-		goto end;
-	}
+	if (test_data->test_op & DECOMPRESS) {
+		if (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0) {
+			ret = EXIT_FAILURE;
+			goto end;
+		}

-	if (ctx->decomp_data_sz != test_data->input_data_sz) {
-		RTE_LOG(ERR, USER1,
-	   "Decompressed data length not equal to input data length\n");
-		RTE_LOG(ERR, USER1,
-			"Decompressed size = %zu, expected = %zu\n",
-			ctx->decomp_data_sz, test_data->input_data_sz);
-		ret = EXIT_FAILURE;
-		goto end;
-	} else {
-		if (memcmp(ctx->mem.decompressed_data,
-				test_data->input_data,
-				test_data->input_data_sz) != 0) {
+		if (!(test_data->test_op & COMPRESS)) {
+			/*
+			 * For DECOMPRESS_ONLY mode there is no more
+			 * verifications, reset the 'ratio' and 'comp_data_sz'
+			 * fields for other tests report.
+			 */
+			ctx->comp_data_sz = 0;
+			ctx->ratio = 0;
+			goto end;
+		}
+
+		if (ctx->decomp_data_sz != test_data->input_data_sz) {
+			RTE_LOG(ERR, USER1,
+				"Decompressed data length not equal to input data length\n");
 			RTE_LOG(ERR, USER1,
-		    "Decompressed data is not the same as file data\n");
+				"Decompressed size = %zu, expected = %zu\n",
+				ctx->decomp_data_sz, test_data->input_data_sz);
 			ret = EXIT_FAILURE;
 			goto end;
+		} else {
+			if (memcmp(ctx->mem.decompressed_data,
+					test_data->input_data,
+					test_data->input_data_sz) != 0) {
+				RTE_LOG(ERR, USER1,
+					"Decompressed data is not the same as file data\n");
+				ret = EXIT_FAILURE;
+				goto end;
+			}
 		}
 	}

 	ctx->ratio = (double) ctx->comp_data_sz /
 			test_data->input_data_sz * 100;

-	uint16_t exp = 0;
 	if (!ctx->silent) {
 		if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,
 				__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {
diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index 41b8edc2bd..bbb4c7917b 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -254,6 +254,14 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 		goto end;
 	}

+	if (!(test_data->test_op & COMPRESS) &&
+	    test_data->input_data_sz >
+	    (size_t) test_data->seg_sz * (size_t) test_data->max_sgl_segs) {
+		RTE_LOG(ERR, USER1,
+			"Size of input must be less than total segments\n");
+		goto end;
+	}
+
 	test_data->input_data = rte_zmalloc_socket(NULL,
 				test_data->input_data_sz, 0, rte_socket_id());

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.467026900 +0800
+++ 0144-app-compress-perf-fix-testing-single-operation.patch	2023-02-27 14:08:40.939237000 +0800
@@ -1 +1 @@
-From 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c Mon Sep 17 00:00:00 2001
+From ad62d3f41062dd1cd4354c75ad89fae6fc289b12 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 83cc3b90ad7a63868a43a67d6aa13b55068fbe0c ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'common/cnxk: fix channel mask for SDP interfaces' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (141 preceding siblings ...)
  2023-02-27  7:00   ` patch 'app/compress-perf: fix testing single operation' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/bnxt: fix link state change interrupt config' " Xueming Li
                     ` (14 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: Kiran Kumar K, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fd1ff4fecb285b989c85ee1f578b3bbc5439a2a2 Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Fri, 10 Feb 2023 13:56:14 +0530
Subject: [PATCH] common/cnxk: fix channel mask for SDP interfaces
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b182b227e70b9065bafc6a9baad5e101fd866fcb ]

Fix channel mask of SDP interfaces on CN10K.

Fixes: f13756633330 ("common/cnxk: support setting channel mask for SDP interfaces")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc.c      | 9 +++++++--
 drivers/common/cnxk/roc_npc_priv.h | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index b38389b18a..bf7fb90f17 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -1263,8 +1263,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
 			/* By default set the channel and mask to cover
 			 * the whole SDP channel range.
 			 */
-			npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
-			npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			if (roc_model_is_cn10k()) {
+				npc->sdp_channel = (uint16_t)CN10K_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)CN10K_SDP_CH_MASK;
+			} else {
+				npc->sdp_channel = (uint16_t)NIX_CHAN_SDP_CH_START;
+				npc->sdp_channel_mask = (uint16_t)NIX_CHAN_SDP_CH_START;
+			}
 		}
 	}

diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index 23acb7b01d..f034f72a04 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -77,6 +77,9 @@
 #define NPC_LFLAG_LC_OFFSET (NPC_LTYPE_OFFSET_START + 6)
 #define NPC_LTYPE_LC_OFFSET (NPC_LTYPE_OFFSET_START + 8)

+#define CN10K_SDP_CH_START 0x80
+#define CN10K_SDP_CH_MASK  0xF80
+
 struct npc_action_vtag_info {
 	uint16_t vlan_id;
 	uint16_t vlan_ethtype;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.497224100 +0800
+++ 0145-common-cnxk-fix-channel-mask-for-SDP-interfaces.patch	2023-02-27 14:08:40.939237000 +0800
@@ -1 +1 @@
-From b182b227e70b9065bafc6a9baad5e101fd866fcb Mon Sep 17 00:00:00 2001
+From fd1ff4fecb285b989c85ee1f578b3bbc5439a2a2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b182b227e70b9065bafc6a9baad5e101fd866fcb ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index c872548230..9edccb5258 100644
+index b38389b18a..bf7fb90f17 100644
@@ -22 +24 @@
-@@ -1380,8 +1380,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
+@@ -1263,8 +1263,13 @@ roc_npc_flow_create(struct roc_npc *roc_npc, const struct roc_npc_attr *attr,
@@ -39 +41 @@
-index 2a7d3137fb..aa27228354 100644
+index 23acb7b01d..f034f72a04 100644

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

* patch 'net/bnxt: fix link state change interrupt config' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (142 preceding siblings ...)
  2023-02-27  7:00   ` patch 'common/cnxk: fix channel mask for SDP interfaces' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/nfp: fix VNI of VXLAN encap action' " Xueming Li
                     ` (13 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Edwin Brossette; +Cc: Somnath Kotur, Ajit Khaparde, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8cdbec0d75920660a7d528b3e4e48d792cfa8104 Mon Sep 17 00:00:00 2001
From: Edwin Brossette <edwin.brossette@6wind.com>
Date: Mon, 6 Feb 2023 18:11:13 +0100
Subject: [PATCH] net/bnxt: fix link state change interrupt config
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 60653f4a25bd87a32bc148461f32566af997da8b ]

When getting the device's info via bnxt_dev_info_get_op(), the device
enables interrupts on link state changes because of the following line:

  eth_dev->data->dev_conf.intr_conf.lsc = 1;

Enabling this mode might not be wanted by the user.

The flag RTE_ETH_DEV_INTR_LSC can be used to inform the above
application that LSC interrupts are supported. Thus, checking this flag,
the user can decide whether or not to enable these interrupts.

Since there is no reason for a function meant to display config to
actually modify it, remove this line. In addition, raise the dev_flag
associated with this state on the device's initialization to show the
device supports link state change interrupts.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 .mailmap                       | 1 +
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index c5ee0741b7..42a169ca18 100644
--- a/.mailmap
+++ b/.mailmap
@@ -339,6 +339,7 @@ Dzmitry Sautsa <dzmitryx.sautsa@intel.com>
 Ed Czeck <ed.czeck@atomicrules.com>
 Eduard Serra <eserra@vmware.com>
 Edward Makarov <makarov@kraftway.ru>
+Edwin Brossette <edwin.brossette@6wind.com>
 Eelco Chaudron <echaudro@redhat.com>
 Elad Nachman <eladv6@gmail.com>
 Elad Persiko <eladpe@mellanox.com>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b3de490d36..753e86b4b2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1017,7 +1017,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 		.tx_free_thresh = 32,
 		.tx_rs_thresh = 32,
 	};
-	eth_dev->data->dev_conf.intr_conf.lsc = 1;

 	dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
 	dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
@@ -5859,6 +5858,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)

 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
+	eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;

 	bp = eth_dev->data->dev_private;

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.524195900 +0800
+++ 0146-net-bnxt-fix-link-state-change-interrupt-config.patch	2023-02-27 14:08:40.949237000 +0800
@@ -1 +1 @@
-From 60653f4a25bd87a32bc148461f32566af997da8b Mon Sep 17 00:00:00 2001
+From 8cdbec0d75920660a7d528b3e4e48d792cfa8104 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 60653f4a25bd87a32bc148461f32566af997da8b ]
@@ -23 +25,0 @@
-Cc: stable@dpdk.org
@@ -34 +36 @@
-index e111e05bc2..a9f4f28fba 100644
+index c5ee0741b7..42a169ca18 100644

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

* patch 'net/nfp: fix VNI of VXLAN encap action' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (143 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/bnxt: fix link state change interrupt config' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'net/nfp: restrict flow flush to the port' " Xueming Li
                     ` (12 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7ae80e1379d0f924a6fe7ef3ba7ee3737a62c278 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Wed, 8 Feb 2023 17:23:50 +0800
Subject: [PATCH] net/nfp: fix VNI of VXLAN encap action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 861949032d0f22a6a08bfa101d1beebd9eeb10f9 ]

The helper function which send the tunnel configuration to
firmware requires the vni with CPU endian.
The original VXLAN encap logic wrongly invoke it with the
big-endian value.

Fixes: 724662b4ce5b ("net/nfp: support IPv4 VXLAN encap flow action")
Fixes: c3b7254093c2 ("net/nfp: support IPv6 VXLAN encap flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 8784e01628..30e1edacb2 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2675,6 +2675,7 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,
 		struct nfp_fl_rule_metadata *nfp_flow_meta,
 		struct nfp_fl_tun *tun)
 {
+	uint64_t tun_id;
 	struct nfp_fl_act_pre_tun *pre_tun;
 	struct nfp_fl_act_set_tun *set_tun;
 	const struct rte_flow_item_eth *eth;
@@ -2693,7 +2694,8 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,

 	set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size);
 	memset(set_tun, 0, act_set_size);
-	nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, vxlan->hdr.vx_vni,
+	tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni);
+	nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id,
 			ipv4->hdr.time_to_live, ipv4->hdr.type_of_service);
 	set_tun->tun_flags = vxlan->hdr.vx_flags;

@@ -2710,6 +2712,7 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
 		struct nfp_fl_rule_metadata *nfp_flow_meta,
 		struct nfp_fl_tun *tun)
 {
+	uint64_t tun_id;
 	struct nfp_fl_act_pre_tun *pre_tun;
 	struct nfp_fl_act_set_tun *set_tun;
 	const struct rte_flow_item_eth *eth;
@@ -2728,7 +2731,8 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,

 	set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size);
 	memset(set_tun, 0, act_set_size);
-	nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, vxlan->hdr.vx_vni,
+	tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni);
+	nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id,
 			ipv6->hdr.hop_limits,
 			(ipv6->hdr.vtc_flow >> RTE_IPV6_HDR_TC_SHIFT) & 0xff);
 	set_tun->tun_flags = vxlan->hdr.vx_flags;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.555152000 +0800
+++ 0147-net-nfp-fix-VNI-of-VXLAN-encap-action.patch	2023-02-27 14:08:40.949237000 +0800
@@ -1 +1 @@
-From 861949032d0f22a6a08bfa101d1beebd9eeb10f9 Mon Sep 17 00:00:00 2001
+From 7ae80e1379d0f924a6fe7ef3ba7ee3737a62c278 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 861949032d0f22a6a08bfa101d1beebd9eeb10f9 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index bd3a8d2a3b..4d4d21d997 100644
+index 8784e01628..30e1edacb2 100644
@@ -28 +30 @@
-@@ -2686,6 +2686,7 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,
+@@ -2675,6 +2675,7 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,
@@ -36 +38 @@
-@@ -2704,7 +2705,8 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,
+@@ -2693,7 +2694,8 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower,
@@ -46 +48 @@
-@@ -2721,6 +2723,7 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
+@@ -2710,6 +2712,7 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
@@ -54 +56 @@
-@@ -2739,7 +2742,8 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
+@@ -2728,7 +2731,8 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,

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

* patch 'net/nfp: restrict flow flush to the port' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (144 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/nfp: fix VNI of VXLAN encap action' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'app/testpmd: fix crash on cleanup' " Xueming Li
                     ` (11 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Jin Liu; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 31f4d9ce135aba0a6f91f8b31329ec849c1a4b12 Mon Sep 17 00:00:00 2001
From: Jin Liu <jin.liu@corigine.com>
Date: Thu, 16 Feb 2023 14:36:44 +0800
Subject: [PATCH] net/nfp: restrict flow flush to the port
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c2bd03f27fdd79f3440511237296eb51105ee9cc ]

The flow flush function will destroy all the flow table on all the
port of NFP NIC rather than the provide port. Modify logic, only
destroy the flow table on the corresponding port.

Fixes: 30ecce522732 ("net/nfp: support flow API")

Signed-off-by: Jin Liu <jin.liu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 18 +++++++++++++-----
 drivers/net/nfp/nfp_flow.h |  1 +
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 30e1edacb2..b3f4861ae4 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -339,7 +339,7 @@ nfp_flow_table_search(struct nfp_flow_priv *priv,
 }

 static struct rte_flow *
-nfp_flow_alloc(struct nfp_fl_key_ls *key_layer)
+nfp_flow_alloc(struct nfp_fl_key_ls *key_layer, uint32_t port_id)
 {
 	char *tmp;
 	size_t len;
@@ -357,6 +357,7 @@ nfp_flow_alloc(struct nfp_fl_key_ls *key_layer)

 	nfp_flow->length = len;

+	nfp_flow->port_id      = port_id;
 	payload                = &nfp_flow->payload;
 	payload->meta          = (struct nfp_fl_rule_metadata *)tmp;
 	payload->unmasked_data = tmp + sizeof(struct nfp_fl_rule_metadata);
@@ -3488,7 +3489,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
 		return NULL;
 	}

-	nfp_flow = nfp_flow_alloc(&key_layer);
+	nfp_flow = nfp_flow_alloc(&key_layer, representor->port_id);
 	if (nfp_flow == NULL) {
 		PMD_DRV_LOG(ERR, "Alloc nfp flow failed.");
 		goto free_stats;
@@ -3796,14 +3797,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
 	void *next_data;
 	uint32_t iter = 0;
 	const void *next_key;
+	struct rte_flow *nfp_flow;
 	struct nfp_flow_priv *priv;
+	struct nfp_flower_representor *representor;
+
+	representor = dev->data->dev_private;

 	priv = nfp_flow_dev_to_priv(dev);

 	while (rte_hash_iterate(priv->flow_table, &next_key, &next_data, &iter) >= 0) {
-		ret = nfp_flow_destroy(dev, (struct rte_flow *)next_data, error);
-		if (ret != 0)
-			break;
+		nfp_flow = next_data;
+		if (nfp_flow->port_id == representor->port_id) {
+			ret = nfp_flow_destroy(dev, nfp_flow, error);
+			if (ret != 0)
+				break;
+		}
 	}

 	return ret;
diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h
index b0c2aaf6d8..8071243b86 100644
--- a/drivers/net/nfp/nfp_flow.h
+++ b/drivers/net/nfp/nfp_flow.h
@@ -222,6 +222,7 @@ struct rte_flow {
 	struct nfp_fl_tun tun;
 	size_t length;
 	uint32_t hash_key;
+	uint32_t port_id;
 	bool install_flag;
 	enum nfp_flow_type type;
 };
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.583583800 +0800
+++ 0148-net-nfp-restrict-flow-flush-to-the-port.patch	2023-02-27 14:08:40.949237000 +0800
@@ -1 +1 @@
-From c2bd03f27fdd79f3440511237296eb51105ee9cc Mon Sep 17 00:00:00 2001
+From 31f4d9ce135aba0a6f91f8b31329ec849c1a4b12 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c2bd03f27fdd79f3440511237296eb51105ee9cc ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index eba6aea40f..0c38925701 100644
+index 30e1edacb2..b3f4861ae4 100644
@@ -40 +42 @@
- 	nfp_flow->mtr_id       = NFP_MAX_MTR_CNT;
+
@@ -45 +47 @@
-@@ -3549,7 +3550,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
+@@ -3488,7 +3489,7 @@ nfp_flow_process(struct nfp_flower_representor *representor,
@@ -54 +56 @@
-@@ -3868,14 +3869,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
+@@ -3796,14 +3797,21 @@ nfp_flow_flush(struct rte_eth_dev *dev,
@@ -80 +82 @@
-index b8da752a9d..d352671c2c 100644
+index b0c2aaf6d8..8071243b86 100644
@@ -83 +85,2 @@
-@@ -223,6 +223,7 @@ struct rte_flow {
+@@ -222,6 +222,7 @@ struct rte_flow {
+ 	struct nfp_fl_tun tun;
@@ -86 +88,0 @@
- 	uint32_t mtr_id;

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

* patch 'app/testpmd: fix crash on cleanup' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (145 preceding siblings ...)
  2023-02-27  7:00   ` patch 'net/nfp: restrict flow flush to the port' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'sched: fix alignment of structs in subport' " Xueming Li
                     ` (10 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: David Marchand; +Cc: Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 38465cec0aaeb7a171a8520b7a6c71b7e3f71f8e Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 6 Feb 2023 16:49:46 +0100
Subject: [PATCH] app/testpmd: fix crash on cleanup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]

If allocating the ports[] array fails, a crash will occur when shutting
down testpmd since ethdev emits RTE_ETH_EVENT_DESTROY events.
Move init_port() before registering ethdev event handler.

Fixes: 85c6571c9103 ("app/testpmd: reset port status on close notification")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/testpmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 538609d890..adf19cfb9e 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4392,6 +4392,9 @@ main(int argc, char** argv)
 		rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
 			 rte_strerror(rte_errno));

+	/* allocate port structures, and init them */
+	init_port();
+
 	ret = register_eth_event_callback();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
@@ -4410,9 +4413,6 @@ main(int argc, char** argv)
 	if (nb_ports == 0)
 		TESTPMD_LOG(WARNING, "No probed ethernet devices\n");

-	/* allocate port structures, and init them */
-	init_port();
-
 	set_def_fwd_config();
 	if (nb_lcores == 0)
 		rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n"
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.611425100 +0800
+++ 0149-app-testpmd-fix-crash-on-cleanup.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From 563fbd084b6b8de866d4fad9582f9eb071e6da0a Mon Sep 17 00:00:00 2001
+From 38465cec0aaeb7a171a8520b7a6c71b7e3f71f8e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index a6c5dec4c0..0c14325b8d 100644
+index 538609d890..adf19cfb9e 100644
@@ -23 +25 @@
-@@ -4429,6 +4429,9 @@ main(int argc, char** argv)
+@@ -4392,6 +4392,9 @@ main(int argc, char** argv)
@@ -33 +35 @@
-@@ -4447,9 +4450,6 @@ main(int argc, char** argv)
+@@ -4410,9 +4413,6 @@ main(int argc, char** argv)

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

* patch 'sched: fix alignment of structs in subport' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (146 preceding siblings ...)
  2023-02-27  7:00   ` patch 'app/testpmd: fix crash on cleanup' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'eal/freebsd: fix lock in alarm callback' " Xueming Li
                     ` (9 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Megha Ajmera; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a656595e9bac405e7384fe429d3931b9c8e50816 Mon Sep 17 00:00:00 2001
From: Megha Ajmera <megha.ajmera@intel.com>
Date: Tue, 7 Feb 2023 06:10:08 +0000
Subject: [PATCH] sched: fix alignment of structs in subport
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bc3b950d80941420873b40d56ee387867fc34dad ]

Big structures like bitmap, pipes and queues in subport are addressed
using offset of 'memory' field in subport structures. This means no other
variable should be added after 'memory' variable or else addressing of such
structs like bitmap etc. become incorrect.

Realigned tc_ov_enabled variable in subport structure.

Fixes: f5e60154ade ("sched: enable traffic class oversubscription conditionally")

Signed-off-by: Megha Ajmera <megha.ajmera@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/sched/rte_sched.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
index c91697131d..19768d8c38 100644
--- a/lib/sched/rte_sched.c
+++ b/lib/sched/rte_sched.c
@@ -202,6 +202,9 @@ struct rte_sched_subport {
 	uint32_t qsize_add[RTE_SCHED_QUEUES_PER_PIPE];
 	uint32_t qsize_sum;

+	/* TC oversubscription activation */
+	int tc_ov_enabled;
+
 	struct rte_sched_pipe *pipe;
 	struct rte_sched_queue *queue;
 	struct rte_sched_queue_extra *queue_extra;
@@ -209,9 +212,6 @@ struct rte_sched_subport {
 	uint8_t *bmp_array;
 	struct rte_mbuf **queue_array;
 	uint8_t memory[0] __rte_cache_aligned;
-
-	/* TC oversubscription activation */
-	int tc_ov_enabled;
 } __rte_cache_aligned;

 struct rte_sched_port {
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.641189400 +0800
+++ 0150-sched-fix-alignment-of-structs-in-subport.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From bc3b950d80941420873b40d56ee387867fc34dad Mon Sep 17 00:00:00 2001
+From a656595e9bac405e7384fe429d3931b9c8e50816 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bc3b950d80941420873b40d56ee387867fc34dad ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'eal/freebsd: fix lock in alarm callback' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (147 preceding siblings ...)
  2023-02-27  7:00   ` patch 'sched: fix alignment of structs in subport' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:00   ` patch 'dma/ioat: fix device stop if no copies done' " Xueming Li
                     ` (8 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Bruce Richardson, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 13 Feb 2023 12:44:52 +0000
Subject: [PATCH] eal/freebsd: fix lock in alarm callback
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]

The spinlock should unlock when clock_gettime() failed. This patch
fixes it by invoking clock_gettime() before lock.

Fixes: 26021a715067 ("eal/bsd: support alarm API")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/freebsd/eal_alarm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c
index 1023c32937..1a3e6c0aad 100644
--- a/lib/eal/freebsd/eal_alarm.c
+++ b/lib/eal/freebsd/eal_alarm.c
@@ -171,12 +171,12 @@ eal_alarm_callback(void *arg __rte_unused)
 	struct timespec now;
 	struct alarm_entry *ap;

-	rte_spinlock_lock(&alarm_list_lk);
-	ap = LIST_FIRST(&alarm_list);
-
 	if (clock_gettime(CLOCK_TYPE_ID, &now) < 0)
 		return;

+	rte_spinlock_lock(&alarm_list_lk);
+	ap = LIST_FIRST(&alarm_list);
+
 	while (ap != NULL && timespec_cmp(&now, &ap->time) >= 0) {
 		ap->executing = 1;
 		ap->executing_id = pthread_self();
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.671928700 +0800
+++ 0151-eal-freebsd-fix-lock-in-alarm-callback.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From fc6bdd5248e843ba1300c8d46d43b263b4a69438 Mon Sep 17 00:00:00 2001
+From fb395ef1d0e7dcdf5899dbe1a6e71226c09e2fed Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fc6bdd5248e843ba1300c8d46d43b263b4a69438 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'dma/ioat: fix device stop if no copies done' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (148 preceding siblings ...)
  2023-02-27  7:00   ` patch 'eal/freebsd: fix lock in alarm callback' " Xueming Li
@ 2023-02-27  7:00   ` Xueming Li
  2023-02-27  7:01   ` patch 'dma/ioat: fix indexes after restart' " Xueming Li
                     ` (7 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:00 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Conor Walsh, Kevin Laatz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 881919396f3331a98ea69c957df2c461588ecdd6 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 16 Feb 2023 11:09:14 +0000
Subject: [PATCH] dma/ioat: fix device stop if no copies done
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 664fa1c3922c7f81047bff55c13fccd3ef6c4131 ]

The HW DMA devices supported by IOAT driver do not transition to
the "active" state until the first operation is started by the HW.
Therefore, if the user calls "rte_dma_stop()" on a device without
triggering any operations, the sequence of commands to be sent to
the HW is different, as is the final device state.

Update the IOAT driver "stop" function to take account of this
difference.

Fixes: 583f046dd404 ("dma/ioat: add start and stop")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/dma/ioat/ioat_dmadev.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c
index 5906eb45aa..aff7bbbfde 100644
--- a/drivers/dma/ioat/ioat_dmadev.c
+++ b/drivers/dma/ioat/ioat_dmadev.c
@@ -166,17 +166,28 @@ static int
 ioat_dev_stop(struct rte_dma_dev *dev)
 {
 	struct ioat_dmadev *ioat = dev->fp_obj->dev_private;
+	unsigned int chansts;
 	uint32_t retry = 0;

-	ioat->regs->chancmd = IOAT_CHANCMD_SUSPEND;
+	chansts = (unsigned int)(ioat->regs->chansts & IOAT_CHANSTS_STATUS);
+	if (chansts == IOAT_CHANSTS_ACTIVE || chansts == IOAT_CHANSTS_IDLE)
+		ioat->regs->chancmd = IOAT_CHANCMD_SUSPEND;
+	else
+		ioat->regs->chancmd = IOAT_CHANCMD_RESET;

 	do {
 		rte_pause();
 		retry++;
-	} while ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) != IOAT_CHANSTS_SUSPENDED
-			&& retry < 200);
+		chansts = (unsigned int)(ioat->regs->chansts & IOAT_CHANSTS_STATUS);
+	} while (chansts != IOAT_CHANSTS_SUSPENDED &&
+			chansts != IOAT_CHANSTS_HALTED && retry < 200);
+
+	if (chansts == IOAT_CHANSTS_SUSPENDED || chansts == IOAT_CHANSTS_HALTED)
+		return 0;

-	return ((ioat->regs->chansts & IOAT_CHANSTS_STATUS) == IOAT_CHANSTS_SUSPENDED) ? 0 : -1;
+	IOAT_PMD_WARN("Channel could not be suspended on stop. (chansts = %u [%s])",
+			chansts, chansts_readable[chansts]);
+	return -1;
 }

 /* Get device information of a device. */
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.701704600 +0800
+++ 0152-dma-ioat-fix-device-stop-if-no-copies-done.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From 664fa1c3922c7f81047bff55c13fccd3ef6c4131 Mon Sep 17 00:00:00 2001
+From 881919396f3331a98ea69c957df2c461588ecdd6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 664fa1c3922c7f81047bff55c13fccd3ef6c4131 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

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

* patch 'dma/ioat: fix indexes after restart' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (149 preceding siblings ...)
  2023-02-27  7:00   ` patch 'dma/ioat: fix device stop if no copies done' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'dma/ioat: fix error reporting on " Xueming Li
                     ` (6 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Conor Walsh, Kevin Laatz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 90ad21e9881ec3231f54801042d179811299be40 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 16 Feb 2023 11:09:15 +0000
Subject: [PATCH] dma/ioat: fix indexes after restart
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 79ab0f29dd9d734d0caf56e7694d7b0c6ead12e2 ]

As part of the process of restarting a dma instance, the IOAT driver
will reset the HW addresses and state values. The read and write
indexes for SW use need to be similarly reset to keep HW and SW in
sync.

Fixes: 583f046dd404 ("dma/ioat: add start and stop")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/dma/ioat/ioat_dmadev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c
index aff7bbbfde..072eb17cd9 100644
--- a/drivers/dma/ioat/ioat_dmadev.c
+++ b/drivers/dma/ioat/ioat_dmadev.c
@@ -146,6 +146,13 @@ ioat_dev_start(struct rte_dma_dev *dev)
 	/* Prime the status register to be set to the last element. */
 	ioat->status = ioat->ring_addr + ((ioat->qcfg.nb_desc - 1) * DESC_SZ);

+	/* reset all counters */
+	ioat->next_read = 0;
+	ioat->next_write = 0;
+	ioat->last_write = 0;
+	ioat->offset = 0;
+	ioat->failure = 0;
+
 	printf("IOAT.status: %s [0x%"PRIx64"]\n",
 			chansts_readable[ioat->status & IOAT_CHANSTS_STATUS],
 			ioat->status);
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.732596000 +0800
+++ 0153-dma-ioat-fix-indexes-after-restart.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From 79ab0f29dd9d734d0caf56e7694d7b0c6ead12e2 Mon Sep 17 00:00:00 2001
+From 90ad21e9881ec3231f54801042d179811299be40 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 79ab0f29dd9d734d0caf56e7694d7b0c6ead12e2 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'dma/ioat: fix error reporting on restart' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (150 preceding siblings ...)
  2023-02-27  7:01   ` patch 'dma/ioat: fix indexes after restart' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'reorder: invalidate buffer from ready queue in drain' " Xueming Li
                     ` (5 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Conor Walsh, Kevin Laatz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 106e0f2637880f7e976713713ea978cf65e8455c Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Thu, 16 Feb 2023 11:09:16 +0000
Subject: [PATCH] dma/ioat: fix error reporting on restart
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d486f1dad1df34abb0d64dcc8d192675476581ed ]

When the DMA device was stopped and restarted by the driver, the control
register specifying the behaviour on error was not getting correctly
reset. This caused unit tests to fail as explicitly introduced errors
were got getting reported back.

Fix by moving the setting of the register to the start function from the
probe function.

Fixes: 583f046dd404 ("dma/ioat: add start and stop")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
---
 drivers/dma/ioat/ioat_dmadev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c
index 072eb17cd9..57c18c081d 100644
--- a/drivers/dma/ioat/ioat_dmadev.c
+++ b/drivers/dma/ioat/ioat_dmadev.c
@@ -142,6 +142,9 @@ ioat_dev_start(struct rte_dma_dev *dev)
 	ioat->regs->chainaddr = ioat->ring_addr;
 	/* Inform hardware of where to write the status/completions. */
 	ioat->regs->chancmp = ioat->status_addr;
+	/* Ensure channel control is set to abort on error, so we get status writeback. */
+	ioat->regs->chanctrl = IOAT_CHANCTRL_ANY_ERR_ABORT_EN |
+			IOAT_CHANCTRL_ERR_COMPLETION_EN;

 	/* Prime the status register to be set to the last element. */
 	ioat->status = ioat->ring_addr + ((ioat->qcfg.nb_desc - 1) * DESC_SZ);
@@ -682,8 +685,6 @@ ioat_dmadev_create(const char *name, struct rte_pci_device *dev)
 			return -EIO;
 		}
 	}
-	ioat->regs->chanctrl = IOAT_CHANCTRL_ANY_ERR_ABORT_EN |
-			IOAT_CHANCTRL_ERR_COMPLETION_EN;

 	dmadev->fp_obj->dev_private = ioat;

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.760843700 +0800
+++ 0154-dma-ioat-fix-error-reporting-on-restart.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From d486f1dad1df34abb0d64dcc8d192675476581ed Mon Sep 17 00:00:00 2001
+From 106e0f2637880f7e976713713ea978cf65e8455c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d486f1dad1df34abb0d64dcc8d192675476581ed ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org

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

* patch 'reorder: invalidate buffer from ready queue in drain' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (151 preceding siblings ...)
  2023-02-27  7:01   ` patch 'dma/ioat: fix error reporting on " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'test/reorder: fix double free of drained buffers' " Xueming Li
                     ` (4 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b515c436e649c7bdd60481abbacc1d853d2c94fa Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Sat, 7 Jan 2023 16:19:38 +0100
Subject: [PATCH] reorder: invalidate buffer from ready queue in drain
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit af12092f927d0d230b4dc051529dae88902fba1c ]

Set drained buffers from ready queue to NULL, since their ownership
returned to user. Otherwise it's possible that both user and library
will attempt to free the packet.

Fixes: b70b56032bff ("reorder: new library")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/reorder/rte_reorder.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index 385ee479da..b38e71f460 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -389,6 +389,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,
 	/* Try to fetch requested number of mbufs from ready buffer */
 	while ((drain_cnt < max_mbufs) && (ready_buf->tail != ready_buf->head)) {
 		mbufs[drain_cnt++] = ready_buf->entries[ready_buf->tail];
+		ready_buf->entries[ready_buf->tail] = NULL;
 		ready_buf->tail = (ready_buf->tail + 1) & ready_buf->mask;
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.790561600 +0800
+++ 0155-reorder-invalidate-buffer-from-ready-queue-in-drain.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From af12092f927d0d230b4dc051529dae88902fba1c Mon Sep 17 00:00:00 2001
+From b515c436e649c7bdd60481abbacc1d853d2c94fa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit af12092f927d0d230b4dc051529dae88902fba1c ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'test/reorder: fix double free of drained buffers' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (152 preceding siblings ...)
  2023-02-27  7:01   ` patch 'reorder: invalidate buffer from ready queue in drain' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'build: fix toolchain definition' " Xueming Li
                     ` (3 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: Stephen Hemminger, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 15ae43b33a3fe1ecff7af0202db6091617435727 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Sat, 7 Jan 2023 16:19:39 +0100
Subject: [PATCH] test/reorder: fix double free of drained buffers
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d51955ea93fba1873e9c2b86a911e114787bdd4d ]

Set to zero array of drained buffers after free, to prevent freeing them
one more time.
Discovered with enabled `RTE_LIBRTE_MEMPOOL_DEBUG`.

Fixes: ecd867faa860 ("test/reorder: fix freeing mbuf twice")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_reorder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c
index f0714a5c18..7b5e590bac 100644
--- a/app/test/test_reorder.c
+++ b/app/test/test_reorder.c
@@ -278,6 +278,7 @@ test_reorder_drain(void)
 		goto exit;
 	}
 	rte_pktmbuf_free(robufs[0]);
+	memset(robufs, 0, sizeof(robufs));

 	/* Insert more packets
 	 * RB[] = {NULL, NULL, NULL, NULL}
@@ -313,6 +314,7 @@ test_reorder_drain(void)
 	for (i = 0; i < 3; i++) {
 		rte_pktmbuf_free(robufs[i]);
 	}
+	memset(robufs, 0, sizeof(robufs));

 	/*
 	 * RB[] = {NULL, NULL, NULL, NULL}
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.817987600 +0800
+++ 0156-test-reorder-fix-double-free-of-drained-buffers.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From d51955ea93fba1873e9c2b86a911e114787bdd4d Mon Sep 17 00:00:00 2001
+From 15ae43b33a3fe1ecff7af0202db6091617435727 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d51955ea93fba1873e9c2b86a911e114787bdd4d ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'build: fix toolchain definition' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (153 preceding siblings ...)
  2023-02-27  7:01   ` patch 'test/reorder: fix double free of drained buffers' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'eal: use same atomic intrinsics for GCC and clang' " Xueming Li
                     ` (2 subsequent siblings)
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Keith Wiles, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a5d83cee8ef87c616435a86100d4b571e39419d0 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 7 Feb 2023 15:22:00 +0000
Subject: [PATCH] build: fix toolchain definition
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e08c1645df1f2967b331e132ddb36ba817812dc2 ]

When using "icx" (Intel(R) oneAPI DPC++/C++ Compiler) to build DPDK,
meson reports the toolchain as "intel-llvm"[1]. This value is used
directly to define the RTE_TOOLCHAIN macros, which means that we end up
with the invalid macro name "RTE_TOOLCHAIN_INTEL-LLVM", and getting the
compiler warning:

rte_build_config.h:422:28: warning: ISO C99 requires whitespace after the macro name

This can be fixed, and the macro generation made more robust generally,
by adding "underscorify()" on the string. This replaces the "-", and
any other invalid characters, with "_" [2].

[1] https://mesonbuild.com/Reference-tables.html#compiler-ids
[2] https://mesonbuild.com/Reference-manual_elementary_str.html#strunderscorify

Fixes: afd18fa21b5e ("build: set toolchain info during meson configure")

Reported-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 config/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index 239d3ea0ec..6597fa24e3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -139,7 +139,7 @@ endif

 toolchain = cc.get_id()
 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
-dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
+dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper().underscorify(), 1)

 dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8)
 dpdk_conf.set('RTE_ARCH_32', cc.sizeof('void *') == 4)
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.843926500 +0800
+++ 0157-build-fix-toolchain-definition.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From e08c1645df1f2967b331e132ddb36ba817812dc2 Mon Sep 17 00:00:00 2001
+From a5d83cee8ef87c616435a86100d4b571e39419d0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e08c1645df1f2967b331e132ddb36ba817812dc2 ]
@@ -22 +24,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index 26f3168bc9..fc3ac99a32 100644
+index 239d3ea0ec..6597fa24e3 100644

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

* patch 'eal: use same atomic intrinsics for GCC and clang' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (154 preceding siblings ...)
  2023-02-27  7:01   ` patch 'build: fix toolchain definition' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'examples/cmdline: fix build with GCC 12' " Xueming Li
  2023-02-27  7:01   ` patch 'examples/qos_sched: fix Tx port config when link down' " Xueming Li
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Ola Liljedahl, Ruifeng Wang, Morten Brørup, Tyler Retzlaff,
	dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1b9356337876bd96035ac6306252d054ec92d6e5 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Date: Fri, 17 Feb 2023 19:58:03 -0600
Subject: [PATCH] eal: use same atomic intrinsics for GCC and clang
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 ]

The size generic atomic intrinsics generate the same
code as the size specific intrinsics for gcc. Use size
generic intrinsics for both gcc and clang.

Fixes: 7bdccb93078e ("eal: fix ARM build with clang")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/include/generic/rte_atomic.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index f5c49a9870..234b268b91 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -176,11 +176,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
 static inline uint16_t
 rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif

@@ -459,11 +455,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
 static inline uint32_t
 rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif

@@ -741,11 +733,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
 static inline uint64_t
 rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
 {
-#if defined(__clang__)
 	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
-#else
-	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
-#endif
 }
 #endif

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.871504700 +0800
+++ 0158-eal-use-same-atomic-intrinsics-for-GCC-and-clang.patch	2023-02-27 14:08:40.969237000 +0800
@@ -1 +1 @@
-From 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 Mon Sep 17 00:00:00 2001
+From 1b9356337876bd96035ac6306252d054ec92d6e5 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0c0eb1156e3d52ede4b19d687aa5387d1dca7666 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/cmdline: fix build with GCC 12' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (155 preceding siblings ...)
  2023-02-27  7:01   ` patch 'eal: use same atomic intrinsics for GCC and clang' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  2023-02-27  7:01   ` patch 'examples/qos_sched: fix Tx port config when link down' " Xueming Li
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ecb065fe53917eba11d1a9c34f6983de3f45a48a Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Wed, 18 Jan 2023 16:11:11 +0000
Subject: [PATCH] examples/cmdline: fix build with GCC 12
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 ]

When building the example without libbsd and using the DPDK-provided
strlcpy function, a compiler warning is emitted by GCC 12 about the copy
of the parsed string into the resulting object. This is because the
source from cmdline library is 128 bytes and the destination buffer is
64-bytes.

commands.c: In function 'cmd_obj_add_parsed':
rte_string_fns.h:61:24: warning: '%s' directive output may be truncated
writing up to 127 bytes into a region of size 64 [-Wformat-truncation=]
   61 |         return (size_t)snprintf(dst, size, "%s", src);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:894,
                 from commands.c:7:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: note:
'__builtin_snprintf' output between 1 and 128 bytes into a destination of size 64

Multiple options are possible to fix this, but the one taken in this
patch is to ensure truncation never occurs by setting the destination
buffer size to be the same as that used by the cmdline library.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 examples/cmdline/parse_obj_list.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/cmdline/parse_obj_list.h b/examples/cmdline/parse_obj_list.h
index 6516d3e2c2..1223ac1e8b 100644
--- a/examples/cmdline/parse_obj_list.h
+++ b/examples/cmdline/parse_obj_list.h
@@ -12,8 +12,9 @@

 #include <sys/queue.h>
 #include <cmdline_parse.h>
+#include <cmdline_parse_string.h>

-#define OBJ_NAME_LEN_MAX 64
+#define OBJ_NAME_LEN_MAX sizeof(cmdline_fixed_string_t)

 struct object {
 	SLIST_ENTRY(object) next;
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.899742400 +0800
+++ 0159-examples-cmdline-fix-build-with-GCC-12.patch	2023-02-27 14:08:40.969237000 +0800
@@ -1 +1 @@
-From 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 Mon Sep 17 00:00:00 2001
+From ecb065fe53917eba11d1a9c34f6983de3f45a48a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2ba8d0adb06f92ef73bc8e3953ca45b7d322c823 ]
@@ -27 +29,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/qos_sched: fix Tx port config when link down' has been queued to stable release 22.11.2
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
                     ` (156 preceding siblings ...)
  2023-02-27  7:01   ` patch 'examples/cmdline: fix build with GCC 12' " Xueming Li
@ 2023-02-27  7:01   ` Xueming Li
  157 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-02-27  7:01 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/01/23. So please
shout if anyone has objections.

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

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

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

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dc7302e733911234b7b0d5e147e3812ba7a2a92f Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Fri, 3 Feb 2023 10:05:30 +0000
Subject: [PATCH] examples/qos_sched: fix Tx port config when link down
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]

The Tx port config will fail if the port is not up,
so wait 10 seconds on startup for it to start.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/qos_sched/init.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index d28350e14a..7a27c03b64 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -328,6 +328,8 @@ int app_init(void)
 	for(i = 0; i < nb_pfc; i++) {
 		uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
 		struct rte_ring *ring;
+		struct rte_eth_link link = {0};
+		int retry_count = 100, retry_delay = 100; /* try every 100ms for 10 sec */

 		snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].rx_core);
 		ring = rte_ring_lookup(ring_name);
@@ -358,6 +360,14 @@ int app_init(void)
 		app_init_port(qos_conf[i].rx_port, qos_conf[i].mbuf_pool);
 		app_init_port(qos_conf[i].tx_port, qos_conf[i].mbuf_pool);

+		rte_eth_link_get(qos_conf[i].tx_port, &link);
+		if (link.link_status == 0)
+			printf("Waiting for link on port %u\n", qos_conf[i].tx_port);
+		while (link.link_status == 0 && retry_count--) {
+			rte_delay_ms(retry_delay);
+			rte_eth_link_get(qos_conf[i].tx_port, &link);
+		}
+
 		qos_conf[i].sched_port = app_init_sched_port(qos_conf[i].tx_port, socket);
 	}

--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.928141300 +0800
+++ 0160-examples-qos_sched-fix-Tx-port-config-when-link-down.patch	2023-02-27 14:08:40.969237000 +0800
@@ -1 +1 @@
-From 665b49c51639a10c553433bc2bcd85c7331c631e Mon Sep 17 00:00:00 2001
+From dc7302e733911234b7b0d5e147e3812ba7a2a92f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 665b49c51639a10c553433bc2bcd85c7331c631e ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch has been queued to stable release 22.11.2
  2023-02-27  6:21 patch has been queued to stable release 22.11.2 Xueming Li
  2023-02-27  6:21 ` patch 'drivers: fix symbol exports when map is omitted' " Xueming Li
  2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
@ 2023-04-09 15:23 ` Xueming Li
  2023-04-09 15:23   ` patch 'common/cnxk: fix second pass flow rule layer type' " Xueming Li
                     ` (136 more replies)
  2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
  3 siblings, 137 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Xueming Li; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/30/23. So please
shout if anyone has objections.

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

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


Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f9f94070e0a9c9ac33b64bc22d67377fe316dfea Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl@nvidia.com>
Date: Sun, 9 Apr 2023 21:45:38 +0800
Subject: 22.11.2 second batch patch list
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

Abdullah Sevincer (1):
  eventdev: fix memory size for telemetry

Akhil Goyal (2):
  examples/ipsec-secgw: fix auth IV length
  doc: fix code blocks in cryptodev guide

Alex Vesker (1):
  net/mlx5/hws: fix error code of send queue action

Alexander Kozyrev (1):
  net/mlx5: fix CQE dump for Tx

Arkadiusz Kusztal (1):
  app/compress-perf: fix remaining data for ops

Beilei Xing (1):
  net/idpf: reset queue flag when queue is stopped

Bing Zhao (2):
  net/mlx5: fix hairpin Tx queue reference count
  net/mlx5: fix sysfs port name translation

Boleslav Stankevich (1):
  net/virtio: deduce IP length for TSO checksum

Bruce Richardson (1):
  examples/qos_sched: fix config entries in wrong sections

Chaoyong He (7):
  net/nfp: fix set MAC flow action
  net/nfp: fix set IPv4 flow action
  net/nfp: fix set IPv6 flow action
  net/nfp: fix set TP flow action
  net/nfp: fix set TTL flow action
  net/nfp: fix set DSCP flow action
  net/nfp: fix offload of multiple output actions

Cheng Jiang (1):
  vhost: fix slot index in async split virtqueue Tx

Chengwen Feng (7):
  kvargs: add API documentation for process callback
  compressdev: fix empty devargs parsing
  cryptodev: fix empty devargs parsing
  net/hns3: fix empty devargs parsing
  net/virtio: fix empty devargs parsing
  dma/skeleton: fix empty devargs parsing
  raw/skeleton: fix empty devargs parsing

Ciara Power (5):
  crypto/qat: fix SM3 auth mode
  app/crypto-perf: fix test file memory leak
  test/crypto: fix ZUC digest length in comparison
  test/crypto: fix capability check for ZUC cipher-auth
  test/crypto: fix skip condition for CPU crypto SGL

Dariusz Sosnowski (2):
  net/mlx5: fix egress group translation in HWS
  net/mlx5: fix isolated mode if no representor matching

David Christensen (1):
  acl: fix crash on PPC64 with GCC 11

David Marchand (13):
  doc: fix reference to event timer header
  vhost: fix OOB access for invalid vhost ID
  app/testpmd: fix Tx preparation in checksum engine
  app/testpmd: fix packet count in IEEE 1588 engine
  app/testpmd: fix packet transmission in noisy VNF engine
  net/i40e: revert link status check on device start
  crypto/ccp: fix PCI probing
  raw/skeleton: fix selftest
  net/vhost: add missing newline in logs
  net/vhost: fix leak in interrupt handle setup
  net/vhost: fix Rx interrupt
  net/virtio: remove address width limit for modern devices
  net/mlx5: fix build with GCC 12 and ASan

Dmitry Kozlyuk (1):
  doc: add Linux capability to access physical addresses

Erez Shitrit (1):
  net/mlx5/hws: fix pattern creation

Ferruh Yigit (1):
  ethdev: remove telemetry Rx mbuf alloc failed field

Gerry Gribbon (2):
  regex/mlx5: utilize all available queue pairs
  regex/mlx5: fix doorbell record

Gowrishankar Muthukrishnan (6):
  examples/fips_validation: fix MCT output for SHA
  examples/fips_validation: fix integer parsing
  examples/fips_validation: fix AES-GCM tests
  examples/fips_validation: fix AES-XTS sequence number
  examples/fips_validation: add extra space in JSON buffer
  common/cnxk: fix auth key length

Harshad Narayane (1):
  doc: fix pipeline example path in user guide

Hernan Vargas (5):
  baseband/acc: fix check after deref and dead code
  test/bbdev: fix crash for non supported HARQ length
  test/bbdev: extend HARQ tolerance
  test/bbdev: remove check for invalid opaque data
  app/bbdev: check statistics failure

Huisong Li (17):
  mem: fix heap ID in telemetry
  net/hns3: fix possible truncation of hash key when config
  net/hns3: fix possible truncation of redirection table
  net/hns3: use hardware config to report hash key
  net/hns3: use hardware config to report hash types
  net/hns3: use hardware config to report redirection table
  net/hns3: separate setting hash algorithm
  net/hns3: separate setting hash key
  net/hns3: separate setting redirection table
  net/hns3: separate setting RSS types
  net/hns3: separate setting and clearing RSS rule
  net/hns3: use new RSS rule to configure hardware
  net/hns3: save hash algo to RSS filter list node
  net/hns3: allow adding queue buffer size hash rule
  net/hns3: separate flow RSS config from RSS conf
  net/hns3: reimplement hash flow function
  net/hns3: add verification of RSS types

Ivan Malov (3):
  common/sfc_efx/base: add MAE mark reset action
  net/sfc: fix resetting mark in tunnel offload switch rules
  net/sfc: invalidate switch port entry on representor unplug

Joyce Kong (1):
  pdump: fix build with GCC 12

Kai Ji (1):
  crypto/openssl: fix freeing in RSA EVP

Kaiwen Deng (1):
  net/ixgbe: fix IPv6 mask in flow director

Kamalakshitha Aligeri (3):
  net/i40e: fix AVX512 fast-free path
  examples/l3fwd: remove hash entry number
  doc: fix LPM support in l3forward guide

Kevin Traynor (1):
  ring: silence GCC 12 warnings

Krzysztof Karas (2):
  ethdev: fix build with LTO
  crypto/ipsec_mb: relax multi-process requirement

Levend Sayar (1):
  net/gve: fix offloading capability

Long Li (2):
  net/mana: enable driver by default
  net/mana: fix stats counters

Long Wu (1):
  net/nfp: fix getting RSS configuration

Michael Baum (4):
  compress/mlx5: fix decompress xform validation
  compress/mlx5: fix output Adler-32 checksum offset
  compress/mlx5: fix queue setup for partial transformations
  app/testpmd: fix encap/decap size calculation

Mohammad Iqbal Ahmad (1):
  app/flow-perf: fix division or module by zero

Nicolas Chautru (4):
  baseband/acc: protect from TB negative scenario
  baseband/acc: add explicit mbuf append for soft output
  baseband/acc: prevent to dequeue more than requested
  baseband/acc: fix iteration counter in TB mode

Nithin Dabilpuram (2):
  common/cnxk: add memory clobber to steor and ldeor
  examples/ipsec-secgw: fix offload variable init

Pavel Ivashchenko (1):
  test/mbuf: fix test with mbuf debug enabled

Peng Zhang (2):
  net/nfp: fix 48-bit DMA support for NFDk
  net/nfp: fix MTU configuration order

Qi Zhang (1):
  doc: fix DCF instructions in ice guide

Rakesh Kudurumalla (1):
  net/cnxk: fix LBK BPID usage

Rongwei Liu (1):
  net/mlx5: fix crash on action template failure

Saoirse O'Donovan (1):
  test/crypto: fix statistics error messages

Satheesh Paul (1):
  common/cnxk: fix second pass flow rule layer type

Shiyang He (1):
  app/testpmd: fix secondary process packet forwarding

Simei Su (2):
  net/i40e: fix maximum frame size configuration
  net/ice: fix Rx timestamp

Stephen Hemminger (4):
  cmdline: make rdline status not private
  cmdline: handle EOF as quit
  app/testpmd: cleanup cleanly from signal
  app/testpmd: fix interactive mode on Windows

Thomas Monjalon (5):
  eal/windows: fix pedantic build
  doc: add gpudev to the Doxygen index
  net/mlx5: fix Windows build with MinGW GCC 12
  gpudev: export header file for external drivers
  devtools: move mailmap check after patch applied

Tyler Retzlaff (2):
  eal/windows: fix thread creation
  eal/unix: fix thread creation

Visa Hankala (1):
  net/e1000: fix saving of stripped VLAN TCI

Volodymyr Fialko (2):
  event/cnxk: fix SSO cleanup
  reorder: fix sequence number mbuf field register

Wei Huang (3):
  bus/ifpga: fix devargs handling
  net/ipn3ke: fix thread exit
  net/ipn3ke: fix representor name

Wenjing Qiao (1):
  net/i40e: fix MAC loopback on X722

Yangchao Zhou (1):
  kni: fix possible starvation when mbufs are exhausted

Yogesh Jangra (1):
  table: fix action selector group size log2 setting

Zhichao Zeng (1):
  net/iavf: fix device stop during reset

Zhuobin Huang (1):
  test: fix segment length in packet generator

 .mailmap                                      |  11 +
 MAINTAINERS                                   |   2 +-
 app/test-bbdev/test_bbdev_perf.c              |  32 +-
 .../comp_perf_test_common.c                   |  11 +-
 app/test-crypto-perf/cperf_options_parsing.c  |   1 +
 .../cperf_test_vector_parsing.c               |   1 +
 app/test-flow-perf/main.c                     |   7 +-
 app/test-pmd/cmdline.c                        |  29 +-
 app/test-pmd/cmdline_flow.c                   |  48 +-
 app/test-pmd/csumonly.c                       |  17 +-
 app/test-pmd/ieee1588fwd.c                    |   2 +-
 app/test-pmd/noisy_vnf.c                      |   5 +-
 app/test-pmd/testpmd.c                        | 160 ++-
 app/test-pmd/testpmd.h                        |   1 +
 app/test/packet_burst_generator.c             |  26 +-
 app/test/test_cryptodev.c                     |  60 +-
 app/test/test_mbuf.c                          |   1 +
 devtools/check-git-log.sh                     |  15 +
 devtools/checkpatches.sh                      |  30 -
 doc/api/doxy-api-index.md                     |   1 +
 doc/guides/linux_gsg/enable_func.rst          |   4 +-
 doc/guides/nics/ice.rst                       |   8 +-
 doc/guides/nics/mana.rst                      |   8 +-
 doc/guides/nics/mlx5.rst                      |   3 +
 doc/guides/prog_guide/cryptodev_lib.rst       | 121 +--
 doc/guides/prog_guide/event_timer_adapter.rst |   2 +-
 doc/guides/sample_app_ug/l3_forward.rst       |   3 +-
 doc/guides/sample_app_ug/pipeline.rst         |   2 +-
 drivers/baseband/acc/rte_acc100_pmd.c         |   2 -
 drivers/baseband/acc/rte_acc200_pmd.c         |  61 +-
 drivers/bus/ifpga/ifpga_bus.c                 |   3 +-
 drivers/common/cnxk/roc_io.h                  |  12 +-
 drivers/common/cnxk/roc_npc_mcam.c            |  39 +-
 drivers/common/cnxk/roc_npc_mcam_dump.c       |   6 +-
 drivers/common/cnxk/roc_npc_parse.c           |   1 +
 drivers/common/cnxk/roc_npc_priv.h            |   1 +
 drivers/common/cnxk/roc_se.h                  |   7 +-
 drivers/common/mlx5/meson.build               |   9 +-
 drivers/common/mlx5/windows/mlx5_win_defs.h   | 100 +-
 drivers/common/sfc_efx/base/efx.h             |  18 +
 drivers/common/sfc_efx/base/efx_mae.c         |  12 +
 drivers/common/sfc_efx/version.map            |   1 +
 drivers/compress/mlx5/mlx5_compress.c         |   8 +-
 drivers/crypto/ccp/ccp_crypto.c               |   1 -
 drivers/crypto/ccp/ccp_dev.c                  |  89 +-
 drivers/crypto/ccp/ccp_dev.h                  |  31 +-
 drivers/crypto/ccp/ccp_pci.c                  | 207 ----
 drivers/crypto/ccp/ccp_pci.h                  |  24 -
 drivers/crypto/ccp/meson.build                |   1 -
 drivers/crypto/ccp/rte_ccp_pmd.c              |  17 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.c    |   2 +-
 drivers/crypto/openssl/rte_openssl_pmd.c      |   4 +-
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c  |   3 +
 drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c  |   3 +
 drivers/crypto/qat/qat_sym_session.c          |   2 +-
 drivers/dma/skeleton/skeleton_dmadev.c        |   8 +-
 drivers/event/cnxk/cnxk_eventdev.c            |   3 +-
 drivers/net/cnxk/cnxk_ethdev.c                |  28 +
 drivers/net/e1000/em_rxtx.c                   |   3 +-
 drivers/net/gve/gve_ethdev.c                  |   1 -
 drivers/net/hns3/hns3_cmd.h                   |   1 +
 drivers/net/hns3/hns3_common.c                |   9 +
 drivers/net/hns3/hns3_ethdev.h                |   9 -
 drivers/net/hns3/hns3_flow.c                  | 985 ++++++++++++------
 drivers/net/hns3/hns3_flow.h                  |  21 +-
 drivers/net/hns3/hns3_rss.c                   | 642 +++++++++---
 drivers/net/hns3/hns3_rss.h                   | 130 ++-
 drivers/net/i40e/i40e_ethdev.c                |  68 +-
 drivers/net/i40e/i40e_ethdev.h                |   3 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c       |  12 +-
 drivers/net/iavf/iavf_ethdev.c                |   3 +
 drivers/net/ice/base/ice_common.c             |   4 +-
 drivers/net/ice/ice_ethdev.c                  |  36 +-
 drivers/net/ice/ice_rxtx.h                    |  11 +-
 drivers/net/idpf/idpf_rxtx.c                  |   2 +
 drivers/net/ipn3ke/ipn3ke_ethdev.c            |   2 +-
 drivers/net/ipn3ke/ipn3ke_representor.c       |   2 +-
 drivers/net/ixgbe/ixgbe_flow.c                |  16 +-
 drivers/net/mana/mana.c                       |  12 +-
 drivers/net/meson.build                       |   1 +
 drivers/net/mlx5/hws/mlx5dr_cmd.c             |  16 +-
 drivers/net/mlx5/hws/mlx5dr_send.c            |   4 +-
 drivers/net/mlx5/linux/mlx5_ethdev_os.c       |  19 +-
 drivers/net/mlx5/linux/mlx5_os.c              |  16 +
 drivers/net/mlx5/mlx5_flow.c                  |   4 +
 drivers/net/mlx5/mlx5_flow_hw.c               |  17 +-
 drivers/net/mlx5/mlx5_stats.c                 |   3 +-
 drivers/net/mlx5/mlx5_trigger.c               |   2 +-
 drivers/net/mlx5/mlx5_tx.c                    |   2 +-
 drivers/net/mlx5/mlx5_txpp.c                  |   4 +-
 drivers/net/mlx5/windows/mlx5_os.c            |   4 +-
 drivers/net/nfp/flower/nfp_flower.c           |  13 +-
 drivers/net/nfp/flower/nfp_flower_ctrl.c      |   2 +-
 drivers/net/nfp/nfp_common.c                  |  26 +-
 drivers/net/nfp/nfp_common.h                  |   2 +
 drivers/net/nfp/nfp_ethdev.c                  |  12 +-
 drivers/net/nfp/nfp_ethdev_vf.c               |  12 +-
 drivers/net/nfp/nfp_flow.c                    |  55 +-
 drivers/net/nfp/nfp_rxtx.c                    |   4 +-
 drivers/net/nfp/nfp_rxtx.h                    |   4 +-
 drivers/net/sfc/sfc_mae.c                     |   8 +-
 drivers/net/sfc/sfc_repr.c                    |   2 +
 drivers/net/sfc/sfc_switch.c                  |  12 +
 drivers/net/vhost/rte_eth_vhost.c             | 355 +++----
 drivers/net/virtio/virtio_ethdev.c            |   3 +
 drivers/net/virtio/virtio_pci.c               |  28 +-
 drivers/net/virtio/virtio_pci_ethdev.c        |   3 +
 drivers/net/virtio/virtio_rxtx.c              |  25 +-
 drivers/raw/skeleton/skeleton_rawdev.c        |   6 +-
 drivers/raw/skeleton/skeleton_rawdev_test.c   |  46 +-
 drivers/regex/mlx5/mlx5_regex.h               |   2 +-
 drivers/regex/mlx5/mlx5_regex_fastpath.c      |  16 +-
 examples/fips_validation/fips_validation.c    |  29 +-
 examples/fips_validation/fips_validation.h    |   2 +-
 .../fips_validation/fips_validation_gcm.c     |  12 +-
 .../fips_validation/fips_validation_sha.c     |   8 +-
 .../fips_validation/fips_validation_xts.c     |  13 +-
 examples/fips_validation/main.c               |  13 +-
 examples/ipsec-secgw/sa.c                     |   8 +-
 examples/l3fwd/l3fwd.h                        |   1 -
 examples/l3fwd/main.c                         |  38 +-
 examples/qos_sched/profile.cfg                |   6 +-
 examples/qos_sched/profile_ov.cfg             |   6 +-
 examples/qos_sched/profile_pie.cfg            |   6 +-
 examples/qos_sched/profile_red.cfg            |   6 +-
 lib/acl/acl_run_altivec.h                     |   2 +-
 lib/cmdline/cmdline.c                         |  12 +-
 lib/cmdline/cmdline.h                         |   6 +
 lib/cmdline/cmdline_os_unix.c                 |   6 +
 lib/cmdline/cmdline_os_windows.c              |  14 +
 lib/cmdline/cmdline_private.h                 |  11 +-
 lib/compressdev/rte_compressdev_pmd.c         |   6 +
 lib/cryptodev/cryptodev_pmd.c                 |   7 +
 lib/cryptodev/rte_crypto_sym.h                |   4 +
 lib/cryptodev/rte_cryptodev.h                 |   6 +
 lib/eal/common/eal_common_memory.c            |   2 +-
 lib/eal/unix/rte_thread.c                     |  73 +-
 lib/eal/windows/include/pthread.h             |   3 +-
 lib/eal/windows/rte_thread.c                  |  19 +-
 lib/ethdev/rte_class_eth.c                    |   2 +-
 lib/ethdev/rte_ethdev.c                       |   2 -
 lib/eventdev/rte_eventdev.c                   |   2 +-
 lib/gpudev/gpudev_driver.h                    |   8 +
 lib/gpudev/meson.build                        |   4 +
 lib/kni/rte_kni.c                             |   4 +-
 lib/kvargs/rte_kvargs.h                       |  14 +-
 lib/pdump/rte_pdump.c                         |   2 +-
 lib/reorder/rte_reorder.c                     |  95 +-
 lib/reorder/rte_reorder.h                     |   1 +
 lib/ring/rte_ring_elem_pvt.h                  |  10 +
 lib/table/rte_swx_table_selector.c            |   2 +-
 lib/vhost/vhost.h                             |   5 +-
 lib/vhost/virtio_net.c                        |   1 +
 153 files changed, 2642 insertions(+), 1843 deletions(-)
 delete mode 100644 drivers/crypto/ccp/ccp_pci.c
 delete mode 100644 drivers/crypto/ccp/ccp_pci.h

--
2.25.1

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

* patch 'common/cnxk: fix second pass flow rule layer type' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/mlx5: fix crash on action template failure' " Xueming Li
                     ` (135 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Satheesh Paul; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/4dc4547f2df57baae38b12246f5a0a732fbdd3ff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4dc4547f2df57baae38b12246f5a0a732fbdd3ff Mon Sep 17 00:00:00 2001
From: Satheesh Paul <psatheesh@marvell.com>
Date: Mon, 27 Feb 2023 15:07:17 +0530
Subject: [PATCH] common/cnxk: fix second pass flow rule layer type
Cc: Xueming Li <xuemingl@nvidia.com>

When installing flow rule for second pass packets, set the
LA LTYPE to LA_CPT_HDR.

Fixes: 4968b362b639 ("common/cnxk: support CPT second pass flow rules")
Cc: stable@dpdk.org

[ upstream commit a0c837ad1fb5b6a8b10a284ffeb5f9e31bd8ff00 ]

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc_mcam.c      | 39 +++++++++++++++++++++----
 drivers/common/cnxk/roc_npc_mcam_dump.c |  6 ++--
 drivers/common/cnxk/roc_npc_parse.c     |  1 +
 drivers/common/cnxk/roc_npc_priv.h      |  1 +
 4 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c
index ceb0a733f0..3bf35cdf48 100644
--- a/drivers/common/cnxk/roc_npc_mcam.c
+++ b/drivers/common/cnxk/roc_npc_mcam.c
@@ -551,6 +551,8 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
 	struct idev_cfg *idev;
 	uint16_t pf_func = 0;
 	uint16_t ctr = ~(0);
+	uint32_t la_offset;
+	uint64_t mask;
 	int rc, idx;
 	int entry;
 
@@ -617,17 +619,42 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
 			flow->npc_action &= ~(GENMASK(19, 4));
 			flow->npc_action |= (uint64_t)pf_func << 4;
 
-			npc_mcam_set_channel(flow, req, inl_dev->channel,
-					     inl_dev->chan_mask, false);
+			npc_mcam_set_channel(flow, req, inl_dev->channel, inl_dev->chan_mask,
+					     false);
 		} else if (npc->is_sdp_link) {
-			npc_mcam_set_channel(flow, req, npc->sdp_channel,
-					     npc->sdp_channel_mask,
+			npc_mcam_set_channel(flow, req, npc->sdp_channel, npc->sdp_channel_mask,
 					     pst->is_second_pass_rule);
 		} else {
-			npc_mcam_set_channel(flow, req, npc->channel,
-					     (BIT_ULL(12) - 1),
+			npc_mcam_set_channel(flow, req, npc->channel, (BIT_ULL(12) - 1),
 					     pst->is_second_pass_rule);
 		}
+		/*
+		 * For second pass rule, set LA LTYPE to CPT_HDR.
+		 * For all other rules, set LA LTYPE to match both 1st pass and 2nd pass ltypes.
+		 */
+		if (pst->is_second_pass_rule || (!pst->is_second_pass_rule && pst->has_eth_type)) {
+			la_offset = __builtin_popcount(npc->keyx_supp_nmask[flow->nix_intf] &
+						       ((1ULL << 9 /* LA offset */) - 1));
+			la_offset *= 4;
+
+			mask = ~((0xfULL << la_offset));
+			req->entry_data.kw[0] &= mask;
+			req->entry_data.kw_mask[0] &= mask;
+			flow->mcam_data[0] &= mask;
+			flow->mcam_mask[0] &= mask;
+			if (pst->is_second_pass_rule) {
+				req->entry_data.kw[0] |= ((uint64_t)NPC_LT_LA_CPT_HDR) << la_offset;
+				req->entry_data.kw_mask[0] |= (0xFULL << la_offset);
+				flow->mcam_data[0] |= ((uint64_t)NPC_LT_LA_CPT_HDR) << la_offset;
+				flow->mcam_mask[0] |= (0xFULL << la_offset);
+			} else {
+				/* Mask ltype ETHER (0x2) and CPT_HDR (0xa)  */
+				req->entry_data.kw[0] |= (0x2ULL << la_offset);
+				req->entry_data.kw_mask[0] |= (0x7ULL << la_offset);
+				flow->mcam_data[0] |= (0x2ULL << la_offset);
+				flow->mcam_mask[0] |= (0x7ULL << la_offset);
+			}
+		}
 	} else {
 		uint16_t pf_func = (flow->npc_action >> 4) & 0xffff;
 
diff --git a/drivers/common/cnxk/roc_npc_mcam_dump.c b/drivers/common/cnxk/roc_npc_mcam_dump.c
index fe57811a84..cc1599ef33 100644
--- a/drivers/common/cnxk/roc_npc_mcam_dump.c
+++ b/drivers/common/cnxk/roc_npc_mcam_dump.c
@@ -69,8 +69,10 @@ static const char *const ltype_str[NPC_MAX_LID][NPC_MAX_LT] = {
 	[NPC_LID_LA][NPC_LT_LA_IH_NIX_ETHER] = "LA_IH_NIX_ETHER",
 	[NPC_LID_LA][NPC_LT_LA_HIGIG2_ETHER] = "LA_HIGIG2_ETHER",
 	[NPC_LID_LA][NPC_LT_LA_IH_NIX_HIGIG2_ETHER] = "LA_IH_NIX_HIGIG2_ETHER",
-	[NPC_LID_LA][NPC_LT_LA_CUSTOM_PRE_L2_ETHER] =
-		"NPC_LT_LA_CUSTOM_PRE_L2_ETHER",
+	[NPC_LID_LA][NPC_LT_LA_CUSTOM_L2_90B_ETHER] = "LA_CUSTOM_L2_90B_ETHER",
+	[NPC_LID_LA][NPC_LT_LA_CPT_HDR] = "LA_CPT_HDR",
+	[NPC_LID_LA][NPC_LT_LA_CUSTOM_L2_24B_ETHER] = "LA_CUSTOM_L2_24B_ETHER",
+	[NPC_LID_LA][NPC_LT_LA_CUSTOM_PRE_L2_ETHER] = "NPC_LT_LA_CUSTOM_PRE_L2_ETHER",
 	[NPC_LID_LB][0] = "NONE",
 	[NPC_LID_LB][NPC_LT_LB_CTAG] = "LB_CTAG",
 	[NPC_LID_LB][NPC_LT_LB_STAG_QINQ] = "LB_STAG_QINQ",
diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index 670f920117..b92970e69b 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -193,6 +193,7 @@ npc_parse_la(struct npc_parse_state *pst)
 	if (pst->pattern->type != ROC_NPC_ITEM_TYPE_ETH)
 		return 0;
 
+	pst->has_eth_type = true;
 	eth_item = pst->pattern->spec;
 
 	lid = NPC_LID_LA;
diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
index f034f72a04..1de33932e7 100644
--- a/drivers/common/cnxk/roc_npc_priv.h
+++ b/drivers/common/cnxk/roc_npc_priv.h
@@ -199,6 +199,7 @@ struct npc_parse_state {
 	bool set_vlan_ltype_mask;
 	bool set_ipv6ext_ltype_mask;
 	bool is_second_pass_rule;
+	bool has_eth_type;
 };
 
 enum npc_kpu_parser_flag {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:38.882702000 +0800
+++ 0001-common-cnxk-fix-second-pass-flow-rule-layer-type.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From a0c837ad1fb5b6a8b10a284ffeb5f9e31bd8ff00 Mon Sep 17 00:00:00 2001
+From 4dc4547f2df57baae38b12246f5a0a732fbdd3ff Mon Sep 17 00:00:00 2001
@@ -3 +3 @@
-Date: Tue, 31 Jan 2023 09:06:52 +0530
+Date: Mon, 27 Feb 2023 15:07:17 +0530
@@ -4,0 +5 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -11,0 +13,2 @@
+[ upstream commit a0c837ad1fb5b6a8b10a284ffeb5f9e31bd8ff00 ]
+
@@ -13 +15,0 @@
-Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
@@ -15,3 +17,5 @@
- drivers/common/cnxk/roc_npc_mcam.c      | 24 +++++++++++++++++-------
- drivers/common/cnxk/roc_npc_mcam_dump.c |  6 ++++--
- 2 files changed, 21 insertions(+), 9 deletions(-)
+ drivers/common/cnxk/roc_npc_mcam.c      | 39 +++++++++++++++++++++----
+ drivers/common/cnxk/roc_npc_mcam_dump.c |  6 ++--
+ drivers/common/cnxk/roc_npc_parse.c     |  1 +
+ drivers/common/cnxk/roc_npc_priv.h      |  1 +
+ 4 files changed, 39 insertions(+), 8 deletions(-)
@@ -20 +24 @@
-index 312424d1c2..06f3212e8d 100644
+index ceb0a733f0..3bf35cdf48 100644
@@ -23,2 +27,26 @@
-@@ -668,22 +668,32 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
- 			npc_mcam_set_channel(flow, req, npc->channel, (BIT_ULL(12) - 1),
+@@ -551,6 +551,8 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
+ 	struct idev_cfg *idev;
+ 	uint16_t pf_func = 0;
+ 	uint16_t ctr = ~(0);
++	uint32_t la_offset;
++	uint64_t mask;
+ 	int rc, idx;
+ 	int entry;
+ 
+@@ -617,17 +619,42 @@ npc_mcam_alloc_and_write(struct npc *npc, struct roc_npc_flow *flow,
+ 			flow->npc_action &= ~(GENMASK(19, 4));
+ 			flow->npc_action |= (uint64_t)pf_func << 4;
+ 
+-			npc_mcam_set_channel(flow, req, inl_dev->channel,
+-					     inl_dev->chan_mask, false);
++			npc_mcam_set_channel(flow, req, inl_dev->channel, inl_dev->chan_mask,
++					     false);
+ 		} else if (npc->is_sdp_link) {
+-			npc_mcam_set_channel(flow, req, npc->sdp_channel,
+-					     npc->sdp_channel_mask,
++			npc_mcam_set_channel(flow, req, npc->sdp_channel, npc->sdp_channel_mask,
+ 					     pst->is_second_pass_rule);
+ 		} else {
+-			npc_mcam_set_channel(flow, req, npc->channel,
+-					     (BIT_ULL(12) - 1),
++			npc_mcam_set_channel(flow, req, npc->channel, (BIT_ULL(12) - 1),
@@ -27,2 +54,0 @@
--		/* Always match both 1st pass and 2nd pass ltypes for all rules */
--		if (!pst->is_second_pass_rule && pst->has_eth_type) {
@@ -34,14 +60,9 @@
- 			la_offset = __builtin_popcount(npc->keyx_supp_nmask[flow->nix_intf] &
- 						       ((1ULL << 9 /* LA offset */) - 1));
- 			la_offset *= 4;
- 
- 			mask = ~((0xfULL << la_offset));
--			/* Mask ltype ETHER (0x2) and CPT_HDR (0xa)  */
- 			req->entry_data.kw[0] &= mask;
- 			req->entry_data.kw_mask[0] &= mask;
--			req->entry_data.kw[0] |= (0x2ULL << la_offset);
--			req->entry_data.kw_mask[0] |= (0x7ULL << la_offset);
- 			flow->mcam_data[0] &= mask;
- 			flow->mcam_mask[0] &= mask;
--			flow->mcam_data[0] |= (0x2ULL << la_offset);
--			flow->mcam_mask[0] |= (0x7ULL << la_offset);
++			la_offset = __builtin_popcount(npc->keyx_supp_nmask[flow->nix_intf] &
++						       ((1ULL << 9 /* LA offset */) - 1));
++			la_offset *= 4;
++
++			mask = ~((0xfULL << la_offset));
++			req->entry_data.kw[0] &= mask;
++			req->entry_data.kw_mask[0] &= mask;
++			flow->mcam_data[0] &= mask;
++			flow->mcam_mask[0] &= mask;
@@ -60 +81 @@
- 		}
++		}
@@ -62,0 +84 @@
+ 
@@ -64 +86 @@
-index 2aaa2ac671..40909b45e6 100644
+index fe57811a84..cc1599ef33 100644
@@ -79,0 +102,24 @@
+diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
+index 670f920117..b92970e69b 100644
+--- a/drivers/common/cnxk/roc_npc_parse.c
++++ b/drivers/common/cnxk/roc_npc_parse.c
+@@ -193,6 +193,7 @@ npc_parse_la(struct npc_parse_state *pst)
+ 	if (pst->pattern->type != ROC_NPC_ITEM_TYPE_ETH)
+ 		return 0;
+ 
++	pst->has_eth_type = true;
+ 	eth_item = pst->pattern->spec;
+ 
+ 	lid = NPC_LID_LA;
+diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h
+index f034f72a04..1de33932e7 100644
+--- a/drivers/common/cnxk/roc_npc_priv.h
++++ b/drivers/common/cnxk/roc_npc_priv.h
+@@ -199,6 +199,7 @@ struct npc_parse_state {
+ 	bool set_vlan_ltype_mask;
+ 	bool set_ipv6ext_ltype_mask;
+ 	bool is_second_pass_rule;
++	bool has_eth_type;
+ };
+ 
+ enum npc_kpu_parser_flag {

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

* patch 'net/mlx5: fix crash on action template failure' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
  2023-04-09 15:23   ` patch 'common/cnxk: fix second pass flow rule layer type' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'eal/windows: fix pedantic build' " Xueming Li
                     ` (134 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Rongwei Liu; +Cc: Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/03299eb5d4384767d929ff3532663c43959181cc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 03299eb5d4384767d929ff3532663c43959181cc Mon Sep 17 00:00:00 2001
From: Rongwei Liu <rongweil@nvidia.com>
Date: Sat, 8 Apr 2023 21:21:05 +0800
Subject: [PATCH] net/mlx5: fix crash on action template failure
Cc: Xueming Li <xuemingl@nvidia.com>

When action template creation fails the testpmd expects error
details.
The driver did not set the error structure and testpmd failed with a
segmentation fault.

Fixes: 836b5c9b5e0e ("net/mlx5: add action template management")
Cc: stable@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 20c71ff7f0..2fe33bbef8 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4534,6 +4534,9 @@ error:
 			mlx5dr_action_template_destroy(at->tmpl);
 		mlx5_free(at);
 	}
+	rte_flow_error_set(error, rte_errno,
+			   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+			   "Failed to create action template");
 	return NULL;
 }
 
-- 
2.25.1


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

* patch 'eal/windows: fix pedantic build' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
  2023-04-09 15:23   ` patch 'common/cnxk: fix second pass flow rule layer type' " Xueming Li
  2023-04-09 15:23   ` patch 'net/mlx5: fix crash on action template failure' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'doc: add gpudev to the Doxygen index' " Xueming Li
                     ` (133 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/300d83b989758cd2f85c206b578d207072ce178e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 300d83b989758cd2f85c206b578d207072ce178e Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 5 Jan 2023 16:18:38 +0100
Subject: [PATCH] eal/windows: fix pedantic build
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b ]

MinGW GCC 12 shows an illegal pointer conversion
when included in a pedantic module:

lib/eal/windows/include/pthread.h:137:41: error:
	ISO C forbids conversion of object pointer to function pointer type
	[-Werror=pedantic]
 137 | hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
     |                                 ^

By using uintptr_t, the compiler is forced to accept the conversion.

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/windows/include/pthread.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h
index 27fd2cca52..f7cf0e9ddf 100644
--- a/lib/eal/windows/include/pthread.h
+++ b/lib/eal/windows/include/pthread.h
@@ -134,7 +134,8 @@ pthread_create(void *threadid, const void *threadattr, void *threadfunc,
 {
 	RTE_SET_USED(threadattr);
 	HANDLE hThread;
-	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
+	hThread = CreateThread(NULL, 0,
+		(LPTHREAD_START_ROUTINE)(uintptr_t)threadfunc,
 		args, 0, (LPDWORD)threadid);
 	if (hThread) {
 		SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:38.923433700 +0800
+++ 0003-eal-windows-fix-pedantic-build.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b Mon Sep 17 00:00:00 2001
+From 300d83b989758cd2f85c206b578d207072ce178e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4ef69b2877a24ddb89afaf4bb6f4e73bb52a605b ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

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

* patch 'doc: add gpudev to the Doxygen index' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (2 preceding siblings ...)
  2023-04-09 15:23   ` patch 'eal/windows: fix pedantic build' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'doc: fix reference to event timer header' " Xueming Li
                     ` (132 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/e806f0529d4e451dafc04451bbe489426e1661ae

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e806f0529d4e451dafc04451bbe489426e1661ae Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Wed, 1 Mar 2023 17:27:00 +0100
Subject: [PATCH] doc: add gpudev to the Doxygen index
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 79cd6f959ebc0886dd212dc4fb057ec2d91b2d39 ]

When introducing the library gpudev,
it has been forgotten to add a link in the API index.

Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/api/doxy-api-index.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index de488c7abf..bbca14be3d 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -22,6 +22,7 @@ The public API headers are grouped by topics:
   [compress](@ref rte_comp.h),
   [regexdev](@ref rte_regexdev.h),
   [dmadev](@ref rte_dmadev.h),
+  [gpudev](@ref rte_gpudev.h),
   [eventdev](@ref rte_eventdev.h),
   [event_eth_rx_adapter](@ref rte_event_eth_rx_adapter.h),
   [event_eth_tx_adapter](@ref rte_event_eth_tx_adapter.h),
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:38.947060100 +0800
+++ 0004-doc-add-gpudev-to-the-Doxygen-index.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From 79cd6f959ebc0886dd212dc4fb057ec2d91b2d39 Mon Sep 17 00:00:00 2001
+From e806f0529d4e451dafc04451bbe489426e1661ae Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 79cd6f959ebc0886dd212dc4fb057ec2d91b2d39 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 2deec7ea19..d6cd4d0861 100644
+index de488c7abf..bbca14be3d 100644

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

* patch 'doc: fix reference to event timer header' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (3 preceding siblings ...)
  2023-04-09 15:23   ` patch 'doc: add gpudev to the Doxygen index' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'event/cnxk: fix SSO cleanup' " Xueming Li
                     ` (131 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/0a3f30f07c526e6c4c0ef51c57d748bcb8440b61

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0a3f30f07c526e6c4c0ef51c57d748bcb8440b61 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 15:47:11 +0100
Subject: [PATCH] doc: fix reference to event timer header
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 ]

The event timer header is rte_event_timer_adapter.h.
Besides, we don't need to detail the full path to such a header.

Fixes: 30e7fbd62839 ("doc: add event timer adapter guide")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 doc/guides/prog_guide/event_timer_adapter.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/prog_guide/event_timer_adapter.rst b/doc/guides/prog_guide/event_timer_adapter.rst
index d7307a29bb..9106092f2d 100644
--- a/doc/guides/prog_guide/event_timer_adapter.rst
+++ b/doc/guides/prog_guide/event_timer_adapter.rst
@@ -35,7 +35,7 @@ device upon timer expiration.
 
 The Event Timer Adapter API represents each event timer with a generic struct,
 which contains an event and user metadata.  The ``rte_event_timer`` struct is
-defined in ``lib/event/librte_event_timer_adapter.h``.
+defined in ``rte_event_timer_adapter.h``.
 
 .. _timer_expiry_event:
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:38.969777800 +0800
+++ 0005-doc-fix-reference-to-event-timer-header.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 Mon Sep 17 00:00:00 2001
+From 0a3f30f07c526e6c4c0ef51c57d748bcb8440b61 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 72b0b4205a635f997d4a2ffcb1fabdc2de5b36d0 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 4e07f0cc23..2a15ed8f5c 100644
+index d7307a29bb..9106092f2d 100644

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

* patch 'event/cnxk: fix SSO cleanup' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (4 preceding siblings ...)
  2023-04-09 15:23   ` patch 'doc: fix reference to event timer header' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'eventdev: fix memory size for telemetry' " Xueming Li
                     ` (130 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/2f9bb3f72a14cae2ff3a37810411946b08762743

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2f9bb3f72a14cae2ff3a37810411946b08762743 Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Thu, 2 Mar 2023 11:58:32 +0100
Subject: [PATCH] event/cnxk: fix SSO cleanup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c31a3b37bb26c2f7f270592c8976072b510869dd ]

dev_fini() can return EAGAIN in case if LF is active(used by other
devices). Ignoring return code leads to early free of resources that are
still in use.

Fixes: 8558dcaa05b8 ("event/cnxk: add build infra and device setup")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 drivers/event/cnxk/cnxk_eventdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
index db62d32a81..db50d193a5 100644
--- a/drivers/event/cnxk/cnxk_eventdev.c
+++ b/drivers/event/cnxk/cnxk_eventdev.c
@@ -613,9 +613,8 @@ cnxk_sso_fini(struct rte_eventdev *event_dev)
 
 	cnxk_tim_fini();
 	roc_sso_rsrc_fini(&dev->sso);
-	roc_sso_dev_fini(&dev->sso);
 
-	return 0;
+	return roc_sso_dev_fini(&dev->sso);
 }
 
 int
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:38.993538500 +0800
+++ 0006-event-cnxk-fix-SSO-cleanup.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From c31a3b37bb26c2f7f270592c8976072b510869dd Mon Sep 17 00:00:00 2001
+From 2f9bb3f72a14cae2ff3a37810411946b08762743 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c31a3b37bb26c2f7f270592c8976072b510869dd ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 5f1fa1e96d..cb9ba5d353 100644
+index db62d32a81..db50d193a5 100644
@@ -22 +24 @@
-@@ -670,9 +670,8 @@ cnxk_sso_fini(struct rte_eventdev *event_dev)
+@@ -613,9 +613,8 @@ cnxk_sso_fini(struct rte_eventdev *event_dev)

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

* patch 'eventdev: fix memory size for telemetry' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (5 preceding siblings ...)
  2023-04-09 15:23   ` patch 'event/cnxk: fix SSO cleanup' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'baseband/acc: protect from TB negative scenario' " Xueming Li
                     ` (129 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Abdullah Sevincer; +Cc: Jerin Jacob, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/f76551552e977078105dcac0cb2e1c5dcaadec06

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f76551552e977078105dcac0cb2e1c5dcaadec06 Mon Sep 17 00:00:00 2001
From: Abdullah Sevincer <abdullah.sevincer@intel.com>
Date: Tue, 28 Feb 2023 15:31:23 -0600
Subject: [PATCH] eventdev: fix memory size for telemetry
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e0fb0051ff8f621a2b001d9243cebe50f3d42cf5 ]

Fix the invalid memory free operation caused by extending
xstats ID width from 32 to 64 bits.

Telemetry application crashed when freeing memory,
hence, the telemetry app could not display xstats.

Fixes: 1bdfe4d76e98 ("eventdev: increase xstats ID width to 64 bits")

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.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 b0414206d9..78336faa6a 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1678,7 +1678,7 @@ eventdev_build_telemetry_data(int dev_id,
 	if (xstat_names == NULL)
 		return -1;
 
-	ids = malloc((sizeof(unsigned int)) * num_xstats);
+	ids = malloc((sizeof(uint64_t)) * num_xstats);
 	if (ids == NULL) {
 		free(xstat_names);
 		return -1;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.015093800 +0800
+++ 0007-eventdev-fix-memory-size-for-telemetry.patch	2023-04-09 21:45:38.569042200 +0800
@@ -1 +1 @@
-From e0fb0051ff8f621a2b001d9243cebe50f3d42cf5 Mon Sep 17 00:00:00 2001
+From f76551552e977078105dcac0cb2e1c5dcaadec06 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e0fb0051ff8f621a2b001d9243cebe50f3d42cf5 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 71a29f3506..6ab4524332 100644
+index b0414206d9..78336faa6a 100644
@@ -25 +27 @@
-@@ -1725,7 +1725,7 @@ eventdev_build_telemetry_data(int dev_id,
+@@ -1678,7 +1678,7 @@ eventdev_build_telemetry_data(int dev_id,

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

* patch 'baseband/acc: protect from TB negative scenario' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (6 preceding siblings ...)
  2023-04-09 15:23   ` patch 'eventdev: fix memory size for telemetry' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'baseband/acc: add explicit mbuf append for soft output' " Xueming Li
                     ` (128 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/63797158c21f45dd60ea5b69d3ae91e1c6913e25

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 63797158c21f45dd60ea5b69d3ae91e1c6913e25 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Fri, 10 Feb 2023 17:58:33 +0000
Subject: [PATCH] baseband/acc: protect from TB negative scenario
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 68baaa839250a2a124143b34d4119f218c815d21 ]

Adding handling of negative scenario for malformed
Transport Block mode operations.

Fixes: bec597b78a0e ("baseband/acc200: add LTE processing")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc200_pmd.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
index c5123cfef0..fe4be5b42b 100644
--- a/drivers/baseband/acc/rte_acc200_pmd.c
+++ b/drivers/baseband/acc/rte_acc200_pmd.c
@@ -1848,6 +1848,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
 	r = op->turbo_enc.tb_params.r;
 
 	while (mbuf_total_left > 0 && r < c) {
+		if (unlikely((input == NULL) || (output == NULL)))
+			return -1;
+
 		seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
 		/* Set up DMA descriptor */
 		desc = acc_desc(q, total_enqueued_cbs);
@@ -1882,6 +1885,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
 		r++;
 	}
 
+	/* In case the number of CB doesn't match, the configuration was invalid. */
+	if (unlikely(current_enqueued_cbs != cbs_in_tb))
+		return -1;
+
 	/* Set SDone on last CB descriptor for TB mode. */
 	desc->req.sdone_enable = 1;
 
@@ -2128,6 +2135,9 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
 	}
 
 	while (mbuf_total_left > 0 && r < c) {
+		if (unlikely((input == NULL) || (h_output == NULL)))
+			return -1;
+
 		if (check_bit(op->ldpc_dec.op_flags, RTE_BBDEV_LDPC_DEC_SCATTER_GATHER))
 			seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
 		else
@@ -2173,6 +2183,10 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
 		r++;
 	}
 
+	/* In case the number of CB doesn't match, the configuration was invalid. */
+	if (unlikely(current_enqueued_cbs != cbs_in_tb))
+		return -1;
+
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	if (check_mbuf_total_left(mbuf_total_left) != 0)
 		return -EINVAL;
@@ -2215,6 +2229,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
 	r = op->turbo_dec.tb_params.r;
 
 	while (mbuf_total_left > 0 && r < c) {
+		if (unlikely((input == NULL) || (h_output == NULL)))
+			return -1;
 
 		seg_total_left = rte_pktmbuf_data_len(input) - in_offset;
 
@@ -2265,6 +2281,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
 		r++;
 	}
 
+	/* In case the number of CB doesn't match, the configuration was invalid. */
+	if (unlikely(current_enqueued_cbs != cbs_in_tb))
+		return -1;
+
 	/* Set SDone on last CB descriptor for TB mode */
 	desc->req.sdone_enable = 1;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.036946100 +0800
+++ 0008-baseband-acc-protect-from-TB-negative-scenario.patch	2023-04-09 21:45:38.579042200 +0800
@@ -1 +1 @@
-From 68baaa839250a2a124143b34d4119f218c815d21 Mon Sep 17 00:00:00 2001
+From 63797158c21f45dd60ea5b69d3ae91e1c6913e25 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 68baaa839250a2a124143b34d4119f218c815d21 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -15 +17 @@
- drivers/baseband/acc/rte_vrb_pmd.c | 20 ++++++++++++++++++++
+ drivers/baseband/acc/rte_acc200_pmd.c | 20 ++++++++++++++++++++
@@ -18,5 +20,5 @@
-diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
-index 34e42d1f6e..3afaea71a3 100644
---- a/drivers/baseband/acc/rte_vrb_pmd.c
-+++ b/drivers/baseband/acc/rte_vrb_pmd.c
-@@ -1820,6 +1820,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
+diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
+index c5123cfef0..fe4be5b42b 100644
+--- a/drivers/baseband/acc/rte_acc200_pmd.c
++++ b/drivers/baseband/acc/rte_acc200_pmd.c
+@@ -1848,6 +1848,9 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
@@ -32 +34 @@
-@@ -1854,6 +1857,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
+@@ -1882,6 +1885,10 @@ enqueue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op *op,
@@ -43 +45 @@
-@@ -2100,6 +2107,9 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
+@@ -2128,6 +2135,9 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
@@ -53 +55 @@
-@@ -2145,6 +2155,10 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
+@@ -2173,6 +2183,10 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
@@ -64 +66 @@
-@@ -2187,6 +2201,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
+@@ -2215,6 +2229,8 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
@@ -73 +75 @@
-@@ -2237,6 +2253,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
+@@ -2265,6 +2281,10 @@ enqueue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,

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

* patch 'baseband/acc: add explicit mbuf append for soft output' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (7 preceding siblings ...)
  2023-04-09 15:23   ` patch 'baseband/acc: protect from TB negative scenario' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'baseband/acc: prevent to dequeue more than requested' " Xueming Li
                     ` (127 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/6c9f6f15eef1868dc14f86c6581700dc126695e9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6c9f6f15eef1868dc14f86c6581700dc126695e9 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Fri, 10 Feb 2023 17:58:35 +0000
Subject: [PATCH] baseband/acc: add explicit mbuf append for soft output
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b040f9e874826479696c1b347d21b00bd4ec1754 ]

Adding an explicit mbuf append in the case of soft output
mbuf being provided.

Fixes: e640f6cdfa84 ("baseband/acc200: add LDPC processing")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc200_pmd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
index fe4be5b42b..0bec218ca4 100644
--- a/drivers/baseband/acc/rte_acc200_pmd.c
+++ b/drivers/baseband/acc/rte_acc200_pmd.c
@@ -2086,6 +2086,10 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
 		}
 	}
 
+	if (op->ldpc_dec.soft_output.length > 0)
+		mbuf_append(op->ldpc_dec.soft_output.data, op->ldpc_dec.soft_output.data,
+				op->ldpc_dec.soft_output.length);
+
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	rte_memdump(stderr, "FCW", &desc->req.fcw_ld,
 			sizeof(desc->req.fcw_ld) - 8);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.064936200 +0800
+++ 0009-baseband-acc-add-explicit-mbuf-append-for-soft-outpu.patch	2023-04-09 21:45:38.579042200 +0800
@@ -1 +1 @@
-From b040f9e874826479696c1b347d21b00bd4ec1754 Mon Sep 17 00:00:00 2001
+From 6c9f6f15eef1868dc14f86c6581700dc126695e9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b040f9e874826479696c1b347d21b00bd4ec1754 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -15 +17 @@
- drivers/baseband/acc/rte_vrb_pmd.c | 4 ++++
+ drivers/baseband/acc/rte_acc200_pmd.c | 4 ++++
@@ -18,5 +20,5 @@
-diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
-index fc68f47ca6..b1134f244d 100644
---- a/drivers/baseband/acc/rte_vrb_pmd.c
-+++ b/drivers/baseband/acc/rte_vrb_pmd.c
-@@ -2066,6 +2066,10 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
+diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
+index fe4be5b42b..0bec218ca4 100644
+--- a/drivers/baseband/acc/rte_acc200_pmd.c
++++ b/drivers/baseband/acc/rte_acc200_pmd.c
+@@ -2086,6 +2086,10 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,

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

* patch 'baseband/acc: prevent to dequeue more than requested' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (8 preceding siblings ...)
  2023-04-09 15:23   ` patch 'baseband/acc: add explicit mbuf append for soft output' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'baseband/acc: fix iteration counter in TB mode' " Xueming Li
                     ` (126 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ff4d7c9a71b3359135179e8f4a477c2a8b669478

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ff4d7c9a71b3359135179e8f4a477c2a8b669478 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Fri, 10 Feb 2023 17:58:36 +0000
Subject: [PATCH] baseband/acc: prevent to dequeue more than requested
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e76efc7303cd0d16e873533ffca2914f405b2651 ]

Add support for corner-case when more operations are
requested than expected, in the case of encoder muxing
operations.

Fixes: e640f6cdfa84 ("baseband/acc200: add LDPC processing")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc200_pmd.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
index 0bec218ca4..ee9a050d24 100644
--- a/drivers/baseband/acc/rte_acc200_pmd.c
+++ b/drivers/baseband/acc/rte_acc200_pmd.c
@@ -2660,7 +2660,8 @@ acc200_enqueue_ldpc_dec(struct rte_bbdev_queue_data *q_data,
 /* Dequeue one encode operations from ACC200 device in CB mode. */
 static inline int
 dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
-		uint16_t *dequeued_ops, uint32_t *aq_dequeued, uint16_t *dequeued_descs)
+		uint16_t *dequeued_ops, uint32_t *aq_dequeued, uint16_t *dequeued_descs,
+		uint16_t max_requested_ops)
 {
 	union acc_dma_desc *desc, atom_desc;
 	union acc_dma_rsp_desc rsp;
@@ -2673,6 +2674,9 @@ dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
 	desc = q->ring_addr + desc_idx;
 	atom_desc.atom_hdr = __atomic_load_n((uint64_t *)desc, __ATOMIC_RELAXED);
 
+	if (*dequeued_ops + desc->req.numCBs > max_requested_ops)
+		return -1;
+
 	/* Check fdone bit. */
 	if (!(atom_desc.rsp.val & ACC_FDONE))
 		return -1;
@@ -2714,7 +2718,7 @@ dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
 static inline int
 dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
 		uint16_t *dequeued_ops, uint32_t *aq_dequeued,
-		uint16_t *dequeued_descs)
+		uint16_t *dequeued_descs, uint16_t max_requested_ops)
 {
 	union acc_dma_desc *desc, *last_desc, atom_desc;
 	union acc_dma_rsp_desc rsp;
@@ -2725,6 +2729,9 @@ dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
 	desc = acc_desc_tail(q, *dequeued_descs);
 	atom_desc.atom_hdr = __atomic_load_n((uint64_t *)desc, __ATOMIC_RELAXED);
 
+	if (*dequeued_ops + 1 > max_requested_ops)
+		return -1;
+
 	/* Check fdone bit. */
 	if (!(atom_desc.rsp.val & ACC_FDONE))
 		return -1;
@@ -2985,25 +2992,23 @@ acc200_dequeue_enc(struct rte_bbdev_queue_data *q_data,
 
 	cbm = op->turbo_enc.code_block_mode;
 
-	for (i = 0; i < num; i++) {
+	for (i = 0; i < avail; i++) {
 		if (cbm == RTE_BBDEV_TRANSPORT_BLOCK)
 			ret = dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
 					&dequeued_ops, &aq_dequeued,
-					&dequeued_descs);
+					&dequeued_descs, num);
 		else
 			ret = dequeue_enc_one_op_cb(q, &ops[dequeued_ops],
 					&dequeued_ops, &aq_dequeued,
-					&dequeued_descs);
+					&dequeued_descs, num);
 		if (ret < 0)
 			break;
-		if (dequeued_ops >= num)
-			break;
 	}
 
 	q->aq_dequeued += aq_dequeued;
 	q->sw_ring_tail += dequeued_descs;
 
-	/* Update enqueue stats */
+	/* Update enqueue stats. */
 	q_data->queue_stats.dequeued_count += dequeued_ops;
 
 	return dequeued_ops;
@@ -3029,15 +3034,13 @@ acc200_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
 		if (cbm == RTE_BBDEV_TRANSPORT_BLOCK)
 			ret = dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
 					&dequeued_ops, &aq_dequeued,
-					&dequeued_descs);
+					&dequeued_descs, num);
 		else
 			ret = dequeue_enc_one_op_cb(q, &ops[dequeued_ops],
 					&dequeued_ops, &aq_dequeued,
-					&dequeued_descs);
+					&dequeued_descs, num);
 		if (ret < 0)
 			break;
-		if (dequeued_ops >= num)
-			break;
 	}
 
 	q->aq_dequeued += aq_dequeued;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.091780900 +0800
+++ 0010-baseband-acc-prevent-to-dequeue-more-than-requested.patch	2023-04-09 21:45:38.579042200 +0800
@@ -1 +1 @@
-From e76efc7303cd0d16e873533ffca2914f405b2651 Mon Sep 17 00:00:00 2001
+From ff4d7c9a71b3359135179e8f4a477c2a8b669478 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e76efc7303cd0d16e873533ffca2914f405b2651 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -16 +18 @@
- drivers/baseband/acc/rte_vrb_pmd.c | 27 +++++++++++++++------------
+ drivers/baseband/acc/rte_acc200_pmd.c | 27 +++++++++++++++------------
@@ -19,6 +21,6 @@
-diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
-index b1134f244d..a7d0b1e33c 100644
---- a/drivers/baseband/acc/rte_vrb_pmd.c
-+++ b/drivers/baseband/acc/rte_vrb_pmd.c
-@@ -2640,7 +2640,8 @@ vrb_enqueue_ldpc_dec(struct rte_bbdev_queue_data *q_data,
- /* Dequeue one encode operations from device in CB mode. */
+diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
+index 0bec218ca4..ee9a050d24 100644
+--- a/drivers/baseband/acc/rte_acc200_pmd.c
++++ b/drivers/baseband/acc/rte_acc200_pmd.c
+@@ -2660,7 +2660,8 @@ acc200_enqueue_ldpc_dec(struct rte_bbdev_queue_data *q_data,
+ /* Dequeue one encode operations from ACC200 device in CB mode. */
@@ -26 +28 @@
- vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
+ dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
@@ -33 +35 @@
-@@ -2653,6 +2654,9 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
+@@ -2673,6 +2674,9 @@ dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
@@ -43 +45 @@
-@@ -2694,7 +2698,7 @@ vrb_dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
+@@ -2714,7 +2718,7 @@ dequeue_enc_one_op_cb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
@@ -45 +47 @@
- vrb_dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
+ dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
@@ -52 +54 @@
-@@ -2705,6 +2709,9 @@ vrb_dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
+@@ -2725,6 +2729,9 @@ dequeue_enc_one_op_tb(struct acc_queue *q, struct rte_bbdev_enc_op **ref_op,
@@ -62 +64 @@
-@@ -2965,25 +2972,23 @@ vrb_dequeue_enc(struct rte_bbdev_queue_data *q_data,
+@@ -2985,25 +2992,23 @@ acc200_dequeue_enc(struct rte_bbdev_queue_data *q_data,
@@ -69 +71 @@
- 			ret = vrb_dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
+ 			ret = dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
@@ -74 +76 @@
- 			ret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops],
+ 			ret = dequeue_enc_one_op_cb(q, &ops[dequeued_ops],
@@ -92 +94 @@
-@@ -3009,15 +3014,13 @@ vrb_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
+@@ -3029,15 +3034,13 @@ acc200_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
@@ -94 +96 @@
- 			ret = vrb_dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
+ 			ret = dequeue_enc_one_op_tb(q, &ops[dequeued_ops],
@@ -99 +101 @@
- 			ret = vrb_dequeue_enc_one_op_cb(q, &ops[dequeued_ops],
+ 			ret = dequeue_enc_one_op_cb(q, &ops[dequeued_ops],

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

* patch 'baseband/acc: fix iteration counter in TB mode' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (9 preceding siblings ...)
  2023-04-09 15:23   ` patch 'baseband/acc: prevent to dequeue more than requested' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'baseband/acc: fix check after deref and dead code' " Xueming Li
                     ` (125 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/bf521b9f8028426ceba43479b18e8791e8c7b062

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bf521b9f8028426ceba43479b18e8791e8c7b062 Mon Sep 17 00:00:00 2001
From: Nicolas Chautru <nicolas.chautru@intel.com>
Date: Fri, 10 Feb 2023 17:58:37 +0000
Subject: [PATCH] baseband/acc: fix iteration counter in TB mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ef5b556d58a40517e4088481dee71c545ad465ac ]

The iteration count was not using correct structure (4G vs 5G)
in TB mode.

Fixes: bec597b78a0e ("baseband/acc200: add LTE processing")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc200_pmd.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
index ee9a050d24..b25a83a588 100644
--- a/drivers/baseband/acc/rte_acc200_pmd.c
+++ b/drivers/baseband/acc/rte_acc200_pmd.c
@@ -2895,7 +2895,7 @@ dequeue_ldpc_dec_one_op_cb(struct rte_bbdev_queue_data *q_data,
 	return 1;
 }
 
-/* Dequeue one decode operations from ACC200 device in TB mode. */
+/* Dequeue one decode operations from device in TB mode for 4G or 5G. */
 static inline int
 dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
 		uint16_t dequeued_cbs, uint32_t *aq_dequeued)
@@ -2949,8 +2949,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
 		/* CRC invalid if error exists. */
 		if (!op->status)
 			op->status |= rsp.crc_status << RTE_BBDEV_CRC_ERROR;
-		op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
-				op->turbo_dec.iter_count);
+		if (q->op_type == RTE_BBDEV_OP_LDPC_DEC)
+			op->ldpc_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->ldpc_dec.iter_count);
+		else
+			op->turbo_dec.iter_count = RTE_MAX((uint8_t) rsp.iter_cnt,
+					op->turbo_dec.iter_count);
 
 		/* Check if this is the last desc in batch (Atomic Queue). */
 		if (desc->req.last_desc_in_batch) {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.121163100 +0800
+++ 0011-baseband-acc-fix-iteration-counter-in-TB-mode.patch	2023-04-09 21:45:38.579042200 +0800
@@ -1 +1 @@
-From ef5b556d58a40517e4088481dee71c545ad465ac Mon Sep 17 00:00:00 2001
+From bf521b9f8028426ceba43479b18e8791e8c7b062 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ef5b556d58a40517e4088481dee71c545ad465ac ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -15 +17 @@
- drivers/baseband/acc/rte_vrb_pmd.c | 10 +++++++---
+ drivers/baseband/acc/rte_acc200_pmd.c | 10 +++++++---
@@ -18,5 +20,5 @@
-diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
-index a7d0b1e33c..ccd3adaf93 100644
---- a/drivers/baseband/acc/rte_vrb_pmd.c
-+++ b/drivers/baseband/acc/rte_vrb_pmd.c
-@@ -2875,7 +2875,7 @@ vrb_dequeue_ldpc_dec_one_op_cb(struct rte_bbdev_queue_data *q_data,
+diff --git a/drivers/baseband/acc/rte_acc200_pmd.c b/drivers/baseband/acc/rte_acc200_pmd.c
+index ee9a050d24..b25a83a588 100644
+--- a/drivers/baseband/acc/rte_acc200_pmd.c
++++ b/drivers/baseband/acc/rte_acc200_pmd.c
+@@ -2895,7 +2895,7 @@ dequeue_ldpc_dec_one_op_cb(struct rte_bbdev_queue_data *q_data,
@@ -26 +28 @@
--/* Dequeue one decode operations from device in TB mode. */
+-/* Dequeue one decode operations from ACC200 device in TB mode. */
@@ -29 +31 @@
- vrb_dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
+ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
@@ -31 +33 @@
-@@ -2929,8 +2929,12 @@ vrb_dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,
+@@ -2949,8 +2949,12 @@ dequeue_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op **ref_op,

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

* patch 'baseband/acc: fix check after deref and dead code' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (10 preceding siblings ...)
  2023-04-09 15:23   ` patch 'baseband/acc: fix iteration counter in TB mode' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'test/bbdev: fix crash for non supported HARQ length' " Xueming Li
                     ` (124 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/4bdaf5003136cbd9105fc53062924f2a2d72ab81

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4bdaf5003136cbd9105fc53062924f2a2d72ab81 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Wed, 22 Feb 2023 08:40:41 -0800
Subject: [PATCH] baseband/acc: fix check after deref and dead code
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 01eac6204617cdc60b67934a627dbf0b9b2d5e0f ]

Fix potential issue of dereferencing a pointer before null check.
Remove null check for value that could never be null.

Coverity issue: 381646, 381631
Fixes: 989dec301a98 ("baseband/acc100: add ring companion address")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/baseband/acc/rte_acc100_pmd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 1ca95f4440..7757db81fe 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -4124,8 +4124,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
 	struct rte_bbdev_enc_op *op;
 	union acc_dma_desc *desc;
 
-	if (q == NULL)
-		return 0;
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	if (unlikely(ops == 0))
 		return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.149745400 +0800
+++ 0012-baseband-acc-fix-check-after-deref-and-dead-code.patch	2023-04-09 21:45:38.589042200 +0800
@@ -1 +1 @@
-From 01eac6204617cdc60b67934a627dbf0b9b2d5e0f Mon Sep 17 00:00:00 2001
+From 4bdaf5003136cbd9105fc53062924f2a2d72ab81 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 01eac6204617cdc60b67934a627dbf0b9b2d5e0f ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 40b5eaf089..e485381a3f 100644
+index 1ca95f4440..7757db81fe 100644
@@ -23,2 +25 @@
-@@ -4106,8 +4106,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
- 	int ret, cbm;
+@@ -4124,8 +4124,6 @@ acc100_dequeue_ldpc_enc(struct rte_bbdev_queue_data *q_data,
@@ -25,0 +27 @@
+ 	union acc_dma_desc *desc;

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

* patch 'test/bbdev: fix crash for non supported HARQ length' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (11 preceding siblings ...)
  2023-04-09 15:23   ` patch 'baseband/acc: fix check after deref and dead code' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'test/bbdev: extend HARQ tolerance' " Xueming Li
                     ` (123 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/cdfa1794a622bb5d40bfeff1f95b8c53ef941517

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cdfa1794a622bb5d40bfeff1f95b8c53ef941517 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:55 -0800
Subject: [PATCH] test/bbdev: fix crash for non supported HARQ length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bee9ac50e5da1f573dfb3c647687da15326d7c3e ]

Fix segmentation fault happening in corner case in test-bbdev.
This fault could happen when running some specific vectors which size
are not supported by the PMD.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index e001074861..0c32e366a3 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -84,7 +84,7 @@
 /* Increment for next code block in external HARQ memory */
 #define HARQ_INCR 32768
 /* Headroom for filler LLRs insertion in HARQ buffer */
-#define FILLER_HEADROOM 1024
+#define FILLER_HEADROOM 2048
 /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
 #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
 #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
@@ -2113,9 +2113,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 					ops_ld->n_filler;
 			if (data_len > deRmOutSize)
 				data_len = deRmOutSize;
-			if (data_len > orig_op->segments[i].length)
-				data_len = orig_op->segments[i].length;
 		}
+		if (data_len > orig_op->segments[i].length)
+			data_len = orig_op->segments[i].length;
 		/*
 		 * HARQ output can have minor differences
 		 * due to integer representation and related scaling
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.173545600 +0800
+++ 0013-test-bbdev-fix-crash-for-non-supported-HARQ-length.patch	2023-04-09 21:45:38.589042200 +0800
@@ -1 +1 @@
-From bee9ac50e5da1f573dfb3c647687da15326d7c3e Mon Sep 17 00:00:00 2001
+From cdfa1794a622bb5d40bfeff1f95b8c53ef941517 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bee9ac50e5da1f573dfb3c647687da15326d7c3e ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 45e1780df7..027f32cbf1 100644
+index e001074861..0c32e366a3 100644
@@ -32 +34 @@
-@@ -2111,9 +2111,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -2113,9 +2113,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,

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

* patch 'test/bbdev: extend HARQ tolerance' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (12 preceding siblings ...)
  2023-04-09 15:23   ` patch 'test/bbdev: fix crash for non supported HARQ length' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'test/bbdev: remove check for invalid opaque data' " Xueming Li
                     ` (122 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dccdf95daad1116c2c53a82832526b09dd68bc95

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dccdf95daad1116c2c53a82832526b09dd68bc95 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:56 -0800
Subject: [PATCH] test/bbdev: extend HARQ tolerance
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 39b601c462b8192b8f1c98fe26b604430ebcc8e4 ]

HARQ memory implementation could have different size assumptions.
Extending HARQ tolerance to cover different implementations.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 0c32e366a3..2f15bf6fe8 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -95,6 +95,7 @@
 #define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
 #define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
 
+#define HARQ_MEM_TOLERANCE 256
 static struct test_bbdev_vector test_vector;
 
 /* Switch between PMD and Interrupt for throughput TC */
@@ -2092,13 +2093,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
 		total_data_size += orig_op->segments[i].length;
 
-		TEST_ASSERT(orig_op->segments[i].length <
-				(uint32_t)(data_len + 64),
+		TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
 				"Length of segment differ in original (%u) and filled (%u) op",
 				orig_op->segments[i].length, data_len);
 		harq_orig = (int8_t *) orig_op->segments[i].addr;
 		harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
 
+		/* Cannot compare HARQ output data for such cases */
+		if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
+				|| (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
+			break;
+
 		if (!(ldpc_cap_flags &
 				RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
 				) || (ops_ld->op_flags &
@@ -2174,7 +2179,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 
 	/* Validate total mbuf pkt length */
 	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
-	TEST_ASSERT(total_data_size < pkt_len + 64,
+	TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
 			"Length of data differ in original (%u) and filled (%u) op",
 			total_data_size, pkt_len);
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.199604600 +0800
+++ 0014-test-bbdev-extend-HARQ-tolerance.patch	2023-04-09 21:45:38.589042200 +0800
@@ -1 +1 @@
-From 39b601c462b8192b8f1c98fe26b604430ebcc8e4 Mon Sep 17 00:00:00 2001
+From dccdf95daad1116c2c53a82832526b09dd68bc95 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 39b601c462b8192b8f1c98fe26b604430ebcc8e4 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 027f32cbf1..74e7e13940 100644
+index 0c32e366a3..2f15bf6fe8 100644
@@ -30 +32 @@
-@@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -2092,13 +2093,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
@@ -50 +52 @@
-@@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
+@@ -2174,7 +2179,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,

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

* patch 'test/bbdev: remove check for invalid opaque data' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (13 preceding siblings ...)
  2023-04-09 15:23   ` patch 'test/bbdev: extend HARQ tolerance' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'vhost: fix slot index in async split virtqueue Tx' " Xueming Li
                     ` (121 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/47cef6560020c12c8c8dbba4b97df4fcda5a69ed

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 47cef6560020c12c8c8dbba4b97df4fcda5a69ed Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Thu, 2 Mar 2023 12:21:57 -0800
Subject: [PATCH] test/bbdev: remove check for invalid opaque data
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 26437807ff57a13133d4c03d87c5eac037f1ffaa ]

Assert also if the opaque data is invalid.

Fixes: 335c11fd2763 ("app/bbdev: support HARQ validation")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 2f15bf6fe8..0f441ace4d 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -78,7 +78,6 @@
 
 #define SYNC_WAIT 0
 #define SYNC_START 1
-#define INVALID_OPAQUE -1
 
 #define INVALID_QUEUE_ID -1
 /* Increment for next code block in external HARQ memory */
@@ -1953,10 +1952,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
 			"op_status (%d) != expected_status (%d)",
 			op->status, expected_status);
 
-	if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
-		TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
-				"Ordering error, expected %p, got %p",
-				(void *)(uintptr_t)order_idx, op->opaque_data);
+	TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
+			"Ordering error, expected %p, got %p",
+			(void *)(uintptr_t)order_idx, op->opaque_data);
 
 	return TEST_SUCCESS;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.222437900 +0800
+++ 0015-test-bbdev-remove-check-for-invalid-opaque-data.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From 26437807ff57a13133d4c03d87c5eac037f1ffaa Mon Sep 17 00:00:00 2001
+From 47cef6560020c12c8c8dbba4b97df4fcda5a69ed Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 26437807ff57a13133d4c03d87c5eac037f1ffaa ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 74e7e13940..95d63a3548 100644
+index 2f15bf6fe8..0f441ace4d 100644
@@ -29 +31 @@
-@@ -1951,10 +1950,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
+@@ -1953,10 +1952,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,

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

* patch 'vhost: fix slot index in async split virtqueue Tx' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (14 preceding siblings ...)
  2023-04-09 15:23   ` patch 'test/bbdev: remove check for invalid opaque data' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'vhost: fix OOB access for invalid vhost ID' " Xueming Li
                     ` (120 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Cheng Jiang; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/a6d0c8f6aa03e6d60e416bd2301cc877fb976860

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a6d0c8f6aa03e6d60e416bd2301cc877fb976860 Mon Sep 17 00:00:00 2001
From: Cheng Jiang <cheng1.jiang@intel.com>
Date: Thu, 23 Feb 2023 02:30:32 +0000
Subject: [PATCH] vhost: fix slot index in async split virtqueue Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit baac7d2c41823060b06b8ceddb76f5cfbd17aa51 ]

The slot_idx in the asynchronous Vhost split virtqueue dequeue data path
is supposed to be decreased by 1 when desc_to_mbuf() fails.

Fixes: 84d5204310d7 ("vhost: support async dequeue for split ring")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/virtio_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index a3dbf8cb10..26f184f8b2 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -3476,6 +3476,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
 				allocerr_warned = true;
 			}
 			dropped = true;
+			slot_idx--;
 			break;
 		}
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.247944400 +0800
+++ 0016-vhost-fix-slot-index-in-async-split-virtqueue-Tx.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From baac7d2c41823060b06b8ceddb76f5cfbd17aa51 Mon Sep 17 00:00:00 2001
+From a6d0c8f6aa03e6d60e416bd2301cc877fb976860 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit baac7d2c41823060b06b8ceddb76f5cfbd17aa51 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 51dc3c96d3..be28ea5151 100644
+index a3dbf8cb10..26f184f8b2 100644
@@ -22 +24 @@
-@@ -3783,6 +3783,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
+@@ -3476,6 +3476,7 @@ virtio_dev_tx_async_split(struct virtio_net *dev, struct vhost_virtqueue *vq,

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

* patch 'vhost: fix OOB access for invalid vhost ID' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (15 preceding siblings ...)
  2023-04-09 15:23   ` patch 'vhost: fix slot index in async split virtqueue Tx' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/virtio: deduce IP length for TSO checksum' " Xueming Li
                     ` (119 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/950227315bb4f0266a36bc920c141f36e17a092d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 950227315bb4f0266a36bc920c141f36e17a092d Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 27 Feb 2023 11:59:27 +0100
Subject: [PATCH] vhost: fix OOB access for invalid vhost ID
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]

The net/vhost pmd currently provides a -1 vid when disabling interrupt
after a virtio port got disconnected.

This can be caught when running with ASan.

First, start dpdk-l3fwd-power in interrupt mode with a net/vhost port.

$ ./build-clang/examples/dpdk-l3fwd-power -l0,1 --in-memory \
	-a 0000:00:00.0 \
	--vdev net_vhost0,iface=plop.sock,client=1\
	-- \
	-p 0x1 \
	--interrupt-only \
	--config '(0,0,1)' \
	--parse-ptype 0

Then start testpmd with virtio-user.

$ ./build-clang/app/dpdk-testpmd -l0,2 --single-file-segment --in-memory \
	-a 0000:00:00.0 \
	--vdev net_virtio_user0,path=plop.sock,server=1 \
	-- \
	-i

Finally stop testpmd.
ASan then splats in dpdk-l3fwd-power:

=================================================================
==3641005==ERROR: AddressSanitizer: global-buffer-overflow on address
	0x000005ed0778 at pc 0x000001270f81 bp 0x7fddbd2eee20
	sp 0x7fddbd2eee18
READ of size 8 at 0x000005ed0778 thread T2
    #0 0x1270f80 in get_device .../lib/vhost/vhost.h:801:27
    #1 0x1270f80 in rte_vhost_get_vhost_vring .../lib/vhost/vhost.c:951:8
    #2 0x3ac95cb in eth_rxq_intr_disable
	.../drivers/net/vhost/rte_eth_vhost.c:647:8
    #3 0x170e0bf in rte_eth_dev_rx_intr_disable
	.../lib/ethdev/rte_ethdev.c:5443:25
    #4 0xf72ba7 in turn_on_off_intr .../examples/l3fwd-power/main.c:881:4
    #5 0xf71045 in main_intr_loop .../examples/l3fwd-power/main.c:1061:6
    #6 0x17f9292 in eal_thread_loop
	.../lib/eal/common/eal_common_thread.c:210:9
    #7 0x18373f5 in eal_worker_thread_loop .../lib/eal/linux/eal.c:915:2
    #8 0x7fddc16ae12c in start_thread (/lib64/libc.so.6+0x8b12c)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)
    #9 0x7fddc172fbbf in __GI___clone3 (/lib64/libc.so.6+0x10cbbf)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

0x000005ed0778 is located 8 bytes to the left of global variable
	'vhost_devices' defined in '.../lib/vhost/vhost.c:24'
	(0x5ed0780) of size 8192
0x000005ed0778 is located 20 bytes to the right of global variable
	'vhost_config_log_level' defined in '.../lib/vhost/vhost.c:2174'
	(0x5ed0760) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow
	.../lib/vhost/vhost.h:801:27 in get_device
Shadow bytes around the buggy address:
  0x000080bd2090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x000080bd20b0: f9 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9 00 f9 f9 f9
  0x000080bd20c0: 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x000080bd20d0: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
=>0x000080bd20e0: 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 04 f9 f9[f9]
  0x000080bd20f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080bd2130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T2 created by T0 here:
    #0 0xe98996 in __interceptor_pthread_create
	(.examples/dpdk-l3fwd-power+0xe98996)
	(BuildId: d0b984a3b0287b9e0f301b73426fa921aeecca3a)
    #1 0x1836767 in eal_worker_thread_create .../lib/eal/linux/eal.c:952:6
    #2 0x1834b83 in rte_eal_init .../lib/eal/linux/eal.c:1257:9
    #3 0xf68902 in main .../examples/l3fwd-power/main.c:2496:8
    #4 0x7fddc164a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)
	(BuildId: 81daba31ee66dbd63efdc4252a872949d874d136)

==3641005==ABORTING

More generally, any application passing an incorrect vid would trigger
such an OOB access.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/vhost.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index ef211ed519..0fd6f4bbf4 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -782,7 +782,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
 static __rte_always_inline struct virtio_net *
 get_device(int vid)
 {
-	struct virtio_net *dev = vhost_devices[vid];
+	struct virtio_net *dev = NULL;
+
+	if (likely(vid >= 0 && vid < RTE_MAX_VHOST_DEVICE))
+		dev = vhost_devices[vid];
 
 	if (unlikely(!dev)) {
 		VHOST_LOG_CONFIG("device", ERR, "(%d) device not found.\n", vid);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.271481900 +0800
+++ 0017-vhost-fix-OOB-access-for-invalid-vhost-ID.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 Mon Sep 17 00:00:00 2001
+From 950227315bb4f0266a36bc920c141f36e17a092d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1c80a404fd82b816d5c3ebb7cd9e89804ac63984 ]
@@ -109 +111,0 @@
-Cc: stable@dpdk.org
@@ -118 +120 @@
-index 5750f0c005..954c0ac197 100644
+index ef211ed519..0fd6f4bbf4 100644
@@ -121 +123 @@
-@@ -798,7 +798,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)
+@@ -782,7 +782,10 @@ hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len)

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

* patch 'net/virtio: deduce IP length for TSO checksum' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (16 preceding siblings ...)
  2023-04-09 15:23   ` patch 'vhost: fix OOB access for invalid vhost ID' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/ipsec-secgw: fix auth IV length' " Xueming Li
                     ` (118 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Boleslav Stankevich; +Cc: Andrew Rybchenko, Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/33f3ef50211ece8b98055cf1ac61a3bcd21a26a5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 33f3ef50211ece8b98055cf1ac61a3bcd21a26a5 Mon Sep 17 00:00:00 2001
From: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
Date: Fri, 3 Mar 2023 14:19:29 +0300
Subject: [PATCH] net/virtio: deduce IP length for TSO checksum
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d069c80a5d8c0a05033932421851cdb7159de0df ]

The length of TSO payload could not fit into 16 bits provided by the
IPv4 total length and IPv6 payload length fields. Thus, deduce it
from the length of the packet.

Fixes: 696573046e9e ("net/virtio: support TSO")

Signed-off-by: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 .mailmap                         |  1 +
 drivers/net/virtio/virtio_rxtx.c | 25 ++++++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/.mailmap b/.mailmap
index 42a169ca18..8b0904d938 100644
--- a/.mailmap
+++ b/.mailmap
@@ -167,6 +167,7 @@ Bin Huang <brian.huangbin@huawei.com> <bin.huang@hxt-semitech.com>
 Bin Zheng <zhengbin.89740@bytedance.com>
 Björn Töpel <bjorn.topel@intel.com>
 Bo Chen <box.c.chen@intel.com>
+Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
 Boon Ang <bang@vmware.com>
 Boris Pismenny <borisp@mellanox.com>
 Brandon Lo <blo@iol.unh.edu>
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index d9d40832e0..c3e686cf0c 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -404,29 +404,36 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
 	if (likely(rte_pktmbuf_data_len(m) >= m->l2_len + m->l3_len +
 			m->l4_len)) {
 		struct rte_ipv4_hdr *iph;
-		struct rte_ipv6_hdr *ip6h;
 		struct rte_tcp_hdr *th;
-		uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;
+		uint16_t prev_cksum, new_cksum;
+		uint32_t ip_paylen;
 		uint32_t tmp;
 
 		iph = rte_pktmbuf_mtod_offset(m,
 					struct rte_ipv4_hdr *, m->l2_len);
 		th = RTE_PTR_ADD(iph, m->l3_len);
+
+		/*
+		 * Calculate IPv4 header checksum with current total length value
+		 * (whatever it is) to have correct checksum after update on edits
+		 * done by TSO.
+		 */
 		if ((iph->version_ihl >> 4) == 4) {
 			iph->hdr_checksum = 0;
 			iph->hdr_checksum = rte_ipv4_cksum(iph);
-			ip_len = iph->total_length;
-			ip_paylen = rte_cpu_to_be_16(rte_be_to_cpu_16(ip_len) -
-				m->l3_len);
-		} else {
-			ip6h = (struct rte_ipv6_hdr *)iph;
-			ip_paylen = ip6h->payload_len;
 		}
 
+		/*
+		 * Do not use IPv4 total length and IPv6 payload length fields to get
+		 * TSO payload length since it could not fit into 16 bits.
+		 */
+		ip_paylen = rte_cpu_to_be_32(rte_pktmbuf_pkt_len(m) - m->l2_len -
+					m->l3_len);
+
 		/* calculate the new phdr checksum not including ip_paylen */
 		prev_cksum = th->cksum;
 		tmp = prev_cksum;
-		tmp += ip_paylen;
+		tmp += (ip_paylen & 0xffff) + (ip_paylen >> 16);
 		tmp = (tmp & 0xffff) + (tmp >> 16);
 		new_cksum = tmp;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.295518200 +0800
+++ 0018-net-virtio-deduce-IP-length-for-TSO-checksum.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From d069c80a5d8c0a05033932421851cdb7159de0df Mon Sep 17 00:00:00 2001
+From 33f3ef50211ece8b98055cf1ac61a3bcd21a26a5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d069c80a5d8c0a05033932421851cdb7159de0df ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index a9f4f28fba..8e7d78f37e 100644
+index 42a169ca18..8b0904d938 100644
@@ -34 +36 @@
-index 2d0afd3302..e48ff3cca7 100644
+index d9d40832e0..c3e686cf0c 100644

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

* patch 'examples/ipsec-secgw: fix auth IV length' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (17 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/virtio: deduce IP length for TSO checksum' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'compress/mlx5: fix decompress xform validation' " Xueming Li
                     ` (117 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/2bf416240dcf596528ab3c25289de66fc58a7b70

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2bf416240dcf596528ab3c25289de66fc58a7b70 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil@marvell.com>
Date: Thu, 16 Feb 2023 19:54:40 +0530
Subject: [PATCH] examples/ipsec-secgw: fix auth IV length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 56af18587ef8beace28de1054643752922f7a696 ]

Currently, cipher IV length is getting used to set auth
xform IV length. Auth IV is needed for AES-GMAC case,
and in all other cases, auth IV should be 0.
Used a separate auth IV length to separate out cipher and auth cases.

Fixes: 9413c3901f31 ("examples/ipsec-secgw: support additional algorithms")

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 examples/ipsec-secgw/sa.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 7da9444a7b..001762bea9 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1247,6 +1247,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
 	struct ipsec_sa *sa;
 	uint32_t i, idx;
 	uint16_t iv_length, aad_length;
+	uint16_t auth_iv_length = 0;
 	int inline_status;
 	int32_t rc;
 	struct rte_ipsec_session *ips;
@@ -1340,7 +1341,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
 
 			/* AES_GMAC uses salt like AEAD algorithms */
 			if (sa->auth_algo == RTE_CRYPTO_AUTH_AES_GMAC)
-				iv_length = 12;
+				auth_iv_length = 12;
 
 			if (inbound) {
 				sa_ctx->xf[idx].b.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -1364,7 +1365,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
 				sa_ctx->xf[idx].a.auth.op =
 					RTE_CRYPTO_AUTH_OP_VERIFY;
 				sa_ctx->xf[idx].a.auth.iv.offset = IV_OFFSET;
-				sa_ctx->xf[idx].a.auth.iv.length = iv_length;
+				sa_ctx->xf[idx].a.auth.iv.length = auth_iv_length;
 
 			} else { /* outbound */
 				sa_ctx->xf[idx].a.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -1388,7 +1389,7 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[],
 				sa_ctx->xf[idx].b.auth.op =
 					RTE_CRYPTO_AUTH_OP_GENERATE;
 				sa_ctx->xf[idx].b.auth.iv.offset = IV_OFFSET;
-				sa_ctx->xf[idx].b.auth.iv.length = iv_length;
+				sa_ctx->xf[idx].b.auth.iv.length = auth_iv_length;
 
 			}
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.319196300 +0800
+++ 0019-examples-ipsec-secgw-fix-auth-IV-length.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From 56af18587ef8beace28de1054643752922f7a696 Mon Sep 17 00:00:00 2001
+From 2bf416240dcf596528ab3c25289de66fc58a7b70 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 56af18587ef8beace28de1054643752922f7a696 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

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

* patch 'compress/mlx5: fix decompress xform validation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (18 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/ipsec-secgw: fix auth IV length' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'compress/mlx5: fix output Adler-32 checksum offset' " Xueming Li
                     ` (116 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/9d7902bf42e97fc7360739d9aff0918a2bf53e27

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9d7902bf42e97fc7360739d9aff0918a2bf53e27 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 21 Feb 2023 09:07:49 +0200
Subject: [PATCH] compress/mlx5: fix decompress xform validation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 12b4c48512326e810a5001f105287ee5c6fc6705 ]

In xform creation, it first validate the xform according the
capabilities.

One of validations verifies that given "hash_algo" is
"RTE_COMP_HASH_ALGO_NONE" for both compress and decompress xform
objects.
However, the validation for decompress checks it again for compress
xform object.

This patch changes it to verify decompress xform object.

Fixes: 2efd26544554 ("compress/mlx5: support partial transformation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/compress/mlx5/mlx5_compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index 459e4b5e8a..cadff83f27 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -313,7 +313,7 @@ mlx5_compress_xform_create(struct rte_compressdev *dev,
 			DRV_LOG(ERR, "Not enough capabilities to support decompress operation, maybe old FW/OFED version?");
 			return -ENOTSUP;
 		}
-		if (xform->compress.hash_algo != RTE_COMP_HASH_ALGO_NONE) {
+		if (xform->decompress.hash_algo != RTE_COMP_HASH_ALGO_NONE) {
 			DRV_LOG(ERR, "SHA is not supported.");
 			return -ENOTSUP;
 		}
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.343805000 +0800
+++ 0020-compress-mlx5-fix-decompress-xform-validation.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From 12b4c48512326e810a5001f105287ee5c6fc6705 Mon Sep 17 00:00:00 2001
+From 9d7902bf42e97fc7360739d9aff0918a2bf53e27 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 12b4c48512326e810a5001f105287ee5c6fc6705 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 430f769d41..06d1ff5b95 100644
+index 459e4b5e8a..cadff83f27 100644

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

* patch 'compress/mlx5: fix output Adler-32 checksum offset' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (19 preceding siblings ...)
  2023-04-09 15:23   ` patch 'compress/mlx5: fix decompress xform validation' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'compress/mlx5: fix queue setup for partial transformations' " Xueming Li
                     ` (115 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/2a091b2f313b48586a31585f278d14e9938ef6d3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2a091b2f313b48586a31585f278d14e9938ef6d3 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 21 Feb 2023 09:07:50 +0200
Subject: [PATCH] compress/mlx5: fix output Adler-32 checksum offset
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d54dd89f49ded1e2d8d0e83710b2347a5de4d7f5 ]

After de/compress dequeue, the output checksum is copied into the op
structure. The "output_checksum" field in op structure is "uint64_t"
type, and the 32-bit checksums (CRC32, Adler-32) are copied into the
lower 32 bits.

When both CRC32 and Adler-32 are configured, CRC32 is copied into the
lower 32 bits and Adler-32 into the upper 32 bits.
However, in mlx5 PMD Adler-32 without CRC, is mistakenly copied into the
upper 32 bits.

This patch updates Adler-32 output checksum to be copied into the
lower 32 bits.

Fixes: f8c97babc9f4 ("compress/mlx5: add data-path functions")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/compress/mlx5/mlx5_compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index cadff83f27..c46fb4eb89 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -633,7 +633,7 @@ mlx5_compress_dequeue_burst(void *queue_pair, struct rte_comp_op **ops,
 				break;
 			case RTE_COMP_CHECKSUM_ADLER32:
 				op->output_chksum = (uint64_t)rte_be_to_cpu_32
-					    (opaq[idx].adler32) << 32;
+						    (opaq[idx].adler32);
 				break;
 			case RTE_COMP_CHECKSUM_CRC32_ADLER32:
 				op->output_chksum = (uint64_t)rte_be_to_cpu_32
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.365897400 +0800
+++ 0021-compress-mlx5-fix-output-Adler-32-checksum-offset.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From d54dd89f49ded1e2d8d0e83710b2347a5de4d7f5 Mon Sep 17 00:00:00 2001
+From 2a091b2f313b48586a31585f278d14e9938ef6d3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d54dd89f49ded1e2d8d0e83710b2347a5de4d7f5 ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org
@@ -29 +31 @@
-index 06d1ff5b95..82088a7b8c 100644
+index cadff83f27..c46fb4eb89 100644

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

* patch 'compress/mlx5: fix queue setup for partial transformations' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (20 preceding siblings ...)
  2023-04-09 15:23   ` patch 'compress/mlx5: fix output Adler-32 checksum offset' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix MCT output for SHA' " Xueming Li
                     ` (114 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Michael Baum; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/435188c3c42b725f5653ccbf9e667894a60d13a9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 435188c3c42b725f5653ccbf9e667894a60d13a9 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Tue, 21 Feb 2023 09:07:51 +0200
Subject: [PATCH] compress/mlx5: fix queue setup for partial transformations
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ad7febec11c522c1f6aa3cd61a0be223d12c0c76 ]

The mlx5_compress_qp_setup() function creates QP for compress,
decompress and DMA. Thus, the MMO flag is turned on only when all
operations are supported.

However, since partial transformations have been allowed, it should be
turn on for part of them.

This patch removes the compress MMO support requirement.

Fixes: 2efd26544554 ("compress/mlx5: support partial transformation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/compress/mlx5/mlx5_compress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c
index c46fb4eb89..c4bf62ed41 100644
--- a/drivers/compress/mlx5/mlx5_compress.c
+++ b/drivers/compress/mlx5/mlx5_compress.c
@@ -243,8 +243,8 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format);
 	qp_attr.num_of_receive_wqes = 0;
 	qp_attr.num_of_send_wqbbs = RTE_BIT32(log_ops_n);
-	qp_attr.mmo = priv->mmo_decomp_qp && priv->mmo_comp_qp
-			&& priv->mmo_dma_qp;
+	qp_attr.mmo = priv->mmo_decomp_qp || priv->mmo_comp_qp ||
+		      priv->mmo_dma_qp;
 	ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp,
 					qp_attr.num_of_send_wqbbs *
 					MLX5_WQE_SIZE, &qp_attr, socket_id);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.387501600 +0800
+++ 0022-compress-mlx5-fix-queue-setup-for-partial-transforma.patch	2023-04-09 21:45:38.599042200 +0800
@@ -1 +1 @@
-From ad7febec11c522c1f6aa3cd61a0be223d12c0c76 Mon Sep 17 00:00:00 2001
+From 435188c3c42b725f5653ccbf9e667894a60d13a9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ad7febec11c522c1f6aa3cd61a0be223d12c0c76 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 82088a7b8c..6882bcf6d1 100644
+index c46fb4eb89..c4bf62ed41 100644

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

* patch 'examples/fips_validation: fix MCT output for SHA' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (21 preceding siblings ...)
  2023-04-09 15:23   ` patch 'compress/mlx5: fix queue setup for partial transformations' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix integer parsing' " Xueming Li
                     ` (113 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ac87a06f6b908e77f56be9ca3d772e54f9e111d2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ac87a06f6b908e77f56be9ca3d772e54f9e111d2 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 28 Feb 2023 22:58:47 +0530
Subject: [PATCH] examples/fips_validation: fix MCT output for SHA
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fc78f69d6482fd69b9d475b7f7d003bcd26e4588 ]

MCT test for SHA need not print message string along
with digest value.

Fixes: d5c247145c2 ("examples/fips_validation: add parsing for SHA")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation_sha.c |  8 ++------
 examples/fips_validation/main.c                | 13 +++++--------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/examples/fips_validation/fips_validation_sha.c b/examples/fips_validation/fips_validation_sha.c
index c5da2cc623..178ea492d3 100644
--- a/examples/fips_validation/fips_validation_sha.c
+++ b/examples/fips_validation/fips_validation_sha.c
@@ -182,7 +182,7 @@ parse_test_sha_json_writeback(struct fips_val *val)
 static int
 parse_test_sha_mct_json_writeback(struct fips_val *val)
 {
-	json_t *tcId, *msg, *md, *resArr, *res;
+	json_t *tcId, *md, *resArr, *res;
 	struct fips_val val_local;
 
 	tcId = json_object_get(json_info.json_test_case, "tcId");
@@ -208,11 +208,7 @@ parse_test_sha_mct_json_writeback(struct fips_val *val)
 
 	res = json_object();
 
-	writeback_hex_str("", info.one_line_text, &val[1]);
-	msg = json_string(info.one_line_text);
-	json_object_set_new(res, "msg", msg);
-
-	val_local.val = val[0].val + vec.pt.len;
+	val_local.val = val->val + vec.pt.len;
 	val_local.len = vec.cipher_auth.digest.len;
 
 	writeback_hex_str("", info.one_line_text, &val_local);
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 622f8b5a6e..cc585e8418 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -2268,8 +2268,7 @@ fips_mct_sha_test(void)
 #define SHA_EXTERN_ITER	100
 #define SHA_INTERN_ITER	1000
 #define SHA_MD_BLOCK	3
-	/* val[0] is op result and other value is for parse_writeback callback */
-	struct fips_val val[2] = {{NULL, 0},};
+	struct fips_val val = {NULL, 0};
 	struct fips_val  md[SHA_MD_BLOCK], msg;
 	int ret;
 	uint32_t i, j;
@@ -2328,7 +2327,7 @@ fips_mct_sha_test(void)
 				return ret;
 			}
 
-			ret = get_writeback_data(&val[0]);
+			ret = get_writeback_data(&val);
 			if (ret < 0)
 				return ret;
 
@@ -2337,7 +2336,7 @@ fips_mct_sha_test(void)
 			memcpy(md[1].val, md[2].val, md[2].len);
 			md[1].len = md[2].len;
 
-			memcpy(md[2].val, (val[0].val + vec.pt.len),
+			memcpy(md[2].val, (val.val + vec.pt.len),
 				vec.cipher_auth.digest.len);
 			md[2].len = vec.cipher_auth.digest.len;
 		}
@@ -2348,9 +2347,7 @@ fips_mct_sha_test(void)
 		if (info.file_type != FIPS_TYPE_JSON)
 			fprintf(info.fp_wr, "COUNT = %u\n", j);
 
-		val[1].val = msg.val;
-		val[1].len = msg.len;
-		info.parse_writeback(val);
+		info.parse_writeback(&val);
 
 		if (info.file_type != FIPS_TYPE_JSON)
 			fprintf(info.fp_wr, "\n");
@@ -2361,7 +2358,7 @@ fips_mct_sha_test(void)
 
 	rte_free(vec.pt.val);
 
-	free(val[0].val);
+	free(val.val);
 	free(msg.val);
 
 	return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.413374300 +0800
+++ 0023-examples-fips_validation-fix-MCT-output-for-SHA.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From fc78f69d6482fd69b9d475b7f7d003bcd26e4588 Mon Sep 17 00:00:00 2001
+From ac87a06f6b908e77f56be9ca3d772e54f9e111d2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fc78f69d6482fd69b9d475b7f7d003bcd26e4588 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/fips_validation: fix integer parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (22 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix MCT output for SHA' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-GCM tests' " Xueming Li
                     ` (112 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/809de506c9e510845882ec81d2aa4db28615ea4c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 809de506c9e510845882ec81d2aa4db28615ea4c Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 28 Feb 2023 22:58:49 +0530
Subject: [PATCH] examples/fips_validation: fix integer parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 ]

Parsing integer value in test case vector does not store
it because only string was expected. This patch adds handling
for integer value as well.

Fixes: 58cc98801eb ("examples/fips_validation: add JSON parsing")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation.c | 29 ++++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index f7a6d821ea..d3b6099d73 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -543,15 +543,28 @@ fips_test_parse_one_json_case(void)
 
 	for (i = 0; info.callbacks[i].key != NULL; i++) {
 		param = json_object_get(json_info.json_test_case, info.callbacks[i].key);
-		if (param) {
-			strcpy(info.one_line_text, json_string_value(param));
-			ret = info.callbacks[i].cb(
-				info.callbacks[i].key, info.one_line_text,
-				info.callbacks[i].val
-			);
-			if (ret < 0)
-				return ret;
+		if (!param)
+			continue;
+
+		switch (json_typeof(param)) {
+		case JSON_STRING:
+			snprintf(info.one_line_text, MAX_LINE_CHAR, "%s",
+					 json_string_value(param));
+			break;
+
+		case JSON_INTEGER:
+			snprintf(info.one_line_text, MAX_LINE_CHAR, "%"JSON_INTEGER_FORMAT,
+					 json_integer_value(param));
+			break;
+
+		default:
+			return -EINVAL;
 		}
+
+		ret = info.callbacks[i].cb(info.callbacks[i].key, info.one_line_text,
+				info.callbacks[i].val);
+		if (ret < 0)
+			return ret;
 	}
 
 	return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.437978700 +0800
+++ 0024-examples-fips_validation-fix-integer-parsing.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 Mon Sep 17 00:00:00 2001
+From 809de506c9e510845882ec81d2aa4db28615ea4c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6bbb90cc061b5c6a1931143cdf69390a0ef50ef0 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/fips_validation: fix AES-GCM tests' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (23 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix integer parsing' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-XTS sequence number' " Xueming Li
                     ` (111 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/91c80e936a315c764b9a9954a14db1d63c5435cf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 91c80e936a315c764b9a9954a14db1d63c5435cf Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 28 Feb 2023 22:58:54 +0530
Subject: [PATCH] examples/fips_validation: fix AES-GCM tests
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 02913adaed71fa8437fca727220303b4a0df0896 ]

AES GCM validation tests fail in FIPS validation due to incorrect
fields populated in response file. This patch fixes them.

Fixes: 5b540bebac8e ("examples/fips_validation: fix GMAC decryption output")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation_gcm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c
index a80d8b3e4d..bf08d1b995 100644
--- a/examples/fips_validation/fips_validation_gcm.c
+++ b/examples/fips_validation/fips_validation_gcm.c
@@ -79,7 +79,7 @@ parser_read_gcm_pt_len(const char *key, char *src,
 	if (ret < 0)
 		return ret;
 
-	if (vec.pt.len == 0) {
+	if (info.algo == FIPS_TEST_ALGO_AES_GMAC && vec.pt.len == 0) {
 		info.interim_info.gcm_data.is_gmac = 1;
 		test_ops.prepare_sym_op = prepare_auth_op;
 		test_ops.prepare_sym_xform = prepare_gmac_xform;
@@ -296,6 +296,7 @@ parse_test_gcm_json_writeback(struct fips_val *val)
 			tmp_val.val = val->val;
 			tmp_val.len = vec.pt.len;
 
+			info.one_line_text[0] = '\0';
 			writeback_hex_str("", info.one_line_text, &tmp_val);
 			ct = json_string(info.one_line_text);
 			json_object_set_new(json_info.json_write_case, CT_JSON_STR, ct);
@@ -326,6 +327,7 @@ parse_test_gcm_json_writeback(struct fips_val *val)
 				tmp_val.val = val->val;
 				tmp_val.len = vec.pt.len;
 
+				info.one_line_text[0] = '\0';
 				writeback_hex_str("", info.one_line_text, &tmp_val);
 				json_object_set_new(json_info.json_write_case, PT_JSON_STR,
 					json_string(info.one_line_text));
@@ -334,12 +336,8 @@ parse_test_gcm_json_writeback(struct fips_val *val)
 					json_true());
 			}
 		} else {
-			if (!info.interim_info.gcm_data.is_gmac)
-				json_object_set_new(json_info.json_write_case, PT_JSON_STR,
-					json_string(""));
-			else
-				json_object_set_new(json_info.json_write_case, "testPassed",
-					json_false());
+			json_object_set_new(json_info.json_write_case, "testPassed",
+				json_false());
 		}
 	}
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.462033600 +0800
+++ 0025-examples-fips_validation-fix-AES-GCM-tests.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 02913adaed71fa8437fca727220303b4a0df0896 Mon Sep 17 00:00:00 2001
+From 91c80e936a315c764b9a9954a14db1d63c5435cf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 02913adaed71fa8437fca727220303b4a0df0896 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/fips_validation: fix AES-XTS sequence number' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (24 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-GCM tests' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'examples/fips_validation: add extra space in JSON buffer' " Xueming Li
                     ` (110 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/903f4ee07da15770a9185c900a21b883b1ddae96

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 903f4ee07da15770a9185c900a21b883b1ddae96 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 28 Feb 2023 22:58:55 +0530
Subject: [PATCH] examples/fips_validation: fix AES-XTS sequence number
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6e27b74b0e324fb966c8d10d1006b68089c2a806 ]

Fix AES XTS test to read sequence number correctly.

Fixes: f8e431ed8f6 ("examples/fips_validation: add parsing for AES-XTS")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation_xts.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/examples/fips_validation/fips_validation_xts.c b/examples/fips_validation/fips_validation_xts.c
index 531e3c688e..530df78ab4 100644
--- a/examples/fips_validation/fips_validation_xts.c
+++ b/examples/fips_validation/fips_validation_xts.c
@@ -34,6 +34,7 @@
 #define DATAUNITLEN_JSON_STR	"dataUnitLen"
 #define PAYLOADLEN_JSON_STR	"payloadLen"
 #define TWEAKVALUE_JSON_STR	"tweakValue"
+#define SEQNUMBER_JSON_STR	"sequenceNumber"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
 
@@ -95,14 +96,17 @@ parser_xts_read_keylen(const char *key, char *src, struct fips_val *val)
 static int
 parser_xts_read_tweakval(const char *key, char *src, struct fips_val *val)
 {
+	char num_str[4] = {0};
 	int ret;
 
-	if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_HEX)
+	if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_HEX) {
 		ret = parse_uint8_hex_str(key, src, val);
-	else if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_NUMBER)
-		ret = parser_read_uint32_bit_val(key, src, val);
-	else
+	} else if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_NUMBER) {
+		snprintf(num_str, RTE_DIM(num_str), "%x", atoi(src));
+		ret = parse_uint8_hex_str(key, num_str, val);
+	} else {
 		ret = -1;
+	}
 
 	return ret;
 }
@@ -122,6 +126,7 @@ struct fips_test_callback xts_interim_json_vectors[] = {
 struct fips_test_callback xts_enc_json_vectors[] = {
 		{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.cipher_auth.key},
 		{TWEAKVALUE_JSON_STR, parser_xts_read_tweakval, &vec.iv},
+		{SEQNUMBER_JSON_STR, parser_xts_read_tweakval, &vec.iv},
 		{PT_JSON_STR, parse_uint8_hex_str, &vec.pt},
 		{NULL, NULL, NULL} /**< end pointer */
 };
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.484726000 +0800
+++ 0026-examples-fips_validation-fix-AES-XTS-sequence-number.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 6e27b74b0e324fb966c8d10d1006b68089c2a806 Mon Sep 17 00:00:00 2001
+From 903f4ee07da15770a9185c900a21b883b1ddae96 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6e27b74b0e324fb966c8d10d1006b68089c2a806 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'examples/fips_validation: add extra space in JSON buffer' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (25 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-XTS sequence number' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'common/cnxk: fix auth key length' " Xueming Li
                     ` (109 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: Brian Dooley, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/995a6460b24d732d537e2712b8c56af690b10523

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 995a6460b24d732d537e2712b8c56af690b10523 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Tue, 28 Feb 2023 22:58:56 +0530
Subject: [PATCH] examples/fips_validation: add extra space in JSON buffer
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 904efb4cba8e661d6a09dc671baabea6d31ea9b3 ]

Current test buffer to copy input data of maximum possible length
did not account NULL character, due to which a last input character
is always ignored and it causes tests like RSA SIGVER for modulo
of 4096 bits to fail. This patch fixes it.

Fixes: 0b65d54f3a4 ("examples/fips_validation: fix JSON buffer size")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
---
 examples/fips_validation/fips_validation.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index 565a5cd36e..c4bb041785 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -244,7 +244,7 @@ struct ecdsa_interim_data {
  * Esp, in asym op, modulo bits decide char buffer size.
  * max = (modulo / 4)
  */
-#define FIPS_TEST_JSON_BUF_LEN (4096 / 4)
+#define FIPS_TEST_JSON_BUF_LEN ((4096 / 4) + 1)
 
 struct fips_test_json_info {
 	/* Information used for reading from json */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.505369400 +0800
+++ 0027-examples-fips_validation-add-extra-space-in-JSON-buf.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 904efb4cba8e661d6a09dc671baabea6d31ea9b3 Mon Sep 17 00:00:00 2001
+From 995a6460b24d732d537e2712b8c56af690b10523 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 904efb4cba8e661d6a09dc671baabea6d31ea9b3 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index c4988053c1..abc1d64742 100644
+index 565a5cd36e..c4bb041785 100644
@@ -24 +26 @@
-@@ -247,7 +247,7 @@ struct ecdsa_interim_data {
+@@ -244,7 +244,7 @@ struct ecdsa_interim_data {

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

* patch 'common/cnxk: fix auth key length' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (26 preceding siblings ...)
  2023-04-09 15:23   ` patch 'examples/fips_validation: add extra space in JSON buffer' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix 48-bit DMA support for NFDk' " Xueming Li
                     ` (108 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/6ede2ab4723fae561d2453c6d8c282c227f05ffd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6ede2ab4723fae561d2453c6d8c282c227f05ffd Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Date: Fri, 24 Feb 2023 15:10:04 +0530
Subject: [PATCH] common/cnxk: fix auth key length
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0fcaf90fe25ecaa002d765fa9759e554500e3f76 ]

Auth key length is stored as 8 bit value in SE context. It should
be larger enough to accommodate supported auth key length of 1024
bytes maximum, as in HMAC.

Fixes: a45859312ff ("common/cnxk: add SE definitions for symmetric crypto")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/common/cnxk/roc_se.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/common/cnxk/roc_se.h b/drivers/common/cnxk/roc_se.h
index c357c19c0b..5b0ddac42d 100644
--- a/drivers/common/cnxk/roc_se.h
+++ b/drivers/common/cnxk/roc_se.h
@@ -316,16 +316,15 @@ struct roc_se_ctx {
 	uint64_t enc_cipher : 8;
 	uint64_t hash_type : 8;
 	uint64_t mac_len : 8;
-	uint64_t auth_key_len : 8;
+	uint64_t auth_key_len : 16;
 	uint64_t fc_type : 4;
 	uint64_t hmac : 1;
 	uint64_t zsk_flags : 3;
 	uint64_t k_ecb : 1;
 	uint64_t pdcp_ci_alg : 2;
 	uint64_t pdcp_auth_alg : 2;
-	uint16_t ciph_then_auth : 1;
-	uint16_t auth_then_ciph : 1;
-	uint64_t rsvd : 17;
+	uint64_t ciph_then_auth : 1;
+	uint64_t auth_then_ciph : 1;
 	union cpt_inst_w4 template_w4;
 	/* Below fields are accessed by hardware */
 	union {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.527491200 +0800
+++ 0028-common-cnxk-fix-auth-key-length.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 0fcaf90fe25ecaa002d765fa9759e554500e3f76 Mon Sep 17 00:00:00 2001
+From 6ede2ab4723fae561d2453c6d8c282c227f05ffd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0fcaf90fe25ecaa002d765fa9759e554500e3f76 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 6758142214..a0c97b26c5 100644
+index c357c19c0b..5b0ddac42d 100644
@@ -22 +24 @@
-@@ -288,16 +288,15 @@ struct roc_se_ctx {
+@@ -316,16 +316,15 @@ struct roc_se_ctx {
@@ -41 +43 @@
- 	struct se_ctx_s {
+ 	union {

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

* patch 'net/nfp: fix 48-bit DMA support for NFDk' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (27 preceding siblings ...)
  2023-04-09 15:23   ` patch 'common/cnxk: fix auth key length' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/gve: fix offloading capability' " Xueming Li
                     ` (107 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Peng Zhang; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/90f12bb74f7da67b998d9ee233ac651e1cbdd11b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 90f12bb74f7da67b998d9ee233ac651e1cbdd11b Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang@corigine.com>
Date: Mon, 20 Feb 2023 17:02:54 +0800
Subject: [PATCH] net/nfp: fix 48-bit DMA support for NFDk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fd392f844abc825d0ff2e8418a2f5ba9a76e4e14 ]

Initializing of the NFP PMD fails when a NFDk device is used in a PCIe
slot that supports 48-bit DMA address. The failure is due to an
incorrect check by the PMD that limits the support to 40-bit DMA
address. While this check is correct for NFD3 devices, it is incorrect
for NFDk that can support 48-bit DMA address.

Fix this by correcting the DMA mask check at initialization to allow for
different DMA address masks for NFD3 and NFDk.

The RX free list descriptor code is also updated to allow for 48-bit DMA
address. While this code is shared by the NFD3 and NFDk code paths,
this is not an issue as for 40-bit address the top bits are always 0.

Fixes: c73dced48c8c ("net/nfp: add NFDk Tx")

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c      | 12 ++++--------
 drivers/net/nfp/flower/nfp_flower_ctrl.c |  2 +-
 drivers/net/nfp/nfp_common.c             | 18 ++++++++++++++++++
 drivers/net/nfp/nfp_common.h             |  1 +
 drivers/net/nfp/nfp_ethdev.c             | 11 +++--------
 drivers/net/nfp/nfp_ethdev_vf.c          | 11 +++--------
 drivers/net/nfp/nfp_rxtx.c               |  4 ++--
 drivers/net/nfp/nfp_rxtx.h               |  4 ++--
 8 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index e447258d97..6857732028 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -451,7 +451,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
 		rxds->vals[1] = 0;
 		dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
 		rxds->fld.dd = 0;
-		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff;
+		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
 		rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
 		nb_hold++;
 
@@ -631,13 +631,6 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
 	pf_dev = hw->pf_dev;
 	pci_dev = hw->pf_dev->pci_dev;
 
-	/* NFP can not handle DMA addresses requiring more than 40 bits */
-	if (rte_mem_check_dma_mask(40)) {
-		PMD_INIT_LOG(ERR, "Device %s can not be used: restricted dma mask to 40 bits!\n",
-				pci_dev->device.name);
-		return -ENODEV;
-	};
-
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
@@ -666,6 +659,9 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
 	hw->mtu = hw->max_mtu;
 	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
+	if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0)
+		return -ENODEV;
+
 	/* read the Rx offset configured from firmware */
 	if (NFD_CFG_MAJOR_VERSION_of(hw->ver) < 2)
 		hw->rx_offset = NFP_NET_RX_OFFSET;
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c
index 3631e764fe..1c6340f3d7 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c
@@ -123,7 +123,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
 		rxds->vals[1] = 0;
 		dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
 		rxds->fld.dd = 0;
-		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff;
+		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
 		rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
 		nb_hold++;
 
diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index 71711bfa22..c962ed0fc0 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -1413,6 +1413,24 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw,
 RTE_LOG_REGISTER_SUFFIX(nfp_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(nfp_logtype_driver, driver, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(nfp_logtype_cpp, cpp, NOTICE);
+/*
+ * The firmware with NFD3 can not handle DMA address requiring more
+ * than 40 bits
+ */
+int
+nfp_net_check_dma_mask(struct nfp_net_hw *hw, char *name)
+{
+	if (NFD_CFG_CLASS_VER_of(hw->ver) == NFP_NET_CFG_VERSION_DP_NFD3 &&
+			rte_mem_check_dma_mask(40) != 0) {
+		PMD_DRV_LOG(ERR,
+			"The device %s can't be used: restricted dma mask to 40 bits!",
+			name);
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
 /*
  * Local variables:
  * c-file-style: "Linux"
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 36c19b47e4..8cf99c0eae 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -447,6 +447,7 @@ void nfp_net_close_rx_queue(struct rte_eth_dev *dev);
 void nfp_net_stop_tx_queue(struct rte_eth_dev *dev);
 void nfp_net_close_tx_queue(struct rte_eth_dev *dev);
 int nfp_net_set_vxlan_port(struct nfp_net_hw *hw, size_t idx, uint16_t port);
+int nfp_net_check_dma_mask(struct nfp_net_hw *hw, char *name);
 
 #define NFP_NET_DEV_PRIVATE_TO_HW(adapter)\
 	(&((struct nfp_net_adapter *)adapter)->hw)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index f22ae24b53..cf7a4389b3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -517,14 +517,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	/* Use backpointer to the CoreNIC app struct */
 	app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv);
 
-	/* NFP can not handle DMA addresses requiring more than 40 bits */
-	if (rte_mem_check_dma_mask(40)) {
-		RTE_LOG(ERR, PMD,
-			"device %s can not be used: restricted dma mask to 40 bits!\n",
-			pci_dev->device.name);
-		return -ENODEV;
-	}
-
 	port = ((struct nfp_net_hw *)eth_dev->data->dev_private)->idx;
 	if (port < 0 || port > 7) {
 		PMD_DRV_LOG(ERR, "Port value is wrong");
@@ -572,6 +564,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 
 	hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION);
 
+	if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0)
+		return -ENODEV;
+
 	if (nfp_net_ethdev_ops_mount(hw, eth_dev))
 		return -EINVAL;
 
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index d1427b63bc..865cac7741 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -291,14 +291,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
-	/* NFP can not handle DMA addresses requiring more than 40 bits */
-	if (rte_mem_check_dma_mask(40)) {
-		RTE_LOG(ERR, PMD,
-			"device %s can not be used: restricted dma mask to 40 bits!\n",
-			pci_dev->device.name);
-		return -ENODEV;
-	}
-
 	hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
 
 	hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr;
@@ -312,6 +304,9 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 
 	hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION);
 
+	if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0)
+		return -ENODEV;
+
 	if (nfp_netvf_ethdev_ops_mount(hw, eth_dev))
 		return -EINVAL;
 
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 9e20917b5e..ac0fa80d4c 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -48,7 +48,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq)
 
 		rxd = &rxq->rxds[i];
 		rxd->fld.dd = 0;
-		rxd->fld.dma_addr_hi = (dma_addr >> 32) & 0xff;
+		rxd->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
 		rxd->fld.dma_addr_lo = dma_addr & 0xffffffff;
 		rxe[i].mbuf = mbuf;
 		PMD_RX_LOG(DEBUG, "[%d]: %" PRIx64, i, dma_addr);
@@ -361,7 +361,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		rxds->vals[1] = 0;
 		dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
 		rxds->fld.dd = 0;
-		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff;
+		rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
 		rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
 		nb_hold++;
 
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index ced05fde90..e2b48374fe 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -227,8 +227,8 @@ struct nfp_net_rx_desc {
 	union {
 		/* Freelist descriptor */
 		struct {
-			uint8_t dma_addr_hi;
-			__le16 spare;
+			__le16 dma_addr_hi;
+			uint8_t spare;
 			uint8_t dd;
 
 			__le32 dma_addr_lo;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.550102500 +0800
+++ 0029-net-nfp-fix-48-bit-DMA-support-for-NFDk.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From fd392f844abc825d0ff2e8418a2f5ba9a76e4e14 Mon Sep 17 00:00:00 2001
+From 90f12bb74f7da67b998d9ee233ac651e1cbdd11b Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fd392f844abc825d0ff2e8418a2f5ba9a76e4e14 ]
@@ -23 +25,0 @@
-Cc: stable@dpdk.org
@@ -40 +42 @@
-index 42014295ab..2c797ae751 100644
+index e447258d97..6857732028 100644
@@ -43 +45 @@
-@@ -452,7 +452,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
+@@ -451,7 +451,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
@@ -52 +54 @@
-@@ -629,13 +629,6 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
+@@ -631,13 +631,6 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
@@ -66 +68 @@
-@@ -664,6 +657,9 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
+@@ -666,6 +659,9 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type)
@@ -77 +79 @@
-index 6e7545bc39..3e083d948e 100644
+index 3631e764fe..1c6340f3d7 100644
@@ -80 +82 @@
-@@ -122,7 +122,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
+@@ -123,7 +123,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
@@ -90 +92 @@
-index ac05aba92d..907777a9e4 100644
+index 71711bfa22..c962ed0fc0 100644
@@ -93,4 +95,4 @@
-@@ -1566,6 +1566,24 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw,
- 	return ret;
- }
- 
+@@ -1413,6 +1413,24 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw,
+ RTE_LOG_REGISTER_SUFFIX(nfp_logtype_init, init, NOTICE);
+ RTE_LOG_REGISTER_SUFFIX(nfp_logtype_driver, driver, NOTICE);
+ RTE_LOG_REGISTER_SUFFIX(nfp_logtype_cpp, cpp, NOTICE);
@@ -119 +121 @@
-index 56b7edc951..980f3cad89 100644
+index 36c19b47e4..8cf99c0eae 100644
@@ -122,4 +124,4 @@
-@@ -454,6 +454,7 @@ int nfp_net_rx_desc_limits(struct nfp_net_hw *hw,
- int nfp_net_tx_desc_limits(struct nfp_net_hw *hw,
- 		uint16_t *min_tx_desc,
- 		uint16_t *max_tx_desc);
+@@ -447,6 +447,7 @@ void nfp_net_close_rx_queue(struct rte_eth_dev *dev);
+ void nfp_net_stop_tx_queue(struct rte_eth_dev *dev);
+ void nfp_net_close_tx_queue(struct rte_eth_dev *dev);
+ int nfp_net_set_vxlan_port(struct nfp_net_hw *hw, size_t idx, uint16_t port);
@@ -131 +133 @@
-index 3527804785..fed7b1ab13 100644
+index f22ae24b53..cf7a4389b3 100644
@@ -134 +136 @@
-@@ -519,14 +519,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -517,14 +517,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -140,2 +142,2 @@
--		PMD_INIT_LOG(ERR,
--			"device %s can not be used: restricted dma mask to 40 bits!",
+-		RTE_LOG(ERR, PMD,
+-			"device %s can not be used: restricted dma mask to 40 bits!\n",
@@ -149 +151 @@
-@@ -574,6 +566,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -572,6 +564,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -160 +162 @@
-index cbe5c5c5c8..c1f8a0fa0f 100644
+index d1427b63bc..865cac7741 100644
@@ -169,2 +171,2 @@
--		PMD_INIT_LOG(ERR,
--			"device %s can not be used: restricted dma mask to 40 bits!",
+-		RTE_LOG(ERR, PMD,
+-			"device %s can not be used: restricted dma mask to 40 bits!\n",
@@ -189 +191 @@
-index abecff3a87..17a04cec5e 100644
+index 9e20917b5e..ac0fa80d4c 100644
@@ -201 +203 @@
-@@ -454,7 +454,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
+@@ -361,7 +361,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
@@ -211 +213 @@
-index cb67657014..5e651518ed 100644
+index ced05fde90..e2b48374fe 100644
@@ -214 +216 @@
-@@ -288,8 +288,8 @@ struct nfp_net_rx_desc {
+@@ -227,8 +227,8 @@ struct nfp_net_rx_desc {

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

* patch 'net/gve: fix offloading capability' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (28 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix 48-bit DMA support for NFDk' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/mana: enable driver by default' " Xueming Li
                     ` (106 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Levend Sayar; +Cc: Rushil Gupta, Junfeng Guo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/64d858dc0305ac4d73cf1d1f91233aa8b93c9619

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 64d858dc0305ac4d73cf1d1f91233aa8b93c9619 Mon Sep 17 00:00:00 2001
From: Levend Sayar <levendsayar@gmail.com>
Date: Thu, 16 Feb 2023 21:58:13 +0300
Subject: [PATCH] net/gve: fix offloading capability
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 81f6a0e5e4932bf66d01fc31c11a30ab6e8f837b ]

Google Virtual NIC is not doing IPv4 checksumming.
Removed that capability from PMD.

Fixes: a46583cf43c8 ("net/gve: support Rx/Tx")

Signed-off-by: Levend Sayar <levendsayar@gmail.com>
Acked-by: Rushil Gupta <rushilg@google.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
---
 .mailmap                     | 1 +
 drivers/net/gve/gve_ethdev.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 8b0904d938..dc8a8637e1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1148,6 +1148,7 @@ Roy Franz <roy.franz@cavium.com>
 Roy Pledge <roy.pledge@nxp.com>
 Roy Shterman <roy.shterman@vastdata.com>
 Ruifeng Wang <ruifeng.wang@arm.com>
+Rushil Gupta <rushilg@google.com>
 Ryan E Hall <ryan.e.hall@intel.com>
 Sabyasachi Sengupta <sabyasg@hpe.com>
 Sachin Saxena <sachin.saxena@nxp.com> <sachin.saxena@oss.nxp.com>
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 97781f0ed3..e357f16e16 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -282,7 +282,6 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->rx_offload_capa = 0;
 	dev_info->tx_offload_capa =
 		RTE_ETH_TX_OFFLOAD_MULTI_SEGS	|
-		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM	|
 		RTE_ETH_TX_OFFLOAD_UDP_CKSUM	|
 		RTE_ETH_TX_OFFLOAD_TCP_CKSUM	|
 		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM	|
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.574646800 +0800
+++ 0030-net-gve-fix-offloading-capability.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 81f6a0e5e4932bf66d01fc31c11a30ab6e8f837b Mon Sep 17 00:00:00 2001
+From 64d858dc0305ac4d73cf1d1f91233aa8b93c9619 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 81f6a0e5e4932bf66d01fc31c11a30ab6e8f837b ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 8e7d78f37e..8b84277954 100644
+index 8b0904d938..dc8a8637e1 100644
@@ -24 +26 @@
-@@ -1154,6 +1154,7 @@ Roy Franz <roy.franz@cavium.com>
+@@ -1148,6 +1148,7 @@ Roy Franz <roy.franz@cavium.com>
@@ -33 +35 @@
-index 06d1b796c8..fef2458a16 100644
+index 97781f0ed3..e357f16e16 100644

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

* patch 'net/mana: enable driver by default' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (29 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/gve: fix offloading capability' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'app/testpmd: fix Tx preparation in checksum engine' " Xueming Li
                     ` (105 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Long Li; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/62324129c14d18fdb88b2a2af51ab1ce7ad704c7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 62324129c14d18fdb88b2a2af51ab1ce7ad704c7 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Thu, 19 Jan 2023 18:19:27 -0800
Subject: [PATCH] net/mana: enable driver by default
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 807440416cd9eddf571954c7fd355c0b48fa9f14 ]

The required dependencies for mana from rdma-core 44
and Linux kernel 6.2 have been released.

Fixes: 517ed6e2d590 ("net/mana: add basic driver with build environment")

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 MAINTAINERS              | 2 +-
 doc/guides/nics/mana.rst | 8 +++-----
 drivers/net/meson.build  | 1 +
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 22ef2ea4b9..1338ca00ba 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -850,7 +850,7 @@ F: buildtools/options-ibverbs-static.sh
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
-Microsoft mana - EXPERIMENTAL
+Microsoft mana
 M: Long Li <longli@microsoft.com>
 F: drivers/net/mana/
 F: doc/guides/nics/mana.rst
diff --git a/doc/guides/nics/mana.rst b/doc/guides/nics/mana.rst
index 005c0b2ca7..341146c4e7 100644
--- a/doc/guides/nics/mana.rst
+++ b/doc/guides/nics/mana.rst
@@ -29,6 +29,7 @@ and must be installed separately:
   It allows slow and privileged operations
   (context initialization, hardware resources allocations)
   to be managed by the kernel and fast operations to never leave user space.
+  The minimum required rdma-core version is v44.
 
   In most cases, rdma-core is shipped as a package with an OS distribution.
   User can also install the upstream version of the rdma-core from
@@ -39,15 +40,14 @@ and must be installed separately:
   Low-level user space driver library
   for Microsoft Azure Network Adapter devices,
   it is automatically loaded by libibverbs.
-
-  The support of MANA is not merged in rdma-core 42.
+  The minimum required version of rdma-core with libmana is v44.
 
 - **Kernel modules**
 
   They provide the kernel-side verbs API and low level device drivers
   that manage actual hardware initialization
   and resources sharing with user space processes.
-  The minimum required Linux kernel version is 6.1.
+  The minimum required Linux kernel version is 6.2.
 
   Unlike most other PMDs, these modules must remain loaded
   and bound to their devices:
@@ -56,8 +56,6 @@ and must be installed separately:
   - mana_ib: InifiniBand device driver.
   - ib_uverbs: user space driver for verbs (entry point for libibverbs).
 
-  The support of MANA is planned in Linux 6.2.
-
 Driver compilation and testing
 ------------------------------
 
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 6470bf3636..f83a6de117 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -36,6 +36,7 @@ drivers = [
         'ixgbe',
         'kni',
         'liquidio',
+        'mana',
         'memif',
         'mlx4',
         'mlx5',
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.599469800 +0800
+++ 0031-net-mana-enable-driver-by-default.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 807440416cd9eddf571954c7fd355c0b48fa9f14 Mon Sep 17 00:00:00 2001
+From 62324129c14d18fdb88b2a2af51ab1ce7ad704c7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 807440416cd9eddf571954c7fd355c0b48fa9f14 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 3495946d0f..ffbf91296e 100644
+index 22ef2ea4b9..1338ca00ba 100644
@@ -24 +26 @@
-@@ -853,7 +853,7 @@ F: buildtools/options-ibverbs-static.sh
+@@ -850,7 +850,7 @@ F: buildtools/options-ibverbs-static.sh

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

* patch 'app/testpmd: fix Tx preparation in checksum engine' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (30 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/mana: enable driver by default' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'app/testpmd: fix packet count in IEEE 1588 " Xueming Li
                     ` (104 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/a4141026d791b6521c60a4cf9ad21e9ccf112ff7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a4141026d791b6521c60a4cf9ad21e9ccf112ff7 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:54 +0100
Subject: [PATCH] app/testpmd: fix Tx preparation in checksum engine
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 ]

"unprepared" packets could get to the wire in the retry loop.

Split packets freeing in two stages: one for preparation failure, and
one for transmission failure.
Adjust dropped counter update accordingly.

Fixes: 6b520d54ebfe ("app/testpmd: use Tx preparation in checksum engine")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/csumonly.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 1c24598515..90a59e0aa5 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -1168,10 +1168,13 @@ tunnel_update:
 
 	nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
 			tx_pkts_burst, nb_rx);
-	if (nb_prep != nb_rx)
+	if (nb_prep != nb_rx) {
 		fprintf(stderr,
 			"Preparing packet burst to transmit failed: %s\n",
 			rte_strerror(rte_errno));
+		fs->fwd_dropped += (nb_rx - nb_prep);
+		rte_pktmbuf_free_bulk(&tx_pkts_burst[nb_prep], nb_rx - nb_prep);
+	}
 
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, tx_pkts_burst,
 			nb_prep);
@@ -1179,12 +1182,12 @@ tunnel_update:
 	/*
 	 * Retry if necessary
 	 */
-	if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
+	if (unlikely(nb_tx < nb_prep) && fs->retry_enabled) {
 		retry = 0;
-		while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
+		while (nb_tx < nb_prep && retry++ < burst_tx_retry_num) {
 			rte_delay_us(burst_tx_delay_time);
 			nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
-					&tx_pkts_burst[nb_tx], nb_rx - nb_tx);
+					&tx_pkts_burst[nb_tx], nb_prep - nb_tx);
 		}
 	}
 	fs->tx_packets += nb_tx;
@@ -1194,11 +1197,11 @@ tunnel_update:
 	fs->rx_bad_outer_ip_csum += rx_bad_outer_ip_csum;
 
 	inc_tx_burst_stats(fs, nb_tx);
-	if (unlikely(nb_tx < nb_rx)) {
-		fs->fwd_dropped += (nb_rx - nb_tx);
+	if (unlikely(nb_tx < nb_prep)) {
+		fs->fwd_dropped += (nb_prep - nb_tx);
 		do {
 			rte_pktmbuf_free(tx_pkts_burst[nb_tx]);
-		} while (++nb_tx < nb_rx);
+		} while (++nb_tx < nb_prep);
 	}
 
 	get_end_cycles(fs, start_tsc);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.627227100 +0800
+++ 0032-app-testpmd-fix-Tx-preparation-in-checksum-engine.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 Mon Sep 17 00:00:00 2001
+From a4141026d791b6521c60a4cf9ad21e9ccf112ff7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 88a0b0f3858bf430616fe2bcac6f3eee05c383f5 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/testpmd: fix packet count in IEEE 1588 engine' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (31 preceding siblings ...)
  2023-04-09 15:23   ` patch 'app/testpmd: fix Tx preparation in checksum engine' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'app/testpmd: fix packet transmission in noisy VNF " Xueming Li
                     ` (103 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: Aman Singh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/e8996dc08d8fdc83f1fec584b61ecd6952e6a553

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e8996dc08d8fdc83f1fec584b61ecd6952e6a553 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:55 +0100
Subject: [PATCH] app/testpmd: fix packet count in IEEE 1588 engine
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 32567c6d06cd1bb823215476355b48bb2002e1fd ]

Don't count a packet has been transmitted before it is done.

Fixes: af75078fece3 ("first public release")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/ieee1588fwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index fc4e2d014c..896d5ef26a 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -184,13 +184,13 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
 
 	/* Forward PTP packet with hardware TX timestamp */
 	mb->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
-	fs->tx_packets += 1;
 	if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) {
 		printf("Port %u sent PTP packet dropped\n", fs->rx_port);
 		fs->fwd_dropped += 1;
 		rte_pktmbuf_free(mb);
 		return;
 	}
+	fs->tx_packets += 1;
 
 	/*
 	 * Check the TX timestamp.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.654805500 +0800
+++ 0033-app-testpmd-fix-packet-count-in-IEEE-1588-engine.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From 32567c6d06cd1bb823215476355b48bb2002e1fd Mon Sep 17 00:00:00 2001
+From e8996dc08d8fdc83f1fec584b61ecd6952e6a553 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 32567c6d06cd1bb823215476355b48bb2002e1fd ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

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

* patch 'app/testpmd: fix packet transmission in noisy VNF engine' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (32 preceding siblings ...)
  2023-04-09 15:23   ` patch 'app/testpmd: fix packet count in IEEE 1588 " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'ethdev: fix build with LTO' " Xueming Li
                     ` (102 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/cd2635a2b54fdc4e12731ffdc44cbd1ada81ed6b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cd2635a2b54fdc4e12731ffdc44cbd1ada81ed6b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Mon, 20 Feb 2023 19:34:57 +0100
Subject: [PATCH] app/testpmd: fix packet transmission in noisy VNF engine
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c2acd2db16cba89f403a980da5f4b6764085b01d ]

nb_rx relates to the number of packets received from the driver.
nb_tx is the total number of packets transmitted by this forward engine.

Fix the retry stage, for dequeued packets, as it was incorrectly
passing nb_rx / nb_tx as bounds of the tmp_pkts[] array, and fix tx stats
accordingly.

Fixes: 3c156061b938 ("app/testpmd: add noisy neighbour forwarding mode")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/noisy_vnf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index c65ec6f06a..abd99a0407 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -214,9 +214,10 @@ flush:
 		sent = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
 					 tmp_pkts, nb_deqd);
 		if (unlikely(sent < nb_deqd) && fs->retry_enabled)
-			nb_tx += do_retry(nb_rx, nb_tx, tmp_pkts, fs);
-		inc_tx_burst_stats(fs, nb_tx);
+			sent += do_retry(nb_deqd, sent, tmp_pkts, fs);
+		inc_tx_burst_stats(fs, sent);
 		fs->fwd_dropped += drop_pkts(tmp_pkts, nb_deqd, sent);
+		nb_tx += sent;
 		ncf->prev_time = rte_get_timer_cycles();
 	}
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.677201100 +0800
+++ 0034-app-testpmd-fix-packet-transmission-in-noisy-VNF-eng.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From c2acd2db16cba89f403a980da5f4b6764085b01d Mon Sep 17 00:00:00 2001
+From cd2635a2b54fdc4e12731ffdc44cbd1ada81ed6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c2acd2db16cba89f403a980da5f4b6764085b01d ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index ce5a3e5e69..0e72dc034f 100644
+index c65ec6f06a..abd99a0407 100644
@@ -26 +28 @@
-@@ -217,9 +217,10 @@ flush:
+@@ -214,9 +214,10 @@ flush:
@@ -38 +40 @@
- end:
+ }

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

* patch 'ethdev: fix build with LTO' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (33 preceding siblings ...)
  2023-04-09 15:23   ` patch 'app/testpmd: fix packet transmission in noisy VNF " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/mana: fix stats counters' " Xueming Li
                     ` (101 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Krzysztof Karas; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/00af2661ac7a56f1f093cb94c4a702ac971b8fe7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 00af2661ac7a56f1f093cb94c4a702ac971b8fe7 Mon Sep 17 00:00:00 2001
From: Krzysztof Karas <krzysztof.karas@intel.com>
Date: Mon, 20 Feb 2023 17:44:06 +0100
Subject: [PATCH] ethdev: fix build with LTO
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cdd7ab072d1e662b1d06840447e7d1b8ab8946e3 ]

When Link Time Optimization is enabled, compiler may
complain about "id" in eth_representor_cmp() being
uninitialized.

To suppress the warning it is enough to add explicit
initialization of the variable causing the issue.

Fixes: df7547a6a2cc ("ethdev: add helper function to get representor ID")

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                   | 1 +
 lib/ethdev/rte_class_eth.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index dc8a8637e1..ea09ef90cb 100644
--- a/.mailmap
+++ b/.mailmap
@@ -712,6 +712,7 @@ Konstantin Ananyev <konstantin.v.ananyev@yandex.ru> <konstantin.ananyev@huawei.c
 Krishna Murthy <krishna.j.murthy@intel.com>
 Krzysztof Galazka <krzysztof.galazka@intel.com>
 Krzysztof Kanas <kkanas@marvell.com> <krzysztof.kanas@caviumnetworks.com>
+Krzysztof Karas <krzysztof.karas@intel.com>
 Krzysztof Witek <krzysztof.witek@6wind.com>
 Kuba Kozak <kubax.kozak@intel.com>
 Kumar Amber <kumar.amber@intel.com>
diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c
index 838b3a8f9f..b61dae849d 100644
--- a/lib/ethdev/rte_class_eth.c
+++ b/lib/ethdev/rte_class_eth.c
@@ -67,7 +67,7 @@ eth_representor_cmp(const char *key __rte_unused,
 	const struct rte_eth_dev *edev = opaque;
 	const struct rte_eth_dev_data *data = edev->data;
 	struct rte_eth_devargs eth_da;
-	uint16_t id, nc, np, nf, i, c, p, f;
+	uint16_t id = 0, nc, np, nf, i, c, p, f;
 
 	if ((data->dev_flags & RTE_ETH_DEV_REPRESENTOR) == 0)
 		return -1; /* not a representor port */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.698642100 +0800
+++ 0035-ethdev-fix-build-with-LTO.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From cdd7ab072d1e662b1d06840447e7d1b8ab8946e3 Mon Sep 17 00:00:00 2001
+From 00af2661ac7a56f1f093cb94c4a702ac971b8fe7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cdd7ab072d1e662b1d06840447e7d1b8ab8946e3 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 8b84277954..69b6f4de1d 100644
+index dc8a8637e1..ea09ef90cb 100644
@@ -27 +29 @@
-@@ -716,6 +716,7 @@ Konstantin Ananyev <konstantin.v.ananyev@yandex.ru> <konstantin.ananyev@huawei.c
+@@ -712,6 +712,7 @@ Konstantin Ananyev <konstantin.v.ananyev@yandex.ru> <konstantin.ananyev@huawei.c

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

* patch 'net/mana: fix stats counters' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (34 preceding siblings ...)
  2023-04-09 15:23   ` patch 'ethdev: fix build with LTO' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix getting RSS configuration' " Xueming Li
                     ` (100 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Long Li; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/5475d251f17b88d7353956d9a9be958cb773fcf1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5475d251f17b88d7353956d9a9be958cb773fcf1 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Wed, 22 Feb 2023 15:27:24 -0800
Subject: [PATCH] net/mana: fix stats counters
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit eb6f507afed56915fec7b9e5da3389eb5853ab10 ]

For per port counters and we should report summed values from all
queues.

Fixes: e350b56889bb ("net/mana: report queue statistics")

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/net/mana/mana.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 43221e743e..8a782c0d63 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -616,9 +616,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		if (!txq)
 			continue;
 
-		stats->opackets = txq->stats.packets;
-		stats->obytes = txq->stats.bytes;
-		stats->oerrors = txq->stats.errors;
+		stats->opackets += txq->stats.packets;
+		stats->obytes += txq->stats.bytes;
+		stats->oerrors += txq->stats.errors;
 
 		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
 			stats->q_opackets[i] = txq->stats.packets;
@@ -633,9 +633,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 		if (!rxq)
 			continue;
 
-		stats->ipackets = rxq->stats.packets;
-		stats->ibytes = rxq->stats.bytes;
-		stats->ierrors = rxq->stats.errors;
+		stats->ipackets += rxq->stats.packets;
+		stats->ibytes += rxq->stats.bytes;
+		stats->ierrors += rxq->stats.errors;
 
 		/* There is no good way to get stats->imissed, not setting it */
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.720847100 +0800
+++ 0036-net-mana-fix-stats-counters.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From eb6f507afed56915fec7b9e5da3389eb5853ab10 Mon Sep 17 00:00:00 2001
+From 5475d251f17b88d7353956d9a9be958cb773fcf1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit eb6f507afed56915fec7b9e5da3389eb5853ab10 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/nfp: fix getting RSS configuration' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (35 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/mana: fix stats counters' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'ethdev: remove telemetry Rx mbuf alloc failed field' " Xueming Li
                     ` (99 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Long Wu; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/03cfac3c9935306137f5c4b48beedb179b394577

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 03cfac3c9935306137f5c4b48beedb179b394577 Mon Sep 17 00:00:00 2001
From: Long Wu <long.wu@corigine.com>
Date: Tue, 21 Feb 2023 13:52:22 +0800
Subject: [PATCH] net/nfp: fix getting RSS configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd ]

"NFP_NET_CFG_RSS_IPV4" and "NFP_NET_CFG_RSS_IPV6" represent that
firmware will calculate RSS base on L3 rather than UDP or TCP
information from packets. So the logic of return RSS configuration in
driver is wrong.

Modify code to return the right configuration.

Fixes: 934e4c60fbff ("nfp: add RSS")

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index c962ed0fc0..c9eeaa02fc 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -1256,7 +1256,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 	cfg_rss_ctrl = nn_cfg_readl(hw, NFP_NET_CFG_RSS_CTRL);
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4)
-		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_NONFRAG_IPV4_UDP;
+		rss_hf |= RTE_ETH_RSS_IPV4;
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4_TCP)
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_TCP;
@@ -1271,7 +1271,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP;
 
 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV6)
-		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_NONFRAG_IPV6_UDP;
+		rss_hf |= RTE_ETH_RSS_IPV6;
 
 	/* Propagate current RSS hash functions to caller */
 	rss_conf->rss_hf = rss_hf;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.746208000 +0800
+++ 0037-net-nfp-fix-getting-RSS-configuration.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd Mon Sep 17 00:00:00 2001
+From 03cfac3c9935306137f5c4b48beedb179b394577 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ef26b8a08cd2ba0b47d3ca71316ea6e865abb6fd ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 837056cc12..5922bfea8e 100644
+index c962ed0fc0..c9eeaa02fc 100644
@@ -30 +32 @@
-@@ -1420,7 +1420,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
+@@ -1256,7 +1256,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
@@ -39 +41 @@
-@@ -1435,7 +1435,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
+@@ -1271,7 +1271,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
@@ -46,2 +48,2 @@
- 	if (cfg_rss_ctrl & NFP_NET_CFG_RSS_IPV4_SCTP)
- 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_SCTP;
+ 	/* Propagate current RSS hash functions to caller */
+ 	rss_conf->rss_hf = rss_hf;

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

* patch 'ethdev: remove telemetry Rx mbuf alloc failed field' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (36 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix getting RSS configuration' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set MAC flow action' " Xueming Li
                     ` (98 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/aaa501436cdea8d1b5106a4308895ef216a187a9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From aaa501436cdea8d1b5106a4308895ef216a187a9 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit@amd.com>
Date: Tue, 28 Feb 2023 18:02:30 +0000
Subject: [PATCH] ethdev: remove telemetry Rx mbuf alloc failed field
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6686b2d2a0b68698d7bddf51d5a9861fb8a4eaf3 ]

'eth_dev->data->rx_mbuf_alloc_failed' field is not directly exposed to
user via ethdev APIs but it is used internally to set "stats->rx_nombuf'
which is exposed via ehtdev stat APIs.

But telemetry exposes this field to user via "/ethdev/info",
instead user can get 'rx_nombuf' value from stats via "/ethdev/stats".

Removing 'rx_mbuf_alloc_failed' from telemetry to align with ethdev APIs

Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")

Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 lib/ethdev/rte_ethdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index a40d396677..b9c8f79f8c 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6039,8 +6039,6 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
 	rte_tel_data_add_dict_int(d, "mtu", eth_dev->data->mtu);
 	rte_tel_data_add_dict_u64(d, "rx_mbuf_size_min",
 			eth_dev->data->min_rx_buf_size);
-	rte_tel_data_add_dict_u64(d, "rx_mbuf_alloc_fail",
-			eth_dev->data->rx_mbuf_alloc_failed);
 	rte_ether_format_addr(mac_addr, sizeof(mac_addr),
 			eth_dev->data->mac_addrs);
 	rte_tel_data_add_dict_string(d, "mac_addr", mac_addr);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.767644700 +0800
+++ 0038-ethdev-remove-telemetry-Rx-mbuf-alloc-failed-field.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From 6686b2d2a0b68698d7bddf51d5a9861fb8a4eaf3 Mon Sep 17 00:00:00 2001
+From aaa501436cdea8d1b5106a4308895ef216a187a9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6686b2d2a0b68698d7bddf51d5a9861fb8a4eaf3 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 3814c202cd..3d137523a6 100644
+index a40d396677..b9c8f79f8c 100644
@@ -29 +31 @@
-@@ -6642,8 +6642,6 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
+@@ -6039,8 +6039,6 @@ eth_dev_handle_port_info(const char *cmd __rte_unused,
@@ -31 +33 @@
- 	rte_tel_data_add_dict_uint(d, "rx_mbuf_size_min",
+ 	rte_tel_data_add_dict_u64(d, "rx_mbuf_size_min",
@@ -33 +35 @@
--	rte_tel_data_add_dict_uint(d, "rx_mbuf_alloc_fail",
+-	rte_tel_data_add_dict_u64(d, "rx_mbuf_alloc_fail",

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

* patch 'net/nfp: fix set MAC flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (37 preceding siblings ...)
  2023-04-09 15:23   ` patch 'ethdev: remove telemetry Rx mbuf alloc failed field' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set IPv4 " Xueming Li
                     ` (97 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/a0a1f437b298d6b23564dfb2d8cf10f3e9a66670

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a0a1f437b298d6b23564dfb2d8cf10f3e9a66670 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:08 +0800
Subject: [PATCH] net/nfp: fix set MAC flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ba2766c4203aa7d7be733eedd8f2ee785701faac ]

The former logic of set MAC source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right MAC address as expected.

Fixes: 4f6983154570 ("net/nfp: support MAC source flow action")
Fixes: eecc7ca3088a ("net/nfp: support MAC destination flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index b3f4861ae4..51862d73d8 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2055,6 +2055,7 @@ nfp_flow_action_set_mac(char *act_data,
 		bool mac_src_flag,
 		bool mac_set_flag)
 {
+	uint8_t i;
 	size_t act_size;
 	struct nfp_fl_act_set_eth *set_eth;
 	const struct rte_flow_action_set_mac *set_mac;
@@ -2073,9 +2074,13 @@ nfp_flow_action_set_mac(char *act_data,
 	if (mac_src_flag) {
 		rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
 	} else {
 		rte_memcpy(&set_eth->eth_addr[0],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[i] = 0xff;
 	}
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.791852500 +0800
+++ 0039-net-nfp-fix-set-MAC-flow-action.patch	2023-04-09 21:45:38.619042200 +0800
@@ -1 +1 @@
-From ba2766c4203aa7d7be733eedd8f2ee785701faac Mon Sep 17 00:00:00 2001
+From a0a1f437b298d6b23564dfb2d8cf10f3e9a66670 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ba2766c4203aa7d7be733eedd8f2ee785701faac ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 0c38925701..f373171d7e 100644
+index b3f4861ae4..51862d73d8 100644
@@ -28 +30 @@
-@@ -2066,6 +2066,7 @@ nfp_flow_action_set_mac(char *act_data,
+@@ -2055,6 +2055,7 @@ nfp_flow_action_set_mac(char *act_data,
@@ -36 +38 @@
-@@ -2084,9 +2085,13 @@ nfp_flow_action_set_mac(char *act_data,
+@@ -2073,9 +2074,13 @@ nfp_flow_action_set_mac(char *act_data,

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

* patch 'net/nfp: fix set IPv4 flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (38 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set MAC flow action' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set IPv6 " Xueming Li
                     ` (96 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/d6fb8fc9c1378209e92e0d7b04012787c0dd671d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d6fb8fc9c1378209e92e0d7b04012787c0dd671d Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:09 +0800
Subject: [PATCH] net/nfp: fix set IPv4 flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d4b453c42989eb689392fccc7d4b0bc5e1499470 ]

The former logic of set IPv4 source/destination address flow action
don't consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4 address as expected.

Fixes: ab80975b0a14 ("net/nfp: support IPv4 source flow action")
Fixes: f85c1e05bff3 ("net/nfp: support IPv4 destination flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 51862d73d8..14c949d730 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2121,10 +2121,13 @@ nfp_flow_action_set_ip(char *act_data,
 	set_ip->reserved     = 0;
 
 	set_ipv4 = (const struct rte_flow_action_set_ipv4 *)action->conf;
-	if (ip_src_flag)
+	if (ip_src_flag) {
 		set_ip->ipv4_src = set_ipv4->ipv4_addr;
-	else
+		set_ip->ipv4_src_mask = RTE_BE32(0xffffffff);
+	} else {
 		set_ip->ipv4_dst = set_ipv4->ipv4_addr;
+		set_ip->ipv4_dst_mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.816181600 +0800
+++ 0040-net-nfp-fix-set-IPv4-flow-action.patch	2023-04-09 21:45:38.629042200 +0800
@@ -1 +1 @@
-From d4b453c42989eb689392fccc7d4b0bc5e1499470 Mon Sep 17 00:00:00 2001
+From d6fb8fc9c1378209e92e0d7b04012787c0dd671d Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d4b453c42989eb689392fccc7d4b0bc5e1499470 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index f373171d7e..39493ce98d 100644
+index 51862d73d8..14c949d730 100644
@@ -28 +30 @@
-@@ -2132,10 +2132,13 @@ nfp_flow_action_set_ip(char *act_data,
+@@ -2121,10 +2121,13 @@ nfp_flow_action_set_ip(char *act_data,

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

* patch 'net/nfp: fix set IPv6 flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (39 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set IPv4 " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set TP " Xueming Li
                     ` (95 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dcc0be2c8a8ffa634c5b2128f27708f0887b5925

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dcc0be2c8a8ffa634c5b2128f27708f0887b5925 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:10 +0800
Subject: [PATCH] net/nfp: fix set IPv6 flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 784835e690e011754a67a240fdc6154ea349ec20 ]

The former logic of set IPv6 source/destination address flow action
don't consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv6 address as expected.

Fixes: 596ae2217214 ("net/nfp: support IPv6 source flow action")
Fixes: 51384f79b264 ("net/nfp: support IPv6 destination flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 14c949d730..d6ab0a1e8d 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2152,8 +2152,10 @@ nfp_flow_action_set_ipv6(char *act_data,
 	set_ip->head.len_lw = act_size >> NFP_FL_LW_SIZ;
 	set_ip->reserved = 0;
 
-	for (i = 0; i < 4; i++)
-		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i];
+	for (i = 0; i < 4; i++) {
+		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i * 4];
+		set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.839150500 +0800
+++ 0041-net-nfp-fix-set-IPv6-flow-action.patch	2023-04-09 21:45:38.629042200 +0800
@@ -1 +1 @@
-From 784835e690e011754a67a240fdc6154ea349ec20 Mon Sep 17 00:00:00 2001
+From dcc0be2c8a8ffa634c5b2128f27708f0887b5925 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 784835e690e011754a67a240fdc6154ea349ec20 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 39493ce98d..d1fe744758 100644
+index 14c949d730..d6ab0a1e8d 100644
@@ -28 +30 @@
-@@ -2163,8 +2163,10 @@ nfp_flow_action_set_ipv6(char *act_data,
+@@ -2152,8 +2152,10 @@ nfp_flow_action_set_ipv6(char *act_data,

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

* patch 'net/nfp: fix set TP flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (40 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set IPv6 " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set TTL " Xueming Li
                     ` (94 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/264cbadbee9a059d2f0f408e2fbc2f3b2ada2113

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 264cbadbee9a059d2f0f408e2fbc2f3b2ada2113 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:11 +0800
Subject: [PATCH] net/nfp: fix set TP flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 050851abe07671dd4ec501d4f211fc45ec0795f3 ]

The former logic of set TP source/destination flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TP as expected.

Fixes: fc185097bbe6 ("net/nfp: support TP source flow action")
Fixes: 87986df09d75 ("net/nfp: support TP destination flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index d6ab0a1e8d..dedc2d2dc4 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2179,10 +2179,13 @@ nfp_flow_action_set_tp(char *act_data,
 	set_tp->reserved     = 0;
 
 	set_tp_conf = (const struct rte_flow_action_set_tp *)action->conf;
-	if (tp_src_flag)
+	if (tp_src_flag) {
 		set_tp->src_port = set_tp_conf->port;
-	else
+		set_tp->src_port_mask = RTE_BE16(0xffff);
+	} else {
 		set_tp->dst_port = set_tp_conf->port;
+		set_tp->dst_port_mask = RTE_BE16(0xffff);
+	}
 }
 
 static int
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.865085600 +0800
+++ 0042-net-nfp-fix-set-TP-flow-action.patch	2023-04-09 21:45:38.629042200 +0800
@@ -1 +1 @@
-From 050851abe07671dd4ec501d4f211fc45ec0795f3 Mon Sep 17 00:00:00 2001
+From 264cbadbee9a059d2f0f408e2fbc2f3b2ada2113 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 050851abe07671dd4ec501d4f211fc45ec0795f3 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index d1fe744758..5be4c4f18a 100644
+index d6ab0a1e8d..dedc2d2dc4 100644
@@ -28 +30 @@
-@@ -2190,10 +2190,13 @@ nfp_flow_action_set_tp(char *act_data,
+@@ -2179,10 +2179,13 @@ nfp_flow_action_set_tp(char *act_data,

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

* patch 'net/nfp: fix set TTL flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (41 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set TP " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix set DSCP " Xueming Li
                     ` (93 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/336d6c1c41f5a31c7d703496125e4e72b345f5d1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 336d6c1c41f5a31c7d703496125e4e72b345f5d1 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:12 +0800
Subject: [PATCH] net/nfp: fix set TTL flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7b661f403fabbc7ac55785403cace34f8f6cf21d ]

The former logic of set TTL flow action don't consider the mask
filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TTL as expected.

Fixes: ac12e126c482 ("net/nfp: support TTL flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index dedc2d2dc4..660a777e6d 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2241,6 +2241,7 @@ nfp_flow_action_set_ttl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	ttl_tos->ipv4_ttl = ttl_conf->ttl_value;
+	ttl_tos->ipv4_ttl_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2264,6 +2265,7 @@ nfp_flow_action_set_hl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	tc_hl->ipv6_hop_limit = ttl_conf->ttl_value;
+	tc_hl->ipv6_hop_limit_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.891022400 +0800
+++ 0043-net-nfp-fix-set-TTL-flow-action.patch	2023-04-09 21:45:38.629042200 +0800
@@ -1 +1 @@
-From 7b661f403fabbc7ac55785403cace34f8f6cf21d Mon Sep 17 00:00:00 2001
+From 336d6c1c41f5a31c7d703496125e4e72b345f5d1 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7b661f403fabbc7ac55785403cace34f8f6cf21d ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 5be4c4f18a..77f249e2b9 100644
+index dedc2d2dc4..660a777e6d 100644
@@ -27 +29 @@
-@@ -2252,6 +2252,7 @@ nfp_flow_action_set_ttl(char *act_data,
+@@ -2241,6 +2241,7 @@ nfp_flow_action_set_ttl(char *act_data,
@@ -35 +37 @@
-@@ -2275,6 +2276,7 @@ nfp_flow_action_set_hl(char *act_data,
+@@ -2264,6 +2265,7 @@ nfp_flow_action_set_hl(char *act_data,

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

* patch 'net/nfp: fix set DSCP flow action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (42 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set TTL " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/nfp: fix offload of multiple output actions' " Xueming Li
                     ` (92 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/fc325877f64eba2eca025c9a449b1a910e912566

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fc325877f64eba2eca025c9a449b1a910e912566 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 21 Feb 2023 18:35:13 +0800
Subject: [PATCH] net/nfp: fix set DSCP flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 449c68dc9c9475ba780b12046825ae643947742c ]

The former logic of set IPv4/v6 DSCP flow action don't consider the
mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4/v6 DSCP as expected.

Fixes: 9c665d70f7a7 ("net/nfp: support IPv4 DSCP flow action")
Fixes: 3202b003bec1 ("net/nfp: support IPv6 DSCP flow action")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 660a777e6d..49305a4152 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2289,6 +2289,7 @@ nfp_flow_action_set_tos(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	ttl_tos->ipv4_tos = tos_conf->dscp;
+	ttl_tos->ipv4_tos_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2312,6 +2313,7 @@ nfp_flow_action_set_tc(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	tc_hl->ipv6_tc = tos_conf->dscp;
+	tc_hl->ipv6_tc_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.915271700 +0800
+++ 0044-net-nfp-fix-set-DSCP-flow-action.patch	2023-04-09 21:45:38.639042200 +0800
@@ -1 +1 @@
-From 449c68dc9c9475ba780b12046825ae643947742c Mon Sep 17 00:00:00 2001
+From fc325877f64eba2eca025c9a449b1a910e912566 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 449c68dc9c9475ba780b12046825ae643947742c ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 77f249e2b9..53029d00c9 100644
+index 660a777e6d..49305a4152 100644
@@ -28 +30 @@
-@@ -2300,6 +2300,7 @@ nfp_flow_action_set_tos(char *act_data,
+@@ -2289,6 +2289,7 @@ nfp_flow_action_set_tos(char *act_data,
@@ -36 +38 @@
-@@ -2323,6 +2324,7 @@ nfp_flow_action_set_tc(char *act_data,
+@@ -2312,6 +2313,7 @@ nfp_flow_action_set_tc(char *act_data,

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

* patch 'net/nfp: fix offload of multiple output actions' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (43 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix set DSCP " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'app/testpmd: fix secondary process packet forwarding' " Xueming Li
                     ` (91 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Chaoyong He; +Cc: Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/17637f9c0f2ae5434e363b9ae79d1338b0ec48c9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 17637f9c0f2ae5434e363b9ae79d1338b0ec48c9 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he@corigine.com>
Date: Tue, 28 Feb 2023 17:03:05 +0800
Subject: [PATCH] net/nfp: fix offload of multiple output actions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 ]

When offload the flow with multiple output actions, the
original logic add a flag to every output action wrongly,
and this cause only the first output action can take effect.
Fix it by only add the flag to the last output action.

Fixes: 4d946034bf9c ("net/nfp: support basic flow actions")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 49305a4152..50b166786a 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2022,7 +2022,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
 static int
 nfp_flow_action_output(char *act_data,
 		const struct rte_flow_action *action,
-		struct nfp_fl_rule_metadata *nfp_flow_meta)
+		struct nfp_fl_rule_metadata *nfp_flow_meta,
+		uint32_t output_cnt)
 {
 	size_t act_size;
 	struct rte_eth_dev *ethdev;
@@ -2041,8 +2042,9 @@ nfp_flow_action_output(char *act_data,
 	output = (struct nfp_fl_act_output *)act_data;
 	output->head.jump_id = NFP_FL_ACTION_OPCODE_OUTPUT;
 	output->head.len_lw  = act_size >> NFP_FL_LW_SIZ;
-	output->flags        = rte_cpu_to_be_16(NFP_FL_OUT_FLAGS_LAST);
 	output->port         = rte_cpu_to_be_32(representor->port_id);
+	if (output_cnt == 0)
+		output->flags = rte_cpu_to_be_16(NFP_FL_OUT_FLAGS_LAST);
 
 	nfp_flow_meta->shortcut = rte_cpu_to_be_32(representor->port_id);
 
@@ -3254,12 +3256,27 @@ nfp_flow_action_raw_encap(struct nfp_app_fw_flower *app_fw_flower,
 	return ret;
 }
 
+static uint32_t
+nfp_flow_count_output(const struct rte_flow_action actions[])
+{
+	uint32_t count = 0;
+	const struct rte_flow_action *action;
+
+	for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) {
+		if (action->type == RTE_FLOW_ACTION_TYPE_PORT_ID)
+			count++;
+	}
+
+	return count;
+}
+
 static int
 nfp_flow_compile_action(struct nfp_flower_representor *representor,
 		const struct rte_flow_action actions[],
 		struct rte_flow *nfp_flow)
 {
 	int ret = 0;
+	uint32_t count;
 	char *position;
 	char *action_data;
 	bool ttl_tos_flag = false;
@@ -3278,6 +3295,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
 	position      = action_data;
 	meta_tci = (struct nfp_flower_meta_tci *)nfp_flow->payload.unmasked_data;
 
+	count = nfp_flow_count_output(actions);
+
 	for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) {
 		switch (action->type) {
 		case RTE_FLOW_ACTION_TYPE_VOID:
@@ -3294,7 +3313,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
 			break;
 		case RTE_FLOW_ACTION_TYPE_PORT_ID:
 			PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_PORT_ID");
-			ret = nfp_flow_action_output(position, action, nfp_flow_meta);
+			count--;
+			ret = nfp_flow_action_output(position, action, nfp_flow_meta, count);
 			if (ret != 0) {
 				PMD_DRV_LOG(ERR, "Failed when process"
 						" RTE_FLOW_ACTION_TYPE_PORT_ID");
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.939259000 +0800
+++ 0045-net-nfp-fix-offload-of-multiple-output-actions.patch	2023-04-09 21:45:38.639042200 +0800
@@ -1 +1 @@
-From 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 Mon Sep 17 00:00:00 2001
+From 17637f9c0f2ae5434e363b9ae79d1338b0ec48c9 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6a49f38c30eccc2e9040e7c5d78e4cbadbe04937 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 53029d00c9..41b722f4d8 100644
+index 49305a4152..50b166786a 100644
@@ -27 +29 @@
-@@ -2033,7 +2033,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
+@@ -2022,7 +2022,8 @@ nfp_flow_compile_items(struct nfp_flower_representor *representor,
@@ -37 +39 @@
-@@ -2052,8 +2053,9 @@ nfp_flow_action_output(char *act_data,
+@@ -2041,8 +2042,9 @@ nfp_flow_action_output(char *act_data,
@@ -48,2 +50,2 @@
-@@ -3307,12 +3309,27 @@ nfp_flow_action_meter(struct nfp_flower_representor *representor,
- 	return 0;
+@@ -3254,12 +3256,27 @@ nfp_flow_action_raw_encap(struct nfp_app_fw_flower *app_fw_flower,
+ 	return ret;
@@ -76 +78 @@
-@@ -3331,6 +3348,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
+@@ -3278,6 +3295,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
@@ -85 +87 @@
-@@ -3347,7 +3366,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,
+@@ -3294,7 +3313,8 @@ nfp_flow_compile_action(struct nfp_flower_representor *representor,

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

* patch 'app/testpmd: fix secondary process packet forwarding' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (44 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/nfp: fix offload of multiple output actions' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/ixgbe: fix IPv6 mask in flow director' " Xueming Li
                     ` (90 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Shiyang He; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/b0901e6d5b88bb3ec324e02b2dd2337a04faa387

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b0901e6d5b88bb3ec324e02b2dd2337a04faa387 Mon Sep 17 00:00:00 2001
From: Shiyang He <shiyangx.he@intel.com>
Date: Wed, 8 Mar 2023 16:19:47 +0000
Subject: [PATCH] app/testpmd: fix secondary process packet forwarding
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced ]

Under multi-process scenario, the secondary process gets queue state
from the wrong location (the global variable 'ports'). Therefore, the
secondary process can not forward since "stream_init" is not called.

This commit fixes the issue by calling 'rte_eth_rx/tx_queue_info_get'
to get queue state from shared memory.

Fixes: 3c4426db54fc ("app/testpmd: do not poll stopped queues")

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/testpmd.c | 72 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 71 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index adf19cfb9e..60b5942d80 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2342,6 +2342,70 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)
 	}
 }
 
+static void
+update_rx_queue_state(uint16_t port_id, uint16_t queue_id)
+{
+	struct rte_eth_rxq_info rx_qinfo;
+	int32_t rc;
+
+	rc = rte_eth_rx_queue_info_get(port_id,
+			queue_id, &rx_qinfo);
+	if (rc == 0) {
+		ports[port_id].rxq[queue_id].state =
+			rx_qinfo.queue_state;
+	} else if (rc == -ENOTSUP) {
+		/*
+		 * Set the rxq state to RTE_ETH_QUEUE_STATE_STARTED
+		 * to ensure that the PMDs do not implement
+		 * rte_eth_rx_queue_info_get can forward.
+		 */
+		ports[port_id].rxq[queue_id].state =
+			RTE_ETH_QUEUE_STATE_STARTED;
+	} else {
+		TESTPMD_LOG(WARNING,
+			"Failed to get rx queue info\n");
+	}
+}
+
+static void
+update_tx_queue_state(uint16_t port_id, uint16_t queue_id)
+{
+	struct rte_eth_txq_info tx_qinfo;
+	int32_t rc;
+
+	rc = rte_eth_tx_queue_info_get(port_id,
+			queue_id, &tx_qinfo);
+	if (rc == 0) {
+		ports[port_id].txq[queue_id].state =
+			tx_qinfo.queue_state;
+	} else if (rc == -ENOTSUP) {
+		/*
+		 * Set the txq state to RTE_ETH_QUEUE_STATE_STARTED
+		 * to ensure that the PMDs do not implement
+		 * rte_eth_tx_queue_info_get can forward.
+		 */
+		ports[port_id].txq[queue_id].state =
+			RTE_ETH_QUEUE_STATE_STARTED;
+	} else {
+		TESTPMD_LOG(WARNING,
+			"Failed to get tx queue info\n");
+	}
+}
+
+static void
+update_queue_state(void)
+{
+	portid_t pi;
+	queueid_t qi;
+
+	RTE_ETH_FOREACH_DEV(pi) {
+		for (qi = 0; qi < nb_rxq; qi++)
+			update_rx_queue_state(pi, qi);
+		for (qi = 0; qi < nb_txq; qi++)
+			update_tx_queue_state(pi, qi);
+	}
+}
+
 /*
  * Launch packet forwarding configuration.
  */
@@ -2381,9 +2445,12 @@ start_packet_forwarding(int with_tx_first)
 	if (!pkt_fwd_shared_rxq_check())
 		return;
 
-	if (stream_init != NULL)
+	if (stream_init != NULL) {
+		if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+			update_queue_state();
 		for (i = 0; i < cur_fwd_config.nb_fwd_streams; i++)
 			stream_init(fwd_streams[i]);
+	}
 
 	port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin;
 	if (port_fwd_begin != NULL) {
@@ -3143,6 +3210,9 @@ start_port(portid_t pid)
 		pl[cfg_pi++] = pi;
 	}
 
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		update_queue_state();
+
 	if (at_least_one_port_successfully_started && !no_link_check)
 		check_all_ports_link_status(RTE_PORT_ALL);
 	else if (at_least_one_port_exist & all_ports_already_started)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.964731200 +0800
+++ 0046-app-testpmd-fix-secondary-process-packet-forwarding.patch	2023-04-09 21:45:38.639042200 +0800
@@ -1 +1 @@
-From 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced Mon Sep 17 00:00:00 2001
+From b0901e6d5b88bb3ec324e02b2dd2337a04faa387 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5028f207a4fa6d5cdd86019e43d2e2d80fa21ced ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index b6197aa258..0032696608 100644
+index adf19cfb9e..60b5942d80 100644
@@ -26,2 +28,2 @@
-@@ -2397,6 +2397,70 @@ common_fwd_stream_init(struct fwd_stream *fs)
- 	fs->disabled = rx_stopped || tx_stopped;
+@@ -2342,6 +2342,70 @@ launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore)
+ 	}
@@ -97 +99 @@
-@@ -2436,9 +2500,12 @@ start_packet_forwarding(int with_tx_first)
+@@ -2381,9 +2445,12 @@ start_packet_forwarding(int with_tx_first)
@@ -111 +113 @@
-@@ -3198,6 +3265,9 @@ start_port(portid_t pid)
+@@ -3143,6 +3210,9 @@ start_port(portid_t pid)

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

* patch 'net/ixgbe: fix IPv6 mask in flow director' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (45 preceding siblings ...)
  2023-04-09 15:23   ` patch 'app/testpmd: fix secondary process packet forwarding' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/i40e: revert link status check on device start' " Xueming Li
                     ` (89 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Kaiwen Deng; +Cc: Song Jiale, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dc67b490e8485bc61fdc6d07352dd5242a5e9722

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dc67b490e8485bc61fdc6d07352dd5242a5e9722 Mon Sep 17 00:00:00 2001
From: Kaiwen Deng <kaiwenx.deng@intel.com>
Date: Fri, 3 Mar 2023 12:52:26 +0800
Subject: [PATCH] net/ixgbe: fix IPv6 mask in flow director
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 444505f933f197bd064c7f801fa86e88d5edfce5 ]

Rules without addr mask cannot be created together in ixgbe
when setting IPv6 addr mask to default value as 0.

This commit is to change the default value of IPv6 addr mask as '0xFF'.

Fixes: cba954b7beda ("net/ixgbe: enable IPv6 mask in flow rules")
Fixes: 7d629cacedee ("net/ixgbe: enable IPv6 for consistent API")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Tested-by: Song Jiale <songx.jiale@intel.com>
---
 .mailmap                       |  1 +
 drivers/net/ixgbe/ixgbe_flow.c | 16 ++++++----------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/.mailmap b/.mailmap
index ea09ef90cb..e9ecebafc1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1247,6 +1247,7 @@ Smadar Fuks <smadarf@marvell.com>
 Solal Pirelli <solal.pirelli@gmail.com>
 Solganik Alexander <sashas@lightbitslabs.com>
 Somnath Kotur <somnath.kotur@broadcom.com>
+Song Jiale <songx.jiale@intel.com>
 Song Zhu <song.zhu@arm.com>
 Sony Chacko <sony.chacko@qlogic.com>
 Sotiris Salloumis <sotiris.salloumis@ericsson.com>
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index d2ba87df27..7cccbfddb3 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1645,10 +1645,6 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 	memset(&rule->mask, 0xFF, sizeof(struct ixgbe_hw_fdir_mask));
 	rule->mask.vlan_tci_mask = 0;
 	rule->mask.flex_bytes_mask = 0;
-	rule->mask.dst_port_mask = 0;
-	rule->mask.src_port_mask = 0;
-	rule->mask.src_ipv6_mask = 0;
-	rule->mask.dst_ipv6_mask = 0;
 
 	/**
 	 * The first not void item should be
@@ -1922,9 +1918,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check src addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.src_addr[j] == UINT8_MAX) {
-				rule->mask.src_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.src_addr[j] != 0) {
+			if (ipv6_mask->hdr.src_addr[j] == 0) {
+				rule->mask.src_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.src_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1935,9 +1931,9 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
 
 		/* check dst addr mask */
 		for (j = 0; j < 16; j++) {
-			if (ipv6_mask->hdr.dst_addr[j] == UINT8_MAX) {
-				rule->mask.dst_ipv6_mask |= 1 << j;
-			} else if (ipv6_mask->hdr.dst_addr[j] != 0) {
+			if (ipv6_mask->hdr.dst_addr[j] == 0) {
+				rule->mask.dst_ipv6_mask &= ~(1 << j);
+			} else if (ipv6_mask->hdr.dst_addr[j] != UINT8_MAX) {
 				memset(rule, 0, sizeof(struct ixgbe_fdir_rule));
 				rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.986689900 +0800
+++ 0047-net-ixgbe-fix-IPv6-mask-in-flow-director.patch	2023-04-09 21:45:38.649042200 +0800
@@ -1 +1 @@
-From 444505f933f197bd064c7f801fa86e88d5edfce5 Mon Sep 17 00:00:00 2001
+From dc67b490e8485bc61fdc6d07352dd5242a5e9722 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 444505f933f197bd064c7f801fa86e88d5edfce5 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index 69b6f4de1d..5b42f87d1e 100644
+index ea09ef90cb..e9ecebafc1 100644
@@ -26 +28 @@
-@@ -1253,6 +1253,7 @@ Smadar Fuks <smadarf@marvell.com>
+@@ -1247,6 +1247,7 @@ Smadar Fuks <smadarf@marvell.com>
@@ -35 +37 @@
-index 79c84044af..eac81ee489 100644
+index d2ba87df27..7cccbfddb3 100644

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

* patch 'net/i40e: revert link status check on device start' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (46 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/ixgbe: fix IPv6 mask in flow director' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/i40e: fix maximum frame size configuration' " Xueming Li
                     ` (88 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: David Marchand; +Cc: Simei Su, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/287a57f832421a1c912332f5ca7a952098f5065f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 287a57f832421a1c912332f5ca7a952098f5065f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 13 Dec 2022 10:18:37 +0100
Subject: [PATCH] net/i40e: revert link status check on device start
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a8ca8edf8c076c765c6d142ab4664a1f61414233 ]

The mentioned changes broke existing applications when the link status
of i40e ports is down at the time the port is started.
Revert those changes, the original issue will need a different fix.

Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level")
Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Simei Su <simei.su@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 50 +++++-----------------------------
 1 file changed, 7 insertions(+), 43 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7726a89d99..a982e42264 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -387,7 +387,6 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
 				      struct rte_ether_addr *mac_addr);
 
 static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
-static void i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size);
 
 static int i40e_ethertype_filter_convert(
 	const struct rte_eth_ethertype_filter *input,
@@ -1711,6 +1710,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	 */
 	i40e_add_tx_flow_control_drop_filter(pf);
 
+	/* Set the max frame size to 0x2600 by default,
+	 * in case other drivers changed the default value.
+	 */
+	i40e_aq_set_mac_config(hw, I40E_FRAME_SIZE_MAX, TRUE, false, 0, NULL);
+
 	/* initialize RSS rule list */
 	TAILQ_INIT(&pf->rss_config_list);
 
@@ -2328,7 +2332,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 	uint32_t intr_vector = 0;
 	struct i40e_vsi *vsi;
 	uint16_t nb_rxq, nb_txq;
-	uint16_t max_frame_size;
 
 	hw->adapter_stopped = 0;
 
@@ -2467,9 +2470,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 			    "please call hierarchy_commit() "
 			    "before starting the port");
 
-	max_frame_size = dev->data->mtu + I40E_ETH_OVERHEAD;
-	i40e_set_mac_max_frame(dev, max_frame_size);
-
 	return I40E_SUCCESS;
 
 tx_err:
@@ -2809,9 +2809,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
 	return i40e_phy_conf_link(hw, abilities, speed, false);
 }
 
-#define CHECK_INTERVAL             100  /* 100ms */
-#define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
-
 static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
@@ -2878,6 +2875,8 @@ static __rte_always_inline void
 update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
 	bool enable_lse, int wait_to_complete)
 {
+#define CHECK_INTERVAL             100  /* 100ms */
+#define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
 	uint32_t rep_cnt = MAX_REPEAT_TIME;
 	struct i40e_link_status link_status;
 	int status;
@@ -6738,7 +6737,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
 			if (!ret)
 				rte_eth_dev_callback_process(dev,
 					RTE_ETH_EVENT_INTR_LSC, NULL);
-
 			break;
 		default:
 			PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
@@ -12123,40 +12121,6 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
 	return ret;
 }
 
-static void
-i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
-{
-	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t rep_cnt = MAX_REPEAT_TIME;
-	struct rte_eth_link link;
-	enum i40e_status_code status;
-	bool can_be_set = true;
-
-	/*
-	 * I40E_MEDIA_TYPE_BASET link up can be ignored
-	 * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type
-	 * is I40E_MEDIA_TYPE_UNKNOWN
-	 */
-	if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
-	    hw->phy.media_type != I40E_MEDIA_TYPE_UNKNOWN) {
-		do {
-			update_link_reg(hw, &link);
-			if (link.link_status)
-				break;
-			rte_delay_ms(CHECK_INTERVAL);
-		} while (--rep_cnt);
-		can_be_set = !!link.link_status;
-	}
-
-	if (can_be_set) {
-		status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
-		if (status != I40E_SUCCESS)
-			PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
-	} else {
-		PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
-	}
-}
-
 RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(i40e_logtype_driver, driver, NOTICE);
 #ifdef RTE_ETHDEV_DEBUG_RX
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.011846800 +0800
+++ 0048-net-i40e-revert-link-status-check-on-device-start.patch	2023-04-09 21:45:38.649042200 +0800
@@ -1 +1 @@
-From a8ca8edf8c076c765c6d142ab4664a1f61414233 Mon Sep 17 00:00:00 2001
+From 287a57f832421a1c912332f5ca7a952098f5065f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a8ca8edf8c076c765c6d142ab4664a1f61414233 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/i40e: fix maximum frame size configuration' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (47 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/i40e: revert link status check on device start' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/ice: fix Rx timestamp' " Xueming Li
                     ` (87 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Simei Su; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8ec56c115aa1debcc3f672eb95ba646e9b2d6da5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8ec56c115aa1debcc3f672eb95ba646e9b2d6da5 Mon Sep 17 00:00:00 2001
From: Simei Su <simei.su@intel.com>
Date: Mon, 6 Mar 2023 20:18:53 +0800
Subject: [PATCH] net/i40e: fix maximum frame size configuration
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 82fcf20d039c5990ea7829cea2996c530d260fab ]

This patch sets max frame size at port level rather than queue level
to avoid unexpected packets received by port.

Fixes: a8ca8edf8c07 ("net/i40e: revert link status check on device start")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index a982e42264..371f42233e 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1710,11 +1710,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	 */
 	i40e_add_tx_flow_control_drop_filter(pf);
 
-	/* Set the max frame size to 0x2600 by default,
-	 * in case other drivers changed the default value.
-	 */
-	i40e_aq_set_mac_config(hw, I40E_FRAME_SIZE_MAX, TRUE, false, 0, NULL);
-
 	/* initialize RSS rule list */
 	TAILQ_INIT(&pf->rss_config_list);
 
@@ -2332,6 +2327,7 @@ i40e_dev_start(struct rte_eth_dev *dev)
 	uint32_t intr_vector = 0;
 	struct i40e_vsi *vsi;
 	uint16_t nb_rxq, nb_txq;
+	uint16_t max_frame_size;
 
 	hw->adapter_stopped = 0;
 
@@ -2452,7 +2448,7 @@ i40e_dev_start(struct rte_eth_dev *dev)
 			PMD_DRV_LOG(WARNING, "Fail to set phy mask");
 
 		/* Call get_link_info aq command to enable/disable LSE */
-		i40e_dev_link_update(dev, 0);
+		i40e_dev_link_update(dev, 1);
 	}
 
 	if (dev->data->dev_conf.intr_conf.rxq == 0) {
@@ -2470,6 +2466,13 @@ i40e_dev_start(struct rte_eth_dev *dev)
 			    "please call hierarchy_commit() "
 			    "before starting the port");
 
+	max_frame_size = dev->data->mtu ?
+		dev->data->mtu + I40E_ETH_OVERHEAD :
+		I40E_FRAME_SIZE_MAX;
+
+	/* Set the max frame size to HW*/
+	i40e_aq_set_mac_config(hw, max_frame_size, TRUE, false, 0, NULL);
+
 	return I40E_SUCCESS;
 
 tx_err:
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.039770000 +0800
+++ 0049-net-i40e-fix-maximum-frame-size-configuration.patch	2023-04-09 21:45:38.649042200 +0800
@@ -1 +1 @@
-From 82fcf20d039c5990ea7829cea2996c530d260fab Mon Sep 17 00:00:00 2001
+From 8ec56c115aa1debcc3f672eb95ba646e9b2d6da5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 82fcf20d039c5990ea7829cea2996c530d260fab ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

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

* patch 'net/ice: fix Rx timestamp' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (48 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/i40e: fix maximum frame size configuration' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:23   ` patch 'net/cnxk: fix LBK BPID usage' " Xueming Li
                     ` (86 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Simei Su; +Cc: Wenjun Wu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/14688b03c0b50b94694957b516a7e77d929b9d5c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 14688b03c0b50b94694957b516a7e77d929b9d5c Mon Sep 17 00:00:00 2001
From: Simei Su <simei.su@intel.com>
Date: Wed, 8 Mar 2023 12:36:55 +0800
Subject: [PATCH] net/ice: fix Rx timestamp
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 ]

For E822, the time value in Rx Flex Descriptors is 0 due to the
missing PHY clock timer setup. Also, the source clock index in use
is based on device capabilities instead of always being zero.

Fixes: 953e74e6b73a ("net/ice: enable Rx timestamp on flex descriptor")
Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP")
Fixes: fb800fde66f4 ("net/ice/base: work around missing PTP capabilities")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/net/ice/base/ice_common.c |  4 +---
 drivers/net/ice/ice_ethdev.c      | 36 +++++++++++++++++++------------
 drivers/net/ice/ice_rxtx.h        | 11 +++++-----
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 5391bd666b..1a02aad869 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -2554,9 +2554,7 @@ ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
 			 struct ice_aqc_list_caps_elem *cap)
 {
 	struct ice_ts_func_info *info = &func_p->ts_func_info;
-	u32 number = ICE_TS_FUNC_ENA_M | ICE_TS_SRC_TMR_OWND_M |
-		     ICE_TS_TMR_ENA_M | ICE_TS_TMR_IDX_OWND_M |
-		     ICE_TS_TMR_IDX_ASSOC_M;
+	u32 number = LE32_TO_CPU(cap->number);
 	u8 clk_freq;
 
 	ice_debug(hw, ICE_DBG_INIT, "1588 func caps: raw value %x\n", number);
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0bc739daf0..263c80a6eb 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2399,6 +2399,17 @@ ice_dev_init(struct rte_eth_dev *dev)
 	/* Initialize TM configuration */
 	ice_tm_conf_init(dev);
 
+	if (ice_is_e810(hw))
+		hw->phy_cfg = ICE_PHY_E810;
+	else
+		hw->phy_cfg = ICE_PHY_E822;
+
+	if (hw->phy_cfg == ICE_PHY_E822) {
+		ret = ice_start_phy_timer_e822(hw, hw->pf_id, true);
+		if (ret)
+			PMD_INIT_LOG(ERR, "Failed to start phy timer\n");
+	}
+
 	if (!ad->is_safe_mode) {
 		ret = ice_flow_init(ad);
 		if (ret) {
@@ -5800,11 +5811,6 @@ ice_timesync_enable(struct rte_eth_dev *dev)
 		return -1;
 	}
 
-	if (ice_is_e810(hw))
-		hw->phy_cfg = ICE_PHY_E810;
-	else
-		hw->phy_cfg = ICE_PHY_E822;
-
 	if (hw->func_caps.ts_func_info.src_tmr_owned) {
 		ret = ice_ptp_init_phc(hw);
 		if (ret) {
@@ -5925,16 +5931,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_adapter *ad =
 			ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
 	uint32_t hi, lo, lo2;
 	uint64_t time, ns;
 
-	lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
-	hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0));
-	lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
+	lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
+	hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx));
+	lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
 
 	if (lo2 < lo) {
-		lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
-		hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0));
+		lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
+		hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx));
 	}
 
 	time = ((uint64_t)hi << 32) | lo;
@@ -5950,6 +5957,7 @@ ice_timesync_disable(struct rte_eth_dev *dev)
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_adapter *ad =
 			ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
 	uint64_t val;
 	uint8_t lport;
 
@@ -5957,12 +5965,12 @@ ice_timesync_disable(struct rte_eth_dev *dev)
 
 	ice_clear_phy_tstamp(hw, lport, 0);
 
-	val = ICE_READ_REG(hw, GLTSYN_ENA(0));
+	val = ICE_READ_REG(hw, GLTSYN_ENA(tmr_idx));
 	val &= ~GLTSYN_ENA_TSYN_ENA_M;
-	ICE_WRITE_REG(hw, GLTSYN_ENA(0), val);
+	ICE_WRITE_REG(hw, GLTSYN_ENA(tmr_idx), val);
 
-	ICE_WRITE_REG(hw, GLTSYN_INCVAL_L(0), 0);
-	ICE_WRITE_REG(hw, GLTSYN_INCVAL_H(0), 0);
+	ICE_WRITE_REG(hw, GLTSYN_INCVAL_L(tmr_idx), 0);
+	ICE_WRITE_REG(hw, GLTSYN_INCVAL_H(tmr_idx), 0);
 
 	ad->ptp_ena = 0;
 
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 4947d5c25f..94f6bcf3d1 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -349,26 +349,27 @@ static inline
 uint64_t ice_tstamp_convert_32b_64b(struct ice_hw *hw, struct ice_adapter *ad,
 				    uint32_t flag, uint32_t in_timestamp)
 {
+	uint8_t tmr_idx = hw->func_caps.ts_func_info.tmr_index_assoc;
 	const uint64_t mask = 0xFFFFFFFF;
 	uint32_t hi, lo, lo2, delta;
 	uint64_t ns;
 
 	if (flag) {
-		lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
-		hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0));
+		lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
+		hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx));
 
 		/*
 		 * On typical system, the delta between lo and lo2 is ~1000ns,
 		 * so 10000 seems a large-enough but not overly-big guard band.
 		 */
 		if (lo > (UINT32_MAX - ICE_TIMESYNC_REG_WRAP_GUARD_BAND))
-			lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
+			lo2 = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
 		else
 			lo2 = lo;
 
 		if (lo2 < lo) {
-			lo = ICE_READ_REG(hw, GLTSYN_TIME_L(0));
-			hi = ICE_READ_REG(hw, GLTSYN_TIME_H(0));
+			lo = ICE_READ_REG(hw, GLTSYN_TIME_L(tmr_idx));
+			hi = ICE_READ_REG(hw, GLTSYN_TIME_H(tmr_idx));
 		}
 
 		ad->time_hw = ((uint64_t)hi << 32) | lo;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.065822200 +0800
+++ 0050-net-ice-fix-Rx-timestamp.patch	2023-04-09 21:45:38.659042200 +0800
@@ -1 +1 @@
-From 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 Mon Sep 17 00:00:00 2001
+From 14688b03c0b50b94694957b516a7e77d929b9d5c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0e1c5d03d30c531b6d6d42cf5cb5def46f61ca70 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -39 +41 @@
-index 0d011bbffa..9a88cf9796 100644
+index 0bc739daf0..263c80a6eb 100644
@@ -42 +44 @@
-@@ -2413,6 +2413,17 @@ ice_dev_init(struct rte_eth_dev *dev)
+@@ -2399,6 +2399,17 @@ ice_dev_init(struct rte_eth_dev *dev)
@@ -60 +62 @@
-@@ -5814,11 +5825,6 @@ ice_timesync_enable(struct rte_eth_dev *dev)
+@@ -5800,11 +5811,6 @@ ice_timesync_enable(struct rte_eth_dev *dev)
@@ -72 +74 @@
-@@ -5939,16 +5945,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
+@@ -5925,16 +5931,17 @@ ice_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
@@ -95 +97 @@
-@@ -5964,6 +5971,7 @@ ice_timesync_disable(struct rte_eth_dev *dev)
+@@ -5950,6 +5957,7 @@ ice_timesync_disable(struct rte_eth_dev *dev)
@@ -103 +105 @@
-@@ -5971,12 +5979,12 @@ ice_timesync_disable(struct rte_eth_dev *dev)
+@@ -5957,12 +5965,12 @@ ice_timesync_disable(struct rte_eth_dev *dev)

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

* patch 'net/cnxk: fix LBK BPID usage' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (49 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/ice: fix Rx timestamp' " Xueming Li
@ 2023-04-09 15:23   ` Xueming Li
  2023-04-09 15:24   ` patch 'common/cnxk: add memory clobber to steor and ldeor' " Xueming Li
                     ` (85 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:23 UTC (permalink / raw)
  To: Rakesh Kudurumalla; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/67479d24a4c9376df20188340693a1749e75d42c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 67479d24a4c9376df20188340693a1749e75d42c Mon Sep 17 00:00:00 2001
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Date: Fri, 3 Mar 2023 13:40:01 +0530
Subject: [PATCH] net/cnxk: fix LBK BPID usage
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit c9b0bb00d201b57d1d1cdf7820d1a174d652f1ef ]

BPIDs are not disabled while freeing resources for NIX
device as a result a new BPID is assigned which leads
to exhaustion of BPID's after soft exit of application.
This patch fixes the same.

Fixes: d2bebb1feece ("net/cnxk: support flow control operations")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index bf1585fe67..f9245258cb 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -884,6 +884,27 @@ cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss,
 	return flowkey_cfg;
 }
 
+static int
+nix_rxchan_cfg_disable(struct cnxk_eth_dev *dev)
+{
+	struct roc_nix *nix = &dev->nix;
+	struct roc_nix_fc_cfg fc_cfg;
+	int rc;
+
+	if (!roc_nix_is_lbk(nix))
+		return 0;
+
+	memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg));
+	fc_cfg.type = ROC_NIX_FC_RXCHAN_CFG;
+	fc_cfg.rxchan_cfg.enable = false;
+	rc = roc_nix_fc_config_set(nix, &fc_cfg);
+	if (rc) {
+		plt_err("Failed to setup flow control, rc=%d(%s)", rc, roc_error_msg_get(rc));
+		return rc;
+	}
+	return 0;
+}
+
 static void
 nix_free_queue_mem(struct cnxk_eth_dev *dev)
 {
@@ -1202,6 +1223,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 			goto fail_configure;
 
 		roc_nix_tm_fini(nix);
+		nix_rxchan_cfg_disable(dev);
 		roc_nix_lf_free(nix);
 	}
 
@@ -1431,6 +1453,7 @@ tm_fini:
 	roc_nix_tm_fini(nix);
 free_nix_lf:
 	nix_free_queue_mem(dev);
+	rc |= nix_rxchan_cfg_disable(dev);
 	rc |= roc_nix_lf_free(nix);
 fail_configure:
 	dev->configured = 0;
@@ -1980,6 +2003,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset)
 	/* Free ROC RQ's, SQ's and CQ's memory */
 	nix_free_queue_mem(dev);
 
+	/* free nix bpid */
+	rc = nix_rxchan_cfg_disable(dev);
+	if (rc)
+		plt_err("Failed to free nix bpid, rc=%d", rc);
+
 	/* Free nix lf resources */
 	rc = roc_nix_lf_free(nix);
 	if (rc)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.099375600 +0800
+++ 0051-net-cnxk-fix-LBK-BPID-usage.patch	2023-04-09 21:45:38.659042200 +0800
@@ -1 +1 @@
-From c9b0bb00d201b57d1d1cdf7820d1a174d652f1ef Mon Sep 17 00:00:00 2001
+From 67479d24a4c9376df20188340693a1749e75d42c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit c9b0bb00d201b57d1d1cdf7820d1a174d652f1ef ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index 22072d29b0..e99335b117 100644
+index bf1585fe67..f9245258cb 100644
@@ -23 +25 @@
-@@ -900,6 +900,27 @@ cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss,
+@@ -884,6 +884,27 @@ cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss,
@@ -51 +53 @@
-@@ -1218,6 +1239,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
+@@ -1202,6 +1223,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
@@ -59 +61 @@
-@@ -1456,6 +1478,7 @@ tm_fini:
+@@ -1431,6 +1453,7 @@ tm_fini:
@@ -67 +69 @@
-@@ -2026,6 +2049,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset)
+@@ -1980,6 +2003,11 @@ cnxk_eth_dev_uninit(struct rte_eth_dev *eth_dev, bool reset)

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

* patch 'common/cnxk: add memory clobber to steor and ldeor' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (50 preceding siblings ...)
  2023-04-09 15:23   ` patch 'net/cnxk: fix LBK BPID usage' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'eal/windows: fix thread creation' " Xueming Li
                     ` (84 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

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

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/fac8d80e0d4c450768804488c81e5f0b94c14c32

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fac8d80e0d4c450768804488c81e5f0b94c14c32 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Fri, 3 Mar 2023 13:40:12 +0530
Subject: [PATCH] common/cnxk: add memory clobber to steor and ldeor
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a032b598b30daa9c2f01a6d7de07c87adba05dab ]

To avoid compiler reordering stores to LMT line and ldeor,
add clobber attribute to ldeor, steor etc.

Fixes: 014a9e222bac ("common/cnxk: add model init and IO handling API")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_io.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h
index 13f98ed549..45cbb4e587 100644
--- a/drivers/common/cnxk/roc_io.h
+++ b/drivers/common/cnxk/roc_io.h
@@ -125,7 +125,8 @@ roc_lmt_submit_ldeor(plt_iova_t io_address)
 
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE "ldeor xzr, %x[rf], [%[rs]]"
 		     : [rf] "=r"(result)
-		     : [rs] "r"(io_address));
+		     : [rs] "r"(io_address)
+		     : "memory");
 	return result;
 }
 
@@ -136,7 +137,8 @@ roc_lmt_submit_ldeorl(plt_iova_t io_address)
 
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE "ldeorl xzr,%x[rf],[%[rs]]"
 		     : [rf] "=r"(result)
-		     : [rs] "r"(io_address));
+		     : [rs] "r"(io_address)
+		     : "memory");
 	return result;
 }
 
@@ -145,7 +147,8 @@ roc_lmt_submit_steor(uint64_t data, plt_iova_t io_address)
 {
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE
 		     "steor %x[d], [%[rs]]" ::[d] "r"(data),
-		     [rs] "r"(io_address));
+		     [rs] "r"(io_address)
+		     : "memory");
 }
 
 static __plt_always_inline void
@@ -153,7 +156,8 @@ roc_lmt_submit_steorl(uint64_t data, plt_iova_t io_address)
 {
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE
 		     "steorl %x[d], [%[rs]]" ::[d] "r"(data),
-		     [rs] "r"(io_address));
+		     [rs] "r"(io_address)
+		     : "memory");
 }
 
 static __plt_always_inline void
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.123717300 +0800
+++ 0052-common-cnxk-add-memory-clobber-to-steor-and-ldeor.patch	2023-04-09 21:45:38.659042200 +0800
@@ -1 +1 @@
-From a032b598b30daa9c2f01a6d7de07c87adba05dab Mon Sep 17 00:00:00 2001
+From fac8d80e0d4c450768804488c81e5f0b94c14c32 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a032b598b30daa9c2f01a6d7de07c87adba05dab ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 1e5c1f8c04..af1a10cd66 100644
+index 13f98ed549..45cbb4e587 100644
@@ -21 +23 @@
-@@ -130,7 +130,8 @@ roc_lmt_submit_ldeor(plt_iova_t io_address)
+@@ -125,7 +125,8 @@ roc_lmt_submit_ldeor(plt_iova_t io_address)
@@ -31 +33 @@
-@@ -141,7 +142,8 @@ roc_lmt_submit_ldeorl(plt_iova_t io_address)
+@@ -136,7 +137,8 @@ roc_lmt_submit_ldeorl(plt_iova_t io_address)
@@ -41 +43 @@
-@@ -150,7 +152,8 @@ roc_lmt_submit_steor(uint64_t data, plt_iova_t io_address)
+@@ -145,7 +147,8 @@ roc_lmt_submit_steor(uint64_t data, plt_iova_t io_address)
@@ -51 +53 @@
-@@ -158,7 +161,8 @@ roc_lmt_submit_steorl(uint64_t data, plt_iova_t io_address)
+@@ -153,7 +156,8 @@ roc_lmt_submit_steorl(uint64_t data, plt_iova_t io_address)

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

* patch 'eal/windows: fix thread creation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (51 preceding siblings ...)
  2023-04-09 15:24   ` patch 'common/cnxk: add memory clobber to steor and ldeor' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/nfp: fix MTU configuration order' " Xueming Li
                     ` (83 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

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

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/bf878ca704dedd6242d194522065dd97a9da5140

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bf878ca704dedd6242d194522065dd97a9da5140 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Thu, 2 Mar 2023 10:44:42 -0800
Subject: [PATCH] eal/windows: fix thread creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4ca43a8898181e52ea5789ea36d8681dc05931d5 ]

In rte_thread_create setting affinity after CreateThread may fail. Such
a failure is reported but strands the newly created thread in a
suspended state.

Resolve the above issue by notifying the newly created thread that
it should terminate as soon as it is resumed, while still continuing to
free the ctx.

Fixes: ce6e911d20f6 ("eal: add thread lifetime API")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/windows/rte_thread.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c
index 1c1e9d01e3..3538633816 100644
--- a/lib/eal/windows/rte_thread.c
+++ b/lib/eal/windows/rte_thread.c
@@ -17,6 +17,7 @@ struct eal_tls_key {
 
 struct thread_routine_ctx {
 	rte_thread_func thread_func;
+	bool thread_init_failed;
 	void *routine_args;
 };
 
@@ -165,9 +166,13 @@ static DWORD
 thread_func_wrapper(void *arg)
 {
 	struct thread_routine_ctx ctx = *(struct thread_routine_ctx *)arg;
+	const bool thread_exit = __atomic_load_n(&ctx.thread_init_failed, __ATOMIC_ACQUIRE);
 
 	free(arg);
 
+	if (thread_exit)
+		return 0;
+
 	return (DWORD)ctx.thread_func(ctx.routine_args);
 }
 
@@ -181,6 +186,7 @@ rte_thread_create(rte_thread_t *thread_id,
 	HANDLE thread_handle = NULL;
 	GROUP_AFFINITY thread_affinity;
 	struct thread_routine_ctx *ctx;
+	bool thread_exit = false;
 
 	ctx = calloc(1, sizeof(*ctx));
 	if (ctx == NULL) {
@@ -190,6 +196,7 @@ rte_thread_create(rte_thread_t *thread_id,
 	}
 	ctx->routine_args = args;
 	ctx->thread_func = thread_func;
+	ctx->thread_init_failed = false;
 
 	thread_handle = CreateThread(NULL, 0, thread_func_wrapper, ctx,
 		CREATE_SUSPENDED, &tid);
@@ -207,23 +214,29 @@ rte_thread_create(rte_thread_t *thread_id,
 							);
 			if (ret != 0) {
 				RTE_LOG(DEBUG, EAL, "Unable to convert cpuset to thread affinity\n");
-				goto cleanup;
+				thread_exit = true;
+				goto resume_thread;
 			}
 
 			if (!SetThreadGroupAffinity(thread_handle,
 						    &thread_affinity, NULL)) {
 				ret = thread_log_last_error("SetThreadGroupAffinity()");
-				goto cleanup;
+				thread_exit = true;
+				goto resume_thread;
 			}
 		}
 		ret = rte_thread_set_priority(*thread_id,
 				thread_attr->priority);
 		if (ret != 0) {
 			RTE_LOG(DEBUG, EAL, "Unable to set thread priority\n");
-			goto cleanup;
+			thread_exit = true;
+			goto resume_thread;
 		}
 	}
 
+resume_thread:
+	__atomic_store_n(&ctx->thread_init_failed, thread_exit, __ATOMIC_RELEASE);
+
 	if (ResumeThread(thread_handle) == (DWORD)-1) {
 		ret = thread_log_last_error("ResumeThread()");
 		goto cleanup;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.153091800 +0800
+++ 0053-eal-windows-fix-thread-creation.patch	2023-04-09 21:45:38.659042200 +0800
@@ -1 +1 @@
-From 4ca43a8898181e52ea5789ea36d8681dc05931d5 Mon Sep 17 00:00:00 2001
+From bf878ca704dedd6242d194522065dd97a9da5140 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4ca43a8898181e52ea5789ea36d8681dc05931d5 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 8556a84f13..e528ac9991 100644
+index 1c1e9d01e3..3538633816 100644
@@ -27 +29 @@
-@@ -19,6 +19,7 @@ struct eal_tls_key {
+@@ -17,6 +17,7 @@ struct eal_tls_key {
@@ -35 +37 @@
-@@ -167,9 +168,13 @@ static DWORD
+@@ -165,9 +166,13 @@ static DWORD
@@ -49 +51 @@
-@@ -183,6 +188,7 @@ rte_thread_create(rte_thread_t *thread_id,
+@@ -181,6 +186,7 @@ rte_thread_create(rte_thread_t *thread_id,
@@ -57 +59 @@
-@@ -192,6 +198,7 @@ rte_thread_create(rte_thread_t *thread_id,
+@@ -190,6 +196,7 @@ rte_thread_create(rte_thread_t *thread_id,
@@ -65 +67 @@
-@@ -209,23 +216,29 @@ rte_thread_create(rte_thread_t *thread_id,
+@@ -207,23 +214,29 @@ rte_thread_create(rte_thread_t *thread_id,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/nfp: fix MTU configuration order' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (52 preceding siblings ...)
  2023-04-09 15:24   ` patch 'eal/windows: fix thread creation' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'kvargs: add API documentation for process callback' " Xueming Li
                     ` (82 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Peng Zhang; +Cc: Chaoyong He, Niklas Söderlund, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/bb296faffc9f2cf9d068709aa9683047c32d082d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From bb296faffc9f2cf9d068709aa9683047c32d082d Mon Sep 17 00:00:00 2001
From: Peng Zhang <peng.zhang@corigine.com>
Date: Wed, 8 Mar 2023 10:33:18 +0800
Subject: [PATCH] net/nfp: fix MTU configuration order
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]

If rte_eth_dev_set_mtu() is called before rte_eth_rx_queue_setup() the
NFP driver setup fails. This is because the default values evaluated
when setting the MTU are initialized in the rte_eth_rx_queue_setup()
code path. Fix this by instead initializing the MTU default values in
the device initialization, in nfp_net_init() and the check also is
conducted in nfp_net_start(), so it doesn't influence the result.

This was found by using DPDK with OVS.

Fixes: dbad6f64f921 ("net/nfp: fix internal buffer size and MTU check")

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower.c | 1 -
 drivers/net/nfp/nfp_common.c        | 4 ++--
 drivers/net/nfp/nfp_common.h        | 1 +
 drivers/net/nfp/nfp_ethdev.c        | 1 +
 drivers/net/nfp/nfp_ethdev_vf.c     | 1 +
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index 6857732028..9c237bdb72 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -25,7 +25,6 @@
 #include "nfp_flower_cmsg.h"
 
 #define CTRL_VNIC_NB_DESC 512
-#define DEFAULT_FLBUF_SIZE 9216
 
 static void
 nfp_pf_repr_enable_queues(struct rte_eth_dev *dev)
diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c
index c9eeaa02fc..b673370f20 100644
--- a/drivers/net/nfp/nfp_common.c
+++ b/drivers/net/nfp/nfp_common.c
@@ -977,9 +977,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EBUSY;
 	}
 
-	/* MTU larger then current mbufsize not supported */
+	/* MTU larger than current mbufsize not supported */
 	if (mtu > hw->flbufsz) {
-		PMD_DRV_LOG(ERR, "MTU (%u) larger then current mbufsize (%u) not supported",
+		PMD_DRV_LOG(ERR, "MTU (%u) larger than current mbufsize (%u) not supported",
 			    mtu, hw->flbufsz);
 		return -ERANGE;
 	}
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 8cf99c0eae..67c8dc33d8 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -111,6 +111,7 @@ struct nfp_net_adapter;
 
 /* Maximum supported NFP frame size (MTU + layer 2 headers) */
 #define NFP_FRAME_SIZE_MAX	10048
+#define DEFAULT_FLBUF_SIZE        9216
 
 #include <linux/types.h>
 #include <rte_io.h>
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index cf7a4389b3..dc63b05bd6 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -604,6 +604,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	hw->mtu = RTE_ETHER_MTU;
+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
 	/* VLAN insertion is incompatible with LSOv2 */
 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 865cac7741..1877d6b76b 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -361,6 +361,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
 	hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP);
 	hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU);
 	hw->mtu = RTE_ETHER_MTU;
+	hw->flbufsz = DEFAULT_FLBUF_SIZE;
 
 	/* VLAN insertion is incompatible with LSOv2 */
 	if (hw->cap & NFP_NET_CFG_CTRL_LSO2)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.180394400 +0800
+++ 0054-net-nfp-fix-MTU-configuration-order.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 Mon Sep 17 00:00:00 2001
+From bb296faffc9f2cf9d068709aa9683047c32d082d Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4352a3bcee3a4cc20c8accb71d683d5add3c6f80 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -33 +35 @@
-index 2c797ae751..6f197396a4 100644
+index 6857732028..9c237bdb72 100644
@@ -36 +38 @@
-@@ -24,7 +24,6 @@
+@@ -25,7 +25,6 @@
@@ -45 +47 @@
-index 5922bfea8e..5d92b476e2 100644
+index c9eeaa02fc..b673370f20 100644
@@ -48 +50 @@
-@@ -1126,9 +1126,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -977,9 +977,9 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
@@ -61 +63 @@
-index 49c89ac327..4486ffa72c 100644
+index 8cf99c0eae..67c8dc33d8 100644
@@ -73 +75 @@
-index 47d5dff16c..56fb8e8c73 100644
+index cf7a4389b3..dc63b05bd6 100644
@@ -76 +78 @@
-@@ -603,6 +603,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
+@@ -604,6 +604,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
@@ -85 +87 @@
-index 7834b2ee0c..d69ac8cd37 100644
+index 865cac7741..1877d6b76b 100644
@@ -88 +90 @@
-@@ -365,6 +365,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
+@@ -361,6 +361,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'kvargs: add API documentation for process callback' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (53 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/nfp: fix MTU configuration order' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'compressdev: fix empty devargs parsing' " Xueming Li
                     ` (81 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/6567e0cf763b4a317e2c97ee1d342f1ced4fca88

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6567e0cf763b4a317e2c97ee1d342f1ced4fca88 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:04 +0000
Subject: [PATCH] kvargs: add API documentation for process callback
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 52ab17efdecf935792ee1d0cb749c0dbd536c083 ]

The rte_kvargs_process() is used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
(which prototype is arg_handler_t) parameter 'value' is NULL when
parsing 'only keys'.

But there is no detailed definition of 'value' may be NULL, so this
patch adds it.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/kvargs/rte_kvargs.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.h b/lib/kvargs/rte_kvargs.h
index 359a9f5b09..4900b750bc 100644
--- a/lib/kvargs/rte_kvargs.h
+++ b/lib/kvargs/rte_kvargs.h
@@ -36,7 +36,19 @@ extern "C" {
 /** separator character used between key and value */
 #define RTE_KVARGS_KV_DELIM	"="
 
-/** Type of callback function used by rte_kvargs_process() */
+/**
+ * Callback prototype used by rte_kvargs_process().
+ *
+ * @param key
+ *   The key to consider, it will not be NULL.
+ * @param value
+ *   The value corresponding to the key, it may be NULL (e.g. only with key)
+ * @param opaque
+ *   An opaque pointer coming from the caller.
+ * @return
+ *   - >=0 handle key success.
+ *   - <0 on error.
+ */
 typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
 
 /** A key/value association */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.205453500 +0800
+++ 0055-kvargs-add-API-documentation-for-process-callback.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 52ab17efdecf935792ee1d0cb749c0dbd536c083 Mon Sep 17 00:00:00 2001
+From 6567e0cf763b4a317e2c97ee1d342f1ced4fca88 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 52ab17efdecf935792ee1d0cb749c0dbd536c083 ]
@@ -13,2 +15,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'compressdev: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (54 preceding siblings ...)
  2023-04-09 15:24   ` patch 'kvargs: add API documentation for process callback' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'cryptodev: " Xueming Li
                     ` (80 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/00e3a4efbc3b018303e0826404a05cb2b6cd161e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 00e3a4efbc3b018303e0826404a05cb2b6cd161e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:05 +0000
Subject: [PATCH] compressdev: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault in rte_compressdev_pmd_parse_uint_arg()
when parse input args with 'only keys' (e.g. socket_id).

For a similar reason, this patch fixes
rte_compressdev_pmd_parse_name_arg().

Fixes: ed7dd94f7f66 ("compressdev: add basic device management")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/compressdev/rte_compressdev_pmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c
index e139bc86e7..156bccd972 100644
--- a/lib/compressdev/rte_compressdev_pmd.c
+++ b/lib/compressdev/rte_compressdev_pmd.c
@@ -23,6 +23,9 @@ rte_compressdev_pmd_parse_name_arg(const char *key __rte_unused,
 	struct rte_compressdev_pmd_init_params *params = extra_args;
 	int n;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	n = strlcpy(params->name, value, RTE_COMPRESSDEV_NAME_MAX_LEN);
 	if (n >= RTE_COMPRESSDEV_NAME_MAX_LEN)
 		return -EINVAL;
@@ -40,6 +43,9 @@ rte_compressdev_pmd_parse_uint_arg(const char *key __rte_unused,
 	int i;
 	char *end;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	errno = 0;
 	i = strtol(value, &end, 10);
 	if (*end != 0 || errno != 0 || i < 0)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.230675500 +0800
+++ 0056-compressdev-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From bb27182482d61777de6a38b16a1d2c692c2c3f8b Mon Sep 17 00:00:00 2001
+From 00e3a4efbc3b018303e0826404a05cb2b6cd161e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bb27182482d61777de6a38b16a1d2c692c2c3f8b ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'cryptodev: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (55 preceding siblings ...)
  2023-04-09 15:24   ` patch 'compressdev: fix empty devargs parsing' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: " Xueming Li
                     ` (79 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/63ba1d9f2c17245fd549c897536e1ecf2b4fe23e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 63ba1d9f2c17245fd549c897536e1ecf2b4fe23e Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:07 +0000
Subject: [PATCH] cryptodev: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8146454c56636ba8af5263b57e1c4a9f67fd4a39 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault in rte_cryptodev_pmd_parse_uint_arg()
when parse input args with 'only keys' (e.g. socket_id,
max_nb_queue_pairs).

For a similar reason, this patch fixes
rte_cryptodev_pmd_parse_name_arg().

Fixes: 9e6edea41805 ("cryptodev: add APIs to assist PMD initialisation")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/cryptodev/cryptodev_pmd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
index 77b269f312..d8073a601d 100644
--- a/lib/cryptodev/cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -22,6 +22,9 @@ rte_cryptodev_pmd_parse_name_arg(const char *key __rte_unused,
 	struct rte_cryptodev_pmd_init_params *params = extra_args;
 	int n;
 
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	n = strlcpy(params->name, value, RTE_CRYPTODEV_NAME_MAX_LEN);
 	if (n >= RTE_CRYPTODEV_NAME_MAX_LEN)
 		return -EINVAL;
@@ -38,6 +41,10 @@ rte_cryptodev_pmd_parse_uint_arg(const char *key __rte_unused,
 {
 	int i;
 	char *end;
+
+	if (value == NULL || extra_args == NULL)
+		return -EINVAL;
+
 	errno = 0;
 
 	i = strtol(value, &end, 10);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.253461800 +0800
+++ 0057-cryptodev-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 8146454c56636ba8af5263b57e1c4a9f67fd4a39 Mon Sep 17 00:00:00 2001
+From 63ba1d9f2c17245fd549c897536e1ecf2b4fe23e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8146454c56636ba8af5263b57e1c4a9f67fd4a39 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (56 preceding siblings ...)
  2023-04-09 15:24   ` patch 'cryptodev: " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/virtio: " Xueming Li
                     ` (78 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/33b1cea25d77140ebfa518d312803803b02c56ac

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 33b1cea25d77140ebfa518d312803803b02c56ac Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:09 +0000
Subject: [PATCH] net/hns3: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8e9bd29995ddb1205d90291a684bcf71599d6623 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. rx_func_hint).

Fixes: a124f9e9591b ("net/hns3: add runtime config to select IO burst function")
Fixes: 70791213242e ("net/hns3: support masking device capability")
Fixes: 2fc3e696a7f1 ("net/hns3: add runtime config for mailbox limit time")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_common.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index a0c9e66c2c..f077ef5057 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -163,6 +163,9 @@ hns3_parse_io_hint_func(const char *key, const char *value, void *extra_args)
 
 	RTE_SET_USED(key);
 
+	if (value == NULL || extra_args == NULL)
+		return 0;
+
 	if (strcmp(value, "vec") == 0)
 		hint = HNS3_IO_FUNC_HINT_VEC;
 	else if (strcmp(value, "sve") == 0)
@@ -203,6 +206,9 @@ hns3_parse_dev_caps_mask(const char *key, const char *value, void *extra_args)
 
 	RTE_SET_USED(key);
 
+	if (value == NULL || extra_args == NULL)
+		return 0;
+
 	val = strtoull(value, NULL, HNS3_CONVERT_TO_HEXADECIMAL);
 	*(uint64_t *)extra_args = val;
 
@@ -216,6 +222,9 @@ hns3_parse_mbx_time_limit(const char *key, const char *value, void *extra_args)
 
 	RTE_SET_USED(key);
 
+	if (value == NULL || extra_args == NULL)
+		return 0;
+
 	val = strtoul(value, NULL, HNS3_CONVERT_TO_DECIMAL);
 
 	/*
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.276437600 +0800
+++ 0058-net-hns3-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 8e9bd29995ddb1205d90291a684bcf71599d6623 Mon Sep 17 00:00:00 2001
+From 33b1cea25d77140ebfa518d312803803b02c56ac Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8e9bd29995ddb1205d90291a684bcf71599d6623 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/virtio: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (57 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'dma/skeleton: " Xueming Li
                     ` (77 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:10 +0000
Subject: [PATCH] net/virtio: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. vectorized,vdpa).

Fixes: 4710e16a4a7b ("net/virtio: add parameter to enable vectorized path")
Fixes: 44d7b2e87b69 ("net/virtio: refactor devargs parsing")
Fixes: 440f03c25378 ("net/virtio: skip device probe in vDPA mode")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c     | 3 +++
 drivers/net/virtio/virtio_pci_ethdev.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 760ba4e368..b72334455e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2457,6 +2457,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
 static int vectorized_check_handler(__rte_unused const char *key,
 		const char *value, void *ret_val)
 {
+	if (value == NULL || ret_val == NULL)
+		return -EINVAL;
+
 	if (strcmp(value, "1") == 0)
 		*(int *)ret_val = 1;
 	else
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index abc63b0935..9b4b846f8a 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -148,6 +148,9 @@ eth_virtio_pci_uninit(struct rte_eth_dev *eth_dev)
 static int vdpa_check_handler(__rte_unused const char *key,
 		const char *value, void *ret_val)
 {
+	if (value == NULL || ret_val == NULL)
+		return -EINVAL;
+
 	if (strcmp(value, "1") == 0)
 		*(int *)ret_val = 1;
 	else
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.299008500 +0800
+++ 0059-net-virtio-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 Mon Sep 17 00:00:00 2001
+From ce3c0aa7aa3eb6a29884b0692a9bd49e1ebc683d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1c1b35b59b4cee8836f34498b7c55b49de39d7b3 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index dc6856d749..ae84d313be 100644
+index 760ba4e368..b72334455e 100644
@@ -29 +31 @@
-@@ -2056,6 +2056,9 @@ virtio_dev_speed_capa_get(uint32_t speed)
+@@ -2457,6 +2457,9 @@ virtio_dev_speed_capa_get(uint32_t speed)

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'dma/skeleton: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (58 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/virtio: " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'raw/skeleton: " Xueming Li
                     ` (76 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/0848681e9058955f794a52c02ba84501493e9548

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0848681e9058955f794a52c02ba84501493e9548 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:11 +0000
Subject: [PATCH] dma/skeleton: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e0e5dd0450db22fc7712da4b5a8e6fd6e081c870 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. lcore).

Fixes: 05d5fc66a269 ("dma/skeleton: introduce skeleton driver")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/dma/skeleton/skeleton_dmadev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 9b6da655fd..daf35eccce 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -515,9 +515,15 @@ skeldma_parse_lcore(const char *key __rte_unused,
 		    const char *value,
 		    void *opaque)
 {
-	int lcore_id = atoi(value);
+	int lcore_id;
+
+	if (value == NULL || opaque == NULL)
+		return -EINVAL;
+
+	lcore_id = atoi(value);
 	if (lcore_id >= 0 && lcore_id < RTE_MAX_LCORE)
 		*(int *)opaque = lcore_id;
+
 	return 0;
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.322382400 +0800
+++ 0060-dma-skeleton-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From e0e5dd0450db22fc7712da4b5a8e6fd6e081c870 Mon Sep 17 00:00:00 2001
+From 0848681e9058955f794a52c02ba84501493e9548 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e0e5dd0450db22fc7712da4b5a8e6fd6e081c870 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'raw/skeleton: fix empty devargs parsing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (59 preceding siblings ...)
  2023-04-09 15:24   ` patch 'dma/skeleton: " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'table: fix action selector group size log2 setting' " Xueming Li
                     ` (75 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/60f6d9449cc1083c1466e723af727ad11d176ef0

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 60f6d9449cc1083c1466e723af727ad11d176ef0 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Thu, 2 Mar 2023 07:50:12 +0000
Subject: [PATCH] raw/skeleton: fix empty devargs parsing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 ]

The rte_kvargs_process() was used to parse KV pairs, it also supports
to parse 'only keys' (e.g. socket_id) type. And the callback function
parameter 'value' is NULL when parsed 'only keys'.

This patch fixes segment fault when parse input args with 'only keys'
(e.g. self_test).

Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index b2ca1cc5cd..53fe49f936 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -664,6 +664,8 @@ skeldev_get_selftest(const char *key __rte_unused,
 		     void *opaque)
 {
 	int *flag = opaque;
+	if (value == NULL || opaque == NULL)
+		return -EINVAL;
 	*flag = atoi(value);
 	return 0;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.347662700 +0800
+++ 0061-raw-skeleton-fix-empty-devargs-parsing.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 Mon Sep 17 00:00:00 2001
+From 60f6d9449cc1083c1466e723af727ad11d176ef0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 11da6149224a8de53d2ddd2aacba7b158cc4e3b4 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'table: fix action selector group size log2 setting' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (60 preceding siblings ...)
  2023-04-09 15:24   ` patch 'raw/skeleton: " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'regex/mlx5: utilize all available queue pairs' " Xueming Li
                     ` (74 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Yogesh Jangra; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/cb4baf72a46b98fc6110a6382c299f11005afab6

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From cb4baf72a46b98fc6110a6382c299f11005afab6 Mon Sep 17 00:00:00 2001
From: Yogesh Jangra <yogesh.jangra@intel.com>
Date: Thu, 9 Mar 2023 13:58:42 +0000
Subject: [PATCH] table: fix action selector group size log2 setting
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 44bcb29f5c1b5b5af1942dee58ba16fba78c35f0 ]

The incorrect variable for the number of groups was used, so in the
case of values not power of 2 the incorrect result was produced.

Fixes: f7598a62d114 ("table: support selector table")

Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/table/rte_swx_table_selector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/table/rte_swx_table_selector.c b/lib/table/rte_swx_table_selector.c
index ad99f18453..18e021fe6f 100644
--- a/lib/table/rte_swx_table_selector.c
+++ b/lib/table/rte_swx_table_selector.c
@@ -232,7 +232,7 @@ table_params_copy(struct table *t, struct rte_swx_table_selector_params *params)
 	t->params.n_members_per_group_max = rte_align32pow2(params->n_members_per_group_max);
 
 	for (i = 0; i < 32; i++)
-		if (params->n_members_per_group_max == 1U << i)
+		if (t->params.n_members_per_group_max == 1U << i)
 			t->n_members_per_group_max_log2 = i;
 
 	/* t->params.selector_mask */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.371580900 +0800
+++ 0062-table-fix-action-selector-group-size-log2-setting.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 44bcb29f5c1b5b5af1942dee58ba16fba78c35f0 Mon Sep 17 00:00:00 2001
+From cb4baf72a46b98fc6110a6382c299f11005afab6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 44bcb29f5c1b5b5af1942dee58ba16fba78c35f0 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'regex/mlx5: utilize all available queue pairs' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (61 preceding siblings ...)
  2023-04-09 15:24   ` patch 'table: fix action selector group size log2 setting' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'regex/mlx5: fix doorbell record' " Xueming Li
                     ` (73 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Gerry Gribbon; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/b5512d3186fac7391068f825896c8b63d83ee3d7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b5512d3186fac7391068f825896c8b63d83ee3d7 Mon Sep 17 00:00:00 2001
From: Gerry Gribbon <ggribbon@nvidia.com>
Date: Tue, 21 Feb 2023 07:47:28 +0000
Subject: [PATCH] regex/mlx5: utilize all available queue pairs
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2fa696a2e93c57f22a6640987b5f4378fb5de899 ]

Fix overflow of free QP mask.
Regex used 64 QPs and used a bitmask to select a free QP for use.
The bitmask in use was only 32 bits so did not allow half of the QPs
to be utilised.
Upgraded to 64 bit mask and using ffsll now instead of ffs.

Fixes: 270032608503 ("regex/mlx5: refactor HW queue objects")

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex.h          |  2 +-
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex.h b/drivers/regex/mlx5/mlx5_regex.h
index b8554fd1cf..481f6fc59f 100644
--- a/drivers/regex/mlx5/mlx5_regex.h
+++ b/drivers/regex/mlx5/mlx5_regex.h
@@ -37,7 +37,7 @@ struct mlx5_regex_qp {
 	struct mlx5_regex_hw_qp *qps; /* Pointer to qp array. */
 	uint16_t nb_obj; /* Number of qp objects. */
 	struct mlx5_regex_cq cq; /* CQ struct. */
-	uint32_t free_qps;
+	uint64_t free_qps;
 	struct mlx5_regex_job *jobs;
 	struct ibv_mr *metadata;
 	struct ibv_mr *outputs;
diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 143c7d7cdf..6c87afa923 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -417,7 +417,7 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id,
 		return 0;
 #endif
 
-	while ((hw_qpid = ffs(queue->free_qps))) {
+	while ((hw_qpid = ffsll(queue->free_qps))) {
 		hw_qpid--; /* ffs returns 1 for bit 0 */
 		qp_obj = &queue->qps[hw_qpid];
 		nb_desc = get_free(qp_obj, priv->has_umr);
@@ -426,7 +426,7 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id,
 			if (nb_desc > nb_left)
 				nb_desc = nb_left;
 			else
-				queue->free_qps &= ~(1 << hw_qpid);
+				queue->free_qps &= ~(1ULL << hw_qpid);
 			prep_regex_umr_wqe_set(priv, queue, qp_obj, ops,
 				nb_desc);
 			send_doorbell(priv, qp_obj);
@@ -456,7 +456,7 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id,
 		return 0;
 #endif
 
-	while ((hw_qpid = ffs(queue->free_qps))) {
+	while ((hw_qpid = ffsll(queue->free_qps))) {
 		hw_qpid--; /* ffs returns 1 for bit 0 */
 		qp_obj = &queue->qps[hw_qpid];
 		while (get_free(qp_obj, priv->has_umr)) {
@@ -470,7 +470,7 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id,
 				goto out;
 			}
 		}
-		queue->free_qps &= ~(1 << hw_qpid);
+		queue->free_qps &= ~(1ULL << hw_qpid);
 		send_doorbell(priv, qp_obj);
 	}
 
@@ -603,7 +603,7 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id,
 		cq->ci = (cq->ci + 1) & 0xffffff;
 		rte_wmb();
 		cq->cq_obj.db_rec[0] = rte_cpu_to_be_32(cq->ci);
-		queue->free_qps |= (1 << hw_qpid);
+		queue->free_qps |= (1ULL << hw_qpid);
 	}
 
 out:
@@ -642,7 +642,7 @@ setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue)
 				     (uintptr_t)job->output);
 			wqe += 64;
 		}
-		queue->free_qps |= 1 << hw_qpid;
+		queue->free_qps |= 1ULL << hw_qpid;
 	}
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.396606800 +0800
+++ 0063-regex-mlx5-utilize-all-available-queue-pairs.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 2fa696a2e93c57f22a6640987b5f4378fb5de899 Mon Sep 17 00:00:00 2001
+From b5512d3186fac7391068f825896c8b63d83ee3d7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2fa696a2e93c57f22a6640987b5f4378fb5de899 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'regex/mlx5: fix doorbell record' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (62 preceding siblings ...)
  2023-04-09 15:24   ` patch 'regex/mlx5: utilize all available queue pairs' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'common/sfc_efx/base: add MAE mark reset action' " Xueming Li
                     ` (72 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Gerry Gribbon; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/4224d5f5218a792143a45d30aeef594ccaade5cf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 4224d5f5218a792143a45d30aeef594ccaade5cf Mon Sep 17 00:00:00 2001
From: Gerry Gribbon <ggribbon@nvidia.com>
Date: Tue, 21 Feb 2023 07:49:57 +0000
Subject: [PATCH] regex/mlx5: fix doorbell record
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b15d75b2872efce397d827dac78692a919358302 ]

We were writing a value that should represent the number of items to be
processed by hardware. The value being written was off by 1 (N*4)+3;
The value should be (N*4) + 4 simplified to (N+1)*4

Fixes: 5dfa003db53f ("common/mlx5: fix post doorbell barrier")

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
---
 drivers/regex/mlx5/mlx5_regex_fastpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c
index 6c87afa923..8e5f8c9c95 100644
--- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
+++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
@@ -211,8 +211,8 @@ send_doorbell(struct mlx5_regex_priv *priv, struct mlx5_regex_hw_qp *qp)
 			    (MLX5_SEND_WQE_BB << (priv->has_umr ? 2 : 0)) +
 			    (priv->has_umr ? MLX5_REGEX_UMR_WQE_SIZE : 0);
 	uint8_t *wqe = (uint8_t *)(uintptr_t)qp->qp_obj.wqes + wqe_offset;
-	uint32_t actual_pi = (priv->has_umr ? (qp->db_pi * 4 + 3) : qp->db_pi) &
-			     MLX5_REGEX_MAX_WQE_INDEX;
+	uint32_t actual_pi = (priv->has_umr ? ((1 + qp->db_pi) * 4) : qp->db_pi)
+			     & MLX5_REGEX_MAX_WQE_INDEX;
 
 	/* Or the fm_ce_se instead of set, avoid the fence be cleared. */
 	((struct mlx5_wqe_ctrl_seg *)wqe)->fm_ce_se |= MLX5_WQE_CTRL_CQ_UPDATE;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.420181000 +0800
+++ 0064-regex-mlx5-fix-doorbell-record.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From b15d75b2872efce397d827dac78692a919358302 Mon Sep 17 00:00:00 2001
+From 4224d5f5218a792143a45d30aeef594ccaade5cf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b15d75b2872efce397d827dac78692a919358302 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'common/sfc_efx/base: add MAE mark reset action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (63 preceding siblings ...)
  2023-04-09 15:24   ` patch 'regex/mlx5: fix doorbell record' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/sfc: fix resetting mark in tunnel offload switch rules' " Xueming Li
                     ` (71 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/f6bdbdf6f2f9a7149d4442eb932fa88f6edea2bd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f6bdbdf6f2f9a7149d4442eb932fa88f6edea2bd Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Thu, 9 Mar 2023 08:28:41 +0400
Subject: [PATCH] common/sfc_efx/base: add MAE mark reset action
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 13d3f0d2ffeac7308f72fed56b2c8c545ac73fa5 ]

Previously, DPDK sfc driver received support for tunnel
offload. In it, MAE needs to set intermediate mark from
an outer rule (OR) recirculation ID in order to help
the driver identify packets that hit the OR but miss
on action rule (AR) lookup. But, for packets that do
hit an AR, the driver wants to reset this mark so
that the end receiver of traffic does not see it.

The driver has a call to request such mark reset,
but it does not work as it comes via the regular
mark populate API, which must not be invoked
after final delivery action has been added.

Provide a suitable dedicated API for that.

Fixes: 3a73dcfdb255 ("common/sfc_efx/base: match on recirc ID in action rules")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/common/sfc_efx/base/efx.h     | 18 ++++++++++++++++++
 drivers/common/sfc_efx/base/efx_mae.c | 12 ++++++++++++
 drivers/common/sfc_efx/version.map    |  1 +
 3 files changed, 31 insertions(+)

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 92ec18761b..f4fa88f169 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -4582,6 +4582,24 @@ efx_mae_action_set_populate_mark(
 	__in				efx_mae_actions_t *spec,
 	__in				uint32_t mark_value);
 
+/*
+ * Whilst efx_mae_action_set_populate_mark() can be used to request setting
+ * a user mark in matching packets and demands that the request come before
+ * setting the final destination (deliver action), this API can be invoked
+ * after deliver action has been added in order to request mark reset if
+ * the user's own mark request has not been added as a result of parsing.
+ *
+ * It is useful when the driver chains an outer rule (OR) with an action
+ * rule (AR) by virtue of a recirculation ID. The OR may set mark from
+ * this ID to help the driver identify packets that hit the OR and do
+ * not hit the AR. But, for packets that do hit the AR, the driver
+ * wants to reset the mark value to avoid confusing recipients.
+ */
+LIBEFX_API
+extern					void
+efx_mae_action_set_populate_mark_reset(
+	__in				efx_mae_actions_t *spec);
+
 LIBEFX_API
 extern	__checkReturn			efx_rc_t
 efx_mae_action_set_populate_deliver(
diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c
index 31f51b5548..7732d99992 100644
--- a/drivers/common/sfc_efx/base/efx_mae.c
+++ b/drivers/common/sfc_efx/base/efx_mae.c
@@ -1916,6 +1916,18 @@ efx_mae_action_set_populate_mark(
 	    EFX_MAE_ACTION_MARK, sizeof (mark_value), arg));
 }
 
+					void
+efx_mae_action_set_populate_mark_reset(
+	__in				efx_mae_actions_t *spec)
+{
+	uint32_t action_mask = (1U << EFX_MAE_ACTION_MARK);
+
+	if ((spec->ema_actions & action_mask) == 0) {
+		spec->ema_actions |= action_mask;
+		spec->ema_mark_value = 0;
+	}
+}
+
 	__checkReturn			efx_rc_t
 efx_mae_action_set_populate_deliver(
 	__in				efx_mae_actions_t *spec,
diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map
index a54aab0a08..aabc354118 100644
--- a/drivers/common/sfc_efx/version.map
+++ b/drivers/common/sfc_efx/version.map
@@ -103,6 +103,7 @@ INTERNAL {
 	efx_mae_action_set_populate_encap;
 	efx_mae_action_set_populate_flag;
 	efx_mae_action_set_populate_mark;
+	efx_mae_action_set_populate_mark_reset;
 	efx_mae_action_set_populate_set_dst_mac;
 	efx_mae_action_set_populate_set_src_mac;
 	efx_mae_action_set_populate_vlan_pop;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.444680300 +0800
+++ 0065-common-sfc_efx-base-add-MAE-mark-reset-action.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From 13d3f0d2ffeac7308f72fed56b2c8c545ac73fa5 Mon Sep 17 00:00:00 2001
+From f6bdbdf6f2f9a7149d4442eb932fa88f6edea2bd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 13d3f0d2ffeac7308f72fed56b2c8c545ac73fa5 ]
@@ -22 +24,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/sfc: fix resetting mark in tunnel offload switch rules' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (64 preceding siblings ...)
  2023-04-09 15:24   ` patch 'common/sfc_efx/base: add MAE mark reset action' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'kni: fix possible starvation when mbufs are exhausted' " Xueming Li
                     ` (70 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/993c0d08eb60e70a8e52ca5cb9b6a65a6829c819

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 993c0d08eb60e70a8e52ca5cb9b6a65a6829c819 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Thu, 9 Mar 2023 08:28:42 +0400
Subject: [PATCH] net/sfc: fix resetting mark in tunnel offload switch rules
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dfa00c456adb6f4214b581a5e82e601e963248d2 ]

The currently used API is unfit for the purpose as it
checks the order in which the action is being added.
Use a dedicated API to request the reset.

Fixes: 012bf708c20f ("net/sfc: support group flows in tunnel offload")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_mae.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 82d5a95ec4..29b8bb9e25 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -3896,12 +3896,10 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 		break;
 	case SFC_FT_RULE_SWITCH:
 		/*
-		 * Packets that go to the rule's AR have FT mark set (from the
-		 * TUNNEL rule OR's RECIRC_ID). Remove this mark in matching
-		 * packets. The user may have provided their own action
-		 * MARK above, so don't check the return value here.
+		 * Packets that go to the rule's AR have FT mark set (from
+		 * the TUNNEL rule OR's RECIRC_ID). Reset the mark to zero.
 		 */
-		(void)efx_mae_action_set_populate_mark(ctx.spec, 0);
+		efx_mae_action_set_populate_mark_reset(ctx.spec);
 
 		ctx.ft_switch_hit_counter =
 			&spec_mae->ft_ctx->switch_hit_counter;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.470520000 +0800
+++ 0066-net-sfc-fix-resetting-mark-in-tunnel-offload-switch-.patch	2023-04-09 21:45:38.669042200 +0800
@@ -1 +1 @@
-From dfa00c456adb6f4214b581a5e82e601e963248d2 Mon Sep 17 00:00:00 2001
+From 993c0d08eb60e70a8e52ca5cb9b6a65a6829c819 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dfa00c456adb6f4214b581a5e82e601e963248d2 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 3daeed81b9..e5e9257998 100644
+index 82d5a95ec4..29b8bb9e25 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'kni: fix possible starvation when mbufs are exhausted' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (65 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/sfc: fix resetting mark in tunnel offload switch rules' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'cmdline: make rdline status not private' " Xueming Li
                     ` (69 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Yangchao Zhou; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/09b626852e51df9bb11dc300e9aaa9b2a49ef77a

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 09b626852e51df9bb11dc300e9aaa9b2a49ef77a Mon Sep 17 00:00:00 2001
From: Yangchao Zhou <zhouyates@gmail.com>
Date: Fri, 30 Dec 2022 12:23:38 +0800
Subject: [PATCH] kni: fix possible starvation when mbufs are exhausted
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a ]

In some scenarios, mbufs returned by rte_kni_rx_burst are not freed
immediately. So kni_allocate_mbufs may be failed, but we don't know.

Even worse, when alloc_q is completely exhausted, kni_net_tx in
rte_kni.ko will drop all tx packets. kni_allocate_mbufs is never
called again, even if the mbufs are eventually freed.

In this patch, we try to allocate mbufs for alloc_q when it is empty.

According to historical experience, the performance bottleneck of KNI
is offen the usleep_range of kni thread in rte_kni.ko.
The check of kni_fifo_count is trivial and the cost should be acceptable.

Fixes: 3e12a98fe397 ("kni: optimize Rx burst")

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 lib/kni/rte_kni.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
index 8ab6c47153..bfa6a001ff 100644
--- a/lib/kni/rte_kni.c
+++ b/lib/kni/rte_kni.c
@@ -634,8 +634,8 @@ rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)
 {
 	unsigned int ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);
 
-	/* If buffers removed, allocate mbufs and then put them into alloc_q */
-	if (ret)
+	/* If buffers removed or alloc_q is empty, allocate mbufs and then put them into alloc_q */
+	if (ret || (kni_fifo_count(kni->alloc_q) == 0))
 		kni_allocate_mbufs(kni);
 
 	return ret;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.495984800 +0800
+++ 0067-kni-fix-possible-starvation-when-mbufs-are-exhausted.patch	2023-04-09 21:45:38.679042200 +0800
@@ -1 +1 @@
-From 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a Mon Sep 17 00:00:00 2001
+From 09b626852e51df9bb11dc300e9aaa9b2a49ef77a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 676ed80ad98fcff39943d09b8fe21e2e01ae3d4a ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'cmdline: make rdline status not private' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (66 preceding siblings ...)
  2023-04-09 15:24   ` patch 'kni: fix possible starvation when mbufs are exhausted' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'cmdline: handle EOF as quit' " Xueming Li
                     ` (68 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Chengwen Feng, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1a22081244a86a6f94dd90d9c8690df266fb0923

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1a22081244a86a6f94dd90d9c8690df266fb0923 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:07 -0800
Subject: [PATCH] cmdline: make rdline status not private
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1ac8dd1d1b62c59cd440e5529e3bd5a500e72f76 ]

The function cmdline_poll() returns values from rdline_status enum
but that was moved to being defined only in cmdline_private.h.

For proper use of the API the return value needs to be visible
to callers. This was not a problem before because cmdline_poll()
was not used anywhere.

Fixes: f8f8dc289095 ("cmdline: make struct rdline opaque")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/cmdline/cmdline.h         | 6 ++++++
 lib/cmdline/cmdline_private.h | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/cmdline/cmdline.h b/lib/cmdline/cmdline.h
index 96674dfda2..b14355ef51 100644
--- a/lib/cmdline/cmdline.h
+++ b/lib/cmdline/cmdline.h
@@ -23,6 +23,12 @@
 extern "C" {
 #endif
 
+enum rdline_status {
+	RDLINE_INIT,
+	RDLINE_RUNNING,
+	RDLINE_EXITED
+};
+
 struct cmdline;
 
 struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h
index c2e906d8de..a3271c7693 100644
--- a/lib/cmdline/cmdline_private.h
+++ b/lib/cmdline/cmdline_private.h
@@ -23,12 +23,6 @@
 #define RDLINE_HISTORY_BUF_SIZE BUFSIZ
 #define RDLINE_HISTORY_MAX_LINE 64
 
-enum rdline_status {
-	RDLINE_INIT,
-	RDLINE_RUNNING,
-	RDLINE_EXITED
-};
-
 struct rdline {
 	enum rdline_status status;
 	/* rdline bufs */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.517705400 +0800
+++ 0068-cmdline-make-rdline-status-not-private.patch	2023-04-09 21:45:38.679042200 +0800
@@ -1 +1 @@
-From 1ac8dd1d1b62c59cd440e5529e3bd5a500e72f76 Mon Sep 17 00:00:00 2001
+From 1a22081244a86a6f94dd90d9c8690df266fb0923 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1ac8dd1d1b62c59cd440e5529e3bd5a500e72f76 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'cmdline: handle EOF as quit' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (67 preceding siblings ...)
  2023-04-09 15:24   ` patch 'cmdline: make rdline status not private' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/testpmd: cleanup cleanly from signal' " Xueming Li
                     ` (67 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/564dbb6a03e87eb4818098b6884da37c72e4f3be

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 564dbb6a03e87eb4818098b6884da37c72e4f3be Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:08 -0800
Subject: [PATCH] cmdline: handle EOF as quit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ]

If end of file is reached on input, then cmdline_poll() will
return 1 (ie file has something); and then the cmdline_in()
call to read will return 0. With the existing code,
caller has no way to tell that end of file has been reached
 and will retry forever.

A good way to handle this is to make end of file equivalent
to the quit command. Since no more input is possible at that
point.

Fixes: 067855e651d6 ("cmdline: add polling mode")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/cmdline/cmdline.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
index e1009ba4c4..8ad0690d85 100644
--- a/lib/cmdline/cmdline.c
+++ b/lib/cmdline/cmdline.c
@@ -197,9 +197,14 @@ cmdline_poll(struct cmdline *cl)
 		if (read_status < 0)
 			return read_status;
 
-		status = cmdline_in(cl, &c, 1);
-		if (status < 0 && cl->rdl.status != RDLINE_EXITED)
-			return status;
+		if (read_status == 0) {
+			/* end of file is implicit quit */
+			cmdline_quit(cl);
+		} else {
+			status = cmdline_in(cl, &c, 1);
+			if (status < 0 && cl->rdl.status != RDLINE_EXITED)
+				return status;
+		}
 	}
 
 	return cl->rdl.status;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.539801600 +0800
+++ 0069-cmdline-handle-EOF-as-quit.patch	2023-04-09 21:45:38.679042200 +0800
@@ -1 +1 @@
-From 415549f1ccce62b82cb182175346904a65f74cec Mon Sep 17 00:00:00 2001
+From 564dbb6a03e87eb4818098b6884da37c72e4f3be Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 415549f1ccce62b82cb182175346904a65f74cec ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/testpmd: cleanup cleanly from signal' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (68 preceding siblings ...)
  2023-04-09 15:24   ` patch 'cmdline: handle EOF as quit' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'mem: fix heap ID in telemetry' " Xueming Li
                     ` (66 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/57294e8df49dd6cf276130cc922400ecbab0f983

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 57294e8df49dd6cf276130cc922400ecbab0f983 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 3 Feb 2023 11:14:09 -0800
Subject: [PATCH] app/testpmd: cleanup cleanly from signal
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]

Do a clean shutdown of testpmd when a signal is received; instead of
having testpmd kill itself.  This fixes the problem where a signal could
be received in the middle of a PMD and then the signal handler would
call PMD's close routine leading to locking problems.

The cmdline structure no longer needs to be global it can
just be local to the prompt() function.

An added benefit is it gets rid of some Windows specific code.

Fixes: d9a191a00e81 ("app/testpmd: fix quitting in container")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/cmdline.c | 29 ++++++----------
 app/test-pmd/testpmd.c | 77 ++++++++++++++++++++----------------------
 app/test-pmd/testpmd.h |  1 +
 3 files changed, 48 insertions(+), 59 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b32dc8bfd4..bd31e16e0f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -65,7 +65,6 @@
 #include "cmdline_tm.h"
 #include "bpf_cmd.h"
 
-static struct cmdline *testpmd_cl;
 static cmdline_parse_ctx_t *main_ctx;
 static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head =
 	TAILQ_HEAD_INITIALIZER(driver_commands_head);
@@ -12921,28 +12920,22 @@ cmdline_read_from_file(const char *filename)
 void
 prompt(void)
 {
-	int ret;
+	struct cmdline *cl;
 
-	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
-	if (testpmd_cl == NULL)
+	cl = cmdline_stdin_new(main_ctx, "testpmd> ");
+	if (cl == NULL)
 		return;
 
-	ret = atexit(prompt_exit);
-	if (ret != 0)
-		fprintf(stderr, "Cannot set exit function for cmdline\n");
-
-	cmdline_interact(testpmd_cl);
-	if (ret != 0)
-		cmdline_stdin_exit(testpmd_cl);
-}
+	/* loop until signal or quit command */
+	while (f_quit == 0 && cl_quit == 0) {
+		int status = cmdline_poll(cl);
 
-void
-prompt_exit(void)
-{
-	if (testpmd_cl != NULL) {
-		cmdline_quit(testpmd_cl);
-		cmdline_stdin_exit(testpmd_cl);
+		if (status < 0 || status == RDLINE_EXITED)
+			break;
 	}
+
+	cmdline_quit(cl);
+	cmdline_stdin_exit(cl);
 }
 
 void
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 60b5942d80..1b54698bf6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -11,6 +11,7 @@
 #include <fcntl.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <sys/mman.h>
+#include <sys/select.h>
 #endif
 #include <sys/types.h>
 #include <errno.h>
@@ -231,7 +232,7 @@ unsigned int xstats_display_num; /**< Size of extended statistics to show */
  * In container, it cannot terminate the process which running with 'stats-period'
  * option. Set flag to exit stats period loop after received SIGINT/SIGTERM.
  */
-static volatile uint8_t f_quit;
+volatile uint8_t f_quit;
 uint8_t cl_quit; /* Quit testpmd from cmdline. */
 
 /*
@@ -4392,13 +4393,6 @@ init_port(void)
 	memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS);
 }
 
-static void
-force_quit(void)
-{
-	pmd_test_exit();
-	prompt_exit();
-}
-
 static void
 print_stats(void)
 {
@@ -4417,28 +4411,9 @@ print_stats(void)
 }
 
 static void
-signal_handler(int signum)
+signal_handler(int signum __rte_unused)
 {
-	if (signum == SIGINT || signum == SIGTERM) {
-		fprintf(stderr, "\nSignal %d received, preparing to exit...\n",
-			signum);
-#ifdef RTE_LIB_PDUMP
-		/* uninitialize packet capture framework */
-		rte_pdump_uninit();
-#endif
-#ifdef RTE_LIB_LATENCYSTATS
-		if (latencystats_enabled != 0)
-			rte_latencystats_uninit();
-#endif
-		force_quit();
-		/* Set flag to indicate the force termination. */
-		f_quit = 1;
-		/* exit with the expected status */
-#ifndef RTE_EXEC_ENV_WINDOWS
-		signal(signum, SIG_DFL);
-		kill(getpid(), signum);
-#endif
-	}
+	f_quit = 1;
 }
 
 int
@@ -4618,15 +4593,9 @@ main(int argc, char** argv)
 			start_packet_forwarding(0);
 		}
 		prompt();
-		pmd_test_exit();
 	} else
 #endif
 	{
-		char c;
-		int rc;
-
-		f_quit = 0;
-
 		printf("No commandline core given, start packet forwarding\n");
 		start_packet_forwarding(tx_first);
 		if (stats_period != 0) {
@@ -4649,15 +4618,41 @@ main(int argc, char** argv)
 				prev_time = cur_time;
 				rte_delay_us_sleep(US_PER_S);
 			}
-		}
+		} else {
+			char c;
+			fd_set fds;
+
+			printf("Press enter to exit\n");
 
-		printf("Press enter to exit\n");
-		rc = read(0, &c, 1);
-		pmd_test_exit();
-		if (rc < 0)
-			return 1;
+			FD_ZERO(&fds);
+			FD_SET(0, &fds);
+
+			/* wait for signal or enter */
+			ret = select(1, &fds, NULL, NULL, NULL);
+			if (ret < 0 && errno != EINTR)
+				rte_exit(EXIT_FAILURE,
+					 "Select failed: %s\n",
+					 strerror(errno));
+
+			/* if got enter then consume it */
+			if (ret == 1 && read(0, &c, 1) < 0)
+				rte_exit(EXIT_FAILURE,
+					 "Read failed: %s\n",
+					 strerror(errno));
+		}
 	}
 
+	pmd_test_exit();
+
+#ifdef RTE_LIB_PDUMP
+	/* uninitialize packet capture framework */
+	rte_pdump_uninit();
+#endif
+#ifdef RTE_LIB_LATENCYSTATS
+	if (latencystats_enabled != 0)
+		rte_latencystats_uninit();
+#endif
+
 	ret = rte_eal_cleanup();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 7d24d25970..022210a7a9 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -34,6 +34,7 @@
 #define RTE_PORT_HANDLING       (uint16_t)3
 
 extern uint8_t cl_quit;
+extern volatile uint8_t f_quit;
 
 /*
  * It is used to allocate the memory for hash key.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.562840900 +0800
+++ 0070-app-testpmd-cleanup-cleanly-from-signal.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff Mon Sep 17 00:00:00 2001
+From 57294e8df49dd6cf276130cc922400ecbab0f983 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0fd1386c30c3ad9365d7fdd2829bf7cb2e1b9dff ]
@@ -17 +19,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index 02c72d06b7..6fa870dc32 100644
+index b32dc8bfd4..bd31e16e0f 100644
@@ -31 +33 @@
-@@ -66,7 +66,6 @@
+@@ -65,7 +65,6 @@
@@ -39 +41 @@
-@@ -13033,28 +13032,22 @@ cmdline_read_from_file(const char *filename)
+@@ -12921,28 +12920,22 @@ cmdline_read_from_file(const char *filename)
@@ -80 +82 @@
-index 0032696608..2ce19ed47a 100644
+index 60b5942d80..1b54698bf6 100644
@@ -100 +102 @@
-@@ -4447,13 +4448,6 @@ init_port(void)
+@@ -4392,13 +4393,6 @@ init_port(void)
@@ -114 +116 @@
-@@ -4472,28 +4466,9 @@ print_stats(void)
+@@ -4417,28 +4411,9 @@ print_stats(void)
@@ -145 +147 @@
-@@ -4677,15 +4652,9 @@ main(int argc, char** argv)
+@@ -4618,15 +4593,9 @@ main(int argc, char** argv)
@@ -161 +163 @@
-@@ -4708,15 +4677,41 @@ main(int argc, char** argv)
+@@ -4649,15 +4618,41 @@ main(int argc, char** argv)
@@ -210 +212 @@
-index b9215720b6..bdfbfd36d3 100644
+index 7d24d25970..022210a7a9 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'mem: fix heap ID in telemetry' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (69 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/testpmd: cleanup cleanly from signal' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of hash key when config' " Xueming Li
                     ` (65 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Chengwen Feng, Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/73b11178a39618365920a9b6249e494a6178562d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 73b11178a39618365920a9b6249e494a6178562d Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Wed, 22 Feb 2023 15:49:53 +0800
Subject: [PATCH] mem: fix heap ID in telemetry
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a9dc4888dd1b81b82781aaa1e2606a1c53d13422 ]

The telemetry lib has added a allowed characters set for dictionary names.
Please see commit 2537fb0c5f34 ("telemetry: limit characters allowed in
dictionary names")

The space is not in this set, which cause the heap ID in /eal/heap_info
cannot be displayed. Additionally, 'heap' is also misspelling. So use
'Heap_id' to replace 'Head id'.

Fixes: e6732d0d6e26 ("mem: add telemetry infos")
Fixes: 2537fb0c5f34 ("telemetry: limit characters allowed in dictionary names")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/eal/common/eal_common_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index 8e427bf4b4..da6711d129 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -1139,7 +1139,7 @@ handle_eal_heap_info_request(const char *cmd __rte_unused, const char *params,
 	malloc_heap_get_stats(heap, &sock_stats);
 
 	rte_tel_data_start_dict(d);
-	rte_tel_data_add_dict_u64(d, "Head id", heap_id);
+	rte_tel_data_add_dict_u64(d, "Head_id", heap_id);
 	rte_tel_data_add_dict_string(d, "Name", heap->name);
 	rte_tel_data_add_dict_u64(d, "Heap_size",
 				  sock_stats.heap_totalsz_bytes);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.595263500 +0800
+++ 0071-mem-fix-heap-ID-in-telemetry.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From a9dc4888dd1b81b82781aaa1e2606a1c53d13422 Mon Sep 17 00:00:00 2001
+From 73b11178a39618365920a9b6249e494a6178562d Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a9dc4888dd1b81b82781aaa1e2606a1c53d13422 ]
@@ -19 +21,0 @@
-Cc: stable@dpdk.org
@@ -25,17 +27,3 @@
- doc/guides/rel_notes/release_23_03.rst | 2 ++
- lib/eal/common/eal_common_memory.c     | 2 +-
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
-index 17ffabbb8c..af6f37389c 100644
---- a/doc/guides/rel_notes/release_23_03.rst
-+++ b/doc/guides/rel_notes/release_23_03.rst
-@@ -260,6 +260,8 @@ API Changes
-    Also, make sure to start the actual text at the margin.
-    =======================================================
- 
-+* The telemetry command ``/eal/heap_info`` is fixed to print ``Heap_id``.
-+
- * The experimental function ``rte_pcapng_copy`` was updated to support comment
-   section in enhanced packet block in the pcapng library.
- 
+ lib/eal/common/eal_common_memory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
@@ -43 +31 @@
-index c917b981bc..c2a4c8f9e7 100644
+index 8e427bf4b4..da6711d129 100644
@@ -50,2 +38,2 @@
--	rte_tel_data_add_dict_uint(d, "Head id", heap_id);
-+	rte_tel_data_add_dict_uint(d, "Heap_id", heap_id);
+-	rte_tel_data_add_dict_u64(d, "Head id", heap_id);
++	rte_tel_data_add_dict_u64(d, "Head_id", heap_id);
@@ -53,2 +41,2 @@
- 	rte_tel_data_add_dict_uint(d, "Heap_size",
- 				   sock_stats.heap_totalsz_bytes);
+ 	rte_tel_data_add_dict_u64(d, "Heap_size",
+ 				  sock_stats.heap_totalsz_bytes);

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: fix possible truncation of hash key when config' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (70 preceding siblings ...)
  2023-04-09 15:24   ` patch 'mem: fix heap ID in telemetry' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of redirection table' " Xueming Li
                     ` (64 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/81fbc0298c062e88ba596d12cd77f6748967ff47

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 81fbc0298c062e88ba596d12cd77f6748967ff47 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:03 +0800
Subject: [PATCH] net/hns3: fix possible truncation of hash key when config
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit bb38316e738ad6009b3f20b3abfaf27ea8cb0202 ]

The hash key length of hns3 driver is obtained from firmware. If the
length is a multiple of HNS3_RSS_HASH_KEY_NUM (16), the last part
of hash key will be truncated.

Fixes: 88347111eb53 ("net/hns3: refactor set RSS hash algorithm and key interface")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index d6e0754273..2011c18b9b 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -301,7 +301,8 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 		req->hash_config |= (hash_algo & HNS3_RSS_HASH_ALGO_MASK);
 		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);
 
-		if (idx == max_bd_num - 1)
+		if (idx == max_bd_num - 1 &&
+		    (key_len % HNS3_RSS_HASH_KEY_NUM) != 0)
 			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
 		else
 			cur_key_size = HNS3_RSS_HASH_KEY_NUM;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.618902300 +0800
+++ 0072-net-hns3-fix-possible-truncation-of-hash-key-when-co.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From bb38316e738ad6009b3f20b3abfaf27ea8cb0202 Mon Sep 17 00:00:00 2001
+From 81fbc0298c062e88ba596d12cd77f6748967ff47 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit bb38316e738ad6009b3f20b3abfaf27ea8cb0202 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: fix possible truncation of redirection table' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (71 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of hash key when config' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash key' " Xueming Li
                     ` (63 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/5042fd84592f5d876da1b89df48b5a52670e9e3e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5042fd84592f5d876da1b89df48b5a52670e9e3e Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:04 +0800
Subject: [PATCH] net/hns3: fix possible truncation of redirection table
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ]

The size of the redirection table is obtained from firmware. If the size
isn't a multiple of HNS3_RSS_CFG_TBL_SIZE, the redirection table from
user will be truncated.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 2011c18b9b..ed397587b5 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -329,6 +329,7 @@ int
 hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 {
 	struct hns3_rss_indirection_table_cmd *req;
+	uint16_t max_bd_num, cfg_tbl_size;
 	struct hns3_cmd_desc desc;
 	uint8_t qid_msb_off;
 	uint8_t qid_msb_val;
@@ -337,14 +338,20 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 	int ret;
 
 	req = (struct hns3_rss_indirection_table_cmd *)desc.data;
-
-	for (i = 0; i < size / HNS3_RSS_CFG_TBL_SIZE; i++) {
+	max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE);
+	for (i = 0; i < max_bd_num; i++) {
 		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE,
 					  false);
 		req->start_table_index =
 				rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE);
 		req->rss_set_bitmap = rte_cpu_to_le_16(HNS3_RSS_SET_BITMAP_MSK);
-		for (j = 0; j < HNS3_RSS_CFG_TBL_SIZE; j++) {
+
+		if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0)
+			cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE;
+		else
+			cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE;
+
+		for (j = 0; j < cfg_tbl_size; j++) {
 			q_id = indir[i * HNS3_RSS_CFG_TBL_SIZE + j];
 			req->rss_result_l[j] = q_id & 0xff;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.644186000 +0800
+++ 0073-net-hns3-fix-possible-truncation-of-redirection-tabl.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From 4729376e555b58a739e6e231d403ca3b029ad92c Mon Sep 17 00:00:00 2001
+From 5042fd84592f5d876da1b89df48b5a52670e9e3e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4729376e555b58a739e6e231d403ca3b029ad92c ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: use hardware config to report hash key' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (72 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of redirection table' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash types' " Xueming Li
                     ` (62 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/68da0b3986cc3f7be8cdad3b43effedd605d1fb4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 68da0b3986cc3f7be8cdad3b43effedd605d1fb4 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:05 +0800
Subject: [PATCH] net/hns3: use hardware config to report hash key
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c ]

Currently, hns3_dev_rss_hash_conf_get() interface reports RSS key from
the key maintained by driver. It's better to report the key from
hardware, which is more realistic.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 53 ++++++++++++++++++++++++++++++++++++-
 drivers/net/hns3/hns3_rss.h |  3 ++-
 2 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index ed397587b5..a8ea5150ab 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -321,6 +321,48 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 	return 0;
 }
 
+int
+hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
+		      uint8_t *key, uint8_t key_len)
+{
+	struct hns3_rss_generic_config_cmd *req;
+	struct hns3_cmd_desc desc;
+	uint16_t cur_key_size;
+	uint16_t max_bd_num;
+	uint8_t *cur_key;
+	uint16_t idx;
+	int ret;
+
+	req = (struct hns3_rss_generic_config_cmd *)desc.data;
+	max_bd_num = DIV_ROUND_UP(key_len, HNS3_RSS_HASH_KEY_NUM);
+	for (idx = 0; idx < max_bd_num; idx++) {
+		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_GENERIC_CONFIG,
+					  true);
+
+		req->hash_config |= (idx << HNS3_RSS_HASH_KEY_OFFSET_B);
+		ret = hns3_cmd_send(hw, &desc, 1);
+		if (ret) {
+			hns3_err(hw, "fail to obtain RSS algo and key from firmware, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		if (idx == 0)
+			*hash_algo = req->hash_config & HNS3_RSS_HASH_ALGO_MASK;
+
+		if (idx == max_bd_num - 1 &&
+		    (key_len % HNS3_RSS_HASH_KEY_NUM) != 0)
+			cur_key_size = key_len % HNS3_RSS_HASH_KEY_NUM;
+		else
+			cur_key_size = HNS3_RSS_HASH_KEY_NUM;
+
+		cur_key = key + idx * HNS3_RSS_HASH_KEY_NUM;
+		memcpy(cur_key, req->hash_key, cur_key_size);
+	}
+
+	return 0;
+}
+
 /*
  * rss_indirection_table command function, opcode:0x0D07.
  * Used to configure the indirection table of rss.
@@ -550,13 +592,22 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
+	uint8_t hash_algo;
+	int ret;
 
 	rte_spinlock_lock(&hw->lock);
 	rss_conf->rss_hf = rss_cfg->conf.types;
 
 	/* Get the RSS Key required by the user */
 	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
-		memcpy(rss_conf->rss_key, rss_cfg->key, hw->rss_key_size);
+		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
+					    hw->rss_key_size);
+		if (ret != 0) {
+			rte_spinlock_unlock(&hw->lock);
+			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
+				 ret);
+			return ret;
+		}
 		rss_conf->rss_key_len = hw->rss_key_size;
 	}
 	rte_spinlock_unlock(&hw->lock);
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index d6f81996f4..be0141f602 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -112,6 +112,7 @@ void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
 int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
-
+int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
+			  uint8_t *key, uint8_t key_len);
 
 #endif /* HNS3_RSS_H */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.678319800 +0800
+++ 0074-net-hns3-use-hardware-config-to-report-hash-key.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c Mon Sep 17 00:00:00 2001
+From 68da0b3986cc3f7be8cdad3b43effedd605d1fb4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7da415d27d8872a45a2d0cf9b5e66a8027c8f53c ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: use hardware config to report hash types' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (73 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash key' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report redirection table' " Xueming Li
                     ` (61 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dbcf64d12eeb6b91087a6bad81636c5faddf0d66

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dbcf64d12eeb6b91087a6bad81636c5faddf0d66 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:06 +0800
Subject: [PATCH] net/hns3: use hardware config to report hash types
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 406b25c7ffd2d84b1e09665872f69755c75e7d89 ]

Use the configuration in hardware to report hash types instead
of data maintained in software.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 260 ++++++++++++++++++++++++++++--------
 drivers/net/hns3/hns3_rss.h |   1 +
 2 files changed, 208 insertions(+), 53 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index a8ea5150ab..9addc00a67 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -70,6 +70,17 @@ enum hns3_tuple_field {
 	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
 };
 
+#define HNS3_RSS_TUPLE_IPV4_TCP_M	GENMASK(3, 0)
+#define HNS3_RSS_TUPLE_IPV4_UDP_M	GENMASK(11, 8)
+#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(20, 16)
+#define HNS3_RSS_TUPLE_IPV4_NONF_M	GENMASK(25, 24)
+#define HNS3_RSS_TUPLE_IPV4_FLAG_M	GENMASK(27, 26)
+#define HNS3_RSS_TUPLE_IPV6_TCP_M	GENMASK(35, 32)
+#define HNS3_RSS_TUPLE_IPV6_UDP_M	GENMASK(43, 40)
+#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(52, 48)
+#define HNS3_RSS_TUPLE_IPV6_NONF_M	GENMASK(57, 56)
+#define HNS3_RSS_TUPLE_IPV6_FLAG_M	GENMASK(59, 58)
+
 enum hns3_rss_tuple_type {
 	HNS3_RSS_IP_TUPLE,
 	HNS3_RSS_IP_L4_TUPLE,
@@ -79,200 +90,249 @@ static const struct {
 	uint64_t rss_types;
 	uint16_t tuple_type;
 	uint64_t rss_field;
+	uint64_t tuple_mask;
 } hns3_set_tuple_table[] = {
 	/* IPV4-FRAG */
 	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 	{ RTE_ETH_RSS_FRAG_IPV4,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_FLAG_M },
 
 	/* IPV4 */
 	{ RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ RTE_ETH_RSS_IPV4,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 
 	/* IPV4-OTHER */
 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_NONF_M },
 
 	/* IPV4-TCP */
 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV4_TCP_M },
 
 	/* IPV4-UDP */
 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV4_UDP_M },
 
 	/* IPV4-SCTP */
 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER),
+	  HNS3_RSS_TUPLE_IPV4_SCTP_M },
 
 	/* IPV6-FRAG */
 	{ RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 	{ RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 	{ RTE_ETH_RSS_FRAG_IPV6,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_FLAG_M },
 
 	/* IPV6 */
 	{ RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ RTE_ETH_RSS_IPV6,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 
 	/* IPV6-OTHER */
 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER,
 	  HNS3_RSS_IP_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_NONF_M },
 
 	/* IPV6-TCP */
 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D),
+	  HNS3_RSS_TUPLE_IPV6_TCP_M },
 
 	/* IPV6-UDP */
 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D),
+	  HNS3_RSS_TUPLE_IPV6_UDP_M },
 
 	/* IPV6-SCTP */
 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_SRC_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_DST_ONLY,
 	  HNS3_RSS_IP_L4_TUPLE,
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP,
 	  HNS3_RSS_IP_L4_TUPLE,
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) |
 	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S) |
-	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER) },
+	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER),
+	  HNS3_RSS_TUPLE_IPV6_SCTP_M },
 };
 
 /*
@@ -576,6 +636,96 @@ set_tuple_fail:
 	return ret;
 }
 
+int
+hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields)
+{
+	struct hns3_rss_input_tuple_cmd *req;
+	struct hns3_cmd_desc desc;
+	int ret;
+
+	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, true);
+	req = (struct hns3_rss_input_tuple_cmd *)desc.data;
+	ret = hns3_cmd_send(hw, &desc, 1);
+	if (ret != 0) {
+		hns3_err(hw, "fail to get RSS hash tuple fields from firmware, ret = %d",
+			 ret);
+		return ret;
+	}
+
+	*tuple_fields = rte_le_to_cpu_64(req->tuple_field);
+
+	return 0;
+}
+
+static uint64_t
+hns3_rss_tuple_fields_to_rss_hf(struct hns3_hw *hw, uint64_t tuple_fields)
+{
+	uint64_t ipv6_sctp_l4_mask =
+				BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D) |
+				BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S);
+	uint64_t rss_hf = 0;
+	uint64_t tuple_mask;
+	uint32_t i;
+
+	for (i = 0; i < RTE_DIM(hns3_set_tuple_table); i++) {
+		tuple_mask = hns3_set_tuple_table[i].tuple_mask;
+		/*
+		 * The RSS hash of the packet type is disabled if its tuples is
+		 * zero.
+		 */
+		if ((tuple_fields & tuple_mask) == 0)
+			continue;
+
+		/*
+		 * Some hardware don't support to use src/dst port fields to
+		 * hash for IPV6-SCTP packet.
+		 */
+		if ((hns3_set_tuple_table[i].rss_types &
+					RTE_ETH_RSS_NONFRAG_IPV6_SCTP) &&
+		    !hw->rss_info.ipv6_sctp_offload_supported)
+			tuple_mask &= ~ipv6_sctp_l4_mask;
+
+		/*
+		 * The framework (ethdev ops) or driver (rte flow API) ensure
+		 * that both L3_SRC/DST_ONLY and L4_SRC/DST_ONLY cannot be set
+		 * to driver at the same time. But if user doesn't specify
+		 * anything L3/L4_SRC/DST_ONLY, driver enables all tuple fields.
+		 * In this case, driver should not report L3/L4_SRC/DST_ONLY.
+		 */
+		if ((tuple_fields & tuple_mask) == tuple_mask) {
+			/* Skip the item enabled part tuples. */
+			if ((tuple_fields & hns3_set_tuple_table[i].rss_field) !=
+					tuple_mask)
+				continue;
+
+			rss_hf |= hns3_set_tuple_table[i].rss_types;
+			continue;
+		}
+
+		/* Match the item enabled part tuples.*/
+		if ((tuple_fields & hns3_set_tuple_table[i].rss_field) ==
+					hns3_set_tuple_table[i].rss_field)
+			rss_hf |= hns3_set_tuple_table[i].rss_types;
+	}
+
+	return rss_hf;
+}
+
+static int
+hns3_rss_hash_get_rss_hf(struct hns3_hw *hw, uint64_t *rss_hf)
+{
+	uint64_t tuple_fields;
+	int ret;
+
+	ret = hns3_get_rss_tuple_field(hw, &tuple_fields);
+	if (ret != 0)
+		return ret;
+
+	*rss_hf = hns3_rss_tuple_fields_to_rss_hf(hw, tuple_fields);
+
+	return 0;
+}
+
 /*
  * Get rss key and rss_hf types set of RSS hash configuration.
  * @param dev
@@ -591,28 +741,32 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
 	uint8_t hash_algo;
 	int ret;
 
 	rte_spinlock_lock(&hw->lock);
-	rss_conf->rss_hf = rss_cfg->conf.types;
+	ret = hns3_rss_hash_get_rss_hf(hw, &rss_conf->rss_hf);
+	if (ret != 0) {
+		hns3_err(hw, "obtain hash tuples failed, ret = %d", ret);
+		goto out;
+	}
 
 	/* Get the RSS Key required by the user */
 	if (rss_conf->rss_key && rss_conf->rss_key_len >= hw->rss_key_size) {
 		ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_conf->rss_key,
 					    hw->rss_key_size);
 		if (ret != 0) {
-			rte_spinlock_unlock(&hw->lock);
 			hns3_err(hw, "obtain hash algo and key failed, ret = %d",
 				 ret);
-			return ret;
+			goto out;
 		}
 		rss_conf->rss_key_len = hw->rss_key_size;
 	}
+
+out:
 	rte_spinlock_unlock(&hw->lock);
 
-	return 0;
+	return ret;
 }
 
 /*
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index be0141f602..17473e70e2 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -110,6 +110,7 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
+int hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields);
 int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
 int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.703016900 +0800
+++ 0075-net-hns3-use-hardware-config-to-report-hash-types.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From 406b25c7ffd2d84b1e09665872f69755c75e7d89 Mon Sep 17 00:00:00 2001
+From dbcf64d12eeb6b91087a6bad81636c5faddf0d66 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 406b25c7ffd2d84b1e09665872f69755c75e7d89 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: use hardware config to report redirection table' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (74 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash types' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate setting hash algorithm' " Xueming Li
                     ` (60 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:07 +0800
Subject: [PATCH] net/hns3: use hardware config to report redirection table
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ]

Currently, reta_query() API reports the redirection table from software.
This patch uses the one in hardware to report.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_cmd.h |  1 +
 drivers/net/hns3/hns3_rss.c | 65 ++++++++++++++++++++++++++++++++++---
 2 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 994dfc48cc..eb394c9dec 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -606,6 +606,7 @@ struct hns3_rss_input_tuple_cmd {
 #define HNS3_RSS_CFG_TBL_SIZE_H		4
 #define HNS3_RSS_CFG_TBL_BW_H		2
 #define HNS3_RSS_CFG_TBL_BW_L		8
+#define HNS3_RSS_CFG_TBL_BW_H_M		0x3
 
 /* Configure the indirection table, opcode:0x0D07 */
 struct hns3_rss_indirection_table_cmd {
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 9addc00a67..7dc4e03d83 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -481,6 +481,54 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 	return 0;
 }
 
+static int
+hns3_get_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
+{
+	struct hns3_rss_indirection_table_cmd *req;
+	uint16_t max_bd_num, cfg_tbl_size;
+	uint8_t qid_msb_off, qid_msb_idx;
+	struct hns3_cmd_desc desc;
+	uint16_t q_id, q_hi, q_lo;
+	uint8_t rss_result_h;
+	uint16_t i, j;
+	int ret;
+
+	req = (struct hns3_rss_indirection_table_cmd *)desc.data;
+	max_bd_num = DIV_ROUND_UP(size, HNS3_RSS_CFG_TBL_SIZE);
+	for (i = 0; i < max_bd_num; i++) {
+		hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INDIR_TABLE,
+					  true);
+		req->start_table_index =
+				rte_cpu_to_le_16(i * HNS3_RSS_CFG_TBL_SIZE);
+		ret = hns3_cmd_send(hw, &desc, 1);
+		if (ret) {
+			hns3_err(hw, "fail to get RSS indirection table from firmware, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		if (i == max_bd_num - 1 && (size % HNS3_RSS_CFG_TBL_SIZE) != 0)
+			cfg_tbl_size = size % HNS3_RSS_CFG_TBL_SIZE;
+		else
+			cfg_tbl_size = HNS3_RSS_CFG_TBL_SIZE;
+
+		for (j = 0; j < cfg_tbl_size; j++) {
+			qid_msb_idx =
+				j * HNS3_RSS_CFG_TBL_BW_H / HNS3_BITS_PER_BYTE;
+			rss_result_h = req->rss_result_h[qid_msb_idx];
+			qid_msb_off =
+				j * HNS3_RSS_CFG_TBL_BW_H % HNS3_BITS_PER_BYTE;
+			q_hi = (rss_result_h >> qid_msb_off) &
+						HNS3_RSS_CFG_TBL_BW_H_M;
+			q_lo = req->rss_result_l[j];
+			q_id = (q_hi << HNS3_RSS_CFG_TBL_BW_L) | q_lo;
+			indir[i * HNS3_RSS_CFG_TBL_SIZE + j] = q_id;
+		}
+	}
+
+	return 0;
+}
+
 int
 hns3_rss_reset_indir_table(struct hns3_hw *hw)
 {
@@ -842,10 +890,11 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,
 			uint16_t reta_size)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
+	uint16_t reta_table[HNS3_RSS_IND_TBL_SIZE_MAX];
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
 	uint16_t idx, shift;
 	uint16_t i;
+	int ret;
 
 	if (reta_size != hw->rss_ind_tbl_size) {
 		hns3_err(hw, "The size of hash lookup table configured (%u)"
@@ -854,14 +903,22 @@ hns3_dev_rss_reta_query(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 	rte_spinlock_lock(&hw->lock);
+	ret = hns3_get_rss_indir_table(hw, reta_table, reta_size);
+	if (ret != 0) {
+		rte_spinlock_unlock(&hw->lock);
+		hns3_err(hw, "query RSS redirection table failed, ret = %d.",
+			 ret);
+		return ret;
+	}
+	rte_spinlock_unlock(&hw->lock);
+
 	for (i = 0; i < reta_size; i++) {
 		idx = i / RTE_ETH_RETA_GROUP_SIZE;
 		shift = i % RTE_ETH_RETA_GROUP_SIZE;
 		if (reta_conf[idx].mask & (1ULL << shift))
-			reta_conf[idx].reta[shift] =
-						rss_cfg->rss_indirection_tbl[i];
+			reta_conf[idx].reta[shift] = reta_table[i];
 	}
-	rte_spinlock_unlock(&hw->lock);
+
 	return 0;
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.729985800 +0800
+++ 0076-net-hns3-use-hardware-config-to-report-redirection-t.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From d1e37d1c6916858314a2c67e6317b0bb6c691b36 Mon Sep 17 00:00:00 2001
+From dde9ec15ea0e5461c9c2fb00e397d62a1e45a6f8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d1e37d1c6916858314a2c67e6317b0bb6c691b36 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate setting hash algorithm' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (75 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report redirection table' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate setting hash key' " Xueming Li
                     ` (59 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/9c24ae1b2df9e3875bd77de52ea8f5eb116a0190

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9c24ae1b2df9e3875bd77de52ea8f5eb116a0190 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:08 +0800
Subject: [PATCH] net/hns3: separate setting hash algorithm
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 ]

Currently, the setting of hash algorithm comes from the
default configuration in driver and the rte_flow interface.
The hash algorithm that is set to hardware in both ways is
saved in hw->rss_info.conf.func.

But the 'func' in struct rte_flow_action_rss is usually used
in rte flow interface. And the ethdev ops interface may also
set hash algorithm in the future. It is not appropriate and
is a little messy for ethdev ops interface and driver default
configuration to use struct rte_flow_action_rss. So we have
to separate the RSS configuration from ethdev ops and rte
flow interface to make codes more easier to maintain.

This patch separates hash algorithm by following ways:
1) 'hash_algo' in struct hns3_rss_conf is used for ethdev ops
   interface or default configuration in driver.
2) Add a 'rte_flow_hash_algo' field in struct hns3_rss_conf
   to save algorithm from rte flow interface. The main reasons
   are as follows:
   Currently, only the last rule is used to restore the rte
   flow rule. If 'func' in RSS action is 'DEFAULT', it means
   that this rule doesn't modify algorithm and driver need to
   save current algorithm for restoring algorithm during reset
   phase.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 60 +++++++++++++++++++++---------------
 drivers/net/hns3/hns3_rss.c  | 14 +--------
 drivers/net/hns3/hns3_rss.h  |  1 +
 3 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index e80ec0f053..0cb6914982 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1438,30 +1438,40 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 			 uint8_t *hash_algo)
 {
-	enum rte_eth_hash_function algo_func = *func;
-	switch (algo_func) {
-	case RTE_ETH_HASH_FUNCTION_DEFAULT:
-		/* Keep *hash_algo as what it used to be */
-		algo_func = hw->rss_info.conf.func;
-		break;
-	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
-		*hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		*hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
-		*hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
-		break;
-	default:
-		hns3_err(hw, "Invalid RSS algorithm configuration(%d)",
-			 algo_func);
-		return -EINVAL;
+	const uint8_t hash_func_map[] = {
+		[RTE_ETH_HASH_FUNCTION_DEFAULT] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+		[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+		[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = HNS3_RSS_HASH_ALGO_SIMPLE,
+		[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP,
+	};
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
+	int ret;
+
+	if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
+		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
+					    hw->rss_key_size);
+		if (ret != 0) {
+			hns3_err(hw, "fail to get current RSS hash algorithm, ret = %d",
+				 ret);
+			return ret;
+		}
+
+		/*
+		 * During the phase of reset recovery, the hash algorithm
+		 * obtained from hardware may not be the one used(saved in
+		 * rte_flow_hash_algo) when this rule is delivered.
+		 */
+		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
+		    *hash_algo != hw->rss_info.rte_flow_hash_algo)
+			*hash_algo = hw->rss_info.rte_flow_hash_algo;
+
+		return 0;
 	}
-	*func = algo_func;
+
+	*hash_algo = hash_func_map[func];
 
 	return 0;
 }
@@ -1471,6 +1481,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
+	uint8_t hash_algo;
 	int ret;
 
 	if (rss_config->key == NULL || rss_config->key_len != hw->rss_key_size) {
@@ -1480,18 +1491,17 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		use_default_key = true;
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, &rss_config->func,
-				       &hw->rss_info.hash_algo);
+	ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo);
 	if (ret)
 		return ret;
 
-	ret = hns3_rss_set_algo_key(hw, hw->rss_info.hash_algo,
+	ret = hns3_rss_set_algo_key(hw, hash_algo,
 				    use_default_key ? rss_key : rss_config->key,
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
 
-	hw->rss_info.conf.func = rss_config->func;
+	hw->rss_info.rte_flow_hash_algo = hash_algo;
 
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types);
 	if (ret)
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 7dc4e03d83..dcd42b554a 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -1022,7 +1022,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
 	uint16_t i;
 
 	/* Default hash algorithm */
-	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_TOEPLITZ;
+	rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
 
 	memcpy(rss_cfg->key, hns3_hash_key,
 		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
@@ -1046,18 +1046,6 @@ hns3_config_rss(struct hns3_adapter *hns)
 
 	enum rte_eth_rx_mq_mode mq_mode = hw->data->dev_conf.rxmode.mq_mode;
 
-	switch (hw->rss_info.conf.func) {
-	case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_SIMPLE;
-		break;
-	case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP;
-		break;
-	default:
-		hw->rss_info.hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
-		break;
-	}
-
 	ret = hns3_rss_set_algo_key(hw, rss_cfg->hash_algo,
 				    hash_key, hw->rss_key_size);
 	if (ret)
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 17473e70e2..6e679b709b 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -42,6 +42,7 @@ struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
+	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.754105900 +0800
+++ 0077-net-hns3-separate-setting-hash-algorithm.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 Mon Sep 17 00:00:00 2001
+From 9c24ae1b2df9e3875bd77de52ea8f5eb116a0190 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1fcbef5ccb993b6028a3f8a68a7b01f9b8c67413 ]
@@ -32 +34,0 @@
-Cc: stable@dpdk.org
@@ -43 +45 @@
-index 881d70613c..2faeb9ca52 100644
+index e80ec0f053..0cb6914982 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate setting hash key' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (76 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate setting hash algorithm' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate setting redirection table' " Xueming Li
                     ` (58 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/99c75dbbfe517b7f729aeb98789c7f0987da7fc3

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 99c75dbbfe517b7f729aeb98789c7f0987da7fc3 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:09 +0800
Subject: [PATCH] net/hns3: separate setting hash key
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit fe9cc8b88babd0911d91dc194b35c7c352e2bf7b ]

The settings of hash key comes from the ethdev ops (like, dev_configure
and rss_hash_update) and rte_flow API. For the ethdev ops, driver has
to save it to rss_info::key in hns3_hw structure so as to it can be
restored when reset is triggered. While rte_flow API no need to use
this field to save, they has a global flow_rss_list to maintain all
rules which save hash key. And hash key can be restored by this rule
information during the reset phase.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index dcd42b554a..401e3adfdf 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -376,8 +376,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			return ret;
 		}
 	}
-	/* Update the shadow RSS key with user specified */
-	memcpy(hw->rss_info.key, key, hw->rss_key_size);
+
 	return 0;
 }
 
@@ -672,6 +671,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 					    key, hw->rss_key_size);
 		if (ret)
 			goto set_algo_key_fail;
+		/* Update the shadow RSS key with user specified */
+		memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	}
 	rte_spinlock_unlock(&hw->lock);
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.779875200 +0800
+++ 0078-net-hns3-separate-setting-hash-key.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From fe9cc8b88babd0911d91dc194b35c7c352e2bf7b Mon Sep 17 00:00:00 2001
+From 99c75dbbfe517b7f729aeb98789c7f0987da7fc3 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit fe9cc8b88babd0911d91dc194b35c7c352e2bf7b ]
@@ -13,2 +15,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate setting redirection table' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (77 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate setting hash key' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate setting RSS types' " Xueming Li
                     ` (57 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/3b85ef547e6dfaf7d3d8a048222f218403778bda

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3b85ef547e6dfaf7d3d8a048222f218403778bda Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:10 +0800
Subject: [PATCH] net/hns3: separate setting redirection table
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit a421cb93462932717f23c5d8342381726e547ba6 ]

The settings of redirection table comes from the ethdev ops (like,
dev_configure and rss_hash_update) and rte_flow API. For the ethdev
ops, driver has to save it to rss_info::rss_indirection_tbl in hns3_hw
structure so as to it can be restored when reset is triggered.
While rte_flow API no need to use this field to save, they has a global
RSS flow list to maintain all rules which can be used to restore the
table during the reset phase.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  2 --
 drivers/net/hns3/hns3_rss.c  | 21 +++++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 0cb6914982..875c0eec11 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1519,8 +1519,6 @@ hns3_update_indir_table(struct hns3_hw *hw,
 	uint32_t i;
 
 	/* Fill in redirection table */
-	memcpy(indir_tbl, hw->rss_info.rss_indirection_tbl,
-	       sizeof(hw->rss_info.rss_indirection_tbl));
 	for (i = 0, j = 0; i < hw->rss_ind_tbl_size; i++, j++) {
 		j %= num;
 		if (conf->queue[j] >= hw->alloc_rss_size) {
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 401e3adfdf..751033d98f 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -473,10 +473,6 @@ hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, uint16_t size)
 		}
 	}
 
-	/* Update redirection table of hw */
-	memcpy(hw->rss_info.rss_indirection_tbl, indir,
-	       sizeof(uint16_t) * size);
-
 	return 0;
 }
 
@@ -542,8 +538,11 @@ hns3_rss_reset_indir_table(struct hns3_hw *hw)
 	}
 
 	ret = hns3_set_rss_indir_table(hw, lut, hw->rss_ind_tbl_size);
-	if (ret)
-		hns3_err(hw, "RSS uninit indir table failed: %d", ret);
+	if (ret != 0)
+		hns3_err(hw, "RSS uninit indir table failed, ret = %d.", ret);
+	else
+		memcpy(hw->rss_info.rss_indirection_tbl, lut,
+		       sizeof(uint16_t) * hw->rss_ind_tbl_size);
 	rte_free(lut);
 
 	return ret;
@@ -855,12 +854,12 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
 		idx = i / RTE_ETH_RETA_GROUP_SIZE;
 		shift = i % RTE_ETH_RETA_GROUP_SIZE;
 		if (reta_conf[idx].reta[shift] >= hw->alloc_rss_size) {
-			rte_spinlock_unlock(&hw->lock);
 			hns3_err(hw, "queue id(%u) set to redirection table "
 				 "exceeds queue number(%u) allocated to a TC",
 				 reta_conf[idx].reta[shift],
 				 hw->alloc_rss_size);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 
 		if (reta_conf[idx].mask & (1ULL << shift))
@@ -869,7 +868,13 @@ hns3_dev_rss_reta_update(struct rte_eth_dev *dev,
 
 	ret = hns3_set_rss_indir_table(hw, indirection_tbl,
 				       hw->rss_ind_tbl_size);
+	if (ret != 0)
+		goto out;
 
+	memcpy(rss_cfg->rss_indirection_tbl, indirection_tbl,
+	       sizeof(uint16_t) * hw->rss_ind_tbl_size);
+
+out:
 	rte_spinlock_unlock(&hw->lock);
 	return ret;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.801317000 +0800
+++ 0079-net-hns3-separate-setting-redirection-table.patch	2023-04-09 21:45:38.689042200 +0800
@@ -1 +1 @@
-From a421cb93462932717f23c5d8342381726e547ba6 Mon Sep 17 00:00:00 2001
+From 3b85ef547e6dfaf7d3d8a048222f218403778bda Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit a421cb93462932717f23c5d8342381726e547ba6 ]
@@ -14,2 +16,0 @@
-Cc: stable@dpdk.org
-
@@ -24 +25 @@
-index 2faeb9ca52..d5db09a263 100644
+index 0cb6914982..875c0eec11 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate setting RSS types' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (78 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate setting redirection table' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate setting and clearing RSS rule' " Xueming Li
                     ` (56 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/679028a2ee4dc7c491d0129986d5e2bafc0277ca

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 679028a2ee4dc7c491d0129986d5e2bafc0277ca Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:11 +0800
Subject: [PATCH] net/hns3: separate setting RSS types
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]

The settings of RSS types comes from the ethdev ops (like, dev_configure
and rss_hash_update) and rte_flow API. For the ethdev ops, driver has to
save it so as to it can be restored when reset is triggered.
While rte_flow API no need to maintain this field, it can be restored by
the saved rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  3 ++-
 drivers/net/hns3/hns3_rss.c  | 22 ++++++++++++++--------
 drivers/net/hns3/hns3_rss.h  |  1 +
 3 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 875c0eec11..9e51891bd9 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1433,6 +1433,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
 	if (ret)
 		return ret;
+	hw->rss_info.rss_hf = 0;
 
 	return 0;
 }
@@ -1580,7 +1581,7 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 	/* Filter the unsupported flow types */
 	flow_types = conf->conf.types ?
 		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.conf.types;
+		     hw->rss_info.rss_hf;
 	if (flow_types != rss_flow_conf.types)
 		hns3_warn(hw, "modified RSS types based on hardware support,"
 			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 751033d98f..f51d70a8e5 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -628,9 +628,6 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
 		return ret;
 	}
 
-	/* Update supported flow types when set tuple success */
-	hw->rss_info.conf.types = rss_hf;
-
 	return 0;
 }
 
@@ -648,7 +645,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 			 struct rte_eth_rss_conf *rss_conf)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint64_t rss_hf_bk = hw->rss_info.conf.types;
+	uint64_t rss_hf_bk = hw->rss_info.rss_hf;
 	uint8_t key_len = rss_conf->rss_key_len;
 	uint64_t rss_hf = rss_conf->rss_hf;
 	uint8_t *key = rss_conf->rss_key;
@@ -673,6 +670,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 		/* Update the shadow RSS key with user specified */
 		memcpy(hw->rss_info.key, key, hw->rss_key_size);
 	}
+	hw->rss_info.rss_hf = rss_hf;
 	rte_spinlock_unlock(&hw->lock);
 
 	return 0;
@@ -1030,6 +1028,7 @@ hns3_rss_set_default_args(struct hns3_hw *hw)
 	/* Default hash algorithm */
 	rss_cfg->hash_algo = HNS3_RSS_HASH_ALGO_TOEPLITZ;
 
+	hw->rss_info.rss_hf = 0;
 	memcpy(rss_cfg->key, hns3_hash_key,
 		RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
 
@@ -1067,15 +1066,22 @@ hns3_config_rss(struct hns3_adapter *hns)
 		return ret;
 
 	/*
-	 * When muli-queue RSS mode flag is not set or unsupported tuples are
+	 * When multi-queue RSS mode flag is not set or unsupported tuples are
 	 * set, disable all tuples.
 	 */
-	rss_hf = hw->rss_info.conf.types;
+	rss_hf = hw->rss_info.rss_hf;
 	if (!((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) ||
 	    !(rss_hf & HNS3_ETH_RSS_SUPPORT))
 		rss_hf = 0;
 
-	return hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
+	if (ret != 0) {
+		hns3_err(hw, "set RSS tuples failed, ret = %d.", ret);
+		return ret;
+	}
+	hw->rss_info.rss_hf = rss_hf;
+
+	return 0;
 }
 
 /*
@@ -1093,5 +1099,5 @@ hns3_rss_uninit(struct hns3_adapter *hns)
 		return;
 
 	/* Disable RSS */
-	hw->rss_info.conf.types = 0;
+	hw->rss_info.rss_hf = 0;
 }
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 6e679b709b..21b90789d0 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -41,6 +41,7 @@
 struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
+	uint64_t rss_hf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
 	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.826818000 +0800
+++ 0080-net-hns3-separate-setting-RSS-types.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 791e56935e488b8154a83daaf3952e1901ed7552 Mon Sep 17 00:00:00 2001
+From 679028a2ee4dc7c491d0129986d5e2bafc0277ca Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 791e56935e488b8154a83daaf3952e1901ed7552 ]
@@ -12,2 +14,0 @@
-Cc: stable@dpdk.org
-
@@ -23 +24 @@
-index d5db09a263..21e00e515e 100644
+index 875c0eec11..9e51891bd9 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate setting and clearing RSS rule' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (79 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate setting RSS types' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: use new RSS rule to configure hardware' " Xueming Li
                     ` (55 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/a2804bcc0c88c29a509bf72ce063eac2537e4e05

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From a2804bcc0c88c29a509bf72ce063eac2537e4e05 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:12 +0800
Subject: [PATCH] net/hns3: separate setting and clearing RSS rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 ]

Separate the setting and clearing of RSS rule.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 46 +++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 9e51891bd9..80dda63afe 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1535,8 +1535,22 @@ hns3_update_indir_table(struct hns3_hw *hw,
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw,
-		       const struct hns3_rss_conf *conf, bool add)
+hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+{
+	int ret;
+
+	if (!conf->valid)
+		return 0;
+
+	ret = hns3_disable_rss(hw);
+	if (ret)
+		hns3_err(hw, "RSS disable failed(%d)", ret);
+
+	return ret;
+}
+
+static int
+hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 {
 	uint64_t flow_types;
 	uint16_t num;
@@ -1553,19 +1567,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
 		.queue = conf->conf.queue,
 	};
 
-	if (!add) {
-		if (!conf->valid)
-			return 0;
-
-		ret = hns3_disable_rss(hw);
-		if (ret) {
-			hns3_err(hw, "RSS disable failed(%d)", ret);
-			return ret;
-		}
-
-		return 0;
-	}
-
 	/* Set rx queues to use */
 	num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num);
 	if (rss_flow_conf.queue_num > num)
@@ -1606,8 +1607,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
 	rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
 	while (rss_filter_ptr) {
 		TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
-		ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
-					     false);
+		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
 		if (ret)
 			rss_rule_fail_cnt++;
 		else
@@ -1636,7 +1636,7 @@ hns3_restore_rss_filter(struct hns3_hw *hw)
 		if (!filter->filter_info.valid)
 			continue;
 
-		ret = hns3_config_rss_filter(hw, &filter->filter_info, true);
+		ret = hns3_config_rss_filter(hw, &filter->filter_info);
 		if (ret != 0) {
 			hns3_err(hw, "restore RSS filter failed, ret=%d", ret);
 			goto out;
@@ -1680,8 +1680,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev,
-		    const struct hns3_rss_conf *conf, bool add)
+hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
@@ -1691,7 +1690,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	return hns3_config_rss_filter(hw, conf, add);
+	return hns3_config_rss_filter(hw, conf);
 }
 
 static int
@@ -1778,7 +1777,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 		}
 	}
 
-	ret = hns3_flow_parse_rss(dev, new_conf, true);
+	ret = hns3_flow_parse_rss(dev, new_conf);
 	if (ret != 0) {
 		rte_free(rss_filter_ptr);
 		return ret;
@@ -1961,8 +1960,7 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
 		break;
 	case RTE_ETH_FILTER_HASH:
 		rss_filter_ptr = (struct hns3_rss_conf_ele *)flow->rule;
-		ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
-					     false);
+		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
 		if (ret)
 			return rte_flow_error_set(error, EIO,
 						  RTE_FLOW_ERROR_TYPE_HANDLE,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.850079600 +0800
+++ 0081-net-hns3-separate-setting-and-clearing-RSS-rule.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 Mon Sep 17 00:00:00 2001
+From a2804bcc0c88c29a509bf72ce063eac2537e4e05 Mon Sep 17 00:00:00 2001
@@ -4,0 +5 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
@@ -6 +7 @@
-Separate the setting and clearing of RSS rule.
+[ upstream commit 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 ]
@@ -8 +9 @@
-Cc: stable@dpdk.org
+Separate the setting and clearing of RSS rule.
@@ -17 +18 @@
-index 21e00e515e..4da98d7adc 100644
+index 9e51891bd9..80dda63afe 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: use new RSS rule to configure hardware' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (80 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate setting and clearing RSS rule' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: save hash algo to RSS filter list node' " Xueming Li
                     ` (54 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/fc620e6832269de904be747ec52a1b0f12d58bb8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fc620e6832269de904be747ec52a1b0f12d58bb8 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:13 +0800
Subject: [PATCH] net/hns3: use new RSS rule to configure hardware
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ]

Remove redundant assignment and directly use new RSS rule to configure
hardware. Additionally, considering that the new rule configuration may
need to be modified, the 'const' of input parameter about it is removed.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 52 ++++++++++++++----------------------
 1 file changed, 20 insertions(+), 32 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 80dda63afe..3ac5279538 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1482,6 +1482,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
+	uint64_t flow_types;
 	uint8_t hash_algo;
 	int ret;
 
@@ -1501,10 +1502,18 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-
 	hw->rss_info.rte_flow_hash_algo = hash_algo;
 
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types);
+	/* Filter the unsupported flow types */
+	flow_types = rss_config->types ?
+		     rss_config->types & HNS3_ETH_RSS_SUPPORT :
+		     hw->rss_info.rss_hf;
+	if (flow_types != rss_config->types)
+		hns3_warn(hw, "modified RSS types based on hardware support,"
+			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
+			  rss_config->types, flow_types);
+
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, flow_types);
 	if (ret)
 		hns3_err(hw, "Update RSS tuples by rss hf failed %d", ret);
 
@@ -1550,48 +1559,27 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 {
-	uint64_t flow_types;
+	struct rte_flow_action_rss *rss_act;
 	uint16_t num;
 	int ret;
 
-	struct rte_flow_action_rss rss_flow_conf = {
-		.func = conf->conf.func,
-		.level = conf->conf.level,
-		.types = conf->conf.types,
-		.key_len = conf->conf.key_len,
-		.queue_num = conf->conf.queue_num,
-		.key = conf->conf.key_len ?
-		    (void *)(uintptr_t)conf->conf.key : NULL,
-		.queue = conf->conf.queue,
-	};
-
+	rss_act = &conf->conf;
 	/* Set rx queues to use */
-	num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num);
-	if (rss_flow_conf.queue_num > num)
+	num = RTE_MIN(hw->data->nb_rx_queues, rss_act->queue_num);
+	if (rss_act->queue_num > num)
 		hns3_warn(hw, "Config queue numbers %u are beyond the scope of truncated",
-			  rss_flow_conf.queue_num);
+			  rss_act->queue_num);
 	hns3_info(hw, "Max of contiguous %u PF queues are configured", num);
 	if (num) {
-		ret = hns3_update_indir_table(hw, &rss_flow_conf, num);
+		ret = hns3_update_indir_table(hw, rss_act, num);
 		if (ret)
 			return ret;
 	}
 
-	/* Filter the unsupported flow types */
-	flow_types = conf->conf.types ?
-		     rss_flow_conf.types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.rss_hf;
-	if (flow_types != rss_flow_conf.types)
-		hns3_warn(hw, "modified RSS types based on hardware support,"
-			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
-			  rss_flow_conf.types, flow_types);
-	/* Update the useful flow types */
-	rss_flow_conf.types = flow_types;
-
 	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, &rss_flow_conf);
+	return hns3_hw_rss_hash_set(hw, rss_act);
 }
 
 static int
@@ -1680,7 +1668,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf)
+hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.871733600 +0800
+++ 0082-net-hns3-use-new-RSS-rule-to-configure-hardware.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 218a119a08e01f203f92b46334b6b2f03ff9765d Mon Sep 17 00:00:00 2001
+From fc620e6832269de904be747ec52a1b0f12d58bb8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 218a119a08e01f203f92b46334b6b2f03ff9765d ]
@@ -10,2 +12,0 @@
-Cc: stable@dpdk.org
-
@@ -19 +20 @@
-index 4da98d7adc..3700d073b1 100644
+index 80dda63afe..3ac5279538 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: save hash algo to RSS filter list node' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (81 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: use new RSS rule to configure hardware' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: allow adding queue buffer size hash rule' " Xueming Li
                     ` (53 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/adf239587c322fccab9d6d0040302e4c34896d75

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From adf239587c322fccab9d6d0040302e4c34896d75 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:14 +0800
Subject: [PATCH] net/hns3: save hash algo to RSS filter list node
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 ]

Save hash algo from rte flow RSS rule to RSS filter list node
instead of struct hns3_rss_conf.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 3ac5279538..f073adebb6 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1439,7 +1439,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 			 uint8_t *hash_algo)
 {
 	const uint8_t hash_func_map[] = {
@@ -1451,7 +1451,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	int ret;
 
-	if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
+	if (rss_conf->conf.func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
 		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
 					    hw->rss_key_size);
 		if (ret != 0) {
@@ -1466,20 +1466,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 		 * rte_flow_hash_algo) when this rule is delivered.
 		 */
 		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != hw->rss_info.rte_flow_hash_algo)
-			*hash_algo = hw->rss_info.rte_flow_hash_algo;
+		    *hash_algo != rss_conf->rte_flow_hash_algo)
+			*hash_algo = rss_conf->rte_flow_hash_algo;
 
 		return 0;
 	}
 
-	*hash_algo = hash_func_map[func];
+	*hash_algo = hash_func_map[rss_conf->conf.func];
 
 	return 0;
 }
 
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 {
+	struct rte_flow_action_rss *rss_config = &conf->conf;
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
 	uint64_t flow_types;
@@ -1493,7 +1494,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		use_default_key = true;
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo);
+	ret = hns3_parse_rss_algorithm(hw, conf, &hash_algo);
 	if (ret)
 		return ret;
 
@@ -1502,7 +1503,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-	hw->rss_info.rte_flow_hash_algo = hash_algo;
+	conf->rte_flow_hash_algo = hash_algo;
 
 	/* Filter the unsupported flow types */
 	flow_types = rss_config->types ?
@@ -1579,7 +1580,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 	}
 
 	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, rss_act);
+	return hns3_hw_rss_hash_set(hw, conf);
 }
 
 static int
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.898199100 +0800
+++ 0083-net-hns3-save-hash-algo-to-RSS-filter-list-node.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 Mon Sep 17 00:00:00 2001
+From adf239587c322fccab9d6d0040302e4c34896d75 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 ]
@@ -9,2 +11,0 @@
-Cc: stable@dpdk.org
-
@@ -18 +19 @@
-index 3700d073b1..527874df44 100644
+index 3ac5279538..f073adebb6 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: allow adding queue buffer size hash rule' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (82 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: save hash algo to RSS filter list node' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: separate flow RSS config from RSS conf' " Xueming Li
                     ` (52 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/796c8188a5b71759a615f2dd575a3fe4d1d1e2cf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 796c8188a5b71759a615f2dd575a3fe4d1d1e2cf Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:15 +0800
Subject: [PATCH] net/hns3: allow adding queue buffer size hash rule
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 ]

The maximum queue number from RSS flow rule allowed depends on
the maximum queue number (512) under one TC instead of the one
of Rx/Tx queue so as to eliminate restrictions on user usage.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_rss.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 21b90789d0..cc0bb8431d 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -37,7 +37,8 @@
 #define HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP 2
 #define HNS3_RSS_HASH_ALGO_MASK		0xf
 
-#define HNS3_RSS_QUEUES_BUFFER_NUM	64 /* Same as the Max rx/tx queue num */
+/* Same as the Max queue num under TC */
+#define HNS3_RSS_QUEUES_BUFFER_NUM	512
 struct hns3_rss_conf {
 	/* RSS parameters :algorithm, flow_types,  key, queue */
 	struct rte_flow_action_rss conf;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.921361400 +0800
+++ 0084-net-hns3-allow-adding-queue-buffer-size-hash-rule.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 Mon Sep 17 00:00:00 2001
+From 796c8188a5b71759a615f2dd575a3fe4d1d1e2cf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8095bf3e6d8ca7349e0a15f95407acd2063e7be0 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: separate flow RSS config from RSS conf' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (83 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: allow adding queue buffer size hash rule' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: reimplement hash flow function' " Xueming Li
                     ` (51 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/7307f965753b81d990afab475900ff1922f2269e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7307f965753b81d990afab475900ff1922f2269e Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:16 +0800
Subject: [PATCH] net/hns3: separate flow RSS config from RSS conf
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ]

Some RSS fields in struct hns3_rss_conf (e.g. conf, queue,
valid) are only used when create RSS flow rule, which is
unnecessary for RSS configuration information from ethdev
ops. This patch removes these fields from hns3_rss_conf
and add a new struct hns3_flow_rss_conf as rte flow
RSS filter list node element.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 23 ++++++++++++-----------
 drivers/net/hns3/hns3_flow.h | 10 +++++++++-
 drivers/net/hns3/hns3_rss.h  |  5 -----
 3 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index f073adebb6..b1189455ec 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1359,7 +1359,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
-	struct hns3_rss_conf *rss_conf = &hw->rss_info;
 	const struct rte_flow_action_rss *rss;
 	const struct rte_flow_action *act;
 	uint32_t act_index = 0;
@@ -1374,7 +1373,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev,
 					  act, "no valid queues");
 	}
 
-	if (rss->queue_num > RTE_DIM(rss_conf->queue))
+	if (rss->queue_num > HNS3_RSS_QUEUES_BUFFER_NUM)
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
 					  "queue number configured exceeds "
@@ -1439,7 +1438,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_flow_rss_conf *rss_conf,
 			 uint8_t *hash_algo)
 {
 	const uint8_t hash_func_map[] = {
@@ -1466,8 +1465,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 		 * rte_flow_hash_algo) when this rule is delivered.
 		 */
 		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != rss_conf->rte_flow_hash_algo)
-			*hash_algo = rss_conf->rte_flow_hash_algo;
+		    *hash_algo != rss_conf->hash_algo)
+			*hash_algo = rss_conf->hash_algo;
 
 		return 0;
 	}
@@ -1478,7 +1477,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 }
 
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
 {
 	struct rte_flow_action_rss *rss_config = &conf->conf;
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
@@ -1503,7 +1502,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-	conf->rte_flow_hash_algo = hash_algo;
+	conf->hash_algo = hash_algo;
 
 	/* Filter the unsupported flow types */
 	flow_types = rss_config->types ?
@@ -1545,7 +1544,8 @@ hns3_update_indir_table(struct hns3_hw *hw,
 }
 
 static int
-hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+hns3_reset_rss_filter(struct hns3_hw *hw,
+		      const struct hns3_flow_rss_conf *conf)
 {
 	int ret;
 
@@ -1560,7 +1560,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
+hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
 {
 	struct rte_flow_action_rss *rss_act;
 	uint16_t num;
@@ -1669,7 +1669,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
 }
 
 static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf)
+hns3_flow_parse_rss(struct rte_eth_dev *dev,
+		    struct hns3_flow_rss_conf *conf)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_hw *hw = &hns->hw;
@@ -1739,8 +1740,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	const struct rte_flow_action_rss *rss_act;
 	struct hns3_rss_conf_ele *rss_filter_ptr;
+	struct hns3_flow_rss_conf *new_conf;
 	struct hns3_rss_conf_ele *filter_ptr;
-	struct hns3_rss_conf *new_conf;
 	int ret;
 
 	rss_filter_ptr = rte_zmalloc("hns3 rss filter",
diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
index e4b2fdf2e6..90126f2b6e 100644
--- a/drivers/net/hns3/hns3_flow.h
+++ b/drivers/net/hns3/hns3_flow.h
@@ -24,10 +24,18 @@ struct rte_flow {
 	uint32_t counter_id;
 };
 
+struct hns3_flow_rss_conf {
+	struct rte_flow_action_rss conf;
+	uint8_t hash_algo;
+	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
+	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
+	bool valid; /* check if RSS rule is valid */
+};
+
 /* rss filter list structure */
 struct hns3_rss_conf_ele {
 	TAILQ_ENTRY(hns3_rss_conf_ele) entries;
-	struct hns3_rss_conf filter_info;
+	struct hns3_flow_rss_conf filter_info;
 };
 
 /* hns3_flow memory list structure */
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index cc0bb8431d..d19730c69c 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -40,15 +40,10 @@
 /* Same as the Max queue num under TC */
 #define HNS3_RSS_QUEUES_BUFFER_NUM	512
 struct hns3_rss_conf {
-	/* RSS parameters :algorithm, flow_types,  key, queue */
-	struct rte_flow_action_rss conf;
 	uint64_t rss_hf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
-	uint8_t rte_flow_hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX];
-	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-	bool valid; /* check if RSS rule is valid */
 	/*
 	 * For IPv6 SCTP packets type, check whether the NIC hardware support
 	 * RSS hash using the src/dst port as the input tuple. For Kunpeng920
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.946049800 +0800
+++ 0085-net-hns3-separate-flow-RSS-config-from-RSS-conf.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 Mon Sep 17 00:00:00 2001
+From 7307f965753b81d990afab475900ff1922f2269e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ]
@@ -13,2 +15,0 @@
-Cc: stable@dpdk.org
-
@@ -24 +25 @@
-index 527874df44..89374816aa 100644
+index f073adebb6..b1189455ec 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: reimplement hash flow function' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (84 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: separate flow RSS config from RSS conf' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/hns3: add verification of RSS types' " Xueming Li
                     ` (50 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/3a5105f1de819eed82a669824012f6d7dd556994

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3a5105f1de819eed82a669824012f6d7dd556994 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:17 +0800
Subject: [PATCH] net/hns3: reimplement hash flow function
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e3069658da9ffb6f83a0d972ff2776c405eb6a8f ]

Currently, hns3 driver supports setting multiple rte flow RSS rule,
but only the last is valid. This implementation is different from
the mainstream usage of rte flow hash in the community. Please see
the discussion threads [1] and [2].

This patch sets RSS hash feature completely based on the request of
the flow rule so that multiple hash rules can take effect at the same
time. Please notice that:
1. For hns3, 'func' has only one hardware. 'key' and 'queue' have only
   one entry in hardware.
2. the overlapping part of the old rule will be overridden if the
   configuration items of a new rule overlap with those of an old rule.

The hns3_flow_validate() verifies and parses RSS or Fdir rules from
user, and saves them to a local variable at the same time. The local
variable is directly used to create RSS or Fdir rules. In this way,
we save one parsing and saving process.

[1] https://lore.kernel.org/all/DM5PR12MB46648085D7CABF1AFF2D75CDD60A9@DM5PR12MB4664.namprd12.prod.outlook.com/
[2] https://lore.kernel.org/all/f7de4db4-1b88-622f-4e03-acd3eee8a72c@oktetlabs.ru/

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.h |   9 -
 drivers/net/hns3/hns3_flow.c   | 966 +++++++++++++++++++++++----------
 drivers/net/hns3/hns3_flow.h   |  15 +-
 drivers/net/hns3/hns3_rss.c    | 144 ++---
 drivers/net/hns3/hns3_rss.h    | 117 +++-
 5 files changed, 855 insertions(+), 396 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 2457754b3d..9acc5a3d7e 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -996,15 +996,6 @@ static inline uint32_t hns3_read_reg(void *base, uint32_t reg)
 #define hns3_read_dev(a, reg) \
 	hns3_read_reg((a)->io_base, (reg))
 
-#define NEXT_ITEM_OF_ACTION(act, actions, index)                        \
-	do {								\
-		(act) = (actions) + (index);				\
-		while ((act)->type == RTE_FLOW_ACTION_TYPE_VOID) {	\
-			(index)++;					\
-			(act) = (actions) + (index);				\
-		}							\
-	} while (0)
-
 static inline uint64_t
 hns3_atomic_test_bit(unsigned int nr, volatile uint64_t *addr)
 {
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index b1189455ec..c38bd9dd8b 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -10,6 +10,125 @@
 #include "hns3_logs.h"
 #include "hns3_flow.h"
 
+#define NEXT_ITEM_OF_ACTION(act, actions, index) \
+	do { \
+		(act) = (actions) + (index); \
+		while ((act)->type == RTE_FLOW_ACTION_TYPE_VOID) { \
+			(index)++; \
+			(act) = (actions) + (index); \
+		} \
+	} while (0)
+
+#define NEXT_ITEM_OF_PATTERN(item, pattern, index) \
+	do { \
+		(item) = (pattern) + (index); \
+		while ((item)->type == RTE_FLOW_ITEM_TYPE_VOID) { \
+			(index)++; \
+			(item) = (pattern) + (index); \
+		} \
+	} while (0)
+
+#define HNS3_HASH_HDR_ETH	RTE_BIT64(0)
+#define HNS3_HASH_HDR_IPV4	RTE_BIT64(1)
+#define HNS3_HASH_HDR_IPV6	RTE_BIT64(2)
+#define HNS3_HASH_HDR_TCP	RTE_BIT64(3)
+#define HNS3_HASH_HDR_UDP	RTE_BIT64(4)
+#define HNS3_HASH_HDR_SCTP	RTE_BIT64(5)
+
+#define HNS3_HASH_VOID_NEXT_ALLOW	BIT_ULL(RTE_FLOW_ITEM_TYPE_ETH)
+
+#define HNS3_HASH_ETH_NEXT_ALLOW	(BIT_ULL(RTE_FLOW_ITEM_TYPE_IPV4) | \
+					 BIT_ULL(RTE_FLOW_ITEM_TYPE_IPV6))
+
+#define HNS3_HASH_IP_NEXT_ALLOW		(BIT_ULL(RTE_FLOW_ITEM_TYPE_TCP) | \
+					 BIT_ULL(RTE_FLOW_ITEM_TYPE_UDP) | \
+					 BIT_ULL(RTE_FLOW_ITEM_TYPE_SCTP))
+
+static const uint64_t hash_pattern_next_allow_items[] = {
+	[RTE_FLOW_ITEM_TYPE_VOID] = HNS3_HASH_VOID_NEXT_ALLOW,
+	[RTE_FLOW_ITEM_TYPE_ETH]  = HNS3_HASH_ETH_NEXT_ALLOW,
+	[RTE_FLOW_ITEM_TYPE_IPV4] = HNS3_HASH_IP_NEXT_ALLOW,
+	[RTE_FLOW_ITEM_TYPE_IPV6] = HNS3_HASH_IP_NEXT_ALLOW,
+};
+
+static const uint64_t hash_pattern_item_header[] = {
+	[RTE_FLOW_ITEM_TYPE_ETH]  = HNS3_HASH_HDR_ETH,
+	[RTE_FLOW_ITEM_TYPE_IPV4] = HNS3_HASH_HDR_IPV4,
+	[RTE_FLOW_ITEM_TYPE_IPV6] = HNS3_HASH_HDR_IPV6,
+	[RTE_FLOW_ITEM_TYPE_TCP]  = HNS3_HASH_HDR_TCP,
+	[RTE_FLOW_ITEM_TYPE_UDP]  = HNS3_HASH_HDR_UDP,
+	[RTE_FLOW_ITEM_TYPE_SCTP] = HNS3_HASH_HDR_SCTP,
+};
+
+#define HNS3_HASH_IPV4		(HNS3_HASH_HDR_ETH | HNS3_HASH_HDR_IPV4)
+#define HNS3_HASH_IPV4_TCP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV4 | \
+				 HNS3_HASH_HDR_TCP)
+#define HNS3_HASH_IPV4_UDP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV4 | \
+				 HNS3_HASH_HDR_UDP)
+#define HNS3_HASH_IPV4_SCTP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV4 | \
+				 HNS3_HASH_HDR_SCTP)
+#define HNS3_HASH_IPV6		(HNS3_HASH_HDR_ETH | HNS3_HASH_HDR_IPV6)
+#define HNS3_HASH_IPV6_TCP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV6 | \
+				 HNS3_HASH_HDR_TCP)
+#define HNS3_HASH_IPV6_UDP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV6 | \
+				 HNS3_HASH_HDR_UDP)
+#define HNS3_HASH_IPV6_SCTP	(HNS3_HASH_HDR_ETH | \
+				 HNS3_HASH_HDR_IPV6 | \
+				 HNS3_HASH_HDR_SCTP)
+
+static const struct hns3_hash_map_info {
+	/* flow type specified, zero means action works for all flow types. */
+	uint64_t pattern_type;
+	uint64_t rss_pctype; /* packet type with prefix RTE_ETH_RSS_xxx */
+	uint64_t l3l4_types; /* Supported L3/L4 RSS types for this packet type */
+	uint64_t hw_pctype; /* packet type in driver */
+	uint64_t tuple_mask; /* full tuples of the hw_pctype */
+} hash_map_table[] = {
+	/* IPV4 */
+	{ HNS3_HASH_IPV4,
+	  RTE_ETH_RSS_IPV4, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV4_NONF, HNS3_RSS_TUPLE_IPV4_NONF_M },
+	{ HNS3_HASH_IPV4,
+	  RTE_ETH_RSS_NONFRAG_IPV4_OTHER, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV4_NONF, HNS3_RSS_TUPLE_IPV4_NONF_M },
+	{ HNS3_HASH_IPV4,
+	  RTE_ETH_RSS_FRAG_IPV4, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV4_FLAG, HNS3_RSS_TUPLE_IPV4_FLAG_M },
+	{ HNS3_HASH_IPV4_TCP,
+	  RTE_ETH_RSS_NONFRAG_IPV4_TCP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV4_TCP, HNS3_RSS_TUPLE_IPV4_TCP_M },
+	{ HNS3_HASH_IPV4_UDP,
+	  RTE_ETH_RSS_NONFRAG_IPV4_UDP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV4_UDP, HNS3_RSS_TUPLE_IPV4_UDP_M },
+	{ HNS3_HASH_IPV4_SCTP,
+	  RTE_ETH_RSS_NONFRAG_IPV4_SCTP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV4_SCTP, HNS3_RSS_TUPLE_IPV4_SCTP_M },
+	/* IPV6 */
+	{ HNS3_HASH_IPV6,
+	  RTE_ETH_RSS_IPV6, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV6_NONF, HNS3_RSS_TUPLE_IPV6_NONF_M },
+	{ HNS3_HASH_IPV6,
+	  RTE_ETH_RSS_NONFRAG_IPV6_OTHER, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV6_NONF, HNS3_RSS_TUPLE_IPV6_NONF_M },
+	{ HNS3_HASH_IPV6,
+	  RTE_ETH_RSS_FRAG_IPV6, HNS3_RSS_SUPPORT_L3_SRC_DST,
+	  HNS3_RSS_PCTYPE_IPV6_FLAG, HNS3_RSS_TUPLE_IPV6_FLAG_M },
+	{ HNS3_HASH_IPV6_TCP,
+	  RTE_ETH_RSS_NONFRAG_IPV6_TCP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV6_TCP, HNS3_RSS_TUPLE_IPV6_TCP_M },
+	{ HNS3_HASH_IPV6_UDP,
+	  RTE_ETH_RSS_NONFRAG_IPV6_UDP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV6_UDP, HNS3_RSS_TUPLE_IPV6_UDP_M },
+	{ HNS3_HASH_IPV6_SCTP,
+	  RTE_ETH_RSS_NONFRAG_IPV6_SCTP, HNS3_RSS_SUPPORT_L3L4,
+	  HNS3_RSS_PCTYPE_IPV6_SCTP, HNS3_RSS_TUPLE_IPV6_SCTP_M },
+};
+
 static const uint8_t full_mask[VNI_OR_TNI_LEN] = { 0xFF, 0xFF, 0xFF };
 static const uint8_t zero_mask[VNI_OR_TNI_LEN] = { 0x00, 0x00, 0x00 };
 
@@ -79,7 +198,7 @@ net_addr_to_host(uint32_t *dst, const rte_be32_t *src, size_t len)
 }
 
 /*
- * This function is used to find rss general action.
+ * This function is used to parse filter type.
  * 1. As we know RSS is used to spread packets among several queues, the flow
  *    API provide the struct rte_flow_action_rss, user could config its field
  *    sush as: func/level/types/key/queue to control RSS function.
@@ -87,16 +206,18 @@ net_addr_to_host(uint32_t *dst, const rte_be32_t *src, size_t len)
  *    implemented by FDIR + RSS in hns3 hardware, user can create one FDIR rule
  *    which action is RSS queues region.
  * 3. When action is RSS, we use the following rule to distinguish:
- *    Case 1: pattern have ETH and action's queue_num > 0, indicate it is queue
- *            region configuration.
+ *    Case 1: pattern has ETH and all fields in RSS action except 'queues' are
+ *            zero or default, indicate it is queue region configuration.
  *    Case other: an rss general action.
  */
-static const struct rte_flow_action *
-hns3_find_rss_general_action(const struct rte_flow_item pattern[],
-			     const struct rte_flow_action actions[])
+static void
+hns3_parse_filter_type(const struct rte_flow_item pattern[],
+		       const struct rte_flow_action actions[],
+		       struct hns3_filter_info *filter_info)
 {
 	const struct rte_flow_action_rss *rss_act;
 	const struct rte_flow_action *act = NULL;
+	bool only_has_queues = false;
 	bool have_eth = false;
 
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
@@ -105,8 +226,10 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 			break;
 		}
 	}
-	if (!act)
-		return NULL;
+	if (act == NULL) {
+		filter_info->type = RTE_ETH_FILTER_FDIR;
+		return;
+	}
 
 	for (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) {
 		if (pattern->type == RTE_FLOW_ITEM_TYPE_ETH) {
@@ -116,18 +239,20 @@ hns3_find_rss_general_action(const struct rte_flow_item pattern[],
 	}
 
 	rss_act = act->conf;
-	if (have_eth && rss_act->queue_num) {
+	only_has_queues = (rss_act->queue_num > 0) &&
+			  (rss_act->func == RTE_ETH_HASH_FUNCTION_DEFAULT &&
+			   rss_act->types == 0 && rss_act->key_len == 0);
+	if (have_eth && only_has_queues) {
 		/*
-		 * Pattern have ETH and action's queue_num > 0, indicate this is
-		 * queue region configuration.
-		 * Because queue region is implemented by FDIR + RSS in hns3
-		 * hardware, it needs to enter FDIR process, so here return NULL
-		 * to avoid enter RSS process.
+		 * Pattern has ETH and all fields in RSS action except 'queues'
+		 * are zero or default, which indicates this is queue region
+		 * configuration.
 		 */
-		return NULL;
+		filter_info->type = RTE_ETH_FILTER_FDIR;
+		return;
 	}
 
-	return act;
+	filter_info->type = RTE_ETH_FILTER_HASH;
 }
 
 static inline struct hns3_flow_counter *
@@ -1246,7 +1371,6 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct hns3_fdir_rule_ele *fdir_rule_ptr;
-	struct hns3_rss_conf_ele *rss_filter_ptr;
 	struct hns3_flow_mem *flow_node;
 
 	fdir_rule_ptr = TAILQ_FIRST(&hw->flow_fdir_list);
@@ -1256,13 +1380,6 @@ hns3_filterlist_flush(struct rte_eth_dev *dev)
 		fdir_rule_ptr = TAILQ_FIRST(&hw->flow_fdir_list);
 	}
 
-	rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
-	while (rss_filter_ptr) {
-		TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
-		rte_free(rss_filter_ptr);
-		rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
-	}
-
 	flow_node = TAILQ_FIRST(&hw->flow_list);
 	while (flow_node) {
 		TAILQ_REMOVE(&hw->flow_list, flow_node, entries);
@@ -1328,196 +1445,422 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp,
 }
 
 static bool
-hns3_rss_input_tuple_supported(struct hns3_hw *hw,
-			       const struct rte_flow_action_rss *rss)
+hns3_valid_ipv6_sctp_rss_types(struct hns3_hw *hw, uint64_t types)
 {
 	/*
-	 * For IP packet, it is not supported to use src/dst port fields to RSS
-	 * hash for the following packet types.
-	 * - IPV4 FRAG | IPV4 NONFRAG | IPV6 FRAG | IPV6 NONFRAG
-	 * Besides, for Kunpeng920, the NIC HW is not supported to use src/dst
-	 * port fields to RSS hash for IPV6 SCTP packet type. However, the
-	 * Kunpeng930 and future kunpeng series support to use src/dst port
-	 * fields to RSS hash for IPv6 SCTP packet type.
+	 * Some hardware don't support to use src/dst port fields to hash
+	 * for IPV6 SCTP packet type.
 	 */
-	if (rss->types & (RTE_ETH_RSS_L4_DST_ONLY | RTE_ETH_RSS_L4_SRC_ONLY) &&
-	    (rss->types & RTE_ETH_RSS_IP ||
-	    (!hw->rss_info.ipv6_sctp_offload_supported &&
-	    rss->types & RTE_ETH_RSS_NONFRAG_IPV6_SCTP)))
+	if (types & RTE_ETH_RSS_NONFRAG_IPV6_SCTP &&
+	    types & HNS3_RSS_SUPPORT_L4_SRC_DST &&
+	    !hw->rss_info.ipv6_sctp_offload_supported)
 		return false;
 
 	return true;
 }
 
-/*
- * This function is used to parse rss action validation.
- */
 static int
-hns3_parse_rss_filter(struct rte_eth_dev *dev,
-		      const struct rte_flow_action *actions,
-		      struct rte_flow_error *error)
+hns3_flow_parse_hash_func(const struct rte_flow_action_rss *rss_act,
+			  struct hns3_flow_rss_conf *rss_conf,
+			  struct rte_flow_error *error)
 {
-	struct hns3_adapter *hns = dev->data->dev_private;
-	struct hns3_hw *hw = &hns->hw;
-	const struct rte_flow_action_rss *rss;
-	const struct rte_flow_action *act;
-	uint32_t act_index = 0;
-	uint16_t n;
+	if (rss_act->func >= RTE_ETH_HASH_FUNCTION_MAX)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  NULL, "RSS hash func are not supported");
 
-	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-	rss = act->conf;
+	rss_conf->conf.func = rss_act->func;
+	return 0;
+}
 
-	if (rss == NULL) {
+static int
+hns3_flow_parse_hash_key(struct hns3_hw *hw,
+			 const struct rte_flow_action_rss *rss_act,
+			 struct hns3_flow_rss_conf *rss_conf,
+			 struct rte_flow_error *error)
+{
+	if (rss_act->key_len != hw->rss_key_size)
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
-					  act, "no valid queues");
-	}
+					  NULL, "invalid RSS key length");
+
+	if (rss_act->key != NULL)
+		memcpy(rss_conf->key, rss_act->key, rss_act->key_len);
+	else
+		memcpy(rss_conf->key, hns3_hash_key,
+			RTE_MIN(sizeof(hns3_hash_key), rss_act->key_len));
+	/* Need to record if user sets hash key. */
+	rss_conf->conf.key = rss_act->key;
+	rss_conf->conf.key_len = rss_act->key_len;
 
-	if (rss->queue_num > HNS3_RSS_QUEUES_BUFFER_NUM)
+	return 0;
+}
+
+static int
+hns3_flow_parse_queues(struct hns3_hw *hw,
+		       const struct rte_flow_action_rss *rss_act,
+		       struct hns3_flow_rss_conf *rss_conf,
+		       struct rte_flow_error *error)
+{
+	uint16_t i;
+
+	if (rss_act->queue_num > hw->rss_ind_tbl_size)
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "queue number configured exceeds "
-					  "queue buffer size driver supported");
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  NULL,
+					  "queue number can not exceed RSS indirection table.");
 
-	for (n = 0; n < rss->queue_num; n++) {
-		if (rss->queue[n] < hw->alloc_rss_size)
-			continue;
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "queue id must be less than queue number allocated to a TC");
+	if (rss_act->queue_num > HNS3_RSS_QUEUES_BUFFER_NUM)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  NULL,
+					  "queue number configured exceeds queue buffer size driver supported");
+
+	for (i = 0; i < rss_act->queue_num; i++) {
+		if (rss_act->queue[i] >= hw->alloc_rss_size)
+			return rte_flow_error_set(error, EINVAL,
+						RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+						NULL,
+						"queue id must be less than queue number allocated to a TC");
 	}
 
-	if (!(rss->types & HNS3_ETH_RSS_SUPPORT) && rss->types)
+	memcpy(rss_conf->queue, rss_act->queue,
+	       rss_act->queue_num * sizeof(rss_conf->queue[0]));
+	rss_conf->conf.queue = rss_conf->queue;
+	rss_conf->conf.queue_num = rss_act->queue_num;
+
+	return 0;
+}
+
+static int
+hns3_flow_get_hw_pctype(struct hns3_hw *hw,
+			const struct rte_flow_action_rss *rss_act,
+			const struct hns3_hash_map_info *map,
+			struct hns3_flow_rss_conf *rss_conf,
+			struct rte_flow_error *error)
+{
+	uint64_t l3l4_src_dst, l3l4_refine, left_types;
+
+	if (rss_act->types == 0) {
+		/* Disable RSS hash of this packet type if types is zero. */
+		rss_conf->hw_pctypes |= map->hw_pctype;
+		return 0;
+	}
+
+	/*
+	 * Can not have extra types except rss_pctype and l3l4_type in this map.
+	 */
+	left_types = ~map->rss_pctype & rss_act->types;
+	if (left_types & ~map->l3l4_types)
 		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
-					  act,
-					  "Flow types is unsupported by "
-					  "hns3's RSS");
-	if (rss->func >= RTE_ETH_HASH_FUNCTION_MAX)
-		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "RSS hash func are not supported");
-	if (rss->level)
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
+					  "cannot set extra types.");
+
+	l3l4_src_dst = left_types;
+	/* L3/L4 SRC and DST shouldn't be specified at the same time. */
+	l3l4_refine = rte_eth_rss_hf_refine(l3l4_src_dst);
+	if (l3l4_refine != l3l4_src_dst)
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "a nonzero RSS encapsulation level is not supported");
-	if (rss->key_len && rss->key_len != hw->rss_key_size)
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
+					  "cannot specify L3_SRC/DST_ONLY or L4_SRC/DST_ONLY at the same.");
+
+	if (!hns3_valid_ipv6_sctp_rss_types(hw, rss_act->types))
 		return rte_flow_error_set(error, ENOTSUP,
-					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, act,
-					  "invalid RSS key length");
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
+					  "hardware doesn't support to use L4 src/dst to hash for IPV6-SCTP.");
 
-	if (!hns3_rss_input_tuple_supported(hw, rss))
-		return rte_flow_error_set(error, EINVAL,
+	rss_conf->hw_pctypes |= map->hw_pctype;
+
+	return 0;
+}
+
+static int
+hns3_flow_parse_rss_types_by_ptype(struct hns3_hw *hw,
+				   const struct rte_flow_action_rss *rss_act,
+				   uint64_t pattern_type,
+				   struct hns3_flow_rss_conf *rss_conf,
+				   struct rte_flow_error *error)
+{
+	const struct hns3_hash_map_info *map;
+	bool matched = false;
+	uint16_t i;
+	int ret;
+
+	for (i = 0; i < RTE_DIM(hash_map_table); i++) {
+		map = &hash_map_table[i];
+		if (map->pattern_type != pattern_type) {
+			/*
+			 * If the target pattern type is already matched with
+			 * the one before this pattern in the hash map table,
+			 * no need to continue walk.
+			 */
+			if (matched)
+				break;
+			continue;
+		}
+		matched = true;
+
+		/*
+		 * If pattern type is matched and the 'types' is zero, all packet flow
+		 * types related to this pattern type disable RSS hash.
+		 * Otherwise, RSS types must match the pattern type and cannot have no
+		 * extra or unsupported types.
+		 */
+		if (rss_act->types != 0 && !(map->rss_pctype & rss_act->types))
+			continue;
+
+		ret = hns3_flow_get_hw_pctype(hw, rss_act, map, rss_conf, error);
+		if (ret != 0)
+			return ret;
+	}
+
+	if (rss_conf->hw_pctypes != 0)
+		return 0;
+
+	if (matched)
+		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
-					  &rss->types,
-					  "input RSS types are not supported");
+					  NULL, "RSS types are unsupported");
 
-	act_index++;
+	return rte_flow_error_set(error, ENOTSUP,
+				  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+				  NULL, "Pattern specified is unsupported");
+}
 
-	/* Check if the next not void action is END */
-	NEXT_ITEM_OF_ACTION(act, actions, act_index);
-	if (act->type != RTE_FLOW_ACTION_TYPE_END)
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION,
-					  act, "Not supported action.");
+static uint64_t
+hns3_flow_get_all_hw_pctypes(uint64_t types)
+{
+	uint64_t hw_pctypes = 0;
+	uint16_t i;
 
-	return 0;
+	for (i = 0; i < RTE_DIM(hash_map_table); i++) {
+		if (types & hash_map_table[i].rss_pctype)
+			hw_pctypes |= hash_map_table[i].hw_pctype;
+	}
+
+	return hw_pctypes;
 }
 
 static int
-hns3_disable_rss(struct hns3_hw *hw)
+hns3_flow_parse_rss_types(struct hns3_hw *hw,
+			  const struct rte_flow_action_rss *rss_act,
+			  uint64_t pattern_type,
+			  struct hns3_flow_rss_conf *rss_conf,
+			  struct rte_flow_error *error)
+{
+	rss_conf->conf.types = rss_act->types;
+
+	/* no pattern specified to set global RSS types. */
+	if (pattern_type == 0) {
+		if (rss_act->types & ~HNS3_ETH_RSS_SUPPORT)
+			hns3_warn(hw, "some types in the requested RSS types (0x%" PRIx64 ") aren't supported, they are ignored.",
+				  rss_act->types);
+		rss_conf->hw_pctypes =
+				hns3_flow_get_all_hw_pctypes(rss_act->types);
+		return 0;
+	}
+
+	return hns3_flow_parse_rss_types_by_ptype(hw, rss_act, pattern_type,
+						  rss_conf, error);
+}
+
+static int
+hns3_flow_parse_hash_global_conf(struct rte_eth_dev *dev,
+				 const struct rte_flow_action_rss *rss_act,
+				 struct hns3_flow_rss_conf *rss_conf,
+				 struct rte_flow_error *error)
 {
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	int ret;
 
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
-	if (ret)
+	ret = hns3_flow_parse_hash_func(rss_act, rss_conf, error);
+	if (ret != 0)
 		return ret;
-	hw->rss_info.rss_hf = 0;
 
-	return 0;
+	if (rss_act->queue_num > 0) {
+		ret = hns3_flow_parse_queues(hw, rss_act, rss_conf, error);
+		if (ret != 0)
+			return ret;
+	}
+
+	if (rss_act->key_len > 0) {
+		ret = hns3_flow_parse_hash_key(hw, rss_act, rss_conf, error);
+		if (ret != 0)
+			return ret;
+	}
+
+	return hns3_flow_parse_rss_types(hw, rss_act, rss_conf->pattern_type,
+					 rss_conf, error);
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_flow_rss_conf *rss_conf,
-			 uint8_t *hash_algo)
-{
-	const uint8_t hash_func_map[] = {
-		[RTE_ETH_HASH_FUNCTION_DEFAULT] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
-		[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
-		[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = HNS3_RSS_HASH_ALGO_SIMPLE,
-		[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP,
-	};
-	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
-	int ret;
+hns3_flow_parse_pattern_type(const struct rte_flow_item pattern[],
+			     uint64_t *ptype, struct rte_flow_error *error)
+{
+	enum rte_flow_item_type pre_type = RTE_FLOW_ITEM_TYPE_VOID;
+	const char *message = "Pattern specified isn't supported";
+	uint64_t item_hdr, pattern_hdrs = 0;
+	enum rte_flow_item_type cur_type;
 
-	if (rss_conf->conf.func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
-		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
-					    hw->rss_key_size);
-		if (ret != 0) {
-			hns3_err(hw, "fail to get current RSS hash algorithm, ret = %d",
-				 ret);
-			return ret;
+	for (; pattern->type != RTE_FLOW_ITEM_TYPE_END; pattern++) {
+		if (pattern->type == RTE_FLOW_ITEM_TYPE_VOID)
+			continue;
+		if (pattern->mask || pattern->spec || pattern->last) {
+			message = "Header info shouldn't be specified";
+			goto unsup;
 		}
 
-		/*
-		 * During the phase of reset recovery, the hash algorithm
-		 * obtained from hardware may not be the one used(saved in
-		 * rte_flow_hash_algo) when this rule is delivered.
-		 */
-		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != rss_conf->hash_algo)
-			*hash_algo = rss_conf->hash_algo;
+		/* Check the sub-item allowed by the previous item . */
+		if (pre_type >= RTE_DIM(hash_pattern_next_allow_items) ||
+		    !(hash_pattern_next_allow_items[pre_type] &
+				BIT_ULL(pattern->type)))
+			goto unsup;
+
+		cur_type = pattern->type;
+		/* Unsupported for current type being greater than array size. */
+		if (cur_type >= RTE_DIM(hash_pattern_item_header))
+			goto unsup;
+
+		/* The value is zero, which means unsupported current header. */
+		item_hdr = hash_pattern_item_header[cur_type];
+		if (item_hdr == 0)
+			goto unsup;
+
+		/* Have duplicate pattern header. */
+		if (item_hdr & pattern_hdrs)
+			goto unsup;
+		pre_type = cur_type;
+		pattern_hdrs |= item_hdr;
+	}
 
+	if (pattern_hdrs != 0) {
+		*ptype = pattern_hdrs;
 		return 0;
 	}
 
-	*hash_algo = hash_func_map[rss_conf->conf.func];
+unsup:
+	return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM,
+				  pattern, message);
+}
+
+static int
+hns3_flow_parse_pattern_act(struct rte_eth_dev *dev,
+			    const struct rte_flow_item pattern[],
+			    const struct rte_flow_action_rss *rss_act,
+			    struct hns3_flow_rss_conf *rss_conf,
+			    struct rte_flow_error *error)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int ret;
+
+	ret = hns3_flow_parse_hash_func(rss_act, rss_conf, error);
+	if (ret != 0)
+		return ret;
+
+	if (rss_act->key_len > 0) {
+		ret = hns3_flow_parse_hash_key(hw, rss_act, rss_conf, error);
+		if (ret != 0)
+			return ret;
+	}
+
+	if (rss_act->queue_num > 0) {
+		ret = hns3_flow_parse_queues(hw, rss_act, rss_conf, error);
+		if (ret != 0)
+			return ret;
+	}
+
+	ret = hns3_flow_parse_pattern_type(pattern, &rss_conf->pattern_type,
+					   error);
+	if (ret != 0)
+		return ret;
+
+	ret = hns3_flow_parse_rss_types(hw, rss_act, rss_conf->pattern_type,
+					rss_conf, error);
+	if (ret != 0)
+		return ret;
+
+	if (rss_act->func != RTE_ETH_HASH_FUNCTION_DEFAULT ||
+	    rss_act->key_len > 0 || rss_act->queue_num > 0)
+		hns3_warn(hw, "hash func, key and queues are global config, which work for all flow types. "
+			  "Recommend: don't set them together with pattern.");
 
 	return 0;
 }
 
+static bool
+hns3_rss_action_is_dup(struct hns3_hw *hw,
+		       const struct hns3_flow_rss_conf *conf)
+{
+	struct hns3_rss_conf_ele *filter;
+
+	TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) {
+		if (conf->pattern_type != filter->filter_info.pattern_type)
+			continue;
+
+		if (hns3_action_rss_same(&filter->filter_info.conf, &conf->conf))
+			return true;
+	}
+
+	return false;
+}
+
+/*
+ * This function is used to parse rss action validation.
+ */
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
+hns3_parse_rss_filter(struct rte_eth_dev *dev,
+		      const struct rte_flow_item pattern[],
+		      const struct rte_flow_action *actions,
+		      struct hns3_flow_rss_conf *rss_conf,
+		      struct rte_flow_error *error)
 {
-	struct rte_flow_action_rss *rss_config = &conf->conf;
-	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
-	bool use_default_key = false;
-	uint64_t flow_types;
-	uint8_t hash_algo;
+	struct hns3_adapter *hns = dev->data->dev_private;
+	const struct rte_flow_action_rss *rss_act;
+	const struct rte_flow_action *act;
+	const struct rte_flow_item *pat;
+	struct hns3_hw *hw = &hns->hw;
+	uint32_t index = 0;
 	int ret;
 
-	if (rss_config->key == NULL || rss_config->key_len != hw->rss_key_size) {
-		hns3_warn(hw, "Default RSS hash key to be set");
-		memcpy(rss_key, hns3_hash_key,
-			RTE_MIN(sizeof(hns3_hash_key), hw->rss_key_size));
-		use_default_key = true;
+	NEXT_ITEM_OF_ACTION(act, actions, index);
+	if (actions[1].type != RTE_FLOW_ACTION_TYPE_END)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION,
+					  &actions[1],
+					  "Only support one action for RSS.");
+
+	rss_act = (const struct rte_flow_action_rss *)act->conf;
+	if (rss_act == NULL) {
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  act, "lost RSS action configuration");
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, conf, &hash_algo);
-	if (ret)
+	if (rss_act->level != 0)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  act,
+					  "RSS level is not supported");
+
+	index = 0;
+	NEXT_ITEM_OF_PATTERN(pat, pattern, index);
+	if (pat[0].type == RTE_FLOW_ITEM_TYPE_END) {
+		rss_conf->pattern_type = 0;
+		ret = hns3_flow_parse_hash_global_conf(dev, rss_act,
+						       rss_conf, error);
+	} else {
+		ret = hns3_flow_parse_pattern_act(dev, pat, rss_act,
+						  rss_conf, error);
+	}
+	if (ret != 0)
 		return ret;
 
-	ret = hns3_rss_set_algo_key(hw, hash_algo,
-				    use_default_key ? rss_key : rss_config->key,
-				    hw->rss_key_size);
-	if (ret)
-		return ret;
-	conf->hash_algo = hash_algo;
-
-	/* Filter the unsupported flow types */
-	flow_types = rss_config->types ?
-		     rss_config->types & HNS3_ETH_RSS_SUPPORT :
-		     hw->rss_info.rss_hf;
-	if (flow_types != rss_config->types)
-		hns3_warn(hw, "modified RSS types based on hardware support,"
-			  " requested:0x%" PRIx64 " configured:0x%" PRIx64,
-			  rss_config->types, flow_types);
-
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, flow_types);
-	if (ret)
-		hns3_err(hw, "Update RSS tuples by rss hf failed %d", ret);
+	if (hns3_rss_action_is_dup(hw, rss_conf))
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					  act, "duplicate RSS rule");
 
-	return ret;
+	return 0;
 }
 
 static int
@@ -1543,44 +1886,106 @@ hns3_update_indir_table(struct hns3_hw *hw,
 	return hns3_set_rss_indir_table(hw, indir_tbl, hw->rss_ind_tbl_size);
 }
 
+static uint64_t
+hns3_flow_get_pctype_tuple_mask(uint64_t hw_pctype)
+{
+	uint64_t tuple_mask = 0;
+	uint16_t i;
+
+	for (i = 0; i < RTE_DIM(hash_map_table); i++) {
+		if (hw_pctype == hash_map_table[i].hw_pctype) {
+			tuple_mask = hash_map_table[i].tuple_mask;
+			break;
+		}
+	}
+
+	return tuple_mask;
+}
+
 static int
-hns3_reset_rss_filter(struct hns3_hw *hw,
-		      const struct hns3_flow_rss_conf *conf)
+hns3_flow_set_rss_ptype_tuple(struct hns3_hw *hw,
+			      struct hns3_flow_rss_conf *rss_conf)
 {
+	uint64_t old_tuple_fields, new_tuple_fields;
+	uint64_t hw_pctypes, tuples, tuple_mask = 0;
+	bool cfg_global_tuple;
 	int ret;
 
-	if (!conf->valid)
-		return 0;
+	cfg_global_tuple = (rss_conf->pattern_type == 0);
+	if (!cfg_global_tuple) {
+		/*
+		 * To ensure that different packets do not affect each other,
+		 * we have to first read all tuple fields, and then only modify
+		 * the tuples for the specified packet type.
+		 */
+		ret = hns3_get_rss_tuple_field(hw, &old_tuple_fields);
+		if (ret != 0)
+			return ret;
 
-	ret = hns3_disable_rss(hw);
-	if (ret)
-		hns3_err(hw, "RSS disable failed(%d)", ret);
+		new_tuple_fields = old_tuple_fields;
+		hw_pctypes = rss_conf->hw_pctypes;
+		while (hw_pctypes > 0) {
+			uint32_t idx = rte_bsf64(hw_pctypes);
+			uint64_t pctype = BIT_ULL(idx);
+
+			tuple_mask = hns3_flow_get_pctype_tuple_mask(pctype);
+			tuples = hns3_rss_calc_tuple_filed(hw,
+							rss_conf->conf.types);
+			new_tuple_fields &= ~tuple_mask;
+			new_tuple_fields |= tuples;
+			hw_pctypes &= ~pctype;
+		}
+	} else {
+		new_tuple_fields =
+			hns3_rss_calc_tuple_filed(hw, rss_conf->conf.types);
+	}
 
-	return ret;
+	ret = hns3_set_rss_tuple_field(hw, new_tuple_fields);
+	if (ret != 0)
+		return ret;
+
+	hns3_info(hw, "RSS tuple fields changed from 0x%" PRIx64 " to 0x%" PRIx64,
+		  old_tuple_fields, new_tuple_fields);
+
+	return 0;
 }
 
 static int
-hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf)
+hns3_config_rss_filter(struct hns3_hw *hw,
+		       struct hns3_flow_rss_conf *rss_conf)
 {
 	struct rte_flow_action_rss *rss_act;
-	uint16_t num;
 	int ret;
 
-	rss_act = &conf->conf;
-	/* Set rx queues to use */
-	num = RTE_MIN(hw->data->nb_rx_queues, rss_act->queue_num);
-	if (rss_act->queue_num > num)
-		hns3_warn(hw, "Config queue numbers %u are beyond the scope of truncated",
-			  rss_act->queue_num);
-	hns3_info(hw, "Max of contiguous %u PF queues are configured", num);
-	if (num) {
-		ret = hns3_update_indir_table(hw, rss_act, num);
-		if (ret)
+	rss_act = &rss_conf->conf;
+	if (rss_act->queue_num > 0) {
+		ret = hns3_update_indir_table(hw, rss_act, rss_act->queue_num);
+		if (ret) {
+			hns3_err(hw, "set queues action failed, ret = %d", ret);
+			return ret;
+		}
+	}
+
+	if (rss_act->key_len > 0 ||
+	    rss_act->func != RTE_ETH_HASH_FUNCTION_DEFAULT) {
+		ret = hns3_update_rss_algo_key(hw, rss_act->func, rss_conf->key,
+					       rss_act->key_len);
+		if (ret != 0) {
+			hns3_err(hw, "set func or hash key action failed, ret = %d",
+				 ret);
 			return ret;
+		}
+	}
+
+	if (rss_conf->hw_pctypes > 0) {
+		ret = hns3_flow_set_rss_ptype_tuple(hw, rss_conf);
+		if (ret != 0) {
+			hns3_err(hw, "set types action failed, ret = %d", ret);
+			return ret;
+		}
 	}
 
-	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, conf);
+	return 0;
 }
 
 static int
@@ -1589,50 +1994,44 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
 	struct hns3_adapter *hns = dev->data->dev_private;
 	struct hns3_rss_conf_ele *rss_filter_ptr;
 	struct hns3_hw *hw = &hns->hw;
-	int rss_rule_succ_cnt = 0; /* count for success of clearing RSS rules */
-	int rss_rule_fail_cnt = 0; /* count for failure of clearing RSS rules */
-	int ret = 0;
 
 	rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
 	while (rss_filter_ptr) {
 		TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
-		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
-		if (ret)
-			rss_rule_fail_cnt++;
-		else
-			rss_rule_succ_cnt++;
 		rte_free(rss_filter_ptr);
 		rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
 	}
 
-	if (rss_rule_fail_cnt) {
-		hns3_err(hw, "fail to delete all RSS filters, success num = %d fail num = %d",
-			 rss_rule_succ_cnt, rss_rule_fail_cnt);
-		ret = -EIO;
-	}
-
-	return ret;
+	return hns3_config_rss(hns);
 }
 
 static int
-hns3_restore_rss_filter(struct hns3_hw *hw)
+hns3_reconfig_all_rss_filter(struct hns3_hw *hw)
 {
 	struct hns3_rss_conf_ele *filter;
-	int ret = 0;
+	uint32_t rule_no = 0;
+	int ret;
 
-	pthread_mutex_lock(&hw->flows_lock);
 	TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) {
-		if (!filter->filter_info.valid)
-			continue;
-
 		ret = hns3_config_rss_filter(hw, &filter->filter_info);
 		if (ret != 0) {
-			hns3_err(hw, "restore RSS filter failed, ret=%d", ret);
-			goto out;
+			hns3_err(hw, "config %uth RSS filter failed, ret = %d",
+				 rule_no, ret);
+			return ret;
 		}
+		rule_no++;
 	}
 
-out:
+	return 0;
+}
+
+static int
+hns3_restore_rss_filter(struct hns3_hw *hw)
+{
+	int ret;
+
+	pthread_mutex_lock(&hw->flows_lock);
+	ret = hns3_reconfig_all_rss_filter(hw);
 	pthread_mutex_unlock(&hw->flows_lock);
 
 	return ret;
@@ -1651,38 +2050,6 @@ hns3_restore_filter(struct hns3_adapter *hns)
 	return hns3_restore_rss_filter(hw);
 }
 
-static bool
-hns3_rss_action_is_dup(struct hns3_hw *hw,
-		       const struct rte_flow_action_rss *act)
-{
-	struct hns3_rss_conf_ele *filter;
-
-	TAILQ_FOREACH(filter, &hw->flow_rss_list, entries) {
-		if (!filter->filter_info.valid)
-			continue;
-
-		if (hns3_action_rss_same(&filter->filter_info.conf, act))
-			return true;
-	}
-
-	return false;
-}
-
-static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev,
-		    struct hns3_flow_rss_conf *conf)
-{
-	struct hns3_adapter *hns = dev->data->dev_private;
-	struct hns3_hw *hw = &hns->hw;
-
-	if (hns3_rss_action_is_dup(hw, &conf->conf)) {
-		hns3_err(hw, "duplicate RSS configuration");
-		return -EINVAL;
-	}
-
-	return hns3_config_rss_filter(hw, conf);
-}
-
 static int
 hns3_flow_args_check(const struct rte_flow_attr *attr,
 		     const struct rte_flow_item pattern[],
@@ -1716,32 +2083,55 @@ static int
 hns3_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 		   const struct rte_flow_item pattern[],
 		   const struct rte_flow_action actions[],
-		   struct rte_flow_error *error)
+		   struct rte_flow_error *error,
+		   struct hns3_filter_info *filter_info)
 {
-	struct hns3_fdir_rule fdir_rule;
+	union hns3_filter_conf *conf;
 	int ret;
 
 	ret = hns3_flow_args_check(attr, pattern, actions, error);
 	if (ret)
 		return ret;
 
-	if (hns3_find_rss_general_action(pattern, actions))
-		return hns3_parse_rss_filter(dev, actions, error);
+	hns3_parse_filter_type(pattern, actions, filter_info);
+	conf = &filter_info->conf;
+	if (filter_info->type == RTE_ETH_FILTER_HASH)
+		return hns3_parse_rss_filter(dev, pattern, actions,
+					     &conf->rss_conf, error);
 
-	memset(&fdir_rule, 0, sizeof(struct hns3_fdir_rule));
-	return hns3_parse_fdir_filter(dev, pattern, actions, &fdir_rule, error);
+	return hns3_parse_fdir_filter(dev, pattern, actions,
+				      &conf->fdir_conf, error);
+}
+
+static int
+hns3_flow_rebuild_all_rss_filter(struct hns3_adapter *hns)
+{
+	struct hns3_hw *hw = &hns->hw;
+	int ret;
+
+	ret = hns3_config_rss(hns);
+	if (ret != 0) {
+		hns3_err(hw, "restore original RSS configuration failed, ret = %d.",
+			 ret);
+		return ret;
+	}
+	ret = hns3_reconfig_all_rss_filter(hw);
+	if (ret != 0)
+		hns3_err(hw, "rebuild all RSS filter failed, ret = %d.", ret);
+
+	return ret;
 }
 
 static int
 hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
-			  const struct rte_flow_action *act,
+			  struct hns3_flow_rss_conf *rss_conf,
 			  struct rte_flow *flow)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	const struct rte_flow_action_rss *rss_act;
+	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	struct hns3_rss_conf_ele *rss_filter_ptr;
 	struct hns3_flow_rss_conf *new_conf;
-	struct hns3_rss_conf_ele *filter_ptr;
+	struct rte_flow_action_rss *rss_act;
 	int ret;
 
 	rss_filter_ptr = rte_zmalloc("hns3 rss filter",
@@ -1751,35 +2141,28 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 		return -ENOMEM;
 	}
 
-	rss_act = (const struct rte_flow_action_rss *)act->conf;
 	new_conf = &rss_filter_ptr->filter_info;
-	memcpy(&new_conf->conf, rss_act, sizeof(*rss_act));
-	if (rss_act->queue_num > 0) {
-		memcpy(new_conf->queue, rss_act->queue,
-		       rss_act->queue_num * sizeof(new_conf->queue[0]));
+	memcpy(new_conf, rss_conf, sizeof(*new_conf));
+	rss_act = &new_conf->conf;
+	if (rss_act->queue_num > 0)
 		new_conf->conf.queue = new_conf->queue;
-	}
-	if (rss_act->key_len > 0) {
-		if (rss_act->key != NULL) {
-			memcpy(new_conf->key, rss_act->key,
-			       rss_act->key_len * sizeof(new_conf->key[0]));
-			new_conf->conf.key = new_conf->key;
-		}
-	}
+	/*
+	 * There are two ways to deliver hash key action:
+	 * 1> 'key_len' is greater than zero and 'key' isn't NULL.
+	 * 2> 'key_len' is greater than zero, but 'key' is NULL.
+	 * For case 2, we need to keep 'key' of the new_conf is NULL so as to
+	 * inherit the configuration from user in case of failing to verify
+	 * duplicate rule later.
+	 */
+	if (rss_act->key_len > 0 && rss_act->key != NULL)
+		new_conf->conf.key = new_conf->key;
 
-	ret = hns3_flow_parse_rss(dev, new_conf);
+	ret = hns3_config_rss_filter(hw, new_conf);
 	if (ret != 0) {
 		rte_free(rss_filter_ptr);
+		(void)hns3_flow_rebuild_all_rss_filter(hns);
 		return ret;
 	}
-	rss_filter_ptr->filter_info.valid = true;
-
-	/*
-	 * When create a new RSS rule, the old rule will be overlaid and set
-	 * invalid.
-	 */
-	TAILQ_FOREACH(filter_ptr, &hw->flow_rss_list, entries)
-		filter_ptr->filter_info.valid = false;
 
 	TAILQ_INSERT_TAIL(&hw->flow_rss_list, rss_filter_ptr, entries);
 	flow->rule = rss_filter_ptr;
@@ -1790,31 +2173,24 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
 
 static int
 hns3_flow_create_fdir_rule(struct rte_eth_dev *dev,
-			   const struct rte_flow_item pattern[],
-			   const struct rte_flow_action actions[],
+			   struct hns3_fdir_rule *fdir_rule,
 			   struct rte_flow_error *error,
 			   struct rte_flow *flow)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
 	struct hns3_fdir_rule_ele *fdir_rule_ptr;
-	struct hns3_fdir_rule fdir_rule;
 	bool indir;
 	int ret;
 
-	memset(&fdir_rule, 0, sizeof(struct hns3_fdir_rule));
-	ret = hns3_parse_fdir_filter(dev, pattern, actions, &fdir_rule, error);
-	if (ret != 0)
-		return ret;
-
-	indir = !!(fdir_rule.flags & HNS3_RULE_FLAG_COUNTER_INDIR);
-	if (fdir_rule.flags & HNS3_RULE_FLAG_COUNTER) {
-		ret = hns3_counter_new(dev, indir, fdir_rule.act_cnt.id,
+	indir = !!(fdir_rule->flags & HNS3_RULE_FLAG_COUNTER_INDIR);
+	if (fdir_rule->flags & HNS3_RULE_FLAG_COUNTER) {
+		ret = hns3_counter_new(dev, indir, fdir_rule->act_cnt.id,
 				       error);
 		if (ret != 0)
 			return ret;
 
-		flow->counter_id = fdir_rule.act_cnt.id;
+		flow->counter_id = fdir_rule->act_cnt.id;
 	}
 
 	fdir_rule_ptr = rte_zmalloc("hns3 fdir rule",
@@ -1830,11 +2206,11 @@ hns3_flow_create_fdir_rule(struct rte_eth_dev *dev,
 	 * rules to the hardware to simplify the rollback of rules in the
 	 * hardware.
 	 */
-	ret = hns3_fdir_filter_program(hns, &fdir_rule, false);
+	ret = hns3_fdir_filter_program(hns, fdir_rule, false);
 	if (ret != 0)
 		goto err_fdir_filter;
 
-	memcpy(&fdir_rule_ptr->fdir_conf, &fdir_rule,
+	memcpy(&fdir_rule_ptr->fdir_conf, fdir_rule,
 		sizeof(struct hns3_fdir_rule));
 	TAILQ_INSERT_TAIL(&hw->flow_fdir_list, fdir_rule_ptr, entries);
 	flow->rule = fdir_rule_ptr;
@@ -1845,8 +2221,8 @@ hns3_flow_create_fdir_rule(struct rte_eth_dev *dev,
 err_fdir_filter:
 	rte_free(fdir_rule_ptr);
 err_malloc:
-	if (fdir_rule.flags & HNS3_RULE_FLAG_COUNTER)
-		hns3_counter_release(dev, fdir_rule.act_cnt.id);
+	if (fdir_rule->flags & HNS3_RULE_FLAG_COUNTER)
+		hns3_counter_release(dev, fdir_rule->act_cnt.id);
 
 	return ret;
 }
@@ -1864,13 +2240,15 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 		 struct rte_flow_error *error)
 {
 	struct hns3_adapter *hns = dev->data->dev_private;
-	struct hns3_hw *hw = &hns->hw;
+	struct hns3_filter_info filter_info = {0};
 	struct hns3_flow_mem *flow_node;
-	const struct rte_flow_action *act;
+	struct hns3_hw *hw = &hns->hw;
+	union hns3_filter_conf *conf;
 	struct rte_flow *flow;
 	int ret;
 
-	ret = hns3_flow_validate(dev, attr, pattern, actions, error);
+	ret = hns3_flow_validate(dev, attr, pattern, actions, error,
+				 &filter_info);
 	if (ret)
 		return NULL;
 
@@ -1890,13 +2268,12 @@ hns3_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 	}
 
 	flow_node->flow = flow;
+	conf = &filter_info.conf;
 	TAILQ_INSERT_TAIL(&hw->flow_list, flow_node, entries);
-
-	act = hns3_find_rss_general_action(pattern, actions);
-	if (act)
-		ret = hns3_flow_create_rss_rule(dev, act, flow);
+	if (filter_info.type == RTE_ETH_FILTER_HASH)
+		ret = hns3_flow_create_rss_rule(dev, &conf->rss_conf, flow);
 	else
-		ret = hns3_flow_create_fdir_rule(dev, pattern, actions,
+		ret = hns3_flow_create_fdir_rule(dev, &conf->fdir_conf,
 						 error, flow);
 	if (ret == 0)
 		return flow;
@@ -1950,15 +2327,10 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
 		break;
 	case RTE_ETH_FILTER_HASH:
 		rss_filter_ptr = (struct hns3_rss_conf_ele *)flow->rule;
-		ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
-		if (ret)
-			return rte_flow_error_set(error, EIO,
-						  RTE_FLOW_ERROR_TYPE_HANDLE,
-						  flow,
-						  "Destroy RSS fail.Try again");
 		TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
 		rte_free(rss_filter_ptr);
 		rss_filter_ptr = NULL;
+		(void)hns3_flow_rebuild_all_rss_filter(hns);
 		break;
 	default:
 		return rte_flow_error_set(error, EINVAL,
@@ -2064,10 +2436,12 @@ hns3_flow_validate_wrap(struct rte_eth_dev *dev,
 			struct rte_flow_error *error)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct hns3_filter_info filter_info = {0};
 	int ret;
 
 	pthread_mutex_lock(&hw->flows_lock);
-	ret = hns3_flow_validate(dev, attr, pattern, actions, error);
+	ret = hns3_flow_validate(dev, attr, pattern, actions, error,
+				 &filter_info);
 	pthread_mutex_unlock(&hw->flows_lock);
 
 	return ret;
diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
index 90126f2b6e..1b49673f11 100644
--- a/drivers/net/hns3/hns3_flow.h
+++ b/drivers/net/hns3/hns3_flow.h
@@ -9,6 +9,7 @@
 #include <ethdev_driver.h>
 
 #include "hns3_rss.h"
+#include "hns3_fdir.h"
 
 struct hns3_flow_counter {
 	LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
@@ -26,10 +27,10 @@ struct rte_flow {
 
 struct hns3_flow_rss_conf {
 	struct rte_flow_action_rss conf;
-	uint8_t hash_algo;
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX];  /* Hash key */
 	uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */
-	bool valid; /* check if RSS rule is valid */
+	uint64_t pattern_type;
+	uint64_t hw_pctypes; /* packet types in driver */
 };
 
 /* rss filter list structure */
@@ -53,6 +54,16 @@ struct rte_flow_action_handle {
 	uint32_t counter_id;
 };
 
+union hns3_filter_conf {
+	struct hns3_fdir_rule fdir_conf;
+	struct hns3_flow_rss_conf rss_conf;
+};
+
+struct hns3_filter_info {
+	enum rte_filter_type type;
+	union hns3_filter_conf conf;
+};
+
 TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
 TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
 
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index f51d70a8e5..dfa2901ae3 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -18,69 +18,13 @@ const uint8_t hns3_hash_key[HNS3_RSS_KEY_SIZE] = {
 	0x6A, 0x42, 0xB7, 0x3B, 0xBE, 0xAC, 0x01, 0xFA
 };
 
-enum hns3_tuple_field {
-	/* IPV4_TCP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D = 0,
-	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S,
-	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S,
-
-	/* IPV4_UDP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D = 8,
-	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S,
-	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S,
-
-	/* IPV4_SCTP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D = 16,
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S,
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S,
-	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER,
-
-	/* IPV4 ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24,
-	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S,
-	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D,
-	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S,
-
-	/* IPV6_TCP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D = 32,
-	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S,
-	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S,
-
-	/* IPV6_UDP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D = 40,
-	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S,
-	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S,
-
-	/* IPV6_SCTP ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D = 48,
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S,
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
-	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,
-
-	/* IPV6 ENABLE FIELD */
-	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56,
-	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S,
-	HNS3_RSS_FIELD_IPV6_FRAG_IP_D,
-	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
+const uint8_t hns3_hash_func_map[] = {
+	[RTE_ETH_HASH_FUNCTION_DEFAULT] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+	[RTE_ETH_HASH_FUNCTION_TOEPLITZ] = HNS3_RSS_HASH_ALGO_TOEPLITZ,
+	[RTE_ETH_HASH_FUNCTION_SIMPLE_XOR] = HNS3_RSS_HASH_ALGO_SIMPLE,
+	[RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ] = HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP,
 };
 
-#define HNS3_RSS_TUPLE_IPV4_TCP_M	GENMASK(3, 0)
-#define HNS3_RSS_TUPLE_IPV4_UDP_M	GENMASK(11, 8)
-#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(20, 16)
-#define HNS3_RSS_TUPLE_IPV4_NONF_M	GENMASK(25, 24)
-#define HNS3_RSS_TUPLE_IPV4_FLAG_M	GENMASK(27, 26)
-#define HNS3_RSS_TUPLE_IPV6_TCP_M	GENMASK(35, 32)
-#define HNS3_RSS_TUPLE_IPV6_UDP_M	GENMASK(43, 40)
-#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(52, 48)
-#define HNS3_RSS_TUPLE_IPV6_NONF_M	GENMASK(57, 56)
-#define HNS3_RSS_TUPLE_IPV6_FLAG_M	GENMASK(59, 58)
-
 enum hns3_rss_tuple_type {
 	HNS3_RSS_IP_TUPLE,
 	HNS3_RSS_IP_L4_TUPLE,
@@ -574,7 +518,7 @@ hns3_rss_check_l3l4_types(struct hns3_hw *hw, uint64_t rss_hf)
 		hns3_warn(hw, "packet type isn't specified, L4_SRC/DST_ONLY is ignored.");
 }
 
-static uint64_t
+uint64_t
 hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf)
 {
 	uint64_t l3_only_mask = RTE_ETH_RSS_L3_SRC_ONLY |
@@ -610,25 +554,35 @@ hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf)
 }
 
 int
-hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
+hns3_set_rss_tuple_field(struct hns3_hw *hw, uint64_t tuple_fields)
 {
 	struct hns3_rss_input_tuple_cmd *req;
 	struct hns3_cmd_desc desc;
-	uint64_t tuple_field;
 	int ret;
 
 	hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_RSS_INPUT_TUPLE, false);
 	req = (struct hns3_rss_input_tuple_cmd *)desc.data;
-
-	tuple_field = hns3_rss_calc_tuple_filed(hw, rss_hf);
-	req->tuple_field = rte_cpu_to_le_64(tuple_field);
+	req->tuple_field = rte_cpu_to_le_64(tuple_fields);
 	ret = hns3_cmd_send(hw, &desc, 1);
-	if (ret) {
-		hns3_err(hw, "Update RSS flow types tuples failed %d", ret);
-		return ret;
-	}
+	if (ret != 0)
+		hns3_err(hw, "set RSS hash tuple fields failed ret = %d", ret);
 
-	return 0;
+	return ret;
+}
+
+int
+hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
+{
+	uint64_t tuple_fields;
+	int ret;
+
+	tuple_fields = hns3_rss_calc_tuple_filed(hw, rss_hf);
+	ret = hns3_set_rss_tuple_field(hw, tuple_fields);
+	if (ret != 0)
+		hns3_err(hw, "Update RSS flow types tuples failed, ret = %d",
+			 ret);
+
+	return ret;
 }
 
 /*
@@ -1000,6 +954,52 @@ hns3_set_rss_tc_mode(struct hns3_hw *hw)
 	return ret;
 }
 
+/*
+ * Note: the 'hash_algo' is defined by enum rte_eth_hash_function.
+ */
+int
+hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_func,
+			 uint8_t *key, uint8_t key_len)
+{
+	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
+	bool modify_key, modify_algo;
+	uint8_t hash_algo;
+	int ret;
+
+	modify_key = (key != NULL && key_len > 0);
+	modify_algo = hash_func != RTE_ETH_HASH_FUNCTION_DEFAULT;
+	if (!modify_key && !modify_algo)
+		return 0;
+
+	if (modify_algo && hash_func >= RTE_DIM(hns3_hash_func_map)) {
+		hns3_err(hw, "hash func (%u) is unsupported.", hash_func);
+		return -ENOTSUP;
+	}
+	if (modify_key && key_len != hw->rss_key_size) {
+		hns3_err(hw, "hash key length (%u) is invalid.", key_len);
+		return -EINVAL;
+	}
+
+	ret = hns3_rss_get_algo_key(hw, &hash_algo, rss_key, hw->rss_key_size);
+	if (ret != 0) {
+		hns3_err(hw, "fail to get RSS hash algorithm and key, ret = %d",
+			 ret);
+		return ret;
+	}
+
+	if (modify_algo)
+		hash_algo = hns3_hash_func_map[hash_func];
+	if (modify_key)
+		memcpy(rss_key, key, key_len);
+
+	ret = hns3_rss_set_algo_key(hw, hash_algo, rss_key, hw->rss_key_size);
+	if (ret != 0)
+		hns3_err(hw, "fail to set RSS hash algorithm and key, ret = %d",
+			 ret);
+
+	return ret;
+}
+
 static void
 hns3_rss_tuple_uninit(struct hns3_hw *hw)
 {
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index d19730c69c..d672481a14 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -8,23 +8,102 @@
 #include <rte_ethdev.h>
 #include <rte_flow.h>
 
-#define HNS3_ETH_RSS_SUPPORT ( \
-	RTE_ETH_RSS_IPV4 | \
-	RTE_ETH_RSS_FRAG_IPV4 | \
-	RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
-	RTE_ETH_RSS_NONFRAG_IPV4_UDP | \
-	RTE_ETH_RSS_NONFRAG_IPV4_SCTP | \
-	RTE_ETH_RSS_NONFRAG_IPV4_OTHER | \
-	RTE_ETH_RSS_IPV6 | \
-	RTE_ETH_RSS_FRAG_IPV6 | \
-	RTE_ETH_RSS_NONFRAG_IPV6_TCP | \
-	RTE_ETH_RSS_NONFRAG_IPV6_UDP | \
-	RTE_ETH_RSS_NONFRAG_IPV6_SCTP | \
-	RTE_ETH_RSS_NONFRAG_IPV6_OTHER | \
-	RTE_ETH_RSS_L3_SRC_ONLY | \
-	RTE_ETH_RSS_L3_DST_ONLY | \
-	RTE_ETH_RSS_L4_SRC_ONLY | \
-	RTE_ETH_RSS_L4_DST_ONLY)
+#define HNS3_RSS_SUPPORT_L3_SRC_DST	(RTE_ETH_RSS_L3_SRC_ONLY | \
+					 RTE_ETH_RSS_L3_DST_ONLY)
+#define HNS3_RSS_SUPPORT_L4_SRC_DST	(RTE_ETH_RSS_L4_SRC_ONLY | \
+					 RTE_ETH_RSS_L4_DST_ONLY)
+#define HNS3_RSS_SUPPORT_L3L4		(HNS3_RSS_SUPPORT_L3_SRC_DST | \
+					 HNS3_RSS_SUPPORT_L4_SRC_DST)
+
+#define HNS3_RSS_SUPPORT_FLOW_TYPE	(RTE_ETH_RSS_IPV4 | \
+					 RTE_ETH_RSS_FRAG_IPV4 | \
+					 RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
+					 RTE_ETH_RSS_NONFRAG_IPV4_UDP | \
+					 RTE_ETH_RSS_NONFRAG_IPV4_SCTP | \
+					 RTE_ETH_RSS_NONFRAG_IPV4_OTHER | \
+					 RTE_ETH_RSS_IPV6 | \
+					 RTE_ETH_RSS_FRAG_IPV6 | \
+					 RTE_ETH_RSS_NONFRAG_IPV6_TCP | \
+					 RTE_ETH_RSS_NONFRAG_IPV6_UDP | \
+					 RTE_ETH_RSS_NONFRAG_IPV6_SCTP | \
+					 RTE_ETH_RSS_NONFRAG_IPV6_OTHER)
+
+#define HNS3_ETH_RSS_SUPPORT		(HNS3_RSS_SUPPORT_FLOW_TYPE | \
+					 HNS3_RSS_SUPPORT_L3L4)
+
+enum hns3_tuple_field {
+	/* IPV4_TCP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D = 0,
+	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S,
+	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S,
+
+	/* IPV4_UDP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D = 8,
+	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S,
+	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S,
+
+	/* IPV4_SCTP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D = 16,
+	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S,
+	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S,
+	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER,
+
+	/* IPV4 ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24,
+	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S,
+	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D,
+	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S,
+
+	/* IPV6_TCP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D = 32,
+	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S,
+	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S,
+
+	/* IPV6_UDP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D = 40,
+	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S,
+	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S,
+
+	/* IPV6_SCTP ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_D = 48,
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_S,
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
+	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,
+
+	/* IPV6 ENABLE FIELD */
+	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56,
+	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S,
+	HNS3_RSS_FIELD_IPV6_FRAG_IP_D,
+	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
+};
+
+#define HNS3_RSS_PCTYPE_IPV4_TCP	BIT_ULL(0)
+#define HNS3_RSS_PCTYPE_IPV4_UDP	BIT_ULL(8)
+#define HNS3_RSS_PCTYPE_IPV4_SCTP	BIT_ULL(16)
+#define HNS3_RSS_PCTYPE_IPV4_NONF	BIT_ULL(24)
+#define HNS3_RSS_PCTYPE_IPV4_FLAG	BIT_ULL(26)
+#define HNS3_RSS_PCTYPE_IPV6_TCP	BIT_ULL(32)
+#define HNS3_RSS_PCTYPE_IPV6_UDP	BIT_ULL(40)
+#define HNS3_RSS_PCTYPE_IPV6_SCTP	BIT_ULL(48)
+#define HNS3_RSS_PCTYPE_IPV6_NONF	BIT_ULL(56)
+#define HNS3_RSS_PCTYPE_IPV6_FLAG	BIT_ULL(58)
+
+#define HNS3_RSS_TUPLE_IPV4_TCP_M	GENMASK(3, 0)
+#define HNS3_RSS_TUPLE_IPV4_UDP_M	GENMASK(11, 8)
+#define HNS3_RSS_TUPLE_IPV4_SCTP_M	GENMASK(20, 16)
+#define HNS3_RSS_TUPLE_IPV4_NONF_M	GENMASK(25, 24)
+#define HNS3_RSS_TUPLE_IPV4_FLAG_M	GENMASK(27, 26)
+#define HNS3_RSS_TUPLE_IPV6_TCP_M	GENMASK(35, 32)
+#define HNS3_RSS_TUPLE_IPV6_UDP_M	GENMASK(43, 40)
+#define HNS3_RSS_TUPLE_IPV6_SCTP_M	GENMASK(52, 48)
+#define HNS3_RSS_TUPLE_IPV6_NONF_M	GENMASK(57, 56)
+#define HNS3_RSS_TUPLE_IPV6_FLAG_M	GENMASK(59, 58)
 
 #define HNS3_RSS_IND_TBL_SIZE	512 /* The size of hash lookup table */
 #define HNS3_RSS_IND_TBL_SIZE_MAX 2048
@@ -108,10 +187,14 @@ int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
+int hns3_set_rss_tuple_field(struct hns3_hw *hw, uint64_t tuple_fields);
 int hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields);
 int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
 int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
 			  uint8_t *key, uint8_t key_len);
+uint64_t hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf);
+int hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
+			     uint8_t *key, uint8_t key_len);
 
 #endif /* HNS3_RSS_H */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.969711200 +0800
+++ 0086-net-hns3-reimplement-hash-flow-function.patch	2023-04-09 21:45:38.699042200 +0800
@@ -1 +1 @@
-From e3069658da9ffb6f83a0d972ff2776c405eb6a8f Mon Sep 17 00:00:00 2001
+From 3a5105f1de819eed82a669824012f6d7dd556994 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e3069658da9ffb6f83a0d972ff2776c405eb6a8f ]
@@ -28 +30,0 @@
-Cc: stable@dpdk.org
@@ -61 +63 @@
-index 89374816aa..6ac623bea9 100644
+index b1189455ec..c38bd9dd8b 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/hns3: add verification of RSS types' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (85 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: reimplement hash flow function' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/mlx5: fix Windows build with MinGW GCC 12' " Xueming Li
                     ` (49 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Huisong Li; +Cc: Dongdong Liu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/5af10c2a20aea82a13078ef07fc1deaf2d13617b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 5af10c2a20aea82a13078ef07fc1deaf2d13617b Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:18 +0800
Subject: [PATCH] net/hns3: add verification of RSS types
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit eb3ef9e0d7eb54b47ab58d3d14f9f5fff3f4120b ]

Add the verification of RSS types from ethdev ops and rte flow without
pattern attribute. The following cases are invalid:
1. types contains unsupported RSS type but hasn't type driver support.
2. types has L3 src/dst but hasn't supported packet type.
3. types has L4 src/dst but hasn't supported packet type and hasn't IP
   packet type.

Fixes: 13c3993240c8 ("net/hns3: add L3 and L4 RSS types")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 12 +++---
 drivers/net/hns3/hns3_rss.c  | 74 +++++++++++++++++++++++++-----------
 drivers/net/hns3/hns3_rss.h  |  3 +-
 3 files changed, 60 insertions(+), 29 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index c38bd9dd8b..c1f4f5cb0b 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1652,9 +1652,10 @@ hns3_flow_parse_rss_types(struct hns3_hw *hw,
 
 	/* no pattern specified to set global RSS types. */
 	if (pattern_type == 0) {
-		if (rss_act->types & ~HNS3_ETH_RSS_SUPPORT)
-			hns3_warn(hw, "some types in the requested RSS types (0x%" PRIx64 ") aren't supported, they are ignored.",
-				  rss_act->types);
+		if (!hns3_check_rss_types_valid(hw, rss_act->types))
+			return rte_flow_error_set(error, EINVAL,
+					RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+					NULL, "RSS types is invalid.");
 		rss_conf->hw_pctypes =
 				hns3_flow_get_all_hw_pctypes(rss_act->types);
 		return 0;
@@ -1929,15 +1930,14 @@ hns3_flow_set_rss_ptype_tuple(struct hns3_hw *hw,
 			uint64_t pctype = BIT_ULL(idx);
 
 			tuple_mask = hns3_flow_get_pctype_tuple_mask(pctype);
-			tuples = hns3_rss_calc_tuple_filed(hw,
-							rss_conf->conf.types);
+			tuples = hns3_rss_calc_tuple_filed(rss_conf->conf.types);
 			new_tuple_fields &= ~tuple_mask;
 			new_tuple_fields |= tuples;
 			hw_pctypes &= ~pctype;
 		}
 	} else {
 		new_tuple_fields =
-			hns3_rss_calc_tuple_filed(hw, rss_conf->conf.types);
+			hns3_rss_calc_tuple_filed(rss_conf->conf.types);
 	}
 
 	ret = hns3_set_rss_tuple_field(hw, new_tuple_fields);
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index dfa2901ae3..6126512bd7 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -492,34 +492,62 @@ hns3_rss_reset_indir_table(struct hns3_hw *hw)
 	return ret;
 }
 
-static void
-hns3_rss_check_l3l4_types(struct hns3_hw *hw, uint64_t rss_hf)
+bool
+hns3_check_rss_types_valid(struct hns3_hw *hw, uint64_t types)
 {
 	uint64_t ip_mask = RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_FRAG_IPV4 |
 			   RTE_ETH_RSS_NONFRAG_IPV4_OTHER |
 			   RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_FRAG_IPV6 |
 			   RTE_ETH_RSS_NONFRAG_IPV6_OTHER;
-	uint64_t l4_mask = RTE_ETH_RSS_NONFRAG_IPV4_TCP |
-			   RTE_ETH_RSS_NONFRAG_IPV4_UDP |
-			   RTE_ETH_RSS_NONFRAG_IPV4_SCTP |
-			   RTE_ETH_RSS_NONFRAG_IPV6_TCP |
-			   RTE_ETH_RSS_NONFRAG_IPV6_UDP |
-			   RTE_ETH_RSS_NONFRAG_IPV6_SCTP;
-	uint64_t l3_src_dst_mask = RTE_ETH_RSS_L3_SRC_ONLY |
-				   RTE_ETH_RSS_L3_DST_ONLY;
-	uint64_t l4_src_dst_mask = RTE_ETH_RSS_L4_SRC_ONLY |
-				   RTE_ETH_RSS_L4_DST_ONLY;
-
-	if (rss_hf & l3_src_dst_mask &&
-	    !(rss_hf & ip_mask || rss_hf & l4_mask))
-		hns3_warn(hw, "packet type isn't specified, L3_SRC/DST_ONLY is ignored.");
-
-	if (rss_hf & l4_src_dst_mask && !(rss_hf & l4_mask))
-		hns3_warn(hw, "packet type isn't specified, L4_SRC/DST_ONLY is ignored.");
+	uint64_t ip_l4_mask = RTE_ETH_RSS_NONFRAG_IPV4_TCP |
+			      RTE_ETH_RSS_NONFRAG_IPV4_UDP |
+			      RTE_ETH_RSS_NONFRAG_IPV4_SCTP |
+			      RTE_ETH_RSS_NONFRAG_IPV6_TCP |
+			      RTE_ETH_RSS_NONFRAG_IPV6_UDP |
+			      RTE_ETH_RSS_NONFRAG_IPV6_SCTP;
+	bool has_l4_src_dst = !!(types & HNS3_RSS_SUPPORT_L4_SRC_DST);
+	bool has_ip_pkt = !!(types & ip_mask);
+	uint64_t final_types;
+
+	if (types == 0)
+		return true;
+
+	if ((types & HNS3_ETH_RSS_SUPPORT) == 0) {
+		hns3_err(hw, "specified types(0x%" PRIx64 ") are unsupported.",
+			 types);
+		return false;
+	}
+
+	if ((types & HNS3_RSS_SUPPORT_L3_SRC_DST) != 0 &&
+	    (types & HNS3_RSS_SUPPORT_FLOW_TYPE) == 0) {
+		hns3_err(hw, "IP or IP-TCP/UDP/SCTP packet type isn't specified, L3_SRC/DST_ONLY cannot be set.");
+		return false;
+	}
+
+	if (has_l4_src_dst && (types & ip_l4_mask) == 0) {
+		if (!has_ip_pkt) {
+			hns3_err(hw, "IP-TCP/UDP/SCTP packet type isn't specified, L4_SRC/DST_ONLY cannot be set.");
+			return false;
+		}
+		/*
+		 * For the case that the types has L4_SRC/DST_ONLY but hasn't
+		 * IP-TCP/UDP/SCTP packet type, this types is considered valid
+		 * if it also has IP packet type.
+		 */
+		hns3_warn(hw, "L4_SRC/DST_ONLY is ignored because of no including L4 packet.");
+	}
+
+	if ((types & ~HNS3_ETH_RSS_SUPPORT) != 0) {
+		final_types = types & HNS3_ETH_RSS_SUPPORT;
+		hns3_warn(hw, "set RSS types based on hardware support, requested:0x%" PRIx64 " configured:0x%" PRIx64 "",
+			  types, final_types);
+	}
+
+	return true;
 }
 
 uint64_t
-hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf)
+hns3_rss_calc_tuple_filed(uint64_t rss_hf)
 {
 	uint64_t l3_only_mask = RTE_ETH_RSS_L3_SRC_ONLY |
 				RTE_ETH_RSS_L3_DST_ONLY;
@@ -548,7 +576,6 @@ hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf)
 		    !has_l3_l4_only)
 			tuple |= hns3_set_tuple_table[i].rss_field;
 	}
-	hns3_rss_check_l3l4_types(hw, rss_hf);
 
 	return tuple;
 }
@@ -576,7 +603,7 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
 	uint64_t tuple_fields;
 	int ret;
 
-	tuple_fields = hns3_rss_calc_tuple_filed(hw, rss_hf);
+	tuple_fields = hns3_rss_calc_tuple_filed(rss_hf);
 	ret = hns3_set_rss_tuple_field(hw, tuple_fields);
 	if (ret != 0)
 		hns3_err(hw, "Update RSS flow types tuples failed, ret = %d",
@@ -611,6 +638,9 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
+	if (!hns3_check_rss_types_valid(hw, rss_hf))
+		return -EINVAL;
+
 	rte_spinlock_lock(&hw->lock);
 	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
 	if (ret)
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index d672481a14..415430a399 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -186,6 +186,7 @@ int hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir,
 int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
+bool hns3_check_rss_types_valid(struct hns3_hw *hw, uint64_t types);
 int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
 int hns3_set_rss_tuple_field(struct hns3_hw *hw, uint64_t tuple_fields);
 int hns3_get_rss_tuple_field(struct hns3_hw *hw, uint64_t *tuple_fields);
@@ -193,7 +194,7 @@ int hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			  const uint8_t *key, uint8_t key_len);
 int hns3_rss_get_algo_key(struct hns3_hw *hw,  uint8_t *hash_algo,
 			  uint8_t *key, uint8_t key_len);
-uint64_t hns3_rss_calc_tuple_filed(struct hns3_hw *hw, uint64_t rss_hf);
+uint64_t hns3_rss_calc_tuple_filed(uint64_t rss_hf);
 int hns3_update_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo,
 			     uint8_t *key, uint8_t key_len);
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:40.998672600 +0800
+++ 0087-net-hns3-add-verification-of-RSS-types.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From eb3ef9e0d7eb54b47ab58d3d14f9f5fff3f4120b Mon Sep 17 00:00:00 2001
+From 5af10c2a20aea82a13078ef07fc1deaf2d13617b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit eb3ef9e0d7eb54b47ab58d3d14f9f5fff3f4120b ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index 6ac623bea9..e132d88fa1 100644
+index c38bd9dd8b..c1f4f5cb0b 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix Windows build with MinGW GCC 12' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (86 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/hns3: add verification of RSS types' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'crypto/ccp: fix PCI probing' " Xueming Li
                     ` (48 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Tyler Retzlaff, Tal Shnaiderman, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/f081724c6bf5431062257f4893e078876eb904c8

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f081724c6bf5431062257f4893e078876eb904c8 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 2 Mar 2023 14:21:50 +0100
Subject: [PATCH] net/mlx5: fix Windows build with MinGW GCC 12
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8ce24f0c8398b1129b64af83d49bf6fa8567c472 ]

With recent changes in Meson and MinGW toolchain,
the driver mlx5 was not able to compile on Linux for Windows.

There were errors due to system detection, non-typed constants,
constant going over int range forbidden in pedantic mode,
and minimum-comparison of different types.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
---
 drivers/common/mlx5/meson.build             |   9 +-
 drivers/common/mlx5/windows/mlx5_win_defs.h | 100 +++++++++++---------
 drivers/net/mlx5/windows/mlx5_os.c          |   4 +-
 3 files changed, 65 insertions(+), 48 deletions(-)

diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build
index 60ccd95cbc..9dc809f192 100644
--- a/drivers/common/mlx5/meson.build
+++ b/drivers/common/mlx5/meson.build
@@ -1,9 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2019 Mellanox Technologies, Ltd
 
-if not (is_linux or (is_windows and is_ms_linker))
+if not (is_linux or is_windows)
     build = false
-    reason = 'only supported on Linux and Windows build with clang'
+    reason = 'only supported on Linux and Windows'
+    subdir_done()
+endif
+if is_windows and not is_ms_linker and not meson.is_cross_build()
+    build = false
+    reason = 'MinGW is supported only for cross-compilation test'
     subdir_done()
 endif
 
diff --git a/drivers/common/mlx5/windows/mlx5_win_defs.h b/drivers/common/mlx5/windows/mlx5_win_defs.h
index 3554e4a7ff..65da820c5e 100644
--- a/drivers/common/mlx5/windows/mlx5_win_defs.h
+++ b/drivers/common/mlx5/windows/mlx5_win_defs.h
@@ -2,8 +2,10 @@
  * Copyright (C) Mellanox Technologies, Ltd. 2001-2020.
  */
 
-#ifndef __MLX5_WIN_DEFS_H__
-#define __MLX5_WIN_DEFS_H__
+#ifndef MLX5_WIN_DEFS_H
+#define MLX5_WIN_DEFS_H
+
+#include <rte_bitops.h>
 
 enum {
 	MLX5_CQE_OWNER_MASK	= 1,
@@ -40,29 +42,29 @@ enum {
 };
 
 enum mlx5dv_cq_init_attr_mask {
-	MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE	= 1 << 0,
-	MLX5DV_CQ_INIT_ATTR_MASK_FLAGS		= 1 << 1,
-	MLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZE = 1 << 2,
+	MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE = RTE_BIT32(0),
+	MLX5DV_CQ_INIT_ATTR_MASK_FLAG           = RTE_BIT32(1),
+	MLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZE       = RTE_BIT32(2),
 };
 
 enum mlx5dv_cqe_comp_res_format {
-	MLX5DV_CQE_RES_FORMAT_HASH		= 1 << 0,
-	MLX5DV_CQE_RES_FORMAT_CSUM		= 1 << 1,
-	MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX	= 1 << 2,
+	MLX5DV_CQE_RES_FORMAT_HASH        = RTE_BIT32(0),
+	MLX5DV_CQE_RES_FORMAT_CSUM        = RTE_BIT32(1),
+	MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX = RTE_BIT32(2),
 };
 
 enum ibv_access_flags {
-	IBV_ACCESS_LOCAL_WRITE		= 1,
-	IBV_ACCESS_REMOTE_WRITE		= 1 << 1,
-	IBV_ACCESS_REMOTE_READ		= 1 << 2,
-	IBV_ACCESS_REMOTE_ATOMIC	= 1 << 3,
-	IBV_ACCESS_MW_BIND		= 1 << 4,
-	IBV_ACCESS_ZERO_BASED		= 1 << 5,
-	IBV_ACCESS_ON_DEMAND		= 1 << 6,
+	IBV_ACCESS_LOCAL_WRITE   = RTE_BIT32(0),
+	IBV_ACCESS_REMOTE_WRITE  = RTE_BIT32(1),
+	IBV_ACCESS_REMOTE_READ   = RTE_BIT32(2),
+	IBV_ACCESS_REMOTE_ATOMIC = RTE_BIT32(3),
+	IBV_ACCESS_MW_BIND       = RTE_BIT32(4),
+	IBV_ACCESS_ZERO_BASED    = RTE_BIT32(5),
+	IBV_ACCESS_ON_DEMAND     = RTE_BIT32(6),
 };
 
 enum mlx5_ib_uapi_devx_create_event_channel_flags {
-	MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA = 1 << 0,
+	MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA = RTE_BIT32(0),
 };
 
 #define MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA \
@@ -85,15 +87,15 @@ enum {
 };
 
 enum {
-	MLX5_ETH_WQE_L3_CSUM = (1 << 6),
-	MLX5_ETH_WQE_L4_CSUM = (1 << 7),
+	MLX5_ETH_WQE_L3_CSUM = RTE_BIT32(6),
+	MLX5_ETH_WQE_L4_CSUM = RTE_BIT32(7),
 };
 
 enum {
-	MLX5_WQE_CTRL_CQ_UPDATE	= 2 << 2,
-	MLX5_WQE_CTRL_SOLICITED	= 1 << 1,
-	MLX5_WQE_CTRL_FENCE	= 4 << 5,
-	MLX5_WQE_CTRL_INITIATOR_SMALL_FENCE = 1 << 5,
+	MLX5_WQE_CTRL_SOLICITED             = RTE_BIT32(1),
+	MLX5_WQE_CTRL_CQ_UPDATE             = RTE_BIT32(3),
+	MLX5_WQE_CTRL_INITIATOR_SMALL_FENCE = RTE_BIT32(5),
+	MLX5_WQE_CTRL_FENCE                 = RTE_BIT32(7),
 };
 
 enum {
@@ -101,6 +103,11 @@ enum {
 	MLX5_SEND_WQE_SHIFT	= 6,
 };
 
+/* Verbs headers do not support -pedantic. */
+#ifdef PEDANTIC
+#pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+
 /*
  * RX Hash fields enable to set which incoming packet's field should
  * participates in RX Hash. Each flag represent certain packet's field,
@@ -110,18 +117,22 @@ enum {
  * TCP and UDP flags can't be enabled together on the same QP.
  */
 enum ibv_rx_hash_fields {
-	IBV_RX_HASH_SRC_IPV4	= 1 << 0,
-	IBV_RX_HASH_DST_IPV4	= 1 << 1,
-	IBV_RX_HASH_SRC_IPV6	= 1 << 2,
-	IBV_RX_HASH_DST_IPV6	= 1 << 3,
-	IBV_RX_HASH_SRC_PORT_TCP	= 1 << 4,
-	IBV_RX_HASH_DST_PORT_TCP	= 1 << 5,
-	IBV_RX_HASH_SRC_PORT_UDP	= 1 << 6,
-	IBV_RX_HASH_DST_PORT_UDP	= 1 << 7,
-	IBV_RX_HASH_IPSEC_SPI		= 1 << 8,
-	IBV_RX_HASH_INNER		= (1 << 31),
+	IBV_RX_HASH_SRC_IPV4     = RTE_BIT32(0),
+	IBV_RX_HASH_DST_IPV4     = RTE_BIT32(1),
+	IBV_RX_HASH_SRC_IPV6     = RTE_BIT32(2),
+	IBV_RX_HASH_DST_IPV6     = RTE_BIT32(3),
+	IBV_RX_HASH_SRC_PORT_TCP = RTE_BIT32(4),
+	IBV_RX_HASH_DST_PORT_TCP = RTE_BIT32(5),
+	IBV_RX_HASH_SRC_PORT_UDP = RTE_BIT32(6),
+	IBV_RX_HASH_DST_PORT_UDP = RTE_BIT32(7),
+	IBV_RX_HASH_IPSEC_SPI    = RTE_BIT32(8),
+	IBV_RX_HASH_INNER        = RTE_BIT32(31),
 };
 
+#ifdef PEDANTIC
+#pragma GCC diagnostic error "-Wpedantic"
+#endif
+
 enum {
 	MLX5_RCV_DBR	= 0,
 	MLX5_SND_DBR	= 1,
@@ -141,9 +152,9 @@ enum {
 #endif
 
 enum ibv_flow_flags {
-	IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1 << 0,
-	IBV_FLOW_ATTR_FLAGS_DONT_TRAP = 1 << 1,
-	IBV_FLOW_ATTR_FLAGS_EGRESS = 1 << 2,
+	IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = RTE_BIT32(0),
+	IBV_FLOW_ATTR_FLAGS_DONT_TRAP = RTE_BIT32(1),
+	IBV_FLOW_ATTR_FLAGS_EGRESS = RTE_BIT32(2),
 };
 
 enum ibv_flow_attr_type {
@@ -240,11 +251,11 @@ struct mlx5_wqe_data_seg {
 	rte_be64_t		addr;
 };
 
-#define MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP	(1 << 4)
-#define IBV_DEVICE_RAW_IP_CSUM			(1 << 26)
-#define IBV_RAW_PACKET_CAP_CVLAN_STRIPPING	(1 << 0)
-#define IBV_RAW_PACKET_CAP_SCATTER_FCS		(1 << 1)
-#define IBV_QPT_RAW_PACKET			8
+#define MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP   RTE_BIT32(4)
+#define IBV_DEVICE_RAW_IP_CSUM               RTE_BIT32(26)
+#define IBV_RAW_PACKET_CAP_CVLAN_STRIPPING   RTE_BIT32(0)
+#define IBV_RAW_PACKET_CAP_SCATTER_FCS       RTE_BIT32(1)
+#define IBV_QPT_RAW_PACKET                   8
 
 enum {
 	MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT                    = 0x0,
@@ -254,8 +265,9 @@ enum {
 };
 
 enum {
-	MLX5_MATCH_OUTER_HEADERS        = 1 << 0,
-	MLX5_MATCH_MISC_PARAMETERS      = 1 << 1,
-	MLX5_MATCH_INNER_HEADERS        = 1 << 2,
+	MLX5_MATCH_OUTER_HEADERS        = RTE_BIT32(0),
+	MLX5_MATCH_MISC_PARAMETERS      = RTE_BIT32(1),
+	MLX5_MATCH_INNER_HEADERS        = RTE_BIT32(2),
 };
-#endif /* __MLX5_WIN_DEFS_H__ */
+
+#endif /* MLX5_WIN_DEFS_H */
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 77f04cc931..f401264b61 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -193,8 +193,8 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh)
 		 * Once DPDK supports it, take max size from device attr.
 		 */
 		sh->dev_cap.ind_table_max_size =
-			RTE_MIN(1 << hca_attr->rss_ind_tbl_cap,
-				(unsigned int)RTE_ETH_RSS_RETA_SIZE_512);
+			RTE_MIN((uint32_t)1 << hca_attr->rss_ind_tbl_cap,
+				(uint32_t)RTE_ETH_RSS_RETA_SIZE_512);
 		DRV_LOG(DEBUG, "Maximum Rx indirection table size is %u",
 			sh->dev_cap.ind_table_max_size);
 	}
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.022546000 +0800
+++ 0088-net-mlx5-fix-Windows-build-with-MinGW-GCC-12.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From 8ce24f0c8398b1129b64af83d49bf6fa8567c472 Mon Sep 17 00:00:00 2001
+From f081724c6bf5431062257f4893e078876eb904c8 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8ce24f0c8398b1129b64af83d49bf6fa8567c472 ]
@@ -12,2 +14,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'crypto/ccp: fix PCI probing' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (87 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/mlx5: fix Windows build with MinGW GCC 12' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'crypto/qat: fix SM3 auth mode' " Xueming Li
                     ` (47 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: David Marchand; +Cc: Sunil Uttarwar, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/eba4eee77bf216ac308482cc5887128b05d30773

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From eba4eee77bf216ac308482cc5887128b05d30773 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 2 Mar 2023 12:43:42 +0100
Subject: [PATCH] crypto/ccp: fix PCI probing
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e849b88fff2d3875e815a5749110241140a4512a ]

This driver has been converted from a vdev driver to a pci driver some
time ago.  This conversion is buggy as it tries to probe any pci devices
present on a system for *each* probe request from the PCI bus.

Rely on the passed PCI device and only probe what is requested.

While at it:
- stop copying the pci device object content into a local private copy,
- rely on the PCI identifier and remove internal ccp_device_version
  identifier,
- ccp_list can be made static,

With this done, all the code parsing Linux sysfs can be dropped.

Fixes: 889317b7ecb3 ("crypto/ccp: convert driver from vdev to PCI")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Uttarwar <sunilprakashrao.uttarwar@amd.com>
---
 drivers/crypto/ccp/ccp_crypto.c  |   1 -
 drivers/crypto/ccp/ccp_dev.c     |  89 ++-----------
 drivers/crypto/ccp/ccp_dev.h     |  31 ++---
 drivers/crypto/ccp/ccp_pci.c     | 207 -------------------------------
 drivers/crypto/ccp/ccp_pci.h     |  24 ----
 drivers/crypto/ccp/meson.build   |   1 -
 drivers/crypto/ccp/rte_ccp_pmd.c |  17 +--
 7 files changed, 26 insertions(+), 344 deletions(-)
 delete mode 100644 drivers/crypto/ccp/ccp_pci.c
 delete mode 100644 drivers/crypto/ccp/ccp_pci.h

diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index 2758187d93..4b84b3303e 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -26,7 +26,6 @@
 
 #include "ccp_dev.h"
 #include "ccp_crypto.h"
-#include "ccp_pci.h"
 #include "ccp_pmd_private.h"
 
 #include <openssl/conf.h>
diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 14c54929c4..ee30f5ac30 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -20,10 +20,9 @@
 #include <rte_string_fns.h>
 
 #include "ccp_dev.h"
-#include "ccp_pci.h"
 #include "ccp_pmd_private.h"
 
-struct ccp_list ccp_list = TAILQ_HEAD_INITIALIZER(ccp_list);
+static TAILQ_HEAD(, ccp_device) ccp_list = TAILQ_HEAD_INITIALIZER(ccp_list);
 static int ccp_dev_id;
 
 int
@@ -68,7 +67,7 @@ ccp_read_hwrng(uint32_t *value)
 	struct ccp_device *dev;
 
 	TAILQ_FOREACH(dev, &ccp_list, next) {
-		void *vaddr = (void *)(dev->pci.mem_resource[2].addr);
+		void *vaddr = (void *)(dev->pci->mem_resource[2].addr);
 
 		while (dev->hwrng_retries++ < CCP_MAX_TRNG_RETRIES) {
 			*value = CCP_READ_REG(vaddr, TRNG_OUT_REG);
@@ -480,7 +479,7 @@ ccp_assign_lsbs(struct ccp_device *ccp)
 }
 
 static int
-ccp_add_device(struct ccp_device *dev, int type)
+ccp_add_device(struct ccp_device *dev)
 {
 	int i;
 	uint32_t qmr, status_lo, status_hi, dma_addr_lo, dma_addr_hi;
@@ -494,9 +493,9 @@ ccp_add_device(struct ccp_device *dev, int type)
 
 	dev->id = ccp_dev_id++;
 	dev->qidx = 0;
-	vaddr = (void *)(dev->pci.mem_resource[2].addr);
+	vaddr = (void *)(dev->pci->mem_resource[2].addr);
 
-	if (type == CCP_VERSION_5B) {
+	if (dev->pci->id.device_id == AMD_PCI_CCP_5B) {
 		CCP_WRITE_REG(vaddr, CMD_TRNG_CTL_OFFSET, 0x00012D57);
 		CCP_WRITE_REG(vaddr, CMD_CONFIG_0_OFFSET, 0x00000003);
 		for (i = 0; i < 12; i++) {
@@ -615,41 +614,8 @@ ccp_remove_device(struct ccp_device *dev)
 	TAILQ_REMOVE(&ccp_list, dev, next);
 }
 
-static int
-is_ccp_device(const char *dirname,
-	      const struct rte_pci_id *ccp_id,
-	      int *type)
-{
-	char filename[PATH_MAX];
-	const struct rte_pci_id *id;
-	uint16_t vendor, device_id;
-	int i;
-	unsigned long tmp;
-
-	/* get vendor id */
-	snprintf(filename, sizeof(filename), "%s/vendor", dirname);
-	if (ccp_pci_parse_sysfs_value(filename, &tmp) < 0)
-		return 0;
-	vendor = (uint16_t)tmp;
-
-	/* get device id */
-	snprintf(filename, sizeof(filename), "%s/device", dirname);
-	if (ccp_pci_parse_sysfs_value(filename, &tmp) < 0)
-		return 0;
-	device_id = (uint16_t)tmp;
-
-	for (id = ccp_id, i = 0; id->vendor_id != 0; id++, i++) {
-		if (vendor == id->vendor_id &&
-		    device_id == id->device_id) {
-			*type = i;
-			return 1; /* Matched device */
-		}
-	}
-	return 0;
-}
-
-static int
-ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
+int
+ccp_probe_device(struct rte_pci_device *pci_dev)
 {
 	struct ccp_device *ccp_dev;
 
@@ -658,10 +624,10 @@ ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)
 	if (ccp_dev == NULL)
 		goto fail;
 
-	ccp_dev->pci = *pci_dev;
+	ccp_dev->pci = pci_dev;
 
 	/* device is valid, add in list */
-	if (ccp_add_device(ccp_dev, ccp_type)) {
+	if (ccp_add_device(ccp_dev)) {
 		ccp_remove_device(ccp_dev);
 		goto fail;
 	}
@@ -672,40 +638,3 @@ fail:
 	rte_free(ccp_dev);
 	return -1;
 }
-
-int
-ccp_probe_devices(struct rte_pci_device *pci_dev,
-		const struct rte_pci_id *ccp_id)
-{
-	int dev_cnt = 0;
-	int ccp_type = 0;
-	struct dirent *d;
-	DIR *dir;
-	int ret = 0;
-	uint16_t domain;
-	uint8_t bus, devid, function;
-	char dirname[PATH_MAX];
-
-	TAILQ_INIT(&ccp_list);
-	dir = opendir(SYSFS_PCI_DEVICES);
-	if (dir == NULL)
-		return -1;
-	while ((d = readdir(dir)) != NULL) {
-		if (d->d_name[0] == '.')
-			continue;
-		if (ccp_parse_pci_addr_format(d->d_name, sizeof(d->d_name),
-					&domain, &bus, &devid, &function) != 0)
-			continue;
-		snprintf(dirname, sizeof(dirname), "%s/%s",
-			     SYSFS_PCI_DEVICES, d->d_name);
-		if (is_ccp_device(dirname, ccp_id, &ccp_type)) {
-			CCP_LOG_DBG("CCP : Detected CCP device with ID = 0x%x\n",
-			       ccp_id[ccp_type].device_id);
-			ret = ccp_probe_device(ccp_type, pci_dev);
-			if (ret == 0)
-				dev_cnt++;
-		}
-	}
-	closedir(dir);
-	return dev_cnt;
-}
diff --git a/drivers/crypto/ccp/ccp_dev.h b/drivers/crypto/ccp/ccp_dev.h
index 9deaae7980..e3ec481dd3 100644
--- a/drivers/crypto/ccp/ccp_dev.h
+++ b/drivers/crypto/ccp/ccp_dev.h
@@ -19,6 +19,12 @@
 #include <rte_crypto_sym.h>
 #include <cryptodev_pmd.h>
 
+/* CCP PCI device identifiers */
+#define AMD_PCI_VENDOR_ID 0x1022
+#define AMD_PCI_CCP_5A 0x1456
+#define AMD_PCI_CCP_5B 0x1468
+#define AMD_PCI_CCP_RV 0x15df
+
 /**< CCP specific */
 #define MAX_HW_QUEUES                   5
 #define CCP_MAX_TRNG_RETRIES		10
@@ -169,18 +175,6 @@ static inline uint32_t ccp_pci_reg_read(void *base, int offset)
 #define CCP_WRITE_REG(hw_addr, reg_offset, value) \
 	ccp_pci_reg_write(hw_addr, reg_offset, value)
 
-TAILQ_HEAD(ccp_list, ccp_device);
-
-extern struct ccp_list ccp_list;
-
-/**
- * CCP device version
- */
-enum ccp_device_version {
-	CCP_VERSION_5A = 0,
-	CCP_VERSION_5B,
-};
-
 /**
  * A structure describing a CCP command queue.
  */
@@ -233,8 +227,8 @@ struct ccp_device {
 	/**< ccp queue */
 	int cmd_q_count;
 	/**< no. of ccp Queues */
-	struct rte_pci_device pci;
-	/**< ccp pci identifier */
+	struct rte_pci_device *pci;
+	/**< ccp pci device */
 	unsigned long lsbmap[CCP_BITMAP_SIZE(SLSB_MAP_SIZE)];
 	/**< shared lsb mask of ccp */
 	rte_spinlock_t lsb_lock;
@@ -468,13 +462,12 @@ high32_value(unsigned long addr)
 int ccp_dev_start(struct rte_cryptodev *dev);
 
 /**
- * Detect ccp platform and initialize all ccp devices
+ * Initialize one ccp device
  *
- * @param ccp_id rte_pci_id list for supported CCP devices
- * @return no. of successfully initialized CCP devices
+ * @dev rte pci device
+ * @return 0 on success otherwise -1
  */
-int ccp_probe_devices(struct rte_pci_device *pci_dev,
-		const struct rte_pci_id *ccp_id);
+int ccp_probe_device(struct rte_pci_device *pci_dev);
 
 /**
  * allocate a ccp command queue
diff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c
deleted file mode 100644
index bd1a037f76..0000000000
--- a/drivers/crypto/ccp/ccp_pci.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*   SPDX-License-Identifier: BSD-3-Clause
- *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
- */
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rte_string_fns.h>
-
-#include "ccp_pci.h"
-
-/*
- * split up a pci address into its constituent parts.
- */
-int
-ccp_parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,
-			  uint8_t *bus, uint8_t *devid, uint8_t *function)
-{
-	/* first split on ':' */
-	union splitaddr {
-		struct {
-			char *domain;
-			char *bus;
-			char *devid;
-			char *function;
-		};
-		char *str[PCI_FMT_NVAL];
-		/* last element-separator is "." not ":" */
-	} splitaddr;
-
-	char *buf_copy = strndup(buf, bufsize);
-
-	if (buf_copy == NULL)
-		return -1;
-
-	if (rte_strsplit(buf_copy, bufsize, splitaddr.str, PCI_FMT_NVAL, ':')
-			!= PCI_FMT_NVAL - 1)
-		goto error;
-	/* final split is on '.' between devid and function */
-	splitaddr.function = strchr(splitaddr.devid, '.');
-	if (splitaddr.function == NULL)
-		goto error;
-	*splitaddr.function++ = '\0';
-
-	/* now convert to int values */
-	errno = 0;
-	*domain = (uint8_t)strtoul(splitaddr.domain, NULL, 16);
-	*bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);
-	*devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);
-	*function = (uint8_t)strtoul(splitaddr.function, NULL, 10);
-	if (errno != 0)
-		goto error;
-
-	free(buf_copy); /* free the copy made with strdup */
-	return 0;
-error:
-	free(buf_copy);
-	return -1;
-}
-
-int
-ccp_pci_parse_sysfs_value(const char *filename, unsigned long *val)
-{
-	FILE *f;
-	char buf[BUFSIZ];
-	char *end = NULL;
-
-	f = fopen(filename, "r");
-	if (f == NULL)
-		return -1;
-	if (fgets(buf, sizeof(buf), f) == NULL) {
-		fclose(f);
-		return -1;
-	}
-	*val = strtoul(buf, &end, 0);
-	if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
-		fclose(f);
-		return -1;
-	}
-	fclose(f);
-	return 0;
-}
-
-/** IO resource type: */
-#define IORESOURCE_IO         0x00000100
-#define IORESOURCE_MEM        0x00000200
-
-/* parse one line of the "resource" sysfs file (note that the 'line'
- * string is modified)
- */
-static int
-ccp_pci_parse_one_sysfs_resource(char *line, size_t len, uint64_t *phys_addr,
-				 uint64_t *end_addr, uint64_t *flags)
-{
-	union pci_resource_info {
-		struct {
-			char *phys_addr;
-			char *end_addr;
-			char *flags;
-		};
-		char *ptrs[PCI_RESOURCE_FMT_NVAL];
-	} res_info;
-
-	if (rte_strsplit(line, len, res_info.ptrs, 3, ' ') != 3)
-		return -1;
-	errno = 0;
-	*phys_addr = strtoull(res_info.phys_addr, NULL, 16);
-	*end_addr = strtoull(res_info.end_addr, NULL, 16);
-	*flags = strtoull(res_info.flags, NULL, 16);
-	if (errno != 0)
-		return -1;
-
-	return 0;
-}
-
-/* parse the "resource" sysfs file */
-int
-ccp_pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)
-{
-	FILE *fp;
-	char buf[BUFSIZ];
-	int i;
-	uint64_t phys_addr, end_addr, flags;
-
-	fp = fopen(filename, "r");
-	if (fp == NULL)
-		return -1;
-
-	for (i = 0; i < PCI_MAX_RESOURCE; i++) {
-		if (fgets(buf, sizeof(buf), fp) == NULL)
-			goto error;
-		if (ccp_pci_parse_one_sysfs_resource(buf, sizeof(buf),
-				&phys_addr, &end_addr, &flags) < 0)
-			goto error;
-
-		if (flags & IORESOURCE_MEM) {
-			dev->mem_resource[i].phys_addr = phys_addr;
-			dev->mem_resource[i].len = end_addr - phys_addr + 1;
-			/* not mapped for now */
-			dev->mem_resource[i].addr = NULL;
-		}
-	}
-	fclose(fp);
-	return 0;
-
-error:
-	fclose(fp);
-	return -1;
-}
-
-int
-ccp_find_uio_devname(const char *dirname)
-{
-
-	DIR *dir;
-	struct dirent *e;
-	char dirname_uio[PATH_MAX];
-	unsigned int uio_num;
-	int ret = -1;
-
-	/* depending on kernel version, uio can be located in uio/uioX
-	 * or uio:uioX
-	 */
-	snprintf(dirname_uio, sizeof(dirname_uio), "%s/uio", dirname);
-	dir = opendir(dirname_uio);
-	if (dir == NULL) {
-	/* retry with the parent directory might be different kernel version*/
-		dir = opendir(dirname);
-		if (dir == NULL)
-			return -1;
-	}
-
-	/* take the first file starting with "uio" */
-	while ((e = readdir(dir)) != NULL) {
-		/* format could be uio%d ...*/
-		int shortprefix_len = sizeof("uio") - 1;
-		/* ... or uio:uio%d */
-		int longprefix_len = sizeof("uio:uio") - 1;
-		char *endptr;
-
-		if (strncmp(e->d_name, "uio", 3) != 0)
-			continue;
-
-		/* first try uio%d */
-		errno = 0;
-		uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);
-		if (errno == 0 && endptr != (e->d_name + shortprefix_len)) {
-			ret = uio_num;
-			break;
-		}
-
-		/* then try uio:uio%d */
-		errno = 0;
-		uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);
-		if (errno == 0 && endptr != (e->d_name + longprefix_len)) {
-			ret = uio_num;
-			break;
-		}
-	}
-	closedir(dir);
-	return ret;
-
-
-}
diff --git a/drivers/crypto/ccp/ccp_pci.h b/drivers/crypto/ccp/ccp_pci.h
deleted file mode 100644
index d9a8b9dcc6..0000000000
--- a/drivers/crypto/ccp/ccp_pci.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*   SPDX-License-Identifier: BSD-3-Clause
- *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
- */
-
-#ifndef _CCP_PCI_H_
-#define _CCP_PCI_H_
-
-#include <stdint.h>
-
-#include <bus_pci_driver.h>
-
-#define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
-
-int ccp_parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,
-			      uint8_t *bus, uint8_t *devid, uint8_t *function);
-
-int ccp_pci_parse_sysfs_value(const char *filename, unsigned long *val);
-
-int ccp_pci_parse_sysfs_resource(const char *filename,
-				 struct rte_pci_device *dev);
-
-int ccp_find_uio_devname(const char *dirname);
-
-#endif /* _CCP_PCI_H_ */
diff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build
index a4f3406009..a9abaa4da0 100644
--- a/drivers/crypto/ccp/meson.build
+++ b/drivers/crypto/ccp/meson.build
@@ -18,7 +18,6 @@ sources = files(
         'rte_ccp_pmd.c',
         'ccp_crypto.c',
         'ccp_dev.c',
-        'ccp_pci.c',
         'ccp_pmd_ops.c',
 )
 
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index 661a796116..a5271d7227 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -167,15 +167,9 @@ ccp_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
  * The set of PCI devices this driver supports
  */
 static struct rte_pci_id ccp_pci_id[] = {
-	{
-		RTE_PCI_DEVICE(0x1022, 0x1456), /* AMD CCP-5a */
-	},
-	{
-		RTE_PCI_DEVICE(0x1022, 0x1468), /* AMD CCP-5b */
-	},
-	{
-		RTE_PCI_DEVICE(0x1022, 0x15df), /* AMD CCP RV */
-	},
+	{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_5A), },
+	{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_5B), },
+	{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_RV), },
 	{.device_id = 0},
 };
 
@@ -228,12 +222,11 @@ cryptodev_ccp_create(const char *name,
 		goto init_error;
 	}
 
-	cryptodev_cnt = ccp_probe_devices(pci_dev, ccp_pci_id);
-
-	if (cryptodev_cnt == 0) {
+	if (ccp_probe_device(pci_dev) != 0) {
 		CCP_LOG_ERR("failed to detect CCP crypto device");
 		goto init_error;
 	}
+	cryptodev_cnt++;
 
 	CCP_LOG_DBG("CCP : Crypto device count = %d\n", cryptodev_cnt);
 	dev->device = &pci_dev->device;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.047088900 +0800
+++ 0089-crypto-ccp-fix-PCI-probing.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From e849b88fff2d3875e815a5749110241140a4512a Mon Sep 17 00:00:00 2001
+From eba4eee77bf216ac308482cc5887128b05d30773 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e849b88fff2d3875e815a5749110241140a4512a ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'crypto/qat: fix SM3 auth mode' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (88 preceding siblings ...)
  2023-04-09 15:24   ` patch 'crypto/ccp: fix PCI probing' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'crypto/openssl: fix freeing in RSA EVP' " Xueming Li
                     ` (46 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ciara Power; +Cc: Arek Kusztal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1536a7304aa84119a36a8ebd0da70cf4b726c2d2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1536a7304aa84119a36a8ebd0da70cf4b726c2d2 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Wed, 1 Mar 2023 13:59:15 +0000
Subject: [PATCH] crypto/qat: fix SM3 auth mode
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6291de627734e465e4645117dab4b7546393e20e ]

The SM3 auth mode is now set to 0, to support plain hash only.
This is also added to the capabilities for GEN3 and GEN4.
SM3 HMAC is not supported.

Fixes: 75fd4bbc94ab ("crypto/qat: support SM3 hash algorithm")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 3 +++
 drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c | 3 +++
 drivers/crypto/qat/qat_sym_session.c         | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
index 7f00f6097d..2a0ddab8af 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c
@@ -140,6 +140,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
 	QAT_SYM_CIPHER_CAP(SM4_CTR,
 		CAP_SET(block_size, 16),
 		CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 16, 16, 0)),
+	QAT_SYM_PLAIN_AUTH_CAP(SM3,
+		CAP_SET(block_size, 64),
+		CAP_RNG(digest_size, 32, 32, 0)),
 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
 
diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c
index b1e5fa9a82..b219a418ba 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c
@@ -100,6 +100,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen4[] = {
 	QAT_SYM_CIPHER_CAP(SM4_CTR,
 		CAP_SET(block_size, 16),
 		CAP_RNG(key_size, 16, 16, 0), CAP_RNG(iv_size, 16, 16, 0)),
+	QAT_SYM_PLAIN_AUTH_CAP(SM3,
+		CAP_SET(block_size, 64),
+		CAP_RNG(digest_size, 32, 32, 0)),
 	RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
 };
 
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 46a30d6539..52ed921db2 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -697,7 +697,7 @@ qat_sym_session_configure_auth(struct rte_cryptodev *dev,
 	switch (auth_xform->algo) {
 	case RTE_CRYPTO_AUTH_SM3:
 		session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_SM3;
-		session->auth_mode = ICP_QAT_HW_AUTH_MODE2;
+		session->auth_mode = ICP_QAT_HW_AUTH_MODE0;
 		break;
 	case RTE_CRYPTO_AUTH_SHA1:
 		session->qat_hash_alg = ICP_QAT_HW_AUTH_ALGO_SHA1;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.070718200 +0800
+++ 0090-crypto-qat-fix-SM3-auth-mode.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From 6291de627734e465e4645117dab4b7546393e20e Mon Sep 17 00:00:00 2001
+From 1536a7304aa84119a36a8ebd0da70cf4b726c2d2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6291de627734e465e4645117dab4b7546393e20e ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index 5fa898dc8f..6013fed721 100644
+index 7f00f6097d..2a0ddab8af 100644
@@ -25 +27 @@
-@@ -152,6 +152,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
+@@ -140,6 +140,9 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen3[] = {
@@ -50 +52 @@
-index 466482d225..6ad6c7ee3a 100644
+index 46a30d6539..52ed921db2 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'crypto/openssl: fix freeing in RSA EVP' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (89 preceding siblings ...)
  2023-04-09 15:24   ` patch 'crypto/qat: fix SM3 auth mode' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/crypto-perf: fix test file memory leak' " Xueming Li
                     ` (45 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Kai Ji; +Cc: Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/72c1da7b2d2c8b0726a34ed675658c965151508e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 72c1da7b2d2c8b0726a34ed675658c965151508e Mon Sep 17 00:00:00 2001
From: Kai Ji <kai.ji@intel.com>
Date: Wed, 8 Mar 2023 22:47:48 +0800
Subject: [PATCH] crypto/openssl: fix freeing in RSA EVP
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4de0f183506c5fecbf0486780068c044b1711daf ]

Fixed ASAN heap-use-after-free error on tmp buffer.

Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP API")

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index abcb641a44..384d262621 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -2633,7 +2633,7 @@ process_openssl_rsa_op_evp(struct rte_crypto_op *cop,
 		if (EVP_PKEY_verify_recover(rsa_ctx, tmp, &outlen,
 				op->rsa.sign.data,
 				op->rsa.sign.length) <= 0) {
-			rte_free(tmp);
+			OPENSSL_free(tmp);
 			goto err_rsa;
 		}
 
@@ -2645,7 +2645,7 @@ process_openssl_rsa_op_evp(struct rte_crypto_op *cop,
 				op->rsa.message.length)) {
 			OPENSSL_LOG(ERR, "RSA sign Verification failed");
 		}
-		rte_free(tmp);
+		OPENSSL_free(tmp);
 		break;
 
 	default:
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.096254900 +0800
+++ 0091-crypto-openssl-fix-freeing-in-RSA-EVP.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From 4de0f183506c5fecbf0486780068c044b1711daf Mon Sep 17 00:00:00 2001
+From 72c1da7b2d2c8b0726a34ed675658c965151508e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4de0f183506c5fecbf0486780068c044b1711daf ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/crypto-perf: fix test file memory leak' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (90 preceding siblings ...)
  2023-04-09 15:24   ` patch 'crypto/openssl: fix freeing in RSA EVP' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/flow-perf: fix division or module by zero' " Xueming Li
                     ` (44 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ciara Power; +Cc: Akhil Goyal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/161ef7c943bc84814a5de8c66bc5e3e163847a38

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 161ef7c943bc84814a5de8c66bc5e3e163847a38 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Fri, 10 Mar 2023 13:20:17 +0000
Subject: [PATCH] app/crypto-perf: fix test file memory leak
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 430c35730e09dea162b7830b4719285eb6f36364 ]

A memory leak was detected using the AddressSanitizer tool,
when running the crypto-perf application with a test vector file.

The strdup function used returns a pointer to a null-terminated byte
string, which must be freed after use. This patch frees the pointer in
an error case, and also after a successful run.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
---
 app/test-crypto-perf/cperf_options_parsing.c     | 1 +
 app/test-crypto-perf/cperf_test_vector_parsing.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index cb91bcc3c5..1f06e15d10 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -519,6 +519,7 @@ parse_test_file(struct cperf_options *opts,
 	if (access(opts->test_file, F_OK) != -1)
 		return 0;
 	RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n");
+	free(opts->test_file);
 
 	return -1;
 }
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 98e46c3381..737d61d4af 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -30,6 +30,7 @@ free_test_vector(struct cperf_test_vector *vector, struct cperf_options *opts)
 		rte_free(vector->cipher_key.data);
 		rte_free(vector->auth_key.data);
 		rte_free(vector->ciphertext.data);
+		free(opts->test_file);
 	}
 
 	rte_free(vector);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.120527300 +0800
+++ 0092-app-crypto-perf-fix-test-file-memory-leak.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From 430c35730e09dea162b7830b4719285eb6f36364 Mon Sep 17 00:00:00 2001
+From 161ef7c943bc84814a5de8c66bc5e3e163847a38 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 430c35730e09dea162b7830b4719285eb6f36364 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 8c9f632590..26136a52ae 100644
+index cb91bcc3c5..1f06e15d10 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/flow-perf: fix division or module by zero' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (91 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/crypto-perf: fix test file memory leak' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'examples/ipsec-secgw: fix offload variable init' " Xueming Li
                     ` (43 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Mohammad Iqbal Ahmad; +Cc: Wisam Jaddo, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/55f236de5c17c0bc591c9c647829197aa78cc61e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 55f236de5c17c0bc591c9c647829197aa78cc61e Mon Sep 17 00:00:00 2001
From: Mohammad Iqbal Ahmad <mahmad@marvell.com>
Date: Tue, 24 Jan 2023 16:08:03 +0530
Subject: [PATCH] app/flow-perf: fix division or module by zero
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 132d39dcab370b2112e0a24ab1c94036b40b9557 ]

Fix division or module by zero reported by coverity scan.

Coverity issue: 373870
Fixes: bf3688f1e816 ("app/flow-perf: add insertion rate calculation")

Signed-off-by: Mohammad Iqbal Ahmad <mahmad@marvell.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
---
 .mailmap                  | 1 +
 app/test-flow-perf/main.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index e9ecebafc1..89fdbe2542 100644
--- a/.mailmap
+++ b/.mailmap
@@ -917,6 +917,7 @@ Mitch Williams <mitch.a.williams@intel.com>
 Mit Matelske <mit@pt.net>
 Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
+Mohammad Iqbal Ahmad <mahmad@marvell.com>
 Mohammed Gamal <mgamal@redhat.com>
 Mohsin Kazmi <mohsin.kazmi14@gmail.com>
 Mohsin Mazhar Shaikh <mohsinmazhar_shaikh@trendmicro.com>
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 4a9206803a..e0ef78a840 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -848,7 +848,12 @@ args_parse(int argc, char **argv)
 			/* Control */
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-batch") == 0) {
-				rules_batch = atoi(optarg);
+				n = atoi(optarg);
+				if (n > 0)
+					rules_batch = n;
+				else
+					rte_exit(EXIT_FAILURE,
+							"flow rules-batch should be > 0\n");
 			}
 			if (strcmp(lgopts[opt_idx].name,
 					"rules-count") == 0) {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.146423000 +0800
+++ 0093-app-flow-perf-fix-division-or-module-by-zero.patch	2023-04-09 21:45:38.709042200 +0800
@@ -1 +1 @@
-From 132d39dcab370b2112e0a24ab1c94036b40b9557 Mon Sep 17 00:00:00 2001
+From 55f236de5c17c0bc591c9c647829197aa78cc61e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 132d39dcab370b2112e0a24ab1c94036b40b9557 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index aaa15deff9..4018f0fc47 100644
+index e9ecebafc1..89fdbe2542 100644
@@ -23 +25 @@
-@@ -924,6 +924,7 @@ Mitch Williams <mitch.a.williams@intel.com>
+@@ -917,6 +917,7 @@ Mitch Williams <mitch.a.williams@intel.com>

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'examples/ipsec-secgw: fix offload variable init' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (92 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/flow-perf: fix division or module by zero' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'raw/skeleton: fix selftest' " Xueming Li
                     ` (42 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Nithin Dabilpuram; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8160c206caad63df931f6ddad66186d38ff6b9a9

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8160c206caad63df931f6ddad66186d38ff6b9a9 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Fri, 3 Mar 2023 13:50:03 +0530
Subject: [PATCH] examples/ipsec-secgw: fix offload variable init
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e9a4d497a1d6c298e677159b22995fe4e9d4bfd5 ]

Fix uninitialized hw_reassembly offload variable.

Fixes: d8d51d4f9bf5 ("examples/ipsec-secgw: support per SA HW reassembly")

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 examples/ipsec-secgw/sa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c
index 001762bea9..45cd29f18b 100644
--- a/examples/ipsec-secgw/sa.c
+++ b/examples/ipsec-secgw/sa.c
@@ -1829,6 +1829,7 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads,
 
 	*rx_offloads = 0;
 	*tx_offloads = 0;
+	*hw_reassembly = 0;
 
 	ret = rte_eth_dev_info_get(port_id, &dev_info);
 	if (ret != 0)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.178372100 +0800
+++ 0094-examples-ipsec-secgw-fix-offload-variable-init.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From e9a4d497a1d6c298e677159b22995fe4e9d4bfd5 Mon Sep 17 00:00:00 2001
+From 8160c206caad63df931f6ddad66186d38ff6b9a9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e9a4d497a1d6c298e677159b22995fe4e9d4bfd5 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -17 +19 @@
-index d23bdd20f3..5f5d2685f6 100644
+index 001762bea9..45cd29f18b 100644
@@ -20 +22 @@
-@@ -1832,6 +1832,7 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads,
+@@ -1829,6 +1829,7 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'raw/skeleton: fix selftest' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (93 preceding siblings ...)
  2023-04-09 15:24   ` patch 'examples/ipsec-secgw: fix offload variable init' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'ring: silence GCC 12 warnings' " Xueming Li
                     ` (41 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: David Marchand; +Cc: Yu Jiang, Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 10 Mar 2023 15:26:03 +0100
Subject: [PATCH] raw/skeleton: fix selftest
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ]

ASan reported issues in this driver.

rte_rawdev_obj_t context object points at a uint16_t.
skeleton_rawdev_enqueue_bufs() and skeleton_rawdev_dequeue_bufs() were
incorrectly casting to an int.

The enqueue/dequeue selftest had a leak on the enqueued string and was
wrong in passing a rte_rawdev_buf pointer array.
Fix this by allocating buffers on the stack and check that returned
string is the expected one.

Bugzilla ID: 999
Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by:  Yu Jiang <yux.jiang@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c      |  4 +-
 drivers/raw/skeleton/skeleton_rawdev_test.c | 46 +++++++++------------
 2 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 53fe49f936..6e99d35536 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -428,7 +428,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		queue_buf[q_id].bufs[i] = buffers[i]->buf_addr;
@@ -450,7 +450,7 @@ static int skeleton_rawdev_dequeue_bufs(struct rte_rawdev *dev,
 	 * help in complex implementation which require more information than
 	 * just an integer - for example, a queue-pair.
 	 */
-	q_id = *((int *)context);
+	q_id = *((uint16_t *)context);
 
 	for (i = 0; i < count; i++)
 		buffers[i]->buf_addr = queue_buf[q_id].bufs[i];
diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index ca15c49990..b7a7f623aa 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -370,40 +370,34 @@ static int
 test_rawdev_enqdeq(void)
 {
 	int ret;
-	unsigned int count = 1;
 	uint16_t queue_id = 0;
-	struct rte_rawdev_buf buffers[1];
-	struct rte_rawdev_buf *deq_buffers = NULL;
-
-	buffers[0].buf_addr = malloc(strlen(TEST_DEV_NAME) + 3);
-	if (!buffers[0].buf_addr)
-		goto cleanup;
-	snprintf(buffers[0].buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d",
+	struct rte_rawdev_buf buffer;
+	struct rte_rawdev_buf *buffers[1];
+	struct rte_rawdev_buf deq_buffer;
+	struct rte_rawdev_buf *deq_buffers[1];
+
+	buffers[0] = &buffer;
+	buffer.buf_addr = malloc(strlen(TEST_DEV_NAME) + 3);
+	if (!buffer.buf_addr)
+		return TEST_FAILED;
+	snprintf(buffer.buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d",
 		 TEST_DEV_NAME, 0);
 
-	ret = rte_rawdev_enqueue_buffers(test_dev_id,
-					 (struct rte_rawdev_buf **)&buffers,
-					 count, &queue_id);
-	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count,
+	ret = rte_rawdev_enqueue_buffers(test_dev_id, buffers,
+					 RTE_DIM(buffers), &queue_id);
+	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers),
 			      "Unable to enqueue buffers");
 
-	deq_buffers = malloc(sizeof(struct rte_rawdev_buf) * count);
-	if (!deq_buffers)
-		goto cleanup;
-
-	ret = rte_rawdev_dequeue_buffers(test_dev_id,
-					(struct rte_rawdev_buf **)&deq_buffers,
-					count, &queue_id);
-	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count,
+	deq_buffers[0] = &deq_buffer;
+	ret = rte_rawdev_dequeue_buffers(test_dev_id, deq_buffers,
+					RTE_DIM(deq_buffers), &queue_id);
+	RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers),
 			      "Unable to dequeue buffers");
+	RTE_TEST_ASSERT_EQUAL(deq_buffers[0]->buf_addr, buffers[0]->buf_addr,
+			      "Did not retrieve expected object");
 
-	free(deq_buffers);
-
+	free(buffer.buf_addr);
 	return TEST_SUCCESS;
-cleanup:
-	free(buffers[0].buf_addr);
-
-	return TEST_FAILED;
 }
 
 static void skeldev_test_run(int (*setup)(void),
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.201324700 +0800
+++ 0095-raw-skeleton-fix-selftest.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From 365ec3c4fe599048c67cc79817ae9dfa090753cc Mon Sep 17 00:00:00 2001
+From ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ]
@@ -20 +22,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'ring: silence GCC 12 warnings' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (94 preceding siblings ...)
  2023-04-09 15:24   ` patch 'raw/skeleton: fix selftest' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'reorder: fix sequence number mbuf field register' " Xueming Li
                     ` (40 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Kevin Traynor; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/38369a1974fb07cc59811c1a1cce494eedac24ff

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 38369a1974fb07cc59811c1a1cce494eedac24ff Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor@redhat.com>
Date: Tue, 20 Dec 2022 10:52:17 +0000
Subject: [PATCH] ring: silence GCC 12 warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c ]

gcc 12.2.1 on Fedora 37 is giving stringop-overread and stringop-overflow
warnings when compiled with --buildtype=debug e.g. [1].

They look similar to the overflow issues previously squashed in rte_memcpy
commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings").

Squash these warnings, waiting for a cleaner fix.

[1]
lib/ring/rte_ring_elem_pvt.h:100:25: error:
	‘memcpy’ reading 32 bytes from a region of size 4
	[-Werror=stringop-overread]
100 |               memcpy((void *)(ring + idx),
    |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
101 |                       (const void *)(obj + i), 32);
    |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/ring/rte_ring_elem_pvt.h:234:25: error:
	‘memcpy’ writing 32 bytes into a region of size 4
	overflows the destination [-Werror=stringop-overflow=]
234 |               memcpy((void *)(obj + i), (void *)(ring + idx), 32);
    |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/ring/rte_ring_elem_pvt.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h
index 83788c56e6..e24e4492ff 100644
--- a/lib/ring/rte_ring_elem_pvt.h
+++ b/lib/ring/rte_ring_elem_pvt.h
@@ -10,6 +10,12 @@
 #ifndef _RTE_RING_ELEM_PVT_H_
 #define _RTE_RING_ELEM_PVT_H_
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Wstringop-overread"
+#endif
+
 static __rte_always_inline void
 __rte_ring_enqueue_elems_32(struct rte_ring *r, const uint32_t size,
 		uint32_t idx, const void *obj_table, uint32_t n)
@@ -382,4 +388,8 @@ end:
 	return n;
 }
 
+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000)
+#pragma GCC diagnostic pop
+#endif
+
 #endif /* _RTE_RING_ELEM_PVT_H_ */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.223734000 +0800
+++ 0096-ring-silence-GCC-12-warnings.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c Mon Sep 17 00:00:00 2001
+From 38369a1974fb07cc59811c1a1cce494eedac24ff Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dea4c5415506b3c1996cc56dcf15ffb5f6f1d49c ]
@@ -31,2 +33,0 @@
-
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'reorder: fix sequence number mbuf field register' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (95 preceding siblings ...)
  2023-04-09 15:24   ` patch 'ring: silence GCC 12 warnings' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'test: fix segment length in packet generator' " Xueming Li
                     ` (39 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Volodymyr Fialko; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8f35765d1584ffa0ff205236a3c4ddacf43b581e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8f35765d1584ffa0ff205236a3c4ddacf43b581e Mon Sep 17 00:00:00 2001
From: Volodymyr Fialko <vfialko@marvell.com>
Date: Mon, 13 Mar 2023 14:04:28 +0100
Subject: [PATCH] reorder: fix sequence number mbuf field register
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ec87595f4de01cb81878874d209fa03e6963b3e4 ]

It's possible to initialize reorder buffer with user allocated memory via
rte_reorder_init() function. In such case, rte_reorder_create() is not
required and reorder dynamic field in rte_mbuf will not be registered.

Both reorder lib and mbuf dynamic field are using `rte_mcfg_tailq`
read/write lock for synchronization. To avoid deadlocking, move reorder
buffer initialization before queue insertion.

Fixes: 01f3496695b5 ("reorder: switch sequence number to dynamic mbuf field")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 lib/reorder/rte_reorder.c | 95 +++++++++++++++++++++++++--------------
 lib/reorder/rte_reorder.h |  1 +
 2 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index b38e71f460..bc85b83b14 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -60,6 +60,11 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 {
 	const unsigned int min_bufsize = sizeof(*b) +
 					(2 * size * sizeof(struct rte_mbuf *));
+	static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
+		.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
+		.size = sizeof(rte_reorder_seqn_t),
+		.align = __alignof__(rte_reorder_seqn_t),
+	};
 
 	if (b == NULL) {
 		RTE_LOG(ERR, REORDER, "Invalid reorder buffer parameter:"
@@ -86,6 +91,15 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 		return NULL;
 	}
 
+	rte_reorder_seqn_dynfield_offset = rte_mbuf_dynfield_register(&reorder_seqn_dynfield_desc);
+	if (rte_reorder_seqn_dynfield_offset < 0) {
+		RTE_LOG(ERR, REORDER,
+			"Failed to register mbuf field for reorder sequence number, rte_errno: %i\n",
+			rte_errno);
+		rte_errno = ENOMEM;
+		return NULL;
+	}
+
 	memset(b, 0, bufsize);
 	strlcpy(b->name, name, sizeof(b->name));
 	b->memsize = bufsize;
@@ -98,21 +112,45 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
 	return b;
 }
 
+/*
+ * Insert new entry into global list.
+ * Returns pointer to already inserted entry if such exists, or to newly inserted one.
+ */
+static struct rte_tailq_entry *
+rte_reorder_entry_insert(struct rte_tailq_entry *new_te)
+{
+	struct rte_reorder_list *reorder_list;
+	struct rte_reorder_buffer *b, *nb;
+	struct rte_tailq_entry *te;
+
+	rte_mcfg_tailq_write_lock();
+
+	reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list);
+	/* guarantee there's no existing */
+	TAILQ_FOREACH(te, reorder_list, next) {
+		b = (struct rte_reorder_buffer *) te->data;
+		nb = (struct rte_reorder_buffer *) new_te->data;
+		if (strncmp(nb->name, b->name, RTE_REORDER_NAMESIZE) == 0)
+			break;
+	}
+
+	if (te == NULL) {
+		TAILQ_INSERT_TAIL(reorder_list, new_te, next);
+		te = new_te;
+	}
+
+	rte_mcfg_tailq_write_unlock();
+
+	return te;
+}
+
 struct rte_reorder_buffer*
 rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 {
 	struct rte_reorder_buffer *b = NULL;
-	struct rte_tailq_entry *te;
-	struct rte_reorder_list *reorder_list;
+	struct rte_tailq_entry *te, *te_inserted;
 	const unsigned int bufsize = sizeof(struct rte_reorder_buffer) +
 					(2 * size * sizeof(struct rte_mbuf *));
-	static const struct rte_mbuf_dynfield reorder_seqn_dynfield_desc = {
-		.name = RTE_REORDER_SEQN_DYNFIELD_NAME,
-		.size = sizeof(rte_reorder_seqn_t),
-		.align = __alignof__(rte_reorder_seqn_t),
-	};
-
-	reorder_list = RTE_TAILQ_CAST(rte_reorder_tailq.head, rte_reorder_list);
 
 	/* Check user arguments. */
 	if (!rte_is_power_of_2(size)) {
@@ -128,32 +166,12 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 		return NULL;
 	}
 
-	rte_reorder_seqn_dynfield_offset =
-		rte_mbuf_dynfield_register(&reorder_seqn_dynfield_desc);
-	if (rte_reorder_seqn_dynfield_offset < 0) {
-		RTE_LOG(ERR, REORDER, "Failed to register mbuf field for reorder sequence number\n");
-		rte_errno = ENOMEM;
-		return NULL;
-	}
-
-	rte_mcfg_tailq_write_lock();
-
-	/* guarantee there's no existing */
-	TAILQ_FOREACH(te, reorder_list, next) {
-		b = (struct rte_reorder_buffer *) te->data;
-		if (strncmp(name, b->name, RTE_REORDER_NAMESIZE) == 0)
-			break;
-	}
-	if (te != NULL)
-		goto exit;
-
 	/* allocate tailq entry */
 	te = rte_zmalloc("REORDER_TAILQ_ENTRY", sizeof(*te), 0);
 	if (te == NULL) {
 		RTE_LOG(ERR, REORDER, "Failed to allocate tailq entry\n");
 		rte_errno = ENOMEM;
-		b = NULL;
-		goto exit;
+		return NULL;
 	}
 
 	/* Allocate memory to store the reorder buffer structure. */
@@ -162,14 +180,23 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
 		RTE_LOG(ERR, REORDER, "Memzone allocation failed\n");
 		rte_errno = ENOMEM;
 		rte_free(te);
+		return NULL;
 	} else {
-		rte_reorder_init(b, bufsize, name, size);
+		if (rte_reorder_init(b, bufsize, name, size) == NULL) {
+			rte_free(b);
+			rte_free(te);
+			return NULL;
+		}
 		te->data = (void *)b;
-		TAILQ_INSERT_TAIL(reorder_list, te, next);
 	}
 
-exit:
-	rte_mcfg_tailq_write_unlock();
+	te_inserted = rte_reorder_entry_insert(te);
+	if (te_inserted != te) {
+		rte_free(b);
+		rte_free(te);
+		return te_inserted->data;
+	}
+
 	return b;
 }
 
diff --git a/lib/reorder/rte_reorder.h b/lib/reorder/rte_reorder.h
index 5abdb258e2..79c758f450 100644
--- a/lib/reorder/rte_reorder.h
+++ b/lib/reorder/rte_reorder.h
@@ -82,6 +82,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size);
  *   The initialized reorder buffer instance, or NULL on error
  *   On error case, rte_errno will be set appropriately:
  *    - EINVAL - invalid parameters
+ *    - ENOMEM - not enough memory to register dynamic field
  */
 struct rte_reorder_buffer *
 rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.247133500 +0800
+++ 0097-reorder-fix-sequence-number-mbuf-field-register.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From ec87595f4de01cb81878874d209fa03e6963b3e4 Mon Sep 17 00:00:00 2001
+From 8f35765d1584ffa0ff205236a3c4ddacf43b581e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ec87595f4de01cb81878874d209fa03e6963b3e4 ]
@@ -15 +17,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 9026403ea6..4bf36f6df6 100644
+index b38e71f460..bc85b83b14 100644
@@ -27 +29 @@
-@@ -61,6 +61,11 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
+@@ -60,6 +60,11 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
@@ -39 +41 @@
-@@ -87,6 +92,15 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
+@@ -86,6 +91,15 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
@@ -55 +57 @@
-@@ -99,21 +113,45 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
+@@ -98,21 +112,45 @@ rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
@@ -110 +112 @@
-@@ -129,32 +167,12 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
+@@ -128,32 +166,12 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
@@ -144 +146 @@
-@@ -163,14 +181,23 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
+@@ -162,14 +180,23 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
@@ -173 +175 @@
-index 7ed5f66a2e..f1207f72a9 100644
+index 5abdb258e2..79c758f450 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test: fix segment length in packet generator' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (96 preceding siblings ...)
  2023-04-09 15:24   ` patch 'reorder: fix sequence number mbuf field register' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'test/mbuf: fix test with mbuf debug enabled' " Xueming Li
                     ` (38 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Zhuobin Huang; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b Mon Sep 17 00:00:00 2001
From: Zhuobin Huang <zobin1999@gmail.com>
Date: Mon, 6 Mar 2023 14:51:56 +0800
Subject: [PATCH] test: fix segment length in packet generator
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]

Assign correct data length to each segments according to the given
pkt_len and nb_pkt_segs, instead of using pkt_len as the data_len
of every packet segment.

Fixes: a9c9e9698d5e ("app/test: allow to create packets of different sizes")

Signed-off-by: Zhuobin Huang <zobin1999@gmail.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 .mailmap                          |  1 +
 app/test/packet_burst_generator.c | 26 ++++++++++++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/.mailmap b/.mailmap
index 89fdbe2542..da2ce216a3 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1573,6 +1573,7 @@ Zhipeng Lu <luzhipeng@cestc.cn>
 Zhirun Yan <zhirun.yan@intel.com>
 Zhiwei He <zhiwei.he@intel.com>
 Zhiyong Yang <zhiyong.yang@intel.com>
+Zhuobin Huang <zobin1999@gmail.com>
 Zi Hu <huzilucky@gmail.com>
 Zijie Pan <zijie.pan@6wind.com>
 Ziyang Xuan <xuanziyang2@huawei.com>
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 6b42b9b83b..867a88da00 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -263,11 +263,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
 		void *ip_hdr, uint8_t ipv4, struct rte_udp_hdr *udp_hdr,
 		int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
 {
-	int i, nb_pkt = 0;
-	size_t eth_hdr_size;
-
+	const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
 	struct rte_mbuf *pkt_seg;
 	struct rte_mbuf *pkt;
+	size_t eth_hdr_size;
+	int i, nb_pkt = 0;
 
 	for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
 		pkt = rte_pktmbuf_alloc(mp);
@@ -278,7 +278,7 @@ nomore_mbuf:
 			break;
 		}
 
-		pkt->data_len = pkt_len;
+		pkt->data_len = pkt_seg_data_len;
 		pkt_seg = pkt;
 		for (i = 1; i < nb_pkt_segs; i++) {
 			pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -288,7 +288,10 @@ nomore_mbuf:
 				goto nomore_mbuf;
 			}
 			pkt_seg = pkt_seg->next;
-			pkt_seg->data_len = pkt_len;
+			if (i != nb_pkt_segs - 1)
+				pkt_seg->data_len = pkt_seg_data_len;
+			else
+				pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
 		}
 		pkt_seg->next = NULL; /* Last segment of packet. */
 
@@ -344,11 +347,11 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 		uint8_t ipv4, uint8_t proto, void *proto_hdr,
 		int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
 {
-	int i, nb_pkt = 0;
-	size_t eth_hdr_size;
-
+	const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs;
 	struct rte_mbuf *pkt_seg;
 	struct rte_mbuf *pkt;
+	size_t eth_hdr_size;
+	int i, nb_pkt = 0;
 
 	for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) {
 		pkt = rte_pktmbuf_alloc(mp);
@@ -359,7 +362,7 @@ nomore_mbuf:
 			break;
 		}
 
-		pkt->data_len = pkt_len;
+		pkt->data_len = pkt_seg_data_len;
 		pkt_seg = pkt;
 		for (i = 1; i < nb_pkt_segs; i++) {
 			pkt_seg->next = rte_pktmbuf_alloc(mp);
@@ -369,7 +372,10 @@ nomore_mbuf:
 				goto nomore_mbuf;
 			}
 			pkt_seg = pkt_seg->next;
-			pkt_seg->data_len = pkt_len;
+			if (i != nb_pkt_segs - 1)
+				pkt_seg->data_len = pkt_seg_data_len;
+			else
+				pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs;
 		}
 		pkt_seg->next = NULL; /* Last segment of packet. */
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.270341800 +0800
+++ 0098-test-fix-segment-length-in-packet-generator.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From b88b8af25e7cbb267584bd4c36d3615c4b20109f Mon Sep 17 00:00:00 2001
+From 64f4cb8bcee5e0cf9db41ff606270c4fa97dff6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ]
@@ -20 +23 @@
-index 4018f0fc47..6a56239c3a 100644
+index 89fdbe2542..da2ce216a3 100644
@@ -23 +26 @@
-@@ -1584,6 +1584,7 @@ Zhipeng Lu <luzhipeng@cestc.cn>
+@@ -1573,6 +1573,7 @@ Zhipeng Lu <luzhipeng@cestc.cn>

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test/mbuf: fix test with mbuf debug enabled' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (97 preceding siblings ...)
  2023-04-09 15:24   ` patch 'test: fix segment length in packet generator' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'eal/unix: fix thread creation' " Xueming Li
                     ` (37 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Pavel Ivashchenko; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/29cdc2b88f04b2c459705a24274de32d53001fcf

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 29cdc2b88f04b2c459705a24274de32d53001fcf Mon Sep 17 00:00:00 2001
From: Pavel Ivashchenko <pivashchenko@nfware.com>
Date: Thu, 16 Mar 2023 22:14:56 +0300
Subject: [PATCH] test/mbuf: fix test with mbuf debug enabled
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ce5440e0350df101443aa4d0e96bea0a06ef9364 ]

How to reproduce:

1. Define RTE_LIBRTE_MBUF_DEBUG
2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args
	obj-x86_64-linux-gnu/app/test/dpdk-test
	--file-prefix=mbuf_autotest

   PANIC in rte_mbuf_sanity_check():
   bad pkt_len

   ...
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check
	(m=m@entry=0x17f8c3400, is_header=is_header@entry=1)
	at ../lib/mbuf/rte_mbuf.c:384
   #7  0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400)
	at ../lib/mbuf/rte_mbuf.h:1385
   #8  0x000055555565c7a6 in test_nb_segs_and_next_reset ()
	at ../app/test/test_mbuf.c:2752
   #9  test_mbuf () at ../app/test/test_mbuf.c:2967
   ...

   (gdb) frame 6
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check
	(m=m@entry=0x17f8c3400, is_header=is_header@entry=1)
	at ../lib/mbuf/rte_mbuf.c:384
   384			rte_panic("%s\n", reason);
   (gdb) p/d m->pkt_len
   $4 = 1500

Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 6cbb03b0af..1f4dd62466 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
 
 	/* split m0 chain in two, between m1 and m2 */
 	m0->nb_segs = 2;
+	m0->pkt_len -= m2->data_len;
 	m1->next = NULL;
 	m2->nb_segs = 1;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.296890800 +0800
+++ 0099-test-mbuf-fix-test-with-mbuf-debug-enabled.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From ce5440e0350df101443aa4d0e96bea0a06ef9364 Mon Sep 17 00:00:00 2001
+From 29cdc2b88f04b2c459705a24274de32d53001fcf Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ce5440e0350df101443aa4d0e96bea0a06ef9364 ]
@@ -36 +38,0 @@
-Cc: stable@dpdk.org
@@ -45 +47 @@
-index 81a6632d11..8d8d3b9386 100644
+index 6cbb03b0af..1f4dd62466 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'eal/unix: fix thread creation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (98 preceding siblings ...)
  2023-04-09 15:24   ` patch 'test/mbuf: fix test with mbuf debug enabled' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'gpudev: export header file for external drivers' " Xueming Li
                     ` (36 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Tyler Retzlaff; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/db12268a953bbacdb8b518cb1138ed6b79d38491

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From db12268a953bbacdb8b518cb1138ed6b79d38491 Mon Sep 17 00:00:00 2001
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
Date: Wed, 15 Mar 2023 17:07:04 -0700
Subject: [PATCH] eal/unix: fix thread creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b28c6196b132d1f25cb8c1bf781520fc41556b3a ]

In rte_thread_create setting affinity after pthread_create may fail.
Such a failure should result in the entire rte_thread_create failing
but doesn't.

Additionally if there is a failure to set affinity a race exists where
the creating thread will free ctx and depending on scheduling of the new
thread it may also free ctx (double free).

Resolve the above by setting the affinity from the newly created thread
using a condition variable to signal the completion of the thread
start wrapper having completed.

Since we are now waiting for the thread start wrapper to complete we can
allocate the thread start wrapper context on the stack. While here clean
up the variable naming in the context to better highlight the fields of
the context require synchronization between the creating and created
thread.

Fixes: ce6e911d20f6 ("eal: add thread lifetime API")

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/unix/rte_thread.c | 73 ++++++++++++++++++++++++---------------
 1 file changed, 45 insertions(+), 28 deletions(-)

diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index 37ebfcfca1..f4076122a4 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -5,6 +5,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -16,9 +17,14 @@ struct eal_tls_key {
 	pthread_key_t thread_index;
 };
 
-struct thread_routine_ctx {
+struct thread_start_context {
 	rte_thread_func thread_func;
-	void *routine_args;
+	void *thread_args;
+	const rte_thread_attr_t *thread_attr;
+	pthread_mutex_t wrapper_mutex;
+	pthread_cond_t wrapper_cond;
+	int wrapper_ret;
+	bool wrapper_done;
 };
 
 static int
@@ -81,13 +87,29 @@ thread_map_os_priority_to_eal_priority(int policy, int os_pri,
 }
 
 static void *
-thread_func_wrapper(void *arg)
+thread_start_wrapper(void *arg)
 {
-	struct thread_routine_ctx ctx = *(struct thread_routine_ctx *)arg;
+	struct thread_start_context *ctx = (struct thread_start_context *)arg;
+	rte_thread_func thread_func = ctx->thread_func;
+	void *thread_args = ctx->thread_args;
+	int ret = 0;
+
+	if (ctx->thread_attr != NULL && CPU_COUNT(&ctx->thread_attr->cpuset) > 0) {
+		ret = rte_thread_set_affinity_by_id(rte_thread_self(), &ctx->thread_attr->cpuset);
+		if (ret != 0)
+			RTE_LOG(DEBUG, EAL, "rte_thread_set_affinity_by_id failed\n");
+	}
 
-	free(arg);
+	pthread_mutex_lock(&ctx->wrapper_mutex);
+	ctx->wrapper_ret = ret;
+	ctx->wrapper_done = true;
+	pthread_cond_signal(&ctx->wrapper_cond);
+	pthread_mutex_unlock(&ctx->wrapper_mutex);
 
-	return (void *)(uintptr_t)ctx.thread_func(ctx.routine_args);
+	if (ret != 0)
+		return NULL;
+
+	return (void *)(uintptr_t)thread_func(thread_args);
 }
 
 int
@@ -98,20 +120,18 @@ rte_thread_create(rte_thread_t *thread_id,
 	int ret = 0;
 	pthread_attr_t attr;
 	pthread_attr_t *attrp = NULL;
-	struct thread_routine_ctx *ctx;
 	struct sched_param param = {
 		.sched_priority = 0,
 	};
 	int policy = SCHED_OTHER;
-
-	ctx = calloc(1, sizeof(*ctx));
-	if (ctx == NULL) {
-		RTE_LOG(DEBUG, EAL, "Insufficient memory for thread context allocations\n");
-		ret = ENOMEM;
-		goto cleanup;
-	}
-	ctx->routine_args = args;
-	ctx->thread_func = thread_func;
+	struct thread_start_context ctx = {
+		.thread_func = thread_func,
+		.thread_args = args,
+		.thread_attr = thread_attr,
+		.wrapper_done = false,
+		.wrapper_mutex = PTHREAD_MUTEX_INITIALIZER,
+		.wrapper_cond = PTHREAD_COND_INITIALIZER,
+	};
 
 	if (thread_attr != NULL) {
 		ret = pthread_attr_init(&attr);
@@ -133,7 +153,6 @@ rte_thread_create(rte_thread_t *thread_id,
 			goto cleanup;
 		}
 
-
 		if (thread_attr->priority ==
 				RTE_THREAD_PRIORITY_REALTIME_CRITICAL) {
 			ret = ENOTSUP;
@@ -158,24 +177,22 @@ rte_thread_create(rte_thread_t *thread_id,
 	}
 
 	ret = pthread_create((pthread_t *)&thread_id->opaque_id, attrp,
-		thread_func_wrapper, ctx);
+		thread_start_wrapper, &ctx);
 	if (ret != 0) {
 		RTE_LOG(DEBUG, EAL, "pthread_create failed\n");
 		goto cleanup;
 	}
 
-	if (thread_attr != NULL && CPU_COUNT(&thread_attr->cpuset) > 0) {
-		ret = rte_thread_set_affinity_by_id(*thread_id,
-			&thread_attr->cpuset);
-		if (ret != 0) {
-			RTE_LOG(DEBUG, EAL, "rte_thread_set_affinity_by_id failed\n");
-			goto cleanup;
-		}
-	}
+	pthread_mutex_lock(&ctx.wrapper_mutex);
+	while (!ctx.wrapper_done)
+		pthread_cond_wait(&ctx.wrapper_cond, &ctx.wrapper_mutex);
+	ret = ctx.wrapper_ret;
+	pthread_mutex_unlock(&ctx.wrapper_mutex);
+
+	if (ret != 0)
+		pthread_join((pthread_t)thread_id->opaque_id, NULL);
 
-	ctx = NULL;
 cleanup:
-	free(ctx);
 	if (attrp != NULL)
 		pthread_attr_destroy(&attr);
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.320353400 +0800
+++ 0100-eal-unix-fix-thread-creation.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From b28c6196b132d1f25cb8c1bf781520fc41556b3a Mon Sep 17 00:00:00 2001
+From db12268a953bbacdb8b518cb1138ed6b79d38491 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b28c6196b132d1f25cb8c1bf781520fc41556b3a ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'gpudev: export header file for external drivers' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (99 preceding siblings ...)
  2023-04-09 15:24   ` patch 'eal/unix: fix thread creation' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/testpmd: fix interactive mode on Windows' " Xueming Li
                     ` (35 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: David Marchand, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ef700bf7d0b6e90ff72138536ba1703b76905a5e

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ef700bf7d0b6e90ff72138536ba1703b76905a5e Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Thu, 16 Mar 2023 09:59:19 +0100
Subject: [PATCH] gpudev: export header file for external drivers
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 5dd7c0d6956b5c016f48ec62e8c2e81f2a82e10d ]

In DPDK 21.05, the option driver_sdk_headers was introduced
to export required headers to allow building out-of-tree drivers.

In DPDK 21.11, the gpudev driver class was introduced,
without this out-of-tree compatibility.

It is fixed by exporting gpudev_driver.h as part of the driver SDK.

As a consequence of exporting this header file,
C++ "extern C" guard must be added.

Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/gpudev/gpudev_driver.h | 8 ++++++++
 lib/gpudev/meson.build     | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index d5e2c8e1ef..42898c7c8b 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -19,6 +19,10 @@
 #include <rte_compat.h>
 #include "rte_gpudev.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Flags indicate current state of device. */
 enum rte_gpu_state {
 	RTE_GPU_STATE_UNUSED,        /* not initialized */
@@ -106,4 +110,8 @@ int rte_gpu_release(struct rte_gpu *dev);
 __rte_internal
 void rte_gpu_notify(struct rte_gpu *dev, enum rte_gpu_event);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_GPUDEV_DRIVER_H */
diff --git a/lib/gpudev/meson.build b/lib/gpudev/meson.build
index 89a118f357..d21fadc052 100644
--- a/lib/gpudev/meson.build
+++ b/lib/gpudev/meson.build
@@ -5,6 +5,10 @@ headers = files(
         'rte_gpudev.h',
 )
 
+driver_sdk_headers = files(
+        'gpudev_driver.h',
+)
+
 sources = files(
         'gpudev.c',
 )
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.345353300 +0800
+++ 0101-gpudev-export-header-file-for-external-drivers.patch	2023-04-09 21:45:38.719042200 +0800
@@ -1 +1 @@
-From 5dd7c0d6956b5c016f48ec62e8c2e81f2a82e10d Mon Sep 17 00:00:00 2001
+From ef700bf7d0b6e90ff72138536ba1703b76905a5e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 5dd7c0d6956b5c016f48ec62e8c2e81f2a82e10d ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/testpmd: fix interactive mode on Windows' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (100 preceding siblings ...)
  2023-04-09 15:24   ` patch 'gpudev: export header file for external drivers' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'test/crypto: fix ZUC digest length in comparison' " Xueming Li
                     ` (34 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Olivier Matz, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/7d3df2701dc90f8f3c4e7f249a368ab684f27bf4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7d3df2701dc90f8f3c4e7f249a368ab684f27bf4 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 17 Mar 2023 09:59:41 -0700
Subject: [PATCH] app/testpmd: fix interactive mode on Windows
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f1d0993e034e39968a2c80a8561b46c260c27487 ]

The cmdline_poll() function is broken and was not fully tested,
go back to using cmdline_interact().

Instead, use sigaction() to cancel read character on Unix OS's
and a new helper to cancel I/O on Windows.

Bugzilla ID: 1180
Fixes: 0fd1386c30c3 ("app/testpmd: cleanup cleanly from signal")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 app/test-pmd/cmdline.c           | 26 +++++++++++++-------------
 app/test-pmd/testpmd.c           | 11 +++++++++++
 lib/cmdline/cmdline.c            |  1 +
 lib/cmdline/cmdline_os_unix.c    |  6 ++++++
 lib/cmdline/cmdline_os_windows.c | 14 ++++++++++++++
 lib/cmdline/cmdline_private.h    |  5 ++++-
 6 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bd31e16e0f..07432f3e57 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -65,6 +65,7 @@
 #include "cmdline_tm.h"
 #include "bpf_cmd.h"
 
+static struct cmdline *testpmd_cl;
 static cmdline_parse_ctx_t *main_ctx;
 static TAILQ_HEAD(, testpmd_driver_commands) driver_commands_head =
 	TAILQ_HEAD_INITIALIZER(driver_commands_head);
@@ -12916,26 +12917,25 @@ cmdline_read_from_file(const char *filename)
 	printf("Read CLI commands from %s\n", filename);
 }
 
+void
+prompt_exit(void)
+{
+	cmdline_quit(testpmd_cl);
+}
+
 /* prompt function, called from main on MAIN lcore */
 void
 prompt(void)
 {
-	struct cmdline *cl;
-
-	cl = cmdline_stdin_new(main_ctx, "testpmd> ");
-	if (cl == NULL)
+	testpmd_cl = cmdline_stdin_new(main_ctx, "testpmd> ");
+	if (testpmd_cl == NULL) {
+		fprintf(stderr,
+			"Failed to create stdin based cmdline context\n");
 		return;
-
-	/* loop until signal or quit command */
-	while (f_quit == 0 && cl_quit == 0) {
-		int status = cmdline_poll(cl);
-
-		if (status < 0 || status == RDLINE_EXITED)
-			break;
 	}
 
-	cmdline_quit(cl);
-	cmdline_stdin_exit(cl);
+	cmdline_interact(testpmd_cl);
+	cmdline_stdin_exit(testpmd_cl);
 }
 
 void
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 1b54698bf6..b69b248e47 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4414,6 +4414,7 @@ static void
 signal_handler(int signum __rte_unused)
 {
 	f_quit = 1;
+	prompt_exit();
 }
 
 int
@@ -4424,8 +4425,18 @@ main(int argc, char** argv)
 	uint16_t count;
 	int ret;
 
+#ifdef RTE_EXEC_ENV_WINDOWS
 	signal(SIGINT, signal_handler);
 	signal(SIGTERM, signal_handler);
+#else
+	/* Want read() not to be restarted on signal */
+	struct sigaction action = {
+		.sa_handler = signal_handler,
+	};
+
+	sigaction(SIGINT, &action, NULL);
+	sigaction(SIGTERM, &action, NULL);
+#endif
 
 	testpmd_logtype = rte_log_register("testpmd");
 	if (testpmd_logtype < 0)
diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
index 8ad0690d85..355c7d8ca6 100644
--- a/lib/cmdline/cmdline.c
+++ b/lib/cmdline/cmdline.c
@@ -173,6 +173,7 @@ cmdline_quit(struct cmdline *cl)
 {
 	if (!cl)
 		return;
+	cmdline_cancel(cl);
 	rdline_quit(&cl->rdl);
 }
 
diff --git a/lib/cmdline/cmdline_os_unix.c b/lib/cmdline/cmdline_os_unix.c
index 64a945a34f..9a4ec4e334 100644
--- a/lib/cmdline/cmdline_os_unix.c
+++ b/lib/cmdline/cmdline_os_unix.c
@@ -51,3 +51,9 @@ cmdline_vdprintf(int fd, const char *format, va_list op)
 {
 	return vdprintf(fd, format, op);
 }
+
+/* This function is not needed on Linux, instead use sigaction() */
+void
+cmdline_cancel(__rte_unused struct cmdline *cl)
+{
+}
diff --git a/lib/cmdline/cmdline_os_windows.c b/lib/cmdline/cmdline_os_windows.c
index 73ed9ba290..80863bfc8a 100644
--- a/lib/cmdline/cmdline_os_windows.c
+++ b/lib/cmdline/cmdline_os_windows.c
@@ -203,3 +203,17 @@ cmdline_vdprintf(int fd, const char *format, va_list op)
 
 	return ret;
 }
+
+void
+cmdline_cancel(struct cmdline *cl)
+{
+	if (!cl)
+		return;
+
+	/* force the outstanding read on console to exit */
+	if (cl->oldterm.is_console_input) {
+		HANDLE handle = (HANDLE)_get_osfhandle(cl->s_in);
+
+		CancelIoEx(handle, NULL);
+	}
+}
diff --git a/lib/cmdline/cmdline_private.h b/lib/cmdline/cmdline_private.h
index a3271c7693..86a46cdea6 100644
--- a/lib/cmdline/cmdline_private.h
+++ b/lib/cmdline/cmdline_private.h
@@ -24,7 +24,7 @@
 #define RDLINE_HISTORY_MAX_LINE 64
 
 struct rdline {
-	enum rdline_status status;
+	volatile enum rdline_status status;
 	/* rdline bufs */
 	struct cirbuf left;
 	struct cirbuf right;
@@ -90,6 +90,9 @@ int cmdline_poll_char(struct cmdline *cl);
 /* Read one character from input. */
 ssize_t cmdline_read_char(struct cmdline *cl, char *c);
 
+/* Force current cmdline read to unblock. */
+void cmdline_cancel(struct cmdline *cl);
+
 /* vdprintf(3) */
 __rte_format_printf(2, 0)
 int cmdline_vdprintf(int fd, const char *format, va_list op);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.369691600 +0800
+++ 0102-app-testpmd-fix-interactive-mode-on-Windows.patch	2023-04-09 21:45:38.729042200 +0800
@@ -1 +1 @@
-From f1d0993e034e39968a2c80a8561b46c260c27487 Mon Sep 17 00:00:00 2001
+From 7d3df2701dc90f8f3c4e7f249a368ab684f27bf4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f1d0993e034e39968a2c80a8561b46c260c27487 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -28 +30 @@
-index 6fa870dc32..7b20bef4e9 100644
+index bd31e16e0f..07432f3e57 100644
@@ -31 +33 @@
-@@ -66,6 +66,7 @@
+@@ -65,6 +65,7 @@
@@ -39 +41 @@
-@@ -13028,26 +13029,25 @@ cmdline_read_from_file(const char *filename)
+@@ -12916,26 +12917,25 @@ cmdline_read_from_file(const char *filename)
@@ -79 +81 @@
-index 2ce19ed47a..5cb6f92523 100644
+index 1b54698bf6..b69b248e47 100644
@@ -82 +84 @@
-@@ -4469,6 +4469,7 @@ static void
+@@ -4414,6 +4414,7 @@ static void
@@ -90 +92 @@
-@@ -4479,8 +4480,18 @@ main(int argc, char** argv)
+@@ -4424,8 +4425,18 @@ main(int argc, char** argv)

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test/crypto: fix ZUC digest length in comparison' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (101 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/testpmd: fix interactive mode on Windows' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'test/crypto: fix capability check for ZUC cipher-auth' " Xueming Li
                     ` (33 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ciara Power; +Cc: Brian Dooley, Tejasree Kondoj, Pablo de Lara, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/0217458d5e793eb62f8e32ae700b639dd954c39c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0217458d5e793eb62f8e32ae700b639dd954c39c Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Fri, 3 Mar 2023 09:38:18 +0000
Subject: [PATCH] test/crypto: fix ZUC digest length in comparison
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dc3042ba468196c6f51777b7d41596618b2e47f4 ]

The digest length used in ZUC tests for verifying the digest was
hardcoded at 4 bytes, which was suitable for ZUC-128 only.
Now that ZUC256 is supported by these test functions,
the digest length can vary.

Using the test vector digest length directly in these
comparisons allows for variable digest length.

Fixes: 83397b9f0739 ("test/crypto: add further ZUC test cases")
Fixes: fa5bf9345d4e ("test/crypto: add ZUC cases with 256-bit keys")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test/test_cryptodev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index d6ae762df9..a216e9ff58 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -4853,7 +4853,7 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			4,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	return 0;
 }
@@ -6415,7 +6415,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			ut_params->digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
@@ -6622,7 +6622,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 			digest,
 			tdata->digest.data,
-			DIGEST_BYTE_LENGTH_KASUMI_F9,
+			tdata->digest.len,
 			"ZUC Generated auth tag not as expected");
 	}
 	return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.404623800 +0800
+++ 0103-test-crypto-fix-ZUC-digest-length-in-comparison.patch	2023-04-09 21:45:38.739042200 +0800
@@ -1 +1 @@
-From dc3042ba468196c6f51777b7d41596618b2e47f4 Mon Sep 17 00:00:00 2001
+From 0217458d5e793eb62f8e32ae700b639dd954c39c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dc3042ba468196c6f51777b7d41596618b2e47f4 ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -27 +29 @@
-index 9b18883547..dea0788b4e 100644
+index d6ae762df9..a216e9ff58 100644
@@ -39 +41 @@
-@@ -6499,7 +6499,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
+@@ -6415,7 +6415,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,
@@ -48 +50 @@
-@@ -6706,7 +6706,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
+@@ -6622,7 +6622,7 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test/crypto: fix capability check for ZUC cipher-auth' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (102 preceding siblings ...)
  2023-04-09 15:24   ` patch 'test/crypto: fix ZUC digest length in comparison' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'test/crypto: fix skip condition for CPU crypto SGL' " Xueming Li
                     ` (32 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ciara Power; +Cc: Brian Dooley, Tejasree Kondoj, Pablo de Lara, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/58dff4134c497c31e255ee5bf79ba15b3b97ba82

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 58dff4134c497c31e255ee5bf79ba15b3b97ba82 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Fri, 3 Mar 2023 09:38:20 +0000
Subject: [PATCH] test/crypto: fix capability check for ZUC cipher-auth
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit dd4d13779d63475aa13d2b9f9de06db145e39c78 ]

The cipher-auth test function for ZUC was not using the improved cipher
and auth capability check functions. This meant the required key and IV
lengths were not being checked, leading to problems with ZUC-256 tests
running, and failing, on devices that only support ZUC-128.

Fixes: 27b787132484 ("test/crypto: check cipher parameters")
Fixes: f93fce6de4aa ("test/crypto: check auth parameters")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test/test_cryptodev.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index a216e9ff58..6b09b2ab56 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -136,6 +136,17 @@ security_proto_supported(enum rte_security_session_action_type action,
 static int
 dev_configure_and_start(uint64_t ff_disable);
 
+static int
+check_cipher_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_cipher_algorithm cipher_algo,
+			const uint16_t key_size, const uint16_t iv_size);
+
+static int
+check_auth_capability(const struct crypto_testsuite_params *ts_params,
+			const enum rte_crypto_auth_algorithm auth_algo,
+			const uint16_t key_size, const uint16_t iv_size,
+			const uint16_t tag_size);
+
 static struct rte_mbuf *
 setup_test_string(struct rte_mempool *mpool,
 		const char *string, size_t len, uint8_t blocksize)
@@ -4761,7 +4772,6 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 	unsigned int plaintext_len;
 
 	struct rte_cryptodev_info dev_info;
-	struct rte_cryptodev_sym_capability_idx cap_idx;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -4783,19 +4793,14 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EEA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-	cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_cipher_capability(ts_params, RTE_CRYPTO_CIPHER_ZUC_EEA3,
+			tdata->key.len, tdata->cipher_iv.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Check if device supports ZUC EIA3 */
-	cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
-	cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
-
-	if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
-			&cap_idx) == NULL)
+	if (check_auth_capability(ts_params, RTE_CRYPTO_AUTH_ZUC_EIA3,
+			tdata->key.len, tdata->auth_iv.len,
+			tdata->digest.len) < 0)
 		return TEST_SKIPPED;
 
 	/* Create ZUC session */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.437880200 +0800
+++ 0104-test-crypto-fix-capability-check-for-ZUC-cipher-auth.patch	2023-04-09 21:45:38.749042200 +0800
@@ -1 +1 @@
-From dd4d13779d63475aa13d2b9f9de06db145e39c78 Mon Sep 17 00:00:00 2001
+From 58dff4134c497c31e255ee5bf79ba15b3b97ba82 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit dd4d13779d63475aa13d2b9f9de06db145e39c78 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -24 +26 @@
-index 9447777224..26ae382ad4 100644
+index a216e9ff58..6b09b2ab56 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test/crypto: fix skip condition for CPU crypto SGL' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (103 preceding siblings ...)
  2023-04-09 15:24   ` patch 'test/crypto: fix capability check for ZUC cipher-auth' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/compress-perf: fix remaining data for ops' " Xueming Li
                     ` (31 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Ciara Power; +Cc: Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/dc6e5405cac9a9908e1b2dc8b7d240099130c8f2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From dc6e5405cac9a9908e1b2dc8b7d240099130c8f2 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power@intel.com>
Date: Tue, 7 Mar 2023 17:17:32 +0000
Subject: [PATCH] test/crypto: fix skip condition for CPU crypto SGL
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8c33ed1814d52e8c5a7a5055cc3128e1414e5e8f ]

When SGL support was added to AESNI_MB PMD, the feature flag was enabled.
This meant SGL testcases were incorrectly running for the
cryptodev_cpu_aesni_mb_autotest, and SGL support was not added for
CPU crypto.

Now skipping the ZUC auth cipher SGL tests for CPU crypto,
and GCM authenticated encryption SGL tests for CPU crypto on AESNI_MB
only, as AESNI_GCM CPU crypto supports inplace SGL.

Fixes: f9dfb59edbcc ("crypto/ipsec_mb: support remaining SGL")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 app/test/test_cryptodev.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 6b09b2ab56..7be4bf40b8 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -6458,6 +6458,9 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
 			tdata->digest.len) < 0)
 		return TEST_SKIPPED;
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return TEST_SKIPPED;
+
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
 	uint64_t feat_flags = dev_info.feature_flags;
@@ -7653,6 +7656,9 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
 		}
 	}
 
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+		return TEST_SKIPPED;
+
 	/* Create the session */
 	if (verify)
 		retval = create_wireless_algo_cipher_auth_session(
@@ -14455,8 +14461,13 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
 			&cap_idx) == NULL)
 		return TEST_SKIPPED;
 
-	/* OOP not supported with CPU crypto */
-	if (oop && gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+	/*
+	 * SGL not supported on AESNI_MB PMD CPU crypto,
+	 * OOP not supported on AESNI_GCM CPU crypto
+	 */
+	if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO &&
+			(gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)) || oop))
 		return TEST_SKIPPED;
 
 	/* Detailed check for the particular SGL support flag */
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.471240700 +0800
+++ 0105-test-crypto-fix-skip-condition-for-CPU-crypto-SGL.patch	2023-04-09 21:45:38.759042200 +0800
@@ -1 +1 @@
-From 8c33ed1814d52e8c5a7a5055cc3128e1414e5e8f Mon Sep 17 00:00:00 2001
+From dc6e5405cac9a9908e1b2dc8b7d240099130c8f2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8c33ed1814d52e8c5a7a5055cc3128e1414e5e8f ]
@@ -16 +18,0 @@
-Cc: stable@dpdk.org
@@ -25 +27 @@
-index af3d89b9c7..f4648755e5 100644
+index 6b09b2ab56..7be4bf40b8 100644
@@ -28 +30 @@
-@@ -6542,6 +6542,9 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
+@@ -6458,6 +6458,9 @@ test_zuc_auth_cipher_sgl(const struct wireless_test_data *tdata,
@@ -38 +40 @@
-@@ -7985,6 +7988,9 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
+@@ -7653,6 +7656,9 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
@@ -48 +50 @@
-@@ -14804,8 +14810,13 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
+@@ -14455,8 +14461,13 @@ test_authenticated_encryption_SGL(const struct aead_test_data *tdata,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/compress-perf: fix remaining data for ops' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (104 preceding siblings ...)
  2023-04-09 15:24   ` patch 'test/crypto: fix skip condition for CPU crypto SGL' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'crypto/ipsec_mb: relax multi-process requirement' " Xueming Li
                     ` (30 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Arkadiusz Kusztal; +Cc: Ciara Power, Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/6919a8d8745c1a1558af741e2031660c0e7231a4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6919a8d8745c1a1558af741e2031660c0e7231a4 Mon Sep 17 00:00:00 2001
From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Date: Fri, 10 Mar 2023 16:27:05 +0000
Subject: [PATCH] app/compress-perf: fix remaining data for ops
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cf8c0c65514a12d4f326417f7cf54433338ed226 ]

Individual variables are needed for tracking the remaining data for
compression and decompression.

Fixes: 83cc3b90ad7a ("app/compress-perf: fix testing single operation")

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 app/test-compress-perf/comp_perf_test_common.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index cd60958944..78487196ad 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -366,6 +366,7 @@ int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 {
 	uint32_t remaining_data = test_data->input_data_sz;
+	uint32_t remaining_data_decomp = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
 	size_t data_sz = 0;
 	uint8_t *data_addr;
@@ -482,7 +483,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		}
 
 		if (decompress_only)
-			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+			data_sz = RTE_MIN(remaining_data_decomp, test_data->seg_sz);
 		else
 			data_sz = test_data->out_seg_sz;
 
@@ -496,11 +497,11 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		if (decompress_only) {
 			rte_memcpy(data_addr, input_data_ptr, data_sz);
 			input_data_ptr += data_sz;
-			remaining_data -= data_sz;
+			remaining_data_decomp -= data_sz;
 		}
 
 		/* Chain mbufs if needed for output mbufs */
-		for (j = 1; j < segs_per_mbuf && remaining_data > 0; j++) {
+		for (j = 1; j < segs_per_mbuf && remaining_data_decomp > 0; j++) {
 			struct rte_mbuf *next_seg =
 				rte_pktmbuf_alloc(mem->comp_buf_pool);
 
@@ -521,7 +522,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			}
 
 			if (decompress_only)
-				data_sz = RTE_MIN(remaining_data,
+				data_sz = RTE_MIN(remaining_data_decomp,
 						  test_data->seg_sz);
 			else
 				data_sz = test_data->out_seg_sz;
@@ -536,7 +537,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			if (decompress_only) {
 				rte_memcpy(data_addr, input_data_ptr, data_sz);
 				input_data_ptr += data_sz;
-				remaining_data -= data_sz;
+				remaining_data_decomp -= data_sz;
 			}
 
 			if (rte_pktmbuf_chain(mem->comp_bufs[i],
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.503368300 +0800
+++ 0106-app-compress-perf-fix-remaining-data-for-ops.patch	2023-04-09 21:45:38.759042200 +0800
@@ -1 +1 @@
-From cf8c0c65514a12d4f326417f7cf54433338ed226 Mon Sep 17 00:00:00 2001
+From 6919a8d8745c1a1558af741e2031660c0e7231a4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cf8c0c65514a12d4f326417f7cf54433338ed226 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'crypto/ipsec_mb: relax multi-process requirement' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (105 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/compress-perf: fix remaining data for ops' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'app/bbdev: check statistics failure' " Xueming Li
                     ` (29 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Krzysztof Karas; +Cc: Kai Ji, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/39ca0f7397d1410576d8ab8162b079d430eefb4a

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 39ca0f7397d1410576d8ab8162b079d430eefb4a Mon Sep 17 00:00:00 2001
From: Krzysztof Karas <krzysztof.karas@intel.com>
Date: Mon, 13 Mar 2023 13:01:06 +0100
Subject: [PATCH] crypto/ipsec_mb: relax multi-process requirement
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3707f9795c4888448f1b9121e59da7708d3ba0bc ]

Multi-process IPC support enforces usage of shared
config and multiprocess mode.
Since it is not required to be run with more than one
process in general, so instead of erroring out,
catch the error and proceed with ipsec_mb device
creation normally.

Fixes: b35848bc01f6 ("crypto/ipsec_mb: add multi-process IPC request handler")

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
---
 drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
index 50b789a29b..64f2b4b604 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c
@@ -170,7 +170,7 @@ ipsec_mb_create(struct rte_vdev_device *vdev,
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		retval = ipsec_mb_mp_request_register();
-		if (retval && (rte_errno == EEXIST))
+		if (retval && ((rte_errno == EEXIST) || (rte_errno == ENOTSUP)))
 			/* Safe to proceed, return 0 */
 			return 0;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.526039300 +0800
+++ 0107-crypto-ipsec_mb-relax-multi-process-requirement.patch	2023-04-09 21:45:38.759042200 +0800
@@ -1 +1 @@
-From 3707f9795c4888448f1b9121e59da7708d3ba0bc Mon Sep 17 00:00:00 2001
+From 39ca0f7397d1410576d8ab8162b079d430eefb4a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3707f9795c4888448f1b9121e59da7708d3ba0bc ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/bbdev: check statistics failure' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (106 preceding siblings ...)
  2023-04-09 15:24   ` patch 'crypto/ipsec_mb: relax multi-process requirement' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/vhost: add missing newline in logs' " Xueming Li
                     ` (28 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: Hernan Vargas; +Cc: Maxime Coquelin, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/b80c949b77809e9c7026af726a0a878c0a43c278

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b80c949b77809e9c7026af726a0a878c0a43c278 Mon Sep 17 00:00:00 2001
From: Hernan Vargas <hernan.vargas@intel.com>
Date: Wed, 8 Mar 2023 19:36:24 -0800
Subject: [PATCH] app/bbdev: check statistics failure
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit ce1b62899167f6e2c49d8496afa43a9162167c6b ]

Add check for return value from get_bbdev_queue_stats.

Coverity issue: 383155
Fixes: c25604355a15 ("app/bbdev: add explicit check for counters")

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 app/test-bbdev/test_bbdev_perf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 0f441ace4d..f77ebc4b47 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -5382,7 +5382,7 @@ offload_cost_test(struct active_device *ad,
 	printf("Set RTE_BBDEV_OFFLOAD_COST to 'y' to turn the test on.\n");
 	return TEST_SKIPPED;
 #else
-	int iter;
+	int iter, ret;
 	uint16_t burst_sz = op_params->burst_sz;
 	const uint16_t num_to_process = op_params->num_to_process;
 	const enum rte_bbdev_op_type op_type = test_vector.op_type;
@@ -5477,7 +5477,10 @@ offload_cost_test(struct active_device *ad,
 			rte_get_tsc_hz());
 
 	struct rte_bbdev_stats stats = {0};
-	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+	ret = get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+	TEST_ASSERT_SUCCESS(ret,
+			"Failed to get stats for queue (%u) of device (%u)",
+			queue_id, ad->dev_id);
 	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
 		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
 				"Mismatch in enqueue count %10"PRIu64" %d",
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.548782800 +0800
+++ 0108-app-bbdev-check-statistics-failure.patch	2023-04-09 21:45:38.759042200 +0800
@@ -1 +1 @@
-From ce1b62899167f6e2c49d8496afa43a9162167c6b Mon Sep 17 00:00:00 2001
+From b80c949b77809e9c7026af726a0a878c0a43c278 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit ce1b62899167f6e2c49d8496afa43a9162167c6b ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 15ebcdfc15..276bbf0a2e 100644
+index 0f441ace4d..f77ebc4b47 100644
@@ -22,4 +24,4 @@
-@@ -5679,7 +5679,7 @@ static int
- offload_cost_test(struct active_device *ad,
- 		struct test_op_params *op_params)
- {
+@@ -5382,7 +5382,7 @@ offload_cost_test(struct active_device *ad,
+ 	printf("Set RTE_BBDEV_OFFLOAD_COST to 'y' to turn the test on.\n");
+ 	return TEST_SKIPPED;
+ #else
@@ -31 +33 @@
-@@ -5774,7 +5774,10 @@ offload_cost_test(struct active_device *ad,
+@@ -5477,7 +5477,10 @@ offload_cost_test(struct active_device *ad,
@@ -40,3 +42,3 @@
- 	if (stats.enqueue_warn_count > 0)
- 		printf("Warning reported on the queue : %10"PRIu64"\n",
- 			stats.enqueue_warn_count);
+ 	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
+ 		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
+ 				"Mismatch in enqueue count %10"PRIu64" %d",

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/vhost: add missing newline in logs' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (107 preceding siblings ...)
  2023-04-09 15:24   ` patch 'app/bbdev: check statistics failure' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/vhost: fix leak in interrupt handle setup' " Xueming Li
                     ` (27 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: David Marchand; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/9736b58d621dcc684a567d4372509b2d318bfe71

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 9736b58d621dcc684a567d4372509b2d318bfe71 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 9 Mar 2023 13:37:50 +0100
Subject: [PATCH] net/vhost: add missing newline in logs
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d539a20b7561d9e97d13f9b43d74ec030bd1a4ba ]

Fixes: 3f8ff12821e4 ("vhost: support interrupt mode")
Fixes: 8f1750f42e2d ("net/vhost: perform SW checksum in Rx path")
Fixes: 8ba1723783b2 ("net/vhost: perform SW checksum in Tx path")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index b152279fac..e8b0ed4f0b 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -297,7 +297,7 @@ vhost_dev_csum_configure(struct rte_eth_dev *eth_dev)
 	if (internal->features & (1ULL << VIRTIO_NET_F_CSUM)) {
 		if (!(rxmode->offloads &
 				(RTE_ETH_RX_OFFLOAD_UDP_CKSUM | RTE_ETH_RX_OFFLOAD_TCP_CKSUM))) {
-			VHOST_LOG(NOTICE, "Rx csum will be done in SW, may impact performance.");
+			VHOST_LOG(NOTICE, "Rx csum will be done in SW, may impact performance.\n");
 			internal->rx_sw_csum = true;
 		}
 	}
@@ -305,7 +305,7 @@ vhost_dev_csum_configure(struct rte_eth_dev *eth_dev)
 	if (!(internal->features & (1ULL << VIRTIO_NET_F_GUEST_CSUM))) {
 		if (txmode->offloads &
 				(RTE_ETH_TX_OFFLOAD_UDP_CKSUM | RTE_ETH_TX_OFFLOAD_TCP_CKSUM)) {
-			VHOST_LOG(NOTICE, "Tx csum will be done in SW, may impact performance.");
+			VHOST_LOG(NOTICE, "Tx csum will be done in SW, may impact performance.\n");
 			internal->tx_sw_csum = true;
 		}
 	}
@@ -646,7 +646,7 @@ eth_rxq_intr_disable(struct rte_eth_dev *dev, uint16_t qid)
 
 	ret = rte_vhost_get_vhost_vring(vq->vid, (qid << 1) + 1, &vring);
 	if (ret < 0) {
-		VHOST_LOG(ERR, "Failed to get rxq%d's vring", qid);
+		VHOST_LOG(ERR, "Failed to get rxq%d's vring\n", qid);
 		return ret;
 	}
 	VHOST_LOG(INFO, "Disable interrupt for rxq%d\n", qid);
@@ -851,7 +851,7 @@ new_device(int vid)
 		if (dev_conf->intr_conf.rxq) {
 			if (eth_vhost_install_intr(eth_dev) < 0) {
 				VHOST_LOG(INFO,
-					"Failed to install interrupt handler.");
+					"Failed to install interrupt handler.\n");
 					return -1;
 			}
 		}
@@ -1191,7 +1191,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev)
 		if (dev_conf->intr_conf.rxq) {
 			if (eth_vhost_install_intr(eth_dev) < 0) {
 				VHOST_LOG(INFO,
-					"Failed to install interrupt handler.");
+					"Failed to install interrupt handler.\n");
 					return -1;
 			}
 		}
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.575998000 +0800
+++ 0109-net-vhost-add-missing-newline-in-logs.patch	2023-04-09 21:45:38.759042200 +0800
@@ -1 +1 @@
-From d539a20b7561d9e97d13f9b43d74ec030bd1a4ba Mon Sep 17 00:00:00 2001
+From 9736b58d621dcc684a567d4372509b2d318bfe71 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d539a20b7561d9e97d13f9b43d74ec030bd1a4ba ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 9c609b45a3..198bf4d1f4 100644
+index b152279fac..e8b0ed4f0b 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/vhost: fix leak in interrupt handle setup' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (108 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/vhost: add missing newline in logs' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:24   ` patch 'net/vhost: fix Rx interrupt' " Xueming Li
                     ` (26 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: David Marchand; +Cc: Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1ecf04df54f5ed0743bee50b3498c1a18639a4f2

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1ecf04df54f5ed0743bee50b3498c1a18639a4f2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 9 Mar 2023 13:37:51 +0100
Subject: [PATCH] net/vhost: fix leak in interrupt handle setup
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 24c3a04e16aeab45719cf038d2371ccf8d1bc780 ]

Do a systematic cleanup if any part of the interrupt handle setup fails.

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 53 ++++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 19 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index e8b0ed4f0b..96598f710d 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -686,25 +686,32 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
 	dev->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
 	if (dev->intr_handle == NULL) {
 		VHOST_LOG(ERR, "Fail to allocate intr_handle\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto error;
+	}
+	if (rte_intr_efd_counter_size_set(dev->intr_handle, sizeof(uint64_t))) {
+		ret = -rte_errno;
+		goto error;
 	}
-	if (rte_intr_efd_counter_size_set(dev->intr_handle, sizeof(uint64_t)))
-		return -rte_errno;
 
 	if (rte_intr_vec_list_alloc(dev->intr_handle, NULL, nb_rxq)) {
-		VHOST_LOG(ERR,
-			"Failed to allocate memory for interrupt vector\n");
-		rte_intr_instance_free(dev->intr_handle);
-		return -ENOMEM;
+		VHOST_LOG(ERR, "Failed to allocate memory for interrupt vector\n");
+		ret = -ENOMEM;
+		goto error;
 	}
 
 
 	VHOST_LOG(INFO, "Prepare intr vec\n");
 	for (i = 0; i < nb_rxq; i++) {
-		if (rte_intr_vec_list_index_set(dev->intr_handle, i, RTE_INTR_VEC_RXTX_OFFSET + i))
-			return -rte_errno;
-		if (rte_intr_efds_index_set(dev->intr_handle, i, -1))
-			return -rte_errno;
+		if (rte_intr_vec_list_index_set(dev->intr_handle, i,
+				RTE_INTR_VEC_RXTX_OFFSET + i)) {
+			ret = -rte_errno;
+			goto error;
+		}
+		if (rte_intr_efds_index_set(dev->intr_handle, i, -1)) {
+			ret = -rte_errno;
+			goto error;
+		}
 		vq = dev->data->rx_queues[i];
 		if (!vq) {
 			VHOST_LOG(INFO, "rxq-%d not setup yet, skip!\n", i);
@@ -729,16 +736,24 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
 		VHOST_LOG(INFO, "Installed intr vec for rxq-%d\n", i);
 	}
 
-	if (rte_intr_nb_efd_set(dev->intr_handle, nb_rxq))
-		return -rte_errno;
-
-	if (rte_intr_max_intr_set(dev->intr_handle, nb_rxq + 1))
-		return -rte_errno;
-
-	if (rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_VDEV))
-		return -rte_errno;
+	if (rte_intr_nb_efd_set(dev->intr_handle, nb_rxq)) {
+		ret = -rte_errno;
+		goto error;
+	}
+	if (rte_intr_max_intr_set(dev->intr_handle, nb_rxq + 1)) {
+		ret = -rte_errno;
+		goto error;
+	}
+	if (rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_VDEV)) {
+		ret = -rte_errno;
+		goto error;
+	}
 
 	return 0;
+
+error:
+	eth_vhost_uninstall_intr(dev);
+	return ret;
 }
 
 static void
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.598189800 +0800
+++ 0110-net-vhost-fix-leak-in-interrupt-handle-setup.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 24c3a04e16aeab45719cf038d2371ccf8d1bc780 Mon Sep 17 00:00:00 2001
+From 1ecf04df54f5ed0743bee50b3498c1a18639a4f2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 24c3a04e16aeab45719cf038d2371ccf8d1bc780 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -18 +20 @@
-index 198bf4d1f4..96deb18d91 100644
+index e8b0ed4f0b..96598f710d 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/vhost: fix Rx interrupt' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (109 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/vhost: fix leak in interrupt handle setup' " Xueming Li
@ 2023-04-09 15:24   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/virtio: remove address width limit for modern devices' " Xueming Li
                     ` (25 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:24 UTC (permalink / raw)
  To: David Marchand; +Cc: Chenbo Xia, Dukai Yuan, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/7be8e75277a0b3a4065054e8f53ec4b38e3af83f

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7be8e75277a0b3a4065054e8f53ec4b38e3af83f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 9 Mar 2023 13:37:52 +0100
Subject: [PATCH] net/vhost: fix Rx interrupt
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7995bf4c295464c3a4c3f4ac500f890ab55567e7 ]

In the situation when a port was started while no virtio driver was
connected, Rx interrupts were broken.
They were also broken after a virtio driver reconnects.

There were several issues mixed in:
- this driver was not exposing a fixed file descriptor per Rx queue,
  If a virtio driver was not connected yet, each Rx queue vector was
  pointing at a -1 fd, and an application could interpret this as a lack
  of Rx interrupt support,
- when a virtio driver later (re)connected, this net/vhost driver was
  hacking into the EAL layer epoll fd to remove a old vring kickfd and
  insert the new vring kickfd. This hack constitutes a layer violation
  plus users of rte_eth_dev_rx_intr_ctl_q_get_fd() were not notified of
  this change,
- in the case of reconnection, because the interrupt handle was
  reallocated, a 0 fd was failing to be removed from the EAL layer
  epoll fd, which resulted in never fixing the EAL epoll fd,

To fix Rx interrupts:
- allocating (eth_vhost_install_intr) / releasing
  (eth_vhost_uninstall_intr) the interrupt handle is moved when
  starting / closing the port, while setting / resetting per rxq fd is
  triggered by vhost events via some new helpers (see
  eth_vhost_configure_intr and eth_vhost_unconfigure_intr),
- a "proxy" epoll fd is created per Rx queue at the time the interrupt
  handle is allocated, so applications can start waiting for events on
  those fds, even before a virtio driver initialises,
- when available, vring kickd are populated in the "proxy" epoll fd,

Bugzilla ID: 1135
Fixes: 3f8ff12821e4 ("vhost: support interrupt mode")
Fixes: 3d4cd4be577c ("net/vhost: fix interrupt mode")
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 318 ++++++++++++------------------
 1 file changed, 127 insertions(+), 191 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 96598f710d..f7e1b268ed 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -78,8 +78,9 @@ struct vhost_queue {
 	uint16_t port;
 	uint16_t virtqueue_id;
 	struct vhost_stats stats;
-	int intr_enable;
 	rte_spinlock_t intr_lock;
+	struct epoll_event ev;
+	int kickfd;
 };
 
 struct pmd_internal {
@@ -545,115 +546,68 @@ find_internal_resource(char *ifname)
 	return list;
 }
 
-static int
+static void
 eth_vhost_update_intr(struct rte_eth_dev *eth_dev, uint16_t rxq_idx)
 {
-	struct rte_intr_handle *handle = eth_dev->intr_handle;
-	struct rte_epoll_event rev, *elist;
-	int epfd, ret;
-
-	if (handle == NULL)
-		return 0;
-
-	elist = rte_intr_elist_index_get(handle, rxq_idx);
-	if (rte_intr_efds_index_get(handle, rxq_idx) == elist->fd)
-		return 0;
-
-	VHOST_LOG(INFO, "kickfd for rxq-%d was changed, updating handler.\n",
-			rxq_idx);
+	struct rte_vhost_vring vring;
+	struct vhost_queue *vq;
 
-	if (elist->fd != -1)
-		VHOST_LOG(ERR, "Unexpected previous kickfd value (Got %d, expected -1).\n",
-			elist->fd);
+	vq = eth_dev->data->rx_queues[rxq_idx];
+	if (vq == NULL || vq->vid < 0)
+		return;
 
-	/*
-	 * First remove invalid epoll event, and then install
-	 * the new one. May be solved with a proper API in the
-	 * future.
-	 */
-	epfd = elist->epfd;
-	rev = *elist;
-	ret = rte_epoll_ctl(epfd, EPOLL_CTL_DEL, rev.fd,
-			elist);
-	if (ret) {
-		VHOST_LOG(ERR, "Delete epoll event failed.\n");
-		return ret;
+	if (rte_vhost_get_vhost_vring(vq->vid, (rxq_idx << 1) + 1, &vring) < 0) {
+		VHOST_LOG(DEBUG, "Failed to get rxq-%d's vring, skip!\n", rxq_idx);
+		return;
 	}
 
-	rev.fd = rte_intr_efds_index_get(handle, rxq_idx);
-	if (rte_intr_elist_index_set(handle, rxq_idx, rev))
-		return -rte_errno;
+	rte_spinlock_lock(&vq->intr_lock);
 
-	elist = rte_intr_elist_index_get(handle, rxq_idx);
-	ret = rte_epoll_ctl(epfd, EPOLL_CTL_ADD, rev.fd, elist);
-	if (ret) {
-		VHOST_LOG(ERR, "Add epoll event failed.\n");
-		return ret;
+	/* Remove previous kickfd from proxy epoll */
+	if (vq->kickfd >= 0 && vq->kickfd != vring.kickfd) {
+		if (epoll_ctl(vq->ev.data.fd, EPOLL_CTL_DEL, vq->kickfd, &vq->ev) < 0) {
+			VHOST_LOG(DEBUG, "Failed to unregister %d from rxq-%d epoll: %s\n",
+				vq->kickfd, rxq_idx, strerror(errno));
+		} else {
+			VHOST_LOG(DEBUG, "Unregistered %d from rxq-%d epoll\n",
+				vq->kickfd, rxq_idx);
+		}
+		vq->kickfd = -1;
+	}
+
+	/* Add new one, if valid */
+	if (vq->kickfd != vring.kickfd && vring.kickfd >= 0) {
+		if (epoll_ctl(vq->ev.data.fd, EPOLL_CTL_ADD, vring.kickfd, &vq->ev) < 0) {
+			VHOST_LOG(ERR, "Failed to register %d in rxq-%d epoll: %s\n",
+				vring.kickfd, rxq_idx, strerror(errno));
+		} else {
+			vq->kickfd = vring.kickfd;
+			VHOST_LOG(DEBUG, "Registered %d in rxq-%d epoll\n",
+				vq->kickfd, rxq_idx);
+		}
 	}
 
-	return 0;
+	rte_spinlock_unlock(&vq->intr_lock);
 }
 
 static int
 eth_rxq_intr_enable(struct rte_eth_dev *dev, uint16_t qid)
 {
-	struct rte_vhost_vring vring;
-	struct vhost_queue *vq;
-	int old_intr_enable, ret = 0;
-
-	vq = dev->data->rx_queues[qid];
-	if (!vq) {
-		VHOST_LOG(ERR, "rxq%d is not setup yet\n", qid);
-		return -1;
-	}
-
-	rte_spinlock_lock(&vq->intr_lock);
-	old_intr_enable = vq->intr_enable;
-	vq->intr_enable = 1;
-	ret = eth_vhost_update_intr(dev, qid);
-	rte_spinlock_unlock(&vq->intr_lock);
-
-	if (ret < 0) {
-		VHOST_LOG(ERR, "Failed to update rxq%d's intr\n", qid);
-		vq->intr_enable = old_intr_enable;
-		return ret;
-	}
+	struct vhost_queue *vq = dev->data->rx_queues[qid];
 
-	ret = rte_vhost_get_vhost_vring(vq->vid, (qid << 1) + 1, &vring);
-	if (ret < 0) {
-		VHOST_LOG(ERR, "Failed to get rxq%d's vring\n", qid);
-		return ret;
-	}
-	VHOST_LOG(INFO, "Enable interrupt for rxq%d\n", qid);
-	rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 1);
-	rte_wmb();
+	if (vq->vid >= 0)
+		rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 1);
 
-	return ret;
+	return 0;
 }
 
 static int
 eth_rxq_intr_disable(struct rte_eth_dev *dev, uint16_t qid)
 {
-	struct rte_vhost_vring vring;
-	struct vhost_queue *vq;
-	int ret = 0;
-
-	vq = dev->data->rx_queues[qid];
-	if (!vq) {
-		VHOST_LOG(ERR, "rxq%d is not setup yet\n", qid);
-		return -1;
-	}
+	struct vhost_queue *vq = dev->data->rx_queues[qid];
 
-	ret = rte_vhost_get_vhost_vring(vq->vid, (qid << 1) + 1, &vring);
-	if (ret < 0) {
-		VHOST_LOG(ERR, "Failed to get rxq%d's vring\n", qid);
-		return ret;
-	}
-	VHOST_LOG(INFO, "Disable interrupt for rxq%d\n", qid);
-	rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 0);
-	rte_wmb();
-
-	vq->intr_enable = 0;
+	if (vq->vid >= 0)
+		rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 0);
 
 	return 0;
 }
@@ -664,6 +618,14 @@ eth_vhost_uninstall_intr(struct rte_eth_dev *dev)
 	struct rte_intr_handle *intr_handle = dev->intr_handle;
 
 	if (intr_handle != NULL) {
+		int i;
+
+		for (i = 0; i < dev->data->nb_rx_queues; i++) {
+			int epoll_fd = rte_intr_efds_index_get(dev->intr_handle, i);
+
+			if (epoll_fd >= 0)
+				close(epoll_fd);
+		}
 		rte_intr_vec_list_free(intr_handle);
 		rte_intr_instance_free(intr_handle);
 	}
@@ -673,15 +635,11 @@ eth_vhost_uninstall_intr(struct rte_eth_dev *dev)
 static int
 eth_vhost_install_intr(struct rte_eth_dev *dev)
 {
-	struct rte_vhost_vring vring;
-	struct vhost_queue *vq;
 	int nb_rxq = dev->data->nb_rx_queues;
-	int i;
-	int ret;
+	struct vhost_queue *vq;
 
-	/* uninstall firstly if we are reconnecting */
-	if (dev->intr_handle != NULL)
-		eth_vhost_uninstall_intr(dev);
+	int ret;
+	int i;
 
 	dev->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
 	if (dev->intr_handle == NULL) {
@@ -689,7 +647,7 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
 		ret = -ENOMEM;
 		goto error;
 	}
-	if (rte_intr_efd_counter_size_set(dev->intr_handle, sizeof(uint64_t))) {
+	if (rte_intr_efd_counter_size_set(dev->intr_handle, 0)) {
 		ret = -rte_errno;
 		goto error;
 	}
@@ -700,40 +658,28 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
 		goto error;
 	}
 
-
-	VHOST_LOG(INFO, "Prepare intr vec\n");
+	VHOST_LOG(DEBUG, "Prepare intr vec\n");
 	for (i = 0; i < nb_rxq; i++) {
-		if (rte_intr_vec_list_index_set(dev->intr_handle, i,
-				RTE_INTR_VEC_RXTX_OFFSET + i)) {
-			ret = -rte_errno;
+		int epoll_fd = epoll_create1(0);
+
+		if (epoll_fd < 0) {
+			VHOST_LOG(ERR, "Failed to create proxy epoll fd for rxq-%d\n", i);
+			ret = -errno;
 			goto error;
 		}
-		if (rte_intr_efds_index_set(dev->intr_handle, i, -1)) {
+
+		if (rte_intr_vec_list_index_set(dev->intr_handle, i,
+				RTE_INTR_VEC_RXTX_OFFSET + i) ||
+				rte_intr_efds_index_set(dev->intr_handle, i, epoll_fd)) {
 			ret = -rte_errno;
+			close(epoll_fd);
 			goto error;
 		}
-		vq = dev->data->rx_queues[i];
-		if (!vq) {
-			VHOST_LOG(INFO, "rxq-%d not setup yet, skip!\n", i);
-			continue;
-		}
-
-		ret = rte_vhost_get_vhost_vring(vq->vid, (i << 1) + 1, &vring);
-		if (ret < 0) {
-			VHOST_LOG(INFO,
-				"Failed to get rxq-%d's vring, skip!\n", i);
-			continue;
-		}
-
-		if (vring.kickfd < 0) {
-			VHOST_LOG(INFO,
-				"rxq-%d's kickfd is invalid, skip!\n", i);
-			continue;
-		}
 
-		if (rte_intr_efds_index_set(dev->intr_handle, i, vring.kickfd))
-			continue;
-		VHOST_LOG(INFO, "Installed intr vec for rxq-%d\n", i);
+		vq = dev->data->rx_queues[i];
+		memset(&vq->ev, 0, sizeof(vq->ev));
+		vq->ev.events = EPOLLIN;
+		vq->ev.data.fd = epoll_fd;
 	}
 
 	if (rte_intr_nb_efd_set(dev->intr_handle, nb_rxq)) {
@@ -756,6 +702,46 @@ error:
 	return ret;
 }
 
+static void
+eth_vhost_configure_intr(struct rte_eth_dev *dev)
+{
+	int i;
+
+	VHOST_LOG(DEBUG, "Configure intr vec\n");
+	for (i = 0; i < dev->data->nb_rx_queues; i++)
+		eth_vhost_update_intr(dev, i);
+}
+
+static void
+eth_vhost_unconfigure_intr(struct rte_eth_dev *eth_dev)
+{
+	struct vhost_queue *vq;
+	int i;
+
+	VHOST_LOG(DEBUG, "Unconfigure intr vec\n");
+	for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
+		vq = eth_dev->data->rx_queues[i];
+		if (vq == NULL || vq->vid < 0)
+			continue;
+
+		rte_spinlock_lock(&vq->intr_lock);
+
+		/* Remove previous kickfd from proxy epoll */
+		if (vq->kickfd >= 0) {
+			if (epoll_ctl(vq->ev.data.fd, EPOLL_CTL_DEL, vq->kickfd, &vq->ev) < 0) {
+				VHOST_LOG(DEBUG, "Failed to unregister %d from rxq-%d epoll: %s\n",
+					vq->kickfd, i, strerror(errno));
+			} else {
+				VHOST_LOG(DEBUG, "Unregistered %d from rxq-%d epoll\n",
+					vq->kickfd, i);
+			}
+			vq->kickfd = -1;
+		}
+
+		rte_spinlock_unlock(&vq->intr_lock);
+	}
+}
+
 static void
 update_queuing_status(struct rte_eth_dev *dev, bool wait_queuing)
 {
@@ -862,16 +848,8 @@ new_device(int vid)
 	internal->vid = vid;
 	if (rte_atomic32_read(&internal->started) == 1) {
 		queue_setup(eth_dev, internal);
-
-		if (dev_conf->intr_conf.rxq) {
-			if (eth_vhost_install_intr(eth_dev) < 0) {
-				VHOST_LOG(INFO,
-					"Failed to install interrupt handler.\n");
-					return -1;
-			}
-		}
-	} else {
-		VHOST_LOG(INFO, "RX/TX queues not exist yet\n");
+		if (dev_conf->intr_conf.rxq)
+			eth_vhost_configure_intr(eth_dev);
 	}
 
 	for (i = 0; i < rte_vhost_get_vring_num(vid); i++)
@@ -915,6 +893,7 @@ destroy_device(int vid)
 
 	rte_atomic32_set(&internal->dev_attached, 0);
 	update_queuing_status(eth_dev, true);
+	eth_vhost_unconfigure_intr(eth_dev);
 
 	eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
 
@@ -943,55 +922,10 @@ destroy_device(int vid)
 	rte_spinlock_unlock(&state->lock);
 
 	VHOST_LOG(INFO, "Vhost device %d destroyed\n", vid);
-	eth_vhost_uninstall_intr(eth_dev);
 
 	rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 }
 
-static int
-vring_conf_update(int vid, struct rte_eth_dev *eth_dev, uint16_t vring_id)
-{
-	struct rte_eth_conf *dev_conf = &eth_dev->data->dev_conf;
-	struct pmd_internal *internal = eth_dev->data->dev_private;
-	struct vhost_queue *vq;
-	struct rte_vhost_vring vring;
-	int rx_idx = vring_id % 2 ? (vring_id - 1) >> 1 : -1;
-	int ret = 0;
-
-	/*
-	 * The vring kickfd may be changed after the new device notification.
-	 * Update it when the vring state is updated.
-	 */
-	if (rx_idx >= 0 && rx_idx < eth_dev->data->nb_rx_queues &&
-	    rte_atomic32_read(&internal->dev_attached) &&
-	    rte_atomic32_read(&internal->started) &&
-	    dev_conf->intr_conf.rxq) {
-		ret = rte_vhost_get_vhost_vring(vid, vring_id, &vring);
-		if (ret) {
-			VHOST_LOG(ERR, "Failed to get vring %d information.\n",
-					vring_id);
-			return ret;
-		}
-
-		if (rte_intr_efds_index_set(eth_dev->intr_handle, rx_idx,
-						   vring.kickfd))
-			return -rte_errno;
-
-		vq = eth_dev->data->rx_queues[rx_idx];
-		if (!vq) {
-			VHOST_LOG(ERR, "rxq%d is not setup yet\n", rx_idx);
-			return -1;
-		}
-
-		rte_spinlock_lock(&vq->intr_lock);
-		if (vq->intr_enable)
-			ret = eth_vhost_update_intr(eth_dev, rx_idx);
-		rte_spinlock_unlock(&vq->intr_lock);
-	}
-
-	return ret;
-}
-
 static int
 vring_state_changed(int vid, uint16_t vring, int enable)
 {
@@ -1011,9 +945,8 @@ vring_state_changed(int vid, uint16_t vring, int enable)
 	/* won't be NULL */
 	state = vring_states[eth_dev->data->port_id];
 
-	if (enable && vring_conf_update(vid, eth_dev, vring))
-		VHOST_LOG(INFO, "Failed to update vring-%d configuration.\n",
-			  (int)vring);
+	if (eth_dev->data->dev_conf.intr_conf.rxq && vring % 2)
+		eth_vhost_update_intr(eth_dev, (vring - 1) >> 1);
 
 	rte_spinlock_lock(&state->lock);
 	if (state->cur[vring] == enable) {
@@ -1200,18 +1133,17 @@ eth_dev_start(struct rte_eth_dev *eth_dev)
 	struct pmd_internal *internal = eth_dev->data->dev_private;
 	struct rte_eth_conf *dev_conf = &eth_dev->data->dev_conf;
 
-	queue_setup(eth_dev, internal);
-
-	if (rte_atomic32_read(&internal->dev_attached) == 1) {
-		if (dev_conf->intr_conf.rxq) {
-			if (eth_vhost_install_intr(eth_dev) < 0) {
-				VHOST_LOG(INFO,
-					"Failed to install interrupt handler.\n");
-					return -1;
-			}
-		}
+	eth_vhost_uninstall_intr(eth_dev);
+	if (dev_conf->intr_conf.rxq && eth_vhost_install_intr(eth_dev) < 0) {
+		VHOST_LOG(ERR, "Failed to install interrupt handler.\n");
+		return -1;
 	}
 
+	queue_setup(eth_dev, internal);
+	if (rte_atomic32_read(&internal->dev_attached) == 1 &&
+			dev_conf->intr_conf.rxq)
+		eth_vhost_configure_intr(eth_dev);
+
 	rte_atomic32_set(&internal->started, 1);
 	update_queuing_status(eth_dev, false);
 
@@ -1266,6 +1198,8 @@ eth_dev_close(struct rte_eth_dev *dev)
 	rte_free(internal->iface_name);
 	rte_free(internal);
 
+	eth_vhost_uninstall_intr(dev);
+
 	dev->data->dev_private = NULL;
 
 	rte_free(vring_states[dev->data->port_id]);
@@ -1293,6 +1227,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	vq->mb_pool = mb_pool;
 	vq->virtqueue_id = rx_queue_id * VIRTIO_QNUM + VIRTIO_TXQ;
 	rte_spinlock_init(&vq->intr_lock);
+	vq->kickfd = -1;
 	dev->data->rx_queues[rx_queue_id] = vq;
 
 	return 0;
@@ -1315,6 +1250,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 
 	vq->virtqueue_id = tx_queue_id * VIRTIO_QNUM + VIRTIO_RXQ;
 	rte_spinlock_init(&vq->intr_lock);
+	vq->kickfd = -1;
 	dev->data->tx_queues[tx_queue_id] = vq;
 
 	return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.619568800 +0800
+++ 0111-net-vhost-fix-Rx-interrupt.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 7995bf4c295464c3a4c3f4ac500f890ab55567e7 Mon Sep 17 00:00:00 2001
+From 7be8e75277a0b3a4065054e8f53ec4b38e3af83f Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7995bf4c295464c3a4c3f4ac500f890ab55567e7 ]
@@ -39 +41,0 @@
-Cc: stable@dpdk.org
@@ -49 +51 @@
-index 96deb18d91..62ef955ebc 100644
+index 96598f710d..f7e1b268ed 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/virtio: remove address width limit for modern devices' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (110 preceding siblings ...)
  2023-04-09 15:24   ` patch 'net/vhost: fix Rx interrupt' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/sfc: invalidate switch port entry on representor unplug' " Xueming Li
                     ` (24 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: David Marchand; +Cc: Maxime Coquelin, Andy Pei, Chenbo Xia, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/d59d4fbffa9c3da60b4c2838ac386c9132c77170

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d59d4fbffa9c3da60b4c2838ac386c9132c77170 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 14 Mar 2023 09:53:34 +0100
Subject: [PATCH] net/virtio: remove address width limit for modern devices
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ]

Modern devices don't have the same limitation as legacy devices, because
vring addresses are not configured using a 32-bit register.

Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_pci.c | 28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index 9cf4d760b4..29eb739b04 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -33,22 +33,6 @@
 
 struct virtio_pci_internal virtio_pci_internal[RTE_MAX_ETHPORTS];
 
-static inline int
-check_vq_phys_addr_ok(struct virtqueue *vq)
-{
-	/* Virtio PCI device VIRTIO_PCI_QUEUE_PF register is 32bit,
-	 * and only accepts 32 bit page frame number.
-	 * Check if the allocated physical memory exceeds 16TB.
-	 */
-	if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >>
-			(VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
-		PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!");
-		return 0;
-	}
-
-	return 1;
-}
-
 #define PCI_MSIX_ENABLE 0x8000
 
 static enum virtio_msix_status
@@ -273,8 +257,15 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
 {
 	uint32_t src;
 
-	if (!check_vq_phys_addr_ok(vq))
+	/* Virtio PCI device VIRTIO_PCI_QUEUE_PFN register is 32bit,
+	 * and only accepts 32 bit page frame number.
+	 * Check if the allocated physical memory exceeds 16TB.
+	 */
+	if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >>
+			(VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
+		PMD_INIT_LOG(ERR, "vring address shouldn't be above 16TB!");
 		return -1;
+	}
 
 	rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2,
 		VIRTIO_PCI_QUEUE_SEL);
@@ -476,9 +467,6 @@ modern_setup_queue(struct virtio_hw *hw, struct virtqueue *vq)
 	uint64_t desc_addr, avail_addr, used_addr;
 	uint16_t notify_off;
 
-	if (!check_vq_phys_addr_ok(vq))
-		return -1;
-
 	desc_addr = vq->vq_ring_mem;
 	avail_addr = desc_addr + vq->vq_nentries * sizeof(struct vring_desc);
 	used_addr = RTE_ALIGN_CEIL(avail_addr + offsetof(struct vring_avail,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.642343800 +0800
+++ 0112-net-virtio-remove-address-width-limit-for-modern-dev.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 8b76b3a0d327f6bedc1343149e03619337ab0408 Mon Sep 17 00:00:00 2001
+From d59d4fbffa9c3da60b4c2838ac386c9132c77170 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8b76b3a0d327f6bedc1343149e03619337ab0408 ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/sfc: invalidate switch port entry on representor unplug' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (111 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/virtio: remove address width limit for modern devices' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/i40e: fix AVX512 fast-free path' " Xueming Li
                     ` (23 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Ivan Malov; +Cc: Andy Moreton, Andrew Rybchenko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8a6d064801721157e4d9bbf375616d5e1d5ea552

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8a6d064801721157e4d9bbf375616d5e1d5ea552 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@arknetworks.am>
Date: Fri, 10 Mar 2023 21:07:17 +0400
Subject: [PATCH] net/sfc: invalidate switch port entry on representor unplug
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 723327bed49fb434bfb24b1e4393d5c4db537fda ]

Once allocated, a switch port list entry always stays there,
even after unplugging the ethdev that created it. Currently,
the entry's ethdev ID is not cleared on unplug. Referencing
the ethdev ID of a detached representor from a flow rule is
going to succeed, which is a bug. Also, if the user unplugs
endpoint "A" representor and plugs one for "B" instead, the
latter will pick the same ethdev ID as the gone representor,
but it will have a new port list entry added for it. If the
user tries to reference the ethdev ID from a flow rule, the
code will fetch the wrong entry ("A" rather than "B") since
it sits closer to the list head. That is a serious bug, too.

Make the driver invalidate ethdev ID field on ethdev unplug.

Fixes: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer rules")
Fixes: a62ec90522a6 ("net/sfc: add port representors infrastructure")

Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 drivers/net/sfc/sfc_repr.c   |  2 ++
 drivers/net/sfc/sfc_switch.c | 12 ++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/net/sfc/sfc_repr.c b/drivers/net/sfc/sfc_repr.c
index 4b03b101d8..919048e278 100644
--- a/drivers/net/sfc/sfc_repr.c
+++ b/drivers/net/sfc/sfc_repr.c
@@ -836,6 +836,8 @@ sfc_repr_dev_close(struct rte_eth_dev *dev)
 
 	(void)sfc_repr_proxy_del_port(srs->pf_port_id, srs->repr_id);
 
+	sfc_mae_clear_switch_port(srs->switch_domain_id, srs->switch_port_id);
+
 	dev->rx_pkt_burst = NULL;
 	dev->tx_pkt_burst = NULL;
 	dev->dev_ops = NULL;
diff --git a/drivers/net/sfc/sfc_switch.c b/drivers/net/sfc/sfc_switch.c
index 5c10e8fc74..8f1ee97fa8 100644
--- a/drivers/net/sfc/sfc_switch.c
+++ b/drivers/net/sfc/sfc_switch.c
@@ -489,6 +489,7 @@ sfc_mae_clear_switch_port(uint16_t switch_domain_id,
 			  uint16_t switch_port_id)
 {
 	struct sfc_mae_switch_domain *domain;
+	struct sfc_mae_switch_port *port;
 
 	rte_spinlock_lock(&sfc_mae_switch.lock);
 
@@ -504,6 +505,17 @@ sfc_mae_clear_switch_port(uint16_t switch_domain_id,
 		domain->mae_admin_port = NULL;
 	}
 
+	TAILQ_FOREACH(port, &domain->ports, switch_domain_ports) {
+		if (port->id == switch_port_id) {
+			/*
+			 * Invalidate the field to prevent wrong
+			 * look-ups from flow rule handling path.
+			 */
+			port->ethdev_port_id = RTE_MAX_ETHPORTS;
+			break;
+		}
+	}
+
 	rte_spinlock_unlock(&sfc_mae_switch.lock);
 	return 0;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.670323900 +0800
+++ 0113-net-sfc-invalidate-switch-port-entry-on-representor-.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 723327bed49fb434bfb24b1e4393d5c4db537fda Mon Sep 17 00:00:00 2001
+From 8a6d064801721157e4d9bbf375616d5e1d5ea552 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 723327bed49fb434bfb24b1e4393d5c4db537fda ]
@@ -22 +24,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/i40e: fix AVX512 fast-free path' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (112 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/sfc: invalidate switch port entry on representor unplug' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/e1000: fix saving of stripped VLAN TCI' " Xueming Li
                     ` (22 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Kamalakshitha Aligeri
  Cc: Ruifeng Wang, Feifei Wang, Morten Brørup, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/91a60dfeee486a0815ed92a2e641380422a20ddc

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 91a60dfeee486a0815ed92a2e641380422a20ddc Mon Sep 17 00:00:00 2001
From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Date: Tue, 7 Mar 2023 19:32:21 +0000
Subject: [PATCH] net/i40e: fix AVX512 fast-free path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 1ad4bea0d73a7671095c2c675f9bb8b19503ac06 ]

In i40e_tx_free_bufs_avx512 fast-free path, when cache is NULL,
non fast-free path is being executed. Fixed the bug by calling
rte_mempool_generic_put API that handles the cache==NULL case.

Fixes: 5171b4ee6b6b ("net/i40e: optimize Tx by using AVX512")

Signed-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 .mailmap                                |  1 +
 drivers/net/i40e/i40e_rxtx_vec_avx512.c | 12 ++++--------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/.mailmap b/.mailmap
index da2ce216a3..cfdaeaf6a4 100644
--- a/.mailmap
+++ b/.mailmap
@@ -674,6 +674,7 @@ Kai Ji <kai.ji@intel.com>
 Kaiwen Deng <kaiwenx.deng@intel.com>
 Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
 Kamalakannan R <kamalakannan.r@intel.com>
+Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
 Kamil Bednarczyk <kamil.bednarczyk@intel.com>
 Kamil Chalupnik <kamilx.chalupnik@intel.com>
 Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx512.c b/drivers/net/i40e/i40e_rxtx_vec_avx512.c
index 60c97d5331..74ff54c653 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx512.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx512.c
@@ -906,16 +906,13 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
 		struct rte_mempool_cache *cache = rte_mempool_default_cache(mp,
 				rte_lcore_id());
 
-		if (!cache || cache->len == 0)
-			goto normal;
-
-		cache_objs = &cache->objs[cache->len];
-
-		if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) {
-			rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n);
+		if (!cache || n > RTE_MEMPOOL_CACHE_MAX_SIZE) {
+			rte_mempool_generic_put(mp, (void *)txep, n, cache);
 			goto done;
 		}
 
+		cache_objs = &cache->objs[cache->len];
+
 		/* The cache follows the following algorithm
 		 *   1. Add the objects to the cache
 		 *   2. Anything greater than the cache min value (if it
@@ -947,7 +944,6 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
 		goto done;
 	}
 
-normal:
 	m = rte_pktmbuf_prefree_seg(txep[0].mbuf);
 	if (likely(m)) {
 		free[0] = m;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.695634400 +0800
+++ 0114-net-i40e-fix-AVX512-fast-free-path.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 1ad4bea0d73a7671095c2c675f9bb8b19503ac06 Mon Sep 17 00:00:00 2001
+From 91a60dfeee486a0815ed92a2e641380422a20ddc Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 1ad4bea0d73a7671095c2c675f9bb8b19503ac06 ]
@@ -14 +16,0 @@
-Cc: stable@dpdk.org
@@ -26 +28 @@
-index 9578b86866..c77cdc9ddf 100644
+index da2ce216a3..cfdaeaf6a4 100644
@@ -29 +31 @@
-@@ -681,6 +681,7 @@ Kai Ji <kai.ji@intel.com>
+@@ -674,6 +674,7 @@ Kai Ji <kai.ji@intel.com>
@@ -38 +40 @@
-index d3c7bfd121..ad0893324d 100644
+index 60c97d5331..74ff54c653 100644
@@ -41 +43 @@
-@@ -783,16 +783,13 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
+@@ -906,16 +906,13 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
@@ -62 +64 @@
-@@ -824,7 +821,6 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)
+@@ -947,7 +944,6 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq)

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/e1000: fix saving of stripped VLAN TCI' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (113 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/i40e: fix AVX512 fast-free path' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/i40e: fix MAC loopback on X722' " Xueming Li
                     ` (21 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Visa Hankala; +Cc: Wenjun Wu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8cc24b8aabb11b05b3844657bb94b0d515da8c6b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8cc24b8aabb11b05b3844657bb94b0d515da8c6b Mon Sep 17 00:00:00 2001
From: Visa Hankala <visa@hankala.org>
Date: Sun, 12 Mar 2023 13:44:42 +0000
Subject: [PATCH] net/e1000: fix saving of stripped VLAN TCI
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8d57c9fcfcda3122aa38fba08a029ec248eeb52d ]

When receiving a scattered packet, save the stripped VLAN TCI
in the first mbuf segment where users expect to find it.

Fixes: 805803445a02 ("e1000: support EM devices (also known as e1000/e1000e)")

Signed-off-by: Visa Hankala <visa@hankala.org>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 .mailmap                    | 1 +
 drivers/net/e1000/em_rxtx.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index cfdaeaf6a4..039d487d6d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1405,6 +1405,7 @@ Vincent Li <vincent.mc.li@gmail.com>
 Vincent S. Cojot <vcojot@redhat.com>
 Vipin Varghese <vipin.varghese@amd.com> <vipin.varghese@intel.com>
 Vipul Ashri <vipul.ashri@oracle.com>
+Visa Hankala <visa@hankala.org>
 Vishal Kulkarni <vishal@chelsio.com>
 Vishwas Danivas <vishwas@pensando.io>
 Vitaliy Mysak <vitaliy.mysak@intel.com>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index d48fd52404..cb5ce2307b 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1030,6 +1030,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		 *    - RX port identifier,
 		 *    - hardware offload data, if any:
 		 *      - IP checksum flag,
+		 *      - VLAN TCI, if any,
 		 *      - error flags.
 		 */
 		first_seg->port = rxq->port_id;
@@ -1039,7 +1040,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 					rx_desc_error_to_pkt_flags(rxd.errors);
 
 		/* Only valid if RTE_MBUF_F_RX_VLAN set in pkt_flags */
-		rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
+		first_seg->vlan_tci = rte_le_to_cpu_16(rxd.special);
 
 		/* Prefetch data of first segment, if configured to do so. */
 		rte_packet_prefetch((char *)first_seg->buf_addr +
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.721174700 +0800
+++ 0115-net-e1000-fix-saving-of-stripped-VLAN-TCI.patch	2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 8d57c9fcfcda3122aa38fba08a029ec248eeb52d Mon Sep 17 00:00:00 2001
+From 8cc24b8aabb11b05b3844657bb94b0d515da8c6b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8d57c9fcfcda3122aa38fba08a029ec248eeb52d ]
@@ -10 +12,0 @@
-Cc: stable@dpdk.org
@@ -20 +22 @@
-index c77cdc9ddf..e69e75ca72 100644
+index cfdaeaf6a4..039d487d6d 100644
@@ -23 +25 @@
-@@ -1417,6 +1417,7 @@ Vincent Li <vincent.mc.li@gmail.com>
+@@ -1405,6 +1405,7 @@ Vincent Li <vincent.mc.li@gmail.com>

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/i40e: fix MAC loopback on X722' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (114 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/e1000: fix saving of stripped VLAN TCI' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/idpf: reset queue flag when queue is stopped' " Xueming Li
                     ` (20 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Wenjing Qiao; +Cc: Dukai Yuan, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/8cb2ee860c5ed932cd797c1f75ce9fa5770fa396

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 8cb2ee860c5ed932cd797c1f75ce9fa5770fa396 Mon Sep 17 00:00:00 2001
From: Wenjing Qiao <wenjing.qiao@intel.com>
Date: Mon, 13 Mar 2023 23:16:19 -0400
Subject: [PATCH] net/i40e: fix MAC loopback on X722
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6355ff768b0b5871cc82a69194b376db39ee6e9c ]

If enabling MAC loopback mode on X722 NIC, transmitted packets are not
seen in the receive queue. The root cause is using wrong loopback mode
bits. Correct it according to the X722 datasheet.

Fixes: 3a838ab649df ("net/i40e: support MAC loopback")
Fixes: 5712e6407089 ("net/i40e: revert enhancing loopback AQ command")

Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
Tested-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 17 ++++++++++++++---
 drivers/net/i40e/i40e_ethdev.h |  3 +++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 371f42233e..cb0070f94b 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2411,10 +2411,21 @@ i40e_dev_start(struct rte_eth_dev *dev)
 		}
 	}
 
+	/* Disable mac loopback mode */
+	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_NONE) {
+		ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MODE_NONE, NULL);
+		if (ret != I40E_SUCCESS) {
+			PMD_DRV_LOG(ERR, "fail to set loopback link");
+			goto tx_err;
+		}
+	}
+
 	/* Enable mac loopback mode */
-	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_NONE ||
-	    dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_PHY_LOCAL) {
-		ret = i40e_aq_set_lb_modes(hw, dev->data->dev_conf.lpbk_mode, NULL);
+	if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_EN) {
+		if (hw->mac.type == I40E_MAC_X722)
+			ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MAC_LOCAL_X722, NULL);
+		else
+			ret = i40e_aq_set_lb_modes(hw, I40E_AQ_LB_MAC, NULL);
 		if (ret != I40E_SUCCESS) {
 			PMD_DRV_LOG(ERR, "fail to set loopback link");
 			goto tx_err;
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 7c4cc44a27..9b806d130e 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -48,6 +48,9 @@
 #define I40E_MAX_VF               128
 /*flag of no loopback*/
 #define I40E_AQ_LB_MODE_NONE	  0x0
+#define I40E_AQ_LB_MODE_EN	  0x01
+#define I40E_AQ_LB_MAC		  0x01
+#define I40E_AQ_LB_MAC_LOCAL_X722 0x04
 /*
  * vlan_id is a 12 bit number.
  * The VFTA array is actually a 4096 bit array, 128 of 32bit elements.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.746741400 +0800
+++ 0116-net-i40e-fix-MAC-loopback-on-X722.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From 6355ff768b0b5871cc82a69194b376db39ee6e9c Mon Sep 17 00:00:00 2001
+From 8cb2ee860c5ed932cd797c1f75ce9fa5770fa396 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6355ff768b0b5871cc82a69194b376db39ee6e9c ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/idpf: reset queue flag when queue is stopped' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (115 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/i40e: fix MAC loopback on X722' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/iavf: fix device stop during reset' " Xueming Li
                     ` (19 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Beilei Xing; +Cc: Jingjing Wu, Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/158c05028fbeb46dbd225167181305a7d0db6047

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 158c05028fbeb46dbd225167181305a7d0db6047 Mon Sep 17 00:00:00 2001
From: Beilei Xing <beilei.xing@intel.com>
Date: Thu, 16 Mar 2023 08:09:21 +0000
Subject: [PATCH] net/idpf: reset queue flag when queue is stopped
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 6eed0be6bd3e268c7bed919a7f2317e0ebaebf38 ]

Reset q_started flag when Rx/Tx queue is stopped.

Fixes: c03af6fa0ef1 ("net/idpf: support queue stop")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/idpf/idpf_rxtx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 5aef8ba2b6..1cbd5be8cc 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -1162,6 +1162,7 @@ idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	}
 
 	rxq = dev->data->rx_queues[rx_queue_id];
+	rxq->q_started = false;
 	if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SINGLE) {
 		rxq->ops->release_mbufs(rxq);
 		reset_single_rx_queue(rxq);
@@ -1193,6 +1194,7 @@ idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	}
 
 	txq = dev->data->tx_queues[tx_queue_id];
+	txq->q_started = false;
 	txq->ops->release_mbufs(txq);
 	if (vport->txq_model == VIRTCHNL2_QUEUE_MODEL_SINGLE) {
 		reset_single_tx_queue(txq);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.775506900 +0800
+++ 0117-net-idpf-reset-queue-flag-when-queue-is-stopped.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From 6eed0be6bd3e268c7bed919a7f2317e0ebaebf38 Mon Sep 17 00:00:00 2001
+From 158c05028fbeb46dbd225167181305a7d0db6047 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 6eed0be6bd3e268c7bed919a7f2317e0ebaebf38 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -19 +21 @@
-index 34205a1025..414f9a37f6 100644
+index 5aef8ba2b6..1cbd5be8cc 100644
@@ -22 +24 @@
-@@ -675,6 +675,7 @@ idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+@@ -1162,6 +1162,7 @@ idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
@@ -29,2 +31,2 @@
- 		idpf_qc_single_rx_queue_reset(rxq);
-@@ -706,6 +707,7 @@ idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
+ 		reset_single_rx_queue(rxq);
+@@ -1193,6 +1194,7 @@ idpf_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
@@ -37 +39 @@
- 		idpf_qc_single_tx_queue_reset(txq);
+ 		reset_single_tx_queue(txq);

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/iavf: fix device stop during reset' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (116 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/idpf: reset queue flag when queue is stopped' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix hairpin Tx queue reference count' " Xueming Li
                     ` (18 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Zhichao Zeng; +Cc: Qi Zhang, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/b836bb43cfaa8a12ecfac6e837d4c20817bf99fd

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From b836bb43cfaa8a12ecfac6e837d4c20817bf99fd Mon Sep 17 00:00:00 2001
From: Zhichao Zeng <zhichaox.zeng@intel.com>
Date: Thu, 16 Mar 2023 15:14:49 +0800
Subject: [PATCH] net/iavf: fix device stop during reset
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 24b8bc86dc489ab77d7de7626cc6af7ac9eaba0b ]

The rte_eth_dev_stop will return wrong value as error will return from
iavf PMD during device reset.

This patch is a work around to fix it by return 0 in dev_stop during
device reset.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 3196210f2c..f6d68403ce 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1065,6 +1065,9 @@ iavf_dev_stop(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	if (vf->vf_reset)
+		return 0;
+
 	if (adapter->closed)
 		return -1;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.798564300 +0800
+++ 0118-net-iavf-fix-device-stop-during-reset.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From 24b8bc86dc489ab77d7de7626cc6af7ac9eaba0b Mon Sep 17 00:00:00 2001
+From b836bb43cfaa8a12ecfac6e837d4c20817bf99fd Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 24b8bc86dc489ab77d7de7626cc6af7ac9eaba0b ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix hairpin Tx queue reference count' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (117 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/iavf: fix device stop during reset' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'examples/l3fwd: remove hash entry number' " Xueming Li
                     ` (17 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Matan Azrad, Viacheslav Ovsiienko, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/e528b4f96cdfaae33f5b308ef075928bf53f3bce

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e528b4f96cdfaae33f5b308ef075928bf53f3bce Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Tue, 7 Mar 2023 12:31:08 +0200
Subject: [PATCH] net/mlx5: fix hairpin Tx queue reference count
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 9284987a85b07e168b165fc258523a3a4fde58e2 ]

When calling the haipin unbind interface, all the hairpin Tx queues
of the port will be unbound from the peer Rx queues. If one of the
Tx queue is working in the auto bind mode, the interface will return
directly.

Only when the Tx and peer Rx ports are the same, the auto bind mode
is supported. In this condition branch, the Tx queue release is
missed and the reference count is not decreased. Then in the port
stop stage, the hardware resources of this Tx queue won't be
freed. There would be some assertion or failure when starting the
port again.

With this commit, the reference count will be operated correctly.

Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index f54443ed1a..6479e44a94 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -896,11 +896,11 @@ mlx5_hairpin_unbind_single_port(struct rte_eth_dev *dev, uint16_t rx_port)
 		}
 		/* Indeed, only the first used queue needs to be checked. */
 		if (txq_ctrl->hairpin_conf.manual_bind == 0) {
+			mlx5_txq_release(dev, i);
 			if (cur_port != rx_port) {
 				rte_errno = EINVAL;
 				DRV_LOG(ERR, "port %u and port %u are in"
 					" auto-bind mode", cur_port, rx_port);
-				mlx5_txq_release(dev, i);
 				return -rte_errno;
 			} else {
 				return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.821499200 +0800
+++ 0119-net-mlx5-fix-hairpin-Tx-queue-reference-count.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From 9284987a85b07e168b165fc258523a3a4fde58e2 Mon Sep 17 00:00:00 2001
+From e528b4f96cdfaae33f5b308ef075928bf53f3bce Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 9284987a85b07e168b165fc258523a3a4fde58e2 ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org
@@ -31 +33 @@
-index 3457bf65d3..bbaa7d2aa0 100644
+index f54443ed1a..6479e44a94 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'examples/l3fwd: remove hash entry number' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (118 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix hairpin Tx queue reference count' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'doc: fix LPM support in l3forward guide' " Xueming Li
                     ` (16 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Kamalakshitha Aligeri
  Cc: Honnappa Nagarahalli, Ruifeng Wang, Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/003a860c86a4cb826f380ba7910e38865d786763

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 003a860c86a4cb826f380ba7910e38865d786763 Mon Sep 17 00:00:00 2001
From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Date: Mon, 6 Mar 2023 16:25:06 +0000
Subject: [PATCH] examples/l3fwd: remove hash entry number
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f5251734c5e16db9c9881883f7933bd51a9be861 ]

hash_entry_number in l3fwd is not being used by both lpm and em lookup
method. Removed the global variable hash_entry_number and the function
that parses the hash-entry-number flag.

Fixes: e7e6dd643092 ("examples/l3fwd: support config file for EM")

Signed-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
 examples/l3fwd/l3fwd.h |  1 -
 examples/l3fwd/main.c  | 38 +-------------------------------------
 2 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index ca1426a687..b55855c932 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -55,7 +55,6 @@
 /* 32-bit has less address-space for hugepage memory, limit to 1M entries */
 #define L3FWD_HASH_ENTRIES		(1024*1024*1)
 #endif
-#define HASH_ENTRY_NUMBER_DEFAULT	16
 
 struct parm_cfg {
 	const char *rule_ipv4_name;
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5198ff30dd..a4f061537e 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -89,7 +89,6 @@ uint32_t enabled_port_mask;
 
 /* Used only in exact match mode. */
 int ipv6; /**< ipv6 is false by default. */
-uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT;
 
 struct lcore_conf lcore_conf[RTE_MAX_LCORE];
 
@@ -395,7 +394,6 @@ print_usage(const char *prgname)
 		" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
 		" [--max-pkt-len PKTLEN]"
 		" [--no-numa]"
-		" [--hash-entry-num]"
 		" [--ipv6]"
 		" [--parse-ptype]"
 		" [--per-port-pool]"
@@ -419,7 +417,6 @@ print_usage(const char *prgname)
 		"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
 		"  --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\n"
 		"  --no-numa: Disable numa awareness\n"
-		"  --hash-entry-num: Specify the hash entry number in hexadecimal to be setup\n"
 		"  --ipv6: Set if running ipv6 packets\n"
 		"  --parse-ptype: Set to use software to analyze packet type\n"
 		"  --per-port-pool: Use separate buffer pool per port\n"
@@ -479,22 +476,6 @@ parse_portmask(const char *portmask)
 	return pm;
 }
 
-static int
-parse_hash_entry_number(const char *hash_entry_num)
-{
-	char *end = NULL;
-	unsigned long hash_en;
-	/* parse hexadecimal string */
-	hash_en = strtoul(hash_entry_num, &end, 16);
-	if ((hash_entry_num[0] == '\0') || (end == NULL) || (*end != '\0'))
-		return -1;
-
-	if (hash_en == 0)
-		return -1;
-
-	return hash_en;
-}
-
 static int
 parse_config(const char *q_arg)
 {
@@ -852,14 +833,7 @@ parse_args(int argc, char **argv)
 			break;
 
 		case CMD_LINE_OPT_HASH_ENTRY_NUM_NUM:
-			ret = parse_hash_entry_number(optarg);
-			if ((ret > 0) && (ret <= L3FWD_HASH_ENTRIES)) {
-				hash_entry_number = ret;
-			} else {
-				fprintf(stderr, "invalid hash entry number\n");
-				print_usage(prgname);
-				return -1;
-			}
+			fprintf(stderr, "Hash entry number will be ignored\n");
 			break;
 
 		case CMD_LINE_OPT_PARSE_PTYPE_NUM:
@@ -963,16 +937,6 @@ parse_args(int argc, char **argv)
 		lookup_mode = L3FWD_LOOKUP_LPM;
 	}
 
-	/*
-	 * ipv6 and hash flags are valid only for
-	 * exact match, reset them to default for
-	 * longest-prefix match.
-	 */
-	if (lookup_mode == L3FWD_LOOKUP_LPM) {
-		ipv6 = 0;
-		hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT;
-	}
-
 	/* For ACL, update port config rss hash filter */
 	if (lookup_mode == L3FWD_LOOKUP_ACL) {
 		port_conf.rx_adv_conf.rss_conf.rss_hf |=
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.845674700 +0800
+++ 0120-examples-l3fwd-remove-hash-entry-number.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From f5251734c5e16db9c9881883f7933bd51a9be861 Mon Sep 17 00:00:00 2001
+From 003a860c86a4cb826f380ba7910e38865d786763 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f5251734c5e16db9c9881883f7933bd51a9be861 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -19,2 +21,2 @@
- examples/l3fwd/main.c  | 37 +------------------------------------
- 2 files changed, 1 insertion(+), 37 deletions(-)
+ examples/l3fwd/main.c  | 38 +-------------------------------------
+ 2 files changed, 1 insertion(+), 38 deletions(-)
@@ -35 +37 @@
-index 71a3018036..a4f061537e 100644
+index 5198ff30dd..a4f061537e 100644
@@ -101 +103 @@
-@@ -963,15 +937,6 @@ parse_args(int argc, char **argv)
+@@ -963,16 +937,6 @@ parse_args(int argc, char **argv)
@@ -106,2 +108,2 @@
--	 * hash flag is valid only for
--	 * exact match, reset it to default for
+-	 * ipv6 and hash flags are valid only for
+-	 * exact match, reset them to default for
@@ -110,0 +113 @@
+-		ipv6 = 0;

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'doc: fix LPM support in l3forward guide' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (119 preceding siblings ...)
  2023-04-09 15:25   ` patch 'examples/l3fwd: remove hash entry number' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix egress group translation in HWS' " Xueming Li
                     ` (15 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Kamalakshitha Aligeri
  Cc: Honnappa Nagarahalli, Ruifeng Wang, Konstantin Ananyev, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/3f7e967684e091b4e7004724ae021107db37de3d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3f7e967684e091b4e7004724ae021107db37de3d Mon Sep 17 00:00:00 2001
From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Date: Mon, 6 Mar 2023 16:25:07 +0000
Subject: [PATCH] doc: fix LPM support in l3forward guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 2bf48044dca1892e571fd4964eecaacf6cb0c1c2 ]

LPM based lookup supports both IPv4 and IPv6 forwarding.

Fixes: 6a094e328598 ("examples/l3fwd: implement FIB lookup method")

Signed-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
 doc/guides/sample_app_ug/l3_forward.rst | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
index 94b22da01e..1cc2c1dd1d 100644
--- a/doc/guides/sample_app_ug/l3_forward.rst
+++ b/doc/guides/sample_app_ug/l3_forward.rst
@@ -56,9 +56,8 @@ for the IPv4/IPv6 5-tuple syntax specifically.
 The 5-tuple syntax consists of a source IP address, a destination IP address,
 a source port, a destination port and a protocol identifier.
 
-In the sample application, hash-based, FIB-based and ACL-based forwarding supports
+In the sample application, hash-based, LPM-based, FIB-based and ACL-based forwarding supports
 both IPv4 and IPv6.
-LPM-based forwarding supports IPv4 only.
 During the initialization phase route rules for IPv4 and IPv6 are read from rule files.
 
 Compiling the Application
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.866229900 +0800
+++ 0121-doc-fix-LPM-support-in-l3forward-guide.patch	2023-04-09 21:45:38.779042200 +0800
@@ -1 +1 @@
-From 2bf48044dca1892e571fd4964eecaacf6cb0c1c2 Mon Sep 17 00:00:00 2001
+From 3f7e967684e091b4e7004724ae021107db37de3d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 2bf48044dca1892e571fd4964eecaacf6cb0c1c2 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix egress group translation in HWS' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (120 preceding siblings ...)
  2023-04-09 15:25   ` patch 'doc: fix LPM support in l3forward guide' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix isolated mode if no representor matching' " Xueming Li
                     ` (14 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, Suanming Mou, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/e10c2200535417041f96e9d7d403d6ee3ae6cb29

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From e10c2200535417041f96e9d7d403d6ee3ae6cb29 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Sat, 25 Feb 2023 20:18:09 +0000
Subject: [PATCH] net/mlx5: fix egress group translation in HWS
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 4900c42e0cf035bb3326b46ac3fe615b490c64d7 ]

With HW Steering enabled creating egress template tables and
egress flow rules on E-Switch setups is allowed.
To enable it, PMD creates a set of default egress flow rules
responsible for:

- Storing representor ID (vport tag is used) in HW register.
  This is used for traffic source identification.
- Copying software metadata to proper HW register to allow
  preserving metadata across domains.

Structure of these flow rules and whether they are inserted
depend on the device configuration.
There are the following cases:

1. repr_matching=1 and dv_xmeta_en=4
   - An egress flow rule in group 0 is created for each Tx queue;
   - Flow rule matching SQ number - fills unused REG_C_0 bits
     with vport tag, copies REG_A to REG_C_1 and jumps to group 1.
2. repr_matching=1 and dv_xmeta_en=0
   - An egress flow rule in group 0 is created for each Tx queue;
   - Flow rule matching SQ number - fills unused REG_C_0 bits
     with vport tag and jumps to group 1.
3. repr_matching=0 and dv_xmeta_en=4
   - A single egress flow rule in group 0 is created;
   - Flow rule matches all E-Switch manager TX traffic,
     copies REG_A to REG_C and jumps to group 1.
4. repr_matching=0 and dv_xmeta_en=0 - no default flow rules are added.

When default egress flow rules are required, they are inserted in
group 0 and this group is reserved for PMD purposes.
User created template tables must be created in higher groups.
As a result, on template table creation PMD is translating
the provided group (incrementing it in that case).

Before this patch, a condition used to check if translation of egress
flow group is needed was incorrect. It did not allow translation
if both representor matching AND extended metadata mode were enabled.

This patch fixes this condition - translation is allowed if and only if
representor matching OR extended metadata mode is enabled.

Fixes: 483181f7b6dd ("net/mlx5: support device control of representor matching")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 2fe33bbef8..ead14a0530 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3252,14 +3252,18 @@ flow_hw_translate_group(struct rte_eth_dev *dev,
 						  "group index not supported");
 		*table_group = group + 1;
 	} else if (config->dv_esw_en &&
-		   !(config->repr_matching && config->dv_xmeta_en == MLX5_XMETA_MODE_META32_HWS) &&
+		   (config->repr_matching || config->dv_xmeta_en == MLX5_XMETA_MODE_META32_HWS) &&
 		   cfg->external &&
 		   flow_attr->egress) {
 		/*
-		 * On E-Switch setups, egress group translation is not done if and only if
-		 * representor matching is disabled and legacy metadata mode is selected.
-		 * In all other cases, egree group 0 is reserved for representor tagging flows
-		 * and metadata copy flows.
+		 * On E-Switch setups, default egress flow rules are inserted to allow
+		 * representor matching and/or preserving metadata across steering domains.
+		 * These flow rules are inserted in group 0 and this group is reserved by PMD
+		 * for these purposes.
+		 *
+		 * As a result, if representor matching or extended metadata mode is enabled,
+		 * group provided by the user must be incremented to avoid inserting flow rules
+		 * in group 0.
 		 */
 		if (group > MLX5_HW_MAX_EGRESS_GROUP)
 			return rte_flow_error_set(error, EINVAL,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.888447700 +0800
+++ 0122-net-mlx5-fix-egress-group-translation-in-HWS.patch	2023-04-09 21:45:38.789042200 +0800
@@ -1 +1 @@
-From 4900c42e0cf035bb3326b46ac3fe615b490c64d7 Mon Sep 17 00:00:00 2001
+From e10c2200535417041f96e9d7d403d6ee3ae6cb29 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 4900c42e0cf035bb3326b46ac3fe615b490c64d7 ]
@@ -48 +50,0 @@
-Cc: stable@dpdk.org
@@ -59 +61 @@
-index a3e211633d..a4328a9f50 100644
+index 2fe33bbef8..ead14a0530 100644
@@ -62 +64 @@
-@@ -3415,14 +3415,18 @@ flow_hw_translate_group(struct rte_eth_dev *dev,
+@@ -3252,14 +3252,18 @@ flow_hw_translate_group(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix isolated mode if no representor matching' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (121 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix egress group translation in HWS' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'bus/ifpga: fix devargs handling' " Xueming Li
                     ` (13 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Dariusz Sosnowski; +Cc: Ori Kam, Suanming Mou, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/0680a33bc76cc4d1e5a5835d1d491191feee9ecb

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0680a33bc76cc4d1e5a5835d1d491191feee9ecb Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
Date: Sat, 25 Feb 2023 20:18:10 +0000
Subject: [PATCH] net/mlx5: fix isolated mode if no representor matching
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 042f52ddd71926afacc67209c02486e76ec12fb5 ]

In HW steering mode, when running on an E-Switch setup,
mlx5 PMD provides an ability to enable or disable
representor matching (through `repr_matching_en` device argument).
If representor matching is enabled, any ingress or egress flow rule,
created on any port representor will match traffic related
to that specific port.
If it is disabled, flow rule created on one of the ports,
will match traffic related to all ports.

As a result, when representor matching is disabled,
PMD cannot correctly create control flow rules for receiving
default traffic according to port configuration.
Since each port representor in the same switch domain,
can have different port configuration and flow rules
do not differentiate between ports, these flow rules cannot be
correctly applied.
In that case, each port works in de facto isolated mode.

This patch makes sure that if representor matching is disabled,
port is forced into isolated mode. Disabling flow isolated is forbidden.

Fixes: 483181f7b6dd ("net/mlx5: support device control of representor matching")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 doc/guides/nics/mlx5.rst         |  3 +++
 drivers/net/mlx5/linux/mlx5_os.c | 16 ++++++++++++++++
 drivers/net/mlx5/mlx5_flow.c     |  4 ++++
 3 files changed, 23 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 51f51259e3..75ac2f19b4 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -1121,6 +1121,9 @@ for an additional list of options shared with other mlx5 drivers.
   - 0. If representor matching is disabled, then there will be no implicit
     item added. As a result, ingress flow rules will match traffic
     coming to any port, not only the port on which flow rule is created.
+    Because of that, default flow rules for ingress traffic cannot be created
+    and port starts in isolated mode by default. Port cannot be switched back
+    to non-isolated mode.
 
   - 1. If representor matching is enabled (default setting),
     then each ingress pattern template has an implicit REPRESENTED_PORT
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index a71474c90a..2cce0a7f0f 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1613,6 +1613,22 @@ err_secondary:
 			err = EINVAL;
 			goto error;
 		}
+		/*
+		 * If representor matching is disabled, PMD cannot create default flow rules
+		 * to receive traffic for all ports, since implicit source port match is not added.
+		 * Isolated mode is forced.
+		 */
+		if (priv->sh->config.dv_esw_en && !priv->sh->config.repr_matching) {
+			err = mlx5_flow_isolate(eth_dev, 1, NULL);
+			if (err < 0) {
+				err = -err;
+				goto error;
+			}
+			DRV_LOG(WARNING, "port %u ingress traffic is restricted to defined "
+					 "flow rules (isolated mode) since representor "
+					 "matching is disabled",
+				eth_dev->data->port_id);
+		}
 		return eth_dev;
 #else
 		DRV_LOG(ERR, "DV support is missing for HWS.");
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1768ec3cdb..fd57eafe3a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -7972,6 +7972,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev,
 				   "port must be stopped first");
 		return -rte_errno;
 	}
+	if (!enable && !priv->sh->config.repr_matching)
+		return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+					  "isolated mode cannot be disabled when "
+					  "representor matching is disabled");
 	priv->isolated = !!enable;
 	if (enable)
 		dev->dev_ops = &mlx5_dev_ops_isolate;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.916309700 +0800
+++ 0123-net-mlx5-fix-isolated-mode-if-no-representor-matchin.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 042f52ddd71926afacc67209c02486e76ec12fb5 Mon Sep 17 00:00:00 2001
+From 0680a33bc76cc4d1e5a5835d1d491191feee9ecb Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 042f52ddd71926afacc67209c02486e76ec12fb5 ]
@@ -28 +30,0 @@
-Cc: stable@dpdk.org
@@ -41 +43 @@
-index ddb33d814c..7960a42e9c 100644
+index 51f51259e3..75ac2f19b4 100644
@@ -44 +46 @@
-@@ -1166,6 +1166,9 @@ for an additional list of options shared with other mlx5 drivers.
+@@ -1121,6 +1121,9 @@ for an additional list of options shared with other mlx5 drivers.
@@ -55 +57 @@
-index 569565c727..980234e2ac 100644
+index a71474c90a..2cce0a7f0f 100644
@@ -58 +60 @@
-@@ -1622,6 +1622,22 @@ err_secondary:
+@@ -1613,6 +1613,22 @@ err_secondary:
@@ -82 +84 @@
-index 2514b33332..19f7f92717 100644
+index 1768ec3cdb..fd57eafe3a 100644
@@ -85 +87 @@
-@@ -8395,6 +8395,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev,
+@@ -7972,6 +7972,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'bus/ifpga: fix devargs handling' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (122 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix isolated mode if no representor matching' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/ipn3ke: fix thread exit' " Xueming Li
                     ` (12 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Wei Huang; +Cc: Tianfei Zhang, Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/3bdf07e68240735a4051e3f3cf8dac9943dcfa46

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 3bdf07e68240735a4051e3f3cf8dac9943dcfa46 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Thu, 16 Mar 2023 16:44:12 -0400
Subject: [PATCH] bus/ifpga: fix devargs handling
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8a0b28b4d9581497d7b347c7c8797317707cd58f ]

In function ifpga_scan_one(), variable 'path' is NULL if device argument
'afu_bts' is not set, subsequent string copy with 'path' would lead to
segmentation fault.

Fixes: 6fa4aa2b3645 ("bus/ifpga: fix forcing optional devargs")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/bus/ifpga/ifpga_bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index bb943b58b5..07e316b38e 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -135,6 +135,8 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
 			goto end;
 		}
 		afu_pr_conf.pr_enable = 1;
+		strlcpy(afu_pr_conf.bs_path, path,
+			sizeof(afu_pr_conf.bs_path));
 	} else {
 		afu_pr_conf.pr_enable = 0;
 	}
@@ -174,7 +176,6 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
 		rawdev->dev_ops->dev_start(rawdev))
 		goto end;
 
-	strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path));
 	if (rawdev->dev_ops &&
 		rawdev->dev_ops->firmware_load &&
 		rawdev->dev_ops->firmware_load(rawdev,
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.947147600 +0800
+++ 0124-bus-ifpga-fix-devargs-handling.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 8a0b28b4d9581497d7b347c7c8797317707cd58f Mon Sep 17 00:00:00 2001
+From 3bdf07e68240735a4051e3f3cf8dac9943dcfa46 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8a0b28b4d9581497d7b347c7c8797317707cd58f ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/ipn3ke: fix thread exit' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (123 preceding siblings ...)
  2023-04-09 15:25   ` patch 'bus/ifpga: fix devargs handling' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/ipn3ke: fix representor name' " Xueming Li
                     ` (11 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Wei Huang; +Cc: Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/abe24f4bd04e990c6f422b4bab8a3b178fa2fb26

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From abe24f4bd04e990c6f422b4bab8a3b178fa2fb26 Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Thu, 16 Mar 2023 16:45:06 -0400
Subject: [PATCH] net/ipn3ke: fix thread exit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d8f8e928a7ba23283300b1b80259d0c102348005 ]

Thread does not exit after driver is removed. When there is no
more representor exist, the variable 'num' will be 0 and thread
can exit safely at this time.

Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 2ef96a984a..e50fc73f43 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -2579,7 +2579,7 @@ ipn3ke_rpst_scan_handle_request(__rte_unused void *param)
 		}
 		rte_delay_us(50 * MS);
 
-		if (num == 0xffffff)
+		if (num == 0 || num == 0xffffff)
 			return NULL;
 	}
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.968606400 +0800
+++ 0125-net-ipn3ke-fix-thread-exit.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From d8f8e928a7ba23283300b1b80259d0c102348005 Mon Sep 17 00:00:00 2001
+From abe24f4bd04e990c6f422b4bab8a3b178fa2fb26 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d8f8e928a7ba23283300b1b80259d0c102348005 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/ipn3ke: fix representor name' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (124 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/ipn3ke: fix thread exit' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'examples/qos_sched: fix config entries in wrong sections' " Xueming Li
                     ` (10 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Wei Huang; +Cc: Rosen Xu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/782eda8807d9b0d9dfa7d22629ad3cb0b637cd4c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 782eda8807d9b0d9dfa7d22629ad3cb0b637cd4c Mon Sep 17 00:00:00 2001
From: Wei Huang <wei.huang@intel.com>
Date: Thu, 16 Mar 2023 16:44:56 -0400
Subject: [PATCH] net/ipn3ke: fix representor name
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f66141886fec510764d7be89a2787e8931a00b77 ]

The device name used in rte_eth_dev_allocated() function
is afu device name instead of representor name, this patch
correct it.

Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
 drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c
index 70a06a3b15..2c15611a23 100644
--- a/drivers/net/ipn3ke/ipn3ke_ethdev.c
+++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c
@@ -558,7 +558,7 @@ static int ipn3ke_vswitch_remove(struct rte_afu_device *afu_dev)
 		snprintf(name, sizeof(name), "net_%s_representor_%d",
 			afu_dev->device.name, i);
 
-		ethdev = rte_eth_dev_allocated(afu_dev->device.name);
+		ethdev = rte_eth_dev_allocated(name);
 		if (ethdev != NULL)
 			rte_eth_dev_destroy(ethdev, ipn3ke_rpst_uninit);
 	}
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:41.994103100 +0800
+++ 0126-net-ipn3ke-fix-representor-name.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From f66141886fec510764d7be89a2787e8931a00b77 Mon Sep 17 00:00:00 2001
+From 782eda8807d9b0d9dfa7d22629ad3cb0b637cd4c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f66141886fec510764d7be89a2787e8931a00b77 ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'examples/qos_sched: fix config entries in wrong sections' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (125 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/ipn3ke: fix representor name' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'app/testpmd: fix encap/decap size calculation' " Xueming Li
                     ` (9 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/6a3a2809eb5392c20d34bee58cb5292b67980134

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 6a3a2809eb5392c20d34bee58cb5292b67980134 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 21 Mar 2023 13:13:49 +0000
Subject: [PATCH] examples/qos_sched: fix config entries in wrong sections
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 86dfed2a8ed704e013f054985a92d46f07ff48d1 ]

When specifying the QoS config, the profiles to be used for each pipe
within a subport must be specified in the subport section, not in the
section for the subport profile itself. Similarly for subport profiles,
those should be specified in the port section.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/qos_sched/profile.cfg     | 6 +++---
 examples/qos_sched/profile_ov.cfg  | 6 +++---
 examples/qos_sched/profile_pie.cfg | 6 +++---
 examples/qos_sched/profile_red.cfg | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/examples/qos_sched/profile.cfg b/examples/qos_sched/profile.cfg
index e8de101b6c..00d4c7c1a5 100644
--- a/examples/qos_sched/profile.cfg
+++ b/examples/qos_sched/profile.cfg
@@ -26,6 +26,8 @@ number of subports per port = 1
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
+pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
+
 [subport profile 0]
 tb rate = 1250000000           ; Bytes per second
 tb size = 1000000              ; Bytes
@@ -46,8 +48,6 @@ tc 12 rate = 1250000000        ; Bytes per second
 
 tc period = 10                 ; Milliseconds
 
-pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
-
 ; Pipe configuration
 [pipe profile 0]
 tb rate = 305175               ; Bytes per second
@@ -71,4 +71,4 @@ tc period = 40                ; Milliseconds
 
 tc 12 oversubscription weight = 1
 
-tc 12 wrr weights = 1 1 1 1
\ No newline at end of file
+tc 12 wrr weights = 1 1 1 1
diff --git a/examples/qos_sched/profile_ov.cfg b/examples/qos_sched/profile_ov.cfg
index 14c89ae340..b6fe21ee1e 100644
--- a/examples/qos_sched/profile_ov.cfg
+++ b/examples/qos_sched/profile_ov.cfg
@@ -6,12 +6,14 @@
 frame overhead = 24
 number of subports per port = 1
 
+subport 0-8 = 0
+
 ; Subport configuration
 [subport 0]
 number of pipes per subport = 32
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
-subport 0-8 = 0
+pipe 0-31 = 0               ; These pipes are configured with pipe profile 0
 
 [subport profile 0]
 tb rate = 8400000           ; Bytes per second
@@ -32,8 +34,6 @@ tc 11 rate = 8400000         ; Bytes per second
 tc 12 rate = 8400000         ; Bytes per second
 tc period = 10              ; Milliseconds
 
-pipe 0-31 = 0               ; These pipes are configured with pipe profile 0
-
 ; Pipe configuration
 [pipe profile 0]
 tb rate = 16800000             ; Bytes per second
diff --git a/examples/qos_sched/profile_pie.cfg b/examples/qos_sched/profile_pie.cfg
index 241f748b33..bbc09d912b 100644
--- a/examples/qos_sched/profile_pie.cfg
+++ b/examples/qos_sched/profile_pie.cfg
@@ -21,12 +21,14 @@
 frame overhead = 24
 number of subports per port = 1
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
 ; Subport configuration
 [subport 0]
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
-subport 0-8 = 0                ; These subports are configured with subport profile 0
+pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
 
 [subport profile 0]
 tb rate = 1250000000           ; Bytes per second
@@ -48,8 +50,6 @@ tc 12 rate = 1250000000        ; Bytes per second
 
 tc period = 10                 ; Milliseconds
 
-pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
-
 ; Pipe configuration
 [pipe profile 0]
 tb rate = 305175               ; Bytes per second
diff --git a/examples/qos_sched/profile_red.cfg b/examples/qos_sched/profile_red.cfg
index 4486d2799e..cee1470fd7 100644
--- a/examples/qos_sched/profile_red.cfg
+++ b/examples/qos_sched/profile_red.cfg
@@ -21,12 +21,14 @@
 frame overhead = 24
 number of subports per port = 1
 
+subport 0-8 = 0                ; These subports are configured with subport profile 0
+
 ; Subport configuration
 [subport 0]
 number of pipes per subport = 4096
 queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64
 
-subport 0-8 = 0                ; These subports are configured with subport profile 0
+pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
 
 [subport profile 0]
 tb rate = 1250000000           ; Bytes per second
@@ -48,8 +50,6 @@ tc 12 rate = 1250000000        ; Bytes per second
 
 tc period = 10                 ; Milliseconds
 
-pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0
-
 ; Pipe configuration
 [pipe profile 0]
 tb rate = 305175               ; Bytes per second
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.016427900 +0800
+++ 0127-examples-qos_sched-fix-config-entries-in-wrong-secti.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 86dfed2a8ed704e013f054985a92d46f07ff48d1 Mon Sep 17 00:00:00 2001
+From 6a3a2809eb5392c20d34bee58cb5292b67980134 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 86dfed2a8ed704e013f054985a92d46f07ff48d1 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'app/testpmd: fix encap/decap size calculation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (126 preceding siblings ...)
  2023-04-09 15:25   ` patch 'examples/qos_sched: fix config entries in wrong sections' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5/hws: fix pattern creation' " Xueming Li
                     ` (8 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Michael Baum; +Cc: Ori Kam, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1cbb884f358ba31219bd9e981bc28c5e2bf349c7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1cbb884f358ba31219bd9e981bc28c5e2bf349c7 Mon Sep 17 00:00:00 2001
From: Michael Baum <michaelba@nvidia.com>
Date: Thu, 16 Mar 2023 20:24:12 +0200
Subject: [PATCH] app/testpmd: fix encap/decap size calculation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 7bdf7a13ae34dd9c5d8a6aeef7019003dade6f83 ]

Testpmd app has some functions to create either encap or decap buffer
for some special cases:
 - "l2_encap" and "l2_decap"
 - "mplsogre_encap" and "mplsogre_decap"
 - "mplsoudp_encap" and "mplsoudp_decap"

The functions use both "rte_flow_item_eth" and "rte_flow_item_vlan"
structures to represent the headers and copy them into "raw_encap"
action. The size of either "raw_encap" or "raw_decap" is calculated as
sum of headers size.

However, the both "rte_flow_item_eth" and "rte_flow_item_vlan" contain
more fields than original headers, so using them cause bad size
calculation.

This patch uses "rte_ether_hdr" and "rte_vlan_hdr" structures for header
size calculation.

Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 app/test-pmd/cmdline_flow.c | 48 ++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..042da57a61 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -7737,15 +7737,15 @@ parse_vc_action_l2_encap(struct context *ctx, const struct token *token,
 	       l2_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(eth.src.addr_bytes,
 	       l2_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (l2_encap_conf.select_vlan) {
 		if (l2_encap_conf.select_ipv4)
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		else
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	action_encap_data->conf.size = header -
 		action_encap_data->data;
@@ -7793,11 +7793,11 @@ parse_vc_action_l2_decap(struct context *ctx, const struct token *token,
 	header = action_decap_data->data;
 	if (l2_decap_conf.select_vlan)
 		eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (l2_decap_conf.select_vlan) {
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	action_decap_data->conf.size = header -
 		action_decap_data->data;
@@ -7877,15 +7877,15 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token,
 	       mplsogre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(eth.src.addr_bytes,
 	       mplsogre_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (mplsogre_encap_conf.select_vlan) {
 		if (mplsogre_encap_conf.select_ipv4)
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		else
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	if (mplsogre_encap_conf.select_ipv4) {
 		memcpy(header, &ipv4, sizeof(ipv4));
@@ -7972,15 +7972,15 @@ parse_vc_action_mplsogre_decap(struct context *ctx, const struct token *token,
 	       mplsogre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(eth.src.addr_bytes,
 	       mplsogre_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (mplsogre_encap_conf.select_vlan) {
 		if (mplsogre_encap_conf.select_ipv4)
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		else
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	if (mplsogre_encap_conf.select_ipv4) {
 		memcpy(header, &ipv4, sizeof(ipv4));
@@ -8071,15 +8071,15 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token,
 	       mplsoudp_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(eth.src.addr_bytes,
 	       mplsoudp_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (mplsoudp_encap_conf.select_vlan) {
 		if (mplsoudp_encap_conf.select_ipv4)
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		else
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	if (mplsoudp_encap_conf.select_ipv4) {
 		memcpy(header, &ipv4, sizeof(ipv4));
@@ -8168,15 +8168,15 @@ parse_vc_action_mplsoudp_decap(struct context *ctx, const struct token *token,
 	       mplsoudp_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
 	memcpy(eth.src.addr_bytes,
 	       mplsoudp_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
-	memcpy(header, &eth, sizeof(eth));
-	header += sizeof(eth);
+	memcpy(header, &eth.hdr, sizeof(struct rte_ether_hdr));
+	header += sizeof(struct rte_ether_hdr);
 	if (mplsoudp_encap_conf.select_vlan) {
 		if (mplsoudp_encap_conf.select_ipv4)
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
 		else
 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
-		memcpy(header, &vlan, sizeof(vlan));
-		header += sizeof(vlan);
+		memcpy(header, &vlan.hdr, sizeof(struct rte_vlan_hdr));
+		header += sizeof(struct rte_vlan_hdr);
 	}
 	if (mplsoudp_encap_conf.select_ipv4) {
 		memcpy(header, &ipv4, sizeof(ipv4));
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.040054800 +0800
+++ 0128-app-testpmd-fix-encap-decap-size-calculation.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 7bdf7a13ae34dd9c5d8a6aeef7019003dade6f83 Mon Sep 17 00:00:00 2001
+From 1cbb884f358ba31219bd9e981bc28c5e2bf349c7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 7bdf7a13ae34dd9c5d8a6aeef7019003dade6f83 ]
@@ -26 +28,0 @@
-Cc: stable@dpdk.org
@@ -36 +38 @@
-index 9309607f11..58939ec321 100644
+index 88108498e0..042da57a61 100644
@@ -39 +41 @@
-@@ -8245,15 +8245,15 @@ parse_vc_action_l2_encap(struct context *ctx, const struct token *token,
+@@ -7737,15 +7737,15 @@ parse_vc_action_l2_encap(struct context *ctx, const struct token *token,
@@ -41 +43 @@
- 	memcpy(eth.hdr.src_addr.addr_bytes,
+ 	memcpy(eth.src.addr_bytes,
@@ -49 +51 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
@@ -51 +53 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
@@ -59 +61 @@
-@@ -8301,11 +8301,11 @@ parse_vc_action_l2_decap(struct context *ctx, const struct token *token,
+@@ -7793,11 +7793,11 @@ parse_vc_action_l2_decap(struct context *ctx, const struct token *token,
@@ -62 +64 @@
- 		eth.hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
+ 		eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
@@ -75 +77 @@
-@@ -8385,15 +8385,15 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token,
+@@ -7877,15 +7877,15 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token,
@@ -77 +79 @@
- 	memcpy(eth.hdr.src_addr.addr_bytes,
+ 	memcpy(eth.src.addr_bytes,
@@ -85 +87 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
@@ -87 +89 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
@@ -95 +97 @@
-@@ -8480,15 +8480,15 @@ parse_vc_action_mplsogre_decap(struct context *ctx, const struct token *token,
+@@ -7972,15 +7972,15 @@ parse_vc_action_mplsogre_decap(struct context *ctx, const struct token *token,
@@ -97 +99 @@
- 	memcpy(eth.hdr.src_addr.addr_bytes,
+ 	memcpy(eth.src.addr_bytes,
@@ -105 +107 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
@@ -107 +109 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
@@ -115 +117 @@
-@@ -8579,15 +8579,15 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token,
+@@ -8071,15 +8071,15 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token,
@@ -117 +119 @@
- 	memcpy(eth.hdr.src_addr.addr_bytes,
+ 	memcpy(eth.src.addr_bytes,
@@ -125 +127 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
@@ -127 +129 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
@@ -135 +137 @@
-@@ -8676,15 +8676,15 @@ parse_vc_action_mplsoudp_decap(struct context *ctx, const struct token *token,
+@@ -8168,15 +8168,15 @@ parse_vc_action_mplsoudp_decap(struct context *ctx, const struct token *token,
@@ -137 +139 @@
- 	memcpy(eth.hdr.src_addr.addr_bytes,
+ 	memcpy(eth.src.addr_bytes,
@@ -145 +147 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
@@ -147 +149 @@
- 			vlan.hdr.eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);
+ 			vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5/hws: fix pattern creation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (127 preceding siblings ...)
  2023-04-09 15:25   ` patch 'app/testpmd: fix encap/decap size calculation' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix build with GCC 12 and ASan' " Xueming Li
                     ` (7 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Erez Shitrit; +Cc: Alex Vesker, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/d4335766d408b7586fa0af976a612bda42611d27

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d4335766d408b7586fa0af976a612bda42611d27 Mon Sep 17 00:00:00 2001
From: Erez Shitrit <erezsh@nvidia.com>
Date: Wed, 22 Mar 2023 16:41:17 +0200
Subject: [PATCH] net/mlx5/hws: fix pattern creation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 97e1a2ffc6615e1ace06049ee443af6551496194 ]

When creating a new pattern the data area should be clean, otherwise
when the data will come from the arg object it will do OR operation on
the data part in the pattern and use the dirty area as is.

Now we clean the data area on each pattern creation.

Fixes: f8c8a6d8440d ("net/mlx5/hws: add action object")

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 721376b8da..acad42e12e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -507,9 +507,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
 	uint32_t in[MLX5_ST_SZ_DW(create_header_modify_pattern_in)] = {0};
 	uint32_t out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {0};
 	struct mlx5dr_devx_obj *devx_obj;
-	void *pattern_data;
+	uint64_t *pattern_data;
+	int num_of_actions;
 	void *pattern;
 	void *attr;
+	int i;
 
 	if (pattern_length > MAX_ACTIONS_DATA_IN_HEADER_MODIFY) {
 		DR_LOG(ERR, "Pattern length %d exceeds limit %d",
@@ -535,9 +537,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
 	/* Pattern_length is in ddwords */
 	MLX5_SET(header_modify_pattern_in, pattern, pattern_length, pattern_length / (2 * DW_SIZE));
 
-	pattern_data = MLX5_ADDR_OF(header_modify_pattern_in, pattern, pattern_data);
+	pattern_data = (uint64_t *)MLX5_ADDR_OF(header_modify_pattern_in, pattern, pattern_data);
 	memcpy(pattern_data, actions, pattern_length);
 
+	num_of_actions = pattern_length / MLX5DR_MODIFY_ACTION_SIZE;
+	for (i = 0; i < num_of_actions; i++) {
+		int type;
+
+		type = MLX5_GET(set_action_in, &pattern_data[i], action_type);
+		if (type != MLX5_MODIFICATION_TYPE_COPY)
+			/* Action typ-copy use all bytes for control */
+			MLX5_SET(set_action_in, &pattern_data[i], data, 0);
+	}
+
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
 		DR_LOG(ERR, "Failed to create header_modify_pattern");
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.068737600 +0800
+++ 0129-net-mlx5-hws-fix-pattern-creation.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From 97e1a2ffc6615e1ace06049ee443af6551496194 Mon Sep 17 00:00:00 2001
+From d4335766d408b7586fa0af976a612bda42611d27 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 97e1a2ffc6615e1ace06049ee443af6551496194 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org
@@ -23 +25 @@
-index a444fb4438..0adcedd9c9 100644
+index 721376b8da..acad42e12e 100644
@@ -26 +28 @@
-@@ -523,9 +523,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
+@@ -507,9 +507,11 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
@@ -39 +41 @@
-@@ -551,9 +553,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
+@@ -535,9 +537,19 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix build with GCC 12 and ASan' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (128 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5/hws: fix pattern creation' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5/hws: fix error code of send queue action' " Xueming Li
                     ` (6 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: David Marchand; +Cc: Raslan Darawsheh, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/644bcdb856d6f2cc6e82ffb5d7e7bf852852b6a1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 644bcdb856d6f2cc6e82ffb5d7e7bf852852b6a1 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 22 Mar 2023 18:06:27 +0100
Subject: [PATCH] net/mlx5: fix build with GCC 12 and ASan
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit e17840756179410283ef03660578310874432f40 ]

Building with gcc 12 and ASan raises this warning:

../drivers/net/mlx5/mlx5_txpp.c: In function ‘mlx5_txpp_xstats_get_names’:
../drivers/net/mlx5/mlx5_txpp.c:1066:25: error: ‘strncpy’ specified bound
	64 equals destination size [-Werror=stringop-truncation]
 1066 |                         strncpy(xstats_names[i + n_used].name,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1067 |                                 mlx5_txpp_stat_names[i],
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
 1068 |                                 RTE_ETH_XSTATS_NAME_SIZE);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Prefer strlcpy for xstats.

Fixes: 3b025c0ca425 ("net/mlx5: provide send scheduling error statistics")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
---
 drivers/net/mlx5/mlx5_stats.c | 3 +--
 drivers/net/mlx5/mlx5_txpp.c  | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index f64fa3587b..615e1d073d 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -288,10 +288,9 @@ mlx5_xstats_get_names(struct rte_eth_dev *dev,
 
 	if (n >= mlx5_xstats_n && xstats_names) {
 		for (i = 0; i != mlx5_xstats_n; ++i) {
-			strncpy(xstats_names[i].name,
+			strlcpy(xstats_names[i].name,
 				xstats_ctrl->info[i].dpdk_name,
 				RTE_ETH_XSTATS_NAME_SIZE);
-			xstats_names[i].name[RTE_ETH_XSTATS_NAME_SIZE - 1] = 0;
 		}
 	}
 	mlx5_xstats_n = mlx5_txpp_xstats_get_names(dev, xstats_names,
diff --git a/drivers/net/mlx5/mlx5_txpp.c b/drivers/net/mlx5/mlx5_txpp.c
index 63d98dbde9..0e1da1d5f5 100644
--- a/drivers/net/mlx5/mlx5_txpp.c
+++ b/drivers/net/mlx5/mlx5_txpp.c
@@ -1063,11 +1063,9 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
 
 	if (n >= n_used + n_txpp && xstats_names) {
 		for (i = 0; i < n_txpp; ++i) {
-			strncpy(xstats_names[i + n_used].name,
+			strlcpy(xstats_names[i + n_used].name,
 				mlx5_txpp_stat_names[i],
 				RTE_ETH_XSTATS_NAME_SIZE);
-			xstats_names[i + n_used].name
-					[RTE_ETH_XSTATS_NAME_SIZE - 1] = 0;
 		}
 	}
 	return n_used + n_txpp;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.091907500 +0800
+++ 0130-net-mlx5-fix-build-with-GCC-12-and-ASan.patch	2023-04-09 21:45:38.799042200 +0800
@@ -1 +1 @@
-From e17840756179410283ef03660578310874432f40 Mon Sep 17 00:00:00 2001
+From 644bcdb856d6f2cc6e82ffb5d7e7bf852852b6a1 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit e17840756179410283ef03660578310874432f40 ]
@@ -25 +27,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5/hws: fix error code of send queue action' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (129 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix build with GCC 12 and ASan' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix CQE dump for Tx' " Xueming Li
                     ` (5 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Alex Vesker; +Cc: Erez Shitrit, Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1f4de71406e27229e0e941a196605490e2de4aed

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 1f4de71406e27229e0e941a196605490e2de4aed Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex@nvidia.com>
Date: Thu, 23 Mar 2023 14:34:14 +0200
Subject: [PATCH] net/mlx5/hws: fix error code of send queue action
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 8ae49a5edb5b1a64716b00bd644c57278d1801fe ]

The rte_errno should be set to a positive error value
while the ret of the function should return a negative
value this aligns code to other mlx5dr API functions.

Fixes: 3eb748869d2d ("net/mlx5/hws: add send layer")

Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_send.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index 5c8bbe6fc6..a8aba31cbe 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -842,8 +842,8 @@ int mlx5dr_send_queue_action(struct mlx5dr_context *ctx,
 			/* Signal on the last posted WQE */
 			mlx5dr_send_engine_flush_queue(queue);
 	} else {
-		rte_errno = -EINVAL;
-		return rte_errno;
+		rte_errno = EINVAL;
+		return -rte_errno;
 	}
 
 	return 0;
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.115619200 +0800
+++ 0131-net-mlx5-hws-fix-error-code-of-send-queue-action.patch	2023-04-09 21:45:38.809042200 +0800
@@ -1 +1 @@
-From 8ae49a5edb5b1a64716b00bd644c57278d1801fe Mon Sep 17 00:00:00 2001
+From 1f4de71406e27229e0e941a196605490e2de4aed Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 8ae49a5edb5b1a64716b00bd644c57278d1801fe ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index 51aaf5c8e2..d650c55124 100644
+index 5c8bbe6fc6..a8aba31cbe 100644
@@ -24,4 +26,4 @@
-@@ -1007,8 +1007,8 @@ int mlx5dr_send_queue_action(struct mlx5dr_context *ctx,
- 
- 		break;
- 	default:
+@@ -842,8 +842,8 @@ int mlx5dr_send_queue_action(struct mlx5dr_context *ctx,
+ 			/* Signal on the last posted WQE */
+ 			mlx5dr_send_engine_flush_queue(queue);
+ 	} else {

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix CQE dump for Tx' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (130 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5/hws: fix error code of send queue action' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'net/mlx5: fix sysfs port name translation' " Xueming Li
                     ` (4 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/80ec04827faa12d2a5c2dfb0405669b9544dfde5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 80ec04827faa12d2a5c2dfb0405669b9544dfde5 Mon Sep 17 00:00:00 2001
From: Alexander Kozyrev <akozyrev@nvidia.com>
Date: Fri, 24 Mar 2023 01:51:40 +0200
Subject: [PATCH] net/mlx5: fix CQE dump for Tx
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit cd4158177434d557742b4bb0fbe68e59d2c2db21 ]

The regular CQE size can be 64 bytes or 128 bytes depending
on the cache line size. The error CQE is always 64 bytes long.
Only 64 bytes are dumped to the log file in case of Tx queue
recovery form the error. Use the CQE size, not the error CQE size.

Fixes: 957e45fb7bcb ("net/mlx5: handle Tx completion with error")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_tx.c b/drivers/net/mlx5/mlx5_tx.c
index a13c7e937c..14e1487e59 100644
--- a/drivers/net/mlx5/mlx5_tx.c
+++ b/drivers/net/mlx5/mlx5_tx.c
@@ -107,7 +107,7 @@ mlx5_tx_error_cqe_handle(struct mlx5_txq_data *__rte_restrict txq,
 			mlx5_dump_debug_information(name, "MLX5 Error CQ:",
 						    (const void *)((uintptr_t)
 						    txq->cqes),
-						    sizeof(*err_cqe) *
+						    sizeof(struct mlx5_cqe) *
 						    (1 << txq->cqe_n));
 			mlx5_dump_debug_information(name, "MLX5 Error SQ:",
 						    (const void *)((uintptr_t)
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.137999700 +0800
+++ 0132-net-mlx5-fix-CQE-dump-for-Tx.patch	2023-04-09 21:45:38.809042200 +0800
@@ -1 +1 @@
-From cd4158177434d557742b4bb0fbe68e59d2c2db21 Mon Sep 17 00:00:00 2001
+From 80ec04827faa12d2a5c2dfb0405669b9544dfde5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit cd4158177434d557742b4bb0fbe68e59d2c2db21 ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'net/mlx5: fix sysfs port name translation' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (131 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix CQE dump for Tx' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'doc: fix code blocks in cryptodev guide' " Xueming Li
                     ` (3 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Bing Zhao; +Cc: Matan Azrad, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/2fe7fcc1a35b392a1e1903a2d047829621744c8d

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 2fe7fcc1a35b392a1e1903a2d047829621744c8d Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz@nvidia.com>
Date: Thu, 23 Mar 2023 12:54:14 +0200
Subject: [PATCH] net/mlx5: fix sysfs port name translation
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit f8a226ed65fa1c6e085fb0d5a91bab7fb5034aec ]

With some OFED or upstream kernel of mlx5, the port name fetched from
"/sys/class/net/[DEV]/phys_port_name" may have a tailing "\n" as the
EOL. The sscanf() will return the scanned items number with this EOL.

In such case, the "equal to" condition is considered as false and
the function mlx5_translate_port_name() will recognize the port type
wrongly with UNKNOWN result.

The tailing carriage return character should be removed before
calling the mlx5_translate_port_name(), this was already done in the
NL message handling. In the meanwhile, the possible incorrect line
feed character is also taken into consideration.

Fixes: 654810b56828 ("common/mlx5: share Netlink commands")
Fixes: 420bbdae89f2 ("net/mlx5: fix host physical function representor naming")

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index f1ff6f49f9..55801534d1 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -1035,7 +1035,8 @@ int
 mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 {
 	char ifname[IF_NAMESIZE];
-	char port_name[IF_NAMESIZE];
+	char *port_name = NULL;
+	size_t port_name_size = 0;
 	FILE *file;
 	struct mlx5_switch_info data = {
 		.master = 0,
@@ -1048,6 +1049,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 	bool port_switch_id_set = false;
 	bool device_dir = false;
 	char c;
+	ssize_t line_size;
 
 	if (!if_indextoname(ifindex, ifname)) {
 		rte_errno = errno;
@@ -1063,8 +1065,21 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 
 	file = fopen(phys_port_name, "rb");
 	if (file != NULL) {
-		if (fgets(port_name, IF_NAMESIZE, file) != NULL)
+		char *tail_nl;
+
+		line_size = getline(&port_name, &port_name_size, file);
+		if (line_size < 0) {
+			fclose(file);
+			rte_errno = errno;
+			return -rte_errno;
+		} else if (line_size > 0) {
+			/* Remove tailing newline character. */
+			tail_nl = strchr(port_name, '\n');
+			if (tail_nl)
+				*tail_nl = '\0';
 			mlx5_translate_port_name(port_name, &data);
+		}
+		free(port_name);
 		fclose(file);
 	}
 	file = fopen(phys_switch_id, "rb");
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.165751400 +0800
+++ 0133-net-mlx5-fix-sysfs-port-name-translation.patch	2023-04-09 21:45:38.809042200 +0800
@@ -1 +1 @@
-From f8a226ed65fa1c6e085fb0d5a91bab7fb5034aec Mon Sep 17 00:00:00 2001
+From 2fe7fcc1a35b392a1e1903a2d047829621744c8d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit f8a226ed65fa1c6e085fb0d5a91bab7fb5034aec ]
@@ -21 +23,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'doc: fix code blocks in cryptodev guide' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (132 preceding siblings ...)
  2023-04-09 15:25   ` patch 'net/mlx5: fix sysfs port name translation' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'test/crypto: fix statistics error messages' " Xueming Li
                     ` (2 subsequent siblings)
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Akhil Goyal; +Cc: David Marchand, Ciara Power, Hemant Agrawal, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/95c2df95d259bd8c8429fc196a6cba508cbc2be7

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 95c2df95d259bd8c8429fc196a6cba508cbc2be7 Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil@marvell.com>
Date: Tue, 21 Mar 2023 18:35:27 +0530
Subject: [PATCH] doc: fix code blocks in cryptodev guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ]

Certain structures were replicated in programmer's guide,
which resulted in mismatch when that structure is changed
in future releases.
Added literal includes to copy code block while compiling.

Fixes: 0318c02b57cf ("doc: add cryptodev chapter in prog guide")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 doc/guides/prog_guide/cryptodev_lib.rst | 121 ++++--------------------
 lib/cryptodev/rte_crypto_sym.h          |   4 +
 lib/cryptodev/rte_cryptodev.h           |   6 ++
 3 files changed, 31 insertions(+), 100 deletions(-)

diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst
index 0d9f7059ea..2b513bbf82 100644
--- a/doc/guides/prog_guide/cryptodev_lib.rst
+++ b/doc/guides/prog_guide/cryptodev_lib.rst
@@ -98,14 +98,10 @@ The rte_cryptodev_configure API is used to configure a Crypto device.
 The ``rte_cryptodev_config`` structure is used to pass the configuration
 parameters for socket selection and number of queue pairs.
 
-.. code-block:: c
-
-    struct rte_cryptodev_config {
-        int socket_id;
-        /**< Socket to allocate resources on */
-        uint16_t nb_queue_pairs;
-        /**< Number of queue pairs to configure on device */
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_config 8<
+   :end-before: >8 End of structure rte_cryptodev_config.
 
 
 Configuration of Queue Pairs
@@ -121,11 +117,11 @@ Each queue pairs resources may be allocated on a specified socket.
                 const struct rte_cryptodev_qp_conf *qp_conf,
                 int socket_id)
 
-   struct rte_cryptodev_qp_conf {
-        uint32_t nb_descriptors; /**< Number of descriptors per queue pair */
-        struct rte_mempool *mp_session;
-        /**< The mempool for creating session in sessionless mode */
-    };
+
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_qp_conf 8<
+   :end-before: >8 End of structure rte_cryptodev_qp_conf.
 
 
 The field ``mp_session`` is used for creating temporary session to process
@@ -271,23 +267,10 @@ This allows the user to query a specific Crypto PMD and get all the device
 features and capabilities. The ``rte_cryptodev_info`` structure contains all the
 relevant information for the device.
 
-.. code-block:: c
-
-    struct rte_cryptodev_info {
-        const char *driver_name;
-        uint8_t driver_id;
-        struct rte_device *device;
-
-        uint64_t feature_flags;
-
-        const struct rte_cryptodev_capabilities *capabilities;
-
-        unsigned max_nb_queue_pairs;
-
-        struct {
-            unsigned max_nb_sessions;
-        } sym;
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_cryptodev.h
+   :language: c
+   :start-after: Structure rte_cryptodev_info 8<
+   :end-before: >8 End of structure rte_cryptodev_info.
 
 
 Operation Processing
@@ -540,22 +523,10 @@ Currently there are three transforms types cipher, authentication and AEAD.
 Also it is important to note that the order in which the
 transforms are passed indicates the order of the chaining.
 
-.. code-block:: c
-
-    struct rte_crypto_sym_xform {
-        struct rte_crypto_sym_xform *next;
-        /**< next xform in chain */
-        enum rte_crypto_sym_xform_type type;
-        /**< xform type */
-        union {
-            struct rte_crypto_auth_xform auth;
-            /**< Authentication / hash xform */
-            struct rte_crypto_cipher_xform cipher;
-            /**< Cipher xform */
-            struct rte_crypto_aead_xform aead;
-            /**< AEAD xform */
-        };
-    };
+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h
+   :language: c
+   :start-after: Structure rte_crypto_sym_xform 8<
+   :end-before: >8 End of structure rte_crypto_sym_xform.
 
 The API does not place a limit on the number of transforms that can be chained
 together but this will be limited by the underlying Crypto device poll mode
@@ -578,61 +549,11 @@ authentication/ cipher/ AEAD parameters required depending on the type of operat
 specified in the session or the transform
 chain.
 
-.. code-block:: c
+.. literalinclude:: ../../../lib/cryptodev/rte_crypto_sym.h
+   :language: c
+   :start-after: Structure rte_crypto_sym_op 8<
+   :end-before: >8 End of structure rte_crypto_sym_op.
 
-    struct rte_crypto_sym_op {
-        struct rte_mbuf *m_src;
-        struct rte_mbuf *m_dst;
-
-        union {
-            void *session;
-            /**< Handle for the initialised session context */
-            struct rte_crypto_sym_xform *xform;
-            /**< Session-less API Crypto operation parameters */
-        };
-
-        union {
-            struct {
-                struct {
-                    uint32_t offset;
-                    uint32_t length;
-                } data; /**< Data offsets and length for AEAD */
-
-                struct {
-                    uint8_t *data;
-                    rte_iova_t phys_addr;
-                } digest; /**< Digest parameters */
-
-                struct {
-                    uint8_t *data;
-                    rte_iova_t phys_addr;
-                } aad;
-                /**< Additional authentication parameters */
-            } aead;
-
-            struct {
-                struct {
-                    struct {
-                        uint32_t offset;
-                        uint32_t length;
-                    } data; /**< Data offsets and length for ciphering */
-                } cipher;
-
-                struct {
-                    struct {
-                        uint32_t offset;
-                        uint32_t length;
-                    } data;
-                    /**< Data offsets and length for authentication */
-
-                    struct {
-                        uint8_t *data;
-                        rte_iova_t phys_addr;
-                    } digest; /**< Digest parameters */
-                } auth;
-            };
-        };
-    };
 
 Synchronous mode
 ----------------
diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h
index 33b4966e16..0d625ec103 100644
--- a/lib/cryptodev/rte_crypto_sym.h
+++ b/lib/cryptodev/rte_crypto_sym.h
@@ -574,6 +574,7 @@ enum rte_crypto_sym_xform_type {
  * hold a single transform, the type field is used to specify which transform
  * is contained within the union
  */
+/* Structure rte_crypto_sym_xform 8< */
 struct rte_crypto_sym_xform {
 	struct rte_crypto_sym_xform *next;
 	/**< next xform in chain */
@@ -589,6 +590,7 @@ struct rte_crypto_sym_xform {
 		/**< AEAD xform */
 	};
 };
+/* >8 End of structure rte_crypto_sym_xform. */
 
 /**
  * Symmetric Cryptographic Operation.
@@ -620,6 +622,7 @@ struct rte_crypto_sym_xform {
  * destination buffer being at a different alignment, relative to buffer start,
  * to the data in the source buffer.
  */
+/* Structure rte_crypto_sym_op 8< */
 struct rte_crypto_sym_op {
 	struct rte_mbuf *m_src;	/**< source mbuf */
 	struct rte_mbuf *m_dst;	/**< destination mbuf */
@@ -881,6 +884,7 @@ struct rte_crypto_sym_op {
 		};
 	};
 };
+/* >8 End of structure rte_crypto_sym_op. */
 
 
 /**
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index ed4112c625..c678a88d7c 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -501,6 +501,7 @@ extern const char *
 rte_cryptodev_get_feature_name(uint64_t flag);
 
 /**  Crypto device information */
+/* Structure rte_cryptodev_info 8< */
 struct rte_cryptodev_info {
 	const char *driver_name;	/**< Driver name. */
 	uint8_t driver_id;		/**< Driver identifier */
@@ -529,6 +530,7 @@ struct rte_cryptodev_info {
 		 */
 	} sym;
 };
+/* >8 End of structure rte_cryptodev_info. */
 
 #define RTE_CRYPTODEV_DETACHED  (0)
 #define RTE_CRYPTODEV_ATTACHED  (1)
@@ -541,11 +543,13 @@ enum rte_cryptodev_event_type {
 };
 
 /** Crypto device queue pair configuration structure. */
+/* Structure rte_cryptodev_qp_conf 8<*/
 struct rte_cryptodev_qp_conf {
 	uint32_t nb_descriptors; /**< Number of descriptors per queue pair */
 	struct rte_mempool *mp_session;
 	/**< The mempool for creating session in sessionless mode */
 };
+/* >8 End of structure rte_cryptodev_qp_conf. */
 
 /**
  * Function type used for processing crypto ops when enqueue/dequeue burst is
@@ -674,6 +678,7 @@ extern int
 rte_cryptodev_socket_id(uint8_t dev_id);
 
 /** Crypto device configuration structure */
+/* Structure rte_cryptodev_config 8< */
 struct rte_cryptodev_config {
 	int socket_id;			/**< Socket to allocate resources on */
 	uint16_t nb_queue_pairs;
@@ -686,6 +691,7 @@ struct rte_cryptodev_config {
 	 *  - RTE_CRYTPODEV_FF_SECURITY
 	 */
 };
+/* >8 End of structure rte_cryptodev_config. */
 
 /**
  * Configure a device.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.197660400 +0800
+++ 0134-doc-fix-code-blocks-in-cryptodev-guide.patch	2023-04-09 21:45:38.809042200 +0800
@@ -1 +1 @@
-From d2d7f0190bce57b2a07942e7c11a1e77a9c029ca Mon Sep 17 00:00:00 2001
+From 95c2df95d259bd8c8429fc196a6cba508cbc2be7 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d2d7f0190bce57b2a07942e7c11a1e77a9c029ca ]
@@ -12 +14,0 @@
-Cc: stable@dpdk.org
@@ -186 +188 @@
-index 2cfe66530c..b43174dbec 100644
+index 33b4966e16..0d625ec103 100644
@@ -189 +191 @@
-@@ -582,6 +582,7 @@ enum rte_crypto_sym_xform_type {
+@@ -574,6 +574,7 @@ enum rte_crypto_sym_xform_type {
@@ -197 +199 @@
-@@ -597,6 +598,7 @@ struct rte_crypto_sym_xform {
+@@ -589,6 +590,7 @@ struct rte_crypto_sym_xform {
@@ -205 +207 @@
-@@ -628,6 +630,7 @@ struct rte_crypto_sym_xform {
+@@ -620,6 +622,7 @@ struct rte_crypto_sym_xform {
@@ -213 +215 @@
-@@ -889,6 +892,7 @@ struct rte_crypto_sym_op {
+@@ -881,6 +884,7 @@ struct rte_crypto_sym_op {
@@ -222 +224 @@
-index 27cdec8495..3a9ad13660 100644
+index ed4112c625..c678a88d7c 100644
@@ -225 +227 @@
-@@ -553,6 +553,7 @@ extern const char *
+@@ -501,6 +501,7 @@ extern const char *
@@ -233 +235 @@
-@@ -581,6 +582,7 @@ struct rte_cryptodev_info {
+@@ -529,6 +530,7 @@ struct rte_cryptodev_info {
@@ -241 +243 @@
-@@ -593,11 +595,13 @@ enum rte_cryptodev_event_type {
+@@ -541,11 +543,13 @@ enum rte_cryptodev_event_type {
@@ -255 +257 @@
-@@ -726,6 +730,7 @@ extern int
+@@ -674,6 +678,7 @@ extern int
@@ -263 +265 @@
-@@ -738,6 +743,7 @@ struct rte_cryptodev_config {
+@@ -686,6 +691,7 @@ struct rte_cryptodev_config {

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'test/crypto: fix statistics error messages' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (133 preceding siblings ...)
  2023-04-09 15:25   ` patch 'doc: fix code blocks in cryptodev guide' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'pdump: fix build with GCC 12' " Xueming Li
  2023-04-09 15:25   ` patch 'acl: fix crash on PPC64 with GCC 11' " Xueming Li
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Saoirse O'Donovan; +Cc: Ciara Power, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/fcf7e0e6f7c46fa0d566b3bc3602c72b786f5be1

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From fcf7e0e6f7c46fa0d566b3bc3602c72b786f5be1 Mon Sep 17 00:00:00 2001
From: Saoirse O'Donovan <saoirse.odonovan@intel.com>
Date: Mon, 20 Mar 2023 09:29:56 +0000
Subject: [PATCH] test/crypto: fix statistics error messages
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 051af8d174dd0f100f407269c25c007216c912ad ]

The test stats testcase was printing the same error message for
multiple errors in the test stats testcase. This is now replaced
with descriptive error messages, which match the cause of the failure.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")

Signed-off-by: Saoirse O'Donovan <saoirse.odonovan@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
 .mailmap                  |  1 +
 app/test/test_cryptodev.c | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/.mailmap b/.mailmap
index 039d487d6d..c09043056c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1168,6 +1168,7 @@ Sangjin Han <sangjin@eecs.berkeley.edu>
 Sankar Chokkalingam <sankarx.chokkalingam@intel.com>
 Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
 Santosh Shukla <santosh.shukla@caviumnetworks.com> <sshukla@mvista.com>
+Saoirse O'Donovan <saoirse.odonovan@intel.com>
 Saori Usami <susami@igel.co.jp>
 Sarath Somasekharan <sarathx.somasekharan@intel.com>
 Sarosh Arif <sarosh.arif@emumba.com>
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 7be4bf40b8..0df4e9fca1 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -11992,11 +11992,11 @@ test_stats(void)
 	TEST_ASSERT((stats.enqueued_count == 1),
 		"rte_cryptodev_stats_get returned unexpected enqueued stat");
 	TEST_ASSERT((stats.dequeued_count == 1),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected dequeued stat");
 	TEST_ASSERT((stats.enqueue_err_count == 0),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected enqueued error count stat");
 	TEST_ASSERT((stats.dequeue_err_count == 0),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected dequeued error count stat");
 
 	/* invalid device but should ignore and not reset device stats*/
 	rte_cryptodev_stats_reset(ts_params->valid_devs[0] + 300);
@@ -12004,7 +12004,7 @@ test_stats(void)
 			&stats),
 		"rte_cryptodev_stats_get failed");
 	TEST_ASSERT((stats.enqueued_count == 1),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected enqueued stat after invalid reset");
 
 	/* check that a valid reset clears stats */
 	rte_cryptodev_stats_reset(ts_params->valid_devs[0]);
@@ -12012,9 +12012,9 @@ test_stats(void)
 			&stats),
 					  "rte_cryptodev_stats_get failed");
 	TEST_ASSERT((stats.enqueued_count == 0),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected enqueued stat after valid reset");
 	TEST_ASSERT((stats.dequeued_count == 0),
-		"rte_cryptodev_stats_get returned unexpected enqueued stat");
+		"rte_cryptodev_stats_get returned unexpected dequeued stat after valid reset");
 
 	return TEST_SUCCESS;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.224267800 +0800
+++ 0135-test-crypto-fix-statistics-error-messages.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From 051af8d174dd0f100f407269c25c007216c912ad Mon Sep 17 00:00:00 2001
+From fcf7e0e6f7c46fa0d566b3bc3602c72b786f5be1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 051af8d174dd0f100f407269c25c007216c912ad ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -21 +23 @@
-index dc30369117..cac02a6f48 100644
+index 039d487d6d..c09043056c 100644
@@ -24 +26 @@
-@@ -1182,6 +1182,7 @@ Sangjin Han <sangjin@eecs.berkeley.edu>
+@@ -1168,6 +1168,7 @@ Sangjin Han <sangjin@eecs.berkeley.edu>
@@ -33 +35 @@
-index f4648755e5..9c670e9a35 100644
+index 7be4bf40b8..0df4e9fca1 100644
@@ -36 +38 @@
-@@ -12341,11 +12341,11 @@ test_stats(void)
+@@ -11992,11 +11992,11 @@ test_stats(void)
@@ -51 +53 @@
-@@ -12353,7 +12353,7 @@ test_stats(void)
+@@ -12004,7 +12004,7 @@ test_stats(void)
@@ -60 +62 @@
-@@ -12361,9 +12361,9 @@ test_stats(void)
+@@ -12012,9 +12012,9 @@ test_stats(void)

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'pdump: fix build with GCC 12' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (134 preceding siblings ...)
  2023-04-09 15:25   ` patch 'test/crypto: fix statistics error messages' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  2023-04-09 15:25   ` patch 'acl: fix crash on PPC64 with GCC 11' " Xueming Li
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: Joyce Kong; +Cc: Ruifeng Wang, Reshma Pattan, Tyler Retzlaff, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ac849cac65a35923ffdb10e04a30ca3a67e6d5da

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From ac849cac65a35923ffdb10e04a30ca3a67e6d5da Mon Sep 17 00:00:00 2001
From: Joyce Kong <joyce.kong@arm.com>
Date: Mon, 27 Mar 2023 07:07:12 +0000
Subject: [PATCH] pdump: fix build with GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit b182466683a5c76657efb4b6b8d43e7d71979034 ]

The following warning is observed with GCC12 compilation
with release 20.11:

In function ‘__rte_ring_enqueue_elems_64’,
    inlined from ‘__rte_ring_enqueue_elems’ at
            ../lib/librte_ring/rte_ring_elem.h:225:3,
    inlined from ‘__rte_ring_do_enqueue_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:424:2,
    inlined from ‘rte_ring_mp_enqueue_burst_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:884:9,
    inlined from ‘rte_ring_enqueue_burst_elem’ at
            ../lib/librte_ring/rte_ring_elem.h:946:10,
    inlined from ‘rte_ring_enqueue_burst’ at
            ../lib/librte_ring/rte_ring.h:721:9,
    inlined from ‘pdump_copy’ at
            ../lib/librte_pdump/rte_pdump.c:94:13:
../lib/librte_ring/rte_ring_elem.h:162:40: warning: ‘*dup_bufs.36_42
+ _89’ may be used uninitialized [-Wmaybe-uninitialized]
  162 |                         ring[idx] = obj[i];
      |                                     ~~~^~~
../lib/librte_ring/rte_ring_elem.h:163:44: warning: ‘*dup_bufs.36_42
+ _98’ may be used uninitialized [-Wmaybe-uninitialized]
  163 |                         ring[idx + 1] = obj[i + 1];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:164:44: warning: ‘*dup_bufs.36_42
+ _107’ may be used uninitialized [-Wmaybe-uninitialized]
  164 |                         ring[idx + 2] = obj[i + 2];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:165:44: warning: ‘*dup_bufs.36_42
+ _116’ may be used uninitialized [-Wmaybe-uninitialized]
  165 |                         ring[idx + 3] = obj[i + 3];
      |                                         ~~~^~~~~~~
../lib/librte_ring/rte_ring_elem.h:169:42: warning: ‘*dup_bufs.36_42
+ _129’ may be used uninitialized [-Wmaybe-uninitialized]
  169 |                         ring[idx++] = obj[i++]; /* fallthrough */
      |                                       ~~~^~~~~
../lib/librte_ring/rte_ring_elem.h:171:42: warning: ‘*dup_bufs.36_42
+ _139’ may be used uninitialized [-Wmaybe-uninitialized]
  171 |                         ring[idx++] = obj[i++]; /* fallthrough */
      |                                       ~~~^~~~~
../lib/librte_ring/rte_ring_elem.h:173:42: warning: ‘*dup_bufs.36_42
+ _149’ may be used uninitialized [-Wmaybe-uninitialized]
  173 |                         ring[idx++] = obj[i++];

Actually, this is an alias warning as -O3 enables strict alias.
This patch fixes it by replacing 'dup_bufs' with '&dup_bufs[0]'
as the compiler represents them differently.

Fixes: 278f945402c5 ("pdump: add new library for packet capture")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/pdump/rte_pdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index a81544cb57..4b7a4b3483 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -134,7 +134,7 @@ pdump_copy(uint16_t port_id, uint16_t queue,
 
 	__atomic_fetch_add(&stats->accepted, d_pkts, __ATOMIC_RELAXED);
 
-	ring_enq = rte_ring_enqueue_burst(ring, (void *)dup_bufs, d_pkts, NULL);
+	ring_enq = rte_ring_enqueue_burst(ring, (void *)&dup_bufs[0], d_pkts, NULL);
 	if (unlikely(ring_enq < d_pkts)) {
 		unsigned int drops = d_pkts - ring_enq;
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.258824700 +0800
+++ 0136-pdump-fix-build-with-GCC-12.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From b182466683a5c76657efb4b6b8d43e7d71979034 Mon Sep 17 00:00:00 2001
+From ac849cac65a35923ffdb10e04a30ca3a67e6d5da Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit b182466683a5c76657efb4b6b8d43e7d71979034 ]
@@ -58 +60,0 @@
-Cc: stable@dpdk.org
@@ -69 +71 @@
-index 9bc4bab4f2..53cca1034d 100644
+index a81544cb57..4b7a4b3483 100644

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'acl: fix crash on PPC64 with GCC 11' has been queued to stable release 22.11.2
  2023-04-09 15:23 ` patch " Xueming Li
                     ` (135 preceding siblings ...)
  2023-04-09 15:25   ` patch 'pdump: fix build with GCC 12' " Xueming Li
@ 2023-04-09 15:25   ` Xueming Li
  136 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:25 UTC (permalink / raw)
  To: David Christensen; +Cc: Thinh Tran, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/0dce56b788728c2c3e72acfd9c5b70147754840c

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 0dce56b788728c2c3e72acfd9c5b70147754840c Mon Sep 17 00:00:00 2001
From: David Christensen <drc@linux.vnet.ibm.com>
Date: Wed, 22 Mar 2023 13:29:33 -0400
Subject: [PATCH] acl: fix crash on PPC64 with GCC 11
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 3f62bba2e7aa15e5f1e418cdced0f4160de154b3 ]

Original ACL implementation of Altivec optimized code included an
explicit -O2 optimization level for a particular inlined function.
When DPDK is built with the default -O3 optimization level on gcc
11.x or later, the resulting code may generate a segmentation
fault as observed in acl_autotest.

Since there is no explicit reason given for the local function
optimization level in the original commit, and testing with gcc
versions 8.x through 12.x results in working code at all -O
optimization settings, the local optimization is removed.

Bugzilla ID: 1197

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
---
 lib/acl/acl_run_altivec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/acl/acl_run_altivec.h b/lib/acl/acl_run_altivec.h
index 4dfe7a14b4..4556e1503b 100644
--- a/lib/acl/acl_run_altivec.h
+++ b/lib/acl/acl_run_altivec.h
@@ -102,7 +102,7 @@ acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
 /*
  * Process 4 transitions (in 2 XMM registers) in parallel
  */
-static inline __attribute__((optimize("O2"))) xmm_t
+static __rte_always_inline xmm_t
 transition4(xmm_t next_input, const uint64_t *trans,
 	xmm_t *indices1, xmm_t *indices2)
 {
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.281302000 +0800
+++ 0137-acl-fix-crash-on-PPC64-with-GCC-11.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From 3f62bba2e7aa15e5f1e418cdced0f4160de154b3 Mon Sep 17 00:00:00 2001
+From 0dce56b788728c2c3e72acfd9c5b70147754840c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 3f62bba2e7aa15e5f1e418cdced0f4160de154b3 ]
@@ -18 +20,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'devtools: move mailmap check after patch applied' has been queued to stable release 22.11.2
  2023-02-27  6:21 patch has been queued to stable release 22.11.2 Xueming Li
                   ` (2 preceding siblings ...)
  2023-04-09 15:23 ` patch " Xueming Li
@ 2023-04-09 15:45 ` Xueming Li
  2023-04-09 15:45   ` patch 'doc: fix pipeline example path in user guide' " Xueming Li
                     ` (2 more replies)
  3 siblings, 3 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:45 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: David Marchand, Ferruh Yigit, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/abf51507806a5f79b5ef091bcb8f91e565ea28a4

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From abf51507806a5f79b5ef091bcb8f91e565ea28a4 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas@monjalon.net>
Date: Mon, 27 Mar 2023 16:52:19 +0200
Subject: [PATCH] devtools: move mailmap check after patch applied
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 83812de4f2f3f00081b8fee08be11678ed5c62e0 ]

The names in a patch were possibly checked with checkpatches.sh
before applying the patch, so before .mailmap file was updated.

The check is moved and translated in check-git-log.sh,
which is run only on a repository, not a detached patch file.

Fixes: e83d41f0694d ("mailmap: add list of contributors")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 devtools/check-git-log.sh | 15 +++++++++++++++
 devtools/checkpatches.sh  | 30 ------------------------------
 2 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index e26205814b..af751e49ab 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -259,6 +259,21 @@ done)
 [ -z "$bad" ] || { printf "Missing 'Signed-off-by:' tag: \n$bad\n"\
 	&& failure=true;}

+# check names
+names=$(git log --format='From: %an <%ae>%n%b' --reverse $range |
+	sed -rn 's,.*: (.*<.*@.*>),\1,p' |
+	sort -u)
+bad=$(for contributor in $names ; do
+	! grep -qE "^$contributor($| <)" $selfdir/../.mailmap || continue
+	if grep -q "^${contributor%% <*} <" .mailmap ; then
+		printf "\t$contributor is not the primary email address\n"
+	else
+		printf "\t$contributor is unknown in .mailmap\n"
+	fi
+done)
+[ -z "$bad" ] || { printf "Contributor name/email mismatch with .mailmap: \n$bad\n"\
+	&& failure=true;}
+
 total=$(echo "$commits" | wc -l)
 if $failure ; then
 	printf "\nInvalid patch(es) found - checked $total patch"
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 1dee094c7a..a07bbc83cb 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -248,28 +248,6 @@ check_release_notes() { # <patch>
 		grep -v $current_rel_notes
 }

-check_names() { # <patch>
-	res=0
-
-	old_IFS=$IFS
-	IFS='
-'
-	for contributor in $(sed -rn '/^$/,/^--- / {s/.*: (.*<.*@.*>)/\1/p}' $1); do
-		! grep -qE "^$contributor($| <)" .mailmap || continue
-		name=${contributor%% <*}
-		if grep -q "^$name <" .mailmap; then
-			reason="$name mail differs from primary mail"
-		else
-			reason="$contributor is unknown"
-		fi
-		echo "$reason, please fix the commit message or update .mailmap."
-		res=1
-	done
-	IFS=$old_IFS
-
-	return $res
-}
-
 number=0
 range='origin/main..'
 quiet=false
@@ -378,14 +356,6 @@ check () { # <patch-file> <commit>
 		ret=1
 	fi

-	! $verbose || printf '\nChecking names in commit log:\n'
-	report=$(check_names "$tmpinput")
-	if [ $? -ne 0 ] ; then
-		$headline_printed || print_headline "$subject"
-		printf '%s\n' "$report"
-		ret=1
-	fi
-
 	if [ "$tmpinput" != "$1" ]; then
 		rm -f "$tmpinput"
 		trap - INT
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.302553800 +0800
+++ 0138-devtools-move-mailmap-check-after-patch-applied.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From 83812de4f2f3f00081b8fee08be11678ed5c62e0 Mon Sep 17 00:00:00 2001
+From abf51507806a5f79b5ef091bcb8f91e565ea28a4 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 83812de4f2f3f00081b8fee08be11678ed5c62e0 ]
@@ -13 +15,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'doc: fix pipeline example path in user guide' has been queued to stable release 22.11.2
  2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
@ 2023-04-09 15:45   ` Xueming Li
  2023-04-09 15:45   ` patch 'doc: add Linux capability to access physical addresses' " Xueming Li
  2023-04-09 15:45   ` patch 'doc: fix DCF instructions in ice guide' " Xueming Li
  2 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:45 UTC (permalink / raw)
  To: Harshad Narayane; +Cc: Kamalakannan R, Cristian Dumitrescu, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/7ac4d1cebfa50c1a4959f02ca473cff6e1785b3b

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From 7ac4d1cebfa50c1a4959f02ca473cff6e1785b3b Mon Sep 17 00:00:00 2001
From: Harshad Narayane <harshad.suresh.narayane@intel.com>
Date: Mon, 28 Nov 2022 04:33:24 +0530
Subject: [PATCH] doc: fix pipeline example path in user guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 0ab37572614c695f3087f4edaa8e0a95d1bf4a93 ]

Updated the pipeline example path in the Sample Application User Guide.

Fixes: 29485dd07bc3 ("doc: add pipeline example user guide")

Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 doc/guides/sample_app_ug/pipeline.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guides/sample_app_ug/pipeline.rst b/doc/guides/sample_app_ug/pipeline.rst
index 49d50136bc..7c86bf484a 100644
--- a/doc/guides/sample_app_ug/pipeline.rst
+++ b/doc/guides/sample_app_ug/pipeline.rst
@@ -58,7 +58,7 @@ The following is an example command to run the application configured for the VX
 
 .. code-block:: console
 
-    $ ./<build_dir>/examples/dpdk-pipeline -c 0x3 -- -s examples/vxlan.cli
+    $ ./<build_dir>/examples/dpdk-pipeline -c 0x3 -- -s examples/pipeline/examples/vxlan.cli
 
 The application should start successfully and display as follows:
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.325615800 +0800
+++ 0139-doc-fix-pipeline-example-path-in-user-guide.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From 0ab37572614c695f3087f4edaa8e0a95d1bf4a93 Mon Sep 17 00:00:00 2001
+From 7ac4d1cebfa50c1a4959f02ca473cff6e1785b3b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 0ab37572614c695f3087f4edaa8e0a95d1bf4a93 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'doc: add Linux capability to access physical addresses' has been queued to stable release 22.11.2
  2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
  2023-04-09 15:45   ` patch 'doc: fix pipeline example path in user guide' " Xueming Li
@ 2023-04-09 15:45   ` Xueming Li
  2023-04-09 15:45   ` patch 'doc: fix DCF instructions in ice guide' " Xueming Li
  2 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:45 UTC (permalink / raw)
  To: Dmitry Kozlyuk; +Cc: Boris Ouretskey, Isaac Boukris, dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/d4dc7b1d1b751d30e2bef01ca8df7d8b2e626fd5

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From d4dc7b1d1b751d30e2bef01ca8df7d8b2e626fd5 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Date: Fri, 20 Jan 2023 00:24:24 +0300
Subject: [PATCH] doc: add Linux capability to access physical addresses
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit 50b567c66da268bcc7206dab92f690148d57ad8f ]

DAC_READ_SEARCH or DAC_OVERRIDE capability is required to access
/proc/self/pagemap, but the Linux guide mentioned neither one.
Recommend DAC_READ_SEARCH as less impactful.

Fixes: 979bb5d493fb ("doc: add more instructions for running as non-root")

Reported-by: Boris Ouretskey <borisusun@gmail.com>
Reported-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 .mailmap                             | 2 ++
 doc/guides/linux_gsg/enable_func.rst | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index c09043056c..5dc95a9d07 100644
--- a/.mailmap
+++ b/.mailmap
@@ -169,6 +169,7 @@ Björn Töpel <bjorn.topel@intel.com>
 Bo Chen <box.c.chen@intel.com>
 Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
 Boon Ang <bang@vmware.com>
+Boris Ouretskey <borisusun@gmail.com>
 Boris Pismenny <borisp@mellanox.com>
 Brandon Lo <blo@iol.unh.edu>
 Brendan Ryan <brendan.ryan@intel.com>
@@ -528,6 +529,7 @@ Ilya Maximets <i.maximets@ovn.org> <i.maximets@samsung.com>
 Ilya V. Matveychikov <matvejchikov@gmail.com>
 Ilyes Ben Hamouda <ilyes.ben_hamouda@6wind.com>
 Intiyaz Basha <intiyaz.basha@caviumnetworks.com>
+Isaac Boukris <iboukris@gmail.com>
 Itsuro Oda <oda@valinux.co.jp>
 Ivan Boule <ivan.boule@6wind.com>
 Ivan Dyukov <i.dyukov@samsung.com>
diff --git a/doc/guides/linux_gsg/enable_func.rst b/doc/guides/linux_gsg/enable_func.rst
index 829084d80e..2344d97403 100644
--- a/doc/guides/linux_gsg/enable_func.rst
+++ b/doc/guides/linux_gsg/enable_func.rst
@@ -55,12 +55,12 @@ Refer to the `documentation <https://www.kernel.org/doc/Documentation/vm/hugetlb
 If the driver requires using physical addresses (PA),
 the executable file must be granted additional capabilities:
 
-* ``SYS_ADMIN`` to read ``/proc/self/pagemaps``
+* ``DAC_READ_SEARCH`` and ``SYS_ADMIN`` to read ``/proc/self/pagemaps``
 * ``IPC_LOCK`` to lock hugepages in memory
 
 .. code-block:: console
 
-   setcap cap_ipc_lock,cap_sys_admin+ep <executable>
+   setcap cap_dac_read_search,cap_ipc_lock,cap_sys_admin+ep <executable>
 
 If physical addresses are not accessible,
 the following message will appear during EAL initialization::
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.349381500 +0800
+++ 0140-doc-add-Linux-capability-to-access-physical-addresse.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From 50b567c66da268bcc7206dab92f690148d57ad8f Mon Sep 17 00:00:00 2001
+From d4dc7b1d1b751d30e2bef01ca8df7d8b2e626fd5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit 50b567c66da268bcc7206dab92f690148d57ad8f ]
@@ -11 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +24 @@
-index cac02a6f48..0859104404 100644
+index c09043056c..5dc95a9d07 100644
@@ -25 +27 @@
-@@ -171,6 +171,7 @@ Björn Töpel <bjorn.topel@intel.com>
+@@ -169,6 +169,7 @@ Björn Töpel <bjorn.topel@intel.com>
@@ -33 +35 @@
-@@ -534,6 +535,7 @@ Ilya Maximets <i.maximets@ovn.org> <i.maximets@samsung.com>
+@@ -528,6 +529,7 @@ Ilya Maximets <i.maximets@ovn.org> <i.maximets@samsung.com>

^ permalink raw reply	[flat|nested] 303+ messages in thread

* patch 'doc: fix DCF instructions in ice guide' has been queued to stable release 22.11.2
  2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
  2023-04-09 15:45   ` patch 'doc: fix pipeline example path in user guide' " Xueming Li
  2023-04-09 15:45   ` patch 'doc: add Linux capability to access physical addresses' " Xueming Li
@ 2023-04-09 15:45   ` Xueming Li
  2 siblings, 0 replies; 303+ messages in thread
From: Xueming Li @ 2023-04-09 15:45 UTC (permalink / raw)
  To: Qi Zhang; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to stable release 22.11.2

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/11/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/f9f94070e0a9c9ac33b64bc22d67377fe316dfea

Thanks.

Xueming Li <xuemingl@nvidia.com>

---
From f9f94070e0a9c9ac33b64bc22d67377fe316dfea Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Mon, 27 Mar 2023 15:44:43 -0400
Subject: [PATCH] doc: fix DCF instructions in ice guide
Cc: Xueming Li <xuemingl@nvidia.com>

[ upstream commit d86b64402e520c6b5e0441f17783b6a5f0f56aa5 ]

Replace the deprecated VF action with the represented_port action.

Fixes: 776c119736e7 ("net/ice: remove deprecated VF flow action")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/ice.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst
index ce075e067c..b3dc72d421 100644
--- a/doc/guides/nics/ice.rst
+++ b/doc/guides/nics/ice.rst
@@ -331,18 +331,18 @@ Additional Options
 
       ip link set dev enp24s0f0 vf 0 trust on
 
-#. Bind the VF0,  and run testpmd with 'cap=dcf' devarg::
+#. Bind the VF0, and run testpmd with 'cap=dcf' with port representor for VF 1 and 2::
 
-      dpdk-testpmd -l 22-25 -n 4 -a 18:01.0,cap=dcf -- -i
+      dpdk-testpmd -l 22-25 -n 4 -a 18:01.0,cap=dcf,representor=vf[1-2] -- -i
 
 #. Monitor the VF2 interface network traffic::
 
       tcpdump -e -nn -i enp24s1f2
 
-#. Create one flow to redirect the traffic to VF2 by DCF::
+#. Create one flow to redirect the traffic to VF2 by DCF (assume the representor port ID is 5)::
 
       flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 \
-      dst is 192.168.0.3 / end actions vf id 2 / end
+      dst is 192.168.0.3 / end actions represented_port ethdev_port_id 5 / end
 
 #. Send the packet, and it should be displayed on tcpdump::
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:42.372248000 +0800
+++ 0141-doc-fix-DCF-instructions-in-ice-guide.patch	2023-04-09 21:45:38.819042200 +0800
@@ -1 +1 @@
-From d86b64402e520c6b5e0441f17783b6a5f0f56aa5 Mon Sep 17 00:00:00 2001
+From f9f94070e0a9c9ac33b64bc22d67377fe316dfea Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl@nvidia.com>
+
+[ upstream commit d86b64402e520c6b5e0441f17783b6a5f0f56aa5 ]
@@ -9 +11,0 @@
-Cc: stable@dpdk.org
@@ -17 +19 @@
-index e0ba8534d7..bcc1cab491 100644
+index ce075e067c..b3dc72d421 100644
@@ -20 +22 @@
-@@ -343,18 +343,18 @@ Additional Options
+@@ -331,18 +331,18 @@ Additional Options

^ permalink raw reply	[flat|nested] 303+ messages in thread

end of thread, other threads:[~2023-04-09 15:46 UTC | newest]

Thread overview: 303+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27  6:21 patch has been queued to stable release 22.11.2 Xueming Li
2023-02-27  6:21 ` patch 'drivers: fix symbol exports when map is omitted' " Xueming Li
2023-02-27  6:58 ` patch 'devtools: fix name check with mbox files' " Xueming Li
2023-02-27  6:58   ` patch 'eal/windows: mark memory config as complete' " Xueming Li
2023-02-27  6:58   ` patch 'kni: fix build on RHEL 9.1' " Xueming Li
2023-02-27  6:58   ` patch 'hash: fix GFNI implementation build with GCC 12' " Xueming Li
2023-02-27  6:58   ` patch 'doc: fix dependency setup in l2fwd-cat example guide' " Xueming Li
2023-02-27  6:58   ` patch 'devtools: fix escaped space in grep pattern' " Xueming Li
2023-02-27  6:58   ` patch 'crypto/cnxk: fix digest for empty input data' " Xueming Li
2023-02-27  6:58   ` patch 'app/crypto-perf: fix number of segments' " Xueming Li
2023-02-27  6:58   ` patch 'app/crypto-perf: fix session freeing' " Xueming Li
2023-02-27  6:58   ` patch 'app/crypto-perf: fix SPI zero' " Xueming Li
2023-02-27  6:58   ` patch 'app/crypto-perf: fix IPsec direction' " Xueming Li
2023-02-27  6:58   ` patch 'eventdev/crypto: fix enqueue count' " Xueming Li
2023-02-27  6:58   ` patch 'eventdev/crypto: fix offset used while flushing events' " Xueming Li
2023-02-27  6:58   ` patch 'eventdev/crypto: fix overflow in circular buffer' " Xueming Li
2023-02-27  6:58   ` patch 'eventdev/crypto: fix failed events' " Xueming Li
2023-02-27  6:58   ` patch 'eventdev/eth_tx: fix devices loop' " Xueming Li
2023-02-27  6:58   ` patch 'examples/l2fwd-event: fix worker cleanup' " Xueming Li
2023-02-27  6:58   ` patch 'crypto/qat: fix stream cipher direction' " Xueming Li
2023-02-27  6:58   ` patch 'crypto/qat: fix build for generic x86 with GCC 12' " Xueming Li
2023-02-27  6:58   ` patch 'crypto/qat: fix build' " Xueming Li
2023-02-27  6:58   ` patch 'bus/fslmc: fix deadlock on MC send command timeout' " Xueming Li
2023-02-27  6:58   ` patch 'fbarray: fix metadata dump' " Xueming Li
2023-02-27  6:58   ` patch 'gpudev: fix deadlocks when registering callback' " Xueming Li
2023-02-27  6:58   ` patch 'graph: fix node shrink' " Xueming Li
2023-02-27  6:58   ` patch 'net/nfp: fix Tx packet drop for large data length' " Xueming Li
2023-02-27  6:58   ` patch 'net/nfp: fix firmware name derived from PCI name' " Xueming Li
2023-02-27  6:58   ` patch 'net/ena: fix deadlock in RSS RETA update' " Xueming Li
2023-02-27  6:58   ` patch 'net/hns3: fix inaccurate RTC time to read' " Xueming Li
2023-02-27  6:58   ` patch 'net/nfp: store counter reset before zeroing flow query' " Xueming Li
2023-02-27  6:58   ` patch 'net/nfp: fix teardown of flows sharing a mask ID' " Xueming Li
2023-02-27  6:58   ` patch 'app/testpmd: fix interactive mode with no ports' " Xueming Li
2023-02-27  6:59   ` patch 'telemetry: move include after guard' " Xueming Li
2023-02-27  6:59   ` patch 'ethdev: fix telemetry data truncation' " Xueming Li
2023-02-27  6:59   ` patch 'mempool: " Xueming Li
2023-02-27  6:59   ` patch 'cryptodev: " Xueming Li
2023-02-27  6:59   ` patch 'mem: " Xueming Li
2023-02-27  6:59   ` patch 'examples/qos_sched: fix debug mode' " Xueming Li
2023-02-27  6:59   ` patch 'app/dumpcap: fix storing port identifier' " Xueming Li
2023-02-27  6:59   ` patch 'build: fix dependencies lookup' " Xueming Li
2023-02-27  6:59   ` patch 'vdpa/ifc: fix argument compatibility check' " Xueming Li
2023-02-27  6:59   ` patch 'vdpa/ifc: fix reconnection in SW-assisted live migration' " Xueming Li
2023-02-27  6:59   ` patch 'vhost: fix net header settings in datapath' " Xueming Li
2023-02-27  6:59   ` patch 'app/bbdev: fix build with optional flag' " Xueming Li
2023-02-27  6:59   ` Xueming Li
2023-02-27  6:59   ` patch 'app/bbdev: add allocation checks' " Xueming Li
2023-02-27  6:59   ` patch 'baseband/acc: fix memory leak on acc100 close' " Xueming Li
2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 iteration counter in TB' " Xueming Li
2023-02-27  6:59   ` patch 'baseband/acc: fix multiplexing acc100 operations' " Xueming Li
2023-02-27  6:59   ` patch 'baseband/acc: fix acc100 queue mapping to 64 bits' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/ccp: remove some printf' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/ccp: remove some dead code for UIO' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/ccp: fix IOVA handling' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/openssl: fix warning on copy length' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/ipsec_mb: remove unnecessary null check' " Xueming Li
2023-02-27  6:59   ` patch 'test/crypto: fix typo in AES test' " Xueming Li
2023-02-27  6:59   ` patch 'test/crypto: add missing MAC-I to PDCP vectors' " Xueming Li
2023-02-27  6:59   ` patch 'cryptodev: fix sym session mempool creation description' " Xueming Li
2023-02-27  6:59   ` patch 'compressdev: fix end of driver list' " Xueming Li
2023-02-27  6:59   ` patch 'crypto/ipsec_mb: fix ZUC-256 maximum tag length' " Xueming Li
2023-02-27  6:59   ` patch 'net/bnxt: fix Tx queue stats after queue stop and start' " Xueming Li
2023-02-27  6:59   ` patch 'net/bnxt: fix Rx " Xueming Li
2023-02-27  6:59   ` patch 'net/bnxt: fix RSS hash in mbuf' " Xueming Li
2023-02-27  6:59   ` patch 'doc: fix firmware list in bnxt guide' " Xueming Li
2023-02-27  6:59   ` patch 'eventdev/crypto: fix function symbol export' " Xueming Li
2023-02-27  6:59   ` patch 'event/cnxk: wait for CPT flow control on WQE path' " Xueming Li
2023-02-27  6:59   ` patch 'eventdev/eth_rx: fix getting adapter instance' " Xueming Li
2023-02-27  6:59   ` patch 'event/cnxk: fix burst timer arm' " Xueming Li
2023-02-27  6:59   ` patch 'event/cnxk: fix timer operations in secondary process' " Xueming Li
2023-02-27  6:59   ` patch 'net/cnxk: fix packet type for IPv6 packets post decryption' " Xueming Li
2023-02-27  6:59   ` patch 'common/cnxk: fix aura ID handling' " Xueming Li
2023-02-27  6:59   ` patch 'net/cnxk: fix deadlock in security session creation' " Xueming Li
2023-02-27  6:59   ` patch 'common/cnxk: fix dual VLAN parsing' " Xueming Li
2023-02-27  6:59   ` patch 'common/cnxk: fix IPv6 extension matching' " Xueming Li
2023-02-27  6:59   ` patch 'common/cnxk: reduce channel count per LMAC' " Xueming Li
2023-02-27  6:59   ` patch 'net/cnxk: validate RED threshold config' " Xueming Li
2023-02-27  6:59   ` patch 'mem: fix hugepage info mapping' " Xueming Li
2023-02-27  6:59   ` patch 'raw/ifpga/base: fix init with multi-process' " Xueming Li
2023-02-27  6:59   ` patch 'telemetry: fix repeat display when callback don't init dict' " Xueming Li
2023-02-27  6:59   ` patch 'eal/linux: fix hugetlbfs sub-directories discovery' " Xueming Li
2023-02-27  6:59   ` patch 'drivers/bus: fix leak for devices without driver' " Xueming Li
2023-02-27  6:59   ` patch 'test/mbuf: fix mbuf reset test' " Xueming Li
2023-02-27  6:59   ` patch 'eventdev/timer: fix overflow' " Xueming Li
2023-02-27  6:59   ` patch 'eal: cleanup alarm and hotplug before memory detach' " Xueming Li
2023-02-27  6:59   ` patch 'vhost: decrease log level for unimplemented requests' " Xueming Li
2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks' " Xueming Li
2023-02-27  6:59   ` patch 'vhost: fix possible FD leaks on truncation' " Xueming Li
2023-02-27  6:59   ` patch 'net/virtio-user: fix device starting failure handling' " Xueming Li
2023-02-27  6:59   ` patch 'net/hns3: declare flow rule keeping capability' " Xueming Li
2023-02-27  6:59   ` patch 'doc: fix description of L2TPV2 flow item' " Xueming Li
2023-02-27  6:59   ` patch 'app/testpmd: fix forwarding stats for Tx dropped' " Xueming Li
2023-02-27  6:59   ` patch 'net/txgbe: fix default signal quality value for KX/KX4' " Xueming Li
2023-02-27  7:00   ` patch 'net/txgbe: fix packet type to parse from offload flags' " Xueming Li
2023-02-27  7:00   ` patch 'net/ngbe: " Xueming Li
2023-02-27  7:00   ` patch 'net/ngbe: add spinlock protection on YT PHY' " Xueming Li
2023-02-27  7:00   ` patch 'net/txgbe: fix interrupt loss' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix log about indirection table size' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: extract common function to query device' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: refactor set RSS hash algorithm and key interface' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix RSS key size compatibility' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix clearing RSS configuration' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: use RSS filter list to check duplicated rule' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: remove useless code when destroy valid RSS " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix warning on flush or destroy " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix config struct used for conversion' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix duplicate RSS rule check' " Xueming Li
2023-02-27  7:00   ` patch 'net/sfc: export pick transfer proxy callback to representors' " Xueming Li
2023-02-27  7:00   ` patch 'app/testpmd: fix link check condition on port start' " Xueming Li
2023-02-27  7:00   ` patch 'net/nfp: fix max DMA length' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: fix burst mode query with dummy function' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: add debug info for Rx/Tx " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: remove debug condition for Tx prepare' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: separate Tx prepare from getting Tx function' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: make getting Tx function static' " Xueming Li
2023-02-27  7:00   ` patch 'net/hns3: extract common functions to set Rx/Tx' " Xueming Li
2023-02-27  7:00   ` patch 'net/sfc: fix MAC address entry leak in transfer flow parsing' " Xueming Li
2023-02-27  7:00   ` patch 'net/sfc: enforce fate action in transfer flow rules' " Xueming Li
2023-02-27  7:00   ` patch 'net/txgbe: fix Rx buffer size in config register' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix available tag registers calculation for HWS' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix GENEVE resource overwrite' " Xueming Li
2023-02-27  7:00   ` patch 'common/mlx5: improve AES-XTS tweak capability check' " Xueming Li
2023-02-27  7:00   ` patch 'common/mlx5: fix offset of a field' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix flow sample with ConnectX-5' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix wait descriptor opcode for ConnectX-7' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix warning for Tx scheduling option' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix read device clock in real time mode' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5/hws: fix memory leak on general pool DB init' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: fix error CQE dumping for vectorized Rx' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: ignore non-critical syndromes for Rx queue' " Xueming Li
2023-02-27  7:00   ` patch 'net/mlx5: check compressed CQE opcode in vectorized Rx' " Xueming Li
2023-02-27  7:00   ` patch 'net/iavf: fix outer UDP checksum offload' " Xueming Li
2023-02-27  7:00   ` patch 'net/i40e: reduce interrupt interval in multi-driver mode' " Xueming Li
2023-02-27  7:00   ` patch 'net/idpf: fix mbuf leak in split Tx' " Xueming Li
2023-02-27  7:00   ` patch 'net/idpf: fix driver infos' " Xueming Li
2023-02-27  7:00   ` patch 'net/ixgbe: fix firmware version consistency' " Xueming Li
2023-02-27  7:00   ` patch 'net/iavf: add lock for VF commands' " Xueming Li
2023-02-27  7:00   ` patch 'net/i40e: fix validation of flow transfer attribute' " Xueming Li
2023-02-27  7:00   ` patch 'net/ice: " Xueming Li
2023-02-27  7:00   ` patch 'net/iavf: protect insertion in flow list' " Xueming Li
2023-02-27  7:00   ` patch 'net/iavf: fix building data desc' " Xueming Li
2023-02-27  7:00   ` patch 'net/ixgbe: enable IPv6 mask in flow rules' " Xueming Li
2023-02-27  7:00   ` patch 'net/iavf: fix VLAN offload with AVX2' " Xueming Li
2023-02-27  7:00   ` patch 'app/compress-perf: fix some typos' " Xueming Li
2023-02-27  7:00   ` patch 'app/compress-perf: fix testing single operation' " Xueming Li
2023-02-27  7:00   ` patch 'common/cnxk: fix channel mask for SDP interfaces' " Xueming Li
2023-02-27  7:00   ` patch 'net/bnxt: fix link state change interrupt config' " Xueming Li
2023-02-27  7:00   ` patch 'net/nfp: fix VNI of VXLAN encap action' " Xueming Li
2023-02-27  7:00   ` patch 'net/nfp: restrict flow flush to the port' " Xueming Li
2023-02-27  7:00   ` patch 'app/testpmd: fix crash on cleanup' " Xueming Li
2023-02-27  7:00   ` patch 'sched: fix alignment of structs in subport' " Xueming Li
2023-02-27  7:00   ` patch 'eal/freebsd: fix lock in alarm callback' " Xueming Li
2023-02-27  7:00   ` patch 'dma/ioat: fix device stop if no copies done' " Xueming Li
2023-02-27  7:01   ` patch 'dma/ioat: fix indexes after restart' " Xueming Li
2023-02-27  7:01   ` patch 'dma/ioat: fix error reporting on " Xueming Li
2023-02-27  7:01   ` patch 'reorder: invalidate buffer from ready queue in drain' " Xueming Li
2023-02-27  7:01   ` patch 'test/reorder: fix double free of drained buffers' " Xueming Li
2023-02-27  7:01   ` patch 'build: fix toolchain definition' " Xueming Li
2023-02-27  7:01   ` patch 'eal: use same atomic intrinsics for GCC and clang' " Xueming Li
2023-02-27  7:01   ` patch 'examples/cmdline: fix build with GCC 12' " Xueming Li
2023-02-27  7:01   ` patch 'examples/qos_sched: fix Tx port config when link down' " Xueming Li
2023-04-09 15:23 ` patch " Xueming Li
2023-04-09 15:23   ` patch 'common/cnxk: fix second pass flow rule layer type' " Xueming Li
2023-04-09 15:23   ` patch 'net/mlx5: fix crash on action template failure' " Xueming Li
2023-04-09 15:23   ` patch 'eal/windows: fix pedantic build' " Xueming Li
2023-04-09 15:23   ` patch 'doc: add gpudev to the Doxygen index' " Xueming Li
2023-04-09 15:23   ` patch 'doc: fix reference to event timer header' " Xueming Li
2023-04-09 15:23   ` patch 'event/cnxk: fix SSO cleanup' " Xueming Li
2023-04-09 15:23   ` patch 'eventdev: fix memory size for telemetry' " Xueming Li
2023-04-09 15:23   ` patch 'baseband/acc: protect from TB negative scenario' " Xueming Li
2023-04-09 15:23   ` patch 'baseband/acc: add explicit mbuf append for soft output' " Xueming Li
2023-04-09 15:23   ` patch 'baseband/acc: prevent to dequeue more than requested' " Xueming Li
2023-04-09 15:23   ` patch 'baseband/acc: fix iteration counter in TB mode' " Xueming Li
2023-04-09 15:23   ` patch 'baseband/acc: fix check after deref and dead code' " Xueming Li
2023-04-09 15:23   ` patch 'test/bbdev: fix crash for non supported HARQ length' " Xueming Li
2023-04-09 15:23   ` patch 'test/bbdev: extend HARQ tolerance' " Xueming Li
2023-04-09 15:23   ` patch 'test/bbdev: remove check for invalid opaque data' " Xueming Li
2023-04-09 15:23   ` patch 'vhost: fix slot index in async split virtqueue Tx' " Xueming Li
2023-04-09 15:23   ` patch 'vhost: fix OOB access for invalid vhost ID' " Xueming Li
2023-04-09 15:23   ` patch 'net/virtio: deduce IP length for TSO checksum' " Xueming Li
2023-04-09 15:23   ` patch 'examples/ipsec-secgw: fix auth IV length' " Xueming Li
2023-04-09 15:23   ` patch 'compress/mlx5: fix decompress xform validation' " Xueming Li
2023-04-09 15:23   ` patch 'compress/mlx5: fix output Adler-32 checksum offset' " Xueming Li
2023-04-09 15:23   ` patch 'compress/mlx5: fix queue setup for partial transformations' " Xueming Li
2023-04-09 15:23   ` patch 'examples/fips_validation: fix MCT output for SHA' " Xueming Li
2023-04-09 15:23   ` patch 'examples/fips_validation: fix integer parsing' " Xueming Li
2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-GCM tests' " Xueming Li
2023-04-09 15:23   ` patch 'examples/fips_validation: fix AES-XTS sequence number' " Xueming Li
2023-04-09 15:23   ` patch 'examples/fips_validation: add extra space in JSON buffer' " Xueming Li
2023-04-09 15:23   ` patch 'common/cnxk: fix auth key length' " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix 48-bit DMA support for NFDk' " Xueming Li
2023-04-09 15:23   ` patch 'net/gve: fix offloading capability' " Xueming Li
2023-04-09 15:23   ` patch 'net/mana: enable driver by default' " Xueming Li
2023-04-09 15:23   ` patch 'app/testpmd: fix Tx preparation in checksum engine' " Xueming Li
2023-04-09 15:23   ` patch 'app/testpmd: fix packet count in IEEE 1588 " Xueming Li
2023-04-09 15:23   ` patch 'app/testpmd: fix packet transmission in noisy VNF " Xueming Li
2023-04-09 15:23   ` patch 'ethdev: fix build with LTO' " Xueming Li
2023-04-09 15:23   ` patch 'net/mana: fix stats counters' " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix getting RSS configuration' " Xueming Li
2023-04-09 15:23   ` patch 'ethdev: remove telemetry Rx mbuf alloc failed field' " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set MAC flow action' " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set IPv4 " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set IPv6 " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set TP " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set TTL " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix set DSCP " Xueming Li
2023-04-09 15:23   ` patch 'net/nfp: fix offload of multiple output actions' " Xueming Li
2023-04-09 15:23   ` patch 'app/testpmd: fix secondary process packet forwarding' " Xueming Li
2023-04-09 15:23   ` patch 'net/ixgbe: fix IPv6 mask in flow director' " Xueming Li
2023-04-09 15:23   ` patch 'net/i40e: revert link status check on device start' " Xueming Li
2023-04-09 15:23   ` patch 'net/i40e: fix maximum frame size configuration' " Xueming Li
2023-04-09 15:23   ` patch 'net/ice: fix Rx timestamp' " Xueming Li
2023-04-09 15:23   ` patch 'net/cnxk: fix LBK BPID usage' " Xueming Li
2023-04-09 15:24   ` patch 'common/cnxk: add memory clobber to steor and ldeor' " Xueming Li
2023-04-09 15:24   ` patch 'eal/windows: fix thread creation' " Xueming Li
2023-04-09 15:24   ` patch 'net/nfp: fix MTU configuration order' " Xueming Li
2023-04-09 15:24   ` patch 'kvargs: add API documentation for process callback' " Xueming Li
2023-04-09 15:24   ` patch 'compressdev: fix empty devargs parsing' " Xueming Li
2023-04-09 15:24   ` patch 'cryptodev: " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: " Xueming Li
2023-04-09 15:24   ` patch 'net/virtio: " Xueming Li
2023-04-09 15:24   ` patch 'dma/skeleton: " Xueming Li
2023-04-09 15:24   ` patch 'raw/skeleton: " Xueming Li
2023-04-09 15:24   ` patch 'table: fix action selector group size log2 setting' " Xueming Li
2023-04-09 15:24   ` patch 'regex/mlx5: utilize all available queue pairs' " Xueming Li
2023-04-09 15:24   ` patch 'regex/mlx5: fix doorbell record' " Xueming Li
2023-04-09 15:24   ` patch 'common/sfc_efx/base: add MAE mark reset action' " Xueming Li
2023-04-09 15:24   ` patch 'net/sfc: fix resetting mark in tunnel offload switch rules' " Xueming Li
2023-04-09 15:24   ` patch 'kni: fix possible starvation when mbufs are exhausted' " Xueming Li
2023-04-09 15:24   ` patch 'cmdline: make rdline status not private' " Xueming Li
2023-04-09 15:24   ` patch 'cmdline: handle EOF as quit' " Xueming Li
2023-04-09 15:24   ` patch 'app/testpmd: cleanup cleanly from signal' " Xueming Li
2023-04-09 15:24   ` patch 'mem: fix heap ID in telemetry' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of hash key when config' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: fix possible truncation of redirection table' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash key' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report hash types' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: use hardware config to report redirection table' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate setting hash algorithm' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate setting hash key' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate setting redirection table' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate setting RSS types' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate setting and clearing RSS rule' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: use new RSS rule to configure hardware' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: save hash algo to RSS filter list node' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: allow adding queue buffer size hash rule' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: separate flow RSS config from RSS conf' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: reimplement hash flow function' " Xueming Li
2023-04-09 15:24   ` patch 'net/hns3: add verification of RSS types' " Xueming Li
2023-04-09 15:24   ` patch 'net/mlx5: fix Windows build with MinGW GCC 12' " Xueming Li
2023-04-09 15:24   ` patch 'crypto/ccp: fix PCI probing' " Xueming Li
2023-04-09 15:24   ` patch 'crypto/qat: fix SM3 auth mode' " Xueming Li
2023-04-09 15:24   ` patch 'crypto/openssl: fix freeing in RSA EVP' " Xueming Li
2023-04-09 15:24   ` patch 'app/crypto-perf: fix test file memory leak' " Xueming Li
2023-04-09 15:24   ` patch 'app/flow-perf: fix division or module by zero' " Xueming Li
2023-04-09 15:24   ` patch 'examples/ipsec-secgw: fix offload variable init' " Xueming Li
2023-04-09 15:24   ` patch 'raw/skeleton: fix selftest' " Xueming Li
2023-04-09 15:24   ` patch 'ring: silence GCC 12 warnings' " Xueming Li
2023-04-09 15:24   ` patch 'reorder: fix sequence number mbuf field register' " Xueming Li
2023-04-09 15:24   ` patch 'test: fix segment length in packet generator' " Xueming Li
2023-04-09 15:24   ` patch 'test/mbuf: fix test with mbuf debug enabled' " Xueming Li
2023-04-09 15:24   ` patch 'eal/unix: fix thread creation' " Xueming Li
2023-04-09 15:24   ` patch 'gpudev: export header file for external drivers' " Xueming Li
2023-04-09 15:24   ` patch 'app/testpmd: fix interactive mode on Windows' " Xueming Li
2023-04-09 15:24   ` patch 'test/crypto: fix ZUC digest length in comparison' " Xueming Li
2023-04-09 15:24   ` patch 'test/crypto: fix capability check for ZUC cipher-auth' " Xueming Li
2023-04-09 15:24   ` patch 'test/crypto: fix skip condition for CPU crypto SGL' " Xueming Li
2023-04-09 15:24   ` patch 'app/compress-perf: fix remaining data for ops' " Xueming Li
2023-04-09 15:24   ` patch 'crypto/ipsec_mb: relax multi-process requirement' " Xueming Li
2023-04-09 15:24   ` patch 'app/bbdev: check statistics failure' " Xueming Li
2023-04-09 15:24   ` patch 'net/vhost: add missing newline in logs' " Xueming Li
2023-04-09 15:24   ` patch 'net/vhost: fix leak in interrupt handle setup' " Xueming Li
2023-04-09 15:24   ` patch 'net/vhost: fix Rx interrupt' " Xueming Li
2023-04-09 15:25   ` patch 'net/virtio: remove address width limit for modern devices' " Xueming Li
2023-04-09 15:25   ` patch 'net/sfc: invalidate switch port entry on representor unplug' " Xueming Li
2023-04-09 15:25   ` patch 'net/i40e: fix AVX512 fast-free path' " Xueming Li
2023-04-09 15:25   ` patch 'net/e1000: fix saving of stripped VLAN TCI' " Xueming Li
2023-04-09 15:25   ` patch 'net/i40e: fix MAC loopback on X722' " Xueming Li
2023-04-09 15:25   ` patch 'net/idpf: reset queue flag when queue is stopped' " Xueming Li
2023-04-09 15:25   ` patch 'net/iavf: fix device stop during reset' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix hairpin Tx queue reference count' " Xueming Li
2023-04-09 15:25   ` patch 'examples/l3fwd: remove hash entry number' " Xueming Li
2023-04-09 15:25   ` patch 'doc: fix LPM support in l3forward guide' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix egress group translation in HWS' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix isolated mode if no representor matching' " Xueming Li
2023-04-09 15:25   ` patch 'bus/ifpga: fix devargs handling' " Xueming Li
2023-04-09 15:25   ` patch 'net/ipn3ke: fix thread exit' " Xueming Li
2023-04-09 15:25   ` patch 'net/ipn3ke: fix representor name' " Xueming Li
2023-04-09 15:25   ` patch 'examples/qos_sched: fix config entries in wrong sections' " Xueming Li
2023-04-09 15:25   ` patch 'app/testpmd: fix encap/decap size calculation' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5/hws: fix pattern creation' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix build with GCC 12 and ASan' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5/hws: fix error code of send queue action' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix CQE dump for Tx' " Xueming Li
2023-04-09 15:25   ` patch 'net/mlx5: fix sysfs port name translation' " Xueming Li
2023-04-09 15:25   ` patch 'doc: fix code blocks in cryptodev guide' " Xueming Li
2023-04-09 15:25   ` patch 'test/crypto: fix statistics error messages' " Xueming Li
2023-04-09 15:25   ` patch 'pdump: fix build with GCC 12' " Xueming Li
2023-04-09 15:25   ` patch 'acl: fix crash on PPC64 with GCC 11' " Xueming Li
2023-04-09 15:45 ` patch 'devtools: move mailmap check after patch applied' " Xueming Li
2023-04-09 15:45   ` patch 'doc: fix pipeline example path in user guide' " Xueming Li
2023-04-09 15:45   ` patch 'doc: add Linux capability to access physical addresses' " Xueming Li
2023-04-09 15:45   ` patch 'doc: fix DCF instructions in ice guide' " 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).