Commit f9a9ffb2 authored by Zhu Lingshan's avatar Zhu Lingshan Committed by Michael S. Tsirkin

vDPA/ifcvf: decouple vq irq requester from the adapter

This commit decouples the vq irq requester from the adapter,
so that these functions can be invoked since probe.
Signed-off-by: default avatarZhu Lingshan <lingshan.zhu@intel.com>
Cc: stable@vger.kernel.org
Message-Id: <20221125145724.1129962-7-lingshan.zhu@intel.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 23dac55c
...@@ -155,10 +155,9 @@ static int ifcvf_alloc_vectors(struct ifcvf_adapter *adapter) ...@@ -155,10 +155,9 @@ static int ifcvf_alloc_vectors(struct ifcvf_adapter *adapter)
return ret; return ret;
} }
static int ifcvf_request_per_vq_irq(struct ifcvf_adapter *adapter) static int ifcvf_request_per_vq_irq(struct ifcvf_hw *vf)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = vf->pdev;
struct ifcvf_hw *vf = &adapter->vf;
int i, vector, ret, irq; int i, vector, ret, irq;
vf->vqs_reused_irq = -EINVAL; vf->vqs_reused_irq = -EINVAL;
...@@ -190,10 +189,9 @@ static int ifcvf_request_per_vq_irq(struct ifcvf_adapter *adapter) ...@@ -190,10 +189,9 @@ static int ifcvf_request_per_vq_irq(struct ifcvf_adapter *adapter)
return -EFAULT; return -EFAULT;
} }
static int ifcvf_request_vqs_reused_irq(struct ifcvf_adapter *adapter) static int ifcvf_request_vqs_reused_irq(struct ifcvf_hw *vf)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = vf->pdev;
struct ifcvf_hw *vf = &adapter->vf;
int i, vector, ret, irq; int i, vector, ret, irq;
vector = 0; vector = 0;
...@@ -266,15 +264,14 @@ static int ifcvf_request_dev_irq(struct ifcvf_adapter *adapter) ...@@ -266,15 +264,14 @@ static int ifcvf_request_dev_irq(struct ifcvf_adapter *adapter)
} }
static int ifcvf_request_vq_irq(struct ifcvf_adapter *adapter) static int ifcvf_request_vq_irq(struct ifcvf_hw *vf)
{ {
struct ifcvf_hw *vf = &adapter->vf;
int ret; int ret;
if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG) if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG)
ret = ifcvf_request_per_vq_irq(adapter); ret = ifcvf_request_per_vq_irq(vf);
else else
ret = ifcvf_request_vqs_reused_irq(adapter); ret = ifcvf_request_vqs_reused_irq(vf);
return ret; return ret;
} }
...@@ -341,7 +338,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter) ...@@ -341,7 +338,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
return ret; return ret;
} }
ret = ifcvf_request_vq_irq(adapter); ret = ifcvf_request_vq_irq(vf);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment