DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raghavendra Ningoji <raghavendra.ningoji@amd.com>
To: <dev@dpdk.org>
Cc: <david.marchand@redhat.com>, <stephen@networkplumber.org>,
	<jingjing.wu@intel.com>, <bhagyada.modali@amd.com>,
	<Selwin.Sebastian@amd.com>, <bruce.richardson@intel.com>
Subject: [PATCH v3 00/16] raw/ntb: post-merge fixes
Date: Wed, 11 Nov 2026 12:36:34 +0530	[thread overview]
Message-ID: <cover.1794377833.git.raghavendra.ningoji@amd.com> (raw)
In-Reply-To: <20261106055045.720805-1-raghavendra.ningoji@amd.com>

This series addresses the post-merge review of the AMD NTB support
by Stephen. Some of the issues also exist in the Intel code and in
released versions; those patches are tagged for stable.

- Patches 1-4 fix the type confusion in rte_pmd_ntb_get_mem_align(),
  the unbounded peer memory window count, the off-by-one in the
  address remapping and the memory window leaks.

- Patch 5 fixes the doorbell interrupts with vfio-pci: only MSI-X
  vector 0 (DB0) was serviced, so the DB1/DB2 exchange of dev_stop
  never completed and the stop waited for its 1s timeout.

- Patch 7 removes the AMD hardware event handling, which could not run
  as wired, and documents that hardware events are not handled.

- Patches 8-9 fix the Rx path: a partially consumed packet was leaked
  and desynchronized the ring, and an mbuf owned by the application
  could be freed again on device stop.

- Patches 14-16 fix the peer device status accesses between the
  interrupt thread and the stop/data paths, and the missing checks and
  leaks at queue setup.

- The other patches are documentation and cleanup.

The peer memory window size check suggested for the AMD handshake is
not added: all the AMD scratchpads are in use, and the window limit
register programmed with the local memzone length already bounds what
the peer can reach.

Tested with vfio-pci on two AMD EPYC Embedded hosts: handshake,
file transfer, and stop/quit with DB1/DB2 exchange.

---
Changes since v2:
- Resent with proper threading: in v2, all the patches replied to the
  v1 cover letter, so patchwork did not group them as a series and the
  CI could not apply them. No change in patches 1-15, apart from the
  rebase on current main.
- Added patch 16 for the queue setup leaks reported by Stephen on v2.

Changes since v1:
- Patch 4: embed the memory window size array in struct ntb_hw instead
  of freeing it on close, as the device stays attached after close and
  mw_size could then be dereferenced as NULL.
- Patch 5: allocate the doorbell interrupt handle array with calloc(),
  as it only holds process-private pointers.
- Added patch 14 for the peer device status atomic accesses.
- Added patch 15 for the queue setup checks, also covering the Tx side
  (unchecked nb_desc, and queue leak on invalid tx_free_thresh).

Raghavendra Ningoji (16):
  raw/ntb: fix device check in memory alignment query
  raw/ntb: fix peer memory window count check
  raw/ntb: fix memory window bound in address remapping
  raw/ntb: fix memory leaks
  raw/ntb: fix doorbell interrupts with VFIO MSI-X
  raw/ntb: fix AMD processor names
  raw/ntb: remove AMD hardware event handling
  raw/ntb: fix Rx of incomplete packets
  raw/ntb: fix double free of Rx mbufs on stop
  examples/ntb: fix raw/ntb library linking
  doc: add NTB device info change to ABI section
  doc: add IOVA requirement for NTB
  raw/ntb: remove unused AMD register definitions
  raw/ntb: fix peer device status access
  raw/ntb: fix queue setup checks
  raw/ntb: fix queue leaks on setup

 doc/guides/rawdevs/ntb.rst             |  12 +-
 doc/guides/rel_notes/release_26_11.rst |   6 +-
 drivers/raw/ntb/ntb.c                  | 266 ++++++++++++++++++-------
 drivers/raw/ntb/ntb.h                  |  17 +-
 drivers/raw/ntb/ntb_hw_amd.c           |  60 +-----
 drivers/raw/ntb/ntb_hw_amd.h           |  25 +--
 drivers/raw/ntb/ntb_hw_intel.c         |  17 +-
 examples/ntb/Makefile                  |   3 +-
 8 files changed, 242 insertions(+), 164 deletions(-)

