• willy tarreau's avatar
    net: mvneta: convert to build_skb() · 8ec2cd48
    willy tarreau authored
    Make use of build_skb() to allocate frags on the RX path. When frag size
    is lower than a page size, we can use netdev_alloc_frag(), and we fall back
    to kmalloc() for larger sizes. The frag size is stored into the mvneta_port
    struct. The alloc/free functions check the frag size to decide what alloc/
    free method to use. MTU changes are safe because the MTU change function
    stops the device and clears the queues before applying the change.
    
    With this patch, I observed a reproducible 2% performance improvement on
    HTTP-based benchmarks, and 5% on small packet RX rate.
    
    Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
    Tested-by: default avatarArnaud Ebalard <arno@natisbad.org>
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8ec2cd48
mvneta.c 78.5 KB