summaryrefslogtreecommitdiff
path: root/drivers/vdpa/ifcvf/ifcvf_base.h
diff options
context:
space:
mode:
authorZhu Lingshan <lingshan.zhu@intel.com>2022-11-25 22:57:21 +0800
committerMichael S. Tsirkin <mst@redhat.com>2023-02-20 19:26:55 -0500
commit6a3b2f179b49f2c6452ecc37b4778a43848b454c (patch)
treecbf86af420e04495ebab24db02a7001a2c0bbddd /drivers/vdpa/ifcvf/ifcvf_base.h
parent7cfd36b7e8be6bdaeb5af0f9729871b732a7a3c8 (diff)
downloadlwn-6a3b2f179b49f2c6452ecc37b4778a43848b454c.tar.gz
lwn-6a3b2f179b49f2c6452ecc37b4778a43848b454c.zip
vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev
This commit allocates the hw structure in the management device structure. So the hardware can be initialized once the management device is allocated in probe. Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com> Cc: stable@vger.kernel.org Message-Id: <20221125145724.1129962-10-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa/ifcvf/ifcvf_base.h')
-rw-r--r--drivers/vdpa/ifcvf/ifcvf_base.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h
index e1fe947d61b7..25bd4e927b27 100644
--- a/drivers/vdpa/ifcvf/ifcvf_base.h
+++ b/drivers/vdpa/ifcvf/ifcvf_base.h
@@ -39,7 +39,7 @@
#define IFCVF_INFO(pdev, fmt, ...) dev_info(&pdev->dev, fmt, ##__VA_ARGS__)
#define ifcvf_private_to_vf(adapter) \
- (&((struct ifcvf_adapter *)adapter)->vf)
+ (((struct ifcvf_adapter *)adapter)->vf)
/* all vqs and config interrupt has its own vector */
#define MSIX_VECTOR_PER_VQ_AND_CONFIG 1
@@ -95,7 +95,7 @@ struct ifcvf_hw {
struct ifcvf_adapter {
struct vdpa_device vdpa;
struct pci_dev *pdev;
- struct ifcvf_hw vf;
+ struct ifcvf_hw *vf;
};
struct ifcvf_vring_lm_cfg {
@@ -110,6 +110,7 @@ struct ifcvf_lm_cfg {
struct ifcvf_vdpa_mgmt_dev {
struct vdpa_mgmt_dev mdev;
+ struct ifcvf_hw vf;
struct ifcvf_adapter *adapter;
struct pci_dev *pdev;
};