From patchwork Thu Apr 14 22:46:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12814098 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 341CCC433EF for ; Thu, 14 Apr 2022 22:47:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347345AbiDNWtl (ORCPT ); Thu, 14 Apr 2022 18:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345500AbiDNWtb (ORCPT ); Thu, 14 Apr 2022 18:49:31 -0400 Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 236C5C8BFD; Thu, 14 Apr 2022 15:47:02 -0700 (PDT) Date: Thu, 14 Apr 2022 22:46:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1649976420; bh=PEDAO2gdSiFRYDFQPzekiNHelP6dYcLV8W7h2o7bylk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=QHoSlbFjf/Kt42k1QML0xtJ8oejvL8X+tAEFv/nsHe8Ff3PQZtHTi++9Iq/59YmQS 1hDTnY12ldGaBakqr4D2UDRXQF7k6Z2xQC1OKyyExd2OINI7yc3czb+qPnHfpc/y1K jtMmDIyGRHjNUjk0UCdJQWl5TbEQ66u8D48Y585iGQ7ub2ue37KezYbyTwTYxyoYOb Dtj8qPuqHXVW6bsioTlJMuxWbUdxSIo6kyKln9JaBA4i/A9nuvFLOty4a/IpeUxrfG YuIroPBF0Jn9brL75ErSOdvivLhH2gHzVDyXFJSg/4vUUufqjTWCGOcgT6PE4Eb1Qw Xg8wGvE7ccFzg== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: 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 , Alexander Lobakin , 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, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Reply-To: Alexander Lobakin Subject: [PATCH bpf-next 09/11] samples: bpf: fix include order for non-Glibc environments Message-ID: <20220414223704.341028-10-alobakin@pm.me> In-Reply-To: <20220414223704.341028-1-alobakin@pm.me> References: <20220414223704.341028-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net 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(-) -- 2.35.2 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