public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Zhi Wang <zhiw@nvidia.com>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	dakr@kernel.org, gary@garyguo.net, joelagnelf@nvidia.com,
	aliceryhl@google.com, bhelgaas@google.com,
	kwilczynski@kernel.org, ojeda@kernel.org, alex.gaynor@gmail.com,
	boqun.feng@gmail.com, bjorn3_gh@protonmail.com,
	lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu,
	markus.probst@posteo.de, helgaas@kernel.org, cjia@nvidia.com,
	smitra@nvidia.com, ankita@nvidia.com, aniketa@nvidia.com,
	kwankhede@nvidia.com, targupta@nvidia.com, acourbot@nvidia.com,
	jhubbard@nvidia.com, zhiwang@kernel.org,
	daniel.almeida@collabora.com
Subject: Re: [PATCH 2/2] gpu: nova-core: add fwctl driver for firmware control interface
Date: Mon, 30 Mar 2026 09:58:39 -0300	[thread overview]
Message-ID: <20260330125839.GL310919@nvidia.com> (raw)
In-Reply-To: <20260305190936.398590-3-zhiw@nvidia.com>

On Thu, Mar 05, 2026 at 07:09:36PM +0000, Zhi Wang wrote:
> +        let rm_cmd = match cmd {
> +            uapi::fwctl_cmd_nova_core_FWCTL_CMD_NOVA_CORE_UPLOAD_VGPU_TYPE => {
> +                RmControlMsgFunction::VgpuMgrInternalPgpuAddVgpuType
> +            }
> +            _ => return Err(EINVAL),
> +        };

fwctl drivers should not be changing the commands as they flow
through, the idea is to put the raw command mailbox directly into the
FW, and only access control them. So userspace should be setting the
NV2080_CTRL_CMD_VGPU_MGR_INTERNAL_PGPU_ADD_VGPU_TYPE constant directly
and it should be ABI stable.

> +/**
> + * struct fwctl_rpc_nova_core_request_hdr - ioctl(FWCTL_RPC) input header
> + * @cmd: Command identifier from &enum fwctl_cmd_nova_core.
> + * @mctp_header: MCTP transport header (packed u32).
> + * @nvdm_header: NVDM vendor-defined message header (packed u32).
> + *
> + * Placed at &struct fwctl_rpc.in with total length &struct fwctl_rpc.in_len.
> + * The access scope is specified through &struct fwctl_rpc.scope.
> + * Followed by command-specific input parameters.
> + */
> +struct fwctl_rpc_nova_core_request_hdr {
> +	__u32 mctp_header;
> +	__u32 nvdm_header;
> +	__u32 cmd;
> +};
> +
> +/**
> + * struct fwctl_rpc_nova_core_resp_hdr - ioctl(FWCTL_RPC) output header
> + * @mctp_header: MCTP transport header (packed u32).
> + * @nvdm_header: NVDM vendor-defined message header (packed u32).
> + *
> + * Placed at &struct fwctl_rpc.out with total length &struct fwctl_rpc.out_len.
> + * Followed by command-specific output parameters.
> + */
> +struct fwctl_rpc_nova_core_resp_hdr {
> +	__u32 mctp_header;
> +	__u32 nvdm_header;
> +};

I'm also confused what this is about, are these headers words from the
FW definition?

Jason

      parent reply	other threads:[~2026-03-30 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 19:09 [PATCH 0/2] gpu: nova-core: add fwctl driver Zhi Wang
2026-03-05 19:09 ` [PATCH 1/2] fwctl: use subsys_initcall for built-in configuration Zhi Wang
2026-03-05 19:09 ` [PATCH 2/2] gpu: nova-core: add fwctl driver for firmware control interface Zhi Wang
2026-03-13 16:03   ` Danilo Krummrich
2026-03-13 16:26     ` Jason Gunthorpe
2026-03-30 12:58   ` Jason Gunthorpe [this message]

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=20260330125839.GL310919@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=helgaas@kernel.org \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=kwankhede@nvidia.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=markus.probst@posteo.de \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=tmgross@umich.edu \
    --cc=zhiw@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox