From patchwork Fri Mar 22 15:15:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willem de Bruijn X-Patchwork-Id: 1061309 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hcFMIGIr"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44QnKK5NVJz9sRk for ; Sat, 23 Mar 2019 02:15:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727139AbfCVPPc (ORCPT ); Fri, 22 Mar 2019 11:15:32 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:36212 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727055AbfCVPPV (ORCPT ); Fri, 22 Mar 2019 11:15:21 -0400 Received: by mail-qt1-f196.google.com with SMTP id y36so2905038qtb.3 for ; Fri, 22 Mar 2019 08:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yzf7MP+ZsipkYSpIxiz0fAp3Unje0Bmtm76uggU2Yyw=; b=hcFMIGIr0j3G0vw0t55s9ox28KschP57YADhk2vWpMPsDmpFzC6TeG5SXZuruT2ZcN JFRpKpjLbFCGfm9Wo7yqHrul4uf3jpT3PNVMdIzT8MBZ7Bx9pYtqYYdKQOsHXzfPheYR w5ll7EjF/v17ToX1dxUAaROix2P2padP451zEE7rJuzXkudLdm4gxE6RuPH194c4fDNh cW4A92sCeXPQsFiIWey4luTduK7u0y7nDD8bvTmdcjpXa2DSyEjTnszRKYPbbneqbGOV xC22kMN4VihRkdQ2ubJcRXHBgzXdcRCHP22x6x8RUm/3BXUYRkYP6UCp7FnTobeXumEs +wxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yzf7MP+ZsipkYSpIxiz0fAp3Unje0Bmtm76uggU2Yyw=; b=jvRGmFpL9VjWizfEnUfz0ZLjdkTpVehVgq/rCV4ukMNtNG9sNK60T8yM/XtATZ+CV/ uVpHhN7LAdJ6EkVeORNGc4A7RJUFFdgg0ht06zyVqImr2voKxkbGK9MV8t+glfrjUX5M qdII0w2FYNxOqISLzMfcEH5LvhypF52WsLvUB2SY0+UMoYRQZ8abGiGEUuc7LqGpGFnu xIK3T/Jw6hkzLt0m+3C7I7B2IPOr84HtV1bMckuJTXIBimzGsV4Hpkwp8N1fJpg2N0Gm OrwklZACoB9U7OpoY+ynkxeIXzsphDIqzVf41q8rmdKYFiPO4bv2AuddtzQYbmevoxSo JXDQ== X-Gm-Message-State: APjAAAW6tj57NvM9EX3iWBGT9rlt1DH4HdzkYtP51Mod6dABh7hdCWpg VD1MuB61oXK4q/qw/EaRyL6UZHvl X-Google-Smtp-Source: APXvYqxRjdrn23yOiiukUD4U4hmIN2OFaKVDBZAAzf6QQU3T7suNjQK8Iah1NEShOoaQja6aLT9z4Q== X-Received: by 2002:ac8:32fb:: with SMTP id a56mr8758288qtb.338.1553267720403; Fri, 22 Mar 2019 08:15:20 -0700 (PDT) Received: from willemb1.nyc.corp.google.com ([2620:0:1003:315:3fa1:a34c:1128:1d39]) by smtp.gmail.com with ESMTPSA id v4sm4631317qtq.94.2019.03.22.08.15.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Mar 2019 08:15:19 -0700 (PDT) From: Willem de Bruijn To: netdev@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, alan.maguire@oracle.com, Willem de Bruijn Subject: [PATCH bpf-next v2 10/13] bpf: Sync bpf.h to tools Date: Fri, 22 Mar 2019 11:15:01 -0400 Message-Id: <20190322151504.89983-11-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190322151504.89983-1-willemdebruijn.kernel@gmail.com> References: <20190322151504.89983-1-willemdebruijn.kernel@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Willem de Bruijn Sync include/uapi/linux/bpf.h with tools/ Changes v1->v2: - BPF_F_ADJ_ROOM_MASK moved, no longer in this commit Signed-off-by: Willem de Bruijn --- tools/include/uapi/linux/bpf.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 3c04410137d9..f770f0de5b9c 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -1478,13 +1478,27 @@ union bpf_attr { * Grow or shrink the room for data in the packet associated to * *skb* by *len_diff*, and according to the selected *mode*. * - * There is a single supported mode at this time: + * There are two supported modes at this time: + * + * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer + * (room space is added or removed below the layer 2 header). * * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer * (room space is added or removed below the layer 3 header). * - * All values for *flags* are reserved for future usage, and must - * be left at zero. + * The following flags are supported at this time: + * + * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size. + * Adjusting mss in this way is not allowed for datagrams. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 **: + * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 **: + * Any new space is reserved to hold a tunnel header. + * Configure skb offsets and other fields accordingly. + * + * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE **: + * * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP **: + * Use with ENCAP_L3 flags to further specify the tunnel type. * * A call to this helper is susceptible to change the underlaying * packet buffer. Therefore, at load time, all checks on pointers @@ -2624,9 +2638,21 @@ enum bpf_func_id { /* Current network namespace */ #define BPF_F_CURRENT_NETNS (-1L) +/* BPF_FUNC_skb_adjust_room flags. */ +#define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0) + +#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1) +#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2) +#define BPF_F_ADJ_ROOM_ENCAP_L3_MASK (BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 | \ + BPF_F_ADJ_ROOM_ENCAP_L3_IPV6) + +#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3) +#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4) + /* Mode for BPF_FUNC_skb_adjust_room helper. */ enum bpf_adj_room_mode { BPF_ADJ_ROOM_NET, + BPF_ADJ_ROOM_MAC, }; /* Mode for BPF_FUNC_skb_load_bytes_relative helper. */