-- 
2.34.1


  parent reply	other threads:[~2026-11-11  7:11 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 11:19 [PATCH 00/13] raw/ntb: post-merge fixes Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 01/13] raw/ntb: fix device check in memory alignment query Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 02/13] raw/ntb: fix peer memory window count check Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 03/13] raw/ntb: fix memory window bound in address remapping Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 04/13] raw/ntb: fix memory leaks Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 05/13] raw/ntb: fix doorbell interrupts with VFIO MSI-X Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 06/13] raw/ntb: fix AMD processor names Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 07/13] raw/ntb: remove AMD hardware event handling Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 08/13] raw/ntb: fix Rx of incomplete packets Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 09/13] raw/ntb: fix double free of Rx mbufs on stop Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 10/13] examples/ntb: fix raw/ntb library linking Raghavendra Ningoji
2026-11-04 11:19 ` [PATCH 11/13] doc: add NTB device info change to ABI section Raghavendra Ningoji
2026-11-04 11:20 ` [PATCH 12/13] doc: add IOVA requirement for NTB Raghavendra Ningoji
2026-11-04 11:20 ` [PATCH 13/13] raw/ntb: remove unused AMD register definitions Raghavendra Ningoji
2026-11-04 12:24 ` [PATCH 00/13] raw/ntb: post-merge fixes Stephen Hemminger
2026-11-06  5:54   ` Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 00/15] " Raghavendra Ningoji
2026-11-06 12:50   ` Stephen Hemminger
2026-11-11  7:09     ` Raghavendra Ningoji
2026-11-11  7:06   ` Raghavendra Ningoji [this message]
2026-11-11  7:06     ` [PATCH v3 01/16] raw/ntb: fix device check in memory alignment query Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 02/16] raw/ntb: fix peer memory window count check Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 03/16] raw/ntb: fix memory window bound in address remapping Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 04/16] raw/ntb: fix memory leaks Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 05/16] raw/ntb: fix doorbell interrupts with VFIO MSI-X Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 06/16] raw/ntb: fix AMD processor names Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 07/16] raw/ntb: remove AMD hardware event handling Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 08/16] raw/ntb: fix Rx of incomplete packets Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 09/16] raw/ntb: fix double free of Rx mbufs on stop Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 10/16] examples/ntb: fix raw/ntb library linking Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 11/16] doc: add NTB device info change to ABI section Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 12/16] doc: add IOVA requirement for NTB Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 13/16] raw/ntb: remove unused AMD register definitions Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 14/16] raw/ntb: fix peer device status access Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 15/16] raw/ntb: fix queue setup checks Raghavendra Ningoji
2026-11-11  7:06     ` [PATCH v3 16/16] raw/ntb: fix queue leaks on setup Raghavendra Ningoji
2026-11-12 14:56     ` [PATCH v3 00/16] raw/ntb: post-merge fixes David Marchand
2026-11-06  5:50 ` [PATCH v2 01/15] raw/ntb: fix device check in memory alignment query Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 02/15] raw/ntb: fix peer memory window count check Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 03/15] raw/ntb: fix memory window bound in address remapping Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 04/15] raw/ntb: fix memory leaks Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 05/15] raw/ntb: fix doorbell interrupts with VFIO MSI-X Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 06/15] raw/ntb: fix AMD processor names Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 07/15] raw/ntb: remove AMD hardware event handling Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 08/15] raw/ntb: fix Rx of incomplete packets Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 09/15] raw/ntb: fix double free of Rx mbufs on stop Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 10/15] examples/ntb: fix raw/ntb library linking Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 11/15] doc: add NTB device info change to ABI section Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 12/15] doc: add IOVA requirement for NTB Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 13/15] raw/ntb: remove unused AMD register definitions Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 14/15] raw/ntb: fix peer device status access Raghavendra Ningoji
2026-11-06  5:50 ` [PATCH v2 15/15] raw/ntb: fix queue setup checks Raghavendra Ningoji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1794377833.git.raghavendra.ningoji@amd.com \
    --to=raghavendra.ningoji@amd.com \
    --cc=Selwin.Sebastian@amd.com \
    --cc=bhagyada.modali@amd.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox