[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1251815199.3864.62.camel@mulgrave.site>
Date: Tue, 01 Sep 2009 09:26:39 -0500
From: James Bottomley <James.Bottomley@...e.de>
To: akataria@...are.com
Cc: Robert Love <robert.w.love@...el.com>,
Randy Dunlap <randy.dunlap@...cle.com>,
Mike Christie <michaelc@...wisc.edu>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitry Torokhov <dtor@...are.com>,
Rolf Eike Beer <eike-kernel@...tec.de>,
Maxime Austruy <maustruy@...are.com>,
Bhavesh Davda <bhavesh@...are.com>
Subject: Re: [PATCH] SCSI driver for VMware's virtual HBA.
On Mon, 2009-08-31 at 14:53 -0700, Alok Kataria wrote:
> > > diff --git a/drivers/scsi/pvscsi.c b/drivers/scsi/pvscsi.c
> > > new file mode 100644
> > > index 0000000..fc85a3a
> > > --- /dev/null
> > > +++ b/drivers/scsi/pvscsi.c
> > [...]
> > > +static int __devinit pvscsi_allocate_sg(struct pvscsi_adapter *adapter)
> > > +{
> > > + struct pvscsi_ctx *ctx;
> > > + int i;
> > > +
> > > + ctx = adapter->cmd_map;
> > > + BUILD_BUG_ON(sizeof(struct pvscsi_sg_list) > PAGE_SIZE);
> > > +
> > > + for (i = 0; i < adapter->req_depth; ++i, ++ctx) {
> > > + ctx->sgl = pci_alloc_consistent(adapter->dev, PAGE_SIZE,
> > > + &ctx->sglPA);
> >
> > Why do you need coherent memory for the sg list? Surely the use pattern
> > of an SG list is that it follows a predefined ownership model between
> > the driver and the virtual device, thus not really requiring coherent
> > memory?
>
> The SG list needs to be accessed by the hypervisor too, and we need the
> physical address to access it from the hypervisor. We do that using the
> sglPA field right now, which the pci_.. interface returns. Do you think
> something else should be used for that purpose ?
The hypervisor is part of the OS coherency domain ... coherent memory is
designed to be a mailbox access between a device and driver, which I
believe the hypervisor doesn't need.
If all you're looking for is a way to map a page of memory to a physical
address, won't dma_map_single() do that for you? Or, actually, in this
case virt_to_page() might be a better way.
James
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists