Re: Endianess in cxgb4

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

 



On Wed, Oct 25, 2017 at 09:48:08AM -0500, Steve Wise wrote:
> > On Tue, Oct 24, 2017 at 01:45:52PM -0500, Steve Wise wrote:
> > > >
> > > > Hi Steve,
> > > >
> > > > I reviewed my reports from various static checkers and saw strange code
> > > > in build_tpte_memreg() function that in drivers/infiniband/hw/cxgb4/qp.c.
> > > >
> > > > That function has following code:
> > > >  614         fr->r2 = cpu_to_be32(0);
> > > >  615         fr->stag = cpu_to_be32(mhp->ibmr.rkey);
> > > >
> > > > The r2, stag and rkey are u32, why do you need cpu_to_be32() conversion?
> > > >
> > >
> > > Hey Leon,
> > >
> > > The r2 and stag fields in struct fw_ri_fr_nsmr_tpte_wr should be __be32.
> >
> > it is not how it is declared in drivers/infiniband/hw/cxgb4/t4fw_ri_api.h
> >
> > 672 struct fw_ri_fr_nsmr_tpte_wr {
> > 673         __u8    opcode;
> > 674         __u8   flags;
> > 675         __u16  wrid;
> > 676         __u8   r1[3];
> > 677         __u8   len16;
> > 678         __u32  r2;
> > 679         __u32  stag;
> > 680         struct fw_ri_tpte tpte;
> > 681         __u64  pbl[2];
> > 682 };
> >
> > Thanks
> >
>
> I'm not communicating effectively.  Sorry.
>
> This is a bug in t4fw_ri_api.h.  You need create a patch to change
> fw_ri_fr_nsmr_tpte_wr to make the stag and r2 fields to be __be32.

Thanks, I'll send a fix.

>
> Steve.
>
>
>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux