mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu Zhao <yu.zhao@intel.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: "jbarnes@virtuousgeek.org" <jbarnes@virtuousgeek.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v10 5/7] PCI: handle SR-IOV Virtual Function Migration
Date: Mon, 9 Mar 2009 16:28:47 +0800	[thread overview]
Message-ID: <20090309082847.GD4638@yzhao-otc.sh.intel.com> (raw)
In-Reply-To: <20090306211341.GH25995@parisc-linux.org>

On Sat, Mar 07, 2009 at 05:13:41AM +0800, Matthew Wilcox wrote:
> On Fri, Feb 20, 2009 at 02:54:46PM +0800, Yu Zhao wrote:
> > +static int sriov_migration(struct pci_dev *dev)
> > +{
> > +	u16 status;
> > +	struct pci_sriov *iov = dev->sriov;
> > +
> > +	if (!iov->nr_virtfn)
> > +		return 0;
> > +
> > +	if (!(iov->cap & PCI_SRIOV_CAP_VFM))
> > +		return 0;
> > +
> > +	pci_read_config_word(iov->self, iov->pos + PCI_SRIOV_STATUS, &status);
> 
> You passed in dev here, you don't need to use iov->self, right?

Will do.

> > +	if (!(status & PCI_SRIOV_STATUS_VFM))
> > +		return 0;
> > +
> > +	schedule_work(&iov->mtask);
> > +
> > +	return 1;
> > +}
> 
> > +/**
> > + * pci_sriov_migration - notify SR-IOV core of Virtual Function Migration
> > + * @dev: the PCI device
> > + *
> > + * Returns IRQ_HANDLED if the IRQ is handled, or IRQ_NONE if not.
> > + *
> > + * Physical Function driver is responsible to register IRQ handler using
> > + * VF Migration Interrupt Message Number, and call this function when the
> > + * interrupt is generated by the hardware.
> > + */
> > +irqreturn_t pci_sriov_migration(struct pci_dev *dev)
> > +{
> > +	if (!dev->sriov)
> > +		return IRQ_NONE;
> > +
> > +	return sriov_migration(dev) ? IRQ_HANDLED : IRQ_NONE;
> > +}
> > +EXPORT_SYMBOL_GPL(pci_sriov_migration);
> 
> OK, I think I get it -- you've basically written an interrupt handler
> for the driver to call from its interrupt handler.  Am I right in
> thinking that the reason the driver needs to do the interrupt handler
> here is because we don't currently have an interface that looks like:
> 
> int pci_get_msix_interrupt(struct pci_dev *dev, unsigned vector);
> 
> ?  If so, we should probably add it; I want it for my MSI-X rewrite
> anyway.

Right, we really need this function. But I guess we still have to keep the
handler in case the PF only has MSI, right?

Thanks,
Yu

  reply	other threads:[~2009-03-09  8:27 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20  6:54 [PATCH v10 0/7] PCI: Linux kernel SR-IOV support Yu Zhao
2009-02-20  6:54 ` [PATCH v10 1/7] PCI: initialize and release SR-IOV capability Yu Zhao
2009-03-06 20:08   ` Matthew Wilcox
2009-03-06 22:03     ` Randy Dunlap
2009-03-06 23:31       ` Duyck, Alexander H
2009-03-07  2:38     ` Greg KH
2009-03-10  1:19       ` Yu Zhao
2009-03-11  4:36         ` Greg KH
2009-03-09  8:12     ` Yu Zhao
2009-02-20  6:54 ` [PATCH v10 2/7] PCI: restore saved SR-IOV state Yu Zhao
2009-03-06 20:09   ` Matthew Wilcox
2009-02-20  6:54 ` [PATCH v10 3/7] PCI: reserve bus range for SR-IOV device Yu Zhao
2009-03-06 20:20   ` Matthew Wilcox
2009-03-09  8:13     ` Yu Zhao
2009-03-09 18:09       ` Randy Dunlap
2009-03-09 18:11         ` Matthew Wilcox
2009-02-20  6:54 ` [PATCH v10 4/7] PCI: add SR-IOV API for Physical Function driver Yu Zhao
2009-03-06 20:37   ` Matthew Wilcox
2009-03-06 21:48     ` Randy Dunlap
2009-03-09  8:29       ` Yu Zhao
2009-03-07  2:40     ` Greg KH
2009-03-09  8:25     ` Yu Zhao
2009-03-09 19:39       ` Greg KH
2009-03-10  1:37         ` Yu Zhao
2009-03-11  4:34           ` Greg KH
2009-02-20  6:54 ` [PATCH v10 5/7] PCI: handle SR-IOV Virtual Function Migration Yu Zhao
2009-03-06 21:13   ` Matthew Wilcox
2009-03-09  8:28     ` Yu Zhao [this message]
2009-02-20  6:54 ` [PATCH v10 6/7] PCI: document SR-IOV sysfs entries Yu Zhao
2009-03-06 21:16   ` Matthew Wilcox
2009-03-06 22:35     ` Randy Dunlap
2009-02-20  6:54 ` [PATCH v10 7/7] PCI: manual for SR-IOV user and driver developer Yu Zhao
2009-03-06 21:17   ` Matthew Wilcox
2009-02-24 10:47 ` [PATCH v10 0/7] PCI: Linux kernel SR-IOV support Avi Kivity
2009-02-25  1:36   ` Yu Zhao
2009-03-06 19:33   ` Matthew Wilcox
2009-03-08 14:30     ` Avi Kivity
2009-03-08 15:01       ` Matthew Wilcox
2009-03-09  0:45         ` Greg KH
2009-03-09  3:42       ` Yang, Sheng
2009-03-09  4:35         ` Yang, Sheng
2009-03-09 13:45           ` Avi Kivity
2009-03-06 19:44 ` Matthew Wilcox
2009-03-07  2:34   ` Greg KH
2009-03-10  1:11     ` Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090309082847.GD4638@yzhao-otc.sh.intel.com \
    --to=yu.zhao@intel.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®