Skip to content
  • Björn Töpel's avatar
    xsk: simplify AF_XDP socket teardown · e2ce3674
    Björn Töpel authored
    
    
    Prior this commit, when the struct socket object was being released,
    the UMEM did not have its reference count decreased. Instead, this was
    done in the struct sock sk_destruct function.
    
    There is no reason to keep the UMEM reference around when the socket
    is being orphaned, so in this patch the xdp_put_mem is called in the
    xsk_release function. This results in that the xsk_destruct function
    can be removed!
    
    Note that, it still holds that a struct xsk_sock reference might still
    linger in the XSKMAP after the UMEM is released, e.g. if a user does
    not clear the XSKMAP prior to closing the process. This sock will be
    in a "released" zombie like state, until the XSKMAP is removed.
    
    Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    e2ce3674