From patchwork Mon Feb 26 10:01:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roxana Nicolescu X-Patchwork-Id: 1904232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tjx4W2xKkz23qG for ; Mon, 26 Feb 2024 21:02:35 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1reXoT-0000DY-MP; Mon, 26 Feb 2024 10:02:21 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1reXoG-00009e-6J for kernel-team@lists.ubuntu.com; Mon, 26 Feb 2024 10:02:10 +0000 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id F08AC3FA63 for ; Mon, 26 Feb 2024 10:02:07 +0000 (UTC) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-5d8bdadc79cso2891443a12.2 for ; Mon, 26 Feb 2024 02:02:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708941725; x=1709546525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=faluWbV9MaRGmE4yYlgUOJebKF/ho+p6oOwd2T6OabE=; b=kthluvXABK/fEMLqyGGCPz/T1kEvVI2yfbDk4pay4FmDS7tMdfclunEzQpAY3FYdrU lElMaQ8xy2h5hWAnFpJcv8kEcSehs3bF0AHzl70nwmCtja0YqAjiaJv7ArfEG+VVBhNZ 1NBjsRFAV0YC33zkpjZmE+CPIxqo60LDbeUgYY9Iu+REwWucwnm/vhDL2S+Zc4RggrHd KAS97BIvvydspL/Wmgby0JjqHUvE43TaiWW8Wpf9u3rRqS1w4JufWm0jQfnVinFbIR7c A6pIaHWbX/rQNmV+iLlDMF/Y1CfQj1ILaC2RWfSvk3xF4o0AqKKeLKHFptty6P4a5Exw T0pQ== X-Gm-Message-State: AOJu0YyzoEeAGTnFOnh71qwRvfC97EUaa2yyqOpHYSBofn9JxatjRDyS P/SfooH6Kzaf/A3NeaVQpFR7itLnQWlptv76XAC9xvogkkPwHLCNTdpysDAIcTYTOHfar+8QpJ1 uhKZQJ3+BM1ikFDoh4QzLNSKA8m6rf9zCRQ4V9iWCiEhklH0Aik6TPHnvgiygqJyxdP8l7Kj2nE MrnXoOykA/P1Z5 X-Received: by 2002:a05:6a20:37a9:b0:19e:cba0:2bd5 with SMTP id q41-20020a056a2037a900b0019ecba02bd5mr5803993pze.27.1708941725692; Mon, 26 Feb 2024 02:02:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeitaEffmHWVxyqYl19qxOJtALfvox/Yx+Pw2sohaigh/ayitKQ+6bw0zlRXNLacnmpNECEA== X-Received: by 2002:a05:6a20:37a9:b0:19e:cba0:2bd5 with SMTP id q41-20020a056a2037a900b0019ecba02bd5mr5803984pze.27.1708941725379; Mon, 26 Feb 2024 02:02:05 -0800 (PST) Received: from work.lan ([2001:67c:1560:8007::aac:c490]) by smtp.gmail.com with ESMTPSA id a25-20020a62e219000000b006e4e600d15esm3597785pfi.160.2024.02.26.02.02.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:02:04 -0800 (PST) From: Roxana Nicolescu To: kernel-team@lists.ubuntu.com Subject: [SRU][J][PATCH 1/1] Revert "selftests/bpf: Test tail call counting with bpf2bpf and data on stack" Date: Mon, 26 Feb 2024 11:01:55 +0100 Message-Id: <20240226100155.31286-2-roxana.nicolescu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226100155.31286-1-roxana.nicolescu@canonical.com> References: <20240226100155.31286-1-roxana.nicolescu@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Samasth Norway Ananda BugLink: https://bugs.launchpad.net/bugs/2054567 This reverts commit 3eefb2fbf4ec1c1ff239b8b65e6e78aae335e4a6. libbpf support for "tc" progs doesn't exist for the linux-5.15.y tree. This commit was backported too far back in upstream, to a kernel where the libbpf support was not there for the test. Signed-off-by: Samasth Norway Ananda Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 62900d358c480b12681a60b0c0f2ff5cd80d630c linux-5.15.49) Signed-off-by: Roxana Nicolescu --- .../selftests/bpf/prog_tests/tailcalls.c | 55 ------------------- .../selftests/bpf/progs/tailcall_bpf2bpf6.c | 42 -------------- 2 files changed, 97 deletions(-) delete mode 100644 tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c diff --git a/tools/testing/selftests/bpf/prog_tests/tailcalls.c b/tools/testing/selftests/bpf/prog_tests/tailcalls.c index 28e30ad4a30e..2e3e525e8579 100644 --- a/tools/testing/selftests/bpf/prog_tests/tailcalls.c +++ b/tools/testing/selftests/bpf/prog_tests/tailcalls.c @@ -810,59 +810,6 @@ static void test_tailcall_bpf2bpf_4(bool noise) bpf_object__close(obj); } -#include "tailcall_bpf2bpf6.skel.h" - -/* Tail call counting works even when there is data on stack which is - * not aligned to 8 bytes. - */ -static void test_tailcall_bpf2bpf_6(void) -{ - struct tailcall_bpf2bpf6 *obj; - int err, map_fd, prog_fd, main_fd, data_fd, i, val; - LIBBPF_OPTS(bpf_test_run_opts, topts, - .data_in = &pkt_v4, - .data_size_in = sizeof(pkt_v4), - .repeat = 1, - ); - - obj = tailcall_bpf2bpf6__open_and_load(); - if (!ASSERT_OK_PTR(obj, "open and load")) - return; - - main_fd = bpf_program__fd(obj->progs.entry); - if (!ASSERT_GE(main_fd, 0, "entry prog fd")) - goto out; - - map_fd = bpf_map__fd(obj->maps.jmp_table); - if (!ASSERT_GE(map_fd, 0, "jmp_table map fd")) - goto out; - - prog_fd = bpf_program__fd(obj->progs.classifier_0); - if (!ASSERT_GE(prog_fd, 0, "classifier_0 prog fd")) - goto out; - - i = 0; - err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); - if (!ASSERT_OK(err, "jmp_table map update")) - goto out; - - err = bpf_prog_test_run_opts(main_fd, &topts); - ASSERT_OK(err, "entry prog test run"); - ASSERT_EQ(topts.retval, 0, "tailcall retval"); - - data_fd = bpf_map__fd(obj->maps.bss); - if (!ASSERT_GE(data_fd, 0, "bss map fd")) - goto out; - - i = 0; - err = bpf_map_lookup_elem(data_fd, &i, &val); - ASSERT_OK(err, "bss map lookup"); - ASSERT_EQ(val, 1, "done flag is set"); - -out: - tailcall_bpf2bpf6__destroy(obj); -} - void test_tailcalls(void) { if (test__start_subtest("tailcall_1")) @@ -885,6 +832,4 @@ void test_tailcalls(void) test_tailcall_bpf2bpf_4(false); if (test__start_subtest("tailcall_bpf2bpf_5")) test_tailcall_bpf2bpf_4(true); - if (test__start_subtest("tailcall_bpf2bpf_6")) - test_tailcall_bpf2bpf_6(); } diff --git a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c deleted file mode 100644 index 41ce83da78e8..000000000000 --- a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include - -#define __unused __attribute__((unused)) - -struct { - __uint(type, BPF_MAP_TYPE_PROG_ARRAY); - __uint(max_entries, 1); - __uint(key_size, sizeof(__u32)); - __uint(value_size, sizeof(__u32)); -} jmp_table SEC(".maps"); - -int done = 0; - -SEC("tc") -int classifier_0(struct __sk_buff *skb __unused) -{ - done = 1; - return 0; -} - -static __noinline -int subprog_tail(struct __sk_buff *skb) -{ - /* Don't propagate the constant to the caller */ - volatile int ret = 1; - - bpf_tail_call_static(skb, &jmp_table, 0); - return ret; -} - -SEC("tc") -int entry(struct __sk_buff *skb) -{ - /* Have data on stack which size is not a multiple of 8 */ - volatile char arr[1] = {}; - - return subprog_tail(skb); -} - -char __license[] SEC("license") = "GPL";