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=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 2EC84C282D7 for ; Wed, 30 Jan 2019 19:48:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0036C2084C for ; Wed, 30 Jan 2019 19:48:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sSvC5ZiC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732977AbfA3Tsf (ORCPT ); Wed, 30 Jan 2019 14:48:35 -0500 Received: from mail-pg1-f201.google.com ([209.85.215.201]:47827 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727760AbfA3Tse (ORCPT ); Wed, 30 Jan 2019 14:48:34 -0500 Received: by mail-pg1-f201.google.com with SMTP id o17so420805pgi.14 for ; Wed, 30 Jan 2019 11:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=JSb38Ut2/3xinG2SzpIdPYNYuoFSEq93BkH1ap/hYTU=; b=sSvC5ZiC3wrJdSatex3sTgO4jlCC04l/WLzIlq/6LPwUnHMNoVKrkLSICA7To9Bp3P nX4WEgI3WGj9rFGRHlr/hILi2//EFzvJt1OLp15UsfxL8OHBYA4JJN9ReAcHqTg491Iu iXesMqbNNKUK0tdvFm4hYEQ4jOUzDpYkNujUhzfQ10+DT6cXa6qh4xiJgLr27oLndaR8 iCGcP3Y4Pnpb+cNgGPEMXxZ4P4kceZmj/LT3y/2mRzjOt4SjweXDbXJm3y+M9h+YQZrF tV6fBNBhEISsvFHBQV1Fb7u0kBnWZcSo7G9ysGHdNQGYDyB7+ANESX5+i8u9vSPTMXfb smBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=JSb38Ut2/3xinG2SzpIdPYNYuoFSEq93BkH1ap/hYTU=; b=Naee7r9vaQVd/q6htxIG5E6j10rtQFQz4CjVEZdjnMQL0nwEbBrkaEpCOhgZikhQZo fAlTePO7e+d7ZrWHXEXVoOZNkmFbTDcw2yAqho13w4TbHW32/GQ1j3XM0dpc2GHiL8mP ioRip68HFO+bsj2S7E6tPw1O3tcoG58sErKT/+Dcj9LhDVC+PZU0svIzdGbsN8IS6sbr +BmLXdSt5FsGSGDntbEJFvakLtrilXUChAaI0j8jOcsBDOKrjechlefxYZNe2ZIa9kXp 48rTYtQ37iYAA9m9Jwg4osRF1sIyGg0w4R2QihRgrNb6bZ5HRzmUvSFeXfugYis+2u2O 5rXg== X-Gm-Message-State: AHQUAuajyM8D8kB8rCPm1dXaGF3Xa8G6ace+UfkQ8jBWavyRV4uKKbSX z4eh4ds5TF7Idjas+dCgQQgSUPXs X-Google-Smtp-Source: AHgI3IaQPsDvK4go+VHsaMmJ0Caa79IJTnwUrdm+HPTsaIwUp1i8nlTP3VNY+URaokop1FZhrxbdnnJ5 X-Received: by 2002:a65:510b:: with SMTP id f11mr4732061pgq.92.1548877713205; Wed, 30 Jan 2019 11:48:33 -0800 (PST) Date: Wed, 30 Jan 2019 11:48:10 -0800 In-Reply-To: <20190130194811.239760-1-posk@google.com> Message-Id: <20190130194811.239760-5-posk@google.com> Mime-Version: 1.0 References: <20190130194811.239760-1-posk@google.com> X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog Subject: [PATCH bpf-next v4 4/5] bpf: sync //bpf.h with tools//bpf.h From: Peter Oskolkov To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org Cc: Peter Oskolkov , David Ahern , Peter Oskolkov Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch copies changes in bpf.h done by a previous patch in this patchset from the kernel uapi include dir into tools uapi include dir. Signed-off-by: Peter Oskolkov --- tools/include/uapi/linux/bpf.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 60b99b730a41..911c15585fab 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2015,6 +2015,16 @@ union bpf_attr { * Only works if *skb* contains an IPv6 packet. Insert a * Segment Routing Header (**struct ipv6_sr_hdr**) inside * the IPv6 header. + * **BPF_LWT_ENCAP_IP** + * IP encapsulation (GRE/GUE/IPIP/etc). The outer header + * must be IPv4 or IPv6, followed by zero or more + * additional headers, up to LWT_BPF_MAX_HEADROOM total + * bytes in all prepended headers. + * + * BPF_LWT_ENCAP_SEG6*** types can be called by bpf programs of + * type BPF_PROG_TYPE_LWT_IN; BPF_LWT_ENCAP_IP type can be called + * by bpf programs of types BPF_PROG_TYPE_LWT_IN and + * BPF_PROG_TYPE_LWT_XMIT. * * A call to this helper is susceptible to change the underlaying * packet buffer. Therefore, at load time, all checks on pointers @@ -2495,7 +2505,8 @@ enum bpf_hdr_start_off { /* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */ enum bpf_lwt_encap_mode { BPF_LWT_ENCAP_SEG6, - BPF_LWT_ENCAP_SEG6_INLINE + BPF_LWT_ENCAP_SEG6_INLINE, + BPF_LWT_ENCAP_IP, }; #define __bpf_md_ptr(type, name) \ @@ -2583,7 +2594,15 @@ enum bpf_ret_code { BPF_DROP = 2, /* 3-6 reserved */ BPF_REDIRECT = 7, - /* >127 are reserved for prog type specific return codes */ + /* >127 are reserved for prog type specific return codes. + * + * BPF_LWT_REROUTE: used by BPF_PROG_TYPE_LWT_IN and + * BPF_PROG_TYPE_LWT_XMIT to indicate that skb had been + * changed and should be routed based on its new L3 header. + * (This is an L3 redirect, as opposed to L2 redirect + * represented by BPF_REDIRECT above). + */ + BPF_LWT_REROUTE = 128, }; struct bpf_sock { -- 2.20.1.495.gaa96b0ce6b-goog