diff options
author | Shannon Nelson <shannon.nelson@amd.com> | 2023-04-19 10:04:23 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-04-21 08:29:13 +0100 |
commit | 4569cce43bc61e4cdd76597a1cf9b608846c18cc (patch) | |
tree | 872165355173e782a83d21332f52c580a9a51964 /include/linux/pds | |
parent | f53d93110aa526ad3df628ad6d9f672c7d5ae285 (diff) |
pds_core: add auxiliary_bus devices
An auxiliary_bus device is created for each vDPA type VF at VF
probe and destroyed at VF remove. The aux device name comes
from the driver name + VIF type + the unique id assigned at PCI
probe. The VFs are always removed on PF remove, so there should
be no issues with VFs trying to access missing PF structures.
The auxiliary_device names will look like "pds_core.vDPA.nn"
where 'nn' is the VF's uid.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pds')
-rw-r--r-- | include/linux/pds/pds_auxbus.h | 14 | ||||
-rw-r--r-- | include/linux/pds/pds_common.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/pds/pds_auxbus.h b/include/linux/pds/pds_auxbus.h new file mode 100644 index 000000000000..493f75b1995e --- /dev/null +++ b/include/linux/pds/pds_auxbus.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright(c) 2023 Advanced Micro Devices, Inc */ + +#ifndef _PDSC_AUXBUS_H_ +#define _PDSC_AUXBUS_H_ + +#include <linux/auxiliary_bus.h> + +struct pds_auxiliary_dev { + struct auxiliary_device aux_dev; + struct pci_dev *vf_pdev; + u16 client_id; +}; +#endif /* _PDSC_AUXBUS_H_ */ diff --git a/include/linux/pds/pds_common.h b/include/linux/pds/pds_common.h index b2be14ebadb6..961b3d02c69f 100644 --- a/include/linux/pds/pds_common.h +++ b/include/linux/pds/pds_common.h @@ -60,4 +60,5 @@ enum pds_core_logical_qtype { PDS_CORE_QTYPE_MAX = 16 /* don't change - used in struct size */ }; +void *pdsc_get_pf_struct(struct pci_dev *vf_pdev); #endif /* _PDS_COMMON_H_ */ |