Re: [PATCH 2/2] gpu: nova-core: add fwctl driver for firmware control interface
From: Jason Gunthorpe
Date: Mon Mar 30 2026 - 09:06:19 EST
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