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: 105071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp427015vqr; Thu, 8 Jun 2023 10:16:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5oVc9jWD86wzGqxCmKjrhrC+PQplcZjsodLxLg7+0NU0YGCst2F014Ue6RMSOdlrfM/EKC X-Received: by 2002:a05:6a00:3982:b0:650:6e3e:a8e3 with SMTP id fi2-20020a056a00398200b006506e3ea8e3mr5438267pfb.26.1686244560867; Thu, 08 Jun 2023 10:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244560; cv=none; d=google.com; s=arc-20160816; b=KJASHcOC6IwNuHKQQwq4UywBw7eEdSyt9ce1KXaTK06xZwXHMdge0DZlGCpQ54fDZ4 5V5fUQhsJMH/fwBnmyU2vY5vT7OhiBfTThGmOBpqo61kkUOF+hNOAGdciHlY24YURUmW jL/cS8v6nE6P2neUe392q3Zho8stj0lUqsAWXncpvIJmKlpCtCm+0ClN7rCrb5x1Dm/k NtWFz1kLFL3njW9C1uDr7Zn62FB5UFSOO2svU5Id+mpy2mhJegXFWfwN2Ccg98wjAheo 9q79iqVFMY2miiKpt5ZI8NT1+5dI2D6+UATxY5Zl4dxEvVnpwhgNeBSVJgtXEyy7FniM kSww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Uw4JCOlggtaSPwBTDTjp07y/EtwINur5skPlUaghmwA=; b=LxWI/XyaGN2IPpPkqfqRJpRqYoP/Pyxgd7CAFuu7K7az1BWeQ52cf6q6eaRUlzgHHG 3dPJxR6NO3GyupQh3ONNc4LqgMueigVJrK4nE0Nqy/s0x6eoJRvIhir3dZHMe6oKk36X YVIvYMpwghouCCe/xfq6Fk0ii3GndUip5EMAOTX9TW0MDrVbGu9bMO7ZuriyhcNZhso7 6JQl4xA9rASO4CYT1Q5yNJT7MSt26/IZz9Jc6ByF362uCxH4KcO2MQ4tMygXV+wuyzId 85yrgjVOt58h36F94iIdc25gmeKIwUlBTAjEeXC7ridIuK2AzZ/NM+qjBPHdoO48ZEES juIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="7f/9tOEX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020aa798c7000000b006630be2db05si1095308pfm.182.2023.06.08.10.15.48; Thu, 08 Jun 2023 10:16:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="7f/9tOEX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236302AbjFHQjj (ORCPT + 99 others); Thu, 8 Jun 2023 12:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236044AbjFHQj1 (ORCPT ); Thu, 8 Jun 2023 12:39:27 -0400 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 DBC89359A for ; Thu, 8 Jun 2023 09:38:56 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30aebe2602fso622775f8f.3 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=LDNBAdU6OZeclVVAuG/M8iJPiG0P89Zs9Ug2q2c/9UPa2gqdBifx1GVh9EKFVpW0T6 zdpjyJjRjdJjAXVZbiFGYOtq6nOeJ/lHcq3zOf3RlaOJuTfirgcXXR4wIO5fcPg0A1kF n3kM640JPxWUxJLuG5aWXDhQPYAOirc+bMsKVCmemnJcuvEsSMvz0fb9mz2qSS71jkKS MJvkHql/qbItmkJS5Ws0AQ1aChhPQD3DluhU016fmXOb/pzgl1dFvA1uCzIVCM+dPRl1 oAk9f9DVfeVdxjN1ikOvLdiHWq1jtaDcDllrCoy492bTU1bJ3HM4NR6sO3BCAqEYqpKh NC3g== X-Gm-Message-State: AC+VfDzSM1yQ5ki2kTsG0mOqnQ7/T+1cAbGaXC1nam6DubIa0zNCQ4LJ wsBK3tBMrXiC8HTDIL5n+8Qp+g== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768155576573361781?= X-GMAIL-MSGID: =?utf-8?q?1768155576573361781?= 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: 105052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp410839vqr; Thu, 8 Jun 2023 09:51:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+/A4bnihbKn67nN/qhGKEqkV2q0+bL33ZGLHm8xhue7P1CQjCkZbLvUjzqPXHrk7/vHhR X-Received: by 2002:a17:902:ced0:b0:1ad:d500:19d3 with SMTP id d16-20020a170902ced000b001add50019d3mr6454354plg.23.1686243108215; Thu, 08 Jun 2023 09:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243108; cv=none; d=google.com; s=arc-20160816; b=UByZSlyMqrCZkPFt8Doq03crrlk4ZhzHBJM+iO4w/a3GuwIWyAADdnliCDAfHk9CWe fOsQbTGovViN/l6nN7ttU7tNSMFf2k1ZThEbTmfNTGg+nx3Zr0WlwgiJoE+rg/JT/TsH TgksEH71qGHQZLkDpYhJz4NrYat5yeVyaH4pgyJyNMLzPjNa4NmGWa13SWN6vUztiFF2 rKzyvBvpaX6GXtKmO/Pv+PPrANKgB3s0VYW/HeXp2NgAe4dPwkjo15s8Mr+lsZDteLs/ g6mPnFIEy8Iqfq+nWLvk3qBmcSt76tqA44c6M2INuh26+zUU2T/BJWoNhLNeMDra3iXr 9Vww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=vCtw9PrOLNArcQLmhG5Q8vIjJqO0AaB9WueRBaBXF60=; b=REKg8v2hE/4OMUYVxmDpFT44H2KF9A0mKIBPo4G2uwrcihSDPS7lv3LtfFTCqvCVK2 hTKX53SY+3DqnnsfsowqNcuTJ/MyhP/UijAI5RxfEtSHL4henaOvdersabnFPAR7p7Wh jpQU7qzaX13PtF88Vnq9HofftI8DvfFGZPBHfR1dv2LFJ3DY9JyI3ramghLixlW/ESaL XX/fP9IRzpgdLMgBiux+YxXh7ud/MNZk0KZPb2ZVRJ8GurgBA6NnCIr/+cRe96Z/L+aF raRB0FXxgvvllMsQIKEZ7RbXNNj7DmORs5zhubn8vDe+IADSR82JbSxq55WqMWX4EIWx 9XgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="tXL/drIY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh12-20020a170903064c00b001ab259969e7si1314841plb.31.2023.06.08.09.51.35; Thu, 08 Jun 2023 09:51:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="tXL/drIY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236602AbjFHQjq (ORCPT + 99 others); Thu, 8 Jun 2023 12:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236030AbjFHQj1 (ORCPT ); Thu, 8 Jun 2023 12:39:27 -0400 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 3EAFF2D7E for ; Thu, 8 Jun 2023 09:38:59 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30e57e0a0c7so645791f8f.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=ehaiBujlFL+xXj8g1N6QNDh1VxUr7gRnPH6pvh1iCwYzPOWhtVDtwTT6+Nqan6DgKo m8/klBv0nib/+5oA0e2UKNIHYtrVMGlFc6sbH9y3Vc5/0sNhl9ePDTEg6KndW4aF16nd YM8DR/R83W1AwmeTburkjP7cHcB6jpYhAk904+uk1D/0zWfZyID4nUxD8A6r2B3vA/7w D7iX1YdYrAL8IzOhcNISmuHvW1nvLl4G9ElOVICFXkOGDnXBrfCf9q/FekxzhH5xJ+2O l4fYsT+wkLyqP+piErpF9Le7WPJWm3iFaSXF7sa10FwkYLEYhslun0cQOumhC+2/HDM7 z4nQ== X-Gm-Message-State: AC+VfDw+K5iXpQgoRTFn2v1pl4tX5zg8oHpmCo5TueXoKdwgHPjaoBq7 bYAUGzko4385jRtaLAYTpdGQyQ== 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 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154053047462128?= X-GMAIL-MSGID: =?utf-8?q?1768154053047462128?= 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: 105048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp407425vqr; Thu, 8 Jun 2023 09:45:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46FittMke+6ZDdEyd+KIz8DFWua9xD20QRGrCyQkOikYSu/jnfq1lMy1pIFmp3E+q0hNzP X-Received: by 2002:a17:90b:684:b0:259:5494:db4a with SMTP id m4-20020a17090b068400b002595494db4amr3960338pjz.30.1686242730777; Thu, 08 Jun 2023 09:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686242730; cv=none; d=google.com; s=arc-20160816; b=qjtkGPoy6HDlv4JlVqr7YK/nnvo8YCtEZD90nE85wfYe+E1Kv/MmDr9okKlGMYOxBq xiOS8+8Dp8p2gnTwuCE8UFTL4HzHYWZWXEfIQxj/sQnnKGLtniLFVst2sE1gKQoSXt5u Ovb2SZ6IyjDqFo+fNN6e4n3vai548Z1Wi76P8cm06vOrzdUHrBLMJ8JkNWv6lTOaZFoa xKlLf9m4XFyRqhgS110692pAiBaF7MhKmWnwHpmK1MYHhhoejyXFp7wNeLW520VzUhuG BlR2nXH9NmIeoxXT9UmAw0DHi8RZkaX/GHBft6Od7gsBECcbsLyHRfsj2wCuoFdnRj28 z0ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=3pKdEbukEA9wOHrFUgiYXVQj+yJNTo3IznsPdW4CCZs=; b=SbeNnGYDXctPqypx5EcFdSaJxOtXO19FgtVqXg7omE0hk5Et8gpTsGR4lz1V611wbv jaKovNW3w9s8EHTdruaNXKL41bXBuUzF5EdH9ahsakuzwQgCcFd8hRNk9dqdPD4vbjsj ZgFWSIpf9V45Ppx7ArdiBlrwbENdCgY0ajY6sSnEVTA7ezwtEiSRGtJdY6kWhLo+MEmS 8rcmfQlzRldB0Bmx941NWeOX28AZ04CVT2LDXyetzSZFB0By0FC4bemOZjpHpP0FZ2zQ dN/srH0E0M88RWi4SOHpjNYb1vCuuTowmqZr3eyh2IVeKRivNgbhb8YMF1/oozLM59x3 PeyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=70KA64TS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18-20020a17090aa11200b0025625ecb9c1si1276772pjp.89.2023.06.08.09.45.17; Thu, 08 Jun 2023 09:45:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=70KA64TS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236354AbjFHQjt (ORCPT + 99 others); Thu, 8 Jun 2023 12:39:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236252AbjFHQj1 (ORCPT ); Thu, 8 Jun 2023 12:39:27 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D393359B for ; Thu, 8 Jun 2023 09:39:00 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-30d181952a2so843856f8f.0 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=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=aZ+y4F8sOG/9odykXG4WyCJllQxn+bPozkLyJt9qmcNLHs/7JAuIZw9G/sLtv8vkyX rWcjKt37NqxRW1TEkyD85eKJltX6gvnwfXGdrUQOWrwYeKVls2mZCowXzTooBMIMru+X PjQJtFroKEfQqjBQkG5Gp7oDTwTcZkFYz+LkZrdz7SjEKykPpQk8O/Ir0o43SnGAelFd 4D6GZVJdzY8nYmlH4ZRSfH51ecY2jn045DX6wiEAXxxME+wHclpgWtxydvsbw9xf24FK WbMJSVbMeqzs7cqK06qpIXbnsw5ZKT/KpHPU/IrRBsYvKCmXiQ4DqZf/5Z419m39IbI2 tk9Q== X-Gm-Message-State: AC+VfDySv5luN6wcwgYF2ZQPBmCPCNRfKfZ3QOAWzxMe7EzLM/6lDNUs z5ILusXV8cE+AT8kQAv1ozMziw== 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 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768153657902539619?= X-GMAIL-MSGID: =?utf-8?q?1768153657902539619?= 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: 105051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp408762vqr; Thu, 8 Jun 2023 09:47:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fK0tQD5j8oKBP/aHKXgX/1PYQNWHa1KsK6Oj/0O56KagMWS0NFIS3AtKdAkgAGdmpFCVT X-Received: by 2002:a92:c992:0:b0:33a:9887:52b7 with SMTP id y18-20020a92c992000000b0033a988752b7mr11217301iln.24.1686242868475; Thu, 08 Jun 2023 09:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686242868; cv=none; d=google.com; s=arc-20160816; b=VHS+WoBff0Mxfs9OCfRtwnC0Ogq3UMTOL2fe2VtSotNFixKRL3JogK8GSbR+dQRXGm MgvRwq29McjfstheS8b3reX8icqpvDQ5qLDBCJTivUAwn4uxg10FfMYEqwTSZRkziBHA HKvdkeP01nzsDpyx/cZ+AdrP/dgry9eHs4OSlPwa31J4prEgmBrmobdKOVv00gFgKe6c cIMyQwDen1rV8rtdNKnRsMojdXZpL59eV4pM/jRJtpcDw7ziEUNS/ZbS2Vq3lNelub3I feZy7yvZvmfj256wGyZ+3o+RNnrjxJpQa9+9CBmZ+AHh145bJRE4Max2W/kzf7WtaWse y6mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=W8fna5vAfprlhMtgok8TsdPxk4+XnGn2xwviFFs33yA=; b=M1izXAGkbTot+6CBaxO7tOJ8pCRxvLJSovDtVg7Kfj0QDGPlf2N4Iy9UNPa1C8u/W8 bZIc36OR6CxAN5hY1S6Wai48ztmGk3UUXrenbo0ZkCd6fp0nfU8lauWLHrkDm6/iHgXX CFHv7cGmu7dawFZGM1ysq6M5PBA3uBt3A0hYhwLIp4xqUAK/X+QEgHaeZzYNdpE87mdz Nz4bMJb8JYy/Mh8mhFTsbDIsYNtbCS7UQe8Oeboa+xG+OoJHKFeevOM82gHBUWF8geZX fY7UNeKj+vBCzUReqq6z92yZ+LwEwBPlvHPidH6aHjSur96Vov5YLB1WU+orY4gu2RvN 4NFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=WjO95Uf8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a17090a3f8300b002594c8d950csi2897100pjc.89.2023.06.08.09.47.35; Thu, 08 Jun 2023 09:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=WjO95Uf8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236703AbjFHQjw (ORCPT + 99 others); Thu, 8 Jun 2023 12:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236272AbjFHQj1 (ORCPT ); Thu, 8 Jun 2023 12:39:27 -0400 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 4E20435A2 for ; Thu, 8 Jun 2023 09:39:00 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30aeee7c8a0so666754f8f.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=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=GqSZWVcc1cCh/dtJ/9/cXLrnMro5aTbTQHZUXQwzBccYpILxDQ72vC7q77UxmQXVyI aSkMUSuf+aDzUQAz4eNnHZ64PyiaMftGTucPMHL1ZFTzIhP49gUrsQ3ZtTDQRZ3aEuYv bv4OUNI1w0hwKwUWxBpzeo5sbOa1Jriz+LkI2zbLghckctcfNxazchmDbzsxNhSo2Ej2 v2rB91IWh0BY+qck3XjnqE0Qs+393SXz8wFnci4OcuY/O9DojCkshvN8yi0VeyMHU07v xog+LBtF7cP4WfCk+xH1fGNgshzoChOzRcVRJC59v4YBELkKggoLWMt/Lq/ITmyTkjSX Z6NA== X-Gm-Message-State: AC+VfDxkfJSLbfs+nluiorX47O8oWFKZwRBHlbKJFfKi0FjSyThnKcQK DH48CNIg7/ynDKOS3IcB/v6HrA== 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 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768153802179030910?= X-GMAIL-MSGID: =?utf-8?q?1768153802179030910?= 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: 105062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp419875vqr; Thu, 8 Jun 2023 10:05:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nXmsUaZKG4mGItVAdrJ1FBhZVTWsLCXuzLCco2c0V9o9TuSjqpeM2wIFP5AJeiMV30VO2 X-Received: by 2002:a17:90a:d918:b0:259:3f33:c592 with SMTP id c24-20020a17090ad91800b002593f33c592mr7846541pjv.30.1686243926405; Thu, 08 Jun 2023 10:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243926; cv=none; d=google.com; s=arc-20160816; b=ie2Mp3boFat3GnLDpCIA5pELvVKrIndXo9mna4O26r0aVVZwhwSqDmk8JmolyZl/+E Tq84+mLTqBnPi4rrJzkhBRq4hc7fHIMNdllO2KRpGoyUwV0ZEVyJ/SxCvKOM71ZoVb2M jTAKYi0scJzxqkIjuUV2cC2YO36N2wSmB7p86u6UjSDhk+zkvEeG2E3DMWldVD59Q6XX Xmjh9JhtkutgLrxoj+3WngnNZjQnEXt8sSEDq2CPIAiBMOBAgNH/XNvQ+infl3xnMAIO YbRdYYEjLyE4X2UWhwipf7tIm/pCxH/JKd8GUpuaIfxXDE3aOarBx8YFMHNfs7Y96Ba4 g0FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Lx8RcPnsVd4tQ/K/CCVK2jyjdwYbBjaw/JSTSvRmWqQ=; b=KXjkP1r3S3uQG36V32BuKr35Mt5GZ5qvBXaFiJtqndu1sw7QwiavsJpLN6lawW+b41 J4vnVyCAcu7kWB3fW5gJb8lzsT18doL3yl2LVOJKcV2zNQuiGn3zUUi3gT1lwCLCDaTP 0Uc+G38dxHE/NHonLksdWxTk3JDiCiP0ts41G46p4Jvt2MfOM4fHFNs4emqxsCwueL6u zsysZTbZeD59xpTLJ1O1Lhz7FKk3NklyeJ9wxpBZ0w4FmJwcNIMv4JggsdLk1/nM2PGL 3P1e4r/UkCihaWYI7NJccEonUu2TNPZIVeTsZr/h4yQf8/opJVh+mlkVIiDfmE4saM8c Hkqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=uQbFKr4I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot10-20020a17090b3b4a00b00256c4209ba5si2986713pjb.158.2023.06.08.10.05.06; Thu, 08 Jun 2023 10:05:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=uQbFKr4I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236172AbjFHQk1 (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236294AbjFHQj1 (ORCPT ); Thu, 8 Jun 2023 12:39:27 -0400 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 591A135A4 for ; Thu, 8 Jun 2023 09:39:00 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-30e412a852dso629480f8f.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=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=fSck5ZNuhp+hn/J23DcJjB1Gi9+A9UYjYApLS3GRSGw8OeOWBA+ctpWG/EHsSW5Z75 WMjr3wmFF9Ykd+JZjSN4D7ybV5wCq2FFSbnExjjWylqL35xtJCJFDviOKbi7UJAWDIY3 WgAA4NHE9GiqtT1y/7OILHNSo4QiKlKwjThXmW7Q8J8OucqfEZ93NFMzGV8Vx7Et+e6/ eUrFTidyBaEF/l+hSzwnWpi7l7YjlZCKgoHe4hotUA5ZyPDf9Sm6YPsXXFGaqxePyiXx k4bei1ABLWoZfjxKRIMn8K3qMI7JGP8xLFcHYHaIAUxpB+rdmNwiROMlILcBX/vtSblN aEWg== X-Gm-Message-State: AC+VfDwsx3gn5s8cYy3xiuXcu+vRCjVqw+XE4NUbFfUYZvqu9v3WzVWa 5Ys0DaMAzNtjn5Ciq8g1Azs1BA== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154911237085790?= X-GMAIL-MSGID: =?utf-8?q?1768154911237085790?= 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: 105053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp411833vqr; Thu, 8 Jun 2023 09:53:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7lDLSEz5gl0eM6HVYG4MK9FI9yfDYM3SEgKa5B/zvnszlgr76f9eQGHwzzfDkuygITxdIO X-Received: by 2002:a17:902:f1cd:b0:1ad:edbe:57a8 with SMTP id e13-20020a170902f1cd00b001adedbe57a8mr7546306plc.50.1686243218185; Thu, 08 Jun 2023 09:53:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243218; cv=none; d=google.com; s=arc-20160816; b=YTqZ43NK+j8huna66nmvly/RENwgF7HO7hV3erSED+CYxkJtWjxUNV2Vp0ve3fD331 a+TN4ThKjIJG9Av88Twzif9/VyBG7xeAj14zyViw8BCNjxRaWZGyw9hAWEKArw0A7nQW 389P7ecNkVPUelrVtKz81YPfJQUAB/Qlc8gDfxCy2UmuQ65DO+t0E6r1804MSRrPeNIW QuPZvt69YmnHyxMDY9XzHFC10wAnR/z7ozXyKnAMX/j/8eNZ71/kClbE/0Fo78smb6vg i9Wqu5eV/kEzkfPvnBSJw3/3laerpSMj1mjwHaMqaMGD6EB8k3vGUvupXI1aUXNmvV75 OhcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=czHHBif6b3JNPCEfCU3p0DvzKEkPWI28pRVwFLD3TEk=; b=kNvbhoCFgf9w/F6xwOQGjnt4z+xGH/G4kNhFvRFfx1RNKnJHTjxJ9Pifs5/2JwFlzG n7VBY5SGxUCYJphe1hnl4lyz6EBu6m0PWmE6Euu5yaUSAQDhaHfb+A0D/4XBIV760eXy Z0XN196ZpsURWN+Vy8jgT6uAxH0Ou4ElyL1oHcCfxBJ/3g30ElnYIYXGSOgZ7DGcM/4e cJj3GIQrng1zanrl6Iol4T4OFNhoOE1xnB4Bk2joy8I7SWyF30qaFeDsD2paiodpfnxt 8XoQYiBR1DDVL7qlLF16tIms2Pr7Rqa0eY9nR/bnscTh8qF/wD6KoVte+8YUTxXHUBMz 9o/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=75gqNSzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902eb8700b001b25e9a76d7si1274083plg.316.2023.06.08.09.53.24; Thu, 08 Jun 2023 09:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=75gqNSzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236601AbjFHQkc (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236396AbjFHQj3 (ORCPT ); Thu, 8 Jun 2023 12:39:29 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 745D22119 for ; Thu, 8 Jun 2023 09:39:04 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30aef0499b6so619242f8f.1 for ; Thu, 08 Jun 2023 09:39:04 -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=ivM6s/hd2pW9k1D+CQEdkXOe0HCKLxanxOOhsm1lp/3DaSsSDTPOd9SUqscbraJ6js Llwjmng8b2nACaGw4+5ii3UhME7Wnbhv0pp5fnwo8r+xv2Sih4TH/20MGRKMd2uPAJ4s 8Cx0yASRrqY+7/HkO8+RO8aBHUS+4FqGauIpgP9Ub6+/f2sGBD1WhY9C03ykQ2Fwbrae gsxLm+LSC6IhU9sk1KLg1FVnAsZKbEMf1FMzio/C/b4cPbETUmgLWBr6ieHqxzyn1iZk 4qf2yKHtmdoLT+5FUpdtesnUWV5F9Ww+yFh7/c9VBBIhH2/lU/6gcB8Pnwlm3mxeV+SX abjg== X-Gm-Message-State: AC+VfDxba2cSxaI7kqRIFMipbWv+eWyHX/IRQK2Qn/vZyXAvJmx7eEM+ ac7W2wRTuE7F8a4/Jj33n0oxyQ== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154168965264072?= X-GMAIL-MSGID: =?utf-8?q?1768154168965264072?= 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: 105045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp405247vqr; Thu, 8 Jun 2023 09:41:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W6ITd8D3JZhNATnTmWhCkB0p6OgKbsRfRHINNFcxcVpf6elZ8bD3RI8Zfl0+HVpkFW3B+ X-Received: by 2002:a17:90a:fa02:b0:253:510e:130a with SMTP id cm2-20020a17090afa0200b00253510e130amr3131501pjb.19.1686242488925; Thu, 08 Jun 2023 09:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686242488; cv=none; d=google.com; s=arc-20160816; b=vn2PGSvqHQhu/CwrQyFLmeLpCXWgNICaf/6QdjGiqVqSWKtCeiTR61wJ9B1malSGsW PnicqPSYvE9MRc4xHyTpS7CwRxO54B9b32OiBA/f8pNUibeNwJ6UvWz08u5AhnN+t9F+ 8VYloqN+qtu8pOUZzqW8BhR6CjMJfuuvVEcZJRVOWtRPZC7T67e3SCitW3k6F9/Gw4fr PnRc8gtnxgwq0W2MAWTfqPv39OvMWslO3WMhKwBajmrxyMLkJ0hSSSpl2VVqU42lEX82 Jtq2NSV7BvY4GegTJ3jFsxJD/6TKHBMi3JRKSte2zvkYY4LilShP6xsfiyz8PN5ORnrz JPSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=DG0t6hTRy1TiyueGnVsxEMjDQDrpL785hzWCnX9OzbM=; b=vpVcjR3fhgii3lf9RCal8yyRUf3SuZ0tZGcy9tFAAOqMhuVsO7V6CcHnK6z8JTcJNf TLNIdNVYL0m7xJ6V/N7pcuhbCvVazrUnlpLYy0tMtkB2VnmViMn0b5KyCYFREbDjOP2g JkhPzIDCKDTNZWwNw+EwpGVTnoF/g76VaAA3D7/n0tx4hOpc/TxP3w1VUP6LxHbZAS0H J19h9Em23I64jsARmcJ5NStWbBN5dj+pJeZhrrkz9RSjwWrXj0mi8F6yFsWHwP06ogiC d0qOflVqKC636aY31pT6UrjE1VNgAhUDwa44hlVMxE49vQveKqwA3ig3f4wEYgtndHY0 tqLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=v9od5LLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170903304200b001ab1411f3e6si1243962pla.260.2023.06.08.09.41.16; Thu, 08 Jun 2023 09:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=v9od5LLa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236806AbjFHQkg (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236449AbjFHQj3 (ORCPT ); Thu, 8 Jun 2023 12:39:29 -0400 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 534E62717 for ; Thu, 8 Jun 2023 09:39:07 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30d5931d17aso613310f8f.3 for ; Thu, 08 Jun 2023 09:39:07 -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=M7+vKY/yEDksiNF5pe665lWnyCDsdsg/B2pedjv4oDUFopGz5WLakNg1FfrIODmbP0 pIJH3kK5mYOHQwXDqhTX1Lu39s3KEr5mSTo89jCyfA6PuHZ2ztNbmFk8Gj6cROGLBlMv xuuvsKDsr3CMS3fDzskRTI1GaDo/Jk9nich/wLmEPn4wQK6CIEttKTs7Eq3Ght4PFlPS PB3R1TjsbkN1MUT/44SFw78AlIUowcYLSKCt/tm6/HGTDz75Ib2tE8gGCmDTZA0Y6nGJ p0RgAZOgHPCw4WJctV/bSkCw+OyhWFrrBd51tiNWuU0fDwHfyhZeEcA5Jc/j4O5+PPTn wiDg== X-Gm-Message-State: AC+VfDzX2jorytiBy9qytt3GTukGWwFxyso+SUx6QZPIBxWivsd5Kbn2 LuPGB4OQV9jeeothrQeYefW0jg== 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 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768153404233695583?= X-GMAIL-MSGID: =?utf-8?q?1768153404233695583?= 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: 105057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp413653vqr; Thu, 8 Jun 2023 09:57:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6J5qThGDmCZQwCH8RIn6jnXq37uzVGPQNe+yPwUEFPpWmTKGlU9eYAGJeRnE9qHbWVSiVV X-Received: by 2002:aca:2b0d:0:b0:398:7373:6956 with SMTP id i13-20020aca2b0d000000b0039873736956mr5074618oik.5.1686243433818; Thu, 08 Jun 2023 09:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243433; cv=none; d=google.com; s=arc-20160816; b=EETypuaHpdMKivnmbBBJpW7/VsTWB6838eQJkG/bNgS4sRKOF/wb4m8yDB9okqQNMT y/KnkS2JTQJnmuAyFRDrq5jW4ycFJcJ6/qfHrduY1sIZHbZ3nMCJsvQ5jE8lIby0fTuY jAQRD5FpbPH7fxkijm8KPphvt1LPkRsBLt0oal/IKlHT/6HPdtbD7bi4S3ko+71UpD3h Nr1VYplGe+x0SGPoaIIFXPoUxOVWJA6Ml5w5eyy+dxnZxXiX5Q4Pv5BhbIk7RJDiO3c6 Mif0ZS3s6F02PMp2kePUB5VHexMcE6JE6+muDiSBqyYvpwW6Rde75lDpwy2tjHuavLT/ +iEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=z5QfjatVBc+UOU/sh03jIPNVrbTRG+sfLrSsyGdKccw=; b=06ZM28nC7LExFkH6/jLGZBPtLc3F4l1537HTHnl7/CcM8+ottbP3/YdW77TY+kxs3U ROXjkwbo/jfvUvyIqMtdHA4jD2mu9wLjk/eqlYji2qtfWxMD8Pmk4+77BHA0R4+P+jqV Et4kqipX0RbP7xaVhlO/fcEWe+jnyeKYhrbLHgz0KmFAXpz8WqTMW24VplBO+EVP/f7U lnN465NVOTb7Le8aAWPwf3qs4YJOsG+v4u93X8PEJdjERgkc+Lt4F3kiaYOwf1JScDSO A+hrHYHDARleJBwIh/ukgfoWV+ywB9TodvWcPYjPLkoR6Z/ANffYG3v5gtBsNke8w2IH 1xJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=FgcnTgDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b0051b53285341si1247409pge.277.2023.06.08.09.56.59; Thu, 08 Jun 2023 09:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=FgcnTgDe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236828AbjFHQkk (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236523AbjFHQjd (ORCPT ); Thu, 8 Jun 2023 12:39:33 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D00F2D69 for ; Thu, 8 Jun 2023 09:39:14 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-30af0aa4812so647396f8f.1 for ; Thu, 08 Jun 2023 09:39:14 -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=ZeTX1bO3wpRH1yyeWazL7sIigrvv5EBbGUVpsdF6V9DpaG4howXaCOkyeJIDEqchK4 1pyayuJv423YFvfhpH2MXVy7wlOCctrcZ0x9lTV/pWL6dFSx8FU/xF0vNR/gE/gYTiQ1 Qx/iGBXtvOm0LuhP80HwYHTbDuLsPcBKklqDrgFicW5SVxzgm2aHm2ZLhmqLvcXGZFcl R6LsYeAhvtqdBgMsgpg0nJ/4Sevnxe9fs+yvGjLraB4x8PNNpj/EfzomDPirEzcwJxNo j/G5yc/Om/AB1nOt1Ovv+iPffTOrTRVvQFF9UxSza0ZwkVoyDQDona43dEEwwBMiYV70 x/QQ== X-Gm-Message-State: AC+VfDwFNpRLZESYKVp8D4NPpmVd+KWDQmXPrhoSyV94SjmtiGczKY9T sK8JIk2bCd8XlqJSFixrj5KM3Q== 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 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154394921827701?= X-GMAIL-MSGID: =?utf-8?q?1768154394921827701?= 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: 105060 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp417149vqr; Thu, 8 Jun 2023 10:02:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wIKBYmoPand9Qf2SfmVYfqSeBzSlrbNH7ai68eLrejtxAF9BXjuejCg/J0qu3Od3nhA60 X-Received: by 2002:a05:6a21:339c:b0:110:873a:c3 with SMTP id yy28-20020a056a21339c00b00110873a00c3mr4526933pzb.59.1686243734414; Thu, 08 Jun 2023 10:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243734; cv=none; d=google.com; s=arc-20160816; b=cK5/0wxQzDN+Whpgq/MHe3jTuhtYhe/LZCj4HK7Swc/SYcokMb/X0+hsA3V6imt2C+ HvMmRxItuy+U+7sDHBrSKKaqgl82VcFp1wxu44scsuXlCZGjHVjWZYvxsu3xnLok0D52 R8sdKqu8z1reeqrOCKhp3MY4K+n0MGAgH5Euemeg9yJYKjG86lc6G3oQqL14AvPGuVuO Wvk7veG3ijtdCv5ebPVPxlGczf4fheLhsXhkPqxifv/gj3DOl+EPYA+fUQJL5FjPVrA2 Aq8fkDwnwG5vzoLJC9HX3aIjOINKOdb0Sui9a5h6Z2cPIRurCeP0oIDFiN/y9hG2DVal SjwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=0SeIVqfDIJ5M+hwTQOEMBeQrB+d7nlSQcKhwVwTtbA0=; b=04/AwKG1rUxJCiOUROu1YtiWf9toG0p7VPljcC5KMTDqT5fxWo4RUMTX4ClhX2NDcm 9mSre7l7StbywIwBWDeSSw6CAZJwv13XQuZu/ho6PsTyin5UICvJ593yZOysFK/q2kCk Tu8QnyOgyFEjwXeIz0PdQPlg0S33ikILBBMG+7SenH8CWvk1h3brkb6aizZA65XyaTzI iV6mH+LTfzUCTMnlCj6ym9MNnub/PdIdtGfaVKBlumbkWuRtPyYuIH0oJhBko0PxhiAj cTykQ2DYfTXcn1z7NlNVX5ARnnr8qUG/tQvbxrz3wC+J7xZ1MJ73bzzVUZRmFSZx/Pmj ni9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=PKE5oK5K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g136-20020a62528e000000b006543a5c8fb7si1025565pfb.286.2023.06.08.10.01.57; Thu, 08 Jun 2023 10:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=PKE5oK5K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236908AbjFHQkt (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236600AbjFHQjq (ORCPT ); Thu, 8 Jun 2023 12:39:46 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49BB135AC for ; Thu, 8 Jun 2023 09:39:17 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so857811f8f.2 for ; Thu, 08 Jun 2023 09:39:17 -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=UVMuBUFqV/YQHiSCTkoLIwApRBUV8EFVhWmx9fkRHsuCG2h0JoGw1JteDGx3FEmy0j RF2aTq9zRZIAJ4/cKDVT1Kg9lnyQbPco5ewWkWS9Wwnu/R2XHoM7eSS0zNQTGfUa7pxa tn8nrZ13DX9zzveVLqdQYjCJrS+NqF0Mw6BBnbU/3F+ZTB6nw2UPZ2uuZ2uFSQUlJ15j PwSo5GvktD9A2q9rMD0jvP2pnF0yZB4GhDktFomeFN7QWi/tgk396oVeccahw4+9SMva OkYMtnAgD5zC4EVdH5Y4o3quj6CtFVJnZjIVu0epmiWuHLSA1rAnGhkhJuwZ2RFS8vLw LiBA== X-Gm-Message-State: AC+VfDzcXmUidcFs3fIbH8t1HSFu/9RIYmzAto1oqnh3ThgqNwUGk2ZQ yTnuwlcEOgKMl1VUOp7VaN6oLA== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154710140620526?= X-GMAIL-MSGID: =?utf-8?q?1768154710140620526?= 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: 105066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp425796vqr; Thu, 8 Jun 2023 10:14:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Sd3TcU5+Zj/f9oDKJvsBK7iR7JPAdMX/cejaMQ5dskqKvydLRgShBKCni23ZFwczZKFLZ X-Received: by 2002:a05:6a20:e687:b0:10c:8f0c:f81c with SMTP id mz7-20020a056a20e68700b0010c8f0cf81cmr6893900pzb.53.1686244449631; Thu, 08 Jun 2023 10:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244449; cv=none; d=google.com; s=arc-20160816; b=SOa8rmTBQgEejwG/U3Mw93C3p+Mup4X4TcCD1+DnjXLjsle6fkw3ORoqFiH3U4ZAmV VxdQ9CgeNqOi0nBVP9o1jQmwmj5i2pIK/REjgvzf/9ZibZOydtdIwrFfDFILej9p1mpq 0tJr0YIiBQtO8bkrgi++3LnQd7vMPAFXOM1h2AvidYEOFyMU1YtRUEfGGUTztur+wjDg D2whxIqX9XMGpgCuHJdZAkhIdm7xs0pKaV6AVI0ZGoHFnisC7jdaZHx18x9QeF/x/q9J PkcEWuHN90uV5Gyxb48O+6AASQ0hQaJUm8EXn0lxBW7P86ejPz1O9RHkFzWQW6o7iEAn Sz2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Kh1r2jxB7ScuO/6zF4R4uXq5Ks2IDFHVjEbkZQpHayQ=; b=ssrEWH/Gu5QBUDoNWDunKTz3ae3lseO9jlXF5Kudv0i4cywf0EsDpRqiSp6s+vbWzx jfIaftXMwXqRD1XrZ2HHc9Zip3ag5SjfyWa4J2JXDJ5Sq+2bTfPiGY3Ms2hsPYv3Uq6u n/CiQHaOjCvLn9LnE7pshTzVumqsuPbqsTJQI269llMdgVXmN4tvPAG/8rNVZb4DTBTj UkMb1vhLVLGF3IN4LJv84OQB43AvHu0/NQUOrVS8Ub01kLiKNPH73eZl5dOGwegDH5Lt //qKckMXoXgjavrPS8a8N2a+dzFEFNyy5awTlWXdNSfUPr90/k5FGzNEXF3A+/Bo1GwD 5E4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=RKqKzS8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020aa79aed000000b006501b3c2006si1115202pfp.61.2023.06.08.10.13.57; Thu, 08 Jun 2023 10:14:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=RKqKzS8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236870AbjFHQkp (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236634AbjFHQjq (ORCPT ); Thu, 8 Jun 2023 12:39:46 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8A8035B3 for ; Thu, 8 Jun 2023 09:39:17 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30ad458f085so671982f8f.0 for ; Thu, 08 Jun 2023 09:39:17 -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=GPVPMzwcFypZIj7g8oehKtHyZVFQYpiB2vGOnaydJz1FttpsLJ3dByOPeZ9WZ5ygyY W/r1/hcPXMxar7hgA0CgzHb5+si9QClW6VYCmOkeb+lOKVN+k+t+zVIpmg8xYbOnBXvE SjJAv+dGtdux/onjELj/nwOxoMVSiq1aU0r7JpF59hSittP2WltR4hNvaGJk0d2Hvba9 Dwq0HJhIDPy15uaaR2SkJqyAxOOB8oBXFf8l3/4adKRrBWlNMYxsG181S1ZHdOub1IjL d/VgYGebxacVo0sDn2qypFIBBuuJ7AtCVvbTnau7MLgHRl9Bo/zIGtJfkSFQ12xo/QWD zzaw== X-Gm-Message-State: AC+VfDyRdxSJEdslCHjHt08G+PSQ+pLuM97p78kRnkD1uzhHsHTceUXE aW4JuW96Ztj9svkCnHa2P9VHRA== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768155460111214450?= X-GMAIL-MSGID: =?utf-8?q?1768155460111214450?= 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: 105055 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp412060vqr; Thu, 8 Jun 2023 09:54:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dckby/tsK7w5dmZoWqZMR1Hf+9ImgnZrkbDAF/C+3L54KBq9eEjIzzc8kWqMkML8b9AyE X-Received: by 2002:a17:90a:4ce2:b0:23f:962e:825d with SMTP id k89-20020a17090a4ce200b0023f962e825dmr3169029pjh.1.1686243245888; Thu, 08 Jun 2023 09:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686243245; cv=none; d=google.com; s=arc-20160816; b=ntYTi5Ah6yuyDX+Jki+AoKILRe1hsyDfom239KHgfPwY4LlhiILEeZlcXMFJz7KDgy SyKGOmvR8AStc++YoaFFZuqUw0yudpi3ovzr1cjF2HtAHm5a6Gn0TqkY2qH8/+/CXLKM od9LAPDP4JzKOQMBpmVIDtUm3pVc1b66Bp7/2KYfcFKkO5eSBDEFOEDgrOLecQJVi46C VLYa4Ew4ItjzC2mcYYmnd3FhPCv12XBEVvLKEWqjlDoGzR2eJfyx+hR4SoPywYXxvTye DfHTR6EH8TaYcTecVR671DBUltxaYkGerFBwRqQpFzINTLleUn1sItKtq+tpfiqsiQQM Ur2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=25ZaF3JsFYErEFoIbwPYOVDqmdE5+qzB+30gx62T0y8=; b=P4vgTajVy5+WEBfHrP8mgYk3EhFC8g7Q8xQAqc3WOzyKrHOjP6rbxvJ3S6LRkl7wKE dy106tWjS99kuwBFB4AAtCuihyb9whUin2qdEvsAqxte9kEPGW9VG+z+L40YAIdDbYLd 1km1MwrSyOOcaWlm4b8dh5diRP4nPGqTWkGrk6YUWRwEciYHP6KM67Z+jOeWjMhczrnP i0Xbch17qyejtCfnW8/m+qTgliFij1oTfgk6FoVnY+lagizADowtOYCdIl8t+CXTIFVj IzQWfga4GBA/tbgVPtkH/6tWH6q84xHe7y6PE7XaTlq9lJOPz8p6oO7Oj5D9u37S7ypT rapQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=bLE4kzr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s61-20020a17090a69c300b002477fad79d5si3025743pjj.63.2023.06.08.09.53.53; Thu, 08 Jun 2023 09:54:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=bLE4kzr1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236730AbjFHQlA (ORCPT + 99 others); Thu, 8 Jun 2023 12:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236660AbjFHQjq (ORCPT ); Thu, 8 Jun 2023 12:39:46 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05DE835BB for ; Thu, 8 Jun 2023 09:39:20 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-30af56f5f52so656468f8f.1 for ; Thu, 08 Jun 2023 09:39:19 -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=ZXUFQMihVGyTDH6IhxVoBLVwADlcXS9CHqThRNdvX3tidnPD6xPT5o8qyUOHf3Pbs4 RP0Z0+HYB2cj+OhvoE4OOVeSIEZc1yZeRFZ6F0gZDXdAMhh/DtK0sGay7e9paa5rgGp6 1KPR1uAZbi/2p83x2JME3vw5CMqCzaGosJxruCBECZvgn0BDnEzzkQUppC3FTGzJ+2+x V7wi8kQc4faWfqLWPkkOcaWO+b8TjNY6mxb5Mm2dPVwfMrnlxoptBF4sEVFaRYhn+k7k 0wrQjC0f86OyX8+NdAAlHaqPYxRGpnh63WWyxNTZXGF3wdzwA70GAuUZ+ViA5s7o2lsm 6WhQ== X-Gm-Message-State: AC+VfDz6g7PzGPw3iHs7RxfX2GyTWubEQyP9p6fVSKXkOVaahQwIFHJ3 U2MnKm4WKZ6l5XEiM4AkfvaBUg== 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 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=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768154197957845265?= X-GMAIL-MSGID: =?utf-8?q?1768154197957845265?= 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: 105049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp408187vqr; Thu, 8 Jun 2023 09:46:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6y4jvWDIWiNRNiXjKigSw3fmcyoU8z6UJh9zeFlabEmOJkSN/ti5gIQCYM8P3E5ef5cItj X-Received: by 2002:a17:902:d2c3:b0:1ab:253e:6906 with SMTP id n3-20020a170902d2c300b001ab253e6906mr9172019plc.67.1686242805892; Thu, 08 Jun 2023 09:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686242805; cv=none; d=google.com; s=arc-20160816; b=jx+c0SFaJ67qzRsD8kxnhNOCEC6KzmJgQiCmlCBo2BRmOw+X0LrUu6t6ThWAnxtIm2 P6j38nlFcSoxEHLoaeXuHIhSFqtql2uzvvJP9XOXeGY88CgtiTXQ19sJ9arX0jvFpr/v +ar5C/cgbJN6xI2uokJg+CKcXnJENl1FkxchVh1zJoyMO7y2qon1wgYuSSn8Q98GbuAk Q9Ng0r8MRoOpjjswTBzM42A2ntBpNqk0VosEeMyoWUfMTpq/Dk4q7vqrysUOhhNNDpAm lodUKWgLdK6kOe4LdDCny+u/5YimJNDIgM4JrvRSJDiwng/5EPIQuzvGgRxRS4Mp+SZB t6hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=lOuYSg8J4w1AyHg8USLMCe+g5bUzTKHHhFPUeoHmJUk=; b=HzWznA3NEkGULIqd0gbqNgpSi+yNF5fPb2hoi7l5EzAXYXWF0DLhIHJUGKo7EX/AFP z3f0jOYHK4pPusTkvj84K6mxDKmTwijNzQbho5N1GaFnuadvnPpnd1losFKT+dcLIY2o B7np3t8VtW/Ndz7losuLZgWhdx1QqZ1YiQ5KOmW8js7aC82ncnD2rSowLs/o1fGuOK4e loyZC1lVzZJsVSbGSwsLeeRyppSeene3cKX1Mhz4LWSbPJhL3ei5Pej1B0UIOeiUGBPJ 0jgGpk0zsEij8vzHPPOCesYcdLQiz9JdpQUzZORVPRZ/J7QZeCn6ZEZGeS+j/rXrGNRq BC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=6W8hni56; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lg3-20020a170902fb8300b001ab18790b12si1318277plb.97.2023.06.08.09.46.32; Thu, 08 Jun 2023 09:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=6W8hni56; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236700AbjFHQk4 (ORCPT + 99 others); Thu, 8 Jun 2023 12:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236671AbjFHQjq (ORCPT ); Thu, 8 Jun 2023 12:39:46 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A25735BE for ; Thu, 8 Jun 2023 09:39:20 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30ae901a9ffso832154f8f.2 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=TP7a7Vn5iwFVNzPotc5sq49ArLsouZJguyhZIwRmjImRNFGJm/RBxSJBFIsznz18iC PXGTi6D6sCLDHJVdXZORpHRQedGnunjdGU/EEDxJkgSwqtJGytBr8NQaVrdLdcWHXlXf NgerMqyPhwiI4UKiZrIIJwkUmePXL8E+6R8n1g6kew1uDXYFbPYtAf4Uv0b0maBMrs5U xiIl1F+gh2Q7G9sC6ebAryiK1vmbgaa3qNoKVo8/L+HePnZRIcTH1O0OEF29hf0mges0 A0k/fNtrkUPave1XiAj4tnBwEOjgDOcpDcFxr/YYxYMk+eDJjMDKhRZqUUMEMp4+ie4y L6qA== X-Gm-Message-State: AC+VfDzH+n4L2LOye8DYD9b34A1M4QnWiz1z5TemPie6MGdihW/071tY AkIeLcDy5wNrFZ6TuQ9vaD9Njw== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768153736697767327?= X-GMAIL-MSGID: =?utf-8?q?1768153736697767327?= 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: 105070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp426749vqr; Thu, 8 Jun 2023 10:15:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QS5iM30y637aC3QeOH8HV/BkigzNKzxOawK+LNHP6+lD6tiQEmQchVjEUBMWxvjE2y6j2 X-Received: by 2002:aca:1204:0:b0:38e:8e21:d044 with SMTP id 4-20020aca1204000000b0038e8e21d044mr9172714ois.6.1686244541508; Thu, 08 Jun 2023 10:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244541; cv=none; d=google.com; s=arc-20160816; b=xg0QaeaPmrQ/Smyao6Qm6x6lysa7Nm5+wvsOCXtUtz2G9bVtY+IhC+7FdkPEpDDuab ZfKkaLNPS08X/oC6Y1kWJTmJvNH0d5dQEq03LAubmLnKg5L78BAy+TebYMsZ5lh10LPf jNndWjiizAPXu8Dc/AdLxQtKS3nSSK7HyCdM07I4T0B2uHAx17p94LaiZnMgttNTiRex e9l6s/pCzYBPbI3elSYmwbQQC28cMm1xjnPMaO0E1yuz4g5mFlPxQD0dH/xpg+h7CikO SiL8W0rKL7K6Bm9AKAzVpVzKow8qcd481aydN3J3lKFPwWSzJJ8oIRF3WU4ap/w52EAZ vKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=JRNPtrh4/qtNxd83RxLqXaD6crOweapuAV2/D/pcw+U=; b=kqemLlJ7KQWjbSjFFD0NQsBgwVTGSdbNexN9GYwq1fJ+ONWStPGjTFpuRtvDyRvOJP yjDO/7o0n5fgrflVdMZ3JsPtPrZUCpS9sdI0MCmUOw77BQ+PTPZAH7lDl9Re6GlGz0PN q5Nt6hMnJyXxgRJMo6ZhOFdA/9682GAB3CcnuoGOnZHSZ7aBbApz5SGEHpzekUl8o8FB PQTUkCuwjkNgjK+XwCmNGPQp+jAdeA1UXyainpYi0xB8CN8W9IcYSIUitNXBoMdWvQ5L Uy6HLCquspCbjjMBVOdK/NADZgTVz7DggJrAupf7T73gborWgZ+Eoim/qS1f5IXeRyWf H3WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=Un3Fkyk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a17090add4500b0024e059b55adsi1298780pjv.116.2023.06.08.10.15.25; Thu, 08 Jun 2023 10:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=Un3Fkyk4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236809AbjFHQlF (ORCPT + 99 others); Thu, 8 Jun 2023 12:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236764AbjFHQjz (ORCPT ); Thu, 8 Jun 2023 12:39:55 -0400 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 4EB7A3A81 for ; Thu, 8 Jun 2023 09:39:21 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30af86a966eso624247f8f.2 for ; Thu, 08 Jun 2023 09:39:21 -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=Xfx/EA4vcUHUlrJW1fT8ZTl0WugAUb5//Il0wrJEBpeRGGe/B6sB27D6xqU//pg3qs 0dcGqgbw/32VJiPYWEThJTt+bgXkUPYoqorpgoaWX3aSUNWaK8nI3II4Y32HcMXBTTKO kqA1g44uYn47iWTBaOl8jGrTwFhwl7ZiSTk2NfK1yO6Kv96AgqxpQrDNg/co4KItNXHO q2tEHZ4ddcxtHy6sRSCCCNY3jWbBZQmg4iTurZqjdqf0wT1NmQIXZt2Qt5l/bOLgxa4U F8yGudqsdDQv/vcK5DTsEQYVfG9KMs6Li95cuO4XKc2wVESBU72Ftudi1TNJhHNgmsIj Wg/Q== X-Gm-Message-State: AC+VfDxIssWfwJQxCo5flPgl4RJ+PojJp1RPE0em6m+QO5eqSMR7dkll V5nxidLLTFptXfNHabKY69q0bQ== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768155556567915171?= X-GMAIL-MSGID: =?utf-8?q?1768155556567915171?= 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: 105068 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp426248vqr; Thu, 8 Jun 2023 10:14:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yGGsJ+qsDIEOHvmYRArJkSmrhmIJIMmGhxl69IJSPwaYTN9+NPHWcPQCdYrMUgVN/i3+b X-Received: by 2002:aca:1717:0:b0:398:2f92:65ca with SMTP id j23-20020aca1717000000b003982f9265camr7679395oii.7.1686244496457; Thu, 08 Jun 2023 10:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686244496; cv=none; d=google.com; s=arc-20160816; b=Wd/QEXkxJNGeP/VPYXAymHw+OnOo2cb0wTXn1IaObaqhguAJLSks1Vhp3n5Et7W5BV 2A9KSVdh1yL0SomxzKLQq4U8knOurBLs4oTykg7vi1RGZptDvzE1120ndXkqbZUaRP29 gD104HM8ABpgaoQxO5X00S8tF72G6WFZ4qEf1njnzLl4hj7+4JcfA4nH1ETjOUKDQUBo qy67ucTv+bSt2kz3MwMjPRb3OMC2F2X8olOgcBZ9kz6nUvC7+AgWRWsVd4NWdCVI0f3Q 3k1UKmzzyIzS+acpwrejJPOyhcNdUXg8a6LWch+1YrbXacvKcnRErpp+dgVyRSIw5NaB O+mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=eNE3c3ow4HLujfggwGvIZJSwJNji9SiemeAOxLRnRII=; b=0lKaetHcHsIXPB+uBj43xCTMWPfVg4CSFXrIEKI+AHA8y3FnQ/PnYMXRcHFAOsOWm0 lpqaAV1SwR53bxc4yweT+dhgmQKqDy1g4qitQEL1qCBNjhJu1q71Y5PxJzWzfDy/YIuo kCAdYFPqujvMRWxpjXb8efi0GTeuARjjKg1VXgM8d0bCKhtsiUa41sNB45ThOQ3cVdfN 9rE5wBeePVrKPMUa/M5MhF4/ZkrlqGPnA0qiwNoqBsIKMJBkmcV2dAHN4puJFfUpj04r MGAysn02aqdg08Xcfq4xRRXsQySEZ8HVXKz3BDp+dIz8Qz8uK25RL9YSnDwHZRMMYDZA HNuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=QBhxRYZe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020a17090a6d8200b00259b2afc651si3011619pjk.62.2023.06.08.10.14.41; Thu, 08 Jun 2023 10:14:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=QBhxRYZe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236992AbjFHQlJ (ORCPT + 99 others); Thu, 8 Jun 2023 12:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236843AbjFHQj4 (ORCPT ); Thu, 8 Jun 2023 12:39:56 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 158433A92 for ; Thu, 8 Jun 2023 09:39:24 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-30d5931d17aso613454f8f.3 for ; Thu, 08 Jun 2023 09:39:23 -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=JvO5kwfPB+PntvlRVLOlLUOQyQ2xvC3tiibC+UzJX4lBzqo03cG2ZjFwxYEiuJ6gfg O8ub1SLmhP3Xuuyvv62mII4V5LfYxGJQZXRPVj7ty02MbziIkx9SQMweFlPrblimYNoR DLsr+SJF6wtMUehVJGxwQZpkN/FoCYF26n7Q7hSDJw0XHqc57PdwrjZc+SGK4LHcxXu7 5hyNh6H5ZX0w711F8Ti7KGA6nPlwix0PPTp/tBdkNb3ATpUJUmgx7T2ayHwih4YRrKbZ K+A5SH7Rk/vDSqL0b6gKwwcwr1/wACesxgFuyfdlsZEbLg91Lcckc5kTFruoe7ZTEGu4 rjmg== X-Gm-Message-State: AC+VfDxhdvh8FVgVTiXSH1MVzK0E9d2xPCD0wYlyAWJY/YD894it2t9+ ZqCwp5svrp2YlhL9zBXyeN0YQw== 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768155509050554682?= X-GMAIL-MSGID: =?utf-8?q?1768155509050554682?= 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