From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C2CC368D4D for ; Wed, 22 Jul 2026 11:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784719224; cv=none; b=UeHujj1/Fj2nDMQqPr8XgmXK4Nh+xisPGydtAP21nmWmYg1OFvtdt6SJ42H7M0N8tG2zB2O3ZNUol9Lbx/thxcK368+GB84oRf9rcUiBcN8HZaX+0M8HXQ4Ojzg7fCHmdpeu+nYJlycf+78RfXsxgRjAALFdzTACPImlfFNTl9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784719224; c=relaxed/simple; bh=DNfsK3Qc4wnPZsEh1/qi+3R4oMemw6sshSP1AuLudMY=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IMwdelR0JLweqKbcppp/SN82WQVQ+5sSxG7crtOqz09ipDESADbqGyHBYDJH+y7iE2ow3fJBPQY/c7msffIuQnzpNoXX1OYWQ9LYD74GyDiRAeCyIATG+QagZhnFsMI5lT+enA45BY4egUINc8YlYeVzDrJ6CFYaXi02A0dSYBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HtQgnd2l; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HtQgnd2l" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-49547fc63a0so27539095e9.2 for ; Wed, 22 Jul 2026 04:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784719221; x=1785324021; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=RmjmwaU2oCm5qiT++FhifaZEeDp06wO3d7kV+FIvU1k=; b=HtQgnd2lzOxrH6bJXgwO6RyLgAcBS/oQ0sz+wNY1JOrmFTg4EctIX0d0oOiZI5g72+ 5Qh4fdmnxkhVrxVu0OOXCYKp9XkCTrmaA9XEk6Xc0mPoRHxKZ0Encouf7IGeY7TiNqxR +cSvgl29bJY1+cb4MvYtjxq0Pgz/lghvAqXM3FLx2es4pxxjK3WEdMWTiamwdWijA+Eo 5jYTWb+hH2jm/F6ZASNasua0QLyxAFAwe+1/8WZ3LPec+gUOVgna07bbGlhCLiisg3rq yB4+0UGXzwuIf6gJK7lHJPLwqQ7LXm+BW4LoeDXhpaTgURe7gCjpLKiF9ZoBYO3NfbOI GfvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784719221; x=1785324021; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RmjmwaU2oCm5qiT++FhifaZEeDp06wO3d7kV+FIvU1k=; b=o1akW4DyaVoGIIeKTIlYtk+sQ/gYg925Nkjl59+iAfWJZay8lhBt3iYyjXiMo0qUbm F2k8FBdq/Ak1gEAC85lfOosiI6HuiDeifksJ2NPXsaEf9dndJeG+ajqtE+aC6/amhORQ Sd0LxUYbiUoUAxRFKQEg2HB9yMMP+KldT7txxKlx1XAgP1cpFFoM3X9yD52pRe+kTw5L bujvqdVkFF6qaW9/oZ5oXa4IDmVX8en0fBkcSCFcZAey3nA1sjfDDh9kdM31yBjQD/NH C5xWTKl1ZeHHy3jkYcqaFbAWkG7ppnZgqMl93WRJWDamJ7AgCwu/M+r9BiO8XLk9zhqQ NnxQ== X-Forwarded-Encrypted: i=1; AHgh+RoSEyhcMi8oUXxTicE14/Z2oRyhLSLiPZkp6QAI6eU045DrRRWuK5mkAZqjnyAX4GPD7CYp0Vhx+7IdcMo=@vger.kernel.org X-Gm-Message-State: AOJu0YzSKO+8/gryP+p3/qrzSpLXVSF/RCtz+DzRhbs1AeSmxIWZEVC3 xADwpxipRtzscRT9t5LnERsfAn94RYtCdOAUwTjcsu9iwOJeccfe54J7 X-Gm-Gg: AR+sD10WOadjfJbHVnFYbySefrK6HC0mdm3Av/md50ZJlZH8AuxNfQc7ZXFCwP2abTw mxt18q9Qbrp6Ladf4pMfQSm7pWHZKU7HBH7PQ1cMIydICLUflGR77t1lyfIdtkb1wOa4BaM7Roo gBCPSUSsuGm2NpYRpzH1rxGJbx2sttAjjCTZ9ovfoR/tBx3/rQKj95f6TjUjtalx7y8RClfssU+ 3tN8aagyMZ1kvwzHhgMi4xkXQ/aoyTuwxR0APUqdHnNOn+9egFdF6YJKhba0tjm8HDUITOur8GJ ozD3MsQHjaJd9lYB6goa05GVOTRLmPX1wdaTscj9H33pzm/ogTDSf4+5Om76xtTTKmNjX5xYGuZ 9lNjvJ0R2Q1x4tHfFirk/ZnJcbo7Ss2X+zGemq3GH4B8Gnd45qcA= X-Received: by 2002:a05:600c:190b:b0:493:c77c:108a with SMTP id 5b1f17b1804b1-4954aa1a10amr243092245e9.36.1784719221270; Wed, 22 Jul 2026 04:20:21 -0700 (PDT) Received: from krava ([2a02:8308:a00c:e200::86b6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85bb57cfsm5095686f8f.11.2026.07.22.04.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 04:20:20 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 22 Jul 2026 13:20:18 +0200 To: Leon Hwang Cc: bpf@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Emil Tsalapatis , Shuah Khan , Jingguo Tan , Pu Lehui , Lin Ma , Maciej Fijalkowski , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-patches-bot@fb.com Subject: Re: [PATCH bpf-next 2/2] selftests/bpf: Verify no warning when close fexit link Message-ID: References: <20260721133036.49265-1-leon.hwang@linux.dev> <20260721133036.49265-3-leon.hwang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260721133036.49265-3-leon.hwang@linux.dev> On Tue, Jul 21, 2026 at 09:30:35PM +0800, Leon Hwang wrote: > Add a test to verify that there's no WARNING when detaching fexit link by > following the repro steps of previous commit. > > Without the fix, the WARNING could be triggered by this test. > > Signed-off-by: Leon Hwang left 2 nits below Acked-by: Jiri Olsa jirka > --- > .../selftests/bpf/prog_tests/tailcalls.c | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > > diff --git a/tools/testing/selftests/bpf/prog_tests/tailcalls.c b/tools/testing/selftests/bpf/prog_tests/tailcalls.c > index c66037162da5..86d87d5817cf 100644 > --- a/tools/testing/selftests/bpf/prog_tests/tailcalls.c > +++ b/tools/testing/selftests/bpf/prog_tests/tailcalls.c > @@ -13,6 +13,8 @@ > #include "tailcall_cgrp_storage.skel.h" > #include "tailcall_sleepable.skel.h" > #include "tailcall_callback.skel.h" > +#include "tailcall_bpf2bpf2.skel.h" > +#include "tailcall_bpf2bpf_fexit.skel.h" > > /* test_tailcall_1 checks basic functionality by patching multiple locations > * in a single program for a single tail call slot with nop->jmp, jmp->nop > @@ -1907,6 +1909,53 @@ static void test_tailcall_callback(void) > RUN_TESTS(tailcall_callback); > } > > +static void test_tailcall_bpf2bpf_fexit_links(void) > +{ > + struct tailcall_bpf2bpf_fexit *skel1 = NULL, *skel2 = NULL; > + struct tailcall_bpf2bpf2 *skel_tc; > + struct bpf_link *link; > + int err, prog_fd; > + > + skel_tc = tailcall_bpf2bpf2__open_and_load(); > + if (!ASSERT_OK_PTR(skel_tc, "tailcall_bpf2bpf2__open_and_load")) > + return; > + > + skel1 = tailcall_bpf2bpf_fexit__open(); > + if (!ASSERT_OK_PTR(skel1, "tailcall_bpf2bpf_fexit__open")) > + goto out; > + > + prog_fd = bpf_program__fd(skel_tc->progs.classifier_0); > + err = bpf_program__set_attach_target(skel1->progs.fexit, prog_fd, "subprog_tail"); > + if (!ASSERT_OK(err, "bpf_program__set_attach_target")) > + goto out; > + > + err = tailcall_bpf2bpf_fexit__load(skel1); > + if (!ASSERT_OK(err, "tailcall_bpf2bpf_fexit__load")) > + goto out; > + > + link = bpf_program__attach_trace(skel1->progs.fexit); > + if (!ASSERT_OK_PTR(link, "bpf_program__attach_trace")) > + goto out; > + skel1->links.fexit = link; nit, you could use skel1->links.fexit directly and remove link > + > + skel2 = tailcall_bpf2bpf_fexit__open(); > + if (!ASSERT_OK_PTR(skel2, "tailcall_bpf2bpf_fexit__open")) > + goto out; > + > + err = bpf_program__set_attach_target(skel2->progs.fexit, prog_fd, "subprog_tail"); > + if (!ASSERT_OK(err, "bpf_program__set_attach_target")) > + goto out; > + > + err = tailcall_bpf2bpf_fexit__load(skel2); > + if (!ASSERT_OK(err, "tailcall_bpf2bpf_fexit__load")) > + goto out; nit, no need to if/goto, just ASSERT_OK would be enough > + > +out: > + tailcall_bpf2bpf_fexit__destroy(skel1); > + tailcall_bpf2bpf_fexit__destroy(skel2); > + tailcall_bpf2bpf2__destroy(skel_tc); > +} > + > void test_tailcalls(void) > { > if (test__start_subtest("tailcall_1")) > @@ -1974,4 +2023,6 @@ void test_tailcalls(void) > if (test__start_subtest("tailcall_cgrp_storage_no_storage_bridge")) > test_tailcall_cgrp_storage_no_storage_bridge(); > test_tailcall_callback(); > + if (test__start_subtest("tailcall_bpf2bpf_fexit_links")) > + test_tailcall_bpf2bpf_fexit_links(); > } > -- > 2.55.0 >