Staging: batman-adv: register the batman-adv packet type per interface
authorMarek Lindner <lindner_marek@yahoo.de>
Sat, 4 Sep 2010 23:58:27 +0000 (01:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 5 Sep 2010 07:29:45 +0000 (00:29 -0700)
commit15cf5523d2e42f755b3b1d8ea0fa601ffcf8b9e7
tree7ec59e81276bc8399e221186f7484da9ea26c932
parentd52e90aeaf93d62cc1a7f9a8a9f3a6f68c475cf5
Staging: batman-adv: register the batman-adv packet type per interface

Batman-adv globally registered the batman-adv packet type and installed
a hook to batman_skb_recv(). Each interface receiving a packet with that
type would end up in this function which then had to loop through all
batman-adv internal interface structures to find the its meta data. The
more interfaces a system had the longer the loops might take. Each and
every packet goes through this function making it a performance critical
loop.

This patch installs the hook for each activated interface. The called
batman_skb_recv() can distinguish these calls, therefore avoiding the
loop through the interface structures.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[sven.eckelmann@gmx.de: Rework on top of current version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/hard-interface.c
drivers/staging/batman-adv/main.c
drivers/staging/batman-adv/types.h