public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Rolf Manderscheid
	<rvm-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ibsim: fix size of slid/dlid fields in sim_request structure
Date: Wed, 10 Aug 2011 13:37:52 -0600	[thread overview]
Message-ID: <20110810193752.GB12482@obsidianresearch.com> (raw)
In-Reply-To: <4E42BD69.6070608-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

On Wed, Aug 10, 2011 at 11:18:33AM -0600, Rolf Manderscheid wrote:
> Hi Alex,
> >There are more places where lids defined as integer. Why did you choose to
> >change only these two?
> 
> This structure defines what request packets look like on the wire to
> the simulator.  The motivation for the change is a simulator client
> for python-rdma, and this issue shows up when creating the structure
> format strings for the request packets.

Also that

uint32_t x = htons(y)

Simply doesn't work when you mix big and little endian. So, the
choices are: switch the type to uint16, or switch to htonl. This is the
reason only this struct was changed - because it is the only place
where htons is being applied incorrectly, while finding all the wrong
htons is a bit harder.

python cares because it cannot easily construct something so malformed :)

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2011-08-10 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 23:29 [PATCH] ibsim: fix size of slid/dlid fields in sim_request structure Rolf Manderscheid
     [not found] ` <E1QpTpl-00026F-D6-nLM+XIojDeH72zTlGHhC+rDks+cytr/Z@public.gmane.org>
2011-08-09 15:07   ` Alex Netes
     [not found]     ` <20110809150723.GC2056-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
2011-08-10 17:18       ` Rolf Manderscheid
     [not found]         ` <4E42BD69.6070608-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-08-10 19:37           ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110810193752.GB12482@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rvm-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox