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=-11.6 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, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C7AC4C32757 for ; Wed, 14 Aug 2019 19:56:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CFD32064A for ; Wed, 14 Aug 2019 19:56:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z5im4LRU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729244AbfHNT4p (ORCPT ); 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-Google-Smtp-Source: APXvYqxXSTAWwijyc9NlManHFj6IVa/Msxv4XU2yOuIwifQOSvJEefJBpvrsS3zKqV4PuA0PJ50+m8sLy2gTt5qDjGs= 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