search for: mdev_lock

Displaying 9 results from an estimated 9 matches for "mdev_lock".

Did you mean: wdev_lock
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...gt;>> +{ >>> +??? struct device *dev = mdev_parent_dev(mdev); >>> +??? struct pci_dev *pdev = to_pci_dev(dev); >>> +??? struct ifcvf_adapter *adapter = pci_get_drvdata(pdev); >>> +??? int ret = 0; >>> + >>> +??? mutex_lock(&adapter->mdev_lock); >>> + >>> +??? if (adapter->mdev_count < 1) { >>> +??????? ret = -EINVAL; >>> +??????? goto out; >>> +??? } >>> + >>> +??? mdev_set_class_id(mdev, MDEV_ID_VHOST); >>> +??? mdev_set_dev_ops(mdev, &ifc_mdev_ops); >...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...int ifcvf_mdev_create(struct kobject *kobj, struct mdev_device *mdev) > +{ > + struct device *dev = mdev_parent_dev(mdev); > + struct pci_dev *pdev = to_pci_dev(dev); > + struct ifcvf_adapter *adapter = pci_get_drvdata(pdev); > + int ret = 0; > + > + mutex_lock(&adapter->mdev_lock); > + > + if (adapter->mdev_count < 1) { > + ret = -EINVAL; > + goto out; > + } > + > + mdev_set_class_id(mdev, MDEV_ID_VHOST); > + mdev_set_dev_ops(mdev, &ifc_mdev_ops); > + > + mdev_set_drvdata(mdev, adapter); > + mdev_set_iommu_device(mdev_dev(mdev),...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...int ifcvf_mdev_create(struct kobject *kobj, struct mdev_device *mdev) > +{ > + struct device *dev = mdev_parent_dev(mdev); > + struct pci_dev *pdev = to_pci_dev(dev); > + struct ifcvf_adapter *adapter = pci_get_drvdata(pdev); > + int ret = 0; > + > + mutex_lock(&adapter->mdev_lock); > + > + if (adapter->mdev_count < IFCVF_MDEV_LIMIT) { > + IFC_ERR(&pdev->dev, > + "Can not create mdev, reached limitation %d.\n", > + IFCVF_MDEV_LIMIT); > + ret = -EINVAL; > + goto out; > + } > + > + if (!strcmp(kobj->name, "ifc...
2019 Nov 08
0
[PATCH 1/2] IFC hardware operation layer
...rtio_pci_common_cfg *common_cfg; > + struct ifcvf_net_config *net_cfg; > + struct vring_info vring[IFCVF_MAX_QUEUE_PAIRS * 2]; > + struct ifcvf_pci_mem_resource mem_resource[IFCVF_PCI_MAX_RESOURCE]; > +}; > + > +struct ifcvf_adapter { > + struct device *dev; > + struct mutex mdev_lock; > + int mdev_count; > + int vectors; > + struct ifcvf_hw vf; > +}; > + > +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,...
2019 Nov 05
1
[PATCH 1/2] IFC hardware operation layer
...rtio_pci_common_cfg *common_cfg; > + struct ifcvf_net_config *net_cfg; > + struct vring_info vring[IFCVF_MAX_QUEUE_PAIRS * 2]; > + struct ifcvf_pci_mem_resource mem_resource[IFCVF_PCI_MAX_RESOURCE]; > +}; > + > +struct ifcvf_adapter { > + struct device *dev; > + struct mutex mdev_lock; > + int mdev_count; > + int vectors; > + struct ifcvf_hw vf; > +}; > + > +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,...
2019 Nov 05
0
[PATCH 1/2] IFC hardware operation layer
...rtio_pci_common_cfg *common_cfg; > + struct ifcvf_net_config *net_cfg; > + struct vring_info vring[IFCVF_MAX_QUEUE_PAIRS * 2]; > + struct ifcvf_pci_mem_resource mem_resource[IFCVF_PCI_MAX_RESOURCE]; > +}; > + > +struct ifcvf_adapter { > + struct device *dev; > + struct mutex mdev_lock; > + int mdev_count; > + int vectors; > + struct ifcvf_hw vf; > +}; > + > +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,...
2019 Nov 06
0
[PATCH 1/2] IFC hardware operation layer
...config *net_cfg; > + struct vring_info vring[IFCVF_MAX_QUEUE_PAIRS * 2]; > + struct ifcvf_pci_mem_resource mem_resource[IFCVF_PCI_MAX_RESOURCE]; > +}; It's better to add comments to explain each field. > + > +struct ifcvf_adapter { > + struct device *dev; > + struct mutex mdev_lock; > + int mdev_count; > + int vectors; > + struct ifcvf_hw vf; > +}; > + > +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,...
2019 Oct 16
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...t; + > +#define IFC_PRIVATE_TO_VF(adapter) \ > + (&((struct ifcvf_adapter *)adapter)->vf) > + > +#define IFCVF_MAX_INTR (IFCVF_MAX_QUEUE_PAIRS * 2 + 1) The extra one means the config interrupt? > + > +struct ifcvf_adapter { > + struct device *dev; > + struct mutex mdev_lock; Not used in the patch, move to next one? > + int mdev_count; Not used. > + struct list_head dma_maps; This is not used. Thanks > + int vectors; > + struct ifcvf_hw vf; > +}; > + > +int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev); > +u64 ifcvf_get_fe...
2019 Oct 21
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...gt;> >> >> The extra one means the config interrupt? > Yes. Ok, when we support control vq, it should be changed to 2*N + 2. Thanks >> >> >>> + >>> +struct ifcvf_adapter { >>> +??? struct??? device *dev; >>> +??? struct??? mutex mdev_lock; >> >> >> Not used in the patch, move to next one? > Sure, these not used ones will be moved to small patches where they > are used in v1 patchset. >> >> >>> +??? int??? mdev_count; >> >> >> Not used. >> >> >>> +??...