netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: Radu Rendec <radu.rendec@ines.ro>
Cc: hadi@cyberus.ca, netdev@vger.kernel.org
Subject: Re: Endianness problem with u32 classifier hash masks
Date: Mon, 05 Nov 2007 22:06:56 +0100	[thread overview]
Message-ID: <472F85F0.8060205@o2.pl> (raw)
In-Reply-To: <1194283888.2987.186.camel@localhost.localdomain>

Radu Rendec wrote, On 11/05/2007 06:31 PM:

> On Mon, 2007-11-05 at 09:06 -0500, jamal wrote:
>> On Mon, 2007-05-11 at 14:52 +0100, Jarek Poplawski wrote:
>>
> ...
>>> If we manage to convince Jamal, IMHO a patch to something current like
>>> 2.6.24-rc1-git14 (or maybe -rc2 soon), should suffice (plus some
>>> options to diff to get function names etc. eg.: diff -Nurp). Try with
>>> Documentation/SubmittingPatches. Git isn't necessary at all. And don't
>>> forget about a changelog.
>> That code hasnt changed at all in a few years, so even against
>> 2.6.24-rc1 should be fine and can be applied cleanly to Daves net-2.6.
>> Radu, please refer to my earlier email on things to try.
> 
> Ok, silly procmail rules + threaded view = bad idea. I just didn't see
> your last messages earlier when I replied. Sorry!
> 
> But still, Jamal, I need more explanations on what you meant by "cutdown
> on the conversion in u32_change()". And, before proceeding, I'd like to
> see your reply to Jarek's last email (at 15:49 +0100) about not getting
> 0xff in the end.


Radu, as far as I know Jamal (from reading) he most probably is busy with
some conference! Since these patches aren't so big I think you could
try Jamal's at first, and if it doesn't work, and nothing new from Jamal
in the meantime, resend your version. Cutdown in u32_change() seems to
add more to the fastpath, but maybe Jamal thinks about something else.

> 
> Jarek, because I have to test anyway, I'll include ffs(mask) in my patch
> and have it tested too.


Thanks! But, I did it wrong: + 1 is unnecessary. And since, ffs() checks
for 0 anyway, this should be simpler:

- {
- 	u8 i = 0;
- 	u32 mask = s->hmask;
- 	if (mask) {
- 		while (!(mask & 1)) {
- 			i++;
- 			mask>>=1;
- 		}
- 	}
- 	n->fshift = i;
+ 	n->fshift = ffs(s->hmask);
- }

Plus maybe (u8) cast on warnings...

On the other hand, only now I see here is some hack (or bug) with this
u8, so ffs() would mean a change here. I definitely need to rethink this.
So, it's probably better to make and test this ffs() patch separately
(2 parts).

> 
> I already have a clone of Dave's net-2.6 tree, so it shouldn't be such a
> big effort to use git after all. I can also make the patch against
> 2.6.24-rc1, so please tell me which is more convinient for you.


Since, there is only this one file, with no changes, there will be no
difference, so it's up to your taste.

Cheers,

Jarek P.

  reply	other threads:[~2007-11-05 20:55 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
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 [this message]
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=472F85F0.8060205@o2.pl \
    --to=jarkao2@o2.pl \
    --cc=hadi@cyberus.ca \
    --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).