Lines Matching full:wq
342 struct idxd_wq *wq = idxd->wqs[i]; in group_work_queues_show() local
344 if (!wq->group) in group_work_queues_show()
347 if (wq->group->id == group->id) in group_work_queues_show()
348 rc += sysfs_emit_at(buf, rc, "wq%d.%d ", idxd->id, wq->id); in group_work_queues_show()
590 struct idxd_wq *wq = confdev_to_wq(dev); in wq_clients_show() local
592 return sysfs_emit(buf, "%d\n", wq->client_count); in wq_clients_show()
601 struct idxd_wq *wq = confdev_to_wq(dev); in wq_state_show() local
603 switch (wq->state) { in wq_state_show()
619 struct idxd_wq *wq = confdev_to_wq(dev); in wq_group_id_show() local
621 if (wq->group) in wq_group_id_show()
622 return sysfs_emit(buf, "%u\n", wq->group->id); in wq_group_id_show()
631 struct idxd_wq *wq = confdev_to_wq(dev); in wq_group_id_store() local
632 struct idxd_device *idxd = wq->idxd; in wq_group_id_store()
644 if (wq->state != IDXD_WQ_DISABLED) in wq_group_id_store()
651 if (wq->group) { in wq_group_id_store()
652 wq->group->num_wqs--; in wq_group_id_store()
653 wq->group = NULL; in wq_group_id_store()
659 prevg = wq->group; in wq_group_id_store()
663 wq->group = group; in wq_group_id_store()
674 struct idxd_wq *wq = confdev_to_wq(dev); in wq_mode_show() local
676 return sysfs_emit(buf, "%s\n", wq_dedicated(wq) ? "dedicated" : "shared"); in wq_mode_show()
683 struct idxd_wq *wq = confdev_to_wq(dev); in wq_mode_store() local
684 struct idxd_device *idxd = wq->idxd; in wq_mode_store()
689 if (wq->state != IDXD_WQ_DISABLED) in wq_mode_store()
693 set_bit(WQ_FLAG_DEDICATED, &wq->flags); in wq_mode_store()
694 wq->threshold = 0; in wq_mode_store()
696 clear_bit(WQ_FLAG_DEDICATED, &wq->flags); in wq_mode_store()
710 struct idxd_wq *wq = confdev_to_wq(dev); in wq_size_show() local
712 return sysfs_emit(buf, "%u\n", wq->size); in wq_size_show()
721 struct idxd_wq *wq = idxd->wqs[i]; in total_claimed_wq_size() local
723 wq_size += wq->size; in total_claimed_wq_size()
733 struct idxd_wq *wq = confdev_to_wq(dev); in wq_size_store() local
735 struct idxd_device *idxd = wq->idxd; in wq_size_store()
748 if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size) in wq_size_store()
751 wq->size = size; in wq_size_store()
761 struct idxd_wq *wq = confdev_to_wq(dev); in wq_priority_show() local
763 return sysfs_emit(buf, "%u\n", wq->priority); in wq_priority_show()
770 struct idxd_wq *wq = confdev_to_wq(dev); in wq_priority_store() local
772 struct idxd_device *idxd = wq->idxd; in wq_priority_store()
782 if (wq->state != IDXD_WQ_DISABLED) in wq_priority_store()
788 wq->priority = prio; in wq_priority_store()
798 struct idxd_wq *wq = confdev_to_wq(dev); in wq_block_on_fault_show() local
800 return sysfs_emit(buf, "%u\n", test_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags)); in wq_block_on_fault_show()
807 struct idxd_wq *wq = confdev_to_wq(dev); in wq_block_on_fault_store() local
808 struct idxd_device *idxd = wq->idxd; in wq_block_on_fault_store()
818 if (wq->state != IDXD_WQ_DISABLED) in wq_block_on_fault_store()
826 if (test_bit(WQ_FLAG_PRS_DISABLE, &wq->flags)) in wq_block_on_fault_store()
829 set_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags); in wq_block_on_fault_store()
831 clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags); in wq_block_on_fault_store()
844 struct idxd_wq *wq = confdev_to_wq(dev); in wq_threshold_show() local
846 return sysfs_emit(buf, "%u\n", wq->threshold); in wq_threshold_show()
853 struct idxd_wq *wq = confdev_to_wq(dev); in wq_threshold_store() local
854 struct idxd_device *idxd = wq->idxd; in wq_threshold_store()
862 if (val > wq->size || val <= 0) in wq_threshold_store()
868 if (wq->state != IDXD_WQ_DISABLED) in wq_threshold_store()
871 if (test_bit(WQ_FLAG_DEDICATED, &wq->flags)) in wq_threshold_store()
874 wq->threshold = val; in wq_threshold_store()
885 struct idxd_wq *wq = confdev_to_wq(dev); in wq_type_show() local
887 switch (wq->type) { in wq_type_show()
904 struct idxd_wq *wq = confdev_to_wq(dev); in wq_type_store() local
907 if (wq->state != IDXD_WQ_DISABLED) in wq_type_store()
910 old_type = wq->type; in wq_type_store()
912 wq->type = IDXD_WQT_NONE; in wq_type_store()
914 wq->type = IDXD_WQT_KERNEL; in wq_type_store()
916 wq->type = IDXD_WQT_USER; in wq_type_store()
921 if (wq->type != old_type) in wq_type_store()
922 memset(wq->name, 0, WQ_NAME_SIZE + 1); in wq_type_store()
933 struct idxd_wq *wq = confdev_to_wq(dev); in wq_name_show() local
935 return sysfs_emit(buf, "%s\n", wq->name); in wq_name_show()
942 struct idxd_wq *wq = confdev_to_wq(dev); in wq_name_store() local
945 if (wq->state != IDXD_WQ_DISABLED) in wq_name_store()
956 memset(wq->name, 0, WQ_NAME_SIZE + 1); in wq_name_store()
957 sprintf(wq->name, "%s", pos); in wq_name_store()
968 struct idxd_wq *wq = confdev_to_wq(dev); in wq_cdev_minor_show() local
971 mutex_lock(&wq->wq_lock); in wq_cdev_minor_show()
972 if (wq->idxd_cdev) in wq_cdev_minor_show()
973 minor = wq->idxd_cdev->minor; in wq_cdev_minor_show()
974 mutex_unlock(&wq->wq_lock); in wq_cdev_minor_show()
1002 struct idxd_wq *wq = confdev_to_wq(dev); in wq_max_transfer_size_show() local
1004 return sysfs_emit(buf, "%llu\n", wq->max_xfer_bytes); in wq_max_transfer_size_show()
1010 struct idxd_wq *wq = confdev_to_wq(dev); in wq_max_transfer_size_store() local
1011 struct idxd_device *idxd = wq->idxd; in wq_max_transfer_size_store()
1018 if (wq->state != IDXD_WQ_DISABLED) in wq_max_transfer_size_store()
1028 wq->max_xfer_bytes = xfer_size; in wq_max_transfer_size_store()
1039 struct idxd_wq *wq = confdev_to_wq(dev); in wq_max_batch_size_show() local
1041 return sysfs_emit(buf, "%u\n", wq->max_batch_size); in wq_max_batch_size_show()
1047 struct idxd_wq *wq = confdev_to_wq(dev); in wq_max_batch_size_store() local
1048 struct idxd_device *idxd = wq->idxd; in wq_max_batch_size_store()
1055 if (wq->state != IDXD_WQ_DISABLED) in wq_max_batch_size_store()
1065 idxd_wq_set_max_batch_size(idxd->data->type, wq, (u32)batch_size); in wq_max_batch_size_store()
1075 struct idxd_wq *wq = confdev_to_wq(dev); in wq_ats_disable_show() local
1077 return sysfs_emit(buf, "%u\n", test_bit(WQ_FLAG_ATS_DISABLE, &wq->flags)); in wq_ats_disable_show()
1083 struct idxd_wq *wq = confdev_to_wq(dev); in wq_ats_disable_store() local
1084 struct idxd_device *idxd = wq->idxd; in wq_ats_disable_store()
1088 if (wq->state != IDXD_WQ_DISABLED) in wq_ats_disable_store()
1099 set_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); in wq_ats_disable_store()
1101 clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags); in wq_ats_disable_store()
1111 struct idxd_wq *wq = confdev_to_wq(dev); in wq_prs_disable_show() local
1113 return sysfs_emit(buf, "%u\n", test_bit(WQ_FLAG_PRS_DISABLE, &wq->flags)); in wq_prs_disable_show()
1119 struct idxd_wq *wq = confdev_to_wq(dev); in wq_prs_disable_store() local
1120 struct idxd_device *idxd = wq->idxd; in wq_prs_disable_store()
1124 if (wq->state != IDXD_WQ_DISABLED) in wq_prs_disable_store()
1135 set_bit(WQ_FLAG_PRS_DISABLE, &wq->flags); in wq_prs_disable_store()
1137 clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags); in wq_prs_disable_store()
1139 clear_bit(WQ_FLAG_PRS_DISABLE, &wq->flags); in wq_prs_disable_store()
1149 struct idxd_wq *wq = confdev_to_wq(dev); in wq_occupancy_show() local
1150 struct idxd_device *idxd = wq->idxd; in wq_occupancy_show()
1156 offset = WQCFG_OFFSET(idxd, wq->id, WQCFG_OCCUP_IDX); in wq_occupancy_show()
1168 struct idxd_wq *wq = confdev_to_wq(dev); in wq_enqcmds_retries_show() local
1170 if (wq_dedicated(wq)) in wq_enqcmds_retries_show()
1173 return sysfs_emit(buf, "%u\n", wq->enqcmds_retries); in wq_enqcmds_retries_show()
1179 struct idxd_wq *wq = confdev_to_wq(dev); in wq_enqcmds_retries_store() local
1183 if (wq_dedicated(wq)) in wq_enqcmds_retries_store()
1193 wq->enqcmds_retries = retries; in wq_enqcmds_retries_store()
1226 struct idxd_wq *wq = confdev_to_wq(dev); in wq_op_config_show() local
1228 return op_cap_show_common(dev, buf, wq->opcap_bmap); in wq_op_config_show()
1252 struct idxd_wq *wq = confdev_to_wq(dev); in wq_op_config_store() local
1253 struct idxd_device *idxd = wq->idxd; in wq_op_config_store()
1257 if (wq->state != IDXD_WQ_DISABLED) in wq_op_config_store()
1272 bitmap_copy(wq->opcap_bmap, opmask, IDXD_MAX_OPCAP_BITS); in wq_op_config_store()
1287 struct idxd_wq *wq = confdev_to_wq(dev); in wq_driver_name_show() local
1289 return sysfs_emit(buf, "%s\n", wq->driver_name); in wq_driver_name_show()
1295 struct idxd_wq *wq = confdev_to_wq(dev); in wq_driver_name_store() local
1298 if (wq->state != IDXD_WQ_DISABLED) in wq_driver_name_store()
1309 memset(wq->driver_name, 0, DRIVER_NAME_SIZE + 1); in wq_driver_name_store()
1310 sprintf(wq->driver_name, "%s", pos); in wq_driver_name_store()
1341 /* A WQ attr is invisible if the feature is not supported in WQCAP. */
1357 struct idxd_wq *wq = confdev_to_wq(dev); in idxd_wq_attr_visible() local
1358 struct idxd_device *idxd = wq->idxd; in idxd_wq_attr_visible()
1387 struct idxd_wq *wq = confdev_to_wq(dev); in idxd_conf_wq_release() local
1389 bitmap_free(wq->opcap_bmap); in idxd_conf_wq_release()
1390 kfree(wq->wqcfg); in idxd_conf_wq_release()
1391 xa_destroy(&wq->upasid_xa); in idxd_conf_wq_release()
1392 kfree(wq); in idxd_conf_wq_release()
1396 .name = "wq",
1511 struct idxd_wq *wq = idxd->wqs[i]; in clients_show() local
1513 count += wq->client_count; in clients_show()
1894 struct idxd_wq *wq; in idxd_register_wq_devices() local
1898 wq = idxd->wqs[i]; in idxd_register_wq_devices()
1899 rc = device_add(wq_confdev(wq)); in idxd_register_wq_devices()
1909 wq = idxd->wqs[i]; in idxd_register_wq_devices()
1910 put_device(wq_confdev(wq)); in idxd_register_wq_devices()
1914 wq = idxd->wqs[j]; in idxd_register_wq_devices()
1915 device_unregister(wq_confdev(wq)); in idxd_register_wq_devices()
1931 dev_dbg(dev, "WQ devices registering failed: %d\n", rc); in idxd_register_devices()
1965 struct idxd_wq *wq = idxd->wqs[i]; in idxd_unregister_devices() local
1967 device_unregister(wq_confdev(wq)); in idxd_unregister_devices()