• Yunsheng Lin's avatar
    net: hns3: support dma_map_sg() for multi frags skb · 7459775e
    Yunsheng Lin authored
    Using the queue based tx buffer, it is also possible to allocate a
    sgl buffer, and use skb_to_sgvec() to convert the skb to the sgvec
    in order to support the dma_map_sg() to decreases the overhead of
    IOMMU mapping and unmapping.
    
    Firstly, it reduces the number of buffers. For example, a tcp skb
    may have a 66-byte header and 3 fragments of 4328, 32768, and 28064
    bytes. With this patch, dma_map_sg() will combine them into two
    buffers, 66-bytes header and one 65160-bytes fragment by using IOMMU.
    
    Secondly, it reduces the number of dma mapping and unmapping. All the
    original 4 buffers are mapped only once rather than 4 times.
    
    The throughput improves above 10% when running single thread of iperf
    using TCP when IOMMU is in strict mode.
    Suggested-by: default avatarBarry Song <song.bao.hua@hisilicon.com>
    Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
    Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7459775e
hns3_enet.h 16.9 KB