Skip to content

Commit

Permalink
vDPA/ifcvf: decouple vq irq requester from the adapter
Browse files Browse the repository at this point in the history
This commit decouples the vq irq requester from the adapter,
so that these functions can be invoked since probe.

Signed-off-by: Zhu Lingshan <[email protected]>
Cc: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
  • Loading branch information
ls-zhu authored and mstsirkin committed Feb 21, 2023
1 parent 23dac55 commit f9a9ffb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions drivers/vdpa/ifcvf/ifcvf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ static int ifcvf_alloc_vectors(struct ifcvf_adapter *adapter)
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 ifcvf_hw *vf = &adapter->vf;
struct pci_dev *pdev = vf->pdev;
int i, vector, ret, irq;

vf->vqs_reused_irq = -EINVAL;
Expand Down Expand Up @@ -190,10 +189,9 @@ static int ifcvf_request_per_vq_irq(struct ifcvf_adapter *adapter)
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 ifcvf_hw *vf = &adapter->vf;
struct pci_dev *pdev = vf->pdev;
int i, vector, ret, irq;

vector = 0;
Expand Down Expand Up @@ -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;

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
ret = ifcvf_request_vqs_reused_irq(adapter);
ret = ifcvf_request_vqs_reused_irq(vf);

return ret;
}
Expand Down Expand Up @@ -341,7 +338,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
return ret;
}

ret = ifcvf_request_vq_irq(adapter);
ret = ifcvf_request_vq_irq(vf);
if (ret)
return ret;

Expand Down

0 comments on commit f9a9ffb

Please sign in to comment.