From: john M <joh...@gm...> - 2008-07-11 01:42:44
|
Hi all, I intergrated the iet target with our Raid core. As of now, whatever data i need to send to Raid Core or receive from Raid core, i am doing byte copy from "tio" or to "tio" structure. My RaidCore return SGList for Read commands and would give some buffer pointer to copy the DMA data into for the write commands. To completely utilize the throughput, i need a interface which has Scatter Gatter List instead of "tio". Can anyone put some light on how would i go to do this. Or point me at the place which has this interface already implemented. -JM On Mon, Jun 30, 2008 at 10:23 AM, john M <joh...@gm...> wrote: > Ming/Arne, > Thanks for your help, i figured out what was going wrong. > -JM > > On Mon, Jun 30, 2008 at 7:01 AM, Ming Zhang <bla...@gm...> > wrote: > >> i could not spot anything wrong easily base on this partial view. since >> u get the BUG(), then u can print out that command content and see which >> command it is. how it was executed.... >> >> >> On Sun, 2008-06-29 at 11:23 -0700, john M wrote: >> > Arne, >> > Here is my code snippet: >> > >> > static int cmnd_execute(struct iscsi_cmnd *cmnd) >> > { >> > int type = cmnd->conn->session->target->trgt_param.target_type; >> > assert(target_type_array[type]->execute_cmnd); >> > return >> > target_type_array[type]->execute_cmnd(cmnd); /* This >> > would call ProcessCommand which is a filter driver to raid core*/ >> > } >> > >> > int ProcessCmd(cmnd) >> > { >> > int err ; >> > err = SendCmndToRaidCore(cmnd) ; >> > return err; >> > } >> > >> > SentRspToInitator(cmnd, SGL *RspSGL) >> > { >> > int tmplen = 0, rsplen = 0 ; >> > /* Caluclate the SCSI Respone length */ >> > for(i = 0; i < num_sge; i++){ >> > tmplen += RspSGL->sge[i].length ; /* Itertate thr >> > all the SGE and add the lengths >> > >> > >> > rsplen = tmplen ; >> > >> > tio = cmnd->tio = alloc(rsplen) ; /* >> > Allocate the memory for response length */ >> > data = >> > page_address(tio->pvec[0]); >> /*This is the original code */ >> > >> > for(i = 0; i < num_sge; i++) >> > { /* >> > Copy the response into the tio buffer */ >> > memcpy(data, bus_to_virt(sgl->sge[i].address), >> > sgl->sge[i].length) ; >> > data += (sgl->sge[i].length-1) ; >> > } >> > >> > tio_set(tio, tmplen, 0) ; >> > >> > do_send_data_rsp(cmnd); >> > >> > return 0; >> > } >> > >> > >> > -JM >> > >> > >> > On Sun, Jun 29, 2008 at 3:48 AM, Arne Redlich <ag...@po...> >> > wrote: >> > Am Samstag, den 28.06.2008, 18:40 -0700 schrieb john M: >> > > >> > > Hi Team, >> > > >> > > I am trying to interface the IET iscsi target with our Raid >> > core. >> > > >> > > I hacked the disk_execute_cmnd to send the SCSI CDB's to >> > RaidCore >> > > insted of File-IO/Block-IO. When my RaidCore comes with the >> > > Data/Response for the particular SCSI command, i fill in >> > the >> > > Data/Response into the tio->pvec[idx] part of the struct >> > iscsi_cmnd >> > > and call the "do_send_data_rsp(cmnd)" function to send the >> > data back >> > > to Initiator. >> > > >> > > The Report LUNS command goes well, but the next command >> > INQUIRY >> > > Carshes at the following place as shown below. i wrote the >> > code >> > > similar to the existing interface. Looks like i need to >> > delete the >> > > "struct iscsi_cmnd" from the linked list. But the existing >> > code >> > > doesn't call list_del(cmnd->list) or >> > list_del_init(&cmnd->list); in >> > > the disk_execute_cmnd function. Can anyone point out where >> > am i going >> > > wrong? >> > >> > >> > You'll have to show us (your modifications to) the code. >> > >> > Cheers, >> > Arne >> > >> > >> -- >> Ming Zhang >> >> >> @#$%^ purging memory... (*!% >> http://blackmagic02881.wordpress.com/ >> http://www.linkedin.com/in/blackmagic02881 >> -------------------------------------------- >> >> > |