Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp971966pxb; Thu, 21 Apr 2022 14:57:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsZwZFEDfkr+Xu8ai+vGMtV63p7Ke+foCuL9aUrdXJrJ07JIDfrQQMum/N6k/3ZXVvaeSL X-Received: by 2002:a63:368a:0:b0:398:2829:2698 with SMTP id d132-20020a63368a000000b0039828292698mr1276974pga.172.1650578264424; Thu, 21 Apr 2022 14:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650578264; cv=none; d=google.com; s=arc-20160816; b=njpMjKTGBoov1q6p/kBTKbrLoKn37IfkdxoRXzPPS/MfYX/yebM5xwZa0Ks0YxBvBF J9LF/R0KmoKGOj5ykNNpKQWvE2gNSq4bjHqX+ExtEWjqaUIQ8qVsP5WfzjaJwffBdAiX 9Z8HnBXj+Afk+24soelOAp86dgza9wA3caLOvaLeHQO+teLN8RWRk0xH4p96UV0krtEI ae0zWqlV+g1DdYxM2ZC91hO7yDMaG2a+LPPUahVhRdHkJbfbq8U92U4APjZscGmmcGLN KXxdhThmkWR42uPHA7DXpNqWoe6gxpoRdWF8deieSGtEUt6bzOgbWoo26z7GlXGYa0Ox VjNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=J9EMLBfyl6d0EbP75AQ2MnE0hjjzekwUZInxavmwZss=; b=eKcU7AcoqTxQ6oTXpTIgmK/mTePvCjf5RKhRfW8hrUW4g4Kb7P5sxB+EcYsL4NsWEk 7G7n4z5l/Vj0MEUO58Fo1jQgsBE+Yw0GT1BjV8cKcooB6EqaJA82S11UOrYcoFVMUhtC sGI/zU9+Q+7rKeCVZ+XfpyfajqGwnSFO2ELP7Bs3vAsh1wSSBB2pnCFaikzFTfLkUUtX wP7KfR658e9Iy4nmihRdSOnk8cRHLUhfS8RX/IC4vkpUemeePoWBNHA1XTyQJAPCPHTj rGIXW8tlUGoLrIPlu+eLXlpEASICLntcHsufG/jf7uLNS+b3pLxtbDQZ9pJjNq2Ncit0 7zxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=qJARHcrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056a00218300b0050ab666a8e4si6693993pfi.317.2022.04.21.14.57.28; Thu, 21 Apr 2022 14:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail2 header.b=qJARHcrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383585AbiDUAm4 (ORCPT + 99 others); Wed, 20 Apr 2022 20:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383580AbiDUAmn (ORCPT ); Wed, 20 Apr 2022 20:42:43 -0400 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F35E0CE for ; Wed, 20 Apr 2022 17:39:55 -0700 (PDT) Date: Thu, 21 Apr 2022 00:39:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail2; t=1650501593; bh=J9EMLBfyl6d0EbP75AQ2MnE0hjjzekwUZInxavmwZss=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=qJARHcrj6Hh60qCbLVmoEFR3CuENFViDy1rPraIGl/Az3GCz8Aq5S8KZV8rEkoWYR dJfIfBrVytWgcc6VZqf0UtjCpqkv6GIdxsYDouYrxXM4+3XoG+QEsL3uwZMsVK6PQw wYw9PVFhvkocayxI26r/CLtEAbjIRj9wJiMgnL1AS3kldqrU4k48s9n+FvYx9hPLs/ cdD9roNtSs5MYXw33n//IppafEWUhRy6dTwD07lLXeigM/5EwMVcAYxqbnajpFJhiQ b2yTZGosWBP4bfVmBEJY5FYXZ8WbirlecCte/6otmdjkan8EZPZ5HkNgElhVcKKQnq fUtpFql4HMDhg== To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko From: Alexander Lobakin Cc: Alexander Lobakin , Maciej Fijalkowski , Song Liu , Kumar Kartikeya Dwivedi , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v2 bpf 09/11] samples/bpf: fix include order for non-Glibc environments Message-ID: <20220421003152.339542-10-alobakin@pm.me> In-Reply-To: <20220421003152.339542-1-alobakin@pm.me> References: <20220421003152.339542-1-alobakin@pm.me> Feedback-ID: 22809121:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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 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") Acked-by: Song Liu Signed-off-by: Alexander Lobakin --- 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_u= ser.c index c9a0ca8351fd..c0ecca01d890 100644 --- a/samples/bpf/task_fd_query_user.c +++ b/samples/bpf/task_fd_query_user.c @@ -9,11 +9,11 @@ #include #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 6f3fe30ad283..9747d47a0a8f 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.36.0