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 4D5CBC282C4 for ; Tue, 12 Feb 2019 17:33:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F5F520821 for ; Tue, 12 Feb 2019 17:33:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="RHIH5mSV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731033AbfBLRdO (ORCPT ); Tue, 12 Feb 2019 12:33:14 -0500 Received: from mail-pl1-f201.google.com ([209.85.214.201]:52819 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730979AbfBLRdN (ORCPT ); Tue, 12 Feb 2019 12:33:13 -0500 Received: by mail-pl1-f201.google.com with SMTP id 71so2679110plf.19 for ; Tue, 12 Feb 2019 09:33:13 -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=JXkrGznPeT+Nc9rweVoe7LHDi07YZdMJYYhHz8ok4KQ=; b=RHIH5mSVIwXglt23fgDAlB0J5vuwPoUoHOlaGDrnCwNWvLmXMKQtR9DNsid56iw60J DHXlbrczeb0smpjb4Lr3UdYSq4D1z+2gtTZrgvHEnM52KBJXLlmTDnrpeinwksJ78pZ6 2VnSoEEcd/bv67rIFbjU0Pz+DWUAypGTyh2M5n6pBb8ZhpDj4rMq3CeU+n3DkeuivoKo aZ4Ao4Kf7B0TBNZytNT59B6fXcD+141vypKejTBEl7Ur+x/CskglY6OZuLaDe8EKkODL UkVDBm13pwZozv4bviOxWFXFkdUuLL09jY42UqWd9GmM9HTcN0AoHZ3HSzE42Ria8tcW kp1A== 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=JXkrGznPeT+Nc9rweVoe7LHDi07YZdMJYYhHz8ok4KQ=; b=PwaoyzgDRt6rLuj+AsbJrpiy+7VCw+7x0xeVE18Be0VAVkMmOvknwDIsGGstBTDawQ OXzZRQcyr79ankaGW85HWyLx3tnrDygf89XIIYUu6eU3gvab9lQNmqPCCtkkBbbz+NrO VRnDrUFD9rgrR9umcFvVD/Cpz7e9PM/e+OTMQ1/rTZ0Jl9OwBrykwhBMbeWDCFBgdHve uB+njXALN+pQs4ZazrFEJuqI1eo5pVpCSAZMgrE0nOD3/I9vkNnMkPkhV9IqH0blMQyI SjIvlz9157eTb2f5qphzhizt8sjJAF8Qfbz84Ur/7Cl5+krXCkL6ka0IDDAIOJrdWSti R+VQ== X-Gm-Message-State: AHQUAuYDK+NbQ+q5N7dtEzX0kf4lfuOkyOMV5r3Jf9A+NTo6eT4/ChR4 PgeRPb84oid70me4HmeEK/ChN7yr X-Google-Smtp-Source: AHgI3IZaGLXL2842mQ+amdccaFb0GX/CbRu0FwaUChWjCol+xYn9Cp1ewtNTZ7g68V/bqy9sWE7C7tMx X-Received: by 2002:a62:b514:: with SMTP id y20mr1801807pfe.94.1549992792712; Tue, 12 Feb 2019 09:33:12 -0800 (PST) Date: Tue, 12 Feb 2019 09:32:46 -0800 In-Reply-To: <20190212173247.121342-1-posk@google.com> Message-Id: <20190212173247.121342-7-posk@google.com> Mime-Version: 1.0 References: <20190212173247.121342-1-posk@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH bpf-next v10 6/7] bpf: sync /include/.../bpf.h with tools/include/.../bpf.h From: Peter Oskolkov To: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org Cc: Peter Oskolkov , David Ahern , Willem de Bruijn , 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 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 25c8c0e62ecf..bcdd2474eee7 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2016,6 +2016,19 @@ 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. Please note that + * if skb_is_gso(skb) is true, no more than two headers + * can be prepended, and the inner header, if present, + * should be either GRE or UDP/GUE. + * + * 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 @@ -2517,7 +2530,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) \ @@ -2606,7 +2620,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.791.gb4d0f1c61a-goog