1/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright © 2023-2025 Intel Corporation
4 */
5
6#ifndef _XE_SRIOV_PF_TYPES_H_
7#define _XE_SRIOV_PF_TYPES_H_
8
9#include <linux/mutex.h>
10#include <linux/types.h>
11
12#include "xe_guard.h"
13#include "xe_sriov_pf_migration_types.h"
14#include "xe_sriov_pf_provision_types.h"
15#include "xe_sriov_pf_service_types.h"
16
17struct kobject;
18
19/**
20 * struct xe_sriov_metadata - per-VF device level metadata
21 */
22struct xe_sriov_metadata {
23 /** @kobj: kobject representing VF in PF's SR-IOV sysfs tree. */
24 struct kobject *kobj;
25
26 /** @version: negotiated VF/PF ABI version */
27 struct xe_sriov_pf_service_version version;
28 /** @migration: migration state */
29 struct xe_sriov_migration_state migration;
30};
31
32/**
33 * struct xe_device_pf - Xe PF related data
34 *
35 * The data in this structure is valid only if driver is running in the
36 * @XE_SRIOV_MODE_PF mode.
37 */
38struct xe_device_pf {
39 /** @device_total_vfs: Maximum number of VFs supported by the device. */
40 u16 device_total_vfs;
41
42 /** @driver_max_vfs: Maximum number of VFs supported by the driver. */
43 u16 driver_max_vfs;
44
45 /** @guard_vfs_enabling: guards VFs enabling */
46 struct xe_guard guard_vfs_enabling;
47
48 /** @master_lock: protects all VFs configurations across GTs */
49 struct mutex master_lock;
50
51 /** @provision: device level provisioning data. */
52 struct xe_sriov_pf_provision provision;
53
54 /** @migration: device level migration data. */
55 struct xe_sriov_pf_migration migration;
56
57 /** @service: device level service data. */
58 struct xe_sriov_pf_service service;
59
60 /** @sysfs: device level sysfs data. */
61 struct {
62 /** @sysfs.root: the root kobject for all SR-IOV entries in sysfs. */
63 struct kobject *root;
64 } sysfs;
65
66 /** @vfs: metadata for all VFs. */
67 struct xe_sriov_metadata *vfs;
68};
69
70#endif
71

source code of linux/drivers/gpu/drm/xe/xe_sriov_pf_types.h