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

Re: [Xen-devel] Little help with blk ring



> >
> > >>> On 07.05.12 at 08:23, Daniel Castro <evil.dani@xxxxxxxxx> wrote:
> > > Hello List,
> > >
> > > I have a small problem with the ring when transferring blocks the id
> > > on the response is different from the request.
> > > This is the boot up read, count 0.
> > > The guest requests block 0, it has to be located at 7c00.
> > >
> > > I go ahead and create a REQUEST with this data:
> > > ring_req = RING_GET_REQUEST(priv,priv->req_prod_pvt);
> > > ring_req->id = 9;
> > > ring_req->nr_segments=1;
> > > ring_req->operation = BLKIF_OP_READ; ring_req->sector_number =
> > > (int)op->lba; //sector to be read ring_req->seg[0].gref =
> > > (bi->buffer_gref); //this should be get_free_gref();
> > > ring_req->seg[0].first_sect = 0;//op->lba;
> > > ring_req->seg[0].last_sect = 7;//op->lba + op->count;
> > >
> > > RING_PUSH_REQUESTS_AND_CHECK_NOTIFY((priv),notify);  //return
> > notify=0
> > > if(notify){
> > >           dprintf(1,"Start notify procedure\n");
> > >           evtchn_send_t send;
> > >           send.port = (bi->port);
> > >           dprintf(1,"In notify before hypercall port is %d\n",send.port);
> > >           //hypercall_event_channel_op(EVTCHNOP_send, &send);
> > >           dprintf(1,"HYPERCALL read operation notify res %d\n",
> > > hypercall_event_channel_op(EVTCHNOP_send,&send));
> > > }
> > > ring_res = RING_GET_RESPONSE((priv),(temp->rsp_prod));
> > > Then I get:
> > > FAIL RING RESPONSE 0x0009a040 id:256 status:9 operation 0 this is
> > > the line:
> > > dprintf(1,"FAIL RING RESPONSE %p id:%d status:%d operation %d\n",
> > > ring_res,ring_res->id,ring_res->status,ring_res->operation);
> > >
> > >
> > > The id should be the same on both the request and response, there
> > > are bi ither requests on the fly.
> > >
> > > Any clue?=
> >
> > With status happening to be 9 when id should be, is this perhaps a
> > broken response structure definition?
> >
> 
> That would be my guess too. The structure aligns differently under 64 and 32
> bits so I'd guess the OP is talking between the two.
> 

Further to this, Dom0 sets the "protocol" entry in the frontend xenstore 
(/local/domain/<domu id>/device/vbd/<vbd id>/protocol) to tell it what 
alignment it is using. I wrote GPLPV before this setting existed so I solved 
the problem by sending 2 invalid requests down the ring and checking the 
response. If the fields have shifted around I assume that dom0 is not the same 
bit width as the domu and switch structure definitions on the fly.

Are you writing a new frontend driver?

James


_______________________________________________
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®.