Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp203069ybj; Wed, 6 May 2020 15:16:08 -0700 (PDT) X-Google-Smtp-Source: APiQypJZYZsIexTl7JdTEkFKxK4ev3gn6sGY5Zg3o1fWHO33f03sOi7EJOXXhZl50ufk8WGFUDel X-Received: by 2002:a17:906:2410:: with SMTP id z16mr9594065eja.1.1588803368372; Wed, 06 May 2020 15:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588803368; cv=none; d=google.com; s=arc-20160816; b=zd8EBvnGSdCA85XRHsZHXl3n0zpch7OBAxi/VspAeO5kIanMappq1q4gfu4miS0Ua6 k/7G13DMp7sWc75oNl9ftKMzH3peIEndtmsYKE3ep5/wTwtyIVq7Thd73QD1U2669aOj 9YhDri4aHk6Y7PceIAS8U4El403PUudOxaeO8//OZidXRvqsD94uvFPMRwlxn0+PSlUc q6OAGzvMvY6E0q04yInIJqgL3XqmCoER/RRoR8sD1FTiEhuPGSRv/k5lC3WVeOnDXdpW rdecT5NV8cMrD+2OnDoMrDPkgm6/4cUW2719jocqSvW+EeqElyfXqyoSh42ZEA8T7UrG ib4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5seMAfg/V9IKlpMN7xejCaTLjyWdju1CY7lui7OxwBs=; b=BR2rYJgRvkOVZT2wGJr4cw90OZusgH3oWrbGsXgMiF1Apq/g4Pq+DhgnWN7zddJa1r 1ZeGUiherzlwrA7NNmFnAdaYCBbtnlVI7ZFrQxP6uigCFU2lr92ld7+DJZN9oFgB4Nbt dwbSqq7RZ47Z1eehtbzrRV1GhyHC5gjTiGgsu2ZGlIqr+ybufuLkRmYQaIuPpST/F8YX eydYZM7EU5Up+W7ukHuVRyMWE0v6vWjpwiE5DDfSL+fbDUr33TvhZhQTLJB61qH5Uukl B3Cw9fAf2fJs/vVgE6YBjFWhg/cklA66OmHBafT6SPNxGzNA9CD+09R7cq9IQwj8Vvhu BDBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OqErgpFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si1855730edq.508.2020.05.06.15.15.38; Wed, 06 May 2020 15:16:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OqErgpFA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728621AbgEFWOG (ORCPT + 99 others); Wed, 6 May 2020 18:14:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728888AbgEFWOF (ORCPT ); Wed, 6 May 2020 18:14:05 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C975C061A10 for ; Wed, 6 May 2020 15:14:04 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id o8so695616ybc.11 for ; Wed, 06 May 2020 15:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5seMAfg/V9IKlpMN7xejCaTLjyWdju1CY7lui7OxwBs=; b=OqErgpFAnFtDzsIwLFxC5R1yRWO7kawz9wrlJN5IVsCLmaZh+cNFX7aac9daeT8aXu JyLg1kvfN4RYMiFbBebROwAweaFyzWRZ0uRjF66OsXfKaRRIIpgbkF34EAW3klLl3NO4 RNiEF+zwcz3XG8CiXmaqZFK7Shy5fzutwMUZ3guxL8pBTQOktU7qvu0yhOYFROPf6hi/ 5ZI0agfyjjlIp+sDg18gGPl7TpnPl7fG5HVWZSuDWnJCl8dPdXA+EVef2tnracXPQm0s yd//RdLhfEkryPciEoFEM3+1239isEvhjUbd/DrmIdYmMVGTQETdiWWWNMfCCB72lRt5 nFRw== 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=5seMAfg/V9IKlpMN7xejCaTLjyWdju1CY7lui7OxwBs=; b=a9V1PYGFgnenyjA3kJv0VMKVwqu6D10BihdKmxOGIPCPPj8h7USmylcxlvF2a1U36u QFe8rWbd9qik+DC+PD03LQ51U4kdL3cBwvg5uzkbi2+dCvZy0gI9y0vzBOZh6OC9Huf8 ZPnolBzsRBx4Pbe8C/tahjd+BenK+hwZuRBqu06jRoTPAi8QmekLXu0UMIcJRyZwd4BA ft83V+G6LSibPc4iy6aKQ3BwUYp1FsIn9gBZGJp2zz1lCbPT1ioUpF04R1FNGh8m4R5z sbuUQP5RMBzdKeKNXMKFPMkhxL747HwbkRHT1ENb793vgRe1v8n2AloO1jHnj6k4IN+N zw+w== X-Gm-Message-State: AGi0PuaUQ0sONViXzqrEGc/r3ZsstMnOnfQIfvNtywCMqNW/95LMVudQ 4iOWbTp/XQ3OqRq9I74ex6C+tTOsFVGtwSvl8LPYBw== X-Received: by 2002:a25:4443:: with SMTP id r64mr16498352yba.41.1588803243107; Wed, 06 May 2020 15:14:03 -0700 (PDT) MIME-Version: 1.0 References: <20200506205257.8964-1-irogers@google.com> <20200506205257.8964-2-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Wed, 6 May 2020 15:13:51 -0700 Message-ID: Subject: Re: [PATCH 1/2] lib/bpf hashmap: increase portability To: Andrii Nakryiko Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Networking , bpf , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 6, 2020 at 2:56 PM Andrii Nakryiko wrote: > > On Wed, May 6, 2020 at 2:47 PM Ian Rogers wrote: > > > > On Wed, May 6, 2020 at 2:33 PM Andrii Nakryiko > > wrote: > > > > > > On Wed, May 6, 2020 at 1:54 PM Ian Rogers wrote: > > > > > > > > Don't include libbpf_internal.h as it is unused and has conflicting > > > > definitions, for example, with tools/perf/util/debug.h. > > > > Fix a non-glibc include path. > > > > > > > > Signed-off-by: Ian Rogers > > > > --- > > > > tools/lib/bpf/hashmap.h | 3 +-- > > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > > > diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h > > > > index bae8879cdf58..d5ef212a55ba 100644 > > > > --- a/tools/lib/bpf/hashmap.h > > > > +++ b/tools/lib/bpf/hashmap.h > > > > @@ -13,9 +13,8 @@ > > > > #ifdef __GLIBC__ > > > > #include > > > > #else > > > > -#include > > > > +#include > > > > > > why this change? It might be ok for libbpf built from kernel source, > > > but it will break Github libbpf. > > > > Without this change my debian based machine wasn't able to build > > within the kernel tree. I see bits/wordsize.h on the machine. Perhaps > > the __WORDSIZE computation could just be based on __LP64__ to remove > > any #include? > > It might work. Do you mind forking https://github.com/libbpf/libbpf > and trying to execute travis CI tests with such change? It compiles > across a range of distros and arches. You might need to set up Travis > CI login, hope that's not a problem. Thanks! I'll try to find time. Thanks, Ian > > > > Thanks, > > Ian > > > > > > #endif > > > > -#include "libbpf_internal.h" > > > > > > Dropping this seems ok, don't remember why I had it here in the first place. > > > > > > > > > > > static inline size_t hash_bits(size_t h, int bits) > > > > { > > > > -- > > > > 2.26.2.526.g744177e7f7-goog > > > >