From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C28D5C169C4 for ; Mon, 11 Feb 2019 11:47:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69E672070B for ; Mon, 11 Feb 2019 11:47:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="ZklyvCxW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbfBKLrS (ORCPT ); Mon, 11 Feb 2019 06:47:18 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54261 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfBKLrR (ORCPT ); Mon, 11 Feb 2019 06:47:17 -0500 Received: by mail-wm1-f67.google.com with SMTP id d15so17357620wmb.3 for ; Mon, 11 Feb 2019 03:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TvFG7WgbYE7QUM/XT1LbNhlQBCtMUs0H/eJtSkyf2zY=; b=ZklyvCxW6fwH5gkUJipv2L++iZtJRypjq33Io+aRX71+NAL0cK+IiAf4OJP8DRHaua l3KWygcOESULE/PsMeS3RFiHFkKPOHVNHaENnpuvpvIruaLnrUcXQkbQCJTOi2Iq+uMp hOCC7dWjctkcGBhHrAK8o2MuoVmKqrK5s2PckKKMWWT7CM/39H5tKNWjGVxo/MloOcCx iJbpWrDtLedDX+WSpiyzhugq9PfJT1rx2KlI9Ii1TmVCzn3ne+gPu/vkOAx8lP9J6pTU iIQmSIDKnqAvvHB1m+rLdt0tXXvQSGng+5nkWQ8WzF+302N0JI9fNCuDzu8DTRuGQU4B YV8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TvFG7WgbYE7QUM/XT1LbNhlQBCtMUs0H/eJtSkyf2zY=; b=SZPd7L/YX8E7TNtva161oTGNNYYu8NwsYN67A6Y7tPhSalgRnqPr6FG6RJWITK8DL+ QHyaqWuABcQCiWitk23JEcAxCO+qYZTMvTKF1gn5+0u8X5rlLP4rcpUlD+Ov4M1lAR5y gnxCTCv5J1vUlAHdRO63oH5grlxF1DRaJfTdpiMSw/awsKlErzp5pi9/G7gd2eygY7b1 MH/KfJ4VW0J+gTVc7I8eSbWUPMVHg9RfZqg8zV0VeQqG7CZ7B366WxXupbqicSIOAoyY TpVcj4Ne5xrlJOvHK4yhqxKBC4LVaDb/SRP8POREtue5LDFoMVm5xx/0FG+3RZUtv4ca 6meQ== X-Gm-Message-State: AHQUAuY87nQ8iIuZWJR00XZ8DdnAYdAM5Awl3c4EN/rpZWrDh9bb1EmY Woz50qGxPsMIo9VGi23l7XxOug== X-Google-Smtp-Source: AHgI3IbVjgRZ4C3tpI2SwRrYqdOerxstDvjnla65Bf5MSAguhss8g6ZWY2ULIU7YfewNn9iHkA2EGw== X-Received: by 2002:a1c:5656:: with SMTP id k83mr9147906wmb.125.1549885634644; Mon, 11 Feb 2019 03:47:14 -0800 (PST) Received: from [172.20.1.229] ([217.38.71.146]) by smtp.gmail.com with ESMTPSA id e17sm6196350wrs.79.2019.02.11.03.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 03:47:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH bpf-next 2/3] selftests: bpf: extend sub-register mode compilation to all bpf object files From: Jiong Wang In-Reply-To: <20190211040412.wvulodgvz3jcnida@ast-mbp> Date: Mon, 11 Feb 2019 11:47:13 +0000 Cc: Daniel Borkmann , netdev@vger.kernel.org, oss-drivers@netronome.com Content-Transfer-Encoding: quoted-printable Message-Id: <644AE5C7-8D19-4368-BE5E-459BB7F5A620@netronome.com> References: <1549647681-13818-1-git-send-email-jiong.wang@netronome.com> <1549647681-13818-3-git-send-email-jiong.wang@netronome.com> <20190211040412.wvulodgvz3jcnida@ast-mbp> To: Alexei Starovoitov X-Mailer: Apple Mail (2.3273) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > On 11 Feb 2019, at 04:04, Alexei Starovoitov = wrote: >=20 > On Fri, Feb 08, 2019 at 05:41:20PM +0000, Jiong Wang wrote: >> At the moment, we only do extra sub-register mode compilation on bpf = object >> files used by "test_progs". These object files are really loaded and >> executed. >>=20 >> This patch further extends sub-register mode compilation to all bpf = object >> files, even those without corresponding runtime tests. Because this = could >> help testing LLVM sub-register code-gen, kernel bpf selftest has much = more >> C testcases with reasonable size and complexity compared with LLVM >> testsuite which only contains unit tests. >>=20 >> There were some file duplication inside BPF_OBJ_FILES_DUAL_COMPILE = which >> is removed now. >>=20 >> Reviewed-by: Jakub Kicinski >> Signed-off-by: Jiong Wang >> --- >> tools/testing/selftests/bpf/Makefile | 21 ++++++++------------- >> 1 file changed, 8 insertions(+), 13 deletions(-) >>=20 >> diff --git a/tools/testing/selftests/bpf/Makefile = b/tools/testing/selftests/bpf/Makefile >> index 383d2ff..70b2570 100644 >> --- a/tools/testing/selftests/bpf/Makefile >> +++ b/tools/testing/selftests/bpf/Makefile >> @@ -35,20 +35,15 @@ BPF_OBJ_FILES =3D \ >> sendmsg4_prog.o sendmsg6_prog.o test_lirc_mode2_kern.o \ >> get_cgroup_id_kern.o socket_cookie_prog.o = test_select_reuseport_kern.o \ >> test_skb_cgroup_id_kern.o bpf_flow.o netcnt_prog.o = test_xdp_vlan.o \ >> - xdp_dummy.o test_map_in_map.o test_spin_lock.o test_map_lock.o >> - >> -# Objects are built with default compilation flags and with = sub-register >> -# code-gen enabled. >> -BPF_OBJ_FILES_DUAL_COMPILE =3D \ >> - test_pkt_access.o test_pkt_access.o test_xdp.o = test_adjust_tail.o \ >> - test_l4lb.o test_l4lb_noinline.o test_xdp_noinline.o = test_tcp_estats.o \ >> + xdp_dummy.o test_map_in_map.o test_spin_lock.o test_map_lock.o \ >> + test_pkt_access.o test_xdp.o test_adjust_tail.o test_l4lb.o \ >> + test_l4lb_noinline.o test_xdp_noinline.o test_tcp_estats.o \ >> test_obj_id.o test_pkt_md_access.o test_tracepoint.o \ >> - test_stacktrace_map.o test_stacktrace_map.o = test_stacktrace_build_id.o \ >> - test_stacktrace_build_id.o test_get_stack_rawtp.o \ >> - test_get_stack_rawtp.o test_tracepoint.o test_sk_lookup_kern.o \ >> - test_queue_map.o test_stack_map.o >> + test_stacktrace_map.o test_stacktrace_build_id.o \ >> + test_get_stack_rawtp.o test_sk_lookup_kern.o test_queue_map.o \ >> + test_stack_map.o >>=20 >> -TEST_GEN_FILES =3D $(BPF_OBJ_FILES) $(BPF_OBJ_FILES_DUAL_COMPILE) >> +TEST_GEN_FILES =3D $(BPF_OBJ_FILES) >>=20 >> # Also test sub-register code-gen if LLVM + kernel both has eBPF v3 = processor >> # support which is the first version to contain both ALU32 and JMP32 >> @@ -58,7 +53,7 @@ SUBREG_CODEGEN :=3D $(shell echo "int cal(int a) { = return a > 0; }" | \ >> $(LLC) -mattr=3D+alu32 -mcpu=3Dprobe 2>&1 | \ >> grep 'if w') >=20 > build and test servers can be different. > Would it make sense to use -mcpu=3Dv3 instead of -mcpu=3Dprobe ? Have the same thoughts initially, but was worried the situation where = doing native bpf selftest, build/test on same machine and llvm is new but kernel is = old. I think remove the runtime kernel criteria make sense if for bpf = selftest, separation between build and test server are often, for example cross-compilation = are used. Will add a new patch to make this change. >=20 > Also while testing test_progs_32 fails like this: > libbpf: failed to open ./bpf_flow.o: No such file or directory > libbpf: failed to open ./test_spin_lock.o: No such file or directory > test_spin_lock:bpf_prog_load errno 2 >=20 > Do you see the same ? Hmm, I haven=E2=80=99t see the same. This is expected to happen before = this patch, but should not after. Because bpf_flow and test_spin_lock were added after the = initial JMP32 patch set. Noticed there is patch conflict between this patch and KaFai=E2=80=99s = latest test_sock_fields change. Perhaps this patch hasn=E2=80=99t been applied successfully when = doing the test on your env? Regards, Jiong=