• Geert Uytterhoeven's avatar
    xsk: Fix umem fill/completion queue mmap on 32-bit · a5a16e43
    Geert Uytterhoeven authored
    With gcc-4.1.2 on 32-bit:
    
        net/xdp/xsk.c:663: warning: integer constant is too large for ‘long’ type
        net/xdp/xsk.c:665: warning: integer constant is too large for ‘long’ type
    
    Add the missing "ULL" suffixes to the large XDP_UMEM_PGOFF_*_RING values
    to fix this.
    
        net/xdp/xsk.c:663: warning: comparison is always false due to limited range of data type
        net/xdp/xsk.c:665: warning: comparison is always false due to limited range of data type
    
    "unsigned long" is 32-bit on 32-bit systems, hence the offset is
    truncated, and can never be equal to any of the XDP_UMEM_PGOFF_*_RING
    values.  Use loff_t (and the required cast) to fix this.
    
    Fixes: 423f3832 ("xsk: add umem fill queue support and mmap")
    Fixes: fe230832 ("xsk: add umem completion queue support and mmap")
    Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    Acked-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    a5a16e43
xsk.c 16 KB