aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/multicast.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-01-24 12:21:37 +0100
committerSimon Wunderlich <sw@simonwunderlich.de>2018-02-27 13:02:54 +0100
commita163dc22d515d17844435c8217ff66193d35b3fa (patch)
tree84ef38063e928d7f32e0ef110272bbc3c36b9d5a /net/batman-adv/multicast.c
parentbatman-adv: Avoid relation operator comparison with bool (diff)
downloadlinux-dev-a163dc22d515d17844435c8217ff66193d35b3fa.tar.xz
linux-dev-a163dc22d515d17844435c8217ff66193d35b3fa.zip
batman-adv: always assume 2-byte packet alignment
NIC drivers generally try to ensure that the "network header" is aligned to a 4-byte boundary. This is not always possible: When Ethernet frames are encapsulated in other packets with 4-byte aligned headers, the inner Ethernet header will have 4-byte alignment, and in consequence, the inner network header is aligned to 2, but not to 4 bytes. Most parts of batman-adv only care about 2-byte alignment; in particular, no unaligned accesses occur in performance-critical paths that handle actual payload data. This is not true for OGM handling: the seqno and crc fields are accessed as 32-bit values. To avoid these unaligned accesses, this patch reduces the expected packet alignment to 2 bytes for all of batadv's packet types. As no unaligned accesses existed on the performance-critical paths anyways, this chance does have any (positive or negative) effect on performance, but it still makes sense to avoid these accesses to prevent log noise when examining other unaligned accesses in the kernel while batman-adv is active. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/multicast.c')
0 files changed, 0 insertions, 0 deletions