From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [net PATCH 0/3] Fix two teardown bugs for BPF maps cpumap and devmap Date: Thu, 9 Aug 2018 21:54:01 +0200 Message-ID: <3d250a8a-a707-9dc3-a224-14a285646427@iogearbox.net> References: <153376197849.14272.8201612461878004477.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Daniel Borkmann , Alexei Starovoitov , jhsiao@redhat.com To: Jesper Dangaard Brouer , netdev@vger.kernel.org Return-path: Received: from www62.your-server.de ([213.133.104.62]:39195 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeHIWUZ (ORCPT ); Thu, 9 Aug 2018 18:20:25 -0400 In-Reply-To: <153376197849.14272.8201612461878004477.stgit@firesoul> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 08/08/2018 11:00 PM, Jesper Dangaard Brouer wrote: > Removing entries from cpumap and devmap, goes through a number of > syncronization steps to make sure no new xdp_frames can be enqueued. > But there is a small chance, that xdp_frames remains which have not > been flushed/processed yet. Flushing these during teardown, happens > from RCU context and not as usual under RX NAPI context. > > The optimization introduced in commt 389ab7f01af9 ("xdp: introduce > xdp_return_frame_rx_napi"), missed that the flush operation can also > be called from RCU context. Thus, we cannot always use the > xdp_return_frame_rx_napi call, which take advantage of the protection > provided by XDP RX running under NAPI protection. > > The samples/bpf xdp_redirect_cpu have a --stress-mode, that is > adjusted to easier reproduce (verified by Red Hat QA). Applied to bpf, thanks Jesper!