On Wed, May 04, 2011 at 03:52:23PM +0200, Andrew Lunn wrote:
On Wed, May 04, 2011 at 03:36:37PM +0200, Antonio
On Wed, May 04, 2011 at 01:22:34PM +0200, Andrew
+ uint8_t packet_type;
+ uint8_t version;
+ uint8_t dst;
+ uint8_t ttl;
+ uint8_t src;
+ uint8_t client;
Maybe put ttl at the end, to help with alignment?
As I did for the tt_query packet, the initial four fields are the same as the
unicast_packet so that I can exploit route_unicast_packet() instead of writing
Is that a major issue?
No. It just that gcc might optimize accesses to src and client as a
word read + 1/2 word read, if they where 1/2 word aligned. With ttl
where it is, src and client are in strange alignments, so gcc will
have to do byte access.
Understood. Thanks for the explanation.
But this is not the fast path, so it does not
Exactly..So I think we can leave as it is in this case
+ tt_global_add(bat_priv, orig_node, roam_adv_packet->client,
+ atomic_read(&orig_node->last_ttvn) + 1, true);
+ /* Roaming phase starts: I have a new information but the ttvn has been
+ * incremented yet. This flag will make me check all the incoming
+ * packets for the correct destination. */
The grammar in that comment could be better:
/* Roaming phase starts: I have new information but the ttvn has not
* been incremented yet. This flag will make me check all the incoming
* packets for the correct destination. */
Thanks and sorry for my poor grammar :)
Actually, it is mostly very good....
Ok..I got the point. Maybe I will not be so
drastic but I will follow
Lots of small functions is my style. However, the Linux coding style
documentation says something similar:
Chapter 6: Functions
Functions should be short and sweet, and do just one thing. They should
fit on one or two screenfuls of text (the ISO/ANSI screen size is 80x24,
as we all know), and do one thing and do that well.
It is well worth reading Documentation/CodingStyle
Mh, thank you for showing me this document. I'll deeply read it as soon as
..each of us alone is worth nothing..
Ernesto "Che" Guevara