netdev
[Top] [All Lists]

Re: 3c59x.c modified for time measurement / code included

To: Donald Becker <becker@xxxxxxxxx>
Subject: Re: 3c59x.c modified for time measurement / code included
From: Guilhem Tardy <guilhem_tardy@xxxxxxxxx>
Date: Wed, 19 Sep 2001 20:20:40 -0700 (PDT)
Cc: netdev@xxxxxxxxxxx, andrewm@xxxxxxxxxx, greearb@xxxxxxxxxxxxxxx
In-reply-to: <Pine.LNX.4.10.10109192149290.1209-100000@vaio.greennet>
Sender: owner-netdev@xxxxxxxxxxx
> If you are accessing a 32 bit number, you should use a "naturally
> aligned" address.  In your previous example you were using
> (int *)(base + 21)
> If "base" is aligned, base+21 will be misaligned for all but byte accesses.

Then I should be fine, as my original code read:
*(((unsigned int *) (skb->data+20)) + 1)

I was under the assumption that int was 16 bits on x86, but Rene corrected me
("int = 32Bit @ linux"). I will test the code modified with u16 first thing in
the morning tomorrow. In all cases, the "+1" above refers to a pointer of
unsigned int, then alignment should be OK, right?

Thanks for the input. I hope not to bother anyone with that after tomorrow. :)
As a last resort, I will add some heuristic to find the port number in the
packet and start from there.

Guilhem.


__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

<Prev in Thread] Current Thread [Next in Thread>