From patchwork Wed Oct 11 13:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417416 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2084.outbound.protection.outlook.com [40.107.7.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A74C1F928 for ; Wed, 11 Oct 2023 13:34:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="loeUqTS/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fB8axuVBy30eG0r82c2FVmWSsseLSXdYq8hDJUDr2lupPyln8QNwQf/9ugdQQo9SdMLOGeDrnhUD4VFovJaA8+UAiKtVHiLL1m9ovR9xoapGgnYpAFs4UIaFTC/Mbo+Guq6DSteB3VEfBfC4TOchHRqGSnyibVOwsFJEh/tlWn4G/HUU+f75gAKFQBmZv4H3FNafrPEsWn5A8JzxLZ9bgU5KmtyE6z+EauaqaG8APyj4zo9BzyjQKHcni9KYBJ+NKYvSYVip0PchJfxvDNkVbtRfjaG0WRfFZbpz2xusQ/E/7K7dt+gJPLaook1mjhlqpG1ntAL44WQvBFyYv0usOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=59Up5/dh7frhV1A7+7v9QalZdCarW+2Pb/vIvQG+bh8=; b=XJcxmicShUVBkeBtTSnegAFYZxxjzLA3AZ3ou+31WAVBbqTgRIr7z938AIdqsFNdL+k7Yiij4AKYVt6kLHKBLMhTfYtc3kyX5KLqFkfkQo3gV3tIofW56NJKJcmCmoHFcoBy2WnhAYFrxQ10QW9O/Hwsue6xQ+ju23AuHxuO/xn0/YiAIZn+gaDBVokyCiJzjJTkGnwQZjxROCvQIVrVkXJf6EBuJZi0fMnZh+nFeidF/CK6+KXbPgPG7CSR5F/2sSOQSV6GSX5fDSXeDomss9qRbSIv3tAjN+cOo9Pjqp1hjzlYrR8KwVXf63Al27V31HJY/S60WzhryMFWh5N8gQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=59Up5/dh7frhV1A7+7v9QalZdCarW+2Pb/vIvQG+bh8=; b=loeUqTS/vwGXAZd7v2LrGbx/CLFJiTjYPEPrli5zqjoF3F+jzqVK6xN8ngOE4/kV72MbKoTott+gocWZgaIShdHW8gJDscTjEOzdJMQd9GNLWu9Q9l4cvr6+wLqHPpKiMgV1J9qe5NMGvQXTaKq6ZjKI5a2sKo+rdSRptO/b4/nFSm3LXs8/JUUuPL1ksXA0/cpxDTbe7mG6BCKW1SQ+pQ5fXL0iKTw3op89LK9t1NyfhxegXvSubfXkiIkmAhnxytDJ8bt72HvvI8lBKN25lPkVt9EX8rvslpvoFzyPpimfrjDIscbkfCm/clX73eVmTCXB8utS7uQ5RWzxgpzDnQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:13 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:12 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Matthieu Baerts , Mat Martineau Subject: [PATCH mptcp-next v14 1/7] selftests: mptcp: join: correctly check for no RST Date: Wed, 11 Oct 2023 21:34:56 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYWP286CA0024.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::9) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e7067a5-9307-4e31-825e-08dbca5ec199 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: No9Oms6TadJ0rJxovIZIBdJjkadWT3F4v5UABlFMrmGh9e0XLcSA2Dsfx8u36Lu5PV6ajMO7ow9OBR+PauqJRpbqfzRDNpbzubljC0nQJ5dJ9jj7G/PfAcFLQet0O3C8Z77Hsd4FNiLpcs6d+2OjlT6pvHQksmE3WaPP9LPB+U1tIDnG6u4D9uHRz2iSBcY/1+LQzlqUhuExuUcxTdqA8+fC4T1meqiyAc0P7q6PpXkb45votBc+aN+p173OtzvMZxbTTp6v6LicXnSS9fTyTB0W5BP/RaKWwoDOeQde/7Vxa9BSf4FkU4nsA955zz4yVS9Ii+9veu9IU7JEkV98Cc68iPK5AHt3pyNg9jyaXizXrySAVYQM4at0CNZM7kBmOugw+WSr9WzG1QBaPXNAEB/e18KpoKAeRvAQPUiqFLNDMhsmWd2yvIAxy5CFX62Hhm8IQB8+DLcrixDlVYs7iP8icHXpbPFdeQzvphfgSu76YClxExrXRBg0IUhTJkTeOBy6ly63kSmA5Sn87zxwSiHpDJJxip51hLX2/FTDoMVPDfcc1OCcBqT32euVcMg1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(478600001)(26005)(6486002)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(54906003)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mp8+Uxa7eF/OlfQFqZVTfOiz3Dlrhdwnz3WEDvC+9m3+TVoOFA/15WMvzf0Xnjn8xt3DxDORiJgadKO2xXQNp/jVIFca50XUJzUWc9iU52XOpU85xCcc5zVe76X9dQLdGNKKcilXPL6Ej0f16od9q/n2zQe0C06wKBigDGKV8x+xB/SkYS5T8pz0qGoeyIlJqYRCqrHFduDD5i1YLNRh12ltqBfeBAORUenlvep4B6ztSo37W7fArYRDIvGq2nImMwVvmt3DDpRDc+QulAbQZH6xrBy3NI5eWiXsErkqqqwPgpUHfoo/g9Rfn/6Ml4VtPeQLxcq0Nsy4ehkBwVZR3Zw+DMXUyxN/xo0eqEW3Pyq9xlUmmHw0ap5dr+rszToLWXajbgfs05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8JH8/YXrteeNfSHkgn3Z8F4rM1DafPfAVFLK/X36ikkkPz6NpWuToolt4HY9ICWajEeg9bwTChTX/3EBp25zb/GC4WcsDF3kCYJ0sZEJs+/r/ X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e7067a5-9307-4e31-825e-08dbca5ec199 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:12.8785 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5KgZxR/Dv18gLyDBxGjCwpM7KklcLqspf+2y/TGBaoERGBAnXWmzFBSEHEOXJ6O5qLE79BsNGVPIMV76gzRd/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 From: Matthieu Baerts The commit mentioned below was more tolerant with the number of RST seen during a test because in some uncontrollable situations, multiple RST can be generated. But it was not taking into account the case where no RST are expected: this validation was then no longer reporting issues for the 0 RST case because it is not possible to have less than 0 RST in the counter. This patch fixes the issue by adding a specific condition. Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases") Signed-off-by: Matthieu Baerts Reviewed-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ae38b428e42e..01480663c102 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1432,7 +1432,9 @@ chk_rst_nr() count=$(get_counter ${ns_tx} "MPTcpExtMPRstTx") if [ -z "$count" ]; then print_skip - elif [ $count -lt $rst_tx ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_tx -ne 0 ] && [ $count -lt $rst_tx ]; } || + { [ $rst_tx -eq 0 ] && [ $count -ne 0 ]; }; then fail_test "got $count MP_RST[s] TX expected $rst_tx" else print_ok @@ -1442,7 +1444,9 @@ chk_rst_nr() count=$(get_counter ${ns_rx} "MPTcpExtMPRstRx") if [ -z "$count" ]; then print_skip - elif [ "$count" -lt "$rst_rx" ]; then + # accept more rst than expected except if we don't expect any + elif { [ $rst_rx -ne 0 ] && [ $count -lt $rst_rx ]; } || + { [ $rst_rx -eq 0 ] && [ $count -ne 0 ]; }; then fail_test "got $count MP_RST[s] RX expected $rst_rx" else print_ok From patchwork Wed Oct 11 13:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417417 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2040.outbound.protection.outlook.com [40.107.7.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A377C1F928 for ; Wed, 11 Oct 2023 13:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="ZM8ZwB4J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZx6bVwN11/kVU81W0VRY/Xa95WeuZhCvVVR5zILxMGDh2Sni7qbIZ6Hjf8oxQ6i5aXSi545T9UxSnDG1/FbZzssUvICKTMj3grRGfNkKRwqgg3YjbTzC4wQBNhZVCJe8zC4+xcihWR52tFPvpCNJII9EoSwcmmmBXp4zJK6CBfyPAq1m3EqVNq1zUhEs4vMkExTZBWqLLbC/s41lbh+HRLjIJE7zqiG5bPe3UjGqztzBDE0/pn0+zpE5lc3g2VctswT7vpGT/MyuNIEk22+s6ueeu2mcXIYTpCtCi8uq63qqbyScpAeMIhUqo3RV5he/e09DXDWKzHSrmDIavyvVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zRd0Bif/P8noQUpSU597xprr5qSWRiRqC/fpPuazJ+U=; b=EZeW3i3aDPngbmV+tM375Bf/tOD2t6zvytXUvGo3XGigrP/Hc3VoqF5kCmXPKPpO2PvCguZ5uvIUdWeSm/iLQZcsF7dv1StSeFEwVOvRvhpWftZ3W+/7x84KIyEXMURm0ntphyeodWmonGD8Mmy2SfbXicxpgv95o55wWzb7wTc6/TdW1VREcfPlNkU3PcYJipbdiFfDbGm5oucE8oZ+0QMN0i4TxLIDUebVjfBikKTXuKf+Io6kquryzW1e/ZNMOryOZLeWJ2+Pam6S4yBnY7Sh3S5mJvwuwUFei4IU8aOyA4Hyr2kkJYlTvyGG0Eebht4lOQYupQ+ZpXr3QjHWMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zRd0Bif/P8noQUpSU597xprr5qSWRiRqC/fpPuazJ+U=; b=ZM8ZwB4JURzpeLDXcgQkC0BYBtkINJW5jwn9lj/h4B1QvPNzDNLxLLi9y4uCuwnhkz1fi5ii4CozPxUBkG72OLdy5aQ0TZXh9f9UfhVMdcivGHUXgWO8zp/MWKnGMG8XHfCQ52xRGvseWOr3OfYMUYKE8TaWXRpEmGhTEcIAKAJCV9QWqzPoFR8oW3sLrgrw/E6obWOQOnfEHkjl3iQCt0gyF4dTbggsZ9JY6VMfKWT78HTbI+oLNV+QtOjA6+gS4XlwUuyTW9itk/cqDeSCe9JOpT2R8WsDNA9ml1h5Asc4E9hDs3UXiD9o6eXsMwcyw6wrRpbLie6FrHX4k8Igyw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:22 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:22 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v14 2/7] selftests: mptcp: join: no RST when rm subflow/addr Date: Wed, 11 Oct 2023 21:34:57 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: TYWP286CA0029.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::17) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: e66552dc-697f-4b0e-d806-08dbca5ec6fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FV81K+Fa+1dfsjkntdxypEa6ANMuDpYt2DlW5TAMXbywTDB+Kjty2HcE1GlN2crKMzSIoXvsZ8S3TFHMhUqjltsJ/fPcx+bd2VPD+MJUE4pb69sP1++xzZY36RHSqwC6WK3rCjFq1kOdOc1OZKO1uiVez3scteWoJAzjSlbCLmPPMGxltxDHGBt7ytQMkN4ER895d8bbczdv3m5TXjXsy6FTQdRDcWYQsHKGnO3bduJWaXM2QRdrcFi9DcHsrBjfJK3EdEkrLc8wXuDNLaHSS5iOiGU3Pke1IbdS2BRJJKsxAONIakLjHbUa6Oi6IFqdFjexqhCDgQfo5GSl92pkdeuZFLUvUBiR5dL5k34eVTE99g9Xz5F3jrHWvlOpyvQ3Fz/GS07B5Hv3rzYzTeos9NKQCzgJa+2eCWw6m4xAWgOcL630YBZTIuLBw7aswp+/6l6xH9C2QqBXk8ycILo3SAD6LpyFLcCPm0TVWjE3yOJr0WwTBS1bGjNOKwNvYZ2GBeiFPMKMZenlRlBKyWmqAW6QXqhQd6mTFCbXOvWwDElgDn96sZe9twNuLYp2CyTz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(478600001)(26005)(6486002)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k5FvG4jqnGZf2KHP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O8llKcitZnaeja9jig2VX8cY5jsT2FIOaPNlpKVEEOqd6N48xx0v8+eePOLJFiFVZvNGMMrnxQ7v+ziIO5SJTkoESNKN8quK3BN+4EVrIf0X7MHsIYe/PyM9g8AnSSr/4o5ykfPapHlz5z28TIJKbKQGHHTnByhQ/kYWAq3MSE+CLjrbOmqFXACqqw2hIO1zwBg50x2pu4Td42AgEO5dsCTJLyA2ata2LX7TlZ/Npr+4jPpOwGrCqjh0lLA/Gw45pw0XPMtb91ez1WXQV6ukJ1yY+t8LDwLyENPqssjXr5T8zi0xTxSBy12F9SxAmXHuuI9tTprjXE9rmmY3nzTK10J/yR4W+3+XpPAF6INDtd7ycTRy96ZEeQ8pntfU87CVe5dzYuEoeQ8ZTj8zYY/0uvkPqGL+VTRgaxOJaUMzCXL4CkCn9nNXGfjsZYPxBG4RPR1nwa59pdekp0XxZGU4hqP3rD8Kuoyl7OMW08wRMCi8zTTwcYmdkIGo1V1rVp9eYsE8hNCCGgzrKZb5+ X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e66552dc-697f-4b0e-d806-08dbca5ec6fd X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:22.6030 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vi0MDwqOTPwW+eT3z3tADfnoxmRZ3m0g3dqPPkTqSUpJCtDhzhVT5W2LImeq2hTepAkLm4YT7X/2izWvEKW8sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 From: Matthieu Baerts Recently, we noticed that some RST were wrongly generated when removing the initial subflow. This patch makes sure RST are not sent when removing any subflows or any addresses. Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 01480663c102..ab6908b7b143 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2343,6 +2343,7 @@ remove_tests() chk_join_nr 1 1 1 chk_rm_tx_nr 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 fi # multiple subflows, remove @@ -2355,6 +2356,7 @@ remove_tests() run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 2 2 2 chk_rm_nr 2 2 + chk_rst_nr 0 0 fi # single address, remove @@ -2367,6 +2369,7 @@ remove_tests() chk_join_nr 1 1 1 chk_add_nr 1 1 chk_rm_nr 1 1 invert + chk_rst_nr 0 0 fi # subflow and signal, remove @@ -2380,6 +2383,7 @@ remove_tests() chk_join_nr 2 2 2 chk_add_nr 1 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 fi # subflows and signal, remove @@ -2394,6 +2398,7 @@ remove_tests() chk_join_nr 3 3 3 chk_add_nr 1 1 chk_rm_nr 2 2 + chk_rst_nr 0 0 fi # addresses remove @@ -2408,6 +2413,7 @@ remove_tests() chk_join_nr 3 3 3 chk_add_nr 3 3 chk_rm_nr 3 3 invert + chk_rst_nr 0 0 fi # invalid addresses remove @@ -2422,6 +2428,7 @@ remove_tests() chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert + chk_rst_nr 0 0 fi # subflows and signal, flush @@ -2436,6 +2443,7 @@ remove_tests() chk_join_nr 3 3 3 chk_add_nr 1 1 chk_rm_nr 1 3 invert simult + chk_rst_nr 0 0 fi # subflows flush @@ -2455,6 +2463,7 @@ remove_tests() else chk_rm_nr 3 3 fi + chk_rst_nr 0 0 fi # addresses flush @@ -2469,6 +2478,7 @@ remove_tests() chk_join_nr 3 3 3 chk_add_nr 3 3 chk_rm_nr 3 3 invert simult + chk_rst_nr 0 0 fi # invalid addresses flush @@ -2483,6 +2493,7 @@ remove_tests() chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert + chk_rst_nr 0 0 fi # remove id 0 subflow @@ -2494,6 +2505,7 @@ remove_tests() run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 1 1 1 chk_rm_nr 1 1 + chk_rst_nr 0 0 ## TODO: currently failing, Geliang is working on a fix fi # remove id 0 address @@ -2506,6 +2518,7 @@ remove_tests() chk_join_nr 1 1 1 chk_add_nr 1 1 chk_rm_nr 1 1 invert + chk_rst_nr 0 0 invert ## TODO: currently failing, Geliang is working on a fix fi } From patchwork Wed Oct 11 13:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417418 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2074.outbound.protection.outlook.com [40.107.7.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 404BB1F928 for ; Wed, 11 Oct 2023 13:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="tbncFcOf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzolKEi+bfTb+Y5h/N52dDUIgnnr8kzAjJrVm48tTfpjlll/375812RwgiQXSLLOi92OvMvzQkO4DOLParl3382NLecbsvRdKp7XePBcPTE4lQyClKKT2nMx+RSBCGW4LMoT+mzJNzezcGmPcK1xTHtiqYPsF+xlj5OsM2WGAGWFiiRxmIAZxiAWmttzlwFvD9Pcw6I7C8Yg2NPLZMKExvM67ZzcrXsv2G0KiQBjh5ozTjMTiA1WYAtZnKpSoXVfo92yllx5CCqIOkwnagHCfpESDMyGUXmWVUsoVOs3V2UqkNEW0MuNk8zVadFbTUQJLNvZhkCxHoZrmduHs4aQJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z0yS3cDi9k1TVhY/Z2tsvNEnfjIbIkPbwwTd7wQBaTQ=; b=c/mUpEBN6x08gFpZyY1y/6A89VH0WqwWLYaoM0R3+59W696dikzgQmugrUKGeoNHFqOAbvXZBnLW7utGY9TnBYE8PkeLZF7YnIxQ+wv5BhTVggAvLkVo7rgCh1yys0+olLtfrin2yiVBuYL1I2qwYu1rpvDaJam6ZCzY6Amsx4d/jns/aCvWqDoal5DdB+hmxPxVtm2NlBakVrefylhvBpnqT10hhuTG8wHaUNaFGIXqG9CdTr4CJOiKDIdSw1vzv8tij9SKQUf44QR/HqhzrYQBas0icjt8Lf1XK9K6+H6H/2MWX7S7LQC0lbOkgDdUKyT/PU2tWI2NUd4fxXv4MA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z0yS3cDi9k1TVhY/Z2tsvNEnfjIbIkPbwwTd7wQBaTQ=; b=tbncFcOfEMLuQ/qOq0CL/+hjTPGOfBTLpyP3Z3MWahY5FLgXUIL2g9Bbq9KqbAKPey5sTRC/P5W4A1qT1kx2rRYqeG7KomWzGN4yco1EAgfLD7BI7VCOUj/ScPLniWVbmjq5912mnxGShlC8m0uFkNDfK0GBUCh3hMA3MIgawk4AFx40XovzZcdsdgF+00ud7NbxXIEhtKIcIIneJ/atkFgRs6VON5VvF6DCOIHgzN9yCeALs3VtPXSVyVwMPswPLGx8BGimyHR95EpTmrUvZIegwO3Okg9wg/tGQaZkGCkeYu4vao3QM6UXSTCyA8ElFHSqmYs71Le5Gm49I7LK3Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:28 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:28 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang , Paolo Abeni Subject: [PATCH mptcp-next v14 3/7] mptcp: add __mptcp_subflow_disconnect helper Date: Wed, 11 Oct 2023 21:34:58 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0022.apcprd01.prod.exchangelabs.com (2603:1096:4:192::14) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 357f7a20-591a-4d3e-1d41-08dbca5ecb06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HOSeY7SQVTS7q6Xff47uvzjH9D+sZNdrrjcxd3s9nclnDFIGTl0Pl1zsGycvIwv2mDZEijdNtrVNAc5UdBBJVa+uB6n/L2I8EhO96tIYkjZHBGol1ol0M0e+p/pX47wab/5IJKItzQpHkl2oousaS91BasYWUt7fAw80esyK3ydv0GY20q73UHhIqWsc90tbe9bzSJ10MmCNRrASmfIGgq34iiJlAzmTz5d3BUdXafkCsE/UVSc+zCpqs4zfRmPsFx+sliEpJJGSGZ0k17xvv/1LUPAuh467KG4a8qdQ4o3jvardY2kOzHW0LvH3//xflYZpmn+zRu1Cq8vEYhJA2NdCXkOc/UYA0HycmQ5kcAdIywandWWpGH/ElXGq46f5z+56J2y/3FgJ99vN9UJVVAEno4+1yFC9GnPY7buCtMGozA3tOYUUrQgm0R3uODeDRg9eXUxAm4JVdjN6+A/cSlcEJ6TBX2Oe2Ej4+w3KBM1lFO0rR5s579kYZrojPxjgiHucnf27YGkuMbw+MwuPKmX7DtDMjelq661d3+s+rMiAYtjBZOI9dSJh/kscrqRT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(478600001)(26005)(6486002)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(54906003)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oM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Q2R+bBKxc4iGAxwWn5tLO3inAYQarKPTzFi4wSWhMUCotSGVsqsOe/c4cegNbCSoKcevTpxD9ZckrU6eiEw/R6K4Ma+4yT7DEEHNndY+nzBpZ1IqNIXdEclwHd3jwGftfBYwCtz+Wi2Eg3kLJbsxpx1nJyG7FTDVKarNqWXy74SI7f4ng4Jvl8xR1t4BF2oVhF22BORPhGVGd2VkyBRzuEsE8RDBR2sufqSUOwpkoQ+CcxqXLeF9spaUyW+S2mcycEXZbqC4VONamNdXMjqUgSpMlYkHBaoCMMPS1DvFcvkeCl2TOSfciMxOhFm16wXyXPvipP3iPTZlbRzmwD3qZAx5tsrz3kiq1AT3ZrMpSOZ7CUtW7Sqf+KzDSu4HY9hmFszskpPTYvbM5CTqPNuy5r79L5rjyB8t/wYU4ymaFWbsZxmmigAzN21I0jVcNdwwbOL+mVmrfec9w5JvxAmwInBzEgJHw8YiwvMrp29OQUUWMfqIJkM+TzuBRV8Llzkn X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 357f7a20-591a-4d3e-1d41-08dbca5ecb06 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:28.7432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dVCVYb+fyJOBFj/ngVVLZRyz5y93qw9whOY/ZCAM+8riyd6pVIDzd5NbqjAycbVFP3gULGKXgaL/uZyvk6Z0IQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 When closing the msk->first socket in __mptcp_close_ssk(), if there's another subflow available, it's better to avoid resetting it, just shut down it. This patch adds a new helper __mptcp_subflow_disconnect(), and reuse flag MPTCP_CF_FASTCLOSE in this case. When MPTCP_CF_FASTCLOSE isn't set, we invoke tcp_shutdown() instead of tcp_disconnect(). Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Geliang Tang --- net/mptcp/protocol.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 30e0c29ae0a4..1a54d55f8bb2 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2366,6 +2366,26 @@ bool __mptcp_retransmit_pending_data(struct sock *sk) #define MPTCP_CF_PUSH BIT(1) #define MPTCP_CF_FASTCLOSE BIT(2) +/* be sure to send a reset only if the caller asked for it, also + * clean completely the subflow status when the subflow reaches + * TCP_CLOSE state + */ +static void __mptcp_subflow_disconnect(struct sock *ssk, + struct mptcp_subflow_context *subflow, + unsigned int flags) +{ + if (((1 << ssk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || + (flags & MPTCP_CF_FASTCLOSE)) { + /* The MPTCP code never wait on the subflow sockets, TCP-level + * disconnect should never fail + */ + WARN_ON_ONCE(tcp_disconnect(ssk, 0)); + mptcp_subflow_ctx_reset(subflow); + } else { + tcp_shutdown(ssk, SEND_SHUTDOWN); + } +} + /* subflow sockets can be either outgoing (connect) or incoming * (accept). * @@ -2403,7 +2423,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); if ((flags & MPTCP_CF_FASTCLOSE) && !__mptcp_check_fallback(msk)) { - /* be sure to force the tcp_disconnect() path, + /* be sure to force the tcp_close path * to generate the egress reset */ ssk->sk_lingertime = 0; @@ -2413,11 +2433,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, need_push = (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(sk); if (!dispose_it) { - /* The MPTCP code never wait on the subflow sockets, TCP-level - * disconnect should never fail - */ - WARN_ON_ONCE(tcp_disconnect(ssk, 0)); - mptcp_subflow_ctx_reset(subflow); + __mptcp_subflow_disconnect(ssk, subflow, flags); release_sock(ssk); goto out; From patchwork Wed Oct 11 13:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417419 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD94A1F928 for ; Wed, 11 Oct 2023 13:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="DvRZBJ4p" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gNai0sZSkCLKzKBe9wrbYGXZmFSc66vRqwxkeCgYC4/nUvANvHmkPp+G2SPPRa7NFMBv4adPkzbilcBdIJCEGYd+BqmUTw/guy5prrHmXA0u2ZMTwXc8tQ+p4W57/gDM9P3UjeSKxQX9Qwd7yXOdanTr8kqk1zMsZRQA0iFUGhGRJWOkWRZzEysZq790sjlL2wxm919LFwapdHwyBtf4YzuRDibNNwVSIWZZnwWjfDLq4/+jRXyJlbtccfR1AjA+oZJpGtrba+UUKolKemA9/3Sy6vjJy+ddZxYiTSJ2iJ01/8IPu0TFePbsoGfMlaRGPbqz3shnkrTZUa/1Wlsk5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TyRPeHAjR9p06hdEUcyenPU9HoXnE+ZUzkKyofQnITo=; b=UUAv9Y0F7drjmzdGpU0QW7n99azuCcAycR7WKxxsIAy8hmJOXQpLXTVr+Q5N025FXPoEvBMw208HaTS9YLTWIPax3W/JVBTNY38sGNK0u48vNg5VfQAq6I3YC15Lh5LYYBnu372N4ARv9uKKF9v1KreU3qYfAdDEPo+8TxlHV5r09B9F7DfG+9g3G98S9x+2GItPX8y/w2HK3Z5vcTvAdx+8QTL1i3aRIrEjDXVubEhcB2MrJvQWgoIXS9vhJUuXhsSKHDB9dl3r1QrH8AimaA/tlO5b+Qcle7mTZ5UDdhpPbHt4HSIOe2Bq2+fdp7grUnofAg8u+z6LmEFP1W7NfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TyRPeHAjR9p06hdEUcyenPU9HoXnE+ZUzkKyofQnITo=; b=DvRZBJ4pCrVdto6ePB3isbn0Tp/ZajElOMuiwaJvhqYrGW7pedaBKm9bpkHHSy8dCAAcUhsx14fQ27Kfn85D1re9FsSEqsMhj8bo7LeK44k2Fu3EpbLH0YA+7U9f4aioU+QIsc2kDgaaOa9XP/3/+/CHgq3D+QCEy/d9L5KvXeED9EtPcqf/tpD2atGL9ooejZHYPo3iXcRXH47fjGMbjOJ3QSMNgQEHe9GNA2xdKAdF34mfZ/8D9AbW6L7vBWdi1Fh6MdZw+G5HUf5DxE6f/CRLtqUGNMNlUruER935maFFCfcxcKC2N7sVoH57DHXsyGbOX+k+uGaZR34FvX7m8A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:34 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:34 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v14 4/7] selftests: mptcp: userspace pm remove initial subflow Date: Wed, 11 Oct 2023 21:34:59 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0026.apcprd01.prod.exchangelabs.com (2603:1096:4:192::16) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: a2619ea3-61d0-454a-91c3-08dbca5ece99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4YKcItnGhmKDmARm1NHv9gJ8zMAGeM9dYDXYLjPUiRNWehfQXL+tlC1w91PZYxdqh5Rz3zsl6W7bZEKrrmCgI88apeYpx0S4u0vmBCA5koppC2TwyXqIAuzGIjlG8lN+9KclTIvhyIo/J3jLtUWv3boaD+0t1Ro4c9fFBwd89NThIVY01RcEdNvKwU+3Lz3qj/z3tsjaowcVINpsnIRfPtm2IOiI2F4o/Dlnz7x7SNTUAxFnYkK1jzJ30sKC3+/ZiPb+5Dyf67ofidq7DFUftV0l4W76+/AKzi6VC4t9/hdv8qYTcmoHex/tRwojqSQ3kOo+54ZGOaDdflCshGuGdPr0pDxAm79nXAwRNmO8Ir52kB96uFihxYZwXsJPcBVbJo+u/q/HUqevTbHey9BYx2A8ScqksxQlR9YMCVeh/AmGWSNsQ2BPqZ3rCQfP7x0e8CDWNzkeUnuobtKGUmemmXEIm/SGcQ/7+luUfy3HJrHp+k+sE97KHA98rZioToS+AzJlUM56XUDR/nkwqdmzN1s30cxJqXs1D79Qkp6QDZ9wVAMI8VBXCgcx9TjQwqmU X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(107886003)(478600001)(26005)(6486002)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H5hiYYV7Kk6I5Ai5nNDzeM7qk5UyKmJi8CuQiKa41/j69lKmxLPT0ILCPoW7SrGm0XIH7TXlAQH7Dzz7g92V1QRU+7mEiyskOqxLakgVPdLJBT9kN2q8QatDnG/CMxkKVP+Gzm0yN8DWqUqo6JjBX81Yn/rjgVzebn7LqzO4/ov2ydYPFhG7iUBg4snZ/FksNB14F8N9KzjMJx0zU+X0pJgFuQygKSxz0gO4FEIXJVxTJFdMmBJajj0G8eoj0Fi539cpngcNw2ez78fdnq/y7qZh+mDUymn8/k4wG5xg+F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Eejb8iLD12jxOsHsdT7CY+NIYcJP1V7x2Vd8irrSFcG3AdxlqKoahkKsuLzSexcwJJGxW6HryVzZken1GlYS36voMSZOrh499Iqz+RUnSAGNLo4hxb+Sh/DU3S0r5358L8McQjivtZSlv2vKiacOfrC26Y4y6CVfrTyvakb5PdJOHrTGU6PwyHh2wSta5G70/2djd+Vel/PO3mcfLQX5pUXE9j/sz/LM5JGwmNLp X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2619ea3-61d0-454a-91c3-08dbca5ece99 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:34.6324 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dnnzaje5Yhtu5JwtSicQjAEUJ1K7i9F9nsIHLRNeg5fF3ugwvF/M50lwogmuycefnJbbCNfiWgDb9pnqpmH3uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 This patch adds a selftest for userpsace PM to remove the initial subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial ip address to userspace_pm_rm_sf() to remove the initial subflow. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index ab6908b7b143..e1304383057c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3507,6 +3507,28 @@ userspace_tests() kill_events_pids wait $tests_pid fi + + # userspace pm remove initial subflow + if reset_with_events "userspace pm remove initial subflow" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns2 + pm_nl_set_limits $ns1 0 1 + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns2 + userspace_pm_add_sf $ns2 10.0.3.2 20 + chk_join_nr 1 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + userspace_pm_rm_sf $ns2 10.0.1.2 + chk_rm_nr 0 1 + chk_rst_nr 0 0 invert + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + kill_events_pids + wait $tests_pid + fi } endpoint_tests() From patchwork Wed Oct 11 13:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417420 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 283301F928 for ; Wed, 11 Oct 2023 13:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="kW4kUCRJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xw7lTmzA7VWd6XiUHwnisiHN+2QgpHLNr5XsTdh3f9eUwlQ42DLesKYI0KoCws00C9aViKP+339Yb6k6LIpw5gORVW99RVGSBMUyMj8lPktFVbOiW4zuIodFkQ0lpobGzcjbicbeG1/4XAT4TcJMBE+ICq0nOBEJAzVjgQcKego3IMhXiGPb4eVp1hPiGX0WmpMnzjSZniHfeOt0/gUnfERsDjKHH5oS8I3NL1YgA50LbjFFS0jKau3Jzh0BU4FClA9Rn4yVWgIDq6l3CtAKVnuiSKLcDX8FnNALF+Y0ZPb2UnGjszMx6YuEEKg9W/+lOkL/82f2RyubkZ4np1aIXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JF9SqZpDHJjR5kQXzGZWWiFtHP5q3yVGiq85xPy6jr8=; b=hp7qi4ujcpRZ7uIDIYLXTZ+tKzGk7ICzFsJKkSXrTjDWKPx6+FKf6nvBlMghPcZZeP5snvieAq/jJ+a46mfM8UdAdayzKjT/WSvO6LpzmTXglQxafLjkp/HDC7yMigmFA8LtL3Xt9Wojk4zUtV58NN22zw3oQGmIMOYxIoi+VB9t6rYlehxOTMLLtvb4ZX50ypPcfhK/lYZ0CU005Y/X6JrDTjUYxCw1db5uuMcmCLTJFlFgvJDQPiBhFkzCtMOzZFUHozKIVyUoF6ReS3y7v6tLEXlAhZ5mpGMx3cbS4EF0CGzgvvHIPq+qyXboUaeCFcJKJTn6Lbe4wGGVtlD34g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JF9SqZpDHJjR5kQXzGZWWiFtHP5q3yVGiq85xPy6jr8=; b=kW4kUCRJ1Gyv7ijJOzW7Q2BA6wvIeEaTRnKlru350MwwNpbsIZSAd0xazAzlWRfoC4+ExkrF+mXuhc1VH6B1Qfgv3anTo3WXkiIC7gTfIfW1AC65uvswwI+FPhFf/amy/+uIRPOz66cRc6IYOsL72QUG5j/3GOPix2lJQdzyG0Auf4Cy9630Alr8aRFYLJKqhpluwXS9YpcQBnAl/dE3bzMEeEVloQ7ZRb/ZUDmmljW1qZLY3Hc+hIjmxCQMkE5eQdx02vsLGWECVnFxlQVBnAMxoAfvUYoblexrFBaWYhksgMlEPhfTzGsvANC2gmjsW5vRm8PewtFCDSZTF0eMrw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:43 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:42 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v14 5/7] mptcp: userspace pm send RM_ADDR for ID 0 Date: Wed, 11 Oct 2023 21:35:00 +0800 Message-Id: <072d67ec54be6e114cee2f5962419dc504f2e217.1697031190.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0165.apcprd04.prod.outlook.com (2603:1096:4::27) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f52a953-c9b3-4e6f-ef8a-08dbca5ed381 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SHjKK2wDevpCiPJf66AAbWfaOsolhw1SwtnPXIkx2G6Kup7eyjUj1TydondisJE24C+PoNz5UNzniRU/03bPkzsycowxQqK96Vu+CSN2mssvglqhEAYjrKvJrWczhFt1IiE8dA1B/Hmt06qDl+dW8PAFXY3XqEs4MKWmnMXJylLc2YGHklMex51TP/asJ6BkF8sqSX1r31FGKUJd/Qk59hyQoxB0I1JgLg4Uv64AFPvYgrcvb++f8DJblachYla0bcEWzSHJUduq/61BUQ/Q86l+8GDjSaqAEY1nvVW8zSWndelE5TsU8aRflql00+h86Lks9kLN1uO/GceoDfjvFAnz9Fm2BivZk1vULcSl36cvCMer6dC36Vmw4Cxq3NcsPaEPM73h0mmR4/k8fCScNvxqxPfbEHTXYxzdUxq+egY0u0R5Mlv/QWgSDTbsYjpk9M+yHsZY2JMh7q8tL9asKRK30tzD5VWHf5fVmcD0VICY7Xw0Q+EKnLYz3XSdPmEInSxNIuOFxPXX8R1GdyQMQ9hKSI9q8COX+H0jYisIJWM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(107886003)(478600001)(26005)(6486002)(966005)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v3+pOm8ELQcMe/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/TqaiBvOu0EbkbDndkkgmIc3szMCei2CZZvqjUA6rF5q0Bl+2Yh6OLuNa9yyc52CUr76ycIrcxEeoYGInWGgHQMd8dAuNWAqGsqI7l1iJwksXM/PoyKzAp676fqazS5ccOW0FZ7+O0pjyl8ZsU++qAwB8GSgbocZwkLSJ58x5inbrjzf6TubS5Gz3UqXPF7XcZ/V2a2EBX7WmyhDmXGnaBVhHi6iE7ekbJFJnWw8pqrMU4UoEGmayk85O8XUyixTfB80RqOV3bETrI6uCxeXcmtiQGEYGCYe74dEzZru5m8fUmobdqk1mktfw4fha8+u0sRZnw7P1XGbxAsZ9hf+4XlD9ebOSxFVk7XxPazdhmWBV0V1H3RHHePIpxlfqJhDwEcSbMchlR/GFLk+zsgFnnmsUtwuiZeQT+nRcTjJASXxMwU95t3wq+wa1YvzilIUBXo5lQynEZ3w997XY0gQc81zjIe/cwhIhXU09yzx12jdSFNFOeIDssM7ZPjlc X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f52a953-c9b3-4e6f-ef8a-08dbca5ed381 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:42.8363 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ye0NLd9TVax0lpcwbhE7avqHJolEbF9YBDBii/urIIkgu/46UUa/LXjbXNfFlJnsryid3OnfI/Bt7Aq8ybo0zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 This patch adds the ability to send RM_ADDR for local ID 0. Check whether id 0 address is removed, if not, put id 0 into a removing list, pass it to mptcp_pm_remove_addr() to remove id 0 address. There is no reason not to allow the userspace to remove the initial address (ID 0). This special case was not taken into account not letting the userspace to delete all addresses as announced. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/379 Fixes: d9a4594edabf ("mptcp: netlink: Add MPTCP_PM_CMD_REMOVE") Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 6b8083650bc1..ea50e694125d 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -211,6 +211,40 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) return err; } +static int mptcp_userspace_remove_id_zero_address(struct mptcp_sock *msk, + struct genl_info *info) +{ + struct mptcp_rm_list list = { .nr = 0 }; + struct mptcp_subflow_context *subflow; + struct sock *sk = (struct sock *)msk; + bool has_id_0 = false; + int err = -EINVAL; + + lock_sock(sk); + mptcp_for_each_subflow(msk, subflow) { + if (subflow->local_id == 0) { + has_id_0 = true; + break; + } + } + if (!has_id_0) { + GENL_SET_ERR_MSG(info, "address with id 0 not found"); + goto remove_err; + } + + list.ids[list.nr++] = 0; + + spin_lock_bh(&msk->pm.lock); + mptcp_pm_remove_addr(msk, &list); + spin_unlock_bh(&msk->pm.lock); + + err = 0; + +remove_err: + release_sock(sk); + return err; +} + int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) { struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN]; @@ -245,6 +279,11 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) goto remove_err; } + if (id_val == 0) { + err = mptcp_userspace_remove_id_zero_address(msk, info); + goto remove_err; + } + lock_sock(sk); list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { From patchwork Wed Oct 11 13:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417421 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0AA71F928 for ; Wed, 11 Oct 2023 13:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="2RRZBBwl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lyyDnsdPhrna4xYAGwbzWil12ghlMVjSumtFpjQDLydlSBQ1llpOJh3WB+U6bsDBbiuiJ+EpBNynEG4H9DoJx5J+lpBD0tl4n6YX4ujploz5fORgGDkFes4+73Dzmq8omxGlAjGCEaoeKgoWFexKEuomB0XbKgXEpee298IMRQ7d+bfJ6o89s4kya+lynD9jlX7S626/afZlJ+IKCNH4YOYx0lT0xHvVP5CrNUrPkINdx1oFqffKEcm/gn8/kfasVDxm6s1jviMKo2n9u+p2KUaSLOTSioGcaJCgnbsVhg18dB1u6FWsnfF0Ge6p0rbviul1fBw4TnzD2CfrW1s6Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ITrTqUSiTFPQLH+n/E4UD7SU+WUhgfcHxzNk2VWjDqk=; b=L+GRMk0D8iivGlXc9MKhi5QnBrm1DSREOnVlX8hK3yA8TGM6gRhoA9XUxpKt6i5KZ1sMT2dSCJGBmWH61spRDNZPZJU++1qufLkoOvZVTL6k4RUCOgE5Yn+yrUTnMwcyHv2UE1KK0GgvW7OVRNJN5bDxyxix3GjPmv9zMvatGQujs2rJYBC7ci3r7syOHrTYPw18mWS87cnIG2mS2UrUv4Om8YI4L7fHzzvugTgsL1MhOGOoBnKJ9TIT+SGh2LtWTJJ3g4LFIxgIQtBcgnNGvQd72Hhm/ncjDm2fAFhVXPyecRH4cf91N3Y0NIUIy0WEARHeBuagMPifXg8ciJisHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ITrTqUSiTFPQLH+n/E4UD7SU+WUhgfcHxzNk2VWjDqk=; b=2RRZBBwllaT+UqI9lTkBvPnWcQUNhEmMfOoS2WWsreIh5dDxCyFMe5tC6mjH8oRWL5tFtNOBeeK3sbUDP87qRLT5l0NVQZrdJ57XKd8s50MMjo9Kve2KHADf9xXO8mD3WrEjg+d6vdmIv0qa39HJfWaZ49OjLbVnRDZRKOZHPNPN/9fNAOw/+Wc13njEggqNozvcuJydBPU2iEJR9USKKbeWNFXFjiyH9c3h1FOC1ZHQfYMNjKcOF35Hyx75VlmRfhXscbZ74M787uViocLtODdHWYk77Mf798qlRW2coemGIHzRmNKrbthxiqqNGvbvaGxsFqOOMRXYfipQqHA6yA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by PAXPR04MB9139.eurprd04.prod.outlook.com (2603:10a6:102:22e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 11 Oct 2023 13:34:49 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:49 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang , Matthieu Baerts Subject: [PATCH mptcp-next v14 6/7] mptcp: userspace pm rename remove_err to out Date: Wed, 11 Oct 2023 21:35:01 +0800 Message-Id: <34ddd27d7daa9fd19e5d250f529cb768f2de0deb.1697031190.git.geliang.tang@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0153.apcprd04.prod.outlook.com (2603:1096:4::15) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|PAXPR04MB9139:EE_ X-MS-Office365-Filtering-Correlation-Id: 1961be97-8f8b-4e15-84cf-08dbca5ed779 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xXYfz9w7Xkpto0EJPJITyucJrAvOcAlOAFD+lZe+rK9cLvz7QoAI7TL7kcBnwJOudB7UMbRGE7jLRx7aSGYr1bSEoSdXVuwkzLLgxWqbvmjvkXif2iFjTBLXyBgQ7vMNe4BhBLldehsEtaMSHXOa6JAm7AYQB/IFmWRpNTrhFlOIDAMvfQ7AC88+/trWRbYLORk66B2YW+qqFRL3XW1fWIx0y6BCgTZAOVJoQSv3/RFkPSjhN2XuX610AjZkwzqmO252D9r1He5ebkGI67IFJxP1yU0tu+H/fYtryRt4DWPaSSSVdGaeFsQmBV6PAFQKt+fDxVMtDRM4XWqVaicmFK190fCy1ZWWspuOVj5iKavY52DEJUjNuEY0amTAJdL7Xd5uFrJjMRXWr94z6EoR0i6LOM1zVMtPI/T5HBLhQF7vWNWxwT2v0I6OkEeJvpv02H8MfgfgRluC2bxPvoH/eUK/+1oI6qKmFQViQ1UlAjLPG8Lz74dU4J7JTApFoBTIMK24JUomPVVMtr/DaahlVIr2mt2KG90+NDOA/Xq5QSK+XzNfL4uh3npgvTpnwBdh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(39860400002)(376002)(396003)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(2616005)(478600001)(26005)(6486002)(38100700002)(6512007)(66476007)(316002)(66556008)(6916009)(66946007)(54906003)(6506007)(5660300002)(44832011)(83380400001)(4326008)(8936002)(41300700001)(8676002)(36756003)(6666004)(86362001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BXa0tdvts4AmeX4pNlKcHAAvbvvYQ6TB3JGAUuhmtcTSO0/faSXvvGOQtkeFJ+iJZK85Bz5SZYcyO2VtkJAklYFRHiPqA6k25gjsjGnA7c84V973+Fx2FLt8WtVeXu+5HBwmvnwLFM/lQxsG46N6iyzub2594XEZa7sg9YRZx1rYqxxzVMJQTqMQqMPkF9UDHblyRrnYQCXDnmt29urePcVWPGWC7rZPkhH4uB79GR+tDotexuJzRhnBfHTdgVRbr+J/4m//NFPnBZ9q/hAc4TYbl8MebzPey1wljjwdimTPt7F/qptqd9rtAYIy+iUcE7nXhMKeWpedmEXqdXPqFDC23wLykOEOYI+J1tmoWICifHdr5EW0zU9rB6m+fQTMLZUMWXguF2LPX6cuT/1Z6MZk49IrbyID7jeb7To9a1RjQUgbv6UTzLrRwphyACxlyqUIIoelW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5bHcdkQst5D+Q5ovUuqv0dNhOOUd8wkr9TmBJTfX9bWij1pM0dhzchEuj/XxquYV5 X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1961be97-8f8b-4e15-84cf-08dbca5ed779 X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:49.7217 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4vx+J/BiGyLWCZTk4GYF1Cg7wRA6tfGXmzIe0SDlX790fLyMXJDKtav9XfuFjcnQqCs7rf7l5YyInmJB835GDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9139 The value of 'err' will be not only '-EINVAL', but alse '0' most of the time. So it's better to rename the lable 'remove_err' to 'out'. Suggested-by: Matthieu Baerts Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index ea50e694125d..cdff3e631d2d 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -276,12 +276,12 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) if (!mptcp_pm_is_userspace(msk)) { GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected"); - goto remove_err; + goto out; } if (id_val == 0) { err = mptcp_userspace_remove_id_zero_address(msk, info); - goto remove_err; + goto out; } lock_sock(sk); @@ -296,7 +296,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) if (!match) { GENL_SET_ERR_MSG(info, "address with specified id not found"); release_sock(sk); - goto remove_err; + goto out; } list_move(&match->list, &free_list); @@ -310,7 +310,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) } err = 0; - remove_err: +out: sock_put(sk); return err; } From patchwork Wed Oct 11 13:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13417422 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2061.outbound.protection.outlook.com [40.107.21.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B132B1F928 for ; Wed, 11 Oct 2023 13:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gG47uTL0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fl+KCFvAGUFZ9HX1lVYYQlz55l8qGRcU2Cca+o3w41gWuC58XZd/kZNnbDzxQhNV/mhfpz7c+OJmWzMjD2Es60055Imwb5qMXS0dyC4FVmIimHZ7tPuqXgyYzykfSD5G5PBoXUx4YhWCkjpZrRL3FSmp69+LGyOWAD8IlWD51WFKUaLaVVVYpmUa5QmmC4UxM1Agpdgg9vE2GWUIcpX2xxH5gUL4qgzmqerYLfvs/fqlwFlaudSBnHYp4S9f9MGhszw8OoCKMvjhmhuQpiKDTLMYtUBHn62PVR8fN+hFdFDc9vZRuk4hHgQKYIM746FzR/nV8RPP/ceomFLSqti3hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7NpE5dDY1/HQeGrg93X0kLK37iM3BvBi6DRIt+GR8c4=; b=Ig1exeLWFYJ4fuv8Q6PkR0sP2S0nrmu0BAKGgw4uujHjsshQSZ6p3D7RVSmq4e+Wh4+EzS7WbiW7IkeO/XfvPYTi2nzX7oEIkpCRzvzrcn2mTo+MHRf+pok94Uied2MG2Uq8tg5WC6t8UQNaepnXeEpspaUpmWdiQbj9womrVX3KRzF+9dEAUOe1NaheL6pL9WcCzum+70f63qO4t4Qw67hGcsQ87XzfzLK//LCM6bePdyESlypRNsD5jdx9J0OFbOokS+BuY876UBs5fWukRL+irzKpGmEW54X2vWnJTmeosQKX+f2nUzQquy+U041sgrcDNuA0+v7gUD/nq2gz/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7NpE5dDY1/HQeGrg93X0kLK37iM3BvBi6DRIt+GR8c4=; b=gG47uTL0VNzOEVdifmJYNi8HeDMYaGZ+XDDXe+nriaOt9OT54usXSdfdAXRNNL711McklSxGyUUiEprWgMHggLSUzC6Xy5iDRRbfSUUV3zC23PDBIbYg2liGu4jYx6lXtiUY0hKDRjL14yIXEiRCkHbYEMzVl/m+iVPjM/k/atO1lK3/Lq1KrFDn7Zvv4ioPbBEHFdedQ0qWdIvHOIFOfGbdDowNXCxcaRHxYeu2yJs+QS2hyHa/ZG8yk9o3W3Y0O5XqqXbhjYVAGo+c+64t+RclMePODzKwAboUHuflEyWaQ+OOC8pdWnL3oGwamuAswwZJ9xKqCrc+DezRt/S3Dw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) by DB9PR04MB9377.eurprd04.prod.outlook.com (2603:10a6:10:36b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.42; Wed, 11 Oct 2023 13:34:58 +0000 Received: from HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8]) by HE1PR0402MB3497.eurprd04.prod.outlook.com ([fe80::3852:4f89:9891:73c8%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 13:34:57 +0000 From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v14 7/7] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Date: Wed, 11 Oct 2023 21:35:02 +0800 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0168.apcprd04.prod.outlook.com (2603:1096:4::30) To HE1PR0402MB3497.eurprd04.prod.outlook.com (2603:10a6:7:83::14) Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0402MB3497:EE_|DB9PR04MB9377:EE_ X-MS-Office365-Filtering-Correlation-Id: 29e64692-0e5d-418a-7e44-08dbca5edc7e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y5JrUpgf25x5XCrz/3i/kYXa+X432NW2zDFVx+Px4iIrYy+aBrmFfDnsU4B/DbxDcGD4YZDEV3eZnFhcwpiVS9TsI8/O+uvFKgNqqmHV9S0zeOk0/N2vL9v+4Pz3wcNTptFgTKhDrT8PdMVTjjDIW/mW52UBQIfgcfBFvh5ibou2xP99V32AYqyKXfS1osnm26oHhBGL3iOLU5FLRNBa/TyKRsWF5T5Cplg26avNUIGicCsZB4Cabb45xTs7tcp4nwQrmO7Y/Vx4FY1ZIiJmPW15lj3g9R5lZ5HH5X1gFyKJU1H8Zm1KAW5NCHIP84ZqfxohVhxTkeH9mwq+vPx+CD4XSSNItqGy0wU2a31CkZB1YtrtaMZzc6P2n+6whB/PO5ntLhQ/wKX398kDxFNyCixPjfHUkbqSh8fcA7GbImDppEP6MSmorbBlOCaNTQyMm5waNrantz8197Up+2T40ldes6GYbTCfktdubRJBlH6jQaN+KSfUdHTBvWFFiaOaO1U3OhTIL1w5Nw1Ac7/ktKvzYt5iYNs2xCwIJVVMur2N0egOv/v5KJwMrESWfhOw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HE1PR0402MB3497.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(366004)(396003)(376002)(346002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(478600001)(6512007)(66556008)(2616005)(6916009)(6666004)(107886003)(83380400001)(26005)(66476007)(8676002)(66946007)(316002)(41300700001)(5660300002)(4326008)(8936002)(44832011)(6486002)(6506007)(2906002)(36756003)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6692qAo4Ggjg/A7EK/YA76FADGk7c8NQczqUHnxhuMVSy05Q1C8B58dBUtv1egGDyqyxT90lK7sStHT9Hp2hcEgREzHMQn5QuG2ASuOUFUM+/MnfyzlpCwKQBMIPC3WZeIfp0AYpH4CN398flyljHQnDkWDV88qscyuQlgPrXlFBHK3I3rRLMwy9W7YNskDMsS8DVSy6hwMa35VHt+IrtB2nHjV2S+MvD1oQ/9haxwF8ZWzNiqSemU8Or69BiJ3KI8eBy2OTdapa65BxpkJP0RQxTGi58Srp5033JC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sKlW43NH59cdSyemL0c9mpxyc3MzwlBUjGd3yGE8nSCai75XMXkSYx0KdqVOQDSxZtRwPNCsCCgvQpcnScVffYTYX5lO5kOB1sc+l5WdzX9lJLwNA/fG21m/Ashj2qHw+ywN+EF/6YDWNYDGHS2+YJQurvk/SzWEWSQ2vaGmoFO0wabuOM9rgE7tRj3gpUdeR2h83Ud7gI/XoeoLVfcdRe9c X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29e64692-0e5d-418a-7e44-08dbca5edc7e X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3497.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 13:34:57.8968 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qDAk6tE8ROqcjnoUmAUwrc8vKv9DJMxZgb72sdWN2Hb/Cw+DWNOjEOSAbGSXE9SmnBt9M3yRD5mFEGZV8NCTAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9377 This patch adds a selftest for userpsace PM to remove id 0 address. Use userspace_pm_add_addr() helper to add a id 10 address, then use userspace_pm_rm_addr() helper to remove id 0 address. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index e1304383057c..2233b24687cf 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3529,6 +3529,31 @@ userspace_tests() kill_events_pids wait $tests_pid fi + + # userspace pm send RM_ADDR for ID 0 + if reset_with_events "userspace pm send RM_ADDR for ID 0" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns1 + pm_nl_set_limits $ns2 1 1 + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns1 + userspace_pm_add_addr $ns1 10.0.2.1 10 + chk_join_nr 1 1 1 + chk_add_nr 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + chk_mptcp_info add_addr_signal 1 add_addr_accepted 1 + userspace_pm_rm_addr $ns1 0 + sleep 0.5 + chk_rm_nr 1 0 invert + chk_rst_nr 0 0 invert + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + kill_events_pids + wait $tests_pid + fi } endpoint_tests()