| 479bec4c | 17-Sep-2025 |
Thorsten Blum <thorsten.blum@linux.dev> |
pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc
Replace kzalloc() followed by copy_from_user() with memdup_user() to improve and simplify pdsfc_fw_rpc().
Return early i
pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc
Replace kzalloc() followed by copy_from_user() with memdup_user() to improve and simplify pdsfc_fw_rpc().
Return early if an error occurs and remove the obsolete 'err_out' label.
No functional changes intended.
Link: https://patch.msgid.link/r/20250917150941.168887-1-thorsten.blum@linux.dev Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Tested-by: Brett Creeley <brett.creeley@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| e7085be8 | 08-Sep-2025 |
Saeed Mahameed <saeedm@nvidia.com> |
fwctl/mlx5: Add Adjacent function query commands and their scope
MLX5_CMD_OP_QUERY_ADJACENT_FUNCTIONS_ID: - Query Adjacent functions (PFs/VFs) of the function calling FW.
MLX5_CMD_OP_DELEGATE_VHCA
fwctl/mlx5: Add Adjacent function query commands and their scope
MLX5_CMD_OP_QUERY_ADJACENT_FUNCTIONS_ID: - Query Adjacent functions (PFs/VFs) of the function calling FW.
MLX5_CMD_OP_DELEGATE_VHCA_MANAGEMENT: - Delegates own VFs to be managed/seen by other adjacent PFs
MLX5_CMD_OP_QUERY_DELEGATED_VHCA: - Query current function delegation state.
Link: https://patch.msgid.link/r/20250908165256.1255985-3-saeed@kernel.org Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| cb81f72f | 08-Sep-2025 |
Avihai Horon <avihaih@nvidia.com> |
fwctl/mlx5: Allow MODIFY_CONG_STATUS command
MODIFY_CONG_STATUS command is used to enable or disable congestion control according to a given priority and protocol.
Add MODIFY_CONG_STATUS to the all
fwctl/mlx5: Allow MODIFY_CONG_STATUS command
MODIFY_CONG_STATUS command is used to enable or disable congestion control according to a given priority and protocol.
Add MODIFY_CONG_STATUS to the allowed commands under configuration scope.
Link: https://patch.msgid.link/r/20250908165256.1255985-2-saeed@kernel.org Signed-off-by: Avihai Horon <avihaih@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| f1234301 | 20-Aug-2025 |
Liao Yuanhong <liaoyuanhong@vivo.com> |
pds_fwctl: Remove the use of dev_err_probe()
Logging messages that show some type of "out of memory" error are generally unnecessary as there is a generic message and a stack dump done by the memory
pds_fwctl: Remove the use of dev_err_probe()
Logging messages that show some type of "out of memory" error are generally unnecessary as there is a generic message and a stack dump done by the memory subsystem. These messages generally increase kernel size without much added value[1].
The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore, remove the useless call to dev_err_probe(), and just return the value instead.
[1]: https://lore.kernel.org/lkml/1402419340.30479.18.camel@joe-AO725/
Link: https://patch.msgid.link/r/20250820124011.474224-1-liaoyuanhong@vivo.com Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| c92ae5d4 | 09-Apr-2025 |
Shannon Nelson <shannon.nelson@amd.com> |
fwctl: Fix repeated device word in log message
Remove the repeated word "device" from a dev_warn() message.
Link: https://patch.msgid.link/r/20250408223300.24561-1-shannon.nelson@amd.com Signed-off
fwctl: Fix repeated device word in log message
Remove the repeated word "device" from a dev_warn() message.
Link: https://patch.msgid.link/r/20250408223300.24561-1-shannon.nelson@amd.com Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| 92c66ee8 | 20-Mar-2025 |
Brett Creeley <brett.creeley@amd.com> |
pds_fwctl: add rpc and query support
The pds_fwctl driver doesn't know what RPC operations are available in the firmware, so also doesn't know what scope they might have. The userland utility suppl
pds_fwctl: add rpc and query support
The pds_fwctl driver doesn't know what RPC operations are available in the firmware, so also doesn't know what scope they might have. The userland utility supplies the firmware "endpoint" and "operation" id values and this driver queries the firmware for endpoints and their available operations. The operation descriptions include the scope information which the driver uses for scope testing.
Link: https://patch.msgid.link/r/20250320194412.67983-6-shannon.nelson@amd.com Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| 52929c21 | 28-Feb-2025 |
Saeed Mahameed <saeedm@nvidia.com> |
fwctl/mlx5: Support for communicating with mlx5 fw
mlx5 FW has a built in security context called UID. Each UID has a set of permissions controlled by the kernel when it is created and every command
fwctl/mlx5: Support for communicating with mlx5 fw
mlx5 FW has a built in security context called UID. Each UID has a set of permissions controlled by the kernel when it is created and every command is tagged by the kernel with a particular UID. In general commands cannot reach objects outside of their UID and commands cannot exceed their UID's permissions. These restrictions are enforced by FW.
This mechanism has long been used in RDMA for the devx interface where RDMA will sent commands directly to the FW and the UID limitations restrict those commands to a ib_device/verbs security domain. For instance commands that would effect other VFs, or global device resources. The model is suitable for unprivileged userspace to operate the RDMA functionality.
The UID has been extended with a "tools resources" permission which allows additional commands and sub-commands that are intended to match with the scope limitations set in FWCTL. This is an alternative design to the "command intent log" where the FW does the enforcement rather than having the FW report the enforcement the kernel should do.
Consistent with the fwctl definitions the "tools resources" security context is limited to the FWCTL_RPC_CONFIGURATION, FWCTL_RPC_DEBUG_READ_ONLY, FWCTL_RPC_DEBUG_WRITE, and FWCTL_RPC_DEBUG_WRITE_FULL security scopes.
Like RDMA devx, each opened fwctl file descriptor will get a unique UID associated with each file descriptor.
The fwctl driver is kept simple and we reject commands that can create objects as the UID mechanism relies on the kernel to track and destroy objects prior to detroying the UID. Filtering into fwctl sub scopes is done inside the driver with a switch statement. This substantially limits what is possible to primarily query functions ad a few limited set operations.
mlx5 already has a robust infrastructure for delivering RPC messages to fw. Trivially connect fwctl's RPC mechanism to mlx5_cmd_do(). Enforce the User Context ID in every RPC header accepted from the FD so the FW knows the security context of the issuing ID.
Link: https://patch.msgid.link/r/7-v5-642aa0c94070+4447f-fwctl_jgg@nvidia.com Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| fb39e909 | 28-Feb-2025 |
Jason Gunthorpe <jgg@nvidia.com> |
fwctl: FWCTL_INFO to return basic information about the device
Userspace will need to know some details about the fwctl interface being used to locate the correct userspace code to communicate with
fwctl: FWCTL_INFO to return basic information about the device
Userspace will need to know some details about the fwctl interface being used to locate the correct userspace code to communicate with the kernel. Provide a simple device_type enum indicating what the kernel driver is.
Allow the device to provide a device specific info struct that contains any additional information that the driver may need to provide to userspace.
Link: https://patch.msgid.link/r/3-v5-642aa0c94070+4447f-fwctl_jgg@nvidia.com Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Tested-by: Dave Jiang <dave.jiang@intel.com> Tested-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|
| 0e79a47f | 28-Feb-2025 |
Jason Gunthorpe <jgg@nvidia.com> |
fwctl: Basic ioctl dispatch for the character device
Each file descriptor gets a chunk of per-FD driver specific context that allows the driver to attach a device specific struct to. The core code t
fwctl: Basic ioctl dispatch for the character device
Each file descriptor gets a chunk of per-FD driver specific context that allows the driver to attach a device specific struct to. The core code takes care of the memory lifetime for this structure.
The ioctl dispatch and design is based on what was built for iommufd. The ioctls have a struct which has a combined in/out behavior with a typical 'zero pad' scheme for future extension and backwards compatibility.
Like iommufd some shared logic does most of the ioctl marshaling and compatibility work and table dispatches to some function pointers for each unique ioctl.
This approach has proven to work quite well in the iommufd and rdma subsystems.
Allocate an ioctl number space for the subsystem.
Link: https://patch.msgid.link/r/2-v5-642aa0c94070+4447f-fwctl_jgg@nvidia.com Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Tested-by: Dave Jiang <dave.jiang@intel.com> Tested-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
show more ...
|