[openib-general] Re: more CM byte ordering.

Libor Michalek libor at topspin.com
Thu Feb 3 10:47:30 PST 2005


On Thu, Feb 03, 2005 at 10:18:04AM -0800, Sean Hefty wrote:
> Libor Michalek wrote:
> >   I found a couple more spots in the active connect case of incorrect
> > byte ordering, this time around starting psn. Here is a tested patch.
> 
> Thanks for finding this.
> 
> > -	cm_req_set_starting_psn(req_msg, cpu_to_be32(param->starting_psn));
> > +	cm_req_set_starting_psn(req_msg, param->starting_psn);
> 
> This fix implies that the user is giving the CM the starting PSN in 
> network-byte order, which probably isn't the case.  Looking at where 
> the PSN values are set, I think it's swapped in 3 places.  (For 
> example, I don't think it's being swapped on the receiving end of the 
> REQ, which is why this patch works.)

  The only reason I assumed that the user was providing the value in
network byte order, is that the Service ID is expected in network byte
order, as well as the staring PSN in ib_send_cm_rep is expected in
network byte order as well.

  I agree the host byte order makes sense, since the event data is
provided to the user in host byte order. Looks like there are three
fields for which the change would have to be made:

  struct ib_cm_req_param {
        u64                     service_id;
        u32                     starting_psn;
  }
  struct ib_cm_rep_param {
        u32             starting_psn;
  }

Plus the fields in the SIDR params...

-Libor



More information about the general mailing list