From patchwork Wed Jun 12 16:05:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martynas Pumputis X-Patchwork-Id: 1114663 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lambda.lt Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="VocxbXoL"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45PBWD0pF5z9s9y for ; Thu, 13 Jun 2019 02:03:52 +1000 (AEST) 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 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 Acked-by: Andrii Nakryiko --- 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 */