From patchwork Mon Feb 11 12:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 1039762 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=netronome.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="irfIUcv4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43yksf0WcLz9sML for ; Mon, 11 Feb 2019 23:01:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbfBKMBk (ORCPT ); Mon, 11 Feb 2019 07:01:40 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51920 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726391AbfBKMBi (ORCPT ); Mon, 11 Feb 2019 07:01:38 -0500 Received: by mail-wm1-f68.google.com with SMTP id b11so17418678wmj.1 for ; Mon, 11 Feb 2019 04:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ONzJ47QpQVRE/CfF1im4/aJV3p8B9EjrnKc/x/9TVqQ=; b=irfIUcv4hPxnDwfVC53s80aD/Z0D2yKHuUWvgGkjMy8DA962rFzSwo+w91R4Xon2Fw GdKKxpyHvG2/+OxvM1imnZXOCjvguNIc39ttOlIpyonqzOguuwkDe98zDftIy2UBrOXW uyTdDpUAY45ws3DtHKp/W3sWe/Tv7sfZhezme5pUMLGprzSzHdbf/Y/M5OOwaz99T5cL bx0YiCGPPxNvxJEELuMuHilxSkRdpECY24CPnNRwsiVkpBCuckgqz7xRvCRcK2/SYi8d ncrq0MuHKpReBSRWyLFWlH1V05XK/7OC99VqZR3HRMMr3SE1lBAiRWzE4VpVJzdxJ8ve J1DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ONzJ47QpQVRE/CfF1im4/aJV3p8B9EjrnKc/x/9TVqQ=; b=WLEPTFTUY/TtCEPTlP664EM2eznEKEWIOaTY3aG6r0/ZJgKawU0vDdSbD+sscgHsuO eplFxhxw7tmyi6pThtodoXq8IORYvetZYuNxQD54pizvotGXuycXYH/xYk6JJeFJ6OM/ XAGKHASdGxkoMNfe7NW8aYOhk8TS9aTXww1gL+/RMdYjrLJFZAB6O5Mi2usA7mITA+5F 9NfPZIUxj2sx88OpBuYWSMpTyEj3oo9ODKNCTQCYWkN/tgiW3VvhP2o0IMBLlwmhwBa5 SaJ7Ph/cn1G4Qh9Hzp6jKuAm0FeA0kePXrTO9405ELK6JB3OjCmn+XXNAMPg5XKbzzJx QyEg== X-Gm-Message-State: AHQUAubaUlDBeKxt+ylQuxxpCW7a0BcXOieNNFlgl9BYbOwIgZ9UYDIa pmlCzggzZSvnNhTU3xY9SF3hMQ== X-Google-Smtp-Source: AHgI3IZ14xZrubStCINIEMrD6QrQJwL1SQ2gQzA9mjx/C+ZOX3hjFdh0D/1HK3Umd/U9YJsgxkK7bg== X-Received: by 2002:a1c:e10a:: with SMTP id y10mr8954748wmg.73.1549886495746; Mon, 11 Feb 2019 04:01:35 -0800 (PST) Received: from cbtest28.netronome.com ([217.38.71.146]) by smtp.gmail.com with ESMTPSA id i10sm10538805wrx.54.2019.02.11.04.01.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Feb 2019 04:01:34 -0800 (PST) From: Jiong Wang To: alexei.starovoitov@gmail.com, daniel@iogearbox.net Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, Jiong Wang Subject: [PATCH bpf-next v2 2/4] selftests: bpf: extend sub-register mode compilation to all bpf object files Date: Mon, 11 Feb 2019 12:01:19 +0000 Message-Id: <1549886481-25848-3-git-send-email-jiong.wang@netronome.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549886481-25848-1-git-send-email-jiong.wang@netronome.com> References: <1549886481-25848-1-git-send-email-jiong.wang@netronome.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. 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. There were some file duplication inside BPF_OBJ_FILES_DUAL_COMPILE which is removed now. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- tools/testing/selftests/bpf/Makefile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index c7e1e32..f2c1147 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -36,20 +36,14 @@ BPF_OBJ_FILES = \ 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 \ - test_sock_fields_kern.o - -# Objects are built with default compilation flags and with sub-register -# code-gen enabled. -BPF_OBJ_FILES_DUAL_COMPILE = \ - 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 \ + 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 test_sock_fields_kern.o -TEST_GEN_FILES = $(BPF_OBJ_FILES) $(BPF_OBJ_FILES_DUAL_COMPILE) +TEST_GEN_FILES = $(BPF_OBJ_FILES) # 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 @@ -59,7 +53,7 @@ SUBREG_CODEGEN := $(shell echo "int cal(int a) { return a > 0; }" | \ $(LLC) -mattr=+alu32 -mcpu=probe 2>&1 | \ grep 'if w') ifneq ($(SUBREG_CODEGEN),) -TEST_GEN_FILES += $(patsubst %.o,alu32/%.o, $(BPF_OBJ_FILES_DUAL_COMPILE)) +TEST_GEN_FILES += $(patsubst %.o,alu32/%.o, $(BPF_OBJ_FILES)) endif # Order correspond to 'make run_tests' order