Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp29855lfe; Fri, 15 Apr 2022 17:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztEJBqrvmib2K6aZtpdHmJ6HsDvyqrO06PJo0Y3IjXIuhOGtsnXlw10qXwxOq3PJQiR9zz X-Received: by 2002:a05:6a00:b46:b0:508:2d0f:9f83 with SMTP id p6-20020a056a000b4600b005082d0f9f83mr1430617pfo.80.1650070652911; Fri, 15 Apr 2022 17:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650070652; cv=none; d=google.com; s=arc-20160816; b=CzvnWmaPjFTcDxWweR2QAWB9X1dw/spfarzQOCRjUn407cBATsNJ7FgeG3IXl+wPKa KnZH5o6jhD3s6FirPYkukNIqVhR+uHApjHIlHws8d+E9+pEOp5fpsX1kEG/uT/orJs/l W31H9Ch4X3UDBflh6TUGPtkUK8hP38kNZ6lG6ifLlcqdt0x/Nf+z4HDJe7AA27Ugm8qO dJDZFcMSpdyGUhQ6gdCbdQSEPZ5lcAZl0BGPlUKHS7ilE+nRoBRL3c6XuvoV5UNd+W72 jq7q8sN5esbwCT+Iza9+zRnX5vxwulrUVv95u70bTy911zg1fyJcvyrivXOS6yUlpki2 OLRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xkJa6UA2x5J9iSUBsZqmhERzIny7iy+96UJBQ2uqCi0=; b=jF78xgeY0RMQ0cyRwLKQ1aSOPlT75A/4ScFEbHy30SN6VooB8aC/iO9hcTvNeCK3st TjOBMghDxt18/pBRHaeLHcWtmsnrPyl7cfvM+vQhMCA9E0rTXzZRG4CrujQ0sNnRpyq9 LrwEbkq+o3RvM0Qsffq+A2pS9ML1tH326T8KheiZy3KQYAa2krykf8KpZu7XqCXOQ6hw ExIpsuiE9XY3X9ZPYKNisrk65dc2yp6CWnG1pO9UyWRLqYkget0jjtIPVMxp7hXViQ8s nxmGsnEXnZfvzb+cRsK6IY5E+PLYxJWMTb0vcEidu9m+ren8rroSYyh3fwwWYHbJh51n aXlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkijavTC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k15-20020a6555cf000000b0039dadec177dsi2792989pgs.695.2022.04.15.17.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:57:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkijavTC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C31B434658; Fri, 15 Apr 2022 17:43:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356628AbiDOX6L (ORCPT + 99 others); Fri, 15 Apr 2022 19:58:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356571AbiDOX6J (ORCPT ); Fri, 15 Apr 2022 19:58:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AAF429813; Fri, 15 Apr 2022 16:55:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E9FDF61BD5; Fri, 15 Apr 2022 23:55:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59405C385AB; Fri, 15 Apr 2022 23:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650066939; bh=YH64/o1O+cqN6mti7iSTLeA7PRyBcNLfWO/TvtuyAM8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tkijavTCh1wVpyg+GjXJWWbYnnBjhHT+VkxUTBA1yNFhK+lDbtQly03gbGjuQlecJ 1/PdgTWTwD8+0wlBnSNAUAm4BP7J0+yg2kaBGsrMxX/GSPpgIRefw/lTXp+CWzoMrv AL7hKp4iQgOEehAvpQUphLN7fZSzIvDuubGXG1alsj7m3jcRTmOiW09CbmNry+O6RG g+vyiSgs8nBIqWtiAdbx9o7hpLwXoeBOLW4E1qsBxOIunG7UKdd/m02ollqGST2ARt tLYdHJBEg/wPPr3Zit8+9oiGGx6MlyFMIJbeGF/CMTG7ylRTlfQd10i1q+THVo3K2n xVSAa8A7lSrIQ== Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-2edbd522c21so95306007b3.13; Fri, 15 Apr 2022 16:55:39 -0700 (PDT) X-Gm-Message-State: AOAM531kvRrqHNq7pxRIXctyKdQzH+8cA0kfP7ijA5rC6J9Lwzzg7ILq bLpsvidBJcBOy9cYE7eyRWnipKVFXPo/UyfnQmo= X-Received: by 2002:a81:5087:0:b0:2ef:33c1:fccd with SMTP id e129-20020a815087000000b002ef33c1fccdmr1206424ywb.73.1650066938416; Fri, 15 Apr 2022 16:55:38 -0700 (PDT) MIME-Version: 1.0 References: <20220414223704.341028-1-alobakin@pm.me> <20220414223704.341028-10-alobakin@pm.me> In-Reply-To: <20220414223704.341028-10-alobakin@pm.me> From: Song Liu Date: Fri, 15 Apr 2022 16:55:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next 09/11] samples: bpf: fix include order for non-Glibc environments To: Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , Nathan Chancellor , Nick Desaulniers , Dmitrii Dolgov <9erthalion6@gmail.com>, Quentin Monnet , Tiezhu Yang , Kumar Kartikeya Dwivedi , Chenbo Feng , Willem de Bruijn , Daniel Wagner , Thomas Graf , Ong Boon Leong , linux-perf-users@vger.kernel.org, open list , Networking , bpf , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2022 at 3:47 PM Alexander Lobakin wrote: > > Some standard C library implementations, e.g. Musl, ship the UAPI > definitions themselves to not be dependent on the UAPI headers and > their versions. Their kernel UAPI counterparts are usually guarded > with some definitions which the formers set in order to avoid > duplicate definitions. > In such cases, include order matters. Change it in two samples: in > the first, kernel UAPI ioctl definitions should go before the libc > ones, and the opposite story with the second, where the kernel > includes should go later to avoid struct redefinitions. > > Fixes: b4b8faa1ded7 ("samples/bpf: sample application and documentation for AF_XDP sockets") > Fixes: e55190f26f92 ("samples/bpf: Fix build for task_fd_query_user.c") > Signed-off-by: Alexander Lobakin Acked-by: Song Liu > --- > samples/bpf/task_fd_query_user.c | 2 +- > samples/bpf/xdpsock_user.c | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/samples/bpf/task_fd_query_user.c b/samples/bpf/task_fd_query_user.c > index 424718c0872c..5d3a60547f9f 100644 > --- a/samples/bpf/task_fd_query_user.c > +++ b/samples/bpf/task_fd_query_user.c > @@ -9,10 +9,10 @@ > #include > #include > #include > +#include > #include > #include > #include > -#include > > #include > #include > diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c > index be7d2572e3e6..399b999fcec2 100644 > --- a/samples/bpf/xdpsock_user.c > +++ b/samples/bpf/xdpsock_user.c > @@ -7,14 +7,15 @@ > #include > #include > #include > -#include > #include > #include > +#include > #include > #include > #include > #include > #include > +#include > #include > #include > #include > -- > 2.35.2 > >