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 15:53:46 +0200 Message-ID: <20160711155346.18839919@redhat.com> References: <1467944124-14891-1-git-send-email-bblanco@plumgrid.com> <1467944124-14891-2-git-send-email-bblanco@plumgrid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: 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 , Daniel Borkmann , brouer@redhat.com To: Tom Herbert Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751917AbcGKNxx (ORCPT ); Mon, 11 Jul 2016 09:53:53 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Sun, 10 Jul 2016 16:04:16 -0500 Tom Herbert wrote: > > +/* User return codes for XDP prog type. > > + * A valid XDP program must return one of these defined values. All other > > + * return codes are reserved for future use. Unknown return codes will result > > + * in driver-dependent behavior. > > + */ > > +enum xdp_action { > > + XDP_DROP, > > + XDP_PASS, > > I think that we should be able to distinguish an abort in BPF program > from a normal programmatic drop. e.g.: > > enum xdp_action { > XDP_ABORTED = 0, > XDP_DROP, > XDP_PASS, > }; I agree. And maybe we can re-use the bpf_warn_invalid_xdp_action() call to keep the branch/jump-table as simple as possible, handling the distinguishing on the slow path. -- 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