From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12D32C2D0A8 for ; Wed, 30 Sep 2020 07:58:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCDA820789 for ; Wed, 30 Sep 2020 07:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbgI3H6T (ORCPT ); Wed, 30 Sep 2020 03:58:19 -0400 Received: from www62.your-server.de ([213.133.104.62]:36092 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgI3H6T (ORCPT ); Wed, 30 Sep 2020 03:58:19 -0400 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1kNX07-0000dO-5S; Wed, 30 Sep 2020 09:58:11 +0200 Received: from [178.196.57.75] (helo=pc-9.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNX06-000J9Y-SH; Wed, 30 Sep 2020 09:58:10 +0200 Subject: Re: [PATCH bpf-next v3 3/6] bpf: add redirect_neigh helper as redirect drop-in To: Martin KaFai Lau Cc: ast@kernel.org, john.fastabend@gmail.com, netdev@vger.kernel.org, bpf@vger.kernel.org, David Ahern References: <20200930064811.mroafbnrrnb77qki@kafai-mbp.dhcp.thefacebook.com> From: Daniel Borkmann Message-ID: <750269bb-0b72-9fd9-bfeb-768213c8618a@iogearbox.net> Date: Wed, 30 Sep 2020 09:58:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200930064811.mroafbnrrnb77qki@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.4/25942/Tue Sep 29 15:56:33 2020) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 9/30/20 8:48 AM, Martin KaFai Lau wrote: > On Tue, Sep 29, 2020 at 11:23:03PM +0200, Daniel Borkmann wrote: [...] > >> +/* Internal, non-exposed redirect flags. */ >> +enum { >> + BPF_F_NEIGH = (1ULL << 1), >> +}; > It will be useful to ensure the future "flags" of BPF_FUNC_redirect > will not overlap with this. May be a BUILD_BUG_ON? I was thinking about this as well, but didn't go for it since typically this would mean that we need to add a mask of all flags for redirect helper in uapi right next to where we define BPF_F_INGRESS such that people don't forget to update the mask whenever they extend the flags there in order for the BUILD_BUG_ON() assertion to be actually effective (see also RTAX_FEATURE_MASK vs DST_FEATURE_MASK). If the mask sits in a different location, then developers might forget to update, it might slip through review (since not included in diff) and the build failure doesn't trigger. So far we have avoided to extend bpf uapi in such way. That was basically my rationale, another option could be to just add a comment in the enum right underneath BPF_F_INGRESS that the (1ULL << 1) bit is currently kernel-internal. > Others LGTM. > > Acked-by: Martin KaFai Lau Thanks!