All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Hao, Xudong" <xudong.hao@intel.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Re-enable LTR/OBFF when device is owned by pciback
Date: Sun, 22 Apr 2012 22:38:23 -0400	[thread overview]
Message-ID: <20120423023823.GC13840@phenom.dumpdata.com> (raw)
In-Reply-To: <403610A45A2B5242BD291EDAE8B37D300FD2997D@SHSMSX101.ccr.corp.intel.com>

On Sun, Apr 22, 2012 at 03:25:04PM +0000, Hao, Xudong wrote:
> When PCIE device which has LTR/OBFF capabilities is owned by pciback, LTR/OBFF feature may be disabled. This patch re-enable LTR and OBFF, so that guest with device assigned can be benefitted.

Shouldn't they be reset when the device is de-assigned from the guest as well?
> 
> Signed-off-by: Xudong Hao <xudong.hao@intel.com>
> 
> diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
> index 19834d1..82aac5b 100644
> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -334,6 +334,14 @@ static int __devinit pcistub_init_device(struct pci_dev *dev)
>  	dev_dbg(&dev->dev, "reset device\n");
>  	xen_pcibk_reset_device(dev);
>  
> +	/* set default value */
> +	unsigned long type = PCI_EXP_OBFF_SIGNAL_ALWAYS;
> +	int snoop_lat_ns = 1024, nosnoop_lat_ns = 1024; /* 1024ns is max value */


Please put them in the appropiate location - at the start of the 
function.

> +
> +	/* Enable LTR and OBFF before do device assignment */
> +	/* LTR(Latency tolerance reporting) allows devices to send messages to the
> +	 * root complex indicating their latency tolerance for snooped & unsnooped
> +	 * memory transactions. 
> +	 */
> +	pci_enable_ltr(dev);
> +	pci_set_ltr(dev, snoop_lat_ns, nosnoop_lat_ns);

OK, but didn't you just come with up those values?

> +
> +	/* OBFF (optimized buffer flush/fill), where supported, can help improve
> +	 * energy efficiency by giving devices information about when interrupts and
> +	 * other activity will have a reduced power impact.
> +	 */
> +	pci_enable_obff(dev, type);
> +
>  	dev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
>  	return 0;

  reply	other threads:[~2012-04-23  2:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22 15:25 [PATCH] Re-enable LTR/OBFF when device is owned by pciback Hao, Xudong
2012-04-23  2:38 ` Konrad Rzeszutek Wilk [this message]
2012-04-23  3:16   ` Hao, Xudong
2012-04-23  7:52     ` Jan Beulich
2012-04-23  7:50 ` Jan Beulich
2012-04-24  2:49   ` Hao, Xudong
2012-04-24  6:49     ` Jan Beulich
2012-04-25  2:46       ` Hao, Xudong
2012-04-25  6:51         ` Jan Beulich
2012-04-27  2:24           ` Hao, Xudong

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=20120423023823.GC13840@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xudong.hao@intel.com \
    /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 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.