search for: virtio_f_sr_iov

Displaying 20 results from an estimated 36 matches for "virtio_f_sr_iov".

2018 May 30
8
[PATCH] virtio_pci: support enabling VFs
...tio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + sriov_configure = pci_sriov_configure_simple; + if (sriov_configure == NULL) + return -ENOENT; + + return sriov_configure(pci_dev, num_vfs); +} + static struct pci_driver virtio_pci_driver = { .name = "virtio-pci", .id_table = virtio_pci_id_table, @@ -596,6...
2018 May 30
8
[PATCH] virtio_pci: support enabling VFs
...tio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + sriov_configure = pci_sriov_configure_simple; + if (sriov_configure == NULL) + return -ENOENT; + + return sriov_configure(pci_dev, num_vfs); +} + static struct pci_driver virtio_pci_driver = { .name = "virtio-pci", .id_table = virtio_pci_id_table, @@ -596,6...
2018 Jun 01
3
[PATCH v2] virtio_pci: support enabling VFs
...struct pci_dev *pci_dev, int num_vfs) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int ret; + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + if (pci_vfs_assigned(pci_dev)) + return -EPERM; + + if (num_vfs == 0) { + pci_disable_sriov(pci_dev); + return 0; + } + + ret = pci_enable_sriov(pci_dev, num_vfs); + if (ret < 0) + return ret; + + return num_vfs; +} + static struct pci_driver virtio_pci_driver = {...
2018 Jun 01
3
[PATCH v2] virtio_pci: support enabling VFs
...struct pci_dev *pci_dev, int num_vfs) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int ret; + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + if (pci_vfs_assigned(pci_dev)) + return -EPERM; + + if (num_vfs == 0) { + pci_disable_sriov(pci_dev); + return 0; + } + + ret = pci_enable_sriov(pci_dev, num_vfs); + if (ret < 0) + return ret; + + return num_vfs; +} + static struct pci_driver virtio_pci_driver = {...
2018 Jun 01
2
[PATCH v3] virtio_pci: support enabling VFs
...struct pci_dev *pci_dev, int num_vfs) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int ret; + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + if (pci_vfs_assigned(pci_dev)) + return -EPERM; + + if (num_vfs == 0) { + pci_disable_sriov(pci_dev); + return 0; + } + + ret = pci_enable_sriov(pci_dev, num_vfs); + if (ret < 0) + return ret; + + return num_vfs; +} + static struct pci_driver virtio_pci_driver = {...
2018 Jun 01
2
[PATCH v3] virtio_pci: support enabling VFs
...struct pci_dev *pci_dev, int num_vfs) +{ + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); + struct virtio_device *vdev = &vp_dev->vdev; + int ret; + + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) + return -EBUSY; + + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) + return -EINVAL; + + if (pci_vfs_assigned(pci_dev)) + return -EPERM; + + if (num_vfs == 0) { + pci_disable_sriov(pci_dev); + return 0; + } + + ret = pci_enable_sriov(pci_dev, num_vfs); + if (ret < 0) + return ret; + + return num_vfs; +} + static struct pci_driver virtio_pci_driver = {...
2018 Jun 05
2
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...p_dev = pci_get_drvdata(pci_dev); > > + struct virtio_device *vdev = &vp_dev->vdev; > > + int ret; > > + > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > > + return -EBUSY; > > + > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > > + return -EINVAL; > > + > > + if (pci_vfs_assigned(pci_dev)) > > + return -EPERM; > > + > > + if (num_vfs == 0) { > > + pci_disable_sriov(pci_dev); > > + return 0; > > + } > > + > > + ret = pci_enable_sriov(pci_dev, num_vfs...
2018 Jun 06
2
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...device *vdev = &vp_dev->vdev; > > > > + int ret; > > > > + > > > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > > > > + return -EBUSY; > > > > + > > > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > > > > + return -EINVAL; > > > > + > > > > + if (pci_vfs_assigned(pci_dev)) > > > > + return -EPERM; > > > > + > > > > + if (num_vfs == 0) { > > > > + pci_disable_sriov(pci_dev); > > > > + return...
2018 Jun 06
2
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...; > + int ret; > > > > > > + > > > > > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > > > > > > + return -EBUSY; > > > > > > + > > > > > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > > > > > > + return -EINVAL; > > > > > > + > > > > > > + if (pci_vfs_assigned(pci_dev)) > > > > > > + return -EPERM; > > > > > > + > > > > > > + if (num_vfs == 0) { > > > > &...
2018 May 31
1
[PATCH] virtio_pci: support enabling VFs
...s); >> > > > > + >> > > > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) >> > > > > + return -EBUSY; >> > > > > + >> > > > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) >> > > > > + return -EINVAL; >> > > > > + >> > > > > + sriov_configure = pci_sriov_configure_simple; >> > > > > + if (sriov_configure == NULL) >> > > > > + return -ENOENT; &gt...
2018 May 30
0
[PATCH] virtio_pci: support enabling VFs
...vdata(pci_dev); > + struct virtio_device *vdev = &vp_dev->vdev; > + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); > + > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return -EBUSY; > + > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > + return -EINVAL; > + > + sriov_configure = pci_sriov_configure_simple; > + if (sriov_configure == NULL) > + return -ENOENT; BTW what is all this trickery in aid of? > + > + return sriov_configure(pci_dev, num_vfs); > +} > + > static struct pci_driver virtio_p...
2018 May 30
0
[virtio-dev] [PATCH] virtio_pci: support enabling VFs
...irtio_device *vdev = &vp_dev->vdev; > + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); > + > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return -EBUSY; > + > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > + return -EINVAL; > + > + sriov_configure = pci_sriov_configure_simple; > + if (sriov_configure == NULL) > + return -ENOENT; > + > + return sriov_configure(pci_dev, num_vfs); > +} > + > static struct pci_driver virtio_...
2018 Jun 01
0
[PATCH v2] virtio_pci: support enabling VFs
...> + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); > + struct virtio_device *vdev = &vp_dev->vdev; > + int ret; > + > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return -EBUSY; > + > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > + return -EINVAL; > + > + if (pci_vfs_assigned(pci_dev)) > + return -EPERM; Not a comment on this patch - existing code has the same race - but generally 1. this seems racy since assigning vfs does not seem to take device lock 2. does this work correctly for kvm at all? pc...
2018 Jun 04
0
[PATCH v3] virtio_pci: support enabling VFs
...> + struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); > + struct virtio_device *vdev = &vp_dev->vdev; > + int ret; > + > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > + return -EBUSY; > + > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > + return -EINVAL; > + > + if (pci_vfs_assigned(pci_dev)) > + return -EPERM; > + > + if (num_vfs == 0) { > + pci_disable_sriov(pci_dev); > + return 0; > + } > + > + ret = pci_enable_sriov(pci_dev, num_vfs); > + if (ret < 0) > + return ret; > + &g...
2018 May 30
2
[PATCH] virtio_pci: support enabling VFs
...; >>>> + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); >>>> + >>>> + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) >>>> + return -EBUSY; >>>> + >>>> + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) >>>> + return -EINVAL; >>>> + >>>> + sriov_configure = pci_sriov_configure_simple; >>>> + if (sriov_configure == NULL) >>>> + return -ENOENT; >>> >>> BTW what is all this trickery in aid of? >> >> When SR-...
2018 May 30
2
[PATCH] virtio_pci: support enabling VFs
...; >>>> + int (*sriov_configure)(struct pci_dev *pci_dev, int num_vfs); >>>> + >>>> + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) >>>> + return -EBUSY; >>>> + >>>> + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) >>>> + return -EINVAL; >>>> + >>>> + sriov_configure = pci_sriov_configure_simple; >>>> + if (sriov_configure == NULL) >>>> + return -ENOENT; >>> >>> BTW what is all this trickery in aid of? >> >> When SR-...
2020 Aug 21
3
[PATCH] vdpa/mlx5: Avoid warnings about shifts on 32-bit platforms
...) | BIT(VIRTIO_NET_F_STANDBY) | \ - BIT(VIRTIO_NET_F_SPEED_DUPLEX) | BIT(VIRTIO_F_NOTIFY_ON_EMPTY) | \ - BIT(VIRTIO_F_ANY_LAYOUT) | BIT(VIRTIO_F_VERSION_1) | BIT(VIRTIO_F_ACCESS_PLATFORM) | \ - BIT(VIRTIO_F_RING_PACKED) | BIT(VIRTIO_F_ORDER_PLATFORM) | BIT(VIRTIO_F_SR_IOV)) + (BIT_ULL(VIRTIO_NET_F_CSUM) | BIT_ULL(VIRTIO_NET_F_GUEST_CSUM) | \ + BIT_ULL(VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) | BIT_ULL(VIRTIO_NET_F_MTU) | BIT_ULL(VIRTIO_NET_F_MAC) | \ + BIT_ULL(VIRTIO_NET_F_GUEST_TSO4) | BIT_ULL(VIRTIO_NET_F_GUEST_TSO6) |...
2020 Aug 21
3
[PATCH] vdpa/mlx5: Avoid warnings about shifts on 32-bit platforms
...) | BIT(VIRTIO_NET_F_STANDBY) | \ - BIT(VIRTIO_NET_F_SPEED_DUPLEX) | BIT(VIRTIO_F_NOTIFY_ON_EMPTY) | \ - BIT(VIRTIO_F_ANY_LAYOUT) | BIT(VIRTIO_F_VERSION_1) | BIT(VIRTIO_F_ACCESS_PLATFORM) | \ - BIT(VIRTIO_F_RING_PACKED) | BIT(VIRTIO_F_ORDER_PLATFORM) | BIT(VIRTIO_F_SR_IOV)) + (BIT_ULL(VIRTIO_NET_F_CSUM) | BIT_ULL(VIRTIO_NET_F_GUEST_CSUM) | \ + BIT_ULL(VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) | BIT_ULL(VIRTIO_NET_F_MTU) | BIT_ULL(VIRTIO_NET_F_MAC) | \ + BIT_ULL(VIRTIO_NET_F_GUEST_TSO4) | BIT_ULL(VIRTIO_NET_F_GUEST_TSO6) |...
2018 Jun 05
0
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...gt; > > + struct virtio_device *vdev = &vp_dev->vdev; > > > + int ret; > > > + > > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > > > + return -EBUSY; > > > + > > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > > > + return -EINVAL; > > > + > > > + if (pci_vfs_assigned(pci_dev)) > > > + return -EPERM; > > > + > > > + if (num_vfs == 0) { > > > + pci_disable_sriov(pci_dev); > > > + return 0; > > > + } > > > + &...
2018 Jun 06
0
[virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs
...;vdev; > > > > > + int ret; > > > > > + > > > > > + if (!(vdev->config->get_status(vdev) & VIRTIO_CONFIG_S_DRIVER_OK)) > > > > > + return -EBUSY; > > > > > + > > > > > + if (!__virtio_test_bit(vdev, VIRTIO_F_SR_IOV)) > > > > > + return -EINVAL; > > > > > + > > > > > + if (pci_vfs_assigned(pci_dev)) > > > > > + return -EPERM; > > > > > + > > > > > + if (num_vfs == 0) { > > > > > + pci_disable_sriov(pci_d...