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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 E0EDAC433DB for ; Sun, 7 Mar 2021 22:31:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A74D265151 for ; Sun, 7 Mar 2021 22:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbhCGWal (ORCPT ); Sun, 7 Mar 2021 17:30:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbhCGWaa (ORCPT ); Sun, 7 Mar 2021 17:30:30 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C497BC06174A for ; Sun, 7 Mar 2021 14:30:29 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id u1so10553087ybu.14 for ; Sun, 07 Mar 2021 14:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=/dBG0yzSXzaEP6wMxF8WVCUzDpcnQDtjFnGEznOQX/s=; b=UWzHK5JD0jUddhVg2gtrM9KROWDj/CbEKimn+q4kgOYXPCwWDxoFugo11FmZ3cysNr wlvu9QYl8N2iMJ5fjHGAK+ELj+KqGlWLf6palIGL1N0ubRKGpZTlc+Q92A494HHN5laI p1a1c1catOsgPQ2tvE3mvKCgN1Nq2nHcELza21SvHZxwssx7glYkU1YknloO9910jgJI qbrjrwJc9g4gpD6hAZtBYqIGM6+RlFZSGqAVRvE4L/lo1yxHjZRugqMhTaeLRZcCfwf/ gqa77N7+4ik92luA4iraU4dd7jh57MOQCDx4rzxwm7Yu+JPMN2pJHmSCvwOWxDr0Q3sE 7chA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=/dBG0yzSXzaEP6wMxF8WVCUzDpcnQDtjFnGEznOQX/s=; b=PA8T6AgOCjv6z7f2ni3z42Om5XnAT5NWtncGBKZF2F8wHUNAcZzAclW0jTvRy4GWO6 JtrkCUJu9Y3UhWZpD2/u5sbRI/KmJcjpDTDWIl+8l5iyuFYLTBZU3ZcFgTlFT7lv1jSU Md1452DyoTtdlYl/mwx5XVjOAQB9FE9XN0VUra5XTRRupDKnh683DjV4luDF8Ptg4mA1 r1aRv4OVgYo4C+QtYNiz+cBLIrMY5dZhoqgyoXC5nBpmjOYofK6WfOPws2ra2xL/VafE liexsk//P0DYi3SzlVb1/Uep3UqoqMq0R2fzqKTZVXHPkrXqsEdqXpC1WjvxWSoRD7ET 4deg== X-Gm-Message-State: AOAM530tOrmuqNQ/j4xcGzcsbdNjQnf+qUMofPc/3aYeDHQA+NUfZGiQ Y/Exg+pxquOrDCt+Eqa2IVcXTUTUAlZ2 X-Google-Smtp-Source: ABdhPJwsYZzwXptjNwlzQryIbwpIEMnHOv6VOApg2GBKnTQas/Dhz8jbZZ4u/jD+wbomQDqeQHCD45YZ3YTN Sender: "irogers via sendgmr" X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:2:54a7:6d37:d773:a2ec]) (user=irogers job=sendgmr) by 2002:a25:7613:: with SMTP id r19mr29172005ybc.212.1615156228902; Sun, 07 Mar 2021 14:30:28 -0800 (PST) Date: Sun, 7 Mar 2021 14:30:24 -0800 Message-Id: <20210307223024.4081067-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [PATCH] tools include: Add __sum16 and __wsum definitions. From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Song Liu , linux-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Yonghong Song , John Fastabend , KP Singh , Tiezhu Yang , netdev@vger.kernel.org, bpf@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds definitions available in the uapi version. Explanation: In the kernel include of types.h the uapi version is included. In tools the uapi/linux/types.h and linux/types.h are distinct. For BPF programs a definition of __wsum is needed by the generated bpf_helpers.h. The definition comes either from a generated vmlinux.h or from that may be transitively included from bpf.h. The perf build prefers linux/types.h over uapi/linux/types.h for *. To allow tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c to compile with the same include path used for perf then these definitions are necessary. There is likely a wider conversation about exactly how types.h should be specified and the include order used by the perf build - it is somewhat confusing that tools/include/uapi/linux/bpf.h is using the non-uapi types.h. *see tools/perf/Makefile.config: ... INC_FLAGS += -I$(srctree)/tools/include/ INC_FLAGS += -I$(srctree)/tools/arch/$(SRCARCH)/include/uapi INC_FLAGS += -I$(srctree)/tools/include/uapi ... The include directories are scanned from left-to-right: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html As tools/include/linux/types.h appears before tools/include/uapi/linux/types.h then I say it is preferred. Signed-off-by: Ian Rogers --- tools/include/linux/types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h index e9c5a215837d..6e14a533ab4e 100644 --- a/tools/include/linux/types.h +++ b/tools/include/linux/types.h @@ -61,6 +61,9 @@ typedef __u32 __bitwise __be32; typedef __u64 __bitwise __le64; typedef __u64 __bitwise __be64; +typedef __u16 __bitwise __sum16; +typedef __u32 __bitwise __wsum; + typedef struct { int counter; } atomic_t; -- 2.30.1.766.gb4fecdf3b7-goog