Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1233506ybl; Wed, 14 Aug 2019 13:04:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhHpJWjlcdLvWQms4cawET1jKXkbiP9YmSXN2bTR58G41wZz2oBbpGAB2VAMISMicpv3s2 X-Received: by 2002:a17:90a:1d8:: with SMTP id 24mr1412838pjd.70.1565813098591; Wed, 14 Aug 2019 13:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565813098; cv=none; d=google.com; s=arc-20160816; b=D0lvUKmzYCj1olHJi6BCi5UUF9Wq4W8F7GqF5YjFZJBhkAOqI5U/YKfm6IxTU+WB/X uTCnngugxs5dzHjiHV2Fj3HiEZSws2w02mFUSmkvZZCC4fWpDlx7Iglay9XMe0/D2JZU lDb+O7cexzrduHmMGwCrrJm0ah3kFXq84KEsb1wkubRMirjXzra1p0Z1dGGa4Ugqsh0q XGWeFttQr8nK1F8jZtZhlKPrrlAE2cIeTe0PtC3A1KW4bd7LG+gxdLqjeT4BUqLM5+jd R8XEG/OGSqfLUrW2tEYxwQZIa2QyDVRxEoFFxx0uI+naHJM3sg0rca1jfdS8/OcoU0EK y59A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ww+ukQWhq8T3zW2D5eMGHhBPEXg0kxg6O6YWVSbyLu0=; b=dCNGfOG5rnfwp2DpqJfojGrLohdDOLJ8ol6I1lIgK84LpgX1FvkZsrmyR/ITTOmzr8 NgUV66yYRvzfWNFj38FjpR0WpKdZUXLmHgb3gu6r4I0ssanxkPTUXOFdN+DcfQWcbc6J jQfex9/AD1fyHqx0vg8u3mXimmBi9xolUpnpPwXoEymDu+5SDQu0lkiG2P7hZW8pKZbD URHHnECC1aHP4YFNl14ePix7gKLkUvF2b1PhKgJlSTwWQa0Jf8ASoJ+XcYVrMdhHNPdZ iUlcNqtWToA8GXZfCsjvW6ZIvfbG3bQXURNOde0nBRlwub8ABzgtXZVSYhOPO0wH/NIM mGrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z5im4LRU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 64si513158plk.180.2019.08.14.13.04.42; Wed, 14 Aug 2019 13:04:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z5im4LRU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729099AbfHNT4p (ORCPT + 99 others); Wed, 14 Aug 2019 15:56:45 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45274 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfHNT4p (ORCPT ); Wed, 14 Aug 2019 15:56:45 -0400 Received: by mail-qt1-f195.google.com with SMTP id k13so14217221qtm.12; Wed, 14 Aug 2019 12:56:44 -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; bh=ww+ukQWhq8T3zW2D5eMGHhBPEXg0kxg6O6YWVSbyLu0=; b=Z5im4LRUTbqe71draDujv36ynaR5I7qnWRFDXujjJOzy8/wD1b7rPasp8FZ0ASV+FK 2TOMISmoOdJ7DuiiaFYlzb9BQAokUydp8ZyR4t3xhk1tZM5T4q89XGdp4vgvIz3wTBGN ffr//kJA2Xy3cDRAURvIvGO8qv4/ro/22riaw2Bg/9dDRcetRHknLSh58Jf+0KNGPA6v lgx6bGTaXn0l4GBe5ERN9ErTjrki/EPLWVrJ2B3fH2L2nj5WJoF9oQPcTGGr3zqbYi0M dkSVvFrCEYMsPitD6HZNUOztYWReG85PTV3FVlII6yFD012SQJAF12TPOqyl9lHBi811 DFeA== 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; bh=ww+ukQWhq8T3zW2D5eMGHhBPEXg0kxg6O6YWVSbyLu0=; b=gOIXH6EXbEq99u27/TqlAWtgJW640zSSJoqOG3WixZrPqD4BNwu83PMHGzIEczf1Pz Aj0W4PUBaIh8G8CZ7gRMFz1Hxj4YBaeXVVyZrSRImK+OgYqCCKuZAiTVnFtJlrAQpEcH TI6KhURiF43fNfbxoVX5B04Kvj3BOSpOhfOlYrPoahFC4osbNV5zcbEb0vZ+yDyoPnY0 qrosby1lVpnfpzYMPGHe063un0TGD/UTNiwJcesEzZJDkLIdp97TaiVIJhSGWUszZe1f 2MoCZLtQUaR4b7Zqmq/sqakTSEAwEDPmeDaQ5TtSAR9YCBPSvAhUrg4cf8qsd5WIB7As 9rsQ== X-Gm-Message-State: APjAAAVaDSh7YV2zmipsJT3Uc4M6gA5bG0sFvd16OfOQPP8lVms1Opez DVc9os4hhPe70aiVLwdyqCMKIOm2RIW/ei/TL8c= X-Received: by 2002:ac8:488a:: with SMTP id i10mr891426qtq.93.1565812603868; Wed, 14 Aug 2019 12:56:43 -0700 (PDT) MIME-Version: 1.0 References: <20190813102318.5521-1-ivan.khoronzhuk@linaro.org> <20190813102318.5521-2-ivan.khoronzhuk@linaro.org> <20190814092403.GA4142@khorivan> In-Reply-To: <20190814092403.GA4142@khorivan> From: Andrii Nakryiko Date: Wed, 14 Aug 2019 12:56:32 -0700 Message-ID: Subject: Re: [PATCH bpf-next 1/3] libbpf: add asm/unistd.h to xsk to get __NR_mmap2 To: Andrii Nakryiko , Magnus Karlsson , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , "David S. Miller" , Jesper Dangaard Brouer , john fastabend , Jakub Kicinski , Daniel Borkmann , Networking , bpf , xdp-newbies@vger.kernel.org, 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, Aug 14, 2019 at 2:24 AM Ivan Khoronzhuk wrote: > > On Tue, Aug 13, 2019 at 04:38:13PM -0700, Andrii Nakryiko wrote: > > Hi, Andrii > > >On Tue, Aug 13, 2019 at 3:24 AM Ivan Khoronzhuk > > wrote: > >> > >> That's needed to get __NR_mmap2 when mmap2 syscall is used. > >> > >> Signed-off-by: Ivan Khoronzhuk > >> --- > >> tools/lib/bpf/xsk.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c > >> index 5007b5d4fd2c..f2fc40f9804c 100644 > >> --- a/tools/lib/bpf/xsk.c > >> +++ b/tools/lib/bpf/xsk.c > >> @@ -12,6 +12,7 @@ > >> #include > >> #include > >> #include > >> +#include > > > >asm/unistd.h is not present in Github libbpf projection. Is there any > > Look on includes from > tools/lib/bpf/libpf.c > tools/lib/bpf/bpf.c > Yeah, sorry for the noise. I missed that this is system header that's expected to be present, not internal kernel header, parts of which we need to re-implement for Github projection. Never mind my concerns. > That's how it's done... Copping headers to arch/arm will not > solve this, it includes both of them anyway, and anyway it needs > asm/unistd.h inclusion here, only because xsk.c needs __NR_* > > > >way to avoid including this header? Generally, libbpf can't easily use > >all of kernel headers, we need to re-implemented all the extra used > >stuff for Github version of libbpf, so we try to minimize usage of new > >headers that are not just plain uapi headers from include/uapi. > > Yes I know, it's far away from real number of changes needed. > I faced enough about this already and kernel headers, especially > for arm32 it's a bit decency problem. But this patch it's part of > normal one. I have couple issues despite this normally fixed mmap2 > that is the same even if uapi includes are coppied to tools/arch/arm. > > In continuation of kernel headers inclusion and arm build: > > For instance, what about this rough "kernel headers" hack: > https://github.com/ikhorn/af_xdp_stuff/commit/aa645ccca4d844f404ec3c2b27402d4d7848d1b5 > > or this one related for arm32 only: > https://github.com/ikhorn/af_xdp_stuff/commit/2c6c6d538605aac39600dcb3c9b66de11c70b963 > > I have more... > > > > >> #include > >> #include > >> #include > >> -- > >> 2.17.1 > >> > > -- > Regards, > Ivan Khoronzhuk