public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/9] gpu: nova-core: gsp: add continuation record support
@ 2026-03-02 11:42 Eliot Courtney
  2026-03-02 11:42 ` [PATCH v4 1/9] gpu: nova-core: gsp: sort MsgFunction variants alphabetically Eliot Courtney
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Eliot Courtney @ 2026-03-02 11:42 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, Alexandre Courbot, David Airlie,
	Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross
  Cc: Zhi Wang, John Hubbard, Alistair Popple, Joel Fernandes,
	Timur Tabi, nouveau, dri-devel, linux-kernel, rust-for-linux,
	Eliot Courtney

GSP commands over 16 pages need to be sent using "continuation records"
which essentially means splitting the payload over multiple commands.

This series adds a command type `ContinuationRecord` which just writes
its header and whatever payload it is given. It also adds types
`SplitState` and `SplitCommand` which support splitting a large RPC
into smaller ones while transparently letting regular sized RPCs be sent
without extra copies.

The send pathway uses `SplitState` to send all commands, but if
the command fits into 16 pages, it still writes directly into the
command queue. If it is larger than 16 pages and needs continuation
records, it writes into a staging buffer, so there is one copy.

Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
---
Changes in v4:
- Removed Tested-by Zhi on the ContinuationRecord patch, since it
  changed substantively.
- Incorporated Alex's design for SplitState
- Moved the continuation record types into their own module.
- Tightened visibility on continuation record types.
- Used non-zero sized command in tests.
- Link to v3: https://lore.kernel.org/r/20260226-cmdq-continuation-v3-0-572ab9916766@nvidia.com

Changes in v3:
- Rebased onto drm-rust-next
- Added some doc comments
- Reworded command_size doc comment
- Link to v2: https://lore.kernel.org/r/20260219-cmdq-continuation-v2-0-2e8b7615536f@nvidia.com

Changes in v2:
- Added doccoments
- Renamed driver_bytes_available_to_write to driver_write_area_size
- allocate_command_with_timeout merged allocate_command with timeout parameter
- Replaced hardcoded GSP_PAGE_SIZE * 16 with bindings
- Changed oversized command error from EIO to EMSGSIZE
- Added EMSGSIZE to kernel/error.rs
- Split WrappingCommand functionality into SplitState + SplitCommand enum
- Made max_size a const (MAX_CMD_SIZE)
- Removed send_continuation_record + added comment for type inference
- send_single_command now consumes the command
- Extracted command_size + used in SplitState 
- Link to v1: https://lore.kernel.org/r/20260212-cmdq-continuation-v1-0-73079ded55e6@nvidia.com

---
Eliot Courtney (9):
      gpu: nova-core: gsp: sort MsgFunction variants alphabetically
      gpu: nova-core: gsp: add mechanism to wait for space on command queue
      rust: add EMSGSIZE error code
      gpu: nova-core: gsp: add checking oversized commands
      gpu: nova-core: gsp: clarify invariant on command queue
      gpu: nova-core: gsp: unconditionally call variable payload handling
      gpu: nova-core: gsp: add command_size helper
      gpu: nova-core: gsp: support large RPCs via continuation record
      gpu: nova-core: gsp: add tests for continuation records

 drivers/gpu/nova-core/gsp.rs                      |   1 +
 drivers/gpu/nova-core/gsp/cmdq.rs                 | 114 ++++++--
 drivers/gpu/nova-core/gsp/continuation.rs         | 305 ++++++++++++++++++++++
 drivers/gpu/nova-core/gsp/fw.rs                   |  75 +++---
 drivers/gpu/nova-core/gsp/fw/r570_144/bindings.rs |   1 +
 rust/kernel/error.rs                              |   1 +
 6 files changed, 440 insertions(+), 57 deletions(-)
---
base-commit: 4a49fe23e357b48845e31fe9c28a802c05458198
change-id: 20260203-cmdq-continuation-b99f3d5966c3

Best regards,
-- 
Eliot Courtney <ecourtney@nvidia.com>


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

end of thread, other threads:[~2026-03-03  7:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 11:42 [PATCH v4 0/9] gpu: nova-core: gsp: add continuation record support Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 1/9] gpu: nova-core: gsp: sort MsgFunction variants alphabetically Eliot Courtney
2026-03-02 13:47   ` Gary Guo
2026-03-02 14:49     ` Alexandre Courbot
2026-03-02 11:42 ` [PATCH v4 2/9] gpu: nova-core: gsp: add mechanism to wait for space on command queue Eliot Courtney
2026-03-02 14:18   ` Gary Guo
2026-03-03  3:07     ` Eliot Courtney
2026-03-03  7:48       ` Alexandre Courbot
2026-03-02 11:42 ` [PATCH v4 3/9] rust: add EMSGSIZE error code Eliot Courtney
2026-03-02 14:19   ` Gary Guo
2026-03-02 11:42 ` [PATCH v4 4/9] gpu: nova-core: gsp: add checking oversized commands Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 5/9] gpu: nova-core: gsp: clarify invariant on command queue Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 6/9] gpu: nova-core: gsp: unconditionally call variable payload handling Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 7/9] gpu: nova-core: gsp: add command_size helper Eliot Courtney
2026-03-02 14:22   ` Gary Guo
2026-03-03  3:12     ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 8/9] gpu: nova-core: gsp: support large RPCs via continuation record Eliot Courtney
2026-03-02 13:06   ` Alexandre Courbot
2026-03-03  4:27     ` Eliot Courtney
2026-03-02 11:42 ` [PATCH v4 9/9] gpu: nova-core: gsp: add tests for continuation records Eliot Courtney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox