• Simon Wunderlich's avatar
    Staging: batman-adv: receive packets directly using skbs · e7017195
    Simon Wunderlich authored
    This patch removes the (ugly and racy) packet receiving thread and the
    kernel socket usage. Instead, packets are received directly by registering
    the ethernet type and handling skbs instead of self-allocated buffers.
    
    Some consequences and comments:
    
     * we don't copy the payload data when forwarding/sending/receiving data
       anymore. This should boost performance.
     * packets from/to different interfaces can be (theoretically) processed
       simultaneously. Only the big originator hash lock might be in the way.
     * no more polling or sleeping/wakeup/scheduling issues when receiving
       packets
     * this might introduce new race conditions.
     * aggregation and vis code still use packet buffers and are not (yet)
       converted.
     * all spinlocks were converted to irqsave/restore versions to solve
       some lifelock issues when preempted. This might be overkill, some
       of these locks might be reverted later.
     * skb copies are only done if neccesary to avoid overhead
    
    performance differences:
    
     * we made some "benchmarks" with intel laptops.
     * bandwidth on Gigabit Ethernet increased from ~500 MBit/s to ~920 MBit/s
     * ping latency decresed from ~2ms to ~0.2 ms
    
    I did some tests on my 9 node qemu environment and could confirm that
    usual sending/receiving, forwarding, vis, batctl ping etc works.
    Signed-off-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
    Acked-by: default avatarSven Eckelmann <sven.eckelmann@gmx.de>
    Acked-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
    Acked-by: default avatarLinus Lüssing <linus.luessing@web.de>
    Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    e7017195
soft-interface.h 1.32 KB