[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Re-enable LTR/OBFF when device is owned by pciback



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Monday, April 23, 2012 3:50 PM
> To: Hao, Xudong
> Cc: xen-devel; konrad.wilk@xxxxxxxxxx
> Subject: Re: [Xen-devel] [PATCH] Re-enable LTR/OBFF when device is owned by
> pciback
> 
> >>> On 22.04.12 at 17:25, "Hao, Xudong" <xudong.hao@xxxxxxxxx> 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.
> >
> > Signed-off-by: Xudong Hao <xudong.hao@xxxxxxxxx>
> >
> > 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);
> 
> Wouldn't the guest kernel be able to do this itself, as it's just playing 
> with bits in
> the PCIE capability structure, or the LTR extended one?
> 
> If not, shouldn't you properly report (or at least log) errors here?
> 

There are two reasons I want to enable ltr/obff in host but not in guest.
1) ltr/obff is not only for one device, enabling them need to enable the whole 
pci bus, include root port, upstream and downstream port. It's complex to let 
guest enable the whole path.
2) LTR/obff are PCIE device capabilities2, current qemu did not support 
exposing PCIe capabilities2 to guest.

Yes, I'll add error report log here.

Thanks,
-Xudong

> > +
> > +   /* 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);
> 
> Similarly here.
> 
> Jan
> 
> > +
> >     dev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED;
> >     return 0;
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxx
> > http://lists.xen.org/xen-devel
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.