From: Daniel Borkmann Subject: Re: [PATCH bpf-next] xsk: simplify AF_XDP socket teardown Date: Wed, 19 Dec 2018 22:04:58 +0100 Message-ID: <40412731-cb3f-65e4-178d-8cb0dbf335d8@iogearbox.net> References: <20181219120931.30720-1-bjorn.topel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , magnus.karlsson@intel.com, magnus.karlsson@gmail.com To: bjorn.topel@gmail.com, ast@kernel.org, netdev@vger.kernel.org Return-path: Received: from www62.your-server.de ([213.133.104.62]:39990 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbeLSVFB (ORCPT ); Wed, 19 Dec 2018 16:05:01 -0500 In-Reply-To: <20181219120931.30720-1-bjorn.topel@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/19/2018 01:09 PM, bjorn.topel@gmail.com wrote: > From: Björn Töpel > > 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: Björn Töpel Applied, thanks!