From patchwork Thu Jul 11 08:09:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 13730145 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E29A14F9EA; Thu, 11 Jul 2024 08:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720685424; cv=none; b=FZPt9KgYUopGeKFPLc2kVbItSO3HeZVZDmW1aeAzMpPyVs+NQpCnQpr6oeWihAE7OhVjz0pEy4EFSuohDGTBZWO+9mRTSMP0+n4MBUWbgune3XMtKhCZ3uAOUOfkXIqAl86pT1Y2fyqmaKNxM0KO3st6rsqARJib7YvNjgs7Ukc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720685424; c=relaxed/simple; bh=mPMPaJ6NYfMmkWphAj5c1fFz2osmjYrh6VBnh5A4vaI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fV8yFp5Pr6W+LlU4Augkvw+im5ekXZRev88a+EHIvoOAkakArmZtxbgBBmecrdeKL9F+oovrvCv/vBytRetO1TJar+Gyy6Rezd0F3Dn30eLAzVYgy3BvHCUcY8hSZbOiMlgEpPcM3J3vh80DEntEsV/2JT64mgTz/FdiHGB/Bfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=DSScV/HK; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="DSScV/HK" Received: by mail.gandi.net (Postfix) with ESMTPSA id 841FDE000A; Thu, 11 Jul 2024 08:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720685414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0P6tXzN3Sz5qeahHtMUGfew6mwqB6sS+9QsEJKqfUOw=; b=DSScV/HKeEQ8mt46ZEiHHmLUH2nQGNXvETvlqTqrXhgpARnkF08xTPJqxZa6W7sSO0yW29 GlrjoqqRKAgGCpvax3Q+BUZiCAt6LDSc8QfhJMg4PF263lIRQDWDXDrtyoZ/CJQMNTlEhQ C/kIa7g/GSArm4VEbSfHMC74JII1USYBx+ArtF43OXfYVSn5qJWuK+/st5Eo84lcTJoOCD S2Q+eCOyo2MpLormold2Of1MyRDj20fO8L6FmFCqErhb7ZS8QThZEthNwMk5aLEyOtwYOf 4QqniksEKP28Hnxtz8s8lUPukDtAhDpzE30Brd70nSi441CkK61DPfjSi55ExQ== From: =?utf-8?q?Alexis_Lothor=C3=A9_=28eBPF_Foundation=29?= Date: Thu, 11 Jul 2024 10:09:34 +0200 Subject: [PATCH 1/3] selftests/bpf: update xdp_redirect_map prog sections for libbpf Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240711-convert_test_xdp_veth-v1-1-868accb0a727@bootlin.com> References: <20240711-convert_test_xdp_veth-v1-0-868accb0a727@bootlin.com> In-Reply-To: <20240711-convert_test_xdp_veth-v1-0-868accb0a727@bootlin.com> To: Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan Cc: ebpf@linuxfoundation.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , =?utf-8?q?Alexis_Lothor?= =?utf-8?q?=C3=A9?= X-Mailer: b4 0.13.0 X-GND-Sasl: alexis.lothore@bootlin.com xdp_redirect_map.c is a bpf program used by test_xdp_veth.sh, which is not handled by the generic test runner (test_progs). To allow converting this test to test_progs, the corresponding program must be updated to allow handling it through skeletons generated by bpftool and libbpf. Update programs section names to allow to manipulate those with libbpf. Signed-off-by: Alexis Lothoré --- tools/testing/selftests/bpf/progs/xdp_redirect_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/xdp_redirect_map.c b/tools/testing/selftests/bpf/progs/xdp_redirect_map.c index d037262c8937..682dda8dabbc 100644 --- a/tools/testing/selftests/bpf/progs/xdp_redirect_map.c +++ b/tools/testing/selftests/bpf/progs/xdp_redirect_map.c @@ -10,19 +10,19 @@ struct { __uint(value_size, sizeof(int)); } tx_port SEC(".maps"); -SEC("redirect_map_0") +SEC("xdp") int xdp_redirect_map_0(struct xdp_md *xdp) { return bpf_redirect_map(&tx_port, 0, 0); } -SEC("redirect_map_1") +SEC("xdp") int xdp_redirect_map_1(struct xdp_md *xdp) { return bpf_redirect_map(&tx_port, 1, 0); } -SEC("redirect_map_2") +SEC("xdp") int xdp_redirect_map_2(struct xdp_md *xdp) { return bpf_redirect_map(&tx_port, 2, 0);