• Xuan Zhuo's avatar
    xsk: support use vaddr as ring · 9f78bf33
    Xuan Zhuo authored
    When we try to start AF_XDP on some machines with long running time, due
    to the machine's memory fragmentation problem, there is no sufficient
    contiguous physical memory that will cause the start failure.
    
    If the size of the queue is 8 * 1024, then the size of the desc[] is
    8 * 1024 * 8 = 16 * PAGE, but we also add struct xdp_ring size, so it is
    16page+. This is necessary to apply for a 4-order memory. If there are a
    lot of queues, it is difficult to these machine with long running time.
    
    Here, that we actually waste 15 pages. 4-Order memory is 32 pages, but
    we only use 17 pages.
    
    This patch replaces __get_free_pages() by vmalloc() to allocate memory
    to solve these problems.
    Signed-off-by: default avatarXuan Zhuo <xuanzhuo@linux.alibaba.com>
    Acked-by: default avatarMagnus Karlsson <magnus.karlsson@intel.com>
    Reviewed-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9f78bf33
xsk_queue.h 11.6 KB