• Xuan Zhuo's avatar
    virtio_net: get build_skb() buf by data ptr · 8fb7da9e
    Xuan Zhuo authored
    In the case of merge, the page passed into page_to_skb() may be a head
    page, not the page where the current data is located. So when trying to
    get the buf where the data is located, we should get buf based on
    headroom instead of offset.
    
    This patch solves this problem. But if you don't use this patch, the
    original code can also run, because if the page is not the page of the
    current data, the calculated tailroom will be less than 0, and will not
    enter the logic of build_skb() . The significance of this patch is to
    modify this logical problem, allowing more situations to use
    build_skb().
    Signed-off-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8fb7da9e
virtio_net.c 86.9 KB