gpu: nvgpu: mig: Add sysfs nodes for mig mode selection

This is adding two sysfs nodes
1. mig_mode_config: to select the mig_mode
2. mig_mode_config_list: to list the available mig configs.

Added logic to skip gpu dev node creation only for
real MIG physical device.
Added logic to skip the gpu characteristics flags only for
real MIG physical device.

JIRA NVGPU-6633

Change-Id: I4a450b6d658f76e79d89f863c00dffad4558c70f
Signed-off-by: dt <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2499284
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
dt
2021-03-16 09:09:07 +00:00
committed by mobile promotions
parent 639ca4edfb
commit f2b69c8704
3 changed files with 111 additions and 6 deletions

View File

@@ -384,7 +384,9 @@ static long gk20a_ctrl_ioctl_gpu_characteristics(
gpu.cbc_comptags_per_line = g->cbc->comptags_per_cacheline;
#endif
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG) || (gpu_instance_id != 0U)) {
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG) ||
(gpu_instance_id != 0U) ||
(!nvgpu_grmgr_is_multi_gr_enabled(g))) {
gpu.flags = nvgpu_ctrl_ioctl_gpu_characteristics_flags(g);
nvgpu_set_preemption_mode_flags(g, &gpu);
} else {
@@ -2140,7 +2142,9 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg
break;
case NVGPU_GPU_IOCTL_GET_ENGINE_INFO:
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG) && (gpu_instance_id != 0U)) {
if (nvgpu_is_enabled(g, NVGPU_SUPPORT_MIG) &&
((gpu_instance_id != 0U) ||
(!nvgpu_grmgr_is_multi_gr_enabled(g)))) {
err = nvgpu_gpu_get_gpu_instance_engine_info(g, gpu_instance_id,
(struct nvgpu_gpu_get_engine_info_args *)buf);
} else {