Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp638915rwe; Fri, 26 Aug 2022 11:18:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5fc3A+o5RYoNKJHg6yEx43OL5ePzx99nhFH71jt2RPm5pNJ5SBEnAwqT/C66Ydz0q2z5kQ X-Received: by 2002:a63:5507:0:b0:42a:315a:3f07 with SMTP id j7-20020a635507000000b0042a315a3f07mr4159697pgb.174.1661537884129; Fri, 26 Aug 2022 11:18:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661537884; cv=pass; d=google.com; s=arc-20160816; b=W8EWfF2APMqP5oZT/wTUWAEXj6eXKi1aiNiT5wU5MePQc6ePIp0gvCLw9tfjIhZUwX nt9WpOsX2WSjSf5K696QUlRvksZefZJJbjO751evigcO0VD/JlK9Rpy1OeTuDV35Ovs2 7pHLVuajOfGqYtDSzV064QDnwUeECQvs6BIGIbsdnVk4BDbSNVf+MYL7GRZycWT2SqKB UCr2/4g5PD+qNhYv9aBKpDPgLAQIVeSWsy/9nnv1BOqDYEJYO0yCUnGiYRww+v8xivfU 3BIxYP3c3zw7OiFZ6F4ZMHWn2q9nNa/ohADgsPiZ5CHAapgVHEFUtAIu2/XTM2KySoj0 w/+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zqJrUzTrGJcUXDO+Xp68iugw1pyZpEltqdZPhEG/tXE=; b=0DHAzEMPW2ueIXWmSdhJUCZ/ieRpF+UwnYulH0T6HqNauo0wMdXAMszZbu+IR93fXl 69gAv8eoHlxgoAjjGXCtJRisr8qRsCm0O2iHcFHCfr5htTAmirku1oJaSk1/U3+EVZYM Yq749QOhuNIE7tKFMejCkUUjFd170sXPnDrjrQsdYwNgzL7ChA9y2KbaOFEQKR1m5Sqw 8nr5wxfbcDRUxLkduOnSvRIASt7Z2u/f5r0xtsitMHz0usF77U/HJKX+oBEN+ACwIEAY TSOEGRAtaYee0KwAuuvGSYsKMN0GiqyG+lTnr789ZWsBBO4ofJnpNkK+Ol8sxmzucUH9 fGEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Tr0pX9SG; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.com); 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk11-20020a17090b33cb00b001fd647cc985si1870768pjb.65.2022.08.26.11.17.52; Fri, 26 Aug 2022 11:18:04 -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=@fb.com header.s=facebook header.b=Tr0pX9SG; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.com); 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=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344439AbiHZRSK (ORCPT + 99 others); Fri, 26 Aug 2022 13:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239029AbiHZRSE (ORCPT ); Fri, 26 Aug 2022 13:18:04 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9E4CDF09B; Fri, 26 Aug 2022 10:18:03 -0700 (PDT) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 27QG75rp012626; Fri, 26 Aug 2022 10:17:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=facebook; bh=zqJrUzTrGJcUXDO+Xp68iugw1pyZpEltqdZPhEG/tXE=; b=Tr0pX9SG2D17QJ7LzNKUWnaxqaWXuQUcRL7v+2lTMCjBdnFFnihS5x7XmU7U4Qzk4DPm cWtygTnwmB5e202rvTvlf7Qd1DIT1TloQhPMlShJFJLH6x1Eofl5eBuOAHud9wK7c9Ce n/TvbCd6ZVsPTswgmITWXFyG3qtfwphuVmA= Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by m0001303.ppops.net (PPS) with ESMTPS id 3j71dhghen-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 10:17:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c39QCjQmXKkAGpj78OllX8sg39yBku0J9WCjQadqjlcgiYhn+WjTBk65SFeIXQ2GTt48E5mntr882vxLGPkvUpXlLwS0IqwEpg+HReOxb6Zt8Ahz2nc4Z569MquPXRibS5+R6TEI0eI1rKp/7DrLq2/4Q9Uh9lszpHe4CrLy4KO++Fxhor0ERKypb74EeevfSbqM3V5MS5x9hEzLIzqPdrnwQhQSSnW1u+QLlook5dByjcX9+9qLV5NyQT/PNNgHobxycPcdPkq8l68ws3hr3zMr9StkcW4PFesVgf7H+hG9lTF2m6huP+2+TdsBmmqVeFyzkCVfkk7KK3NXJlu9Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zqJrUzTrGJcUXDO+Xp68iugw1pyZpEltqdZPhEG/tXE=; b=csOEQobaASB3kCHmZaDxhJ6rfkBZEGQjGbZaTH24c+RQJlyD6v/LWbUW262SBxCuVvUBdP7l2K3OECMMGjZpL/eQXCdZHIJImicGOT8aWrchoqiPSOwur36dZtthGGo06RtNH5861RALPD8quGnRjfvJInym6CoSDGEyvOPX0+/ykarvMEL5837zvCxDLD44hBUxNrG0ABtHWNHGHwpw7mR4BRP+Z3f9YuHK7ifkUq4TlTu0jSF6oBLLddrQJc7uXpWSRYfhpsN2X4dgrVyfcX8GR7xXi9eZ7YuU3Mqkr4iBdWG6wiQ/0Q4q0K+j3ZvsOJFMNncHrzfICe6fFFdy/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none Received: from MW4PR15MB4475.namprd15.prod.outlook.com (2603:10b6:303:104::16) by SA1PR15MB4690.namprd15.prod.outlook.com (2603:10b6:806:19d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Fri, 26 Aug 2022 17:17:45 +0000 Received: from MW4PR15MB4475.namprd15.prod.outlook.com ([fe80::1858:f420:93d2:4b5e]) by MW4PR15MB4475.namprd15.prod.outlook.com ([fe80::1858:f420:93d2:4b5e%3]) with mapi id 15.20.5566.016; Fri, 26 Aug 2022 17:17:45 +0000 Date: Fri, 26 Aug 2022 10:17:41 -0700 From: Martin KaFai Lau To: James Hilliard Cc: bpf@vger.kernel.org, Andrii Nakryiko , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/bpf: Fix bind{4,6} tcp/socket header type conflict Message-ID: <20220826171741.pdiqa4n4mls56bw3@kafai-mbp.dhcp.thefacebook.com> References: <20220825221751.258958-1-james.hilliard1@gmail.com> <20220826051630.glhrbdhiybtqwc4p@kafai-mbp.dhcp.thefacebook.com> <20220826054944.5bcx7unsyx4ts6ok@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BYAPR06CA0055.namprd06.prod.outlook.com (2603:10b6:a03:14b::32) To MW4PR15MB4475.namprd15.prod.outlook.com (2603:10b6:303:104::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b6ea093-88cb-4020-6f0e-08da8786e407 X-MS-TrafficTypeDiagnostic: SA1PR15MB4690:EE_ X-FB-Source: Internal X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KbqKR0eScrKifpNpPzCADAx8QxOkqwMyv5HbAbModVFs90YjBWsm8i7CMpDnx+gn5+0HXwakSqAGkgOqWzhZQuiqLSsB2dffHVnTvdTneDwHw4PJJEaJ1TtdPkJXLZk9UBV6xOBiYGiSCjyGbFhEiC1SezPt5hZlzOPZmeBHjzF8lAHCEbmSROZzbGp2EN3SnB8I5trGLjXT8Uw8NK0fJj/7hzFAA8BTrEU65uq0+hcnSO2wqJ0TOfpWYqh5KEcleay5rU6LlzDtycBJlxDQMks5KgEnWZbz0WT3eqkHvUJpugaXXYo+klAgQysaoSB03jkjxoeARde8mR8llOka2Y+ZudSMpZC9njM2ulpzvEmKz6RWFC0JfiJ/UjRMl9wOU6eGAk0HLqEyUv0YoLxHav7IxxLYZQKYkt0cYYe3pM6BzWxIlEVw9cEhFHuhSPjTmQConQ4QJhjTytIwHrY0mbvn8zIMXNWmlyL8ScGTP36sMnXloHGsgRB1ABpj+W3Qqv5B126MAi/L01r52oDLVHZvefk8FvfKiBLE2EgL/JoDgbDC4owIpBbwKFlrKPB+8VxH9LdD3LoKXh5zFs04mvahRfKApWHE8NuOlHKq/47u6lKK9qDpa9r1Ez8G5XIEg/gIaKEq++2XUVtPvhDLd/6gu60Pi4XWtoR8VHxuPLqhCAQbbdsDsRFHQBttWKqA91Gys0LLfAushwwttWBs5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR15MB4475.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(376002)(366004)(39860400002)(396003)(136003)(8676002)(66476007)(6916009)(66556008)(66946007)(54906003)(316002)(5660300002)(4326008)(2906002)(8936002)(7416002)(478600001)(1076003)(52116002)(86362001)(53546011)(6506007)(6666004)(6512007)(6486002)(9686003)(186003)(41300700001)(38100700002)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ze6P6mC8Y1Tr09isdPHoHf0ia3YP5uLThx2B4uG4Ep+naBaxQVP6xBvQNZYM?= =?us-ascii?Q?us/RRuktBxWF3iTCdYwC3k2OZXQB9CR4xzYPlveNQ29LqCnijCUvj8wyefWq?= =?us-ascii?Q?Op+zsS3vM+oqmXkvwSgpkohpW0Zq+TArIkDpLP50TPn9e77cUV2F3EHW49Zl?= =?us-ascii?Q?7LuQ7RoCF6ZnHTZLGMIuO6L7tsAsKSQ5SPGA8qOPJgUrXAOXqUiBtxEYCr2P?= =?us-ascii?Q?QZit0VkevuuxPR9jo69NNzEcxk2kERcxPXRqJxUTWjLDCaM8k17PY8/fL1qS?= =?us-ascii?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E?= =?us-ascii?Q?j18ad1pvel/d+OncBUzMZWUf/MXFA4Eq/XPKQ7OPmXh/NUSqOT6FzaNsU0XF?= =?us-ascii?Q?SKyaTCyKnazBYOEA1sdtl9J6LS0wTYQo9wMqNUqqsptdM3rJhjzJzpNsRbwi?= =?us-ascii?Q?o363NadOwJ5TPsEKXfFGS7Kfs4VDnpgWUc5TE6blXJnX3H+BxkD3ABY6xOYf?= =?us-ascii?Q?HxjQ0t2BBKOYZzpIoyG1SIdzJbDZ88X3S5VjziD/ZhbfKQQqRmaJ5C4MGKVm?= =?us-ascii?Q?+Xc6sHI8BN/vWjFmAlMFqCA26SESsMYHLvF17eZ/aFAzCDxNBaVTki++1Oxp?= =?us-ascii?Q?9v81xulxl1VgptgalQ76l+U9Q62Q9tjfGT8AFsh4/x2ljf+1ShV8dat7t2UD?= =?us-ascii?Q?nXo5OAt2Q/3qKg2q65pRPMZXEiGPh9pzuLddGDq0gWPzFPYj1flbdOGGEkws?= =?us-ascii?Q?cg=3D=3D?= X-OriginatorOrg: fb.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b6ea093-88cb-4020-6f0e-08da8786e407 X-MS-Exchange-CrossTenant-AuthSource: MW4PR15MB4475.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2022 17:17:44.9280 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V/a4nSz9JN42jdBCzVdTtUxE79ne0YFDqsD7SkcmFLVaRSwOmqfwCKJ0BUAZgKPx X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR15MB4690 X-Proofpoint-ORIG-GUID: OWE43n6iKADVexSylntR9zlFJyaPF2Tu X-Proofpoint-GUID: OWE43n6iKADVexSylntR9zlFJyaPF2Tu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-26_09,2022-08-25_01,2022-06-22_01 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Fri, Aug 26, 2022 at 12:13:54AM -0600, James Hilliard wrote: > On Thu, Aug 25, 2022 at 11:49 PM Martin KaFai Lau wrote: > > > > On Thu, Aug 25, 2022 at 11:31:15PM -0600, James Hilliard wrote: > > > On Thu, Aug 25, 2022 at 11:16 PM Martin KaFai Lau wrote: > > > > > > > > On Thu, Aug 25, 2022 at 04:17:49PM -0600, James Hilliard wrote: > > > > > There is a potential for us to hit a type conflict when including > > > > > netinet/tcp.h with sys/socket.h, we can replace both of these includes > > > > > with linux/tcp.h to avoid this conflict. > > > > > > > > > > Fixes errors like: > > > > > In file included from /usr/include/netinet/tcp.h:91, > > > > > from progs/bind4_prog.c:10: > > > > > /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:34:23: error: conflicting types for 'int8_t'; have 'char' > > > > > 34 | typedef __INT8_TYPE__ int8_t; > > > > > | ^~~~~~ > > > > > In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, > > > > > from /usr/include/x86_64-linux-gnu/bits/socket.h:29, > > > > > from /usr/include/x86_64-linux-gnu/sys/socket.h:33, > > > > > from progs/bind4_prog.c:9: > > > > > /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:18: note: previous declaration of 'int8_t' with type 'int8_t' {aka 'signed char'} > > > > > 24 | typedef __int8_t int8_t; > > > > > | ^~~~~~ > > > > > /home/buildroot/opt/cross/lib/gcc/bpf/13.0.0/include/stdint.h:43:24: error: conflicting types for 'int64_t'; have 'long int' > > > > > 43 | typedef __INT64_TYPE__ int64_t; > > > > > | ^~~~~~~ > > > > > /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:19: note: previous declaration of 'int64_t' with type 'int64_t' {aka 'long long int'} > > > > > 27 | typedef __int64_t int64_t; > > > > > | ^~~~~~~ > > > > > make: *** [Makefile:537: /home/buildroot/bpf-next/tools/testing/selftests/bpf/bpf_gcc/bind4_prog.o] Error 1 > > > > > > > > > > Signed-off-by: James Hilliard > > > > > --- > > > > > tools/testing/selftests/bpf/progs/bind4_prog.c | 3 +-- > > > > > tools/testing/selftests/bpf/progs/bind6_prog.c | 3 +-- > > > > > 2 files changed, 2 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/tools/testing/selftests/bpf/progs/bind4_prog.c b/tools/testing/selftests/bpf/progs/bind4_prog.c > > > > > index 474c6a62078a..6bd20042fd53 100644 > > > > > --- a/tools/testing/selftests/bpf/progs/bind4_prog.c > > > > > +++ b/tools/testing/selftests/bpf/progs/bind4_prog.c > > > > > @@ -6,8 +6,7 @@ > > > > > #include > > > > > #include > > > > > #include > > > > > -#include > > > > > -#include > > > > These includes look normal to me. What environment is hitting this. > > > > > > I was hitting this error with GCC 13(GCC master branch). > > These two includes ( and ) are normal, > > so does it mean all existing programs need to change to use gcc 13 ? > > Well I think it's mostly just an issue getting hit with GCC-BPF as it > looks to me like a cross compilation host/target header conflict. The users have been using these headers in the bpf progs. The solution should be on the GCC-BPF side instead of changing all bpf progs.