All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: netdev@vger.kernel.org
Subject: Re: Some NIPQUAD_FMT -> %pI4 conversions are broken
Date: Fri, 09 Jan 2009 22:07:25 -0800	[thread overview]
Message-ID: <1231567645.5714.19.camel@brick> (raw)
In-Reply-To: <adaprivom8o.fsf@cisco.com>

On Fri, 2009-01-09 at 19:47 -0800, Roland Dreier wrote:
> I just noticed (by getting a messed up print in my kernel log) that most
> of the changes to drivers/infiniband/hw/nes in commit 63779436
> ("drivers: replace NIPQUAD()") were wrong: the idea was to change printk
> statements like
> 
> 	printk("..." NIPQUAD_FMT "...", NIPQUAD(foo));
> 
> but most of the changes in nes were to code like
> 
> 	printk("..." NIPQUAD_FMT "...", HIPQUAD(foo));
> 
> ie *H* IPQUAD not *N* IPQUAD, indicating the foo is in host endian
> order, and hence the new code
> 
> 	printk("...%pI4...", &foo);
> 
> prints the IP in reverse order now.
> 
> I don't see a good way to fix this without introducing a temporary
> variable to hold a swapped IP address... but is there a better way?
> 

My apologies indeed, the best choice I think is to add a temp var for
now and I'll work with you to eliminate the byteswapping further up the
callchain so a be32 gets passed down, but that might be too involved for 2.6.29.

Sound OK?

Harvey


  reply	other threads:[~2009-01-10  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-10  3:47 Some NIPQUAD_FMT -> %pI4 conversions are broken Roland Dreier
2009-01-10  6:07 ` Harvey Harrison [this message]
2009-01-10  6:15   ` David Miller
2009-01-10  6:24     ` Harvey Harrison
2009-01-10  6:24 ` [PATCH] nes: fix reversed IP address Harvey Harrison
2009-01-10  6:49   ` Harvey Harrison

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=1231567645.5714.19.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.