All of lore.kernel.org
 help / color / mirror / Atom feed
* SR-IOV
@ 2014-08-21 23:39 sheng qiu
  2014-08-22 14:18 ` SR-IOV Keith Busch
  0 siblings, 1 reply; 5+ messages in thread
From: sheng qiu @ 2014-08-21 23:39 UTC (permalink / raw)


Hi,

May i ask is SR-IOV currently enabled on the NVMe driver side (linux)
? if not, is there any plan for it?

Thanks!
Sheng

^ permalink raw reply	[flat|nested] 5+ messages in thread

* SR-IOV
  2014-08-21 23:39 SR-IOV sheng qiu
@ 2014-08-22 14:18 ` Keith Busch
  2014-08-23 20:10   ` SR-IOV Learner
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Busch @ 2014-08-22 14:18 UTC (permalink / raw)


On Thu, 21 Aug 2014, sheng qiu wrote:
> May i ask is SR-IOV currently enabled on the NVMe driver side (linux)
> ? if not, is there any plan for it?

It's not implemented in the linux driver, but no one's proposed a patch
yet either. I've been holding on to this one for a while, but haven't
been able to test.
---

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index 28aec2d..70b6476 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -2961,6 +2961,24 @@ static int nvme_resume(struct device *dev)

  static SIMPLE_DEV_PM_OPS(nvme_dev_pm_ops, nvme_suspend, nvme_resume);

+static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs)
+{
+	if (!pdev->is_physfn)
+		return -EPERM;
+	if (numvfs == 0) {
+		if (pci_vfs_assigned(pdev)) {
+			dev_warn(&pdev->dev,
+				 "Cannot disable SR-IOV VFs while assigned\n");
+			return -EPERM;
+		}
+		pci_disable_sriov(pdev);
+	}
+	else
+		pci_enable_sriov(pdev, numvfs);
+
+	return 0;
+}
+
  static const struct pci_error_handlers nvme_err_handler = {
  	.error_detected	= nvme_error_detected,
  	.mmio_enabled	= nvme_dump_registers,
@@ -2988,6 +3006,7 @@ static struct pci_driver nvme_driver = {
  	.driver		= {
  		.pm	= &nvme_dev_pm_ops,
  	},
+	.sriov_configure = nvme_pci_sriov_configure,
  	.err_handler	= &nvme_err_handler,
  };
--

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* SR-IOV
  2014-08-22 14:18 ` SR-IOV Keith Busch
@ 2014-08-23 20:10   ` Learner
  2014-08-23 23:23     ` SR-IOV Neal Galbo (ngalbo)
  0 siblings, 1 reply; 5+ messages in thread
From: Learner @ 2014-08-23 20:10 UTC (permalink / raw)


Is there a spec or guidelines to follow for implementing/designing SRIOV over nvme...I think the nvme spec doesnt cover SRIOV.

Thanks for your time!

On Aug 22, 2014,@7:18 AM, Keith Busch <keith.busch@intel.com> wrote:

