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 3DCC4C282D0 for ; Tue, 29 Jan 2019 01:12:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0187C214DA for ; Tue, 29 Jan 2019 01:12:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="d7exENpH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727639AbfA2BMc (ORCPT ); Mon, 28 Jan 2019 20:12:32 -0500 Received: from mail-io1-f73.google.com ([209.85.166.73]:39575 "EHLO mail-io1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbfA2BMb (ORCPT ); Mon, 28 Jan 2019 20:12:31 -0500 Received: by mail-io1-f73.google.com with SMTP id q23so15660733ior.6 for ; Mon, 28 Jan 2019 17:12:31 -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=uXNLzf5ZP2BlT9gZWwUG+pdK4o8/6ITYYoFETUHKhmI=; b=d7exENpHM778TxJovs5kA2/SZcS2IfwbjDNnrY0/IhLhDsTTWbD8YR1ChDmGKY4zqN 5w3sP9JXJhvmwfkaUaBuFz47tcEyu8PmoernCXAqWGPMIjMroi/YY3PL8kxxXIlY4nwr 22YcOf18S8nQuQp5JQj7wWEzZIQvXRmiR2ONjnp0iZZ4LrIBuSH2jTM+4Qa7mcKSdBL7 tK36eBTnVl4xanZzrHmQ5wi6COfgqcM6DoF12JvE4rXjklsKGp/eYxuwbnHe0BmKgjFA lG+J2g0d+W4qNN+3SnIICylXgy6kznFusokZKtXaENWlYq4y68g5EFyvK+P8usjdDf1p l1YA== 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=uXNLzf5ZP2BlT9gZWwUG+pdK4o8/6ITYYoFETUHKhmI=; b=c1DxwEXBDuSbvrMf+3Wym9Zp3xzZwWvh+fpCk6JwVaHmeuoKqfSem3nkpHBoSR3jdo VXO9c/v0K9VqgiMC6sMEyY4TE9iBC71//p0YAZ1gf6yxHZfZX84tTULVzlkogxqdUzL6 pT7EEBAe6ttyGi0V+n522HbasBzF63uVQN3T5MzSs49urso5LHDajeG9A4MM8/h1XEOL Y+wjuTAmwMT70e/ltkLVKiHq3v9ZtMwG/E+l01HH+sDk4B0iIsPJtcbkC+a5B2/A7jsv zHsQUe8O4WeTgrpJlsi8UU+lOCgzIxnOW1fuaIYoS+yC+gsRlqXVWO+m/0HFLlcn/RzU jSfw== X-Gm-Message-State: AHQUAuYXIILQInrhSaUyDKxQovtWEw9vwTqJxQ57FxsfDRfVUqJKUttx PlEjb2i39L94zrOIGar9ZXwxZ5+B X-Google-Smtp-Source: AHgI3IZFztJ1ljkF91LTdpGmJMjBMSf0yhHTAvTA5SRZLmsNgnLv0IPZZXzJIiwcE1yrzRbBmY7KQ+G0 X-Received: by 2002:a24:4509:: with SMTP id y9mr1476796ita.13.1548724350718; Mon, 28 Jan 2019 17:12:30 -0800 (PST) Date: Mon, 28 Jan 2019 17:12:16 -0800 In-Reply-To: <20190129011217.192510-1-posk@google.com> Message-Id: <20190129011217.192510-4-posk@google.com> Mime-Version: 1.0 References: <20190129011217.192510-1-posk@google.com> X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog Subject: [PATCH bpf-next v3 3/4] 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 , 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 | 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..c4fee8b45762 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's dst + * has changed and appropriate dst_input() or dst_output() + * action has to be taken (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