From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [PATCH v6 01/12] bpf: add XDP prog type for early driver filter Date: Mon, 11 Jul 2016 14:58:45 +0200 Message-ID: <20160711145845.215e2c23@redhat.com> References: <1467944124-14891-1-git-send-email-bblanco@plumgrid.com> <1467944124-14891-2-git-send-email-bblanco@plumgrid.com> <20160709101403.1ed7d021@redhat.com> <20160710153731.62d6773d@redhat.com> <20160710170922.GC6657@gmail.com> <578371CE.6090305@iogearbox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Tom Herbert , Brenden Blanco , "David S. Miller" , Linux Kernel Network Developers , Martin KaFai Lau , Ari Saha , Alexei Starovoitov , Or Gerlitz , john fastabend , Hannes Frederic Sowa , Thomas Graf , brouer@redhat.com To: Daniel Borkmann Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42467 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbcGKM6x (ORCPT ); Mon, 11 Jul 2016 08:58:53 -0400 In-Reply-To: <578371CE.6090305@iogearbox.net> Sender: netdev-owner@vger.kernel.org List-ID: Trying to sum up the main points of the discussion. Two main issues: 1) Allowing to load an XDP/eBPF program what use return codes not compatible with the drivers. 2) Default dropping at this level make is hard to debug / no-metrics. To solve issue #1, I proposed defining a fallback semantics. I guess, people didn't like that semantics. The only other solution I see, is to NOT-allow programs to be loaded if they want to use return-codes/features not supported by the driver, e.g reject XDP programs. Given we cannot automatic deduct used return codes (if prog is table driven) then we need some kind of versioning or feature codes. Could this be modeled after NIC "features"? I guess this could also help HW offload engines, if eBPF programs register/annotate their needed capabilities upfront? For issue #2 (default drop): If the solution for issue #1 is to only loaded compatible programs, then I agree that unknown return code should default to drop. For debug-ability, it should be easy to extend the call bpf_warn_invalid_xdp_action() to log more information for debugging purposes. Which for performance/DoS reasons should be off by default. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat Author of http://www.iptv-analyzer.org LinkedIn: http://www.linkedin.com/in/brouer