Jason Wang
2020-Jul-15 08:40 UTC
[PATCH 6/7] ifcvf: replace irq_request/free with helpers in vDPA core.
On 2020/7/13 ??6:22, Zhu, Lingshan wrote:> > > On 7/13/2020 4:33 PM, Jason Wang wrote: >> >> On 2020/7/12 ??10:49, Zhu Lingshan wrote: >>> This commit replaced irq_request/free() with helpers in vDPA >>> core, so that it can request/free irq and setup irq offloading >>> on order. >>> >>> Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com> >>> --- >>> ? drivers/vdpa/ifcvf/ifcvf_main.c | 11 ++++++----- >>> ? 1 file changed, 6 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c >>> b/drivers/vdpa/ifcvf/ifcvf_main.c >>> index f5a60c1..65b84e1 100644 >>> --- a/drivers/vdpa/ifcvf/ifcvf_main.c >>> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c >>> @@ -47,11 +47,12 @@ static void ifcvf_free_irq(struct ifcvf_adapter >>> *adapter, int queues) >>> ? { >>> ????? struct pci_dev *pdev = adapter->pdev; >>> ????? struct ifcvf_hw *vf = &adapter->vf; >>> +??? struct vdpa_device *vdpa = &adapter->vdpa; >>> ????? int i; >>> ? ? ????? for (i = 0; i < queues; i++) >>> -??????? devm_free_irq(&pdev->dev, vf->vring[i].irq, &vf->vring[i]); >>> +??????? vdpa_free_vq_irq(&pdev->dev, vdpa, vf->vring[i].irq, i, >>> &vf->vring[i]); >>> ? ????? ifcvf_free_irq_vectors(pdev); >>> ? } >>> @@ -60,6 +61,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter >>> *adapter) >>> ? { >>> ????? struct pci_dev *pdev = adapter->pdev; >>> ????? struct ifcvf_hw *vf = &adapter->vf; >>> +??? struct vdpa_device *vdpa = &adapter->vdpa; >>> ????? int vector, i, ret, irq; >>> ? ????? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR, >>> @@ -73,6 +75,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter >>> *adapter) >>> ?????????? pci_name(pdev)); >>> ????? vector = 0; >>> ????? irq = pci_irq_vector(pdev, vector); >>> +??? /* config interrupt */ >> >> >> Unnecessary changes. > This is to show we did not setup this irq offloading for config > interrupt, only setup irq offloading for data vq. But can remove this > since we have config_msix_name in code to show what it isBtw, any reason for not making config interrupt work for irq offloading? I don't see any thing that blocks this. Thanks> Thanks BR Zhu Lingshan >>
Michael S. Tsirkin
2020-Jul-15 10:01 UTC
[PATCH 6/7] ifcvf: replace irq_request/free with helpers in vDPA core.
On Wed, Jul 15, 2020 at 04:40:17PM +0800, Jason Wang wrote:> > On 2020/7/13 ??6:22, Zhu, Lingshan wrote: > > > > > > On 7/13/2020 4:33 PM, Jason Wang wrote: > > > > > > On 2020/7/12 ??10:49, Zhu Lingshan wrote: > > > > This commit replaced irq_request/free() with helpers in vDPA > > > > core, so that it can request/free irq and setup irq offloading > > > > on order. > > > > > > > > Signed-off-by: Zhu Lingshan <lingshan.zhu at intel.com> > > > > --- > > > > ? drivers/vdpa/ifcvf/ifcvf_main.c | 11 ++++++----- > > > > ? 1 file changed, 6 insertions(+), 5 deletions(-) > > > > > > > > diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c > > > > b/drivers/vdpa/ifcvf/ifcvf_main.c > > > > index f5a60c1..65b84e1 100644 > > > > --- a/drivers/vdpa/ifcvf/ifcvf_main.c > > > > +++ b/drivers/vdpa/ifcvf/ifcvf_main.c > > > > @@ -47,11 +47,12 @@ static void ifcvf_free_irq(struct > > > > ifcvf_adapter *adapter, int queues) > > > > ? { > > > > ????? struct pci_dev *pdev = adapter->pdev; > > > > ????? struct ifcvf_hw *vf = &adapter->vf; > > > > +??? struct vdpa_device *vdpa = &adapter->vdpa; > > > > ????? int i; > > > > ? ? ????? for (i = 0; i < queues; i++) > > > > -??????? devm_free_irq(&pdev->dev, vf->vring[i].irq, &vf->vring[i]); > > > > +??????? vdpa_free_vq_irq(&pdev->dev, vdpa, vf->vring[i].irq, i, > > > > &vf->vring[i]); > > > > ? ????? ifcvf_free_irq_vectors(pdev); > > > > ? } > > > > @@ -60,6 +61,7 @@ static int ifcvf_request_irq(struct > > > > ifcvf_adapter *adapter) > > > > ? { > > > > ????? struct pci_dev *pdev = adapter->pdev; > > > > ????? struct ifcvf_hw *vf = &adapter->vf; > > > > +??? struct vdpa_device *vdpa = &adapter->vdpa; > > > > ????? int vector, i, ret, irq; > > > > ? ????? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR, > > > > @@ -73,6 +75,7 @@ static int ifcvf_request_irq(struct > > > > ifcvf_adapter *adapter) > > > > ?????????? pci_name(pdev)); > > > > ????? vector = 0; > > > > ????? irq = pci_irq_vector(pdev, vector); > > > > +??? /* config interrupt */ > > > > > > > > > Unnecessary changes. > > This is to show we did not setup this irq offloading for config > > interrupt, only setup irq offloading for data vq. But can remove this > > since we have config_msix_name in code to show what it is > > > Btw, any reason for not making config interrupt work for irq offloading? I > don't see any thing that blocks this. > > ThanksWell config accesses all go through userspace right? Doing config interrupt directly would just be messy ...> > > Thanks BR Zhu Lingshan > > >
Jason Wang
2020-Jul-15 10:04 UTC
[PATCH 6/7] ifcvf: replace irq_request/free with helpers in vDPA core.
On 2020/7/15 ??6:01, Michael S. Tsirkin wrote:> On Wed, Jul 15, 2020 at 04:40:17PM +0800, Jason Wang wrote: >> On 2020/7/13 ??6:22, Zhu, Lingshan wrote: >>> On 7/13/2020 4:33 PM, Jason Wang wrote: >>>> On 2020/7/12 ??10:49, Zhu Lingshan wrote: >>>>> This commit replaced irq_request/free() with helpers in vDPA >>>>> core, so that it can request/free irq and setup irq offloading >>>>> on order. >>>>> >>>>> Signed-off-by: Zhu Lingshan<lingshan.zhu at intel.com> >>>>> --- >>>>> ? drivers/vdpa/ifcvf/ifcvf_main.c | 11 ++++++----- >>>>> ? 1 file changed, 6 insertions(+), 5 deletions(-) >>>>> >>>>> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c >>>>> b/drivers/vdpa/ifcvf/ifcvf_main.c >>>>> index f5a60c1..65b84e1 100644 >>>>> --- a/drivers/vdpa/ifcvf/ifcvf_main.c >>>>> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c >>>>> @@ -47,11 +47,12 @@ static void ifcvf_free_irq(struct >>>>> ifcvf_adapter *adapter, int queues) >>>>> ? { >>>>> ????? struct pci_dev *pdev = adapter->pdev; >>>>> ????? struct ifcvf_hw *vf = &adapter->vf; >>>>> +??? struct vdpa_device *vdpa = &adapter->vdpa; >>>>> ????? int i; >>>>> ? ? ????? for (i = 0; i < queues; i++) >>>>> -??????? devm_free_irq(&pdev->dev, vf->vring[i].irq, &vf->vring[i]); >>>>> +??????? vdpa_free_vq_irq(&pdev->dev, vdpa, vf->vring[i].irq, i, >>>>> &vf->vring[i]); >>>>> ? ????? ifcvf_free_irq_vectors(pdev); >>>>> ? } >>>>> @@ -60,6 +61,7 @@ static int ifcvf_request_irq(struct >>>>> ifcvf_adapter *adapter) >>>>> ? { >>>>> ????? struct pci_dev *pdev = adapter->pdev; >>>>> ????? struct ifcvf_hw *vf = &adapter->vf; >>>>> +??? struct vdpa_device *vdpa = &adapter->vdpa; >>>>> ????? int vector, i, ret, irq; >>>>> ? ????? ret = pci_alloc_irq_vectors(pdev, IFCVF_MAX_INTR, >>>>> @@ -73,6 +75,7 @@ static int ifcvf_request_irq(struct >>>>> ifcvf_adapter *adapter) >>>>> ?????????? pci_name(pdev)); >>>>> ????? vector = 0; >>>>> ????? irq = pci_irq_vector(pdev, vector); >>>>> +??? /* config interrupt */ >>>> Unnecessary changes. >>> This is to show we did not setup this irq offloading for config >>> interrupt, only setup irq offloading for data vq. But can remove this >>> since we have config_msix_name in code to show what it is >> Btw, any reason for not making config interrupt work for irq offloading? I >> don't see any thing that blocks this. >> >> Thanks > Well config accesses all go through userspace right? > Doing config interrupt directly would just be messy ...Right, so I think we need a better comment here. Thanks> >
Seemingly Similar Threads
- [PATCH 6/7] ifcvf: replace irq_request/free with helpers in vDPA core.
- [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism
- [PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq
- [PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq
- [PATCH V2 0/5] vDPA/ifcvf: implement immediate initialization mechanism