Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>,
	David.Laight@ACULAB.COM, amwang@redhat.com,
	netdev@vger.kernel.org
Subject: Re: [Patch net-next v3] net: clean up skb headers code
Date: Fri, 31 May 2013 09:18:41 +0900	[thread overview]
Message-ID: <20130531001841.GB26684@verge.net.au> (raw)
In-Reply-To: <1369947918.2414.28.camel@bwh-desktop.uk.level5networks.com>

On Thu, May 30, 2013 at 10:05:18PM +0100, Ben Hutchings wrote:
> On Thu, 2013-05-30 at 13:16 -0700, David Miller wrote:
> > From: "David Laight" <David.Laight@ACULAB.COM>
> > Date: Thu, 30 May 2013 12:18:13 +0100
> > 
> > >> commit 1a37e412a0225fcba5587 (net: Use 16bits for *_headers
> > >> fields of struct skbuff) converts skb->*_header to u16,
> > >> some #if NET_SKBUFF_DATA_USES_OFFSET are now useless,
> > >> and to be safe, we could just use "X = ~(typeof(X))0;"
> > >> as suggested by David and Ben.
> > > 
> > > IIRC ~(unsigned short)0 is the same as ~0 and will be -1.
> > > define an actual constant with value 0xffff
> > 
> > The problem with doing that is that if this type is changed again,
> > we'lll go through this same circus changing the constant everywhere
> > and missing some cases.
> > 
> > I absolutely want to see a version of this fix that makes sure that if
> > the type changes, either the constantly automatically change (that's
> > the "typeof(X)" approach) or the build breaks spectacularly until the
> > value is fixed up.
> 
> Let's just give the 'invalid' value a name and define it right next to
> those fields.  It might be worth reintroducing sk_buff_data_t too, since
> there was at least one place which wanted to save and restore offsets in
> local variables.

sk_buff_data_t was not removed, its just used for less fields.

  reply	other threads:[~2013-05-31  0:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  2:06 [Patch net-next v3] net: clean up skb headers code Cong Wang
2013-05-30 11:18 ` David Laight
2013-05-30 20:16   ` David Miller
2013-05-30 21:05     ` Ben Hutchings
2013-05-31  0:18       ` Simon Horman [this message]
2013-05-31  0:25 ` Simon Horman

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=20130531001841.GB26684@verge.net.au \
    --to=horms@verge.net.au \
    --cc=David.Laight@ACULAB.COM \
    --cc=amwang@redhat.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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