Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp191334ybj; Wed, 6 May 2020 14:58:31 -0700 (PDT) X-Google-Smtp-Source: APiQypKa4K60ruqgTrUPeGNxdX+117RrczaxvUQiAcc49gqdmQq27Ua7/5AuzFTWmaDPjpGspqlq X-Received: by 2002:a05:6402:297:: with SMTP id l23mr1029327edv.57.1588802311321; Wed, 06 May 2020 14:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588802311; cv=none; d=google.com; s=arc-20160816; b=MW8N9jNOB53ijWQXifoxFqpB4d2/qt+atQYPUsNZTpdSI9lwnWft6lJfsJXSecdXhZ oxATXfLWuKlEOf7k/r3XF5e/BN5PB9zgco6cDhepbJufmWXPxHaGp/iY5h8v1DYOUOwo Fq+QrSqkTQyRklBQEXI4rIBBIiV5Z26HYBZLJ/CA/Eceyb6rCqfQkfrYLjIbtfk8LIBu Xi74DInuktXZbxTpH1IexQ9OzoE5J6NER8z/kN6pPueM0dEebudeIwT1x6oEdIRCqDjf MIp44WF+2CWCq0EgIM77Za7Pt3TZH02L++GboMwzIJAhp1ShRgLQ9cWsmvRkj0yi7f3l 9svg== 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=aBCiVVZEpJWRYd7epspD5olBcNsS+jZLiGB12vTlPJ0=; b=TOrS7AOtqxlB/sujZ5fSZfazWbBOlabzphFP4xSA9/49EMxXuoWyu+6T3tPRnomT+t T3FBEviCKoREbyjbn9I7WuXp42mOWRyg+XlMgNWa2DwRpQrrBrTIFhRcY0IjbEgr94Wv U7TIEl0J5Pf3RV7YZ9JhO+hk6Xc1snoETmWpSjyLWMS9kL2qn6rbHfL18aWM6D70i7Wo f61urE5pNMeLGA95DDSGc+kBeRNBna1RxV7ESFPi6XEn0t5J/mhcF24ulHvD7bGFXj8Q tttBFDbMFKp2GlwAf6Vk8dLOL/mU7tcfWTk6hRdgZcSM3KLwGkNwNvFha+hnPoYq+NQJ 07ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="n/kzFmwE"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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.14.58.08; Wed, 06 May 2020 14:58:31 -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=@gmail.com header.s=20161025 header.b="n/kzFmwE"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729962AbgEFV4a (ORCPT + 99 others); Wed, 6 May 2020 17:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726927AbgEFV43 (ORCPT ); Wed, 6 May 2020 17:56:29 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84AB6C061A0F; Wed, 6 May 2020 14:56:29 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id q13so2988018qtp.7; Wed, 06 May 2020 14:56:29 -0700 (PDT) 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=aBCiVVZEpJWRYd7epspD5olBcNsS+jZLiGB12vTlPJ0=; b=n/kzFmwEJyYkO9ldTqSkf7R/Yy7OqGmNcDVU8GEQizholP9steDnVou2QWWWDccrg+ sic3e+clFU3UKJovfLUY3aneEcWmSnucNVF3YdOnviRoXdhA4FLM/cBicuS5uwK/4RtI q5fLMKyJZk+JYqO429wZdWZKoENTBwVJUi4Q+2mBzXXATv72RikKhuqvs4f4uOFOg7OE E6vY7lvSQPyBtJL47ASNUlyAyPmELWMYoECwS3FvY7ICNjQMF+aS2MrgamfRnm81Cu80 dUCBkXHAmwos/sf8NZFPytrAGqxsgnOoIszFejTO7GpR2sPHAUeeqOhdJSCL2HvzevQF bsSw== 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=aBCiVVZEpJWRYd7epspD5olBcNsS+jZLiGB12vTlPJ0=; b=G1vNm3fxSWDxIYjb332B7XR+YQHFm/85I2vSlzHS0deBgkLpQnHbcWLty5hD5cqans lIAj+LLC2ZTlSzOQ0+1xyOaJD8wp/Yt7mhC2uSBSrmK1m/RQ39pb2wpcaVhQGudH4dTz 1hUDq/v7DanTtsCPSW7CUnkQXACP5YhE6SpUBSfjln7RdHcngq84rAUCQL8KjOTmI1oP vZvfBZPJcn+ntDZHgU5XunE8r8h6C1+dyy+4k2h+p2cFsyASv9H1v07oGj1ehbOaTJGF PvHOi+e97mf0JCtcZuGIGyEvf3W7HqoaUbkLCWZhch/CtXyntuoLwVaWXwYwdgL4AZF7 de1w== X-Gm-Message-State: AGi0Pua/OZrVpj6tQ+2gLlDc1oqUDfgK5AlToxzPBqGBA67hhIr3yydx EAofM/5H1hiPqUU70TNjDaJTyeiuRFxg4WYU7pA= X-Received: by 2002:ac8:468d:: with SMTP id g13mr10390645qto.59.1588802188756; Wed, 06 May 2020 14:56:28 -0700 (PDT) MIME-Version: 1.0 References: <20200506205257.8964-1-irogers@google.com> <20200506205257.8964-2-irogers@google.com> In-Reply-To: From: Andrii Nakryiko Date: Wed, 6 May 2020 14:56:17 -0700 Message-ID: Subject: Re: [PATCH 1/2] lib/bpf hashmap: increase portability To: Ian Rogers 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: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! > > 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 > > >