Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3052274ybi; Tue, 2 Jul 2019 01:11:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLpniaPMepegcrCrXQ9ft/weACN50TSX5Is25j8BXFbxbhxrITdyeu5j52NP3pR2Lp+p2W X-Received: by 2002:a63:4d4a:: with SMTP id n10mr28641242pgl.396.1562055086157; Tue, 02 Jul 2019 01:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562055086; cv=none; d=google.com; s=arc-20160816; b=r5u/blRcwO9P0RjRZcKjPDQdA6VzuuByLk5eaZ5yLwACYfAV75EZye4nPqB3B6uGtF d9Gz62Qjpy9DS2wrJ992DgPDuR7XmVzsbawA862tZyHdjAf4TSsCKsMUVbN/nqKomTj/ g4kINd9r3Zvf53BVpbFiYBWpl0lrqPiEZm9crnzxo1D9iCYkI5zG9bbpqQ1gBvFUbteW +uxT2TI9fY+bQnslfajhJZy/s8dSgJXIM+QCBD62izlJX5HJYuP56goiSckadbMUpydT d182SwmVa5AdZtLTIXeNFX+2gzR+8eVPlK/VxhoCD+SYc4tc3LQLGACdPpEMbo8FMQRI E6sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FMDKFU2/fes1TxPZi2mPlrZJuxOSi/vh4oZg6H54+mA=; b=yDf+3Eylsn1GKg+E3TDgA1k7TPl1pAKvtPhgAn89HhDP8xTmfyNENvxznorssTB8Ks nz00slwZCQXfIaDXFZhUmjiBaNn9mtRlYiUpWNrRoF2nceQNnyUh7PiYcfHjkW+ECZPL AcpwWA087003TLjMdys/HRz5YcdCdDjz6dR3sq2Y73E5iUTxv2oUlJsBtQoFG9Iysi0R 0vO1dk3XFl2p/471gk3NPMenvDc/7FEETRMTI94nIYvYviNnoNEHahLW3cnIN+Yejz61 7kCdSCN8H4WO4dmkY7VhdT4XbHnqAvyvh0Z8FWWjcEJwIALVmbqTuh9lCVxuCRKaF6Zx iaqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sQf/WA6g"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si11016501plr.131.2019.07.02.01.11.11; Tue, 02 Jul 2019 01:11:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sQf/WA6g"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728513AbfGBIIs (ORCPT + 99 others); Tue, 2 Jul 2019 04:08:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:56430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727842AbfGBIIq (ORCPT ); Tue, 2 Jul 2019 04:08:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6551206A2; Tue, 2 Jul 2019 08:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562054925; bh=8X71bpmRYa3Yx+gOlVC9pX5bTxnVVFLRsTAVsZOIFnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQf/WA6gcCY/aCfrjLLuRmuhg90q6J8fqGDtYHDNLxbaXzs9y7sGxxJu9RNJB/T+p QWFt2DmOMGFfvyADD/RLkac9urXxp0OwRnnQN5q058FFIgmmXnT50qje7FBqmspWx+ ssXaDXQ/n2zcgzEWBSeX3U5r4cI2sHBv3A+fI82g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martynas Pumputis , Andrii Nakryiko , Daniel Borkmann Subject: [PATCH 4.19 62/72] bpf: simplify definition of BPF_FIB_LOOKUP related flags Date: Tue, 2 Jul 2019 10:02:03 +0200 Message-Id: <20190702080127.840630441@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080124.564652899@linuxfoundation.org> References: <20190702080124.564652899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martynas Pumputis commit b1d6c15b9d824a58c5415673f374fac19e8eccdf upstream. Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags in the BPF UAPI were defined with the help of BIT macro. This had the following issues: - In order to use 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. Fixes: 87f5fc7e48dd ("bpf: Provide helper to do forwarding lookups in kernel FIB table") Signed-off-by: Martynas Pumputis Acked-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Signed-off-by: Greg Kroah-Hartman --- include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2705,8 +2705,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 */