From patchwork Wed Feb 8 18:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrei Gherzan X-Patchwork-Id: 1739608 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=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=P5Xm0W4k; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (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 4PBp6R5pWSz23y7 for ; Thu, 9 Feb 2023 05:14:06 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pPoxA-0006ZF-W1; Wed, 08 Feb 2023 18:13:56 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pPox8-0006Xv-Gx for kernel-team@lists.ubuntu.com; Wed, 08 Feb 2023 18:13:54 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (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 202283F1F3 for ; Wed, 8 Feb 2023 18:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675880033; bh=9bU855fL+GwvjES7edpGUVeJHHa78vBNV5AltZhg7u4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=P5Xm0W4k4gTLuqdqBsmHSzS1dGLos/s3LRiEImYYHNFz4Jq//IE0c2gw6tOA1yjum D5LoZGFOkGWXd4mIhn7rH3jVKOzxtnBzLVScUshosbG8gNRFH5v3vZRRFRui26B72R RibwX0JnArK2X3UfVSHfDDyiCzh1xqLSfqb9dm+rMap5yInxSdoJMOcIhAaeypVNHT Vhs3KZP+AQZyiqhRc8OI0gP6OEyF+VvzbGCP9YTBAvumcF7/6HIz1awzUcNsaRyHrv pluAgcusYiBAnuGOkM1ZjzFPDTMtf3gIe1phnGEO6YECBue/sP9AiGzxojWhRUn37V osqsTiDC1JnfQ== Received: by mail-wr1-f69.google.com with SMTP id v5-20020adf8b45000000b002bde0366b11so3140034wra.7 for ; Wed, 08 Feb 2023 10:13:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9bU855fL+GwvjES7edpGUVeJHHa78vBNV5AltZhg7u4=; b=PWs4vko/Z294CEaRUCupPdxLgc3+gT2LzUDS7xMaheOueJlo2qsm0ThVV4+oFfAUpr BIOkFA0fbOjpIf0ONXDDPy7zmYmcOoIMfk+4AK2tltPe6Wm7VqtJki+JSVQYZ0vosPlu 6S4ZAWlLCvQgRC4N0MJPyHMjeIhyPc2ja7rKkwsA+AV29Xueh18goxFjmGIVFmO3cZ+d KWbSXjY42gVQjcR5l+l1UIaJI9XCAssX5Sh8hhrzGv5ZwM5QKZkb/EJN57vk8ZC5VhG/ qSWs8jAquV4trUmV+RhcTi/3khs3DL9RY6dWUoptffPPl4+IUJkGpzNAAZcmCuDaB2tP jBfw== X-Gm-Message-State: AO0yUKXyER7WmbvNkez5BNV1q82x4abBke8Odjx/FyM/LL5F1h+U5bKn neQpVink+IvApspqenypt+DiHZmaFh/bwvq+w2h0EDwBelXnHzCLU76VHRJU+oSW3by7in6gDB+ tDevkLLZQ2PAhiQWP7y8L66HCKx6Cbc1AWUH4vudf34+wKq8= X-Received: by 2002:a05:600c:13d4:b0:3df:e1e9:200e with SMTP id e20-20020a05600c13d400b003dfe1e9200emr7429064wmg.39.1675880032443; Wed, 08 Feb 2023 10:13:52 -0800 (PST) X-Google-Smtp-Source: AK7set9d6mB7UWcfxyIDydi0+cr69dvzOFP2iISnNLNVGPqQMgyq9yaynBnLc9hFQ/EfwUWJyoeI+g== X-Received: by 2002:a05:600c:13d4:b0:3df:e1e9:200e with SMTP id e20-20020a05600c13d400b003dfe1e9200emr7429053wmg.39.1675880032258; Wed, 08 Feb 2023 10:13:52 -0800 (PST) Received: from qwirkle.internal ([81.2.157.149]) by smtp.gmail.com with ESMTPSA id g16-20020a05600c4ed000b003dfee43863fsm3058136wmq.26.2023.02.08.10.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 10:13:51 -0800 (PST) From: Andrei Gherzan To: kernel-team@lists.ubuntu.com Subject: [SRU][Kinetic][PATCH 3/3] selftests/net: mv bpf/nat6to4.c to net folder Date: Wed, 8 Feb 2023 18:13:38 +0000 Message-Id: <20230208181338.476272-4-andrei.gherzan@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230208181338.476272-1-andrei.gherzan@canonical.com> References: <20230208181338.476272-1-andrei.gherzan@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: , Cc: Andrei Gherzan Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Hangbin Liu BugLink: https://bugs.launchpad.net/bugs/2000708 There are some issues with the bpf/nat6to4.c building. 1. It use TEST_CUSTOM_PROGS, which will add the nat6to4.o to kselftest-list file and run by common run_tests. 2. When building the test via `make -C tools/testing/selftests/ TARGETS="net"`, the nat6to4.o will be build in selftests/net/bpf/ folder. But in test udpgro_frglist.sh it refers to ../bpf/nat6to4.o. The correct path should be ./bpf/nat6to4.o. 3. If building the test via `make -C tools/testing/selftests/ TARGETS="net" install`. The nat6to4.o will be installed to kselftest_install/net/ folder. Then the udpgro_frglist.sh should refer to ./nat6to4.o. To fix the confusing test path, let's just move the nat6to4.c to net folder and build it as TEST_GEN_FILES. Fixes: edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests") Tested-by: Björn Töpel Signed-off-by: Hangbin Liu Link: https://lore.kernel.org/r/20230118020927.3971864-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni (backported from 3c107f36db061603bee7564fbd6388b1f1879fd3 net-next) [agherzan: This change merges the bpf Makefile into the main net Makefile where more tests were added in the meanwhile. The backport consisted only in matching the current state of these tests in the TEST_GEN_FILES and OUTPUT sections.] Signed-off-by: Andrei Gherzan --- tools/testing/selftests/net/Makefile | 50 +++++++++++++++++- tools/testing/selftests/net/bpf/Makefile | 52 ------------------- .../testing/selftests/net/{bpf => }/nat6to4.c | 0 tools/testing/selftests/net/udpgro_frglist.sh | 8 +-- 4 files changed, 52 insertions(+), 58 deletions(-) delete mode 100644 tools/testing/selftests/net/bpf/Makefile rename tools/testing/selftests/net/{bpf => }/nat6to4.c (100%) diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index db05b3764b77..b79a9ab94c04 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -59,14 +59,60 @@ TEST_GEN_FILES += toeplitz TEST_GEN_FILES += cmsg_sender TEST_GEN_FILES += stress_reuseport_listen TEST_PROGS += test_vxlan_vnifiltering.sh +TEST_GEN_FILES += nat6to4.o TEST_FILES := settings KSFT_KHDR_INSTALL := 1 include ../lib.mk -include bpf/Makefile - $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma $(OUTPUT)/tcp_mmap: LDLIBS += -lpthread $(OUTPUT)/tcp_inq: LDLIBS += -lpthread + +# Rules to generate bpf obj nat6to4.o +CLANG ?= clang +SCRATCH_DIR := $(OUTPUT)/tools +BUILD_DIR := $(SCRATCH_DIR)/build +BPFDIR := $(abspath ../../../lib/bpf) +APIDIR := $(abspath ../../../include/uapi) + +CCINCLUDE += -I../bpf +CCINCLUDE += -I../../../../usr/include/ +CCINCLUDE += -I$(SCRATCH_DIR)/include + +BPFOBJ := $(BUILD_DIR)/libbpf/libbpf.a + +MAKE_DIRS := $(BUILD_DIR)/libbpf +$(MAKE_DIRS): + mkdir -p $@ + +# Get Clang's default includes on this system, as opposed to those seen by +# '-target bpf'. This fixes "missing" files on some architectures/distros, +# such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc. +# +# Use '-idirafter': Don't interfere with include mechanics except where the +# build would have failed anyways. +define get_sys_includes +$(shell $(1) $(2) -v -E - &1 \ + | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ +$(shell $(1) $(2) -dM -E - &1 \ - | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ -$(shell $(1) $(2) -dM -E -