From patchwork Thu Jun 8 16:38:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272599 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 767C0174F5 for ; Thu, 8 Jun 2023 16:39:16 +0000 (UTC) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 393173596 for ; Thu, 8 Jun 2023 09:38:56 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-30e412a852dso629333f8f.0 for ; Thu, 08 Jun 2023 09:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242333; x=1688834333; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Uw4JCOlggtaSPwBTDTjp07y/EtwINur5skPlUaghmwA=; b=7f/9tOEXwXQllKsibzf7pBBpDrRxyepaLdPYMWKrNI+nUAC2S2heOkLiE8b1golsfi /3y5yT7tEVpuby2LSMdNeK3M5Ok4gYfW2vUkCBjUSYPvID/C0RulqBL7klbMCSR0QV+F DrqKWN58R/d15SS9BKYpOIy/j/Gasaz6ggF3tSetbdtqzO0zSIibgMuhjmFjsLMjUj7M oJC2TKJTGHagvhcmx4lujd7M1yDR3zstbvHi54nqFMcMzyxbYNy72WbAlCHUOu5kgIch NlD699UAwPFamOenwsp1Dsv7Nv/oHI/sZRl1I9BRe0TwvLbUnPuV9rhFqtp4Bvv+yXIo 47cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242333; x=1688834333; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uw4JCOlggtaSPwBTDTjp07y/EtwINur5skPlUaghmwA=; b=Dl2PcgPp9nh5QZFBj3UHNPEIBBR/kYc319Dd4WQxo2fyaJjBFC1LfTDp4q+USWhlhW zfB6Ee6OfHxOgkJnWH+AVxR9UXnKeLMKBbqnrdOSvku47DqZ+5otsJf2ejdldA6mpQRV HWtucqr4weANdGcZz6Iyqh3JiwMO3by6akl5J9GI8wmqmuZ5dpUs4wXZgYXBAYUxaglz aDofCBLwizxapVOHfwD04b+jy+dmqsbj9qO4cG9vSZHUKlLIlAe/3sXgeCd3oq48T9y0 K5KEGGbTJIZaB+MyQm7NEkIqA9Ayql1h5vkR3ChNgYZmTBsLFu4LNzNK/GNPzCepK/7Y SuSw== X-Gm-Message-State: AC+VfDwZBFCIFo3EXKeGAQe043OwL9hO8fhYuj1Klg3dcP8yGv2vDs6g +IFcN+F8FMlnsgptE3mIJdObBQ== X-Google-Smtp-Source: ACHHUZ5v1EQxmdq5Wru7kw4Z39LM+198M8ioOAVIaKEJnfkNxZ86ROj4YT9I982x0uPwVAA+mFTVSw== X-Received: by 2002:a5d:4538:0:b0:306:368d:8a1c with SMTP id j24-20020a5d4538000000b00306368d8a1cmr6731624wra.45.1686242333282; Thu, 08 Jun 2023 09:38:53 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:52 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:43 +0200 Subject: [PATCH net 01/14] selftests: mptcp: lib: skip if missing symbol Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-1-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2475; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=d9kMX7C5QhFsCiyZaTdMhXR8W0fg17bpTpuLqXSu/Go=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZth7JIHgU9JOMhTUTPn5Xm/sA0h+5GLjjs zo69zq3rb6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c9g4EADCNFnAktQKkp9vmKC6KoWHc9kkDX8zDn8jFhjyHrn2BcXD6RHrl4cTuG2SJABsK1sKMOw Q60U3F6cScwWpZs1v9bUKs7hdT8oACQSdepJ7ZS3DWS2aZhXk+lsbLfgIbO5ZKngjvHjTMK4tAs /GALvC1gYpPIJ9HYSpH3tDD6XcSJo42uR/n/2QaR7q0vTvX+gL/wJocZM2XZfpt9iNO3DCdJ9s5 nL8uGTybl/zZ0kRLTXtn7h0JTEvhF4QSzWH66aLBEi7V9uxclPliIVJwBrFSGbC5RfzAjRKbdmP BPz61HpXNXhC46U9RjaJGr+0oFGalFM7BkLUrwb93LiznEhKGe4ICNwjcQa1GcMbVf9BW5wb0MN PQFJeMqWtl8XQr7KeF8mhdE8kjbuoCDaDowKvgaDMTfqa1aLioN8Sp5ASWH/RihWKHQEXzt/OP8 veqC6Lsalwg6IeABME8tTQMaFd5gEDxVGSd+tOeUA4WyBPu+RbcptFxvROCf7qOms4/EXhglVTt LkuLVIdW4bJBKxBjACTSmFvDJFSpJ6RsnDtGxr0EEUFuIKTC5O1htzbrCsPkyvrw6ToiGEuojUU KEO7TsFSuYcmZ5OBFzlNqsi72+bKOZS/aGaXHK2OuFYkOXNnJaE4DFg2zRypcRoHYnlbAUUNux1 rMP5xwNib7xhs3g== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. New functions are now available to easily detect if a certain feature is missing by looking at kallsyms. These new helpers are going to be used in the following commits. In order to ease the backport of such future patches, it would be good if this patch is backported up to the introduction of MPTCP selftests, hence the Fixes tag below: this type of check was supposed to be done from the beginning. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/config | 1 + tools/testing/selftests/net/mptcp/mptcp_lib.sh | 38 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/config b/tools/testing/selftests/net/mptcp/config index 38021a0dd527..6032f9b23c4c 100644 --- a/tools/testing/selftests/net/mptcp/config +++ b/tools/testing/selftests/net/mptcp/config @@ -1,3 +1,4 @@ +CONFIG_KALLSYMS=y CONFIG_MPTCP=y CONFIG_IPV6=y CONFIG_MPTCP_IPV6=y diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 3286536b79d5..29b65f4b73b2 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -38,3 +38,41 @@ mptcp_lib_check_mptcp() { exit ${KSFT_SKIP} fi } + +mptcp_lib_check_kallsyms() { + if ! mptcp_lib_has_file "/proc/kallsyms"; then + echo "SKIP: CONFIG_KALLSYMS is missing" + exit ${KSFT_SKIP} + fi +} + +# Internal: use mptcp_lib_kallsyms_has() instead +__mptcp_lib_kallsyms_has() { + local sym="${1}" + + mptcp_lib_check_kallsyms + + grep -q " ${sym}" /proc/kallsyms +} + +# $1: part of a symbol to look at, add '$' at the end for full name +mptcp_lib_kallsyms_has() { + local sym="${1}" + + if __mptcp_lib_kallsyms_has "${sym}"; then + return 0 + fi + + mptcp_lib_fail_if_expected_feature "${sym} symbol not found" +} + +# $1: part of a symbol to look at, add '$' at the end for full name +mptcp_lib_kallsyms_doesnt_have() { + local sym="${1}" + + if ! __mptcp_lib_kallsyms_has "${sym}"; then + return 0 + fi + + mptcp_lib_fail_if_expected_feature "${sym} symbol has been found" +} From patchwork Thu Jun 8 16:38:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272600 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 5029C17AC1 for ; Thu, 8 Jun 2023 16:39:19 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5610130C2 for ; Thu, 8 Jun 2023 09:38:59 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30e57e0a0c7so645793f8f.2 for ; Thu, 08 Jun 2023 09:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242334; x=1688834334; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vCtw9PrOLNArcQLmhG5Q8vIjJqO0AaB9WueRBaBXF60=; b=tXL/drIY7f3MtCB92yRvPxZ9xCTaX0hOPfRz/rUAvsHx53Ajafcx8IOWAIXRnATmx5 EBeRncwYce2/jEJsdbzeRIrK2fx/CZ+zIMMjt+gYCPXx3A6MWLhgG+75HI6WROhbMpF/ 0ITsOD0V79rA0GHdCoo3xIhpEMebXSJBLNJg0nKjza35dwXFC5ZGaoX5ONDQr/lg+ktC uPGa10QJKS3WdBp/UxUEp17BdiE/zgyV8BFPP2SSMfHJ4q9wezcj2bOfGxCB6Gfmp4qB cGzzra29qUE5b2qEWCD4hy2razKzweTSpRZlzT01Vy9tonmPq54hGIwnWCkfj1DK41Ta er0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242334; x=1688834334; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vCtw9PrOLNArcQLmhG5Q8vIjJqO0AaB9WueRBaBXF60=; b=jS59caGQwJRrfCvn3hUrhr3JFDwOcRmEcqqJBtpNJG2lhcdM/r2Kq5FF5zhGxGprsl WGBdRLU6KCDc0aZWvWXHrl5blwojVjt4orPRrYOBvO+0XXhvE7lHS/IEaJnxxBRcYI86 Dp6sM7OLBnUqmFlONqiztz3uE+ptueN7CvWWDAdOHo1ITv0nt3ZwFGCATVtqxYrfje9c VdhoIVgKvHGQZVrSfaa+aPjr+FV9bFaRuoPUDLG5nBaB+5I62aJ5VE0ZfvKEzVSyDvas A7BKiQqBhN7Zo6ndRuveYT+QiE2EL9uaxPbBbQv8g+iI92MZr5OT+LAGdF1wpX1M+BkJ yuEQ== X-Gm-Message-State: AC+VfDxQI/mp9eoEhcQorpRtks844h8NQ9gCxWhagl0DMCb6krUUGPZs QnqFXHSxKNnxKmWrnMluLCPrSQ== X-Google-Smtp-Source: ACHHUZ6UYtkV/BRN58QcXvsxCkID55O4V7in4RcbVabEQQjQB5KY5QZfk9kaARtgpAXOPbdY1XoOrw== X-Received: by 2002:adf:fccf:0:b0:309:5068:9ebe with SMTP id f15-20020adffccf000000b0030950689ebemr6705019wrs.50.1686242334665; Thu, 08 Jun 2023 09:38:54 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:54 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:44 +0200 Subject: [PATCH net 02/14] selftests: mptcp: connect: skip transp tests if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-2-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1974; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=R/V9S3P7iUXd6JZdAlgHifqyiG2/fdAKNW6ncrS04vo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZ+289JuG8nUU0lVwm58ouXSZYgDPVcbH/c KhcDv70cLmJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c8d9D/9H5uHAzLzmBYQN1zmUUbrX52oDu3mMYbl269BVrbFew7wuA+Sv/+1Qf4YdLV8h9/FlmAB cVr6fplajCSksF2IVxrjpkS8593uJqyW8sP1bMDm7BVwg+DfqtrAuXTs3LPSgyw7mdyR+PyuDvq RC7bFC9eT5yoETH6G9ZawftQBs7YEcPdTSgFJsvUrqkrELHljjyg2SQn6os38Ts1avKQBvV5vOP 0mgePIFX+gX3neoTW3QDZphMcrEKTe//SW2nAAfoWQVQkMdI50uuHV2wrApQ2zNU781VJnkAC08 2uvdnJWRK02wJRaTuVOnLpx8Yx7DvsQ61yRLHZI9A0p0El+7GDlvZJxVoWYmGs/2cHNG6/4+e0U 4bFZzNJdMFHm+MUKlUViD4DLvLGtjUALsc/i9BCldJeiwIPby5DeKGYe2Wo3CuTf6prJW406wW6 FviBYmDijhnZzQRf888m1B3ZKUDkH1BRz1hpO4voot3exqnspAUIBk5h3ya8MuQ/zdsaYU0ox08 qjSXqwsspyJ+XizgUzs9T/06oa2+wpsYJ5RajT+ufLzatuqUEc6NzHXscjifeb/tEfuLvFrWOZH 2CF1DoL4QyfCcR8kM0qocA/ifR5kRU6nZFVOoKuWIhmmIkDg/VpMkTP+aXvRK1EZ+pUCjSkONfF 62sCTo+HrCETciw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the support of IP(V6)_TRANSPARENT socket option with MPTCP connections introduced by commit c9406a23c116 ("mptcp: sockopt: add SOL_IP freebind & transparent options"). It is possible to look for "__ip_sock_set_tos" in kallsyms because IP(V6)_TRANSPARENT socket option support has been added after TOS support which came with the required infrastructure in MPTCP sockopt code. To support TOS, the following function has been exported (T). Not great but better than checking for a specific kernel version. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 5fb62e9cd3ad ("selftests: mptcp: add tproxy test case") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index c1f7bac19942..f9c36c6929cc 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -144,6 +144,7 @@ cleanup() } mptcp_lib_check_mptcp +mptcp_lib_check_kallsyms ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then @@ -695,6 +696,15 @@ run_test_transparent() return 0 fi + # IP(V6)_TRANSPARENT has been added after TOS support which came with + # the required infrastructure in MPTCP sockopt code. To support TOS, the + # following function has been exported (T). Not great but better than + # checking for a specific kernel version. + if ! mptcp_lib_kallsyms_has "T __ip_sock_set_tos$"; then + echo "INFO: ${msg} not supported by the kernel: SKIP" + return + fi + ip netns exec "$listener_ns" nft -f /dev/stdin <<"EOF" flush ruleset table inet mangle { From patchwork Thu Jun 8 16:38:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272601 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 E424517AC1 for ; Thu, 8 Jun 2023 16:39:20 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D249359C for ; Thu, 8 Jun 2023 09:39:00 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30af20f5f67so837184f8f.1 for ; Thu, 08 Jun 2023 09:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242336; x=1688834336; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3pKdEbukEA9wOHrFUgiYXVQj+yJNTo3IznsPdW4CCZs=; b=70KA64TSRhWJ4T90MG2iHcjb3Zi3RFeXaht1Lf1EEtjdE9WlKyq2714iztw+/nGJeV c8AUU5Ba5YyuRguUjQL9vxdFBQhW0nKokhL0C0/OVMySpo3PZ+drHqjZA6Z3TuphZKWH e6MzQgH2KtlEHOVDIJN3tV3AlH9V6SACDCM9o09BcudkRO1woTyp9ZBprJy5bkxGAqMg HFRf5dgU4bRRIjgkzbRg/yJcEs1rMBotUSm2ZnAuShAWbM8960PR+MlkNxBgH7SD1SWV sv3Mwv2WD1oMZr288mNpzmRzzv+gwhb6Gs17Y2o7uAK38LE9eY3Wx3O75h+wkGQ/Rg3q LKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242336; x=1688834336; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3pKdEbukEA9wOHrFUgiYXVQj+yJNTo3IznsPdW4CCZs=; b=bpevnltNViADaPyZxSbWv3a+FqRJUuOopbd1tU3CZUdZnADOs0uAAFI+RBe5k+sxCw o9m1KkTqD8H9XT6d+8QUiX2KCgX/2spoerq5wDKu8n+DSZJtdAQde9ZzZiJa8r4olcR3 FDBOPsFv0dFO2OnQj1yX1s4r7Liqri4zV/lXqcs2OaCl3SiWcL+fcIfm0bppiFQmMQGY PHI6M4apZY3bRWTuguNodO6+PoRNIZeAOtZTlkyj90ORJBCvePtftfSuxLiFC4ZmVHo8 wFGnLJQamSoon3+LqzPxiHZK3OwVV9aaNYgSG7h313JvCw+vZpkrmsuzawtero5AQ0Et lcmg== X-Gm-Message-State: AC+VfDxu7uUjnguaQOlLF1Rn2Qa3oypi9oFI3NyYZu0mDriC6oZVNe7G ayZhxuahqbUy2sFGl1jKg+fkTA== X-Google-Smtp-Source: ACHHUZ7LFg83lJitnPpbKmdUbO1JdjuYAV0sJIIUNitB3YJVh/LJvrCyTbEfaTniFgABpB9mrYUZtg== X-Received: by 2002:adf:cd8f:0:b0:307:a52c:26b4 with SMTP id q15-20020adfcd8f000000b00307a52c26b4mr7653582wrj.66.1686242335891; Thu, 08 Jun 2023 09:38:55 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:55 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:45 +0200 Subject: [PATCH net 03/14] selftests: mptcp: connect: skip disconnect tests if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-3-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1360; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=SSoDnMmEl+pZEVoxZerlus09SVoahC8r5yKSBz8cTUI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZQVS717uvTyZWy2u8rtgcAqqdKmNxlD+z6 B+jLTuc0yaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c1FGD/9ddiKh4tHtz6ADpgl+xu8AGJPLieuIMGl9OK2GRXKRRNlIQxqEUHKz+rDp43krnh4jwUC AN97ZLs6xHqne9Ovt4ymciq8nY8knbogUSHvF4wyYuN7Dacx32RGMUcaNUj7/b5FvQJxOX+/mIb Bj8h/b+MLkdelSNY/y6plEJdbE7Ky1BQlJlPrngZKpBRYhxl6W/I9tPBiKyeJmgkQrM6E8+hvFx HPS5bnKRhZyVq83W/z1IRilZL3uxV0wHhDrLk/TVH+J8rcedEN3wCbcp4RKjOhMBmS2SdKO3Dfk C0qwC0fNfh6wgzhGG6xehEKs1oT4o9kAdqtM/Bd+8vCYF4+nbYVeL4UEANIUUkRGaJkGpS8xE0x uYEezzhYda/2hwdKeICljOUzHs9oNdFjbOrpVSHH43W5HggJfnUSF64nlv48RCXnti/Qdk4w3nC hhMEm2utnQfRzs+wG4nEEGppqZChP0YdCxLeejCr5yWbUk+tKDOnlDgO1Jj7O5mP6vHTh25Yzk6 68/4+JQgeiVdRR3ru3O5UerBsr+d4FCSdmg2dBWKs7+42gxHgOrTTqJnO/LrugyqfAZjK2yo0xZ BJdqui59b4sMXsM0MXP30Y9kFa6GiiKeF8Qi1NcE7CYToVmtUlwzNB5XxpzMI9K8fOD2IiFatA0 zXgFkmBOpN1FN/g== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the full support of disconnections from the userspace introduced by commit b29fcfb54cd7 ("mptcp: full disconnect implementation"). It is possible to look for "mptcp_pm_data_reset" in kallsyms because a preparation patch added it to ease the introduction of the mentioned feature. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index f9c36c6929cc..895114fb6832 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -797,6 +797,11 @@ run_tests_disconnect() local old_cin=$cin local old_sin=$sin + if ! mptcp_lib_kallsyms_has "mptcp_pm_data_reset$"; then + echo "INFO: Full disconnect not supported: SKIP" + return + fi + cat $cin $cin $cin > "$cin".disconnect # force do_transfer to cope with the multiple tranmissions From patchwork Thu Jun 8 16:38:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272602 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 7207318003 for ; Thu, 8 Jun 2023 16:39:21 +0000 (UTC) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB7F35A1 for ; Thu, 8 Jun 2023 09:39:00 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30b023b0068so675795f8f.0 for ; Thu, 08 Jun 2023 09:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242337; x=1688834337; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=W8fna5vAfprlhMtgok8TsdPxk4+XnGn2xwviFFs33yA=; b=WjO95Uf8AXRZTgpmN0MrSemNy88XXAN9Yk9p2wn1WqhQZBDRPbXKGIoeCTflOlpzD7 oTfas4tuqIXOJ/S7agipjh1KA1+nozfvMysP9Kc+MOCo34ut2xf5Maw7usiwaX204l+X BpxdZUX24N5i//2vIGpLjt381/3jf+ShzYWLto7pU00AldqM8QfXM8qQzpaO2zonnwL7 J/93qagNO9dpeFFCaS9mSukB0oDjDbZZVsMPlWUAUY6ueyHM8VLrIKacf5E9fHkl1WJS cbzfRa45Tv21NEGemJEF0qAaJvVBf9M5W5Yl9Xnlw8vY63enauWem++arnmG+kOppux6 Ey9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242337; x=1688834337; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W8fna5vAfprlhMtgok8TsdPxk4+XnGn2xwviFFs33yA=; b=k01F0OtgZBLK8apBRj2eOwO7FxwKqrCBZsFxmP2l6SXCC+TEtFhBhswOXpyY64/CH3 e9p7u90boiNVhfXX7VfCIJwHUXhEZ/RAUYvrhRwCNsadAoaAkZ+CtrE20K85ohjhPXDf Qh9HGjRV6TMPOvUW5XqYwVomDmi1Mnrxwrbhxu25R495s5VvGZZ14D3EpVpIfHBGk6wu LQmA0JyTsMsMqrEj7EWrkjLutsS0tlkrVi6vlVgiEVHHeL6ys84TMdRUbAMLUoRmn5Nn dNOpSoNv7k3r5B9hiFecGMaxN2VTUjNgY4Kdtd/xsS5+I1/TnMQD5gw+sxRppuQzSrMC aEFw== X-Gm-Message-State: AC+VfDwwj81iYKi7s3lJQi3yKldOeT3LUzrGfAVF06OtK8h+9jbcZSrW ytftP4GEv1zHYLZIxUATEfau6Q== X-Google-Smtp-Source: ACHHUZ7qQMZsxyPNdRoFPT+JK7h8RzgnXGJX5TEj1DySMBO8nQYkOmQk40GIHbQG+y80B48uf6v17g== X-Received: by 2002:adf:ee12:0:b0:2fe:e455:666c with SMTP id y18-20020adfee12000000b002fee455666cmr1957326wrn.33.1686242337238; Thu, 08 Jun 2023 09:38:57 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:56 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:46 +0200 Subject: [PATCH net 04/14] selftests: mptcp: connect: skip TFO tests if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-4-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1341; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=ungmKl+jPgBUIELXD/hdgwcdNa+5IIbuKeJXRHeksWg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZgRvNNN5VdNCvqhNddhCcd54OxjWj6abwK eeFhezbl4CJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c3p5D/45/+1kAY+ShxGYgWdaJUzHapthY6xFvYQGSwqDpGdNrIaww+42fkLBQtNgpHmdh709Nas 5GM4KPTO3a3QBwl+UWoQd9+3ordpb6kksvUtX50aP4F7k2nl8JllIRTS0rDO7m+egbU4JN1M7n0 6gWPUcw4K2kBvhDpVcEgrmioFGI6O+oj0dBMoOIh92jo5kBXvS7REhtQisFF11B5i3y00QXz1WB d3ZBxpiw5NOHfRasVVsTFUorqgswFOWRm5zQEMMtj3a23aTlBLtPHfajDjwh2ITNco++Lt8cy2f ZIQ1OWtMz/HFVEdabI8Fhvgfq+iSH0roXEnclRnnyQSiL+MtDeflxenuGJyiWBgcn2S8FqACUEu ai8I+3jCE7k+9w352KzzGaAYNlx1li9kRqqll25Mdm9iRW8cxlmhAMMQLdpq7gsskcU9s0Fc8Qu wiYB9AuotY7aR+uJkUnLTMiGA6T8Zu+7e2D+ZXY4xODyRy6WM8cGD+sP5Z8OGtq+oxnwaRGxxDD cY/41eKJTrkPb7mpfWk+z606pENgZ7WhfzC35mVA3LfO3VPlG8awrhRBMLlXWcuSNWwnTodm0+a dcnB9l1eEUCGskXpmxNSqJdd9nqIuz0fQGFsBadsWLMgHpkgvH3cw778jHcBwFFXm1wmuk6FxWe AE/eqCuJHBlXlsw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the support of TCP_FASTOPEN socket option with MPTCP connections introduced by commit 4ffb0a02346c ("mptcp: add TCP_FASTOPEN sock option"). It is possible to look for "mptcp_fastopen_" in kallsyms to know if the feature is supported or not. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: ca7ae8916043 ("selftests: mptcp: mptfo Initiator/Listener") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index 895114fb6832..773dd770a567 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -777,6 +777,11 @@ run_tests_peekmode() run_tests_mptfo() { + if ! mptcp_lib_kallsyms_has "mptcp_fastopen_"; then + echo "INFO: TFO not supported by the kernel: SKIP" + return + fi + echo "INFO: with MPTFO start" ip netns exec "$ns1" sysctl -q net.ipv4.tcp_fastopen=2 ip netns exec "$ns2" sysctl -q net.ipv4.tcp_fastopen=1 From patchwork Thu Jun 8 16:38:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272604 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 DE87E18B00 for ; Thu, 8 Jun 2023 16:39:24 +0000 (UTC) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0F6630E8 for ; Thu, 8 Jun 2023 09:39:02 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30af86a966eso624054f8f.2 for ; Thu, 08 Jun 2023 09:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242338; x=1688834338; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Lx8RcPnsVd4tQ/K/CCVK2jyjdwYbBjaw/JSTSvRmWqQ=; b=uQbFKr4IVFManhEASa1+kCUmK2jgfq7EwASEjIkv9CUL+jFsDhOkBYbVcYUhaRYqp1 +L4y230P4eX3sa/wdNWNrbh9q/IRnIG8gEYmwcOIXxXUgMI9wSAkMGuD/aWTLfpRm0MY w9CyEukdLp/Bjcji9FQCYdFQZOq32d9OBW4NnZXo6bb2JLOFMTAs+zd/U7Jz/3zZUWAO d30GIiEKDUo22bfksyDVkiJIXPhCeAUq6dvK3MVY5DRaJ2fOPTg2PoJShL1bjSNQgbrZ 1kNl8obdM8T7LJKUUALd+EfsAZbTHOw2XkacdCqTAHkdPXGOMeA3e5EjFSYhPSUmqrh4 JkvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242338; x=1688834338; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lx8RcPnsVd4tQ/K/CCVK2jyjdwYbBjaw/JSTSvRmWqQ=; b=Bf1HeTm6p5d/QZZGhZAhkmHCiP6Bivw6ySrXqccaq2hIyMtUPFKlI+2y1tnVKgp0Ai /oUGNBMRphbzc0UaZieaxaqtYj8J0/Lgmn0Hel2tHPmVnhNwiacRJO66XrC4p2RNtUYL 3PeRTZpBQ3hx30qGB5mgH+LHunALumyEsWEcwu2Y2HxDI6mOqpGjojyJKVA6H0YdyY+p b2vt7f4hd62fHe2p8gzbdrPWIPQx9TSxmRhVs0Ar5RQWVbyLKbTh/a5cc9u4OjHNY5Ab 5t/qS1bsovFWwIS1ILKH3z0iI0oEKd8jBQ/3YhywAoPPfc61YH7Ro0iK9+J+agW3e0XT f0FQ== X-Gm-Message-State: AC+VfDyW59tginnGHkVCa07U6txAgrn9+Nf67FAbrQJzMoi4Ye0Xy3kU 4f40Nqjs2qV8mGZvWr8JYuM3Hg== X-Google-Smtp-Source: ACHHUZ5Dk7yiYEDIKc9t4hy5u0PORbw0qZgBFBfIZg0+6XMoeV+zyUzD95h/zc5Fc41tgQUoMEmrXA== X-Received: by 2002:adf:ea91:0:b0:30e:5b10:6ac4 with SMTP id s17-20020adfea91000000b0030e5b106ac4mr4489672wrm.67.1686242338468; Thu, 08 Jun 2023 09:38:58 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:58 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:47 +0200 Subject: [PATCH net 05/14] selftests: mptcp: diag: skip listen tests if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-5-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3556; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=opPOIne3ljEGSqeLiJ1isp//Fw0wv+108k0GKT5anpY=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZ5Cp28T3EpijYaDimGWGlH29vVrPeDSxMO AMRtatqYI+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c0hnEADX7xf/Ss/QTm8ym/KshWMYeE7BirkRZXwJ050WxldqeJEFq8WHIWdWp5QNtLXm/xBq9wk VUQW0dZKdYle2I5x6Bjuqs9an3zHjg2wffDyvzGsP0VApPxJX3w8eB6qaHvOkcQv3xs/ALsvti3 RD6gNNXrGbb5ImETdm+kaE6o7C3CtHgyJTT9axkbOxv1mp9edN5l2n445NMv6LVfSPHmNPCMNOG MmH2OXBTtnjKJWpHzaa87nxznlBJQR/7HTk3Ntub0t0ga0vNa0iifpAvyWo2ThxxjP6MK9rgQEl qKXsHxeVujNhtTAQygQeXltgCDH7rueoYtSS0MXFPFM1G1Zxa8U7W9H2yqc/u2ukSdRA3NThWpr j1sALhQGAx48J2PN7Vc9LltXENRJnNShwOkv+i3cRCxui9dgt1sLeDYzitgdzCeQfFqtLBXLsK+ QKAUKLHXRlLit/WAXXThvKttb2Go4ICvGyEqpPYXYgK3LHRE+MNSnzdoL/jfYMgdlYN/sCit/qa uJWMbH4NWRN/Ve1++iAuHCt4mIxj+F/nja2XenQEcObSnRSF6xEPOSuscaiLwPi0xd/JNP76msB g0CSlMuz/uMVD36+bzHVj1LdZvAIeagFEOBq5uFLqqHOzmo+WZ0EwRh3liAGhFLi5mEMdHDv993 BRNFNDahii3ac2w== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the listen diag dump support introduced by commit 4fa39b701ce9 ("mptcp: listen diag dump support"). It looks like there is no good pre-check to do here, i.e. dedicated function available in kallsyms. Instead, we try to get info if nothing is returned, the test is marked as skipped. That's not ideal because something could be wrong with the feature and instead of reporting an error, the test could be marked as skipped. If we know in advanced that the feature is supposed to be supported, the tester can set SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES env var to 1: in this case the test will report an error instead of marking the test as skipped if nothing is returned. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: f2ae0fa68e28 ("selftests/mptcp: add diag listen tests") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/diag.sh | 42 +++++++++++++------------------ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 4eacdb1ab962..4a6165389b74 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -55,16 +55,20 @@ __chk_nr() { local command="$1" local expected=$2 - local msg nr + local msg="$3" + local skip="${4:-SKIP}" + local nr - shift 2 - msg=$* nr=$(eval $command) printf "%-50s" "$msg" if [ $nr != $expected ]; then - echo "[ fail ] expected $expected found $nr" - ret=$test_cnt + if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then + echo "[ skip ] Feature probably not supported" + else + echo "[ fail ] expected $expected found $nr" + ret=$test_cnt + fi else echo "[ ok ]" fi @@ -76,12 +80,12 @@ __chk_msk_nr() local condition=$1 shift 1 - __chk_nr "ss -inmHMN $ns | $condition" $* + __chk_nr "ss -inmHMN $ns | $condition" "$@" } chk_msk_nr() { - __chk_msk_nr "grep -c token:" $* + __chk_msk_nr "grep -c token:" "$@" } wait_msk_nr() @@ -119,37 +123,26 @@ wait_msk_nr() chk_msk_fallback_nr() { - __chk_msk_nr "grep -c fallback" $* + __chk_msk_nr "grep -c fallback" "$@" } chk_msk_remote_key_nr() { - __chk_msk_nr "grep -c remote_key" $* + __chk_msk_nr "grep -c remote_key" "$@" } __chk_listen() { local filter="$1" local expected=$2 + local msg="$3" - shift 2 - msg=$* - - nr=$(ss -N $ns -Ml "$filter" | grep -c LISTEN) - printf "%-50s" "$msg" - - if [ $nr != $expected ]; then - echo "[ fail ] expected $expected found $nr" - ret=$test_cnt - else - echo "[ ok ]" - fi + __chk_nr "ss -N $ns -Ml '$filter' | grep -c LISTEN" "$expected" "$msg" 0 } chk_msk_listen() { lport=$1 - local msg="check for listen socket" # destination port search should always return empty list __chk_listen "dport $lport" 0 "listen match for dport $lport" @@ -167,10 +160,9 @@ chk_msk_listen() chk_msk_inuse() { local expected=$1 + local msg="$2" local listen_nr - shift 1 - listen_nr=$(ss -N "${ns}" -Ml | grep -c LISTEN) expected=$((expected + listen_nr)) @@ -181,7 +173,7 @@ chk_msk_inuse() sleep 0.1 done - __chk_nr get_msk_inuse $expected $* + __chk_nr get_msk_inuse $expected "$msg" } # $1: ns, $2: port From patchwork Thu Jun 8 16:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272603 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 DE84F182DA for ; Thu, 8 Jun 2023 16:39:24 +0000 (UTC) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73FED30F4 for ; Thu, 8 Jun 2023 09:39:03 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-30ae4ec1ac7so612131f8f.2 for ; Thu, 08 Jun 2023 09:39:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242340; x=1688834340; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=czHHBif6b3JNPCEfCU3p0DvzKEkPWI28pRVwFLD3TEk=; b=75gqNSzuYINuHY5SCr+DHhdj+MkqUn5K3pmF8985c8b8Qmgt1IHJAZJbh3f+fzNMY+ JUtij/ifnHZ1Px7qoQ1wFDKBOqJToPqBdYBS2zGOInSX45sAZYmn2sOZQ7zd17InT0O2 AIAlryytQH9DnHpTSrMJF3xqZe9oT0H0DDff/9wWNrftjM751OclCeRqvFH2bTLCcEbF mWkV7W28ySKLRml85f2ryhONR1gaaW1AniH5+dVoNnB8yUMbjwJ+VRh+2xa/K0HfBncg dQN8umCqv6aPBowj7IRydRJYCEj1ITGy9KeepeK0zmgrV1BdIYcCye4Mav0dmWcqYw8Q axYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242340; x=1688834340; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=czHHBif6b3JNPCEfCU3p0DvzKEkPWI28pRVwFLD3TEk=; b=BH1T4CcSDV1j9EsK3LfNAFt4CoSAqgkrCniK2V1UMab3KoQT5l0G48Ord/+vRMA5Vp fzcG6wswYWFAE1aBrT2DhTJCa2QeuGm2ha+YnMUyh7UJPTUzzzwmHGOCy6iSPuXvedUH T1jtAt8g/Wemyz4GR0gzBIPnQzCHD1NPg1v+TgePBfo6Bc1MMMmWg98H66mvLYcDOrd+ hHNhoY1CHRrQFZ8cPjVeMvWgPXEL3XSDoG4tqW1UaqKKl/tEg5qDllRzsZviv/2G3AwZ XEu5kv/8HZd2wOSxQpvE69B9iqveFOnx8A/yE+QT4f8Ids+AEIe2N7s7ipH/BQYXmrFI kUyQ== X-Gm-Message-State: AC+VfDzXNUOU77b17b+/5lPGKwib2SK/hZRmroMTs/XRwIMGNNSfpOae tsJrriZUD/V6nVmOlL0tY2x0rQ== X-Google-Smtp-Source: ACHHUZ5ejWfNPCf5kv9xyszkDUXkBmsLNfy8THTCbjUhm65isOwsiOMKIa209E2ordVxlqcTIstceg== X-Received: by 2002:adf:f1d1:0:b0:30a:e70d:9e73 with SMTP id z17-20020adff1d1000000b0030ae70d9e73mr7766087wro.33.1686242339908; Thu, 08 Jun 2023 09:38:59 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:38:59 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:48 +0200 Subject: [PATCH net 06/14] selftests: mptcp: diag: skip inuse tests if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-6-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1252; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=GFhSqu6crxevOWFlUMLP/NWLyXtLoglclQ/BPatDiGs=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQZ1TJ6RZ82IXZNGMBvvYLfKUyHoJAZyLbq5 B+55fJO15WJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGQAKCRD2t4JPQmmg c0ogEAC5De1Wak4W2bPErgQJAQgZ7UQe8hoKJnfOsYDzE3i3Q+MZg/KnWX27LHbm+JZ/40ustCj P8Dxhkwbsoi/Y7tLwvwo7IJJ6r8qyHalenDoNywL1J3txjNY7Alj2gXfdaDWB7UoLAsZeqVMlRt 7iMOXgrPaSmP7a5XcfkbZnHoY4LMK11R0pM/VCdorceRiIXRjR7YoQmeX9uS+Kb5439K8HYMkIw wwmNkxywerdfOWOxfhbP/DM+8gp+We9hiEsD5/H4LtjARq3ECjQKniSTYOuSjZ4VlXLxbFNBtZI xyfoP2+Apk14eu85zmXtjIIr3OSkdqtRpatmXGX75Wn9iuR/UI1We3FnK8tTS51boHjruxs94OM YimNcl6q8o+xw5Y/vbUqLv5HZRRl8rG0FXPpE1vujcuW/eL2sHPNxXMvxhqGGcv+08arFHDl9Fi enKjaOXsuArKdRkUK9wB59EFxKRKhkaC6G2c9B3yz0pppGsJAcxSHmx5kpatXekr8xcfSPQv/Rp nOE1oA29xr27XV68cb7o+Whh/4XmNufUM3n8Wp6uympepL4bfuq9l0Nk7woP7MLlgtegmC9HlPc CVL/eGOdPukWMIzEInRCSn7lqYTZ4op2YZUtxsFBE1w8lC9ByYufMkvni19TPmhMiQFtDIUeDFU cLNweqj49lEMGHw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the reporting of the MPTCP sockets being used, introduced by commit c558246ee73e ("mptcp: add statistics for mptcp socket in use"). Similar to the parent commit, it looks like there is no good pre-check to do here, i.e. dedicated function available in kallsyms. Instead, we try to get info and if nothing is returned, the test is marked as skipped. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: e04a30f78809 ("selftest: mptcp: add test for mptcp socket in use") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/diag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 4a6165389b74..fa9e09ad97d9 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -173,7 +173,7 @@ chk_msk_inuse() sleep 0.1 done - __chk_nr get_msk_inuse $expected "$msg" + __chk_nr get_msk_inuse $expected "$msg" 0 } # $1: ns, $2: port From patchwork Thu Jun 8 16:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272605 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 B49CF19922 for ; Thu, 8 Jun 2023 16:39:31 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 355E42D48 for ; Thu, 8 Jun 2023 09:39:10 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30aef0499b6so619259f8f.1 for ; Thu, 08 Jun 2023 09:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242341; x=1688834341; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DG0t6hTRy1TiyueGnVsxEMjDQDrpL785hzWCnX9OzbM=; b=v9od5LLaYjGyBE9sXoa5jMv4GgSBHzi8qzhPbOPMblfJyEoT1Ntk4FeEnl/yQ7csMd tY74qfEBV8O9CBpbNnbHP0adFvE67AxXvEG3wZ8KM3A88BigiySiZSnZ/i9Wbroyx96M 90kDbSTXVgYDcE2ZhZiq2/wUEYbjK44rRfAG1BlhKCAZL9dsuKAUlsF3wj0rTCh2W31R o7xcIJ6EQFbZT2XdJ6CwNaGnKstBh33/mWJ7bDOchCXqNZADtxC9C7T3POyMt7UKOJh3 R1Nl6ctWeHQsieBAib879az3l9JmYTqx3dpcZ9gVXk7tYGYY2G5v89BW683wQJk0DM/0 aLTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242341; x=1688834341; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DG0t6hTRy1TiyueGnVsxEMjDQDrpL785hzWCnX9OzbM=; b=RAbYSIzoWut01RItfjQZY0hi+yrvzXOzxFOJCfJFSjLyCEKjU86JN6i5ZsXu2yL+fo 7NJbKIjJWAsc24Zzwq5CFvm1xtTy3r+0rrRvTj31FvkKyeNnLinV1RJNKObQt6S5liUd Q6UZc30d3kKwWRkzJ66bSxe7uyxQHmpU8xMG4Zsc/29VW+MMvyPpFjKgV4jA22Ca6tLo sigWGGZpgFlL5coJuAKofAFNBmG/cYbc10HGv11sVMdNa8gA5ybbiLA/zFwxtgwVzJX0 175Sz17mtVmq5vt61MvY9jQUi82N1PHH9npyYKKux4GJktoLzqferWGEe8TJenyw18nA rHCw== X-Gm-Message-State: AC+VfDyZgWOWJJtmLIV3wWajeAHt9c2KMmzGileNnlpfay37Cr5dqz9i NVwmX0gZBiaLtCBkpQlEmbaA8g== X-Google-Smtp-Source: ACHHUZ7mNCDI+jt9sTgoc5QjI1No/0dP3dNBFY0c0TDn+0iU4pVklcn3ibo2AcRHK8NMbAhDrfXtiw== X-Received: by 2002:a5d:5966:0:b0:304:6762:2490 with SMTP id e38-20020a5d5966000000b0030467622490mr7431282wri.3.1686242341257; Thu, 08 Jun 2023 09:39:01 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:00 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:49 +0200 Subject: [PATCH net 07/14] selftests: mptcp: pm nl: remove hardcoded default limits Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-7-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2377; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=zenPus60hgnkS6/g6C+PcTE8gwjvfHkXz30wSKvDTLw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQaPUSkIYhlVuF6CCKRXpqcJjLtMtkvcUJ5V 4mYflZuiw2JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c2BiD/0ZLPN/vt8nPU76WXsimATCWKM8DDK6lRKm1Br0xFin9kdDaH2gTz3MQYM/W8cGsbr6lv4 9c6yOdwV/bVfJnJXR7SuSP3iTv6kvpTRePXHlNPfaglf777DQsow4GGEDM/fCojZiP00hcpHdZE 62oDe/SuQcDQU20YjlF9PyR6h2CcJvoMKFVF2t6wYfK/z4o/+egdBBJ8MhezPR+RqAjzMyK2wIG uAwImEUPeY+fWAhWkzPmMRvXzXsTo12TzMU45wLgiNcafjeBaM40Wi4nZd1oWBrxt9FX6voUfea Ulpt9InGY1QIqLwl8XOnO8jLKrBum7eZxG3++D8z3BTh15eN7wQxTjJlu7xpuH5WcMui0/laK/v iFJV3cM4pNenTH+6NmYdgoTCikt+mz3v3pRldpgg/v/082VzpBH8GQHS5mW7DpZrvjbq6r61ggm b5h9yy7G6Afa/jgx0PHYXP0PF3nre6tp6UGyCitGBX+zhIT5PqAYHa/PAdKlsWk92Cijv7WVhVs vuDirSjYk96S4FzESnlMD1GZQt+MNiKSQg+w0GqFY39dQHVl1Vx/iMbdTmIiIssSALxjfN1gnhs IDOUdlSwQ2JSBehWux/iEH7bEvC/OI2cQyTMxj6zY+rVaTO6atrzPMm4VZciSvLQrV/eW+mONv3 VY1lRgQTHDKGfLw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the checks of the default limits returned by the MPTCP in-kernel path-manager. The default values have been modified by commit 72bcbc46a5c3 ("mptcp: increase default max additional subflows to 2"). Instead of comparing with hardcoded values, we can get the default one and compare with them. Note that if we expect to have the latest version, we continue to check the hardcoded values to avoid unexpected behaviour changes. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: eedbc685321b ("selftests: add PM netlink functional tests") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 32f7533e0919..664cafc60705 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -73,8 +73,12 @@ check() } check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "defaults addr list" -check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0 + +default_limits="$(ip netns exec $ns1 ./pm_nl_ctl limits)" +if mptcp_lib_expect_all_features; then + check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0 subflows 2" "defaults limits" +fi ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.2 flags subflow dev lo @@ -121,12 +125,10 @@ ip netns exec $ns1 ./pm_nl_ctl flush check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "flush addrs" ip netns exec $ns1 ./pm_nl_ctl limits 9 1 -check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0 -subflows 2" "rcv addrs above hard limit" +check "ip netns exec $ns1 ./pm_nl_ctl limits" "$default_limits" "rcv addrs above hard limit" ip netns exec $ns1 ./pm_nl_ctl limits 1 9 -check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 0 -subflows 2" "subflows above hard limit" +check "ip netns exec $ns1 ./pm_nl_ctl limits" "$default_limits" "subflows above hard limit" ip netns exec $ns1 ./pm_nl_ctl limits 8 8 check "ip netns exec $ns1 ./pm_nl_ctl limits" "accept 8 From patchwork Thu Jun 8 16:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272606 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 B029B171D7 for ; Thu, 8 Jun 2023 16:39:36 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250AF35A6 for ; Thu, 8 Jun 2023 09:39:16 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30af0aa4812so647397f8f.1 for ; Thu, 08 Jun 2023 09:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242342; x=1688834342; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=z5QfjatVBc+UOU/sh03jIPNVrbTRG+sfLrSsyGdKccw=; b=FgcnTgDeIyKjr2ddER7XjIWrbKxbSmU4qNUhVBJsu0BeUs7lZOQVp38v/HH5qgE3zg Ottn+GpfAYauezlOB1eLjayZQ8yQv/OT7JB+LFFrN1MUPDrrqjaH0naxCVLrm5ZyaDBY q2CEBhQTeoe7p0QjuMXEkBLyvklz3y+pNZYcrhRMg3uF7ZnU+nZE1dZXOdxecdFS+VDO SYP7bz5G1W6Nql32d+MFW9nL/nLstTVTBWj6U4uPQYWvRXpTYIDJCR29HWX23cMJ5J8d t3w1E7INp2oQv1mHWNiW0M6WGpnfpXUnOloyjQIj+0Bok69H5tcPsIbszjdADtSgYsNb vmsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242342; x=1688834342; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z5QfjatVBc+UOU/sh03jIPNVrbTRG+sfLrSsyGdKccw=; b=lN2LWV+DZvymWjIYrfAk1qJYduVCaSbHl37CeK4wJqr4ZyIb8b2gaqOFbH2fP6aoZ2 mtwYnl9T7BT683jxmvqG2Q5kfq5vGE8LTveZ/KZA9FQmO7t71/NDOAvNdQk1K1dNA4/4 F4YwDsFKVi+YkLhl0ZhSoqE5pV8iwobDDH5hSoCrNaZrJ31Bh4cGSKt6oV11/mEF6zlL UE0aaS63HyDDvlWjQ1mul8K/0d66XwoO6abjNQFGNO/jriY0R3Tmd0iJTe91/HvCbSoH TZ1+0ZzA7OfN+rIYDkXilgMYPBiKJBrNlpTBL7705aefQINlx4lVcA1a1+M601SkwNTA El9w== X-Gm-Message-State: AC+VfDy/SRoLqGCdEbcIM12S80ZQ1Q45rTJGZGpqHZGR0l1Z8KqE5WgY ZRLeBVZbDp7IUz+gn5/92Gf5MQ== X-Google-Smtp-Source: ACHHUZ7wx7hlSwuMrdCrq4YW/Kh5FCR6bvTO4XgnIy6RUYYvnVtbyh/v8tV9f4Kj6BZkkDQXR8yDhA== X-Received: by 2002:a5d:65c2:0:b0:30a:6958:456 with SMTP id e2-20020a5d65c2000000b0030a69580456mr6237867wrw.4.1686242342528; Thu, 08 Jun 2023 09:39:02 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:02 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:50 +0200 Subject: [PATCH net 08/14] selftests: mptcp: pm nl: skip fullmesh flag checks if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-8-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2408; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=fBWV1AaPrYseN5Cy0tbLjkgFuddp1+Kl8LYSe6sCVzY=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQa9cZgI5NnXWQxzcCcxMao08wnQcD5e931m dXG6wzLDN+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c8luD/9WjQztHwOltdgDBF5y7YlQZ5onmoZos6LzgMQN6IjPZKmWoBDr4BA81g/din5tFnWv0K+ kPGP+EU2JpD1wQfvFhc64aPZNXMqfPPgRpCyeyFO8apNwwg9yj2+B4M6IjENwwlYxq7A65a0JUP D3OdNQUdyRRMhJfaUz5tfHtcSrbJW7iMcmsYKUObPv0znqk2jJGWjKFz5NMxoUB51ys27v8oqdu 0gncKx6fRfG16UB1T0btDLX1g3fvpvAbqCZv2Dhk1S1seovR0DuKo1UgrUNdg7HzBD2b+ceHYR4 lz41jHOPx5ZdpxsSd3ObmeJRpzt9mXkynIatoIdST6Z1kqKzC+PHionYS2IfmOXkv3SAbvzn8eP 5TsjD93PHrTKj0oG/FmeUkqATztSkU7d4XhlhXnTnMBjKo+KD6K3C3ebsKbT3/zA10FjGGykx/Y gwEqG4M0HVV8fCz/d0KjCerI3lS0H0WLUoyj4l9rK0PXK9Gn1fsa91YYG+50a5YZvhKoleCdyVa w8pa6nv71W7Zv0Lrt26343a6fbgVnNum3lEhgkucxeKtw1D/sUMuzrSqaU5B8oUFUDMVQLCB26t GyVdmSuNhwHhuxBK5WEfSq6Ve+h2FcFQKHQ8v0O1AJDne496xy7WjbmPW4MOWnUTU9c44NMqE0E zWB0ic0yaghREPA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the fullmesh flag that can be given to the MPTCP in-kernel path-manager and introduced in commit 2843ff6f36db ("mptcp: remote addresses fullmesh"). If the flag is not visible in the dump after having set it, we don't check the content. Note that if we expect to have this feature and SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES env var is set to 1, we always check the content to avoid regressions. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 6da1dfdd037e ("selftests: mptcp: add set_flags tests in pm_netlink.sh") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 664cafc60705..d02e0d63a8f9 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -178,14 +178,19 @@ subflow,backup 10.0.1.1" "set flags (backup)" ip netns exec $ns1 ./pm_nl_ctl set 10.0.1.1 flags nobackup check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ subflow 10.0.1.1" " (nobackup)" + +# fullmesh support has been added later ip netns exec $ns1 ./pm_nl_ctl set id 1 flags fullmesh -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ +if ip netns exec $ns1 ./pm_nl_ctl dump | grep -q "fullmesh" || + mptcp_lib_expect_all_features; then + check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ subflow,fullmesh 10.0.1.1" " (fullmesh)" -ip netns exec $ns1 ./pm_nl_ctl set id 1 flags nofullmesh -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ + ip netns exec $ns1 ./pm_nl_ctl set id 1 flags nofullmesh + check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ subflow 10.0.1.1" " (nofullmesh)" -ip netns exec $ns1 ./pm_nl_ctl set id 1 flags backup,fullmesh -check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ + ip netns exec $ns1 ./pm_nl_ctl set id 1 flags backup,fullmesh + check "ip netns exec $ns1 ./pm_nl_ctl dump" "id 1 flags \ subflow,backup,fullmesh 10.0.1.1" " (backup,fullmesh)" +fi exit $ret From patchwork Thu Jun 8 16:38:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272607 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 48D4A19E5A for ; Thu, 8 Jun 2023 16:39:38 +0000 (UTC) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17ACF35AB for ; Thu, 8 Jun 2023 09:39:17 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30ae5f2ac94so863147f8f.1 for ; Thu, 08 Jun 2023 09:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242343; x=1688834343; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0SeIVqfDIJ5M+hwTQOEMBeQrB+d7nlSQcKhwVwTtbA0=; b=PKE5oK5KGY4ma9jGzewDadwzaiA2O8Ub9z2aWRW2Zw0Ab6RQDseA2a9nVCtiA1wgTy pt9Z+swTeoNTXsnQ0hxjkmu3n7rfs9QIL8/9kQ9w0XnWXGljXuJgUcJ4lpugzv45hbw7 SmfBpvPfYm2GHr2bswOyyeIL/8ju134caaLCZOXAyvyJIKSBtL7dLg7MYGf956EsuJgu G61TrWm12iUPzxCXs4mWdbYov0BApBshQmldY5zlQojhAzNXy6izScgbF8LQZWlZB90g kscAL4Rwr1tW2hr63vMn+cKd0fqk126qFLwkw4spcRQ9yvxRY1PE1Yov0CZYYXgJAsV4 uO/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242343; x=1688834343; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0SeIVqfDIJ5M+hwTQOEMBeQrB+d7nlSQcKhwVwTtbA0=; b=bq7PdlsWzgIxs3fyzzTrrJYBAaV7xRfY5Zt0rI0tJkX2rUOtq0XJPEjew7p+uocbvu YVw7D1u8GAi8txT7RKV+0KGHMz9gOeKg1JEApS/XZ3AkJYY/yD6oB4qLSWVoXWTCUK8N W2itSRQd3xHF0NmofuK/LKMaoC7iv2dmuc1ULyoiJtlBKLLjCnPOnDeay/rLxG1xxG8F X28f2KHO71BFlA3qwzOiYV7oFwQrW3BAiTzEt8Vvyxd7hfSFo93Ifnq56YEiWN/vOhq8 +CDdMeAn9LFtkCWr191dZFhz7dJc8HRCr/oGIoXVgYVrFHWjgPGRlTPdu+DG0mJeLdX/ Eapw== X-Gm-Message-State: AC+VfDzt4XnFr8yj+mfYuH3cwxwr5GiFgzynPwGJVzORALkhfTwpWK9L 87SJ1Kcy7z4qO7Wtn2q7y/iH1w== X-Google-Smtp-Source: ACHHUZ6yurkoDraX+JVU46TTVJ2MRrt+TCpcI/s2PSIbLlBZf42OvA/DRkeZVRZAV3vbPyQNmtxxtQ== X-Received: by 2002:adf:d083:0:b0:2dc:cad4:87b9 with SMTP id y3-20020adfd083000000b002dccad487b9mr8050050wrh.68.1686242343680; Thu, 08 Jun 2023 09:39:03 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:03 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:51 +0200 Subject: [PATCH net 09/14] selftests: mptcp: sockopt: relax expected returned size Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-9-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3171; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=GQeNP3ltipPT1KJXTiCPa8omelDx4jZnpR+BwG9Is00=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQa5Qov3Fm/bDBsD6CR3oljXLClang/MHNLi wAtvYGLcoyJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c+syEADSQGmhuKC+jL1Bbph2uy7m/3SgiQ/Rjsewr3kgOOoWSkI0PiBA9l3d33m5A3stWa+m5cW 4h3QM4CZV2Q0OMhe+9D3NxlwodEyXVAdoR0HbHYTb2587u4XQe0yQuqC1J1VRLZZWWTDw5HSYLd LAM+aTCwDUVEhscCJBavOWcyhzife41OhauVMOvwuICpuADLAGoGRIyoT8ulyodHphBNY1wgTjl BUu2xZxX+/xnjpIf3vfPqna4w7rcOFpjjSW4unyNTPbyfvdi4MGSeGb9quzTgeVxRoM39qfXd2M /Vk7jy5bS7R+raVsSijiU2L0bQvK1MrHdOegnkX8yjZjdQ1sD0PzHPZ82s3g0zbDw4ybrxgQ0wq jQc2L8ZE/oVmIEEDPF0/Cb7DofA3XYBRdss8FZFxIONIUDDzuucHgOw6ceu0ehHtklC9AsddAIK /2m0h6ZPAiUbU7m+oV/xODXdOPJl1xsTMZ+gT9Ty8ws7S+Jqg2cpFDkn/ArszNepyylYfqnWkeb aBng4kd+RggojDawfTjbCN1nv3Cdvi7DD5xNVyIPzQviT+pOsI/IrTLn3g7BRsuIuTIPLVHfkcb ujwm75fK61gPmojrfB0EHbQOcGG7rMpLESGijU/MZjfbn91o+e0An9tPVwVr+DUHkei7JyqVTZ5 LrK04fBk+bt8vfQ== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the getsockopt(SOL_MPTCP) to get info about the MPTCP connections introduced by commit 55c42fa7fa33 ("mptcp: add MPTCP_INFO getsockopt") and the following ones. We cannot guess in advance which sizes the kernel will returned: older kernel can returned smaller sizes, e.g. recently the tcp_info structure has been modified in commit 71fc704768f6 ("tcp: add rcv_wnd and plb_rehash to TCP_INFO") where a new field has been added. The userspace can also expect a smaller size if it is compiled with old uAPI kernel headers. So for these sizes, we can only check if they are above a certain threshold, 0 for the moment. We can also only compared sizes with the ones set by the kernel. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c index ae61f39556ca..b35148edbf02 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c @@ -87,6 +87,10 @@ struct so_state { uint64_t tcpi_rcv_delta; }; +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + static void die_perror(const char *msg) { perror(msg); @@ -349,13 +353,14 @@ static void do_getsockopt_tcp_info(struct so_state *s, int fd, size_t r, size_t xerror("getsockopt MPTCP_TCPINFO (tries %d, %m)"); assert(olen <= sizeof(ti)); - assert(ti.d.size_user == ti.d.size_kernel); - assert(ti.d.size_user == sizeof(struct tcp_info)); + assert(ti.d.size_kernel > 0); + assert(ti.d.size_user == + MIN(ti.d.size_kernel, sizeof(struct tcp_info))); assert(ti.d.num_subflows == 1); assert(olen > (socklen_t)sizeof(struct mptcp_subflow_data)); olen -= sizeof(struct mptcp_subflow_data); - assert(olen == sizeof(struct tcp_info)); + assert(olen == ti.d.size_user); if (ti.ti[0].tcpi_bytes_sent == w && ti.ti[0].tcpi_bytes_received == r) @@ -401,13 +406,14 @@ static void do_getsockopt_subflow_addrs(int fd) die_perror("getsockopt MPTCP_SUBFLOW_ADDRS"); assert(olen <= sizeof(addrs)); - assert(addrs.d.size_user == addrs.d.size_kernel); - assert(addrs.d.size_user == sizeof(struct mptcp_subflow_addrs)); + assert(addrs.d.size_kernel > 0); + assert(addrs.d.size_user == + MIN(addrs.d.size_kernel, sizeof(struct mptcp_subflow_addrs))); assert(addrs.d.num_subflows == 1); assert(olen > (socklen_t)sizeof(struct mptcp_subflow_data)); olen -= sizeof(struct mptcp_subflow_data); - assert(olen == sizeof(struct mptcp_subflow_addrs)); + assert(olen == addrs.d.size_user); llen = sizeof(local); ret = getsockname(fd, (struct sockaddr *)&local, &llen); From patchwork Thu Jun 8 16:38:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272609 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 C55B81DCB4 for ; Thu, 8 Jun 2023 16:39:40 +0000 (UTC) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D214935B7 for ; Thu, 8 Jun 2023 09:39:18 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30ad458f085so671984f8f.0 for ; Thu, 08 Jun 2023 09:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242345; x=1688834345; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Kh1r2jxB7ScuO/6zF4R4uXq5Ks2IDFHVjEbkZQpHayQ=; b=RKqKzS8QPbGaeIBMGTZRNc05LSqhiwAp4jXdLWKgA4QtgOPYxhnnAXoS/zIa1FRHzw SJI/A16CDCg+8s/QqlgRmOhnNEKdnSuTz6l26p9ojwJS5NsNAtxLH6g+ifJm/2lqHyQ/ KzHSGSa12I2z1pPhxb7eioT5ThmWWEJ/Ee8e1WPT9D6MqhtsJUCEacvN/Aq0K0c3+INl CpvLO7ZA3+hAPHt7zXK4+TNfQD1UF6A63U9yFbGBdwqjPnHBwsrdVGV601r1ODsTP8mR TDsiaEYiJv3DhxydZKT/PQ05An43Sw3KFh5x3N2ElnBPYO/pAhh2d8OquOH1P4TkuaMk trWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242345; x=1688834345; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kh1r2jxB7ScuO/6zF4R4uXq5Ks2IDFHVjEbkZQpHayQ=; b=VGuNMPy8Gow4eRbGgCDwHeQjYgJfdqafCbHgVqxf2w9kRXdqkfBuVOLYzMm+YwzoZ4 u+FS9LIS3pi8Jo7v1Khu7wIqJsy8Im9PiTJQUPXYMWNrxcamvX3ohxv1Oml4LhibgH2X k1u+/uJQ39U3IKDDcTYXvGGtoX6yXFsKGWzy9REse4RQo4pKtmuUsxeBgpJ/+c6KHeMZ YHp4HBnz2oSA+l1t3Jy65oHkPgGqLGV/qnIJr775l4n+r+MmDjKJF3ZHihfOsWyGATzL Th01EWnngeamjRr209f+krSTIxIGxYxDZcrsNsYHZJdP7lkudoGg62Q73qsFY9tX7O8X tHoQ== X-Gm-Message-State: AC+VfDwi5tdxGur57ESTp78mp0pOvNwjqKjrrOcqZWxaZI5dq92e4WFj imwwjCLxN8hI0Ry6ShRm83dXoQ== X-Google-Smtp-Source: ACHHUZ7tnKmsx4hYMI+pCbVjaBxTj0d1u3pf22ESdyXQkXihNLJxr3z02asgW4yGdc+E9apx/5T5yw== X-Received: by 2002:adf:f9c7:0:b0:30a:8e58:7955 with SMTP id w7-20020adff9c7000000b0030a8e587955mr2292429wrr.13.1686242344924; Thu, 08 Jun 2023 09:39:04 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:04 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:52 +0200 Subject: [PATCH net 10/14] selftests: mptcp: sockopt: skip getsockopt checks if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-10-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1522; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=uRooKe+CzLnbd+RolTp1KPScrbpPmueveZsvj6eHVbc=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQaCPNceWDOur+3v2zawhBoDqTcRbUXxos8C qPz2ZqvR7uJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c40+D/0Xggte0l8UQZafD2aZynfUG/9JaLeHYjbwxPH/3cUBzx2qqOfLuegnHPdzz6jRinLi47J hX6k+TzdlvwJvFx0xuAvIbnyUVY+W/s7N0xXKZMTWA2erSbhdr8rQYprDFlP8YWCt3F8TiCXbfj hm2Fmuk6ic7ik4U3zTW7ptIMPlhoMqmyWJsgEBXy/9L5APoVQyF6lfAV61NY+mmHe/Brviam2Yk e8Hc471uZeJPPw5bCbgVvfdg7N81OgOtKjh1o1eKeh9E+77D2L/c04fjOk9/RnfJq5fs0wNrnj+ iae6vhgbzxC1Eau9UuqMzwQdM8wUI5qrdp3suSpAdPYYDqYVLkex9b2dhkd4nawxW8O1QEn9Qz5 hSTipJubRm2mnKAfoOOo3OCBJ8xwuhmJveyd3JuTBAThrkKgPcVqaxtL9DdrWrny9UbMPkUzTaZ eMRxOC0KjXrN7XbYRUJjvqoSXFWuKZoIItqtGHMaMbc4OG+aU8whOevwNnsrFaCM4gY/lWBDY3Y K2wxo+iSBNc6m4PBvyz2eAyC7fucRBt4i3xX198srFx8AsK8fSZRpRoZVeq2Au5jK29N0N08LXO TJYSQt+8TSyBeFi5e0E5V9bGFeoZYN5w/u+6KY/sXl1H/GOeWBnUS9S2g6ybIw7wIUlpI/mv8c4 6vis+MPkfQtVJmg== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the getsockopt(SOL_MPTCP) to get info about the MPTCP connections introduced by commit 55c42fa7fa33 ("mptcp: add MPTCP_INFO getsockopt") and the following ones. It is possible to look for "mptcp_diag_fill_info" in kallsyms because it is introduced by the mentioned feature. So we can know in advance if the feature is supported and skip the sub-test if not. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index ff5adbb9c7f2..1d4ae8792227 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -87,6 +87,7 @@ cleanup() } mptcp_lib_check_mptcp +mptcp_lib_check_kallsyms ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then @@ -253,6 +254,11 @@ do_mptcp_sockopt_tests() { local lret=0 + if ! mptcp_lib_kallsyms_has "mptcp_diag_fill_info$"; then + echo "INFO: MPTCP sockopt not supported: SKIP" + return + fi + ip netns exec "$ns_sbox" ./mptcp_sockopt lret=$? From patchwork Thu Jun 8 16:38:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272608 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 CCC6A1DCB5 for ; Thu, 8 Jun 2023 16:39:40 +0000 (UTC) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC24735B8 for ; Thu, 8 Jun 2023 09:39:18 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30ae61354fbso653306f8f.3 for ; Thu, 08 Jun 2023 09:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242346; x=1688834346; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=25ZaF3JsFYErEFoIbwPYOVDqmdE5+qzB+30gx62T0y8=; b=bLE4kzr1bCQ0rzhbxY0Bt2OGLWYWKUZUwOYk/Uv3yrqZC4kbVx5rg5DiQzYVWyZa+R FaZQ+3Ucbvs9Q0kYkMlU6FkvzDbO9YKspfiklSDL8M/PjPOtuK4VmxEMue8L5L4sNjwK Elfr4IyYglh1HPIsBF/Jo76xv6l0n6yddU7X1jLX83bevK1ZGiERRZK1v9Tb27hbH0RJ Jei0rFxsjerhn+sFbdi6juWAKH9iQTNQ/FTCBq3RDDe9A/2lRyL3hp+ILbQAQ5yyUQ1a YJjCWU888tmCtXnPr6UdXbQGkhdeKubc4ZTxnKqeLDqE33HltjLTZpa1jfJlTrtm7OVR TVTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242346; x=1688834346; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=25ZaF3JsFYErEFoIbwPYOVDqmdE5+qzB+30gx62T0y8=; b=gs0q7+6boJtvTpMUy9+SFSI2bzqVcTXSEeC67oIqHwEEKkJYYKFvMVygTnWfmZnyEm 2hDxTssWvACz1v95gZAas/OgwYfFb5942AuFoecc9jrKqIhNwYvaweTLWq0QEtpqcHmU fd+QVsE5rsY3AbH2DZijs36kRwU/SSN0fArc7+W2TWywCMT9HiwKP+zmgGQB9s/oifxl b/d83t/PR2eKL+cmAE80OT4prGoTy62BdimrYWLGlTvN8ZWv5u9DwykMYlJP+8XJd03F NdMVfEDFZrvTFOnHKCGXvK0XVBhKRsQHkjpTdEcEf5pFa9uzOgIgC2yqEA83q47UBG+m 3Emg== X-Gm-Message-State: AC+VfDyepOlUYzC+AN1pVYxP8VQebNedxmPk73/uGRmGNOarc3RI5M2G VfRsNeWxmyvJwKpL8UQHKQqGrA== X-Google-Smtp-Source: ACHHUZ65wUtjJyqPFNvZuE1f6WBvIeZZIadiu1Pgy4n7Ffa7OL1OMBN55r1OPGcfegL0pNfZ2vA9Ww== X-Received: by 2002:a5d:5915:0:b0:30e:438f:8ceb with SMTP id v21-20020a5d5915000000b0030e438f8cebmr7199002wrd.59.1686242346219; Thu, 08 Jun 2023 09:39:06 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:05 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:53 +0200 Subject: [PATCH net 11/14] selftests: mptcp: sockopt: skip TCP_INQ checks if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-11-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2133; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=1OsCicu/3vbKAvtKytrt0z0ywt61KRKpMc3STXoQXA8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQawz6TxWhaJHOCzsoj7Dunv2uUMLzRPPKj2 W1VAUZNjaiJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c+JJD/4nMV96ft2RW4sWQl2h5V60vSuGvtu8Fj57RT4rjI8alspOTImfQDSHV2VT0jvyK73a2NN JcBwh0n2KlCAcqU3yRL5Yxe36fHk2ZMJMUi4WUnc1KhOauu9GbtXDgKqgLjk50w69a2msxXrB1/ BzP0Ih1mfkVrKPnsUwbORN+wUjE5jqy+9rP78316DlCkrihfSV9o5yXiwOJJ6qfSbqSKCSt2vMR vdwYxKtLLh137dUTEzaIymzu8z6ZeFw8FXUmGwXXuHHqy7tmr04vFFtP5+Pe0dwZr/1eCP4sOKy +bBIkjQAaz0hzN09loIChJYeJIziWtfxC8KDkpIWl/Voqdfnye2MfE7q4PLN16+Xro81sf8WhQJ rzq0VzRkLDWcXAeiUAgLUw0DfCZsJy33gLTuAMfLqDLW9waL/rbJLF46zo2GBmRTBDPHexcgwHj ht4DgOE/Mgl5XUWbcH36p2TPiR8jK8JIt7Q8+OVNlU9HUTnB1KwzF59WViYddFICF4NxK3+5s99 I3psrh50vH4op27pQiGJkm0wibIQAqED5A8ezAJJ8XAyG3Kplv8RTlQKz4bURFrv0QEWEBKVprp y4qGrl3N5S/nGIe9cptNKHf0m+gS8irTTywG5VbZkeronyhJu2GKkAKYH9Ty8YAwO66aIYObQkN /bhqNwA09G2k+EA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is TCP_INQ cmsg support introduced in commit 2c9e77659a0c ("mptcp: add TCP_INQ cmsg support"). It is possible to look for "mptcp_ioctl" in kallsyms because it was needed to introduce the mentioned feature. We can skip these tests and not set TCPINQ option if the feature is not supported. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 5cbd886ce2a9 ("selftests: mptcp: add TCP_INQ support") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 1d4ae8792227..f295a371ff14 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -187,9 +187,14 @@ do_transfer() local_addr="0.0.0.0" fi + cmsg="TIMESTAMPNS" + if mptcp_lib_kallsyms_has "mptcp_ioctl$"; then + cmsg+=",TCPINQ" + fi + timeout ${timeout_test} \ ip netns exec ${listener_ns} \ - $mptcp_connect -t ${timeout_poll} -l -M 1 -p $port -s ${srv_proto} -c TIMESTAMPNS,TCPINQ \ + $mptcp_connect -t ${timeout_poll} -l -M 1 -p $port -s ${srv_proto} -c "${cmsg}" \ ${local_addr} < "$sin" > "$sout" & local spid=$! @@ -197,7 +202,7 @@ do_transfer() timeout ${timeout_test} \ ip netns exec ${connector_ns} \ - $mptcp_connect -t ${timeout_poll} -M 2 -p $port -s ${cl_proto} -c TIMESTAMPNS,TCPINQ \ + $mptcp_connect -t ${timeout_poll} -M 2 -p $port -s ${cl_proto} -c "${cmsg}" \ $connect_addr < "$cin" > "$cout" & local cpid=$! @@ -313,6 +318,11 @@ do_tcpinq_tests() { local lret=0 + if ! mptcp_lib_kallsyms_has "mptcp_ioctl$"; then + echo "INFO: TCP_INQ not supported: SKIP" + return + fi + local args for args in "-t tcp" "-r tcp"; do do_tcpinq_test $args From patchwork Thu Jun 8 16:38:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272611 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 3DB1A1DCB5 for ; Thu, 8 Jun 2023 16:39:42 +0000 (UTC) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8E235BF for ; Thu, 8 Jun 2023 09:39:20 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30e4eec95c8so827149f8f.3 for ; Thu, 08 Jun 2023 09:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242347; x=1688834347; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lOuYSg8J4w1AyHg8USLMCe+g5bUzTKHHhFPUeoHmJUk=; b=6W8hni56+3CAISFHLE0+aKfDczVpe3GSsC36gdTSCbo77FUGrxOafMNwf/aZA0P+lp 0FjNRd6v+dFm42X//HP0dujYr+WFpb5sSkoc1qr6z0z3h04DYSIF2RV5Wg83Luzawvii C9u2Oh1aQy81go4yVeJvKLbWBtiUz4qjvhkguIOhfrH6FQskup30X5/DUx/zthL4Lkcu QEzSO8vytbsAKig5hGaAG21gVW0MV+Kc578GebqoPcjGH+pHywu1/yPgmbPI2vqkG2kX IYeXjgKxLZ0UFqON5AipdWeCLbPeNc5YV/5Aih+YVfvc4OzqJNYpleQCEmp2hVb3FVqe t6uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242347; x=1688834347; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lOuYSg8J4w1AyHg8USLMCe+g5bUzTKHHhFPUeoHmJUk=; b=VgcVJpvU4hl/83/1cwpH+MDRGxwrWorqkylRRKe9DE5wYI5upb/zOW86MmnwOSmIh/ AyGTEOMKcJmrydMas3a/fMlZTLER3SSgvNX1FwJHlm0Gx+4+Il6kTsZXdy8HsMLRvgzR 1NnkRXYIhMlsrinI/RJCEZzRsVmAR4TzIGyZSQHL3naXUgBRjYnHwc2LA4MqZ3M10i8b 36P6AH2s0mAtlzKaYZNN3CuespozO81gG5wmA1X1W99pLfv3DTK8IYWDW71Fut8ipurG rLU3zuHCMbhZ69u3oLRyUdWTGWAytmkmeuoJQ/pxbL3Gn0jSzUd0YRRaYKm9/Jds366l 79eg== X-Gm-Message-State: AC+VfDyjkEkEed++SiSADuYrVuvGHHf2PUBjz3hlveEjs88WwG1/w41A 0IMUkbnyG4w+GONbzehPBikW2w== X-Google-Smtp-Source: ACHHUZ4w5v555r5a47h8fcPCos9lMeBsunv8Hu1oUvXPAQm+qb6ALiRc0oXrG0SBcb2lupTKB4xVtw== X-Received: by 2002:adf:e2d2:0:b0:30a:e479:66a2 with SMTP id d18-20020adfe2d2000000b0030ae47966a2mr11007108wrj.37.1686242347447; Thu, 08 Jun 2023 09:39:07 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:07 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:54 +0200 Subject: [PATCH net 12/14] selftests: mptcp: userspace pm: skip if 'ip' tool is unavailable Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-12-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=974; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=LgQePFMCSt72bRADkX0FG+ALuqpXJ1DkTpc7juUL6uE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQaOPetE2lDIy1IfFY1CDe5VbXKJ63o3Gq1I uzizz8sM0iJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg cx63EADsPoFYaIZvExp5hZTyExQrpDgNrCt284Hr4s/PMWfWJO5IhB6YBXDFrAH/2x6a+yeS9AM FeJ0RRhC3ATqR6M5D0zKgvWDDwn7zaxewmaIPzg8vEWBwL3It8pA62eIvUvPaMxa2Vw2edfDK7e zKakE5/9rrQI7Sw2T94n8ob2NPoqHX8GK2w7ZEJKjubDFCYjqMUf19S8d1TGSbwp9nQtxTmuFUR Evsolbryd5zzyvW9Lq710epCQr6ubnGsinRpRasAhDdypYxMqaGVRCIjiPcFqyxvoA+n0SsBwFv dlGqlJL0csZpGsM9mC4nMLyHE7qrH9aFthb6WT4WZAAD2EcxHpyxRGrgIrDwo5col8mt/cpP+Rv 3Bl67nCJB7u3uZ1wxNTLAkn/Iy0wxzphM+OfprLFnuuwzgdOpGLw1DOoPTGBY2RUzG47qLgoeMK JXw0Euu6MY50IPJqrVDkcL+bWDPbH6nmnaFyLKRaqe+l3IqVeDa2lykiXbtPqM+rNE/D6JsoQg0 BEglw9ycobAWVKiZylxQYyxR0wdqJQMxYTDOaoS9tcw6Fuoc6M7WzbqUG8z4rTHYNQwT2CscWQd 96yohKQ65y0AG+oAZEu2Ay4BLu36bpJE9hlg2sE8SSu3EXW4AyNOD47tMF+dx70JS+sUQcwe+MK 6gpbM2JvwkpJ78A== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org When a required tool is missing, the return code 4 (SKIP) should be returned instead of 1 (FAIL). Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 8092399d911f..192ab818f292 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -8,7 +8,7 @@ mptcp_lib_check_mptcp ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Cannot not run test without ip tool" - exit 1 + exit ${KSFT_SKIP} fi ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED From patchwork Thu Jun 8 16:38:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272610 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 3DADE1DCB4 for ; Thu, 8 Jun 2023 16:39:42 +0000 (UTC) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0953D359C for ; Thu, 8 Jun 2023 09:39:21 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30e412a852dso629673f8f.0 for ; Thu, 08 Jun 2023 09:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242348; x=1688834348; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JRNPtrh4/qtNxd83RxLqXaD6crOweapuAV2/D/pcw+U=; b=Un3Fkyk4WZcSeyKvPkb+USXGmQAKE4cyiEAXc1XkV8Oz+isJ+310fknpM39YJXcpT7 xMb8dv8TEzPZlrJTxh8KqRRrXv7TBrDN0gvG0A7xPDXnQYNh1Rw0SNtiSmCjjkULgeYA bV824eAUyex6CxGsOM0Nzrm3rHe4AnTdoJfmTBdEfoWH8jVI+qq57StwYNBMYzq3IYp/ d6D7GgfcYtVdRYo3t2/1hH/Bggf7z3dZbQq+anWEvc0lFKlCFX8+WZScz6KhjY+cYqkD peKuH37IgC+QJBF7nd29MYH9JtAILlx7F3R8hUYQb86zsA+c34eYVtDn6JIPa6HJB1hL m4AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242348; x=1688834348; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JRNPtrh4/qtNxd83RxLqXaD6crOweapuAV2/D/pcw+U=; b=koq2dp1Hrjkq0SFhGGgW/1o9ETSxYw+w7oEUQxRhHoJ9zKEa8P4JIIuQ+hkywS+YZ9 font96DtizUDRdRz/lJPEAeSL6dab1pHtzWJnM37BC5hAVe4RM+k3Tcv8zKVWhY2j2gW JwKjXECG7kRDKUdQc/Gavgem/Un7H+i1V0PlJi6lWzIdVhyBwhnVYV7uNItcC9EVHHu+ Zs0tphOpVw3/aYPrkxQzrmp0oRsjsoz+oVOK4uvCt2c9FCm3zTnLnJksaQ0QtY+bBlde Gh02I0CdWpmM9iaeeuJm0jSmsjzrUbdFtRlkL6rb4mE1qg3whpT904eNw95+MGNxEaRT FLGg== X-Gm-Message-State: AC+VfDxalcnIn1pl8l9roa/h+ibnX+dacaGL+nooWn5j9YAzqvHOQDlO diBTVNaiRPSx857bwJQnyZzZ1Q== X-Google-Smtp-Source: ACHHUZ5iZJdIddG/7W2VPfdO3Ht89qbeIG8+GZVpkumfcegq4+3YDO4cSKUdXj66iQ4hYfXS1+lG+w== X-Received: by 2002:a5d:4d49:0:b0:2f9:c2ab:e1de with SMTP id a9-20020a5d4d49000000b002f9c2abe1demr6785099wru.14.1686242348666; Thu, 08 Jun 2023 09:39:08 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:08 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:55 +0200 Subject: [PATCH net 13/14] selftests: mptcp: userspace pm: skip if not supported Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-13-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1305; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=lCLnyi7to0GdP9Uc/eccM6C9A2GjbynXexM/0ZjcvOU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQa1p5uGknzfdbqipsdBEVna7eEYJQ1LesHn 5K9Wwv69+mJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c8D8D/wMnUOKRUij+6jmSfvUzmfQsZc+4SMaMFn+wgdn8svqr2AHPK7kCbmnqA6KX5zY1FH269z aWkyEdCkvRR6utKPf1YW/D0SBKTqPqEJCFU4TPE2bIhsvo3J7guHMcF3Xm3OO1bCyc+DLohR41S qbch7QxblDWd/vsQSfGkL0JdMObSonfZDc5LDX316RHptcu28eVEF7fIbYVlGw0c3F2DHr9ULDm z3JsxfqM2qLlpGw5Z5Sle9LEnxbskRy8+sihXK/P//IHSsV7UwsrDrna4p/ZTEGjT4499P5Z2Jq gXRxBGrzaI11tIiE0JkROQw7mPJbowZ1DHAdJ9ThntOVks+AgO1MKAom+yHf23vzJMYjbRrZXIW HjkBUUfoE+9AfIVUnRdVD6x5I012PLjb+UquMvymYnOZ6wEdslrkJROrK1LD7vNOEa79zHz8ci+ 0hlduCLvV2W3CiyILiQ6PfWzlpxYnI0FhJKBhNoi9XD8UC0Akh81nVo0hOYJMAwpGH8t3dHy77I NY09X5fxFc3cEF2mzeQzC2NSTM0QN4zb43J/uFfzGJbYROEuiveDhmo9m6SyrA0Hp/zmORxLlgs r3teRyxJMpvkN5YfYn4srB6c4XTKjsqJJOrVGf1UI03CUwKJUYOdTaxITNFNFXKWVEt67qu5WTp Sz9RyljYaDzfb/A== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the MPTCP Userspace PM introduced by commit 4638de5aefe5 ("mptcp: handle local addrs announced by userspace PMs"). We can skip all these tests if the feature is not supported simply by looking for the MPTCP pm_type's sysctl knob. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 192ab818f292..38a1d34f7b4d 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -5,6 +5,11 @@ mptcp_lib_check_mptcp +if ! mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + echo "userspace pm tests are not supported by the kernel: SKIP" + exit ${KSFT_SKIP} +fi + ip -Version > /dev/null 2>&1 if [ $? -ne 0 ];then echo "SKIP: Cannot not run test without ip tool" From patchwork Thu Jun 8 16:38:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13272612 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 323351DDE4 for ; Thu, 8 Jun 2023 16:39:45 +0000 (UTC) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD0333A97 for ; Thu, 8 Jun 2023 09:39:24 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-30d5931d17aso613452f8f.3 for ; Thu, 08 Jun 2023 09:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1686242350; x=1688834350; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eNE3c3ow4HLujfggwGvIZJSwJNji9SiemeAOxLRnRII=; b=QBhxRYZe+sDDvDUsNJjopzpa07zO083BpgMmUtvp8LWYVwwBYS7FmmvSEQE77qCzvZ ZYU1eWAZg8prFk8gBMIOaos6NZoMorlowucePZq+gRETnY85v3aZ9UIZ49gtGjqOALTq ivk5UL74n5qLS6ec7J9pOKFbrGqMN0mokMhZhMYbNaIS2h2p5mQd72rdInBKhsrkZJEH gWGiq8J7urRmLTHqu+BNbRk+JaTOn4oNWQwQHwwMxeIDtLIXsIh4td4yE1hHxZIhI22R P2wbFuNXOAZ+WGTTQJUnJVzgNZeuA50d+eCv6zaKVw0GINWnLq+FL4AF2+80WqWkZVUa WMUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686242350; x=1688834350; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eNE3c3ow4HLujfggwGvIZJSwJNji9SiemeAOxLRnRII=; b=Rj6OE82YNG829wXtNttHGA8IFCGo4TOWcXJGrgVCmUEv/83fM1KaWs0myo2UJv5xmP eeVslOYB/VmQ/L7/NlIRlyR+XzOarCpqPpMHsdCyPZOEe1d4VqFP/konlYq5HrvHLIMW 1Hfa7XNkR9VsvYcY3UER0sdLSu8Kz0zfz0rJzpCj+DFqlGqlk38gHxUOcLNma81y2qkw MpxYjztzGBKX6moE3o2XCeGGmgzz7YQMNBZ9oR3fgdIB7vydChKZdmgQkmzNAoJ1Yf4s fH3WSh+TC3hDnKyjKuspFtaadv+4DVHUWgXPHtvDamlv0S2O0ODSvBIL+9iir35mmSqi lCJw== X-Gm-Message-State: AC+VfDzIxIJdRKIH9ujZ1UfvLflTwKU2MU4Qg4gHHiaqKtFkHIiOEV+3 PSkKh7QNgUQ/oTz0qMX7CMh9pQ== X-Google-Smtp-Source: ACHHUZ7+cIAw9f13UW49Yep2x/jmYvDc9Tud1mRnFBJpyjSXpkmlj8OETX6PMVaC9uzChIccBULycA== X-Received: by 2002:a05:6000:1245:b0:30e:44a5:804c with SMTP id j5-20020a056000124500b0030e44a5804cmr6781125wrx.35.1686242349930; Thu, 08 Jun 2023 09:39:09 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id e13-20020adfef0d000000b0030aeb3731d0sm2038215wro.98.2023.06.08.09.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 09:39:09 -0700 (PDT) From: Matthieu Baerts Date: Thu, 08 Jun 2023 18:38:56 +0200 Subject: [PATCH net 14/14] selftests: mptcp: userspace pm: skip PM listener events tests if unavailable Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-14-20997a6fd841@tessares.net> References: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> In-Reply-To: <20230608-upstream-net-20230608-mptcp-selftests-support-old-kernels-part-2-v1-0-20997a6fd841@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Davide Caratti , Dmytro Shytyi , Menglong Dong , Geliang Tang , Kishen Maloor Cc: Florian Westphal , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1649; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=NWyBgeQZowz6Mkkcv8bC8ZQEUyyS/33h051YnreudYI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkggQaQ6XKgvIOs3AtSThNX3TE9Q4HnIMUp5Mg8 ykKZMhFB22JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZIIEGgAKCRD2t4JPQmmg c3d3D/0TgbzsP1x3hX8RCjC04xExB7CAB1pmuCfxS660YCvb/EUzJ5KbojK1H5Ywo+UQPuzEzOV rGRF5YFrPUru/OszmZyRpagcdCYtS58nmzc02RKiQ83dTteCy+72wNRc9QDA43P8TsPfmwc56xL dt9g2UqY0KwX1syMl7DX5N6i8hm9SmzkrdHc2qFZPjNaB1waeLlEL5gvDfzoCekXzxfb4VDF1fA z/J3cuPERmwdnW6o8tzhUMl2atgKbIQJkmR+Yb5ZfPzLtg0IfLfJkz+1nizaAV72/KDEnuaaWP0 RqOWdH6VDThhzd9jPdeUO7B2fnYD3UYNR3qhx2Bo2xWOCltbXMoDobpz1N0uh3/75n3AfczBq/d KqfA1rlNtLsRgHp6iDQDMTecTwvVz6wKSW2fWjDxmxgrJcJGfjoBsN52KL81ZoxF+Y9bkshhjs4 jw+sfNAN/HCgYfCOd6ZnOfttdXb/tDKsKEW23z3X+OtGVCjyqGnrr7OWhnBRALADYkrNIJRX7zb SCaL4JvdJAwY2lhuMH1dW4kujJdT8ZRH7Bm2nIP/jev7D06rUAJ49JEdpLX0RekF2zdJa/DnIsM k1FsfLFJlxhZhnHpILiyDUIk+FKCRIUChvW7KN2QaCvbyF+Kj3gH8Tkj+McMLIsHAOFW1w6Hfqq G0gyKJc2tQFdgsg== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Selftests are supposed to run on any kernels, including the old ones not supporting all MPTCP features. One of them is the new listener events linked to the path-manager introduced by commit f8c9dfbd875b ("mptcp: add pm listener events"). It is possible to look for "mptcp_event_pm_listener" in kallsyms to know in advance if the kernel supports this feature and skip these sub-tests if the feature is not supported. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/368 Fixes: 6c73008aa301 ("selftests: mptcp: listener test for userspace PM") Cc: stable@vger.kernel.org Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 38a1d34f7b4d..98d9e4d2d3fc 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -4,6 +4,7 @@ . "$(dirname "${0}")/mptcp_lib.sh" mptcp_lib_check_mptcp +mptcp_lib_check_kallsyms if ! mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then echo "userspace pm tests are not supported by the kernel: SKIP" @@ -914,6 +915,11 @@ test_listener() { print_title "Listener tests" + if ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then + stdbuf -o0 -e0 printf "LISTENER events \t[SKIP] Not supported\n" + return + fi + # Capture events on the network namespace running the client :>$client_evts