All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Re-enable LTR/OBFF when device is owned by pciback
@ 2012-04-22 15:25 Hao, Xudong
  2012-04-23  2:38 ` Konrad Rzeszutek Wilk
  2012-04-23  7:50 ` Jan Beulich
  0 siblings, 2 replies; 10+ messages in thread
From: Hao, Xudong @ 2012-04-22 15:25 UTC (permalink / raw)
  To: konrad.wilk@oracle.com, xen-devel@lists.xensource.com

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.

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 */
+
+	/* 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);
+
+	/* 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;

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

end of thread, other threads:[~2012-04-27  2:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.