Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2228565rdh; Sat, 25 Nov 2023 20:34:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEn//tWGsxXZZ3n5FPN1ma/udFfWdkodEp0NvcdAibdJ47LXHDZUIDNWKIHca4VqSfuaIv5 X-Received: by 2002:a17:903:2346:b0:1cf:c649:529c with SMTP id c6-20020a170903234600b001cfc649529cmr211173plh.18.1700973290387; Sat, 25 Nov 2023 20:34:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700973290; cv=none; d=google.com; s=arc-20160816; b=0ixEV2fIwjdAfaHBDj7jRZJgBrBTi5CJIGCbZWiqCrYLjpxgpoFlpnrW6TpJeCj026 DZZ/0XZ7HTWnRRgD7wb0GKY6KftSfur3s0OUbbYwDAlnkoprn2PxgxJLbUcKhc1xr3s8 9QMdmCF04rPZEhXKnXYfnM7KbI6UlTE7gBe/iulAEBUFiojfvv422KBUuIYuo6sbCFR+ isqQ50I5pZ1LIfopfL7nSOKGFG3YSVd0pFwM1/EdsrkCwjs0vO84V3HDPl0FNKmxANdw XQMfhQ03oCbuw+DXND+il6gOLztGvz66jEPATtZB7HdfpxVZo3VZtFg1syR5//4i6Sdo OsCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=ntRXoWRJb4uUGlWmDeWV4tv5+SsfDee3WWNlUl0hNCM=; fh=2ezzBTQofXr08U85H/QFsMIcr05ZAFVzNZINY+R1jf4=; b=vbgZOZ+FqmNjSpkw6fQRe+x7aMrsQeiwA8fnMB2GHMULXX8OVJaB6LaN4w9HbTny6P t2C7PNr9PkVqtYtYEoJdWsWvjP1TLr4mzI1x7PEu+z3YdSXRX7ZoJYmE6YYmC34yDT/j IJ9jr0Fd7WEHZnK6UrW8imBxCniXFO7drqaw0YgaRGj0EEDskxNzBiNhDgOLQwg0DpI2 nS/ZUXdfq4R+rghIkqC/az6d0gU630THUrJS8TXdWSMJAHvvt/uP160GGe66TVZd4VFO wK2IWcr8NNoRi5P9gkLlG12ckn6518qhCJXMQ03rUaZo9QTOLIoEmNz6xvAInHlCF3mj uUhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=DGUMPjvK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="X/2xbBLc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j4-20020a170902690400b001ce5fce5328si6718227plk.99.2023.11.25.20.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 20:34:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=DGUMPjvK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="X/2xbBLc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C617A805C72A; Sat, 25 Nov 2023 20:34:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230101AbjKZEeb (ORCPT + 99 others); Sat, 25 Nov 2023 23:34:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKZEe2 (ORCPT ); Sat, 25 Nov 2023 23:34:28 -0500 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 786E510D; Sat, 25 Nov 2023 20:34:34 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 2FA34580892; Sat, 25 Nov 2023 23:34:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 25 Nov 2023 23:34:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1700973271; x=1700980471; bh=nt RXoWRJb4uUGlWmDeWV4tv5+SsfDee3WWNlUl0hNCM=; b=DGUMPjvKnI7cJfCzZA wavOFcmQvrABWS14qboN+2+WyqDTo0d5tsIqtxw7HerR7dr07UYAMtHdfszL6UsX 8Jl2wAXaD8ZNqTooBHQfHJA7ivMb/6LP3/EVwn8MzH/Rzdkaj+NUn+dPogdYqGYb 2Up2+DWm6L0Z8Hy88qUPqGUDoEaPc2XpsN/ivnZO6H6f7tQ0xqZlFb3YW3+5aoOq oAQqTe/6va+A5LE+mhav1RoENWzACKenhTC74Sic9vzwO8+WXK3/Thh3CAvY3aFX 9UZPsBLHO4or6xcfVVb5lSwtv93SlePWb4bkrAEr5Bv1fhpsKXiGHJhSVhpXn04J Po1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700973271; x=1700980471; bh=ntRXoWRJb4uUG lWmDeWV4tv5+SsfDee3WWNlUl0hNCM=; b=X/2xbBLcKl45j7AHiUzN//xsKfI2w V74vQeN9TnSyfpV3+0QNswby9mtcxq3qXf+H4TUdRnF0polbKjfR66tyN2v/Hjos M4OiQr5KptrmxuNPnXQAF1ZGtNVoOV+D5KwwklF5pIeTPP8OmRUNt9jHhkEob7TI G5/o+uRKGBOzXsBJSWZTCqK+OMVoZ9Lm/xPTfJd4mppliEFpiDwTD9RZNdVkc6A6 6adjHi/mgZ7KJoBmhWYrlp0sZxr/0jaAAajwQxc07d0n6PVnrPuc1gIvhJ7bxR8m Ovko2P1vExblqKzMOvEX48m6tgd5FMNJHISBAN4epXZA/PH5i7lsbisfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehkedgjeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdfstddt tddvnecuhfhrohhmpeffrghnihgvlhcuighuuceougiguhesugiguhhuuhdrgiihiieqne cuggftrfgrthhtvghrnhepvdefkeetuddufeeigedtheefffekuedukeehudffudfffffg geeitdetgfdvhfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Nov 2023 23:34:29 -0500 (EST) Date: Sat, 25 Nov 2023 22:34:28 -0600 From: Daniel Xu To: Yonghong Song Cc: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, ast@kernel.org, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linux-ipsec.org, netdev@vger.kernel.org Subject: Re: [PATCH ipsec-next v1 5/7] bpf: selftests: test_tunnel: Use vmlinux.h declarations Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 20:34:47 -0800 (PST) Hi Yonghong, On Sat, Nov 25, 2023 at 04:34:36PM -0800, Yonghong Song wrote: > > On 11/22/23 1:20 PM, Daniel Xu wrote: > > vmlinux.h declarations are more ergnomic, especially when working with > > kfuncs. The uapi headers are often incomplete for kfunc definitions. > > > > Co-developed-by: Antony Antony > > Signed-off-by: Antony Antony > > Signed-off-by: Daniel Xu > > --- > > .../selftests/bpf/progs/bpf_tracing_net.h | 1 + > > .../selftests/bpf/progs/test_tunnel_kern.c | 48 ++++--------------- > > 2 files changed, 9 insertions(+), 40 deletions(-) > > > > diff --git a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h > > index 0b793a102791..1bdc680b0e0e 100644 > > --- a/tools/testing/selftests/bpf/progs/bpf_tracing_net.h > > +++ b/tools/testing/selftests/bpf/progs/bpf_tracing_net.h > > @@ -26,6 +26,7 @@ > > #define IPV6_AUTOFLOWLABEL 70 > > #define TC_ACT_UNSPEC (-1) > > +#define TC_ACT_OK 0 > > #define TC_ACT_SHOT 2 > > #define SOL_TCP 6 > > diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c > > index f66af753bbbb..3065a716544d 100644 > > --- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c > > +++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c > > @@ -6,62 +6,30 @@ > > * modify it under the terms of version 2 of the GNU General Public > > * License as published by the Free Software Foundation. > > */ > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include "vmlinux.h" > > #include > > #include > > +#include "bpf_kfuncs.h" > > +#include "bpf_tracing_net.h" > > #define log_err(__ret) bpf_printk("ERROR line:%d ret:%d\n", __LINE__, __ret) > > -#define VXLAN_UDP_PORT 4789 > > +#define VXLAN_UDP_PORT 4789 > > +#define ETH_P_IP 0x0800 > > +#define PACKET_HOST 0 > > +#define TUNNEL_CSUM bpf_htons(0x01) > > +#define TUNNEL_KEY bpf_htons(0x04) > > /* Only IPv4 address assigned to veth1. > > * 172.16.1.200 > > */ > > #define ASSIGNED_ADDR_VETH1 0xac1001c8 > > -struct geneve_opt { > > - __be16 opt_class; > > - __u8 type; > > - __u8 length:5; > > - __u8 r3:1; > > - __u8 r2:1; > > - __u8 r1:1; > > - __u8 opt_data[8]; /* hard-coded to 8 byte */ > > -}; > > - > > struct vxlanhdr { > > __be32 vx_flags; > > __be32 vx_vni; > > } __attribute__((packed)); > > In my particular setup, I have struct vxlanhdr defined in vmlinux.h so > I hit a compilation failure. Yeah, saw the same error in CI (the emails are nice btw). Looks like vxlanhdr isn't even being used in this selftest. I've deleted it for v2. Thanks, Daniel