Re: Endianness problem with u32 classifier hash masks

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Radu Rendec <radu.rendec@...>
Cc: <hadi@...>, <netdev@...>
Date: Monday, November 5, 2007 - 5:06 pm

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



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.



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).



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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Endianness problem with u32 classifier hash masks, Radu Rendec, (Thu Nov 1, 1:55 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Fri Nov 2, 1:31 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Sat Nov 3, 7:39 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Sat Nov 3, 7:58 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Sat Nov 3, 8:30 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Sat Nov 3, 9:17 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 5:12 am)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 10:35 am)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 9:52 am)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 5:06 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 8:02 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Tue Nov 6, 10:25 am)
Re: Endianness problem with u32 classifier hash masks, David Miller, (Wed Nov 7, 5:22 am)
Re: Endianness problem with u32 classifier hash masks, Radu Rendec, (Wed Nov 7, 10:35 am)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Wed Nov 7, 8:56 am)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Tue Nov 6, 4:28 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 8:12 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 5:28 pm)
Re: Endianness problem with u32 classifier hash masks, Jarek Poplawski, (Mon Nov 5, 10:49 am)
Re: Endianness problem with u32 classifier hash masks, Radu Rendec, (Mon Nov 5, 12:12 pm)