netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: Radu Rendec <radu.rendec@ines.ro>, netdev@vger.kernel.org
Subject: Re: Endianness problem with u32 classifier hash masks
Date: Fri, 02 Nov 2007 19:23:50 -0400	[thread overview]
Message-ID: <1194045830.4438.21.camel@localhost> (raw)
In-Reply-To: <472B5EF1.4020206@o2.pl>


On Fri, 2007-02-11 at 18:31 +0100, Jarek Poplawski wrote:
> Radu Rendec wrote:
> 
> > Hi,
> > 
> > While trying to implement u32 hashes in my shaping machine I ran into a
> > possible bug in the u32 hash/bucket computing algorithm
> > (net/sched/cls_u32.c).
> > 
> > The problem occurs only with hash masks that extend over the octet
> > boundary, on little endian machines (where htonl() actually does
> > something).
> > 
> > I'm not 100% sure this is a problem with u32 itself, but at least I'm
> > sure u32 with the same configuration would behave differently on little
> > endian and big endian machines. Detailed description of the problem and
> > proposed patch follow.
> 
> 
> I think you are right about this different behavior, so it looks like a bug.
> And since little endian way is uncontrollable in such a case, your proposal
> should be right.
> 
> But, since there is a maintainer for this, let's check what is he not payed
> for?! (Cc: Jamal Hadi Salim)
> 

Thanks for the CC Jarek - and i promise to share the loot with you when
i lay my hands on it;->

I see that given the mask described (the 0 bits bounding the two
nibbles), the same packet in that network will hit two different buckets
depending on endianness. In other words there is lack of consistency. So
good catch.
The patch would certainly resolve it.
The only thing that bothers me with the patch approach is the extra
conversion in the fast path. Radu, since this is not a show stopper -
can you give me a short time to sip on it? I am thinking it is probably
resolvable by using the right tuning at config time - one knob that
looks usable is fshift and that all this can be done at config time; but
i may need more than one coffee to get it right, but if you see it just
send a patch. I will try to use the data you used to see if i am making
any sense.

cheers,
jamal


  reply	other threads:[~2007-11-03  0:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 17:55 Endianness problem with u32 classifier hash masks Radu Rendec
2007-11-02 17:31 ` Jarek Poplawski
2007-11-02 23:23   ` jamal [this message]
2007-11-03 23:39     ` Jarek Poplawski
2007-11-03 23:58       ` Jarek Poplawski
2007-11-04  0:30         ` Jarek Poplawski
2007-11-04  1:17           ` Jarek Poplawski
2007-11-04 23:58             ` jamal
2007-11-05  9:12               ` Jarek Poplawski
2007-11-05 12:59                 ` Radu Rendec
2007-11-05 13:43                   ` jamal
2007-11-05 14:49                     ` Jarek Poplawski
2007-11-05 16:12                       ` Radu Rendec
2007-11-05 13:52                   ` Jarek Poplawski
2007-11-05 14:06                     ` jamal
2007-11-05 17:31                       ` Radu Rendec
2007-11-05 21:06                         ` Jarek Poplawski
2007-11-05 21:28                           ` Jarek Poplawski
2007-11-05 22:27                           ` jamal
2007-11-06  0:02                             ` Jarek Poplawski
2007-11-06  0:12                               ` Jarek Poplawski
2007-11-06  8:09                               ` Radu Rendec
2007-11-06 13:34                                 ` jamal
2007-11-06 14:25                                   ` Jarek Poplawski
2007-11-06 14:43                                     ` jamal
2007-11-06 17:00                                       ` Radu Rendec
2007-11-06 20:28                                         ` Jarek Poplawski
2007-11-07  9:22                                         ` David Miller
2007-11-07 12:56                                           ` Jarek Poplawski
2007-11-07 13:42                                           ` jamal
2007-11-07 13:55                                             ` Radu Rendec
2007-11-07 14:35                                           ` Radu Rendec
2007-11-08 11:07                                           ` [PATCH] [PKT_SCHED] CLS_U32: Use ffs() instead of C code on hash mask to get first set bit Radu Rendec
2007-11-08 11:37                                             ` Jarek Poplawski
2007-11-08 13:45                                             ` jamal
2007-11-11  5:55                                               ` David Miller
2007-11-05 13:47                 ` Endianness problem with u32 classifier hash masks jamal
2007-11-05 14:35                   ` Jarek Poplawski

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=1194045830.4438.21.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=jarkao2@o2.pl \
    --cc=netdev@vger.kernel.org \
    --cc=radu.rendec@ines.ro \
    /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;
as well as URLs for NNTP newsgroup(s).