> On Thu, 21 Aug 2014, sheng qiu wrote:
>> May i ask is SR-IOV currently enabled on the NVMe driver side (linux)
>> ? if not, is there any plan for it?
> 
> It's not implemented in the linux driver, but no one's proposed a patch
> yet either. I've been holding on to this one for a while, but haven't
> been able to test.
> ---
> 
> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
> index 28aec2d..70b6476 100644
> --- a/drivers/block/nvme-core.c
> +++ b/drivers/block/nvme-core.c
> @@ -2961,6 +2961,24 @@ static int nvme_resume(struct device *dev)
> 
> static SIMPLE_DEV_PM_OPS(nvme_dev_pm_ops, nvme_suspend, nvme_resume);
> 
> +static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs)
> +{
> +    if (!pdev->is_physfn)
> +        return -EPERM;
> +    if (numvfs == 0) {
> +        if (pci_vfs_assigned(pdev)) {
> +            dev_warn(&pdev->dev,
> +                 "Cannot disable SR-IOV VFs while assigned\n");
> +            return -EPERM;
> +        }
> +        pci_disable_sriov(pdev);
> +    }
> +    else
> +        pci_enable_sriov(pdev, numvfs);
> +
> +    return 0;
> +}
> +
> static const struct pci_error_handlers nvme_err_handler = {
>    .error_detected    = nvme_error_detected,
>    .mmio_enabled    = nvme_dump_registers,
> @@ -2988,6 +3006,7 @@ static struct pci_driver nvme_driver = {
>    .driver        = {
>        .pm    = &nvme_dev_pm_ops,
>    },
> +    .sriov_configure = nvme_pci_sriov_configure,
>    .err_handler    = &nvme_err_handler,
> };
> --
> 
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* SR-IOV
  2014-08-23 20:10   ` SR-IOV Learner
@ 2014-08-23 23:23     ` Neal Galbo (ngalbo)
  0 siblings, 0 replies; 5+ messages in thread
From: Neal Galbo (ngalbo) @ 2014-08-23 23:23 UTC (permalink / raw)


NVMe can accommodate SRIOV. It depends upon the controller implementation whether there is hardware support for VM's or not. Not necessary though, it can be completely done in software too. 

PCI-SIG is the go to place for the SRIOV spec. 

~ Neal Galbo
[iPad Air 128GB]



> On Aug 23, 2014,@4:15 PM, "Learner" <learner.study@gmail.com> wrote:
> 
> Is there a spec or guidelines to follow for implementing/designing SRIOV over nvme...I think the nvme spec doesnt cover SRIOV.
> 
> Thanks for your time!
> 
>> On Aug 22, 2014,@7:18 AM, Keith Busch <keith.busch@intel.com> wrote:
>> 
>>> On Thu, 21 Aug 2014, sheng qiu wrote:
>>> May i ask is SR-IOV currently enabled on the NVMe driver side (linux)
>>> ? if not, is there any plan for it?
>> 
>> It's not implemented in the linux driver, but no one's proposed a patch
>> yet either. I've been holding on to this one for a while, but haven't
>> been able to test.
>> ---
>> 
>> diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
>> index 28aec2d..70b6476 100644
>> --- a/drivers/block/nvme-core.c
>> +++ b/drivers/block/nvme-core.c
>> @@ -2961,6 +2961,24 @@ static int nvme_resume(struct device *dev)
>> 
>> static SIMPLE_DEV_PM_OPS(nvme_dev_pm_ops, nvme_suspend, nvme_resume);
>> 
>> +static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs)
>> +{
>> +    if (!pdev->is_physfn)
>> +        return -EPERM;
>> +    if (numvfs == 0) {
>> +        if (pci_vfs_assigned(pdev)) {
>> +            dev_warn(&pdev->dev,
>> +                 "Cannot disable SR-IOV VFs while assigned\n");
>> +            return -EPERM;
>> +        }
>> +        pci_disable_sriov(pdev);
>> +    }
>> +    else
>> +        pci_enable_sriov(pdev, numvfs);
>> +
>> +    return 0;
>> +}
>> +
>> static const struct pci_error_handlers nvme_err_handler = {
>>   .error_detected    = nvme_error_detected,
>>   .mmio_enabled    = nvme_dump_registers,
>> @@ -2988,6 +3006,7 @@ static struct pci_driver nvme_driver = {
>>   .driver        = {
>>       .pm    = &nvme_dev_pm_ops,
>>   },
>> +    .sriov_configure = nvme_pci_sriov_configure,
>>   .err_handler    = &nvme_err_handler,
>> };
>> --
>> 
>> 
>> _______________________________________________
>> Linux-nvme mailing list
>> Linux-nvme at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-nvme
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply	[flat|nested] 5+ messages in thread

* sr-iov
@ 2017-04-09 16:33 张伟
  0 siblings, 0 replies; 5+ messages in thread
From: 张伟 @ 2017-04-09 16:33 UTC (permalink / raw)
  To: dev

Hi all, 


I have a question related to sr-iov. The problem is that there are two machines directly connected.  On one machine, create an VF and assign IP to it. From another machine, ping it. VF receives the packets. ifconfig has tx increase. tcpdump shows the arp reply. But ethtool tx is 0. another machine does not receive the arp reply.  I created a gist list the steps and related stat information.  Can anyone give some guidance why this happens and how to debug and fix it? 


https://gist.github.com/zhangwei1984/cedd4293d6b2cab6c21ddd0fc17a5cc6


| |


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-09 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21 23:39 SR-IOV sheng qiu
2014-08-22 14:18 ` SR-IOV Keith Busch
2014-08-23 20:10   ` SR-IOV Learner
2014-08-23 23:23     ` SR-IOV Neal Galbo (ngalbo)
2017-04-09 16:33 sr-iov 张伟

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.