From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH bpf] Revert "xdp: add NULL pointer check in __xdp_return()" Date: Fri, 10 Aug 2018 09:26:25 -0700 Message-ID: <20180810092625.1ad1cce4@cakuba.netronome.com> References: <20180810092802.5948-1-bjorn.topel@gmail.com> <5d07c5ce-2dea-7ab2-f5cf-7ed22d5da783@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Daniel Borkmann , Alexei Starovoitov , Netdev , Taehee Yoo , Jesper Dangaard Brouer , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , "Karlsson, Magnus" , Magnus Karlsson , kafai@fb.com To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Return-path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:45494 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbeHJS5D (ORCPT ); Fri, 10 Aug 2018 14:57:03 -0400 Received: by mail-pg1-f193.google.com with SMTP id f1-v6so4619071pgq.12 for ; Fri, 10 Aug 2018 09:26:30 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 10 Aug 2018 17:16:45 +0200, Bj=C3=B6rn T=C3=B6pel wrote: > Den fre 10 aug. 2018 kl 16:10 skrev Daniel Borkmann : > > > > On 08/10/2018 11:28 AM, Bj=C3=B6rn T=C3=B6pel wrote: =20 > > > From: Bj=C3=B6rn T=C3=B6pel > > > > > > This reverts commit 36e0f12bbfd3016f495904b35e41c5711707509f. > > > > > > The reverted commit adds a WARN to check against NULL entries in the > > > mem_id_ht rhashtable. Any kernel path implementing the XDP (generic or > > > driver) fast path is required to make a paired > > > xdp_rxq_info_reg/xdp_rxq_info_unreg call for proper function. In > > > addition, a driver using a different allocation scheme than the > > > default MEM_TYPE_PAGE_SHARED is required to additionally call > > > xdp_rxq_info_reg_mem_model. > > > > > > For MEM_TYPE_ZERO_COPY, an xdp_rxq_info_reg_mem_model call ensures > > > that the mem_id_ht rhashtable has a properly inserted allocator id. If > > > not, this would be a driver bug. A NULL pointer kernel OOPS is > > > preferred to the WARN. > > > > > > Suggested-by: Jesper Dangaard Brouer > > > Signed-off-by: Bj=C3=B6rn T=C3=B6pel =20 > > > > Given the last bpf pr went out yesterday night, I've applied this to > > bpf-next (worst case we can just route it via stable), thanks! =20 >=20 > Ah, right! Thanks! >=20 > bpf-next is OK. (Since this path is currently not used yet by any driver.= .. :-() Wasn't this dead code, anyway? The frame return path is for redirects, and one can't convert_to_xdp_frame presently?