[openib-general] Re: Fwd: [Bug 91] sizeof(srp_indirect_buf) wrongon 64-bit platforms

Ishai Rabinovitz ishai at mellanox.co.il
Tue May 23 02:03:40 PDT 2006


On Tue, May 23, 2006 at 10:10:05AM +0300, Arne Redlich wrote:
> Roland Dreier <rdreier at cisco.com> writes:
> 
> >  > Roland, maybe this means we need scsi/srp.h in svn for now?
> >  > svn is supposed to work on 2.6.16 ...
> >
> > As far as I can tell the bug in the header has no effect on how the IB
> > SRP initiator works.
> 
> Roland,
> 
> I'm afraid it *does* have an effect, unfortunately. There's the following code in ib_srp.c::srp_map_data(), around the lines 540 - 550:
> 
>       struct srp_indirect_buf *buf = (void *) cmd->add_data;
> 
>       /* snip */
> 
>       buf->table_desc.va  = cpu_to_be64(req->cmd->dma +
>                                         sizeof *cmd +
>                                         sizeof *buf);
> 
> So if a target actually RDMA Reads the indirect descriptor table, it will use a wrong address.
> 

It looks to me that there is no effect after all.
This buf->table_desc.va should point to the desc_list array in the srp_indirect_buf.
When the code enters the values to this array (buf->desc_list[i]) it uses the 
address that is corresponding to sizeof *buf.

To sum it up, there will be a change in the address the target sees but the 
data will still be in the address the target sees.

> Arne
> -- 
> Arne Redlich
> Xiranet Communications GmbH
> _______________________________________________
> openib-general mailing list
> openib-general at openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

-- 
Ishai Rabinovitz



More information about the general mailing list