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=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS 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 1462AC43381 for ; Wed, 27 Feb 2019 18:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3F25217F5 for ; Wed, 27 Feb 2019 18:28:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pEBJtQFW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730043AbfB0S2m (ORCPT ); Wed, 27 Feb 2019 13:28:42 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:35024 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbfB0S2m (ORCPT ); Wed, 27 Feb 2019 13:28:42 -0500 Received: by mail-qt1-f195.google.com with SMTP id p48so20413485qtk.2 for ; Wed, 27 Feb 2019 10:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zC1mLIqueJx9li7cJSd1APrFUb6XE9iqPewmUQjIIHU=; b=pEBJtQFWg+YgmECd9k8MW5WRtFxlryAreZM6mEtI1TKcpxak/V+SpGJ4vSCQxZajWj WrRGQ+/2YVzOtOlYk+jOnGISmXb6U5LjagY/cPKK35lSwSDSgFZwD9gW5MuwLovHF2p8 7tAeKPLqQjFxF7cCWs7plzQU+2iVUZ4M1t4faHgT/fiQAGLrXUcM2fWIwez55gNPUc6X V3H+Q2zuZqPn0lr5vxt5xtDfkQWYb/5xsTo9mHKlbiRze05YNulSNliHMtNzO1wXbekM oeK6BWhj0D3WbrMUGJ6TbUTHuTNOtCCRtCzYv84jLVJfL8RkjsrzHXFPWyhpZXTfc2vc FQEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zC1mLIqueJx9li7cJSd1APrFUb6XE9iqPewmUQjIIHU=; b=gqOsHY/EFqxZXYlVM0ig+7MJEvBbvw3k41mRwwgbNg+ds8ZmT1UDETOoohD2Ymf1l3 XE7MV+V7ODwLFTXVIfUbDUxbzjLkMWdFN7ikAxMhnhh2s2e+LmfhvGGbVGMJUqgt2DyZ GJ6FtSiXtQVGek41wyDRtq6/UPLQbOuZ1aN5sf3sjJCmm9zbIoi/ZWeU4BOKf7VLfRmq /qBu1ojI8LsYiWVEG5btd2zKXeWD+90Phtzs2bexFfp7Zx/ykZmmR4pLY/704ZzHENMZ wrqvtZHmWVwp64XRkNB9vBOZYZSMJSbRYTR4wEVycMszZJX8pA3Hen2KirMv4Hf+WYMV dNWQ== X-Gm-Message-State: APjAAAVK1LxLYcMY5fSuo6whIBuPYU26Gp1IoWkRVEldT1j3nsEW+puJ Z/vQobGGtpaeyBQj4i2Yyp4dZ/Irg9X6UddHetaWXcEX X-Google-Smtp-Source: AHgI3IZ4WrTZdtMKEoer+xZXecuBV9kqC0yKSvORyTF+kuAO81q5Q1+XaFKlKr2fafUCJkFb9dEgh4BDHLQW61RjmEM= X-Received: by 2002:ac8:2da3:: with SMTP id p32mr2874271qta.138.1551292120697; Wed, 27 Feb 2019 10:28:40 -0800 (PST) MIME-Version: 1.0 References: <20190227160806.195218-1-willemdebruijn.kernel@gmail.com> In-Reply-To: <20190227160806.195218-1-willemdebruijn.kernel@gmail.com> From: Song Liu Date: Wed, 27 Feb 2019 10:28:28 -0800 Message-ID: Subject: Re: [PATCH bpf-next] bpf: add missing entries to bpf_helpers.h To: Willem de Bruijn Cc: Networking , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Stanislav Fomichev , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Feb 27, 2019 at 8:09 AM Willem de Bruijn wrote: > > From: Willem de Bruijn > > This header defines the BPF functions enumerated in uapi/linux.bpf.h > in a callable format. Expand to include all registered functions. > > Signed-off-by: Willem de Bruijn Acked-by: Song Liu > > --- > > changes pre->v1: > - add brief commit message > (not copying Acks as they do not necessarily agree with that) > > - change return type from ull to uint for > bpf_get_cgroup_classid, bpf_get_route_realm, bpf_get_hash_recalc > > - change size arg from int to __u32 for bpf_probe_read_str > > --- > tools/testing/selftests/bpf/bpf_helpers.h | 30 +++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h > index d9999f1ed1d2a..026bea831e039 100644 > --- a/tools/testing/selftests/bpf/bpf_helpers.h > +++ b/tools/testing/selftests/bpf/bpf_helpers.h > @@ -232,6 +232,36 @@ static int (*bpf_skb_change_head)(void *, int len, int flags) = > (void *) BPF_FUNC_skb_change_head; > static int (*bpf_skb_pull_data)(void *, int len) = > (void *) BPF_FUNC_skb_pull_data; > +static unsigned int (*bpf_get_cgroup_classid)(void *ctx) = > + (void *) BPF_FUNC_get_cgroup_classid; > +static unsigned int (*bpf_get_route_realm)(void *ctx) = > + (void *) BPF_FUNC_get_route_realm; > +static int (*bpf_skb_change_proto)(void *ctx, __be16 proto, __u64 flags) = > + (void *) BPF_FUNC_skb_change_proto; > +static int (*bpf_skb_change_type)(void *ctx, __u32 type) = > + (void *) BPF_FUNC_skb_change_type; > +static unsigned int (*bpf_get_hash_recalc)(void *ctx) = > + (void *) BPF_FUNC_get_hash_recalc; > +static unsigned long long (*bpf_get_current_task)(void *ctx) = > + (void *) BPF_FUNC_get_current_task; > +static int (*bpf_skb_change_tail)(void *ctx, __u32 len, __u64 flags) = > + (void *) BPF_FUNC_skb_change_tail; > +static long long (*bpf_csum_update)(void *ctx, __u32 csum) = > + (void *) BPF_FUNC_csum_update; > +static void (*bpf_set_hash_invalid)(void *ctx) = > + (void *) BPF_FUNC_set_hash_invalid; > +static int (*bpf_get_numa_node_id)(void) = > + (void *) BPF_FUNC_get_numa_node_id; > +static int (*bpf_probe_read_str)(void *ctx, __u32 size, > + const void *unsafe_ptr) = > + (void *) BPF_FUNC_probe_read_str; > +static unsigned int (*bpf_get_socket_uid)(void *ctx) = > + (void *) BPF_FUNC_get_socket_uid; > +static unsigned int (*bpf_set_hash)(void *ctx, __u32 hash) = > + (void *) BPF_FUNC_set_hash; > +static int (*bpf_skb_adjust_room)(void *ctx, __s32 len_diff, __u32 mode, > + unsigned long long flags) = > + (void *) BPF_FUNC_skb_adjust_room; > > /* Scan the ARCH passed in from ARCH env variable (see Makefile) */ > #if defined(__TARGET_ARCH_x86) > -- > 2.21.0.rc2.261.ga7da99ff1b-goog >