search for: ifcvf_init_hw

Displaying 16 results from an estimated 16 matches for "ifcvf_init_hw".

2023 Jan 27
0
[PATCH] vdpa: ifcvf: Do proper cleanup if IFCVF init fails
...<007047221b at gmail.com> > Date: Tue, 27 Dec 2022 22:02:16 +0100 > Subject: [PATCH] vdpa: ifcvf: Do proper cleanup if IFCVF init fails > > ifcvf_mgmt_dev leaks memory if it is not freed before > returning. Call is made to correct return statement > so memory does not leak. ifcvf_init_hw does not take > care of this so it is needed to do it here. > > Signed-off-by: Tanmay Bhushan <007047221b at gmail.com> > --- > drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c &...
2019 Nov 08
0
[PATCH 1/2] IFC hardware operation layer
...dev *dev, > + uint32_t *val, int size, int where) > +{ > + int ret, i; > + > + for (i = 0; i < size; i += 4) { > + ret = pci_read_config_dword(dev, where + i, val + i / 4); > + if (ret < 0) > + return ret; > + } > + > + return 0; > +} > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + struct virtio_pci_cap cap; > + u16 notify_off; > + int ret; > + u8 pos; > + u32 i; > + > + ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &pos); > + > + if (ret < 0) { > + IFC_ERR(&dev->dev, &qu...
2019 Nov 05
1
[PATCH 1/2] IFC hardware operation layer
...dev *dev, > + uint32_t *val, int size, int where) > +{ > + int ret, i; > + > + for (i = 0; i < size; i += 4) { > + ret = pci_read_config_dword(dev, where + i, val + i / 4); > + if (ret < 0) > + return ret; > + } > + > + return 0; > +} > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + struct virtio_pci_cap cap; > + u16 notify_off; > + int ret; > + u8 pos; > + u32 i; > + > + ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &pos); > + > + if (ret < 0) { > + IFC_ERR(&dev->dev, &qu...
2019 Oct 16
0
[RFC 1/2] vhost: IFC VF hardware operation layer
On Wed, 16 Oct 2019 09:03:17 +0800 Zhu Lingshan <lingshan.zhu at intel.com> wrote: > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + int ret; > + u8 pos; > + struct virtio_pci_cap cap; > + u32 i; > + u16 notify_off; For network code, the preferred declaration style is reverse christmas tree.
2019 Nov 05
0
[PATCH 1/2] IFC hardware operation layer
...dev *dev, > + uint32_t *val, int size, int where) > +{ > + int ret, i; > + > + for (i = 0; i < size; i += 4) { > + ret = pci_read_config_dword(dev, where + i, val + i / 4); > + if (ret < 0) > + return ret; > + } > + > + return 0; > +} > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + struct virtio_pci_cap cap; > + u16 notify_off; > + int ret; > + u8 pos; > + u32 i; > + > + ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &pos); > + > + if (ret < 0) { > + IFC_ERR(&dev->dev, &qu...
2023 Mar 31
1
[PATCH 3/5] retire ifcvf_start_datapath and ifcvf_add_status
...uct ifcvf_hw *hw) { ifcvf_hw_disable(hw); diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h index cb19196c3ece..d34d3bc0dbf4 100644 --- a/drivers/vdpa/ifcvf/ifcvf_base.h +++ b/drivers/vdpa/ifcvf/ifcvf_base.h @@ -110,7 +110,6 @@ struct ifcvf_vdpa_mgmt_dev { }; int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev); -int ifcvf_start_hw(struct ifcvf_hw *hw); void ifcvf_stop_hw(struct ifcvf_hw *hw); void ifcvf_notify_queue(struct ifcvf_hw *hw, u16 qid); void ifcvf_read_dev_config(struct ifcvf_hw *hw, u64 offset, diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/...
2019 Nov 06
0
[PATCH 1/2] IFC hardware operation layer
...dev *dev, > + uint32_t *val, int size, int where) > +{ > + int ret, i; > + > + for (i = 0; i < size; i += 4) { > + ret = pci_read_config_dword(dev, where + i, val + i / 4); > + if (ret < 0) > + return ret; > + } > + > + return 0; > +} > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + struct virtio_pci_cap cap; > + u16 notify_off; > + int ret; > + u8 pos; > + u32 i; > + > + ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &pos); > + > + if (ret < 0) { > + IFC_ERR(&dev->dev, &qu...
2019 Oct 16
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...vf_read_config_range(struct pci_dev *dev, > + uint32_t *val, int size, int where) > +{ > + int i; > + > + for (i = 0; i < size; i += 4) { > + if (pci_read_config_dword(dev, where + i, val + i / 4) < 0) > + return -1; > + } > + return 0; > +} > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) > +{ > + int ret; > + u8 pos; > + struct virtio_pci_cap cap; > + u32 i; > + u16 notify_off; > + > + ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST, &pos); > + > + if (ret < 0) { > + IFC_ERR(&dev->dev, &qu...
2019 Oct 21
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...+??? int i; >>> + >>> +??? for (i = 0; i < size; i += 4) { >>> +??????? if (pci_read_config_dword(dev, where + i, val + i / 4) < 0) >>> +??????????? return -1; >>> +??? } >>> +??? return 0; >>> +} >>> + >>> +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev) >>> +{ >>> +??? int ret; >>> +??? u8 pos; >>> +??? struct virtio_pci_cap cap; >>> +??? u32 i; >>> +??? u16 notify_off; >>> + >>> +??? ret = pci_read_config_byte(dev, PCI_CAPABILITY_LIST...
2020 May 13
0
[PATCH V2] ifcvf: move IRQ request/free to status change handlers
...nst struct pci_device_id *id) > adapter->pdev = pdev; > adapter->vdpa.dma_dev = &pdev->dev; > > - ret = ifcvf_request_irq(adapter); > - if (ret) { > - IFCVF_ERR(pdev, "Failed to request MSI-X irq\n"); > - goto err; > - } > - > ret = ifcvf_init_hw(vf, pdev); > if (ret) { > IFCVF_ERR(pdev, "Failed to init IFCVF hw\n");
2020 May 11
0
[PATCH] ifcvf: move IRQ request/free to status change handlers
...nst struct pci_device_id *id) > adapter->pdev = pdev; > adapter->vdpa.dma_dev = &pdev->dev; > > - ret = ifcvf_request_irq(adapter); > - if (ret) { > - IFCVF_ERR(pdev, "Failed to request MSI-X irq\n"); > - goto err; > - } > - > ret = ifcvf_init_hw(vf, pdev); > if (ret) { > IFCVF_ERR(pdev, "Failed to init IFCVF hw\n");
2020 May 12
1
[PATCH] ifcvf: move IRQ request/free to status change handlers
...pter->vdpa.dma_dev = &pdev->dev; >>> ? -??? ret = ifcvf_request_irq(adapter); >>> -??? if (ret) { >>> -??????? IFCVF_ERR(pdev, "Failed to request MSI-X irq\n"); >>> -??????? goto err; >>> -??? } >>> - >>> ????? ret = ifcvf_init_hw(vf, pdev); >>> ????? if (ret) { >>> ????????? IFCVF_ERR(pdev, "Failed to init IFCVF hw\n"); >>
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...+ > + vf->mem_resource[i].addr = pci_iomap_range(pdev, i, 0, > + vf->mem_resource[i].len); > + if (!vf->mem_resource[i].addr) { > + IFC_ERR(adapter->dev, "Failed to map IO resource %d\n", > + i); > + return -1; > + } > + } > + > + if (ifcvf_init_hw(vf, pdev) < 0) > + return -1; > + > + ret = mdev_register_device(dev, &ifcvf_mdev_fops); > + if (ret) { > + IFC_ERR(adapter->dev, "Failed to register mdev device\n"); > + goto destroy_adapter; > + } > + > + return 0; > + > +destroy_adapter: &...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...ource[i].addr = pci_iomap_range(pdev, i, 0, > + vf->mem_resource[i].len); > + if (!vf->mem_resource[i].addr) { > + IFC_ERR(adapter->dev, "Failed to map IO resource %d\n", > + i); > + ret = -1; > + goto free_msix; > + } > + } > + > + if (ifcvf_init_hw(vf, pdev) < 0) { > + ret = -1; > + goto destroy_adapter; > + } > + > + ret = mdev_register_device(dev, &ifcvf_mdev_fops); > + > + if (ret) { > + IFC_ERR(adapter->dev, "Failed to register mdev device\n"); > + goto destroy_adapter; > + } > + &...
2023 Mar 31
7
[PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism
Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations that passed down from the userspace, then load them to the device config space upon DRIVER_OK. This can not serve live migration, so this series implement an immediate initialization mechanism, which means rather than the former store-load
2023 May 08
6
[PATCH V2 0/5] vDPA/ifcvf: implement immediate initialization mechanism
Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations that passed down from the userspace, then load them to the device config space upon DRIVER_OK. This can not serve live migration, so this series implement an immediate initialization mechanism, which means rather than the former store-load