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=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 897D6C31E48 for ; Wed, 12 Jun 2019 16:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FF6521019 for ; Wed, 12 Jun 2019 16:03:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VocxbXoL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730135AbfFLQDv (ORCPT ); Wed, 12 Jun 2019 12:03:51 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:34167 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbfFLQDu (ORCPT ); Wed, 12 Jun 2019 12:03:50 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 18A3421FF3; Wed, 12 Jun 2019 12:03:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 12 Jun 2019 12:03:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=GDV9hhZ5GxuMS6XRy 5N2kICLAkIhzOp0RyrylQkM568=; b=VocxbXoLTtARYZ0ifA2gvbkXk83QqEVoN wuQ0sdFBYGBKkdLU/wyRh7YiSwRu39dcYjzsrCCmB6UG8XqxnWLb0eQoqerRJbdn oA3nEDveaWrK4JOEDHUQYcvcVDMU765TI5lnHyWx7NLhTSiVYtozhx+VlwdGWRwu ic2xfHpuRjW90EjKI5DWid+ePORfNF6udeGf8E+77tZvZAUej5WybDyQyAeWrhjU kYctNCRvMZuI3QLlJrg4B/A1DpLSrCy+EP898JqpbBVg7CKmNVJk6TFqdYT0E1uR 88Za6nc3SaRjMB5MuVnyBgpjYywtWsTjHlAmO4wAAGkDIOZudltmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudehjedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeforghrthihnhgrshcurfhumhhpuhhtihhsuceomheslhgrmhgs uggrrdhltheqnecukfhppeefuddrudeigedruddvuddrfedvnecurfgrrhgrmhepmhgrih hlfhhrohhmpehmsehlrghmsggurgdrlhhtnecuvehluhhsthgvrhfuihiivgepud X-ME-Proxy: Received: from localhost.localdomain (xdsl-31-164-121-32.adslplus.ch [31.164.121.32]) by mail.messagingengine.com (Postfix) with ESMTPA id F1927380083; Wed, 12 Jun 2019 12:03:47 -0400 (EDT) From: Martynas Pumputis To: netdev@vger.kernel.org Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, m@lambda.lt Subject: [PATCH bpf v2 1/2] bpf: simplify definition of BPF_FIB_LOOKUP related flags Date: Wed, 12 Jun 2019 18:05:40 +0200 Message-Id: <20190612160541.2550-1-m@lambda.lt> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags were defined with the help of BIT macro. This had the following issues: - In order to user any of the flags, a user was required to depend on . - No other flag in bpf.h uses the macro, so it seems that an unwritten convention is to use (1 << (nr)) to define BPF-related flags. Signed-off-by: Martynas Pumputis --- include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 63e0cf66f01a..a8f17bc86732 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -3376,8 +3376,8 @@ struct bpf_raw_tracepoint_args { /* DIRECT: Skip the FIB rules and go to FIB table associated with device * OUTPUT: Do lookup from egress perspective; default is ingress */ -#define BPF_FIB_LOOKUP_DIRECT BIT(0) -#define BPF_FIB_LOOKUP_OUTPUT BIT(1) +#define BPF_FIB_LOOKUP_DIRECT (1U << 0) +#define BPF_FIB_LOOKUP_OUTPUT (1U << 1) enum { BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ -- 2.21.0