All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhi Wang <zhiw@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	 Ben Skeggs <bskeggs@nvidia.com>,
	Andy Currid <ACurrid@nvidia.com>, Neo Jia <cjia@nvidia.com>,
	Surath Mitra <smitra@nvidia.com>,
	Ankit Agrawal <ankita@nvidia.com>,
	Aniket Agashe <aniketa@nvidia.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"Tarun Gupta (SW-GPU)" <targupta@nvidia.com>,
	"zhiwang@kernel.org" <zhiwang@kernel.org>
Subject: Re: [PATCH v3 01/15] nvkm: add a kernel doc to introduce the GSP RPC
Date: Fri, 13 Dec 2024 14:11:33 +0000	[thread overview]
Message-ID: <22cb44f3-368d-42d3-adb0-beb4eb3287c8@nvidia.com> (raw)
In-Reply-To: <Z1ll6LMzGNlQuR0O@pollux.localdomain>

On 11/12/2024 12.14, Danilo Krummrich wrote:
> Hi Zhi,
> 
> On Thu, Oct 31, 2024 at 01:52:36AM -0700, Zhi Wang wrote:
>> In order to explain the name clean-ups in GSP RPC routines, a kernel
>> doc to explain the memory layout and terms is required.
>>
>> Add a kernel doc to introduce the GSP RPC.
> 
> Thanks for adding this -- very much appreciated!
> 
>>
>> Signed-off-by: Zhi Wang <zhiw@nvidia.com>
>> ---
>>   .../gpu/drm/nouveau/nvkm/subdev/gsp/r535.c    | 46 +++++++++++++++++++
>>   1 file changed, 46 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
>> index a4b8381c4e3e..1a07c0191356 100644
>> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
>> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
> 
> I assume the idea is to add this documentation r535 specifically and for it for
> new firmware versions?
> 

I think it is to depict the general idea for people to understand. For 
newer firmware version (just checked the code in openrm main branch), 
the idea is still valid. Suppose the minor changes on some data 
structures can be self-documented by definitions.

>> @@ -60,6 +60,52 @@
>>   #define GSP_MSG_MIN_SIZE GSP_PAGE_SIZE
>>   #define GSP_MSG_MAX_SIZE GSP_PAGE_MIN_SIZE * 16
>>   
>> +/**
>> + * DOC: GSP message queue element
> 
> We should probably include those DOCs into a Documentation/gpu/nouveau.rst (which
> would need to be created, now that we add documentation).
> 

Sounds a good idea.

>> + *
>> + * https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/src/nvidia/inc/kernel/gpu/gsp/message_queue_priv.h
> 
> If so, this should not reference the main branch, but rather the corresponding
> r535 release?
> >> + *
>> + * The GSP command queue and status queue are message queues for the
>> + * communication between software and GSP. The software submits the GSP
>> + * RPC via the GSP command queue, GSP writes the status of the submitted
>> + * RPC in the status queue.
>> + *
>> + * A GSP message queue element consists of three parts:
>> + *
>> + * - message element header (struct r535_gsp_msg), which mostly maintains
>> + * the metadata for queuing the element.
>> + *
>> + * - RPC message header (struct nvfw_gsp_rpc), which maintains the info
>> + * of the RPC. E.g., the RPC function number.
>> + *
>> + * - The payload, where the RPC message stays. E.g. the params of a
>> + * specific RPC function. Some RPC functions also have their headers
>> + * in the payload. E.g. rm_alloc, rm_control.
>> + *
>> + * The memory layout of a GSP message element can be illustrated below:
>> + *
>> + * +------------------------+
>> + * | Message Element Header |
>> + * |    (r535_gsp_msg)      |
>> + * |                        |
>> + * | (r535_gsp_msg.data)    |
>> + * |          |             |
>> + * |----------V-------------|
>> + * |    GSP RPC Header      |
>> + * |    (nvfw_gsp_rpc)      |
>> + * |                        |
>> + * | (nvfw_gsp_rpc.data)    |
>> + * |          |             |
>> + * |----------V-------------|
>> + * |                        |
>> + * |       Payload          |
>> + * |                        |
>> + * |   header(optional)     |
>> + * |        params          |
>> + * +------------------------+
>> + *
>> + */
>> +
>>   struct r535_gsp_msg {
>>   	u8 auth_tag_buffer[16];
>>   	u8 aad_buffer[16];
>> -- 
>> 2.34.1
>>


  reply	other threads:[~2024-12-13 14:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31  8:52 [PATCH v3 00/15] NVKM GSP RPC kernel docs, cleanups and fixes Zhi Wang
2024-10-31  8:52 ` [PATCH v3 01/15] nvkm: add a kernel doc to introduce the GSP RPC Zhi Wang
2024-12-11 10:14   ` Danilo Krummrich
2024-12-13 14:11     ` Zhi Wang [this message]
2024-10-31  8:52 ` [PATCH v3 02/15] nvkm: rename "repc" to "gsp_rpc_len" on the GSP message recv path Zhi Wang
2024-12-11 10:26   ` Danilo Krummrich
2024-12-13 14:12     ` Zhi Wang
2024-10-31  8:52 ` [PATCH v3 03/15] nvkm: rename "argv" to what it represnts on the GSP message send path Zhi Wang
2024-10-31  8:52 ` [PATCH v3 04/15] nvkm: remove unused param repc in *rm_alloc_push() Zhi Wang
2024-10-31  8:52 ` [PATCH v3 05/15] nvkm: rename "argv" to what it represents in *rm_{alloc, ctrl}_*() Zhi Wang
2024-10-31  8:52 ` [PATCH v3 06/15] nvkm: rename "argc" to what it represents in GSP RPC routines Zhi Wang
2024-10-31  8:52 ` [PATCH v3 07/15] nvkm: fix the broken marco GSP_MSG_MAX_SIZE Zhi Wang
2024-10-31  8:52 ` [PATCH v3 08/15] nvkm: remove the magic number in r535_gsp_rpc_push() Zhi Wang
2024-10-31  8:52 ` [PATCH v3 09/15] nvkm: refine the variable names " Zhi Wang
2024-10-31  8:52 ` [PATCH v3 10/15] nvkm: refine the variable names in r535_gsp_msg_recv() Zhi Wang
2024-10-31 14:27   ` Timur Tabi
2024-10-31 15:49     ` Zhi Wang
2024-10-31 16:11       ` Timur Tabi
2024-10-31 18:18         ` Zhi Wang
2024-10-31  8:52 ` [PATCH v3 11/15] nvkm: rename the variable "cmd" to "msg" in r535_gsp_cmdq_{get, push}() Zhi Wang
2024-10-31  8:52 ` [PATCH v3 12/15] nvkm: factor out r535_gsp_msgq_peek() Zhi Wang
2024-12-11 13:16   ` Danilo Krummrich
2024-10-31  8:52 ` [PATCH v3 13/15] nvkm: factor out r535_gsp_msgq_recv_one_elem() Zhi Wang
2024-10-31  8:52 ` [PATCH v3 14/15] nvkm: support handling the return of large GSP message Zhi Wang
2024-10-31  8:52 ` [PATCH v3 15/15] nvkm: consume " Zhi Wang
2024-10-31  9:05 ` [PATCH v3 00/15] NVKM GSP RPC kernel docs, cleanups and fixes Danilo Krummrich

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=22cb44f3-368d-42d3-adb0-beb4eb3287c8@nvidia.com \
    --to=zhiw@nvidia.com \
    --cc=ACurrid@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=bskeggs@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=kwankhede@nvidia.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=zhiwang@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.