From patchwork Thu Feb 15 18:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp37151dyb; Thu, 15 Feb 2024 10:26:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXE8sO3gaIcU74NwdKnPC/UIH/xzq3n8n1c/J1zgdnIndgPdBwZ7L7Bh2X97tTcv3WK3DDg3Yxnoxm261VgX9LxC6+RWg== X-Google-Smtp-Source: AGHT+IF3q18BJs6p9JYjzWEZkDPC0AlKTOD6v3MCJLQK6cmFQ1pvVWjBjcQe2OXPb4Y1t3YAOwsO X-Received: by 2002:a05:620a:4946:b0:784:71a6:f8df with SMTP id vz6-20020a05620a494600b0078471a6f8dfmr2789263qkn.44.1708021583125; Thu, 15 Feb 2024 10:26:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021583; cv=pass; d=google.com; s=arc-20160816; b=oFBFuCxQ/+03dS2Q6XLBXhHxSaNSHzahB78y1pD91/m4SHdYQ1a5127JRkF/yzSNSi NiNULc0d9VpG1ETMBGDEpV/QbwBTYJHmtEyeY6SGUIOZlF3d7VknhhkN6gIAkfrxBg9t eQsHIQ1B7O8RGeeAogbS4WmclNT8g0L4AqwHzK3gBYKPzX6Xg2A7FExXwd4WOe2x/mE0 AerbLJbKBKiPHjZBz6blqv/5+B7ErlpNl+WChE2nh0Hs0gmTP8Q5TX2OphwOR/UePPOQ F8MtWpjiZHz4HcNZPDlshn/pNtepqloBmqnXY5QBXMH8+n2JEN/wFGClzU2VbbF2o3eN kdgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=im5uXJWE69aqA1d4eqEt+B6UhJcM5Dmr+tAShoygxPA=; fh=9OgH39SPvd1/fx3vLudq3fGSzfFUtiCA3rk1gIJhyc8=; b=JYMEv/igsvH8Cs0+jtANsY2IrZjJRUxYFNB8Qg8pb5x9Pt2AhsbBMdCY1Lu7Xwjj9B hMGeyU4XBE4nUBfQLdQu2LN4PDsBE5iSNTWy1c7p/JjPDow9dguX38XxcmAmlYErvKjo ZuehGbdh6NPNAPLk4QrXzeSblGA/wxyRIbva9ODbkIU7KQiLZv0FJmCvJUH3v/lirre0 AoAKftLAIlfPjcW8bHQfpUgEoLF78ri8DjkIJbo1BbhuKI/8kI3lAX/C2fo2q8A1pfXv 7QB6hvjbSnQ3K8yJc78mCWNQ4kEM1uUKaiVof91LPd/0uhxjQMRRxY+JQUsXMgtBur/J OFKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cTEz7pyN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67492-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67492-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w13-20020a05620a094d00b00787377c7fe0si1491793qkw.363.2024.02.15.10.26.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:26:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67492-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cTEz7pyN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67492-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67492-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D561C1C21B36 for ; Thu, 15 Feb 2024 18:26:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC9DC13A242; Thu, 15 Feb 2024 18:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cTEz7pyN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D541139570; Thu, 15 Feb 2024 18:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021541; cv=none; b=VwttGvSWOTrdeziLbXOdWvvglzg44ZlPvcHbnG7kdqldWovN26SFKAwzIknC4eQy7vuM5X2VfTgna88ueKjlVjif+V6FVOmUC6Gn9E+6a0lE3byITSp+9SJwOM6EtjtFebBoTWFFiyg6yKDQgV4WPsYsUp/7WnYvJADOcQmqL3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021541; c=relaxed/simple; bh=Pj0an6pet6JMiQN6jgmDWHTcNSh1WHDRJPkGt5MvGWU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BOw9dopYOMWJXJa7JnhY8VatPAuBfGfw9wS+gqtOvXDkPxP12+42APAcDQWeOga+A7Rjp8+ZNKz1CIxhvqIgXwnptYeU7Hqgx9sU/YrGP1uOA5YUjyj3QawKHa2YaaPD91sqp40knGh9FlXT8UozRNt9mTBBjLOrmOSJ04UgfU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cTEz7pyN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EACFC433A6; Thu, 15 Feb 2024 18:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021540; bh=Pj0an6pet6JMiQN6jgmDWHTcNSh1WHDRJPkGt5MvGWU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cTEz7pyN7WTrZTMkSFtRN7Tu2fMRRRaCNlmaFWXLCt882LHWuT+YG9xGTigJloCr0 QUrNJdNehqiwxvrLbuWQ0gaWExW7SxnOpBaVYdpOlqeNVBIQYmIAnsKgfllLftfkv0 7TdV4wfQG6qC5xBmG3HIvBXe4OpvahAm9yJwB/rhOLBzYFu5if8Og86AmsKo+ANKhH 9x63S/SJjvPxRaZX8vKMmi95wPR16fwsAMZA8ah63G4VeZcZNpvM0q/b+1+/uW5xCA NLQ2lO92hEEOWclSjfFTNfRbea3gXgQuoo9dYYhuZaMollpVnhPX14mP1+jtla5tyv NIoqdIFPmo16Q== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:28 +0100 Subject: [PATCH net 01/13] mptcp: add needs_id for userspace appending addr Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-1-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , Geliang Tang , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3724; i=matttbe@kernel.org; h=from:subject:message-id; bh=JleY60xju9PrfhZyS6qCMKbVrnKGfzFaq0Li9qSQ99c=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlccaQjOy2U2xZ7H2PNfZBsGDjJ4QoD+1g4dX +/4Fva7TFeJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHAAKCRD2t4JPQmmg c4HuD/9Z5qAcWnv3ThiJ5fT1htqwPM55HNWgbc3HryOUQtBeFy33c2ZCpHPQpDWw2lYDlOerwOk Gbd8KoFzmSe592a7MRORYpQvXgb0PuOGU72Y2Hhu70jIaJstPo1zab59oe1Mwnw8CwA8FhmJCvW nTVPy8HLlf6VIqxJS9GkPyurjU1e+G7ucUGBTHhhaUixN8c/VSN/3Uc2MBtW6ysuCEzWLk/ez19 Vufkf98Z8efCUYa7/4HT4+JjUk3zIBm9MuylkbvfglZV03MApUfUCHyKJ6cNE0KRbw/ep2AsmXe laXUmeIl/nvxA5qHH9z0whyw2+gLyquwkTJ++FZCAdanulL0QVgWOHsapKEQRolO4Xpy4c9+EDg RwqyPsNRTxWCiz/yv3QCDiNnqWtsFTXmP7raBbtXDy2j+26e3hJwFMuLJMlvhpLO9Xjq0AdAFan StSM2PYHWPvLe/F8wCvxDr7GkZaw3Pm/N5Q/sZP95YZ5+GwTiL9kbx0oPe2dJpkC2kW4KuB1a0L fhU3sGtEZsUsNnR5okz1/KVZpVeZnrkZhmRZnDtBKGM+cD/hMVH84umJx1oJIMO0T62orimQk8G mS9fkjhbBQEjJ0ghC6ZUYTRDUQ61Ljd52jnlQQJAWpuadQaxsQ0ZZz7r4LzVdrvshtp68iN+P/S +EC1eoXg5Rq57aA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990439287310951 X-GMAIL-MSGID: 1790990439287310951 From: Geliang Tang When userspace PM requires to create an ID 0 subflow in "userspace pm create id 0 subflow" test like this: userspace_pm_add_sf $ns2 10.0.3.2 0 An ID 1 subflow, in fact, is created. Since in mptcp_pm_nl_append_new_local_addr(), 'id 0' will be treated as no ID is set by userspace, and will allocate a new ID immediately: if (!e->addr.id) e->addr.id = find_next_zero_bit(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1, 1); To solve this issue, a new parameter needs_id is added for mptcp_userspace_pm_append_new_local_addr() to distinguish between whether userspace PM has set an ID 0 or whether userspace PM has not set any address. needs_id is true in mptcp_userspace_pm_get_local_id(), but false in mptcp_pm_nl_announce_doit() and mptcp_pm_nl_subflow_create_doit(). Fixes: e5ed101a6028 ("mptcp: userspace pm allow creating id 0 subflow") Cc: stable@vger.kernel.org Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_userspace.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 4f3901d5b8ef..e582b3b2d174 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -26,7 +26,8 @@ void mptcp_free_local_addr_list(struct mptcp_sock *msk) } static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, - struct mptcp_pm_addr_entry *entry) + struct mptcp_pm_addr_entry *entry, + bool needs_id) { DECLARE_BITMAP(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); struct mptcp_pm_addr_entry *match = NULL; @@ -41,7 +42,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, spin_lock_bh(&msk->pm.lock); list_for_each_entry(e, &msk->pm.userspace_pm_local_addr_list, list) { addr_match = mptcp_addresses_equal(&e->addr, &entry->addr, true); - if (addr_match && entry->addr.id == 0) + if (addr_match && entry->addr.id == 0 && needs_id) entry->addr.id = e->addr.id; id_match = (e->addr.id == entry->addr.id); if (addr_match && id_match) { @@ -64,7 +65,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, } *e = *entry; - if (!e->addr.id) + if (!e->addr.id && needs_id) e->addr.id = find_next_zero_bit(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1, 1); @@ -153,7 +154,7 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, if (new_entry.addr.port == msk_sport) new_entry.addr.port = 0; - return mptcp_userspace_pm_append_new_local_addr(msk, &new_entry); + return mptcp_userspace_pm_append_new_local_addr(msk, &new_entry, true); } int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) @@ -198,7 +199,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) goto announce_err; } - err = mptcp_userspace_pm_append_new_local_addr(msk, &addr_val); + err = mptcp_userspace_pm_append_new_local_addr(msk, &addr_val, false); if (err < 0) { GENL_SET_ERR_MSG(info, "did not match address and id"); goto announce_err; @@ -378,7 +379,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) } local.addr = addr_l; - err = mptcp_userspace_pm_append_new_local_addr(msk, &local); + err = mptcp_userspace_pm_append_new_local_addr(msk, &local, false); if (err < 0) { GENL_SET_ERR_MSG(info, "did not match address and id"); goto create_err; From patchwork Thu Feb 15 18:25:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201691 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp37352dyb; Thu, 15 Feb 2024 10:26:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXm1oNA1ghEUvY8rBkSBMhBsry1uOhShiY7KdalXC1FZP7BxXGuxKWqlPPfvETkTNWNdGmdRRbpbt/EUHXnBOeRfsNA7w== X-Google-Smtp-Source: AGHT+IGKt1uEDSGBRqTdK07zbGokFRMoypUSTXH8GZ7jzdna1d34dL8bdx4lzre/ki4zWJOeMrOB X-Received: by 2002:a05:620a:2009:b0:787:2a6e:6e08 with SMTP id c9-20020a05620a200900b007872a6e6e08mr2981632qka.15.1708021604563; Thu, 15 Feb 2024 10:26:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021604; cv=pass; d=google.com; s=arc-20160816; b=TcGu0gxpIbVAlLr+LQd6bUBKrTPCJ8M12knf8YaC8GFjKnBYggHnv4kYOBk7MVLW2P tYTC43fZZ6ZVUOpKBQ1AyJfFP34kXgOT5MvuMHZqt7UQXgmXzMt3wvATAqMkwwETAsXT Re5VI0ZP+3RiNhCTndkmSqON92xH6h9oXyq7LLbO97c7LIZAZVwtkySwCkPYG3UROUrI 01IyzdT9s2rLR9Ucf8O84MMR5IH0w3I0MkULBTwiVDwJALmxTc9esCf7o72P9U6aW0fv f3F4zBLOYyZnACy5DxO50R1nsrT5dSd5aZBFI8qNAm13RZKjOiB36UexCTSJzUbiDLpZ mvhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=e3RQhgJl4lFlNjgUiER+ZVFaSWHDX1CxjRT0pF+JHkQ=; fh=9OgH39SPvd1/fx3vLudq3fGSzfFUtiCA3rk1gIJhyc8=; b=poBTIvTHwl2VqJXyu/w15fIsf+4TarA5Ii0yxAHKgkrJq1HiHAY6aluwaICJ+oQJW4 2z0/eAzSqt3pTPsgVsuLZKQc7lIA+bJ2YzFlVVtzkFioUvjW0dJiL+j72e9hXkWWyBuE PyjsM8KRxGHHH/9uAFYzSS41T/3wLeWxildhmgQfRS9ZMRuIiGRjZeAk9MB8HD7Pwkcb R1E70bIOOVu9N5+TW75zvSv6JZnA+S3RLwaJRr7fXvJ7amfnvzg6NFTo2u/By7Hmm+qK CDQABIuZEChiGihSLWWfG06p/WUw6jf9HAnIRaCSuvrWsaOkyBb/31vfFOySY2iB+0pv FGew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYLlcY6M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67493-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67493-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m11-20020ae9e00b000000b00785d6c5e0bcsi1995106qkk.434.2024.02.15.10.26.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67493-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XYLlcY6M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67493-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67493-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 517A01C216C9 for ; Thu, 15 Feb 2024 18:26:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5200713A866; Thu, 15 Feb 2024 18:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XYLlcY6M" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8C5C413A248; Thu, 15 Feb 2024 18:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021544; cv=none; b=V/+B7nyP9qX3V9a3unknPxtFbnnL8BsttT3gXrS1dgP4uOqfXySfLQ+pB221HlrLlIx3HZalWJuUMrsFHSByjJZpBF1P2RB74sJnZBnLYcpyeTXl24uk/A0NCQicvuj/4ddg7g/WziZslCjPrEgLq2zx51a7T9sszqYDSGk2PWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021544; c=relaxed/simple; bh=TLNtJSmJT4K3/W4FxZHb8No2F0zaMpy2B5q0q484CfY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rUFQDXvcXaGv4yoVYoKu5QeEmOM+bPVKhVhEZyvnxRZ95ht4OmAlj5QcTI06J4qpzhyBDyB2og3zw3+RQa/vIXDe0Gzkdg31mxROwhJ/Om0ppal9Zys0FiYQQsfRIMQ8jtzsVUFpniLohfIYxEhb0acSRGP3sqLw6orcIf9qemA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XYLlcY6M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 093D5C43394; Thu, 15 Feb 2024 18:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021544; bh=TLNtJSmJT4K3/W4FxZHb8No2F0zaMpy2B5q0q484CfY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=XYLlcY6MyhsZbb6WGDBU8WYMdjSg1OrXlIK4q3CZzwpx+oF5vzc2QY7qpCimPOQ4L ssLuBHPHbEgv3QQmO1a2ohFwK2ARsI/GoztmEyNLyrtE9kDXV1MW4mi0hZARJ8DkIJ aC+AdexVSPAOfhcJY26f4rRuB5MT4WbwEcMdGSbsnJO+wrQPAfwufXsbDG2lE2SHAM V53obrPomwSI6NCS5ypJpmX3ENHIcncrU1BMHKTRuDTcnehijUuDmehLwoXrMUM5m/ 6k5mIRxjkIy3CdHSotbC4rgX3DLY0LipEmgPT+ZBvLLb/TiQqUciIcX7QNnNzXgpWU PfsLdAA1+T1JA== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:29 +0100 Subject: [PATCH net 02/13] mptcp: add needs_id for netlink appending addr Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-2-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , Geliang Tang , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3209; i=matttbe@kernel.org; h=from:subject:message-id; bh=iuITD/hKkENPzn19h1Lnm4q3SQB2KOC2z7d4DpfDq0k=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcckP2ZdgSCyKKwvr7D2wVc1WxBIQH7PGWrY LW1QcUH5pGJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHAAKCRD2t4JPQmmg czzLEACrCQivCeCBiu2GXkiATG3dUET+CAxtWT/5ds+eqKL80ySow+PoZyycqE+oQeCn6BgDbwC uSNtOh7wFay5QtvJmNm8IsDzMM/lj+JPx/zF/hIX1MdQUerYp96YsOsHLdREqH+Ob4BXjMZPCz0 yV2q9ohUXvFtMBmkfeYoxI4bG9tU3um2n+p3hE98QOWIOFYhZ5bZ3alOP/dZnjHZYxu6K0WRCiM Ff2EDKRGtdBmVkwpdUQORL5RB7YwrwmBQMXEvD0LZG0quWCMj3hYM/4crTeZDJfFdqY8KEWnTLf 22UspRBBlCM0cvN83uVviZvtfuYeQS96eXtko+b+3sCUEVsGWvmPMmYMw2Rjg9j1ZMYyDQz6PVq 3Yk2YLTFb8I030Li/5DMlgc2oiONLDTO4WoY1zRCItj2Wq0NjK3+fKInqMXo22gWS2W2lpKlMQ/ xLlPHg/+60JCVBx2k07t2jLZa71sY/3e6kG3UrMePD0qrqfucKGRUMv5d2rz4nvG0dUux+/l4X7 CoLBFdQTp55AhdEllowADKPe6njYBPVa9bfx7ItAJGBcHDFOQZtH84AHqpj6LtZCPTMHCUOqSoW qXEFeRZ/oLOK0DgkWOMgKxbDdfTt8ouR+AHk1cAmEL6P/j/csD1gprLnIESwM37NiuYgoyyjzEN //9OiObr3/fuouA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990461870384040 X-GMAIL-MSGID: 1790990461870384040 From: Geliang Tang Just the same as userspace PM, a new parameter needs_id is added for in-kernel PM mptcp_pm_nl_append_new_local_addr() too. Add a new helper mptcp_pm_has_addr_attr_id() to check whether an address ID is set from PM or not. In mptcp_pm_nl_get_local_id(), needs_id is always true, but in mptcp_pm_nl_add_addr_doit(), pass mptcp_pm_has_addr_attr_id() to needs_it. Fixes: efd5a4c04e18 ("mptcp: add the address ID assignment bitmap") Cc: stable@vger.kernel.org Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 287a60381eae..a24c9128dee9 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -901,7 +901,8 @@ static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry) } static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, - struct mptcp_pm_addr_entry *entry) + struct mptcp_pm_addr_entry *entry, + bool needs_id) { struct mptcp_pm_addr_entry *cur, *del_entry = NULL; unsigned int addr_max; @@ -949,7 +950,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, } } - if (!entry->addr.id) { + if (!entry->addr.id && needs_id) { find_next: entry->addr.id = find_next_zero_bit(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1, @@ -960,7 +961,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, } } - if (!entry->addr.id) + if (!entry->addr.id && needs_id) goto out; __set_bit(entry->addr.id, pernet->id_bitmap); @@ -1092,7 +1093,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc entry->ifindex = 0; entry->flags = MPTCP_PM_ADDR_FLAG_IMPLICIT; entry->lsk = NULL; - ret = mptcp_pm_nl_append_new_local_addr(pernet, entry); + ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, true); if (ret < 0) kfree(entry); @@ -1285,6 +1286,18 @@ static int mptcp_nl_add_subflow_or_signal_addr(struct net *net) return 0; } +static bool mptcp_pm_has_addr_attr_id(const struct nlattr *attr, + struct genl_info *info) +{ + struct nlattr *tb[MPTCP_PM_ADDR_ATTR_MAX + 1]; + + if (!nla_parse_nested_deprecated(tb, MPTCP_PM_ADDR_ATTR_MAX, attr, + mptcp_pm_address_nl_policy, info->extack) && + tb[MPTCP_PM_ADDR_ATTR_ID]) + return true; + return false; +} + int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info) { struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR]; @@ -1326,7 +1339,8 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info) goto out_free; } } - ret = mptcp_pm_nl_append_new_local_addr(pernet, entry); + ret = mptcp_pm_nl_append_new_local_addr(pernet, entry, + !mptcp_pm_has_addr_attr_id(attr, info)); if (ret < 0) { GENL_SET_ERR_MSG_FMT(info, "too many addresses or duplicate one: %d", ret); goto out_free; From patchwork Thu Feb 15 18:25:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201707 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp53070dyb; Thu, 15 Feb 2024 10:58:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV8JGH7UowGkaUAPOniX2hrheyQErGF4YPD/gRe2WD4Je7Myr6GRp3Y7HD8J2bG2/5F/nVVlj4gDDlXKofmXDyvX7iuhA== X-Google-Smtp-Source: AGHT+IH/hFrZGFa/BpCYNbeidgz7ULeWY/8XOOmQCssojl4E7avG2g2sLJxESrEAhln+IdO7xQT9 X-Received: by 2002:a17:90a:f2c9:b0:298:d0ed:e13a with SMTP id gt9-20020a17090af2c900b00298d0ede13amr3709637pjb.15.1708023498839; Thu, 15 Feb 2024 10:58:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708023498; cv=pass; d=google.com; s=arc-20160816; b=VbOO8+4KItGNV70OPvicWnlKHHwf1vxEVlOam86Z5HgRpbim+tkB22y6jlMPvY5vYf EHnRCmDiorFOyQd2WN5cNOsS5lCTDV5s+iUr5xcN3l1aDQO7jivkFkq7Pobh2Af81DL+ MV4Y8RXZhBh9kBlmI4ZmarUmrsLyE1afMEaHj0tDoMncb9dWP963OGLdt8Wmu6wLOz4s fTQuMEERvANT0qUj6SotqXUBaXw1/GgzxeBmQkKlSzr4fCAQf7r59KLqCP2Mog+ppDkj u0xRShIbnoz+q/ocrCyAX+oWJ2U08/IFSkpKALctSa1irksmval/X+S2u7I2u/jTWKTe AQ5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=L6lIoGryQ0LDRyNW48v27i1rlHfcHYdFthdLA3f9QII=; fh=KHm+5J6+rvFM2Sm0w04dr96065e5NgZLO7CcIOTCxTg=; b=Y0Rg4CCX93k1gGkyuk4DQoNxw7gxAkA06+j54SL+38KuTvhCHIYjnZNAppxlz8+BJ1 lvuScSxPfDFt0/DH22N5bgRWaMo7p1wUJM/TXV629prjDMf2wrka/ghmamUj6IA8qtUp bQQgkjNRPDfSh0I89Wzhg7GJWgIGdGoXk4CO7El3D3yhZy/X/QZSTJaETk3Gg/Brl6dX ZaLh8Caoo7I1oNoQ9JNx5j1paq4+ffPo3b4WSUn5S8i2BA4kuLeUtrIICm797pDbhPoQ jP8KIhLIXseApopP8forxVxmV2kQ3Iw5Y9FtNfbOnq1CV1L8ijoWwH/YUifsCR7/gN5u DfUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqdgbkKA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67494-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67494-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id pb10-20020a17090b3c0a00b00296db812c4dsi1681125pjb.116.2024.02.15.10.58.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:58:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67494-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqdgbkKA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67494-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67494-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C9BC2B23692 for ; Thu, 15 Feb 2024 18:27:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AD4D13AA23; Thu, 15 Feb 2024 18:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hqdgbkKA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CB24913A86C; Thu, 15 Feb 2024 18:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021547; cv=none; b=FwOhGb34KXwflr+5CBFmMw0Mfubf5+KPQ8DEW2WjPIbGOPhYvDWh1XoXnk6W/J+IZDV7j5PIFMa8xW3yWmhUseZKqObQfh1QrGnP01B65EvSuXSFVnAKA+yW7H11wWraQpfkrmyQmnyazzx/nYvI/irC5/hALUoBVGflqIbVFGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021547; c=relaxed/simple; bh=O9TaPCeVsjOq9jAAugHSwpNIaCX6JMv1ouUykBv8gj4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XrC0uxlfJV+BErA7XvBrUIUiS5RjkRrcdQNbs9Q+wvRRsHAZITMkWK6fMCasa7JZDS8SRZfDOtcaSvsCC7YFumlPKuOkNyj2oGixEJBb16C/kW6wxqHfdwanZyRSShVI3srkdR2H+46Tb7P54ChU+BFYsaiLJ5xcxtzyNzsltNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hqdgbkKA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77328C43609; Thu, 15 Feb 2024 18:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021547; bh=O9TaPCeVsjOq9jAAugHSwpNIaCX6JMv1ouUykBv8gj4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hqdgbkKAclztcu1xQRYG5SwRNJ7ZTkGqDGETsTIo85MclM/Y+UlJmyJFDI+lhumWL ZOxv2dd/1qSHYPuFazvJBD5EDLz0NXcwX8UmSkZP79zygVUbkxXRr51z8fcTNTn7Iv MKIXrQG/GYm6NRL4z2VHRrjjvYOboYe4RRe3oXLqFGTbukkF2ncBaPG+o48tHopYrB GmDqT0esOcC01P3siGojYFcKyedjUuXGCCOgtwyMteCXjXqCsV1tkhxRddCpESewXa Og5CX31merFzpt8biF5tqb26ZKAjNiEYWRVHneSnNQPLDgiWJDPYijgzXe3pWKroZJ gr91bOtOZE9UQ== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:30 +0100 Subject: [PATCH net 03/13] mptcp: fix lockless access in subflow ULP diag Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-3-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org, Boris Pismenny , John Fastabend X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3080; i=matttbe@kernel.org; h=from:subject:message-id; bh=xtj9AwzwqPCqP5Friqh0vCOkOhD544GhNiZf9ekwIjU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcc3yITjm+xGd3bhfD6bwGDlnT5JnEpdqxGj PhywDxO5umJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHAAKCRD2t4JPQmmg c56hD/4jXp5hKXebFuJVEHHOfdxqoyu+ghz9oB7ej8NcNVkhVR71JwrdGzHhiOtZ5VHdCcioCrT snpg2EkpSCaNk0rj3FWP622w2st+18qVuicEQ4KM77Dl8lxFeQRgYWWWXuHanuH7YSsYl0lKudW T4IsCOgKJybSYMTlXxR8MgOVOPeVaEXG5qYmHDxB4itbeVbJoU9Py2PEl9N5h+3KrMqlqNzTxYW DHR3ZeBjz+6J4/OrxL1xUnK6KovOqZ8IEJIb/lFRicruFZcx5P41qyylcFfp7OKYEvw1t5UaopQ FlnPJvkZZVDeNXEhNf1SEsXGUG/MIReDU3MhToj5sHrw0npRicV+H2QazESpa3jgrR2z0GtemRi dTgN8ZZ6b1BrUik+FCLDPCdcbj7RQvzUalUkIktJAyUKoOhnlJWsYhz/Mt04Xi4BhH2hOGTTdTZ vjVdh/1Rr8OorQA7zSglQosfdtuXTrzd4+cQD2SuhrYPkMJy2iepEfgCZzBZlc30MeXRAd6g+8p X2i18RDY34ZT/GmHA/rsq1FswcULdaIjcf4jy8ibt946SIMff923FweP4OjYp24dFH2IgMbJve4 GG8j+/vDfkYKf8oRPj+cEESKJFmWE5zGEAs0n90PevE0DIaHcAn11CZxEKdl1ic1062ABiwho1z YbJXY9Lv8sojGlQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790992448683837542 X-GMAIL-MSGID: 1790992448683837542 From: Paolo Abeni Since the introduction of the subflow ULP diag interface, the dump callback accessed all the subflow data with lockless. We need either to annotate all the read and write operation accordingly, or acquire the subflow socket lock. Let's do latter, even if slower, to avoid a diffstat havoc. Fixes: 5147dfb50832 ("mptcp: allow dumping subflow context to userspace") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- Notes: - This patch modifies the existing ULP API. No better solutions have been found for -net, and there is some similar prior art, see commit 0df48c26d841 ("tcp: add tcpi_bytes_acked to tcp_info"). Please also note that TLS ULP Diag has likely the same issue. To: Boris Pismenny To: John Fastabend --- include/net/tcp.h | 2 +- net/mptcp/diag.c | 6 +++++- net/tls/tls_main.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index dd78a1181031..f6eba9652d01 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2506,7 +2506,7 @@ struct tcp_ulp_ops { /* cleanup ulp */ void (*release)(struct sock *sk); /* diagnostic */ - int (*get_info)(const struct sock *sk, struct sk_buff *skb); + int (*get_info)(struct sock *sk, struct sk_buff *skb); size_t (*get_info_size)(const struct sock *sk); /* clone ulp */ void (*clone)(const struct request_sock *req, struct sock *newsk, diff --git a/net/mptcp/diag.c b/net/mptcp/diag.c index a536586742f2..e57c5f47f035 100644 --- a/net/mptcp/diag.c +++ b/net/mptcp/diag.c @@ -13,17 +13,19 @@ #include #include "protocol.h" -static int subflow_get_info(const struct sock *sk, struct sk_buff *skb) +static int subflow_get_info(struct sock *sk, struct sk_buff *skb) { struct mptcp_subflow_context *sf; struct nlattr *start; u32 flags = 0; + bool slow; int err; start = nla_nest_start_noflag(skb, INET_ULP_INFO_MPTCP); if (!start) return -EMSGSIZE; + slow = lock_sock_fast(sk); rcu_read_lock(); sf = rcu_dereference(inet_csk(sk)->icsk_ulp_data); if (!sf) { @@ -69,11 +71,13 @@ static int subflow_get_info(const struct sock *sk, struct sk_buff *skb) } rcu_read_unlock(); + unlock_sock_fast(sk, slow); nla_nest_end(skb, start); return 0; nla_failure: rcu_read_unlock(); + unlock_sock_fast(sk, slow); nla_nest_cancel(skb, start); return err; } diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 1c2c6800949d..b4674f03d71a 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -1003,7 +1003,7 @@ static u16 tls_user_config(struct tls_context *ctx, bool tx) return 0; } -static int tls_get_info(const struct sock *sk, struct sk_buff *skb) +static int tls_get_info(struct sock *sk, struct sk_buff *skb) { u16 version, cipher_type; struct tls_context *ctx; From patchwork Thu Feb 15 18:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201708 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp53144dyb; Thu, 15 Feb 2024 10:58:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKFHNXvMd7HxXK4SksZykBOttdkiEqqMEBWGNwkTMvzvgSZZvN9WB+GC0TM+3G8+BhNcMd7mD1oyjIa3Rp4CWvMcdQIQ== X-Google-Smtp-Source: AGHT+IENtDZmEVqpAfQDViFiYECNQzDeCyw76L4zZTuWY9x7iWAbzDnbUjWxS2wOpmAqSM9Ntulm X-Received: by 2002:a17:902:d2c9:b0:1da:2a50:cc09 with SMTP id n9-20020a170902d2c900b001da2a50cc09mr2816657plc.12.1708023510650; Thu, 15 Feb 2024 10:58:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708023510; cv=pass; d=google.com; s=arc-20160816; b=Ow1ClWXlBkkO0YhwzmHLckwO2YYZzDeRcKN425jNZwoPWQYHtauWFyPEhe8v1Bccb8 CnVtRhlWKYnVYNS3OQGE2PGGlIfjNipeuYbHuyb39lj7ulvkvGnY5FpkzWqRWTPCRTfb nmi7w1RQPpdnQW9cu9JqiXyA8ctWxxMZl+OuOXgGVIoL2v5L/txrrayryLe28FBTRMOF Kxpn+73fDhyXsxkA98vRWJ/Hi0/vQG8bf4QuIXPMIUOesuEDdvuB5mUU7oM2P18GwiYi iWRYUTXqYhnbod08ckN20Ualar/HKyvWPM7ZiJZSW+hdstNn+dqGhienenU/soOVUJa2 tQgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=PS8DciwnlWHpe7iphlG3VQCQLQqz1pJhT6CTbv0FCeo=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=CKzlB4WiLWIVTJobpX1Ig82PxNES/bw8z1sRgKzbHzwNPRISmcl8ZFdBMjDoJMweXz L3XtH1JNI4XuKEg9LF4wK8VkiCvQe28oBl6EArdqVYUdhSowklFQYU+L/hQjSwKvj4TQ 22jLNiBVXWeD6WZDLdmbgBEpyLSfeev/2DJThksz0cRXFRuESNz3ZB30sNRCrUfCqQah D9F8uPJ0lEunL8WLKDZ5tZig1azawi4Nx6vJ209OWbatNha89F2kevSvsyjUeBfio67o WWTCrh9v7OxUwV5bhsG7VZ4b8HPEsnViqO6RpDPpVEP4GJ0sWShzkZ8y2y/Lj/S90nfr MzSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d8nXVTuH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67495-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67495-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e8-20020a170903240800b001d8f24096f5si1583373plo.110.2024.02.15.10.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67495-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d8nXVTuH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67495-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67495-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C892AB226D8 for ; Thu, 15 Feb 2024 18:27:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90B2D1386CD; Thu, 15 Feb 2024 18:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d8nXVTuH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2F0A613AA29; Thu, 15 Feb 2024 18:25:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021551; cv=none; b=KuGeM0+4BfZ/v3gJdIt2oHI/Gve7JUjwbYHlGaN08z0vEz+9U7JgfreTSni0ZQfIZ97ieC51/GEa1/QW9gYgoyRlqP1b+CNIEXO4wckRBGHnOllcud/iE77W1ABSlHjET2KDxEwED3+dZ3HYvXPfPtIYVDE2y0+j/7+6aLh8m4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021551; c=relaxed/simple; bh=OHtghzBpai6zL2VBEImfx8tJSSEJN0SuOVGpf6g87y8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e1HmhzD+jFdMpH3fIUcednxKn9ndSuAmxEjNAeM1yO9cl8Ee6x+MuJANx/uQCnysv5sjKVA5cOCrVkRI1Z7CaFCxfgrRWPYZ3+7/HB1Uc5Me/n8fQbOw6pgUtnK1AYRIqRDZ3p1OC6nUw604VrBdUdBTt+tyT2C3w7m3uSJdRRU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d8nXVTuH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CD19C433C7; Thu, 15 Feb 2024 18:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021550; bh=OHtghzBpai6zL2VBEImfx8tJSSEJN0SuOVGpf6g87y8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=d8nXVTuHEcmJc0wuMqrJT9PEUe0JeYBdXolJvpe/onsVgYTiZXl7OdcTKZW8ifJbW 2tVN3tUxqfFl0xsnub+tdaR5LqAx/rUwEJ1NFtLsYYPfUJZrJRpWSpt/iJHcj9d9yG laoHgmL8BF5JddBolcPRKkuFIjayD+KYnL6xwf6iSqZZ5AMiHGDn4AgfevJPGyL3Lp dHjrTUuE+p8eTSWyWGAsOLq6rxwNErIFghDz++rt3Mi4RGwKRIqlrtKE1M9WbJ9Bzr mve1wBi6NS0s4wPo+90KMvskpssw4+UAgZg8MOTBLaa/QtPHPUCp/DRzS6Wpic/Vq8 +E6zjd6ljI2Ag== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:31 +0100 Subject: [PATCH net 04/13] mptcp: fix data races on local_id Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-4-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=7176; i=matttbe@kernel.org; h=from:subject:message-id; bh=quJW5M/2G3Dvm2MZlUXMbs6cwclKCNyj5WPf/FoK3+8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlccY2QNT2m5csL7F4Hv6Z6DwUiZ5TLSiT8mE 7GCwk7wb8CJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHAAKCRD2t4JPQmmg c1yPEADXvkRaowUNS1xsIgh5+vrKxrhXCwkih+1XPBw/1XTjLXcxo+i8/Pr0hJTxoc5kYCAH3g+ NXrnZmhTa6QhySQc05+jJKKDi7Eqjuz1uYMa3LzoklvX18qAmS7Vt8HU8qZUMgSCYwXmYj6Yto2 Mcee9p6oycYOaF/LzOc8K136wNoUp7pels/MsgEwnaZ7EjqKJa9J0ZU2uaOojBf2OqmLPA19sgu 4j2LfMgoOeVCWwdnGofrwxRqfdCRjVQpConMrvHnCXgM1EpvCdbZXEUZL/rQL4jaDcqNh13FpCj ubQDTtReTKiKu6+e9r+39OQ4zHdsuscyFSh/2b0FN4cFMkicTPQ51mXfQfpBnuoiJ7JxmrCkyIw VUgoZRTrkbCJHlvoMxaOYSELfOHqCyTM2+G5/nzllThDhgB4imjlC5OZtoNF5evC/VowozMnMtb dS6EuSnBnHKfKGhWuX2qTxyFCFhaNmK+iNFABYt6A7qiYjANaeVSm3sMExpi97JrYDDenJosTw5 4FEN5wi2POdV+9kgzohs2AFg2NW9Sr4GXUheNlK+AGUeFo8hDmseGb67EPfXCpz0d3+d4hHbOlq 0nPN+WyDyV8Ky3+5nxdtTcQsZYbuuQ/NcmnGRPPikqSSwhrV5W7oQBw80OmbBeevUJO7wNZJn2F aH0AMEViEYUJkSg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790992460999434209 X-GMAIL-MSGID: 1790992460999434209 From: Paolo Abeni The local address id is accessed lockless by the NL PM, add all the required ONCE annotation. There is a caveat: the local id can be initialized late in the subflow life-cycle, and its validity is controlled by the local_id_valid flag. Remove such flag and encode the validity in the local_id field itself with negative value before initialization. That allows accessing the field consistently with a single read operation. Fixes: 0ee4261a3681 ("mptcp: implement mptcp_pm_remove_subflow") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/diag.c | 2 +- net/mptcp/pm_netlink.c | 6 +++--- net/mptcp/pm_userspace.c | 2 +- net/mptcp/protocol.c | 2 +- net/mptcp/protocol.h | 15 ++++++++++++--- net/mptcp/subflow.c | 9 +++++---- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/net/mptcp/diag.c b/net/mptcp/diag.c index e57c5f47f035..6ff6f14674aa 100644 --- a/net/mptcp/diag.c +++ b/net/mptcp/diag.c @@ -65,7 +65,7 @@ static int subflow_get_info(struct sock *sk, struct sk_buff *skb) sf->map_data_len) || nla_put_u32(skb, MPTCP_SUBFLOW_ATTR_FLAGS, flags) || nla_put_u8(skb, MPTCP_SUBFLOW_ATTR_ID_REM, sf->remote_id) || - nla_put_u8(skb, MPTCP_SUBFLOW_ATTR_ID_LOC, sf->local_id)) { + nla_put_u8(skb, MPTCP_SUBFLOW_ATTR_ID_LOC, subflow_get_local_id(sf))) { err = -EMSGSIZE; goto nla_failure; } diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index a24c9128dee9..912e25077437 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -800,7 +800,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); int how = RCV_SHUTDOWN | SEND_SHUTDOWN; - u8 id = subflow->local_id; + u8 id = subflow_get_local_id(subflow); if (rm_type == MPTCP_MIB_RMADDR && subflow->remote_id != rm_id) continue; @@ -809,7 +809,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, pr_debug(" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u", rm_type == MPTCP_MIB_RMADDR ? "address" : "subflow", - i, rm_id, subflow->local_id, subflow->remote_id, + i, rm_id, id, subflow->remote_id, msk->mpc_endpoint_id); spin_unlock_bh(&msk->pm.lock); mptcp_subflow_shutdown(sk, ssk, how); @@ -1994,7 +1994,7 @@ static int mptcp_event_add_subflow(struct sk_buff *skb, const struct sock *ssk) if (WARN_ON_ONCE(!sf)) return -EINVAL; - if (nla_put_u8(skb, MPTCP_ATTR_LOC_ID, sf->local_id)) + if (nla_put_u8(skb, MPTCP_ATTR_LOC_ID, subflow_get_local_id(sf))) return -EMSGSIZE; if (nla_put_u8(skb, MPTCP_ATTR_REM_ID, sf->remote_id)) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index e582b3b2d174..d396a5973429 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -234,7 +234,7 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk, lock_sock(sk); mptcp_for_each_subflow(msk, subflow) { - if (subflow->local_id == 0) { + if (READ_ONCE(subflow->local_id) == 0) { has_id_0 = true; break; } diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 8ef2927ebca2..948606a537da 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -85,7 +85,7 @@ static int __mptcp_socket_create(struct mptcp_sock *msk) subflow->subflow_id = msk->subflow_id++; /* This is the first subflow, always with id 0 */ - subflow->local_id_valid = 1; + WRITE_ONCE(subflow->local_id, 0); mptcp_sock_graft(msk->first, sk->sk_socket); iput(SOCK_INODE(ssock)); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index ed50f2015dc3..631a7f445f34 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -491,10 +491,9 @@ struct mptcp_subflow_context { remote_key_valid : 1, /* received the peer key from */ disposable : 1, /* ctx can be free at ulp release time */ stale : 1, /* unable to snd/rcv data, do not use for xmit */ - local_id_valid : 1, /* local_id is correctly initialized */ valid_csum_seen : 1, /* at least one csum validated */ is_mptfo : 1, /* subflow is doing TFO */ - __unused : 9; + __unused : 10; bool data_avail; bool scheduled; u32 remote_nonce; @@ -505,7 +504,7 @@ struct mptcp_subflow_context { u8 hmac[MPTCPOPT_HMAC_LEN]; /* MPJ subflow only */ u64 iasn; /* initial ack sequence number, MPC subflows only */ }; - u8 local_id; + s16 local_id; /* if negative not initialized yet */ u8 remote_id; u8 reset_seen:1; u8 reset_transient:1; @@ -556,6 +555,7 @@ mptcp_subflow_ctx_reset(struct mptcp_subflow_context *subflow) { memset(&subflow->reset, 0, sizeof(subflow->reset)); subflow->request_mptcp = 1; + WRITE_ONCE(subflow->local_id, -1); } static inline u64 @@ -1022,6 +1022,15 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc); int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc); +static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow) +{ + int local_id = READ_ONCE(subflow->local_id); + + if (local_id < 0) + return 0; + return local_id; +} + void __init mptcp_pm_nl_init(void); void mptcp_pm_nl_work(struct mptcp_sock *msk); void mptcp_pm_nl_rm_subflow_received(struct mptcp_sock *msk, diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index c34ecadee120..015184bbf06c 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -577,8 +577,8 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) static void subflow_set_local_id(struct mptcp_subflow_context *subflow, int local_id) { - subflow->local_id = local_id; - subflow->local_id_valid = 1; + WARN_ON_ONCE(local_id < 0 || local_id > 255); + WRITE_ONCE(subflow->local_id, local_id); } static int subflow_chk_local_id(struct sock *sk) @@ -587,7 +587,7 @@ static int subflow_chk_local_id(struct sock *sk) struct mptcp_sock *msk = mptcp_sk(subflow->conn); int err; - if (likely(subflow->local_id_valid)) + if (likely(subflow->local_id >= 0)) return 0; err = mptcp_pm_get_local_id(msk, (struct sock_common *)sk); @@ -1731,6 +1731,7 @@ static struct mptcp_subflow_context *subflow_create_ctx(struct sock *sk, pr_debug("subflow=%p", ctx); ctx->tcp_sock = sk; + WRITE_ONCE(ctx->local_id, -1); return ctx; } @@ -1966,7 +1967,7 @@ static void subflow_ulp_clone(const struct request_sock *req, new_ctx->idsn = subflow_req->idsn; /* this is the first subflow, id is always 0 */ - new_ctx->local_id_valid = 1; + subflow_set_local_id(new_ctx, 0); } else if (subflow_req->mp_join) { new_ctx->ssn_offset = subflow_req->ssn_offset; new_ctx->mp_join = 1; From patchwork Thu Feb 15 18:25:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201710 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp53511dyb; Thu, 15 Feb 2024 10:59:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU6fsWLJ/BHHuwPQTPJpqb+o3u8U3blbon9mBqiO5OQ6n5f/iPrE0e5j5NxM2zql+Lk/W4clE7/mREjzi8QwqtWZ2THVg== X-Google-Smtp-Source: AGHT+IEC4Zq5hl53ZGgr8JDMBtLksU1yTRWrWm2ySMKzQgi3Q2nvCrlIGWnAKFai2TlJgT44fKo1 X-Received: by 2002:a17:902:e551:b0:1d9:bff2:67d3 with SMTP id n17-20020a170902e55100b001d9bff267d3mr3478889plf.0.1708023563532; Thu, 15 Feb 2024 10:59:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708023563; cv=pass; d=google.com; s=arc-20160816; b=W41AkIb7TKC1T64A362sVv8BDqH9aAeWIm7si831ndjjqZSUPVSVvj2DMx4NNWYqn9 FkbsjgReqDtqdFicdeZoB+T5qR4t6BEYt1ES8e8hHipiSrDR11243BSvSDyusDuHNmW7 AFFriXiWXj2+v1ji+4eQaWwTLBANFAug0RxfHaRPuHAYKNLPRjpAICJQJrMB1842E2qP bPUsvQ9Lo/Wwl0zMkpq0b/bwHvPXCwMSLkANBekD22nwK4HXdTGm6A0xVzt9XT0uIMc1 CASXV+xm4EKYKOrV8Ws6HmjL4zcHo37AlH64Unwwk4B0pJu5lHq6tcz3+bPNX16s6X3V qlkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=6fM9T5TQvYHmSDtNNaxarAfvJSXrt/ZD4csLZgGM0vQ=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=g0ob9bL7OeOOvRHh6gJLDa+Jzl/d57gWZroer1Nfbuy0/upZCleRWPcmu7ew1ggCmS fbvSvet9yrZtvCg1FY3CJTSrQX8NUGWC14s7OjOoZWHvvNG2R71jFew8y7g3ATDBjfzW OP0oUasoabz5dpgFWtFVzfZ5Yy2Ko9I1/R9B31jCnN5yMLJ+xNmscg7JbIXMxgW7V4Ew UuXuG//fEKHbkU6kLSCBztw1z0rs7u69tNDCxnNRCUlDZqWe2Ch8xjFQM1faxq/Wr4XW f27d1v0V/YsyEItD0LnwSlOahe1m7SSOV68lvMgifhrlv6llO6JuMr3D3972Qd4UmUk6 0Gdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rCTe4gVp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67496-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67496-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p10-20020a170902e74a00b001db2ad61b6dsi1586172plf.538.2024.02.15.10.59.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:59:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67496-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rCTe4gVp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67496-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67496-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DDD26B26561 for ; Thu, 15 Feb 2024 18:27:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75D4313B29B; Thu, 15 Feb 2024 18:25:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rCTe4gVp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A60E213AA4B; Thu, 15 Feb 2024 18:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021554; cv=none; b=HaFZxdRYkjF3VmwyGoxMXsc1KTS777qFf3JSlEh/cM+9m5Djb1ZhTXCdikAWHTAN7deNLWHMJ8UvrGi8nNsgPGn+mEIoht4cZmu6ix1960H3MBjv0yW4Bi5L8lSsSDGG70cnFRQVINJBrIsTJvbzwMkOBPVW6AnaMBpLdB7gpoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021554; c=relaxed/simple; bh=oQx74ogq8XEWhaDeCHKcAvhTLzjLFWuQ3CeAwMCbB/M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sG1S54HCd+G795QWw7bTDf4yUo/FDu/PL/GCZ5JB39e1tEq/C6jzT9+Xaf3O1RS5GgL1+o6Y/hZREKfhSaufcDyfzr8i8R/YXH/l/buabKPR3kSWBtMc7FeXBX9B15MewObbVWlCi7/iThSqBhob4SVI1lDFfZHW5yxfqpmoZ20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rCTe4gVp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E495C433F1; Thu, 15 Feb 2024 18:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021554; bh=oQx74ogq8XEWhaDeCHKcAvhTLzjLFWuQ3CeAwMCbB/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rCTe4gVp3CgS+5NYJZPr8ydUw7L3eNImhP1pM3nXsljdmr7vQTt5G13VGoUxkJOZG GpE9m4KEb/6rFifYRfV5YnV6zqzFRYM6tYEpvkB08CV1iLkMf3lt9n21UO8I5yRWaj DFY7cvTDmfqh25od7keu8vgT/8nfXa5eVLv112XPZFf9kZnoOzYsz/nJySITFxt3hx AqfKossX4NslglEexcO0dExXsBEIB0xJ2cHYPeyUjOjfwyZTBwE85X7X0ylkbm+vt1 SnNCbpMDMuApQWMT/iyohC3AbD+7waZPDqEL3ItlmO4JENvN8apNqbW7uGgY0lzFy1 68dCT1yp9qlmw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:32 +0100 Subject: [PATCH net 05/13] mptcp: fix data races on remote_id Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-5-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3453; i=matttbe@kernel.org; h=from:subject:message-id; bh=Phzggd1e3xH9VcpIMW2JwQ4VlATGqfBwFCcy2ByLV7k=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcc5DkIVpcVyJl8wBeZ/NcTkynzax2nJW0c/ DoLIIyEekGJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHAAKCRD2t4JPQmmg c82OD/4xprG1PGn0dVQ5wAZz0Pt56+fB/JkibVoLaGb448l91a7iJJCAs0BW3CxGW2KdxjbSKLZ geqGcWFges6Hv3MpOr/Iklulh10dsdWBKf9pYTt5fj8miEgtV9VJcJBb8TP0ec2wzlXv745vZim dcK+cxLtxVa8ulu5tJULQkdVehYPTDdNU1a+u4ujKgot4sIPDSn1Twk3QSbYxRyOv1JqTZ4Clla Y3GDLj+WPAT38Qx9Ayapb6l0Y9j6pX3+qR7bAgyXyK75m0cjP00UOH9+C7ekmwRdZqVOzDcAJC5 ArKPNcrVjXKaYNsj6jDQeYnKJ5S+sSI320PwzQCUuXMYmmLqmI4MJkX+AhNWXSj8CWKEpDkit6B pj6doKqX1/iFLhxfI42twmMNGOGLANGjLyXl8S0kr2uKEF/p8/5wOZejEHyHfFdl04m+rWU9kda WA2qjDdq+VlGGNhJ4xpxZ8AP4OykPEzR6lLf4oYgNrUMrwLlPbb2EeSkwD//MKn/hymcxG9t8lE xZ+i5hhdZKYASKtNtuHJzyWYcYWar3/UBnNEo89Z9RrkJbH3vSXIfw2tzxG0+sAF2fDpCr8Z/o7 MbKNpN7EVQSMTsInf7sc/tPir4tCYtwABMCeI01//JD9tmATYW23r1vH4zsraaEBs6XSrIYYBL5 LSJubHk7NEqp4zA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790992516082669352 X-GMAIL-MSGID: 1790992516082669352 From: Paolo Abeni Similar to the previous patch, address the data race on remote_id, adding the suitable ONCE annotations. Fixes: bedee0b56113 ("mptcp: address lookup improvements") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 8 ++++---- net/mptcp/subflow.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 912e25077437..ed6983af1ab2 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -443,7 +443,7 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, mptcp_for_each_subflow(msk, subflow) { ssk = mptcp_subflow_tcp_sock(subflow); remote_address((struct sock_common *)ssk, &addrs[i]); - addrs[i].id = subflow->remote_id; + addrs[i].id = READ_ONCE(subflow->remote_id); if (deny_id0 && !addrs[i].id) continue; @@ -799,18 +799,18 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk, mptcp_for_each_subflow_safe(msk, subflow, tmp) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); + u8 remote_id = READ_ONCE(subflow->remote_id); int how = RCV_SHUTDOWN | SEND_SHUTDOWN; u8 id = subflow_get_local_id(subflow); - if (rm_type == MPTCP_MIB_RMADDR && subflow->remote_id != rm_id) + if (rm_type == MPTCP_MIB_RMADDR && remote_id != rm_id) continue; if (rm_type == MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match(msk, id, rm_id)) continue; pr_debug(" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u", rm_type == MPTCP_MIB_RMADDR ? "address" : "subflow", - i, rm_id, id, subflow->remote_id, - msk->mpc_endpoint_id); + i, rm_id, id, remote_id, msk->mpc_endpoint_id); spin_unlock_bh(&msk->pm.lock); mptcp_subflow_shutdown(sk, ssk, how); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 015184bbf06c..71ba86246ff8 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -535,7 +535,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb) subflow->backup = mp_opt.backup; subflow->thmac = mp_opt.thmac; subflow->remote_nonce = mp_opt.nonce; - subflow->remote_id = mp_opt.join_id; + WRITE_ONCE(subflow->remote_id, mp_opt.join_id); pr_debug("subflow=%p, thmac=%llu, remote_nonce=%u backup=%d", subflow, subflow->thmac, subflow->remote_nonce, subflow->backup); @@ -1567,7 +1567,7 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, pr_debug("msk=%p remote_token=%u local_id=%d remote_id=%d", msk, remote_token, local_id, remote_id); subflow->remote_token = remote_token; - subflow->remote_id = remote_id; + WRITE_ONCE(subflow->remote_id, remote_id); subflow->request_join = 1; subflow->request_bkup = !!(flags & MPTCP_PM_ADDR_FLAG_BACKUP); subflow->subflow_id = msk->subflow_id++; @@ -1974,7 +1974,7 @@ static void subflow_ulp_clone(const struct request_sock *req, new_ctx->fully_established = 1; new_ctx->remote_key_valid = 1; new_ctx->backup = subflow_req->backup; - new_ctx->remote_id = subflow_req->remote_id; + WRITE_ONCE(new_ctx->remote_id, subflow_req->remote_id); new_ctx->token = subflow_req->token; new_ctx->thmac = subflow_req->thmac; From patchwork Thu Feb 15 18:25:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201706 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp48224dyb; Thu, 15 Feb 2024 10:47:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU31juHiv7ogCs7k774/k7Qr+qhCCFtXJVEGvwIIbUXFzVJzZho7Cc/1SmErHdMn3XJzcaH2/HiadKdC49/IhKxGX6m6A== X-Google-Smtp-Source: AGHT+IEQ7XU3bE6VpA6Xee43jzsumgEm5PryWHht/JycLvI+VRWvj2aoA5mOS+5QAkMwg9oi2Kp0 X-Received: by 2002:a05:6a21:8cc7:b0:19e:c9ad:68be with SMTP id ta7-20020a056a218cc700b0019ec9ad68bemr3043855pzb.43.1708022873146; Thu, 15 Feb 2024 10:47:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708022873; cv=pass; d=google.com; s=arc-20160816; b=movErfoR/uvXKmldnqu7/NJvZtEtqYn9KnDiiOrLDss1BW3kIgXFqxo9K/wvtS0E4Q mMtOl3UOX1JViYZzx32gnMpIGwUA1zaxpHaIlw4PdDelY044g2SQeuiToChD1WhUBbOp MyOG2jj7RkI2b+ll/BoZyyCHDQxADQh/9+T5DjJzXLz1cZmywQi+C9b8AnAs/3o17PmA Uw5cCyh5eumXub1rBSHnzXwpgLJ+WuqUvWX/YUdNKMpSwfinR7xRGQZUC84c6yiHJPNs +AdmTKNHSSGZlTXpzw9RYjqD2ZnEKAKO7TY8PE0Okwkl7gC6crBR0g8Y6bKDJLsw8Jhr C2rA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=NRRiuWjh4lQpekUW2af3+qj3EfCoix3eZ/pKB+Wybuc=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=SEF2jLJeUdKtaO8XDTn+McLBPUn+4rqp0K2+GHaJffOS1+8Qjmqoq7Gu8GgmJzxcMN DYQ5bRxFhbklgaTw35Tzd1G2YAEsyAZlyyajG8NxPaJOxF9myfCJRovc3r8HXmgU+WTw KNwXqRcr1cLyVPa/8ZayLGWOM4/BNNYFrw5ixGdb8qSvWrjm/MWlaqk45nx8BsM2ntzU +KocO0S+G0v4/8VEi/eYLIiuwCMhbDftd3vreyiZoItIwaKT+DmmOXpkLD+K7nVQgNXe VNzTTf8DyetkaciOsV8qy1HAMF/LEvbcufUM1G2Mxuj8y1Rd6tWslOfm4LEKi+s2vhtK y10g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jcfqZGyZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67497-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67497-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lv15-20020a1709032a8f00b001da17808c90si1543569plb.537.2024.02.15.10.47.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:47:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67497-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jcfqZGyZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67497-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67497-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1FECB289CAB for ; Thu, 15 Feb 2024 18:28:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F60B13B7A0; Thu, 15 Feb 2024 18:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jcfqZGyZ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 978B113B29D; Thu, 15 Feb 2024 18:25:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021557; cv=none; b=Ao/haotF1lERtWwdybP4gCPrRVmvmWNrn4gGZgwQjXYWMjav64b2j7sF6356dZRbKcmPG6UDgueHfA9gIMublanHKZBK6wqiYqv+TafzrpmrHTx4gxFafTYoBkkunMghZ+vMJeSD8B+rTLZeLom5MyVJmyTxDJe178OxzPKF/ns= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021557; c=relaxed/simple; bh=g7fXBxyk3jJrnTY6KxuB+UW8rqnCEuU0+GG9X+ksv04=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fjJVczpLRiA3R6MU6vpnCbKj3GHI6JQx27srChSNot/PAsjlHGC/DAWJf9bd+lj5T1blurl5dXIJPMNEqfz+oYv2uR/qrXwhIcuZPlv34AQoRmdEIFLffBEb508dcGWEmUn2FqVqVBAr2v3YtJ1zSUXc7BmQq1//uU26pGfUg7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jcfqZGyZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A979C43394; Thu, 15 Feb 2024 18:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021557; bh=g7fXBxyk3jJrnTY6KxuB+UW8rqnCEuU0+GG9X+ksv04=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jcfqZGyZLvtbM1PJwk7WBqIsm3ltcaTJcRD9X+ZRjAchR1bBA6AMfS11ZWNm3ydOb fkjgAIkybNWaQSUmiGYmrHySXBukhS4PTI1HQTU/V2HQQgnpCZM8HWySwxrYGSMZvb wocAhSvZCuyOIu0E7DeVKXbbECubkJpV+RGlZaxgNEKj1JIgjOrLtr/JEwpK0g5lCy W8WUSyvZea5HF1sNy1JJlIEkLLpsclL3SRiKhB3qhpbmWiydIAZzEe4b3KtYf5X9cO Cf61JeFKX3AvyktyvLx+n5yDnoGcG3DVH9iyugX8lbEMB0lfT3Wq9SftBNyRmQ79eR SUDHRGFbkyy5A== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:33 +0100 Subject: [PATCH net 06/13] mptcp: fix duplicate subflow creation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-6-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3034; i=matttbe@kernel.org; h=from:subject:message-id; bh=ws82kCFP+tNaGXtybdfXTs45hTTSHMXbFSuBqCwGyG0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdS6rUmaz1x4lw/43gIP3ya597R0wIip/bn 86sZXUJotKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c03UD/9T+Ps9qSZ36F+qV9NwB9r5qhdozBVeEKhPgZ+2oJlhCAqHVNQlOH/PnJOH/VSvyTckQaP kFSJEDM4ErR4sa6fxUnDq+gNtCxW/k+H75zmjxO6ScjNGvxUp32XZJVkYMux8GfnORkdjrIEU3r HS3wh0dPxyMoy7ceGchQzbN8AxufkuMQx0Vu65pLPUzKMP9oSHtYjv1Kutq2OLboYiHPSPTV7y6 fQfgS4NVi6NOIVumJ62VLMM+lcDIThpGwfdiADDp2mj/Ru0yun9sD9wnOCnTKFACPTqc3RTbREw 0KmUI7TmPwkHXLGf5fhMMJsTyoyF07aFIYh+m7USOnWDnoLkZQVmGw6AE/qeidsnBk0Sj9tagX4 8m0Hqjg9oqXyjItTrxaQhrHXXrO1lom0BgEaIIHZ6FpcwCdMWQmma0KElMj2rJ78WGAnYbLnjQl jCjXBi75aCBg8MDtLtwOouf8Y5ZxAOLtMm5h3OC/k+MwJW0cDlrkovWA/zrM3fHDZvUyIgacbuF Rg6j62h17iswnIUQY2zXZw6L902ZWJoXi2QY/PKWLWO6WSIC+9SvJpYU7c798m/QqYsx2rcAvh0 mIZgrRa/xgq20qZF758p+utxUKlJ6hZjnpD1l6XhCcmaQ0onoJb+ONFmbqNnlEkyCEcRoLLRhcC XRDbmqITwPjwFYQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790991792329508414 X-GMAIL-MSGID: 1790991792329508414 From: Paolo Abeni Fullmesh endpoints could end-up unexpectedly generating duplicate subflows - same local and remote addresses - when multiple incoming ADD_ADDR are processed before the PM creates the subflow for the local endpoints. Address the issue explicitly checking for duplicates at subflow creation time. To avoid a quadratic computational complexity, track the unavailable remote address ids in a temporary bitmap and initialize such bitmap with the remote ids of all the existing subflows matching the local address currently processed. The above allows additionally replacing the existing code checking for duplicate entry in the current set with a simple bit test operation. Fixes: 2843ff6f36db ("mptcp: remote addresses fullmesh") Cc: stable@vger.kernel.org Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/435 Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index ed6983af1ab2..58d17d9604e7 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -396,19 +396,6 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk) } } -static bool lookup_address_in_vec(const struct mptcp_addr_info *addrs, unsigned int nr, - const struct mptcp_addr_info *addr) -{ - int i; - - for (i = 0; i < nr; i++) { - if (addrs[i].id == addr->id) - return true; - } - - return false; -} - /* Fill all the remote addresses into the array addrs[], * and return the array size. */ @@ -440,6 +427,16 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, msk->pm.subflows++; addrs[i++] = remote; } else { + DECLARE_BITMAP(unavail_id, MPTCP_PM_MAX_ADDR_ID + 1); + + /* Forbid creation of new subflows matching existing + * ones, possibly already created by incoming ADD_ADDR + */ + bitmap_zero(unavail_id, MPTCP_PM_MAX_ADDR_ID + 1); + mptcp_for_each_subflow(msk, subflow) + if (READ_ONCE(subflow->local_id) == local->id) + __set_bit(subflow->remote_id, unavail_id); + mptcp_for_each_subflow(msk, subflow) { ssk = mptcp_subflow_tcp_sock(subflow); remote_address((struct sock_common *)ssk, &addrs[i]); @@ -447,11 +444,17 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, if (deny_id0 && !addrs[i].id) continue; + if (test_bit(addrs[i].id, unavail_id)) + continue; + if (!mptcp_pm_addr_families_match(sk, local, &addrs[i])) continue; - if (!lookup_address_in_vec(addrs, i, &addrs[i]) && - msk->pm.subflows < subflows_max) { + if (msk->pm.subflows < subflows_max) { + /* forbid creating multiple address towards + * this id + */ + __set_bit(addrs[i].id, unavail_id); msk->pm.subflows++; i++; } From patchwork Thu Feb 15 18:25:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp38359dyb; Thu, 15 Feb 2024 10:28:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUURHc/iT0OVv0Y5s/OP9yezKwbbLrcYBgz2R9+ujJjdy/kudu7NjeZJstK0Vylw2Zbnpyiw9TwCUcBokZSJNXH40JW7Q== X-Google-Smtp-Source: AGHT+IHTdq8xFgZV+FXKkBGQj5OoSiGF2pnKDPRa77CQ2A4BrPD466D1nPGEiTcIrtlOdH14VK8j X-Received: by 2002:a05:6102:308b:b0:470:1f3c:56eb with SMTP id l11-20020a056102308b00b004701f3c56ebmr1671406vsb.17.1708021722272; Thu, 15 Feb 2024 10:28:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021722; cv=pass; d=google.com; s=arc-20160816; b=TU7K93eMW9QnIkCfF1eDWoVLXwMNg4TU2/PuFc9y5sVv2buh4JRBJ9y/tP2lv+nYaG kKua51SofQu7kCpB8KL1Y5tsMA5dBwaQVZeY493aDXOHe3iYXg7Cu2HEiuvngFaUhJju pI+/Qi7kZPgU6cDg26JYbapBrHFq9sPwydgLrO1V2b34z8GzqbvDMkakADt1ECS8B/+T VSrDPYJFO7et0BpghYL/CGXcMPQCX38FpVQw6fEnajsPlb+2l7AhnwmzQ/5kaa0tnPYi gpX/Of2XD/LjCQTysXkBisbktL8ZkH8oWlnggssFYsI4fZfHUNOlv+nVEvItsu336sS8 O2bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ZXMm52+bMNF80bFlgPLuVeaVtvJoWypWqpXaEDyp8TI=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=rkTD9EB33ACpng2vDv/rycd/gXGmgKaA/hS8L0SsIrdKkDQnFioiPWSiPU2meGwZCE dW4h6XdY2ZV0HA1tUrcmXo8AvrxI4kKkb1UQPr/XxAgCyk2x3/3cBDv8dy3pM6kr8bFj ycWPpMf5u4KKF6/VEu5OUjga7n5AYrzUCbq7XfxN86svPxmRg0RmpGpzcHKBEmhUpFqp Lzxlza15NEZTjFwuLk4SERv40cvMVWhoMIBAfGMzsW1hak2uen3V7aS4OUv0rsVSuatE 1Ve/MFyFHcojfnUSNzm4d9vMayWndLlOJ1zrX/xpHEwjdao2BkYLoEcq6JQZFo52+CDX QD2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DrKHk5wG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67498-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67498-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 4-20020ac85644000000b0042c3986d756si1918049qtt.129.2024.02.15.10.28.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67498-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DrKHk5wG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67498-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67498-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0D0DB1C21E6D for ; Thu, 15 Feb 2024 18:28:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E5701419AD; Thu, 15 Feb 2024 18:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DrKHk5wG" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D3EC413B7A7; Thu, 15 Feb 2024 18:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021561; cv=none; b=jb7vrrEv783LIXQwvv3fNWFm6hZLWtKg/Y5AaEMEBg/+jOLCqP2DbvvLpdRWYPq6p08ntU5efCWb3CBfcP+Tpj04o0nULU257iHwQK37igDfjfenQqwIRAXM4q9WFAMRrMf/v/WdQrjPrwGs5B7PSX3pdJkAuz6zJ4ZVHsKxJSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021561; c=relaxed/simple; bh=Bd2G68hqKS5Z3hOL7RVjNT3ktLWLRKfWpJwK9WO2ZZU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qYTQfCVb+pnCGL/lwBXShECdG7vkMhvhF1sqPcsS6h0ycyTOd8BviASYJO+xfdq4Md/7HQN8D/XDr9k0UJH7VFMp15cOLgeesZH8dve12NiDacShO5EVSlyfCKKh13YVe7laBo9diHAzGx/m1YCWfrJYTZgx/x7QtEBf/gFkAV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DrKHk5wG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6341C433B2; Thu, 15 Feb 2024 18:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021560; bh=Bd2G68hqKS5Z3hOL7RVjNT3ktLWLRKfWpJwK9WO2ZZU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DrKHk5wG3+p2ZNKh926Eg3PmQNr1YBtWGcvEyZ4C5er1uZVhGrM2rgByhgETbQrm7 BQYnB6PuTyLD0Ndab/b+2yC3okD9/dNVb9oOyQIef9PQF68Ce2SR5TSLhkE48Bp00D 8mmNPJMdjngvXnltry1uzjHwCcFt0RxQ6Pt/bB5KahecBb91mNbAccgCtDQiLrMOM6 0T7u4FkqUtKZYsYJn7s7iuXgMhttya1dzDUXtO6j1GkZb9rP170k+jLt03bJ2Rk5SY WIZxozBeW+gHSmKpFP1iW12oy2z48RnDrJQM7zhAIu1m6PKNOhWMABqb0B/MQLHLVZ C6WFhawJE35kw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:34 +0100 Subject: [PATCH net 07/13] selftests: mptcp: pm nl: also list skipped tests Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-7-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1225; i=matttbe@kernel.org; h=from:subject:message-id; bh=Bd2G68hqKS5Z3hOL7RVjNT3ktLWLRKfWpJwK9WO2ZZU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdltt1zNZUj1lxTpJ+Xy4MXRQYvcDQW8XzH GrXkE9RgsuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg czImEADH4fD2jn4rT8o8cr3H5ap+mhXSAssT2+gbN49a+XXOHtsbxYazUOjB1CrvRCk8qy51r34 IAlcd13y43tpHnfgZMHC+N3imLhP9K7jnMD9iikPxxrSwR/RFJRg5UtzQPV/PqrNUeURLXMUWhO cxaZvN1Ht8kWK0MaUr+2JUDyYygHmK1jFw1vruj+4W2+0HJeiL98+f+SF+LvcIkgAL4bROQKY3q ePYBQJqXiPCv0hddekcxtykeCo0jhN9pdRngG3K5asBYeH3RbIrlbe93hUuSh+BrAbGqDBPh+hA CQiOr+6yqL04CGu9vAm6J16TdhynT0nXxRS8h2m5mBigoW3+OJv4wHF33/dedBw34TsZHBMs+Wb BxHbuxXN7Oq6xOyrGf7dK2vHofeBNGTe113NV6chZedvf22hv/EbqMpBHMavveporR8zBNaLnva eS1YSzGEZyV+u18XZ6W5SHyHUccU6nnhdQZPWWlwl4IbQEwxjdClYRpcmjj4S2p7/OF+LovBUBZ H0e/Fpt9tGZrunSr3/oz30p2vl55s7J6CI9NEzBxF00mW3EwvXByajoHGrt2jVe27t/mpJlaTe0 wndPLN2Gp01EkLSC12YJjytI7nUPY+hIFOdAhBN2y+k7UD4ESLwYf984Js2Iu3SUfrBQ3QsgPD2 C9ACKtGvooElWAA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990585344568191 X-GMAIL-MSGID: 1790990585344568191 If the feature is not supported by older kernels, and instead of just ignoring some tests, we should mark them as skipped, so we can still track them. Fixes: d85555ac11f9 ("selftests: mptcp: pm_netlink: format subtests results in TAP") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 8f4ff123a7eb..79e83a2c95de 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -194,6 +194,12 @@ 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 \ subflow,backup,fullmesh 10.0.1.1" " (backup,fullmesh)" +else + for st in fullmesh nofullmesh backup,fullmesh; do + st=" (${st})" + printf "%-50s%s\n" "${st}" "[SKIP]" + mptcp_lib_result_skip "${st}" + done fi mptcp_lib_result_print_all_tap From patchwork Thu Feb 15 18:25:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201705 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp47812dyb; Thu, 15 Feb 2024 10:46:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0G5fdLUw2BT88T8J3Ny5Mk2Roz4FELNk7WX5FbBfCUy8FIiSsrdaK8yj5D/VjJVAbuBpuydaZS8Zu9xHxp0GV2GcGgg== X-Google-Smtp-Source: AGHT+IFpog0Uv0VIsLVpeIUSl2UWvt+I2ZZW4VgmbaOFUKY0rGro8kNk/ThpbGAm1QNjW4bJnsL6 X-Received: by 2002:a05:6a20:869d:b0:19e:cdaa:83a3 with SMTP id k29-20020a056a20869d00b0019ecdaa83a3mr1972985pze.30.1708022816179; Thu, 15 Feb 2024 10:46:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708022816; cv=pass; d=google.com; s=arc-20160816; b=MyfQxJ7L/SBCnFqlTOwXYQ9CRyLLVKnkgKmcrTDnln47Kgg+OvX4USSNZTYr0O0unD 1VOSqPmeq4li9t/zrKgv3msNTdAOkAnN2Z1ucqgdr4yLNNKUFGn9m9SYszCcYRP4Xi7Z XHi1+1ILyDH1reja5lnRWw02ZiH5LM3qFOyJ9aTid5uzic194stqy6ia87m2ijRiuBwj Bl+GCgCj2lX2nYDcJjIyKN2PjEcn2EvMS3NrcukI427mYlQEnima1qO6BeqUDglzhvgN 5bHvbwCelcT8mg4asM2VmtyGF42wlUyvjutTwA/MCC4kUGqzetB4H9UpERufCW6jmDdQ asow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=m8/jB914g5gXdHlmtjMtYUqJwWgZvn9/+eRiAl284Tc=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=leUP+HAUABmaUsUUNmgaFNxZLbRtV88QxGJ/tUTFvJ3xkn++CpjwdSYTrs3xsHT1AF Mka66slPsIzBENzIAgqKKHjk41n7s+bbNmATVFqKBiLe+A/sXYSpd08M485BTftKlcN7 p6uq7isOx4ruk+XjF48g2h8qAAi0HzU5FDXrbYaUQz9sdDYeMM+uEV1CAhbm49ifPOm8 GshbcqjDHXTcJpIVXVX0rV63AOyo7kZZLKrk7NyCGD/sGxA3pA5ZyRadZAsY8SX98bFm 6soSibo7c/bdfvd+w1xYnabjcR5r0zqIjNxALoGT7WO/fgMh5AgTVIMsqZhqs6zGScyL 5G4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Al7QWs9T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67500-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67500-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g15-20020a63374f000000b005dc5061f211si1495531pgn.560.2024.02.15.10.46.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:46:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67500-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Al7QWs9T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67500-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67500-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0B3C628C262 for ; Thu, 15 Feb 2024 18:29:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2944B14199C; Thu, 15 Feb 2024 18:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Al7QWs9T" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 67C2D1420A8; Thu, 15 Feb 2024 18:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021564; cv=none; b=VgtOka0G0C49HFlgzcr87Fs7k3OJpDZnRf6weOQ2tTxIm/5pYvRfRWEUV85Dt85z/sktGN4r6avSU/X6VY/PDteh+FRy9ascGhgs35Qpezxn3HmZmrmZ6rLrpjcXYMQAEv8VZ9cVg/E+5PIgDtqTSdlhusNaH2PrB0ubPnJQm88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021564; c=relaxed/simple; bh=w1Rh8ZunC8Bdt6wf4+VcdM9FXwQfuyyU9C0fs8jsrt8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UG6hylZR0Cgj0XWMXMjSqFqE806EI5WQGO4+kmFz75rBf/u0dTf1iU6LWqW+8cPZmvBB5oYZfvbkQwDeZQiv6VucL2kViU3z7iSdW+NYqsZY8nmwwZ13X+h6JkW6tf1280IJJlEOSQz4yT8T7hTg+mFSi4b3qXXubM9/cuA/CNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Al7QWs9T; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DC06C433A6; Thu, 15 Feb 2024 18:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021563; bh=w1Rh8ZunC8Bdt6wf4+VcdM9FXwQfuyyU9C0fs8jsrt8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Al7QWs9T/G69kjvm27o1VMMXzP7FweGoKwWD30cvL0PQ5vODjxA7m5f09CuWkB+iA 7p2nojtejPkDbPMbuIn4aIyV6biRxay+co1pfaGMYwqz1VC37UN7yRFSYcwJR5UxxP DbrHVph2017j3yTm3oUmd+zPYWZj88NF2rJSuTMsSO/k1EUxPS0Z2A6YI2LfjKvUTN EgK9aJfLANIICrkayxopDau3c8aXpAClsnz39yPCVxkGcXasCw8x1buaS+L9Ao0dqw dSNYAwqoJNZpsmZd0fvN+v7DedM83zwtesLLOcuP91R/yoTmBHB2i3AsChn45VRysn ZNYh6kG3OpMYw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:35 +0100 Subject: [PATCH net 08/13] selftests: mptcp: pm nl: avoid error msg on older kernels Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-8-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1510; i=matttbe@kernel.org; h=from:subject:message-id; bh=w1Rh8ZunC8Bdt6wf4+VcdM9FXwQfuyyU9C0fs8jsrt8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdQJc88jVZfNYZ3LyirBDc4yQQVoMYgoC9P 97Rdj41/QWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg czaDEADi6qZJ+L+5bbEoki4/EDqyazx9R6y7ZQqN03HsAPONCrWBnnRaG3buFlHKFbbcJalLLpA xAg2LEXAby0+OJYn0b5Hr+YxsriSdlyxshUfotRDb5cKD0ZiYEozAPjTqZPmhzbegP4rKVZRsWs gqQmPzD5UrExnsIe9izF7ywtk7uTQsVpQQLwvdhsNE/PKr3RDZgM9M3/L5ZB5zBL0W5/7s/8Kwc hDGv8lSAawO+XovcuW8Jp0WPLUGZ8OlGuUdMAEyW9ep7LSQVlGVkFmZP/DrV4aTqXgmAj66Sv3N +k8uqNjuxfL5aUbBhFoCsEb/i7NL7DKzKG9gew2b8GRNNruo4wZg8KE95yiI/UPN5xIP2/XnPJB H9gfmpUWhtsDQzowt/rRI4a01pp6isrCIBAvxkWAVGhP/mPqym71vrtY/p1gxPIZJj657JSV5QD tb3agLRIXZiXfbBp63bGWWN5OHRDmPlaAEk4YmL+aP1RhHGdI3um6htzLA6VXBDJqHjFnYFrzaR ktXQ0+1o4WnfU3DpvmZyDpLRoQ2lanwaEkCbHjMo3H8rdRCB+hLVllHaRCOdxXBwhN8zDp8vTHH s1x8b97dmCu1p5oASEQH811RZIhgiDpZQbpoCXu/udaQ3iDdcyNMR6+CfiOqjnaspURgk3GNZc6 5MzuIGo4XVFcuKg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790991732560903433 X-GMAIL-MSGID: 1790991732560903433 Since the 'Fixes' commit mentioned below, and if the kernel being tested doesn't support the 'fullmesh' flag, this error will be printed: netlink error -22 (Invalid argument) ./pm_nl_ctl: bailing out due to netlink error[s] But that can be normal if the kernel doesn't support the feature, no need to print this worrying error message while everything else looks OK. So we can mute stderr. Failures will still be detected if any. Fixes: 1dc88d241f92 ("selftests: mptcp: pm_nl_ctl: always look for errors") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh index 79e83a2c95de..71899a3ffa7a 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -183,7 +183,7 @@ 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 +ip netns exec $ns1 ./pm_nl_ctl set id 1 flags fullmesh 2>/dev/null 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 \ From patchwork Thu Feb 15 18:25:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201693 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp38845dyb; Thu, 15 Feb 2024 10:29:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXggY9KTFa+80gkxeyjK3HKCNc20qCbCkYU4j1DkTSbenVzptiwHWce/00sFsBVoH9iDDSludhUvburt9/3zK5eE7+N9w== X-Google-Smtp-Source: AGHT+IFc8YThs1roKd6jXlGj3sORpPT4PpIw4Uyi3u6Kc8rXBC+sBJaJFTcNJh8G2jdW9SWYQ1UC X-Received: by 2002:a05:6402:d6b:b0:563:c09c:13cb with SMTP id ec43-20020a0564020d6b00b00563c09c13cbmr1321990edb.30.1708021782640; Thu, 15 Feb 2024 10:29:42 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f17-20020a056402161100b005638d881b40si850168edv.619.2024.02.15.10.29.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:29:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67501-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=ewC9O0Ii; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-67501-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67501-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4574D1F21C3D for ; Thu, 15 Feb 2024 18:29:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 471F6145B1D; Thu, 15 Feb 2024 18:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ewC9O0Ii" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A8C31145340; Thu, 15 Feb 2024 18:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021567; cv=none; b=gqnAgws/1vLeK8rwds2q/5t0856VSVwfNwSVoPOGNSkUsnRcqITQeHL8rZuxXq4eRcd4b4Laa0URvcoGLl5deQVCGMC/cAPNmiAKkR1ZdL+2qQ/9Un4m6uDesq4uWdm1B1cwTVNs+mJBCCuBQSh1Bd2259idjQKbIdK1XTPYGdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021567; c=relaxed/simple; bh=I8tMy3gnZsswLPWO4mHgqxW2pTFHXbmUfYVHfI6K9Jw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iM3bEGIsBykCaIkeTIXdbM9ykBPyulOQNd3AA96cXuGZlkJlCGbl/awrQNvvY9mdK3E7M7tNTtz51HeDQzQ5dQHcjOEjsYHG2QedVlnpjAczZOlnEYjUhRE+Z0fFoq7B+qx5CiwboIQy6bgBR173spCXg9w0h5zkxO5eLDrTCVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ewC9O0Ii; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57816C433B2; Thu, 15 Feb 2024 18:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021567; bh=I8tMy3gnZsswLPWO4mHgqxW2pTFHXbmUfYVHfI6K9Jw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ewC9O0Ii2Ed82h/9pT3SnHkJ3t0Ei0dG/ES3LquE9YAXlQ/hhKYU0xTREvbnX/kkE E1Osw8pix2a07pkOVEbz1/Bbf1o2hvAg5nokYwlesEWCkt+IKJwjaL8tg3FFqQr7hn yci+AwOZplzpbOYUkPFgo5Ge8YYmaHpEHLWK/HXsZJ9eApFZwjRlFPLQcCZo0qrmKI SVc72Xbzmbl9Rz1FmpUYeyrZZJukD1g17oDcG9bSobnwaqJuizCUVcEl3mLxo5kMRZ qMB/dKNPuoa9opSokX8HliYKr2rfapqmypi/hAWGU8v4vqIJdYDxACN/ZZZqA3el5K kbnvoUNZQ+RUg== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:36 +0100 Subject: [PATCH net 09/13] selftests: mptcp: diag: fix bash warnings on older kernels Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-9-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1379; i=matttbe@kernel.org; h=from:subject:message-id; bh=I8tMy3gnZsswLPWO4mHgqxW2pTFHXbmUfYVHfI6K9Jw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcduQs28cu/Z97JCqjemC0Ze0BwKG58kPlXH Ruc/vurVkWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c7PREADkxziI5UoNVMO+Go6c5uaYWKgVAgzf/DBBaXj+/A4UQHp2cRPpN7ZwB2l8tOu9JJ0oy6l 17Ju2ZKGb1RKcBmUWAgO2+FJuU5hFfmczle7qyl9RzyL1OQ4kB3zLjjEg5SwS+hYXH9juSEBQV6 zOCiYnTRjKnOmrAhZaDHgfh2Edo+PaoUi3/5hB7QX+f+gY86SnX4hKVdAg/TnUlnLA6PtcT3wch fu/MFwHpYuUjbO8dgj0FsK5+/HoKUd7H/UCXVhEepV9OX6sQYocHEs8atcIcyBT+rP67k9wK6MD FeyQ4Wmlw3iZMddOEmsj1AEYc0yiLuRnUEOJKVVVFcDr25BoBpNsT3xjs0c1ZZyKCTW0DMX0lWI heqII/9wrj7mHMFVGLQJgQsCGDqKZoRVPGnvgQ4TnFSjU8sgcD5ptF6oYbXhth7j4PxOnsrXaVu ubGPTp76ojN9cKk43nPyFGYWd67rFFaCR3n8mZ1gL+7ez9AgSXUoC93O/JKGPetLVgaWP3cJmNE Vb5PRYQf9bRUdzBhKuXfes6gedqhUC6RQaudxUJNacfhJtDKYE56GtrIsBt7Mtz2pZx0ahnBueX vU6+Fj+gMwd5pFuJRlmbAZKivZw524KIjtG/MZn/rG1KMe3QvIwebxpMy42ujyn6H0sMY0akMN7 fjEdGZuKyjYdn7Q== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990648695118103 X-GMAIL-MSGID: 1790990648695118103 Since the 'Fixes' commit mentioned below, the command that is executed in __chk_nr() helper can return nothing if the feature is not supported. This is the case when the MPTCP CURRESTAB counter is not supported. To avoid this warning ... ./diag.sh: line 65: [: !=: unary operator expected .. we just need to surround '$nr' with double quotes, to support an empty string when the feature is not supported. Fixes: 81ab772819da ("selftests: mptcp: diag: check CURRESTAB counters") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/diag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 04fcb8a077c9..e0615c6ffb8d 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -62,8 +62,8 @@ __chk_nr() nr=$(eval $command) printf "%-50s" "$msg" - if [ $nr != $expected ]; then - if [ $nr = "$skip" ] && ! mptcp_lib_expect_all_features; then + if [ "$nr" != "$expected" ]; then + if [ "$nr" = "$skip" ] && ! mptcp_lib_expect_all_features; then echo "[ skip ] Feature probably not supported" mptcp_lib_result_skip "${msg}" else From patchwork Thu Feb 15 18:25:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201694 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp39098dyb; Thu, 15 Feb 2024 10:30:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUWKNQPbP2KXrd0hdE5WrYHf8d4yQbhezTgMUPXo9DpDYq3/Hwc9wg/X8ZHWwwcWd+5Vs7Cja30QARa3C+rMq7r8vcuUA== X-Google-Smtp-Source: AGHT+IEOPAMpOZOjv+riBW4xLAVRzRkKoHIEZd9fbH74VkPpY6b8QXdqTtu2VXEsZIOM7zxPqXVg X-Received: by 2002:a17:906:c2d8:b0:a3d:5f3:8941 with SMTP id ch24-20020a170906c2d800b00a3d05f38941mr1822310ejb.50.1708021807129; Thu, 15 Feb 2024 10:30:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021807; cv=pass; d=google.com; s=arc-20160816; b=yF37Auw28GCTqcZ5g+gE923i5MZMRV0Vq+g30u8rfmqQ8Mr7NuYDI7vlXNE6kCpcRy iJAJaLSRm+vwN53OlEN96AoNkPykv/2BEVB9zIsRPR4lRhFWldHoqe8iHZNEWNhZZPgt aCrzuW3MwcbuVUDRu6OePAwDKxQ6iGciVjurQO/VYPf3UYnxgm4hMCzQe1KHyws8WfEJ 07d5ZpLqfu+PFB7TLYPlVC0AqdCWPtkFiMTz60s9VnUgHSC9N0zsq9fzL8j/EtnSINAF 3YjqzdScenlpFC1GwF+tT9Y/ZyyuuE8Qx6KCzXTqL5UD3QZVGCkWvqzCBL2Z4gNJNN9/ ZwBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=io+lAFKSf2khEkMDxaxMN3Jspo4ytIseDgM+lAKmJMw=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=BF0DmAm8gcsU41tHHfotCR2Yj3bcZHMWTwBXPXTirtL1U7wFxW0QD1IXR5OzYLtKHq Yiow/3V4kLkIbwOqviYgVazgCZXmP8m+xURDt532wk2kreC3Y8aqMaJDVoLCabiROBiC gNyeTbZWi0M05hVj3xXCyxE8mONotNmLMDNfzyQo5LH81p3Vtn4o1yUE0Pt2edDS26ip Ue2Dn3f0DjfBCf+SqMu7O6n6jAbTCZPDbguRJvLchNXsCuJhxfS62YQnvRvseoeZXGP6 DLjawfPb8zYvbsKs93mwTzqg76ERLjDHKfNu7Moec74+XAJBU192tfpJTsgXH5XfYZGU EUcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E1fg1CfX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67502-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67502-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t4-20020a1709060c4400b00a3ced0f6eb3si831389ejf.547.2024.02.15.10.30.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:30:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67502-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E1fg1CfX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67502-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67502-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BC2211F22369 for ; Thu, 15 Feb 2024 18:30:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84CBA13958E; Thu, 15 Feb 2024 18:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E1fg1CfX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DF39E145B22; Thu, 15 Feb 2024 18:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021571; cv=none; b=WiKWb+51UWyqEFsU7/ECe+Rqu6wS8LgqJfDvuYAlGehdjPnja9f5ws19n8ldRr3sPpJcYN+8JOEbzmY0TFY0MmIvY33dvlcQmlzF7wsNQQxc7J1Q2fzjbePmfMTl767lUJSVnEUYc6d/Jlq1neTwiLmeaVuZ0oWvdNH/BjvtTBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021571; c=relaxed/simple; bh=nSs3+BtV2/ff367YsFLdCP2QJFXRZLr2rZYWqLUTkaw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IT2Cujd578W98Vk2QUZFBz3VbBCiEKymeD833rebu6eIsIlOCOPJZEdr482t9e+QnI+0mhWT5kCKPixf230pyDjc4m4kQrh3KsDGG1gHsT7rPwNptogOUTa+7i0n0lvMV4T3+SaCDToeVQJxsvH67V57l9wrGXKfM7Oy73EF6t4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E1fg1CfX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9140DC43601; Thu, 15 Feb 2024 18:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021570; bh=nSs3+BtV2/ff367YsFLdCP2QJFXRZLr2rZYWqLUTkaw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=E1fg1CfXSObE8/kfIxsJmP+v/jEG0Thgw/EduNWRoELHyp70IVkPns2L8u24mf7NM BnrKTedtORBmBI2ROagzzosqMpt6wOUnqYujZ4rui+DHrvtUw0bTgu4gFT0l9wszky teK+gpVBRvLHHg9zIEzLn+iWc4m+kUhbJmozs22g3MtbZmMzSKOeJVK17PwvAGax8Q BCHyQpWJAQQp2h0f7GvHoS7aBGHqRRp0uGdA82zJWbpwN874Dgljm8QTra6DDWK8Bd yj7pp6XqSNt9htfBkI8Uycp6DZNN6NobSmyusYgtpDRBdIhIn5AXE0NtVxo+4DbBch Fiy9+4iDANzQg== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:37 +0100 Subject: [PATCH net 10/13] selftests: mptcp: simult flows: fix some subtest names Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-10-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1143; i=matttbe@kernel.org; h=from:subject:message-id; bh=nSs3+BtV2/ff367YsFLdCP2QJFXRZLr2rZYWqLUTkaw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdFM+5TfOdHD5haKNyDgG3OAhCJaATM2U2V 4Ey8aah+taJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c0R6D/4gBNd1KxJP6DujFTdHPSngx+eyZBvJ9rjifc7Ojc2PIj/350Yq1JlyJir8Siw210ZdXZ1 qUC4dzieNjDM+PV9qnLXWcsvQeT4D6Xyw5vp+CPe7EG9IiWdhDUtKnANfH+yv+IyPNmFrEUp+Gs dY4G+Tee/FA8RWpK1JiH64rdAq1JnpFbrXBylU03RwBkFa7MDc0Aln2vJzpSDiYJuNxllD5f8i6 nec7Fz5qe1VA5a7lTdm4voSZFcFGOqqd38TmMxBARZVV9ie1yG/G7HShKCIHCU+W7pZt38iI95e JfDrTVZ1Ps4nBDt3z/kbN3ZCyC1y/eSyr7yIcq7zoM2mWqIPUWfDdwr/L/Vpho2Gfa1TDX4ixEU +kYFyrdLYqVuJxBoBYmI4TzMdUSO+ce7u5B6P3nXH33obEJUwan2Q7vURwZEuej0iNM4qQg5pxC 96hmKoeCgXGHCTIw2YSeThh9u90ywrmg6XMM+M9EpQaK99rr+OprZQmYVUrjyVwU+4LfLT4T40f b+93824pmCDGcp6P9TsrIGcx2vsbn32u/SUWUZa/Gk9Cmb1l7UjzUyrBMYW+t1PDZgb0hRaWB94 BX8pfusDS0ZOlXe+rDGDnPR0ETXla9NVa2yUwWoJ+ek5xgMn8vrcIfJost+FbX4mR8gfZbc7+6O 432ZUcEdKaCnxcA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990674894555998 X-GMAIL-MSGID: 1790990674894555998 The selftest was correctly recording all the results, but the 'reverse direction' part was missing in the name when needed. It is important to have a unique (sub)test name in TAP, because some CI environments drop tests with duplicated name. Fixes: 675d99338e7a ("selftests: mptcp: simult flows: format subtests results in TAP") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/simult_flows.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh index 0cc964e6f2c1..8f9ddb3ad4fe 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -250,7 +250,8 @@ run_test() [ $bail -eq 0 ] || exit $ret fi - printf "%-60s" "$msg - reverse direction" + msg+=" - reverse direction" + printf "%-60s" "${msg}" do_transfer $large $small $time lret=$? mptcp_lib_result_code "${lret}" "${msg}" From patchwork Thu Feb 15 18:25:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201695 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp39369dyb; Thu, 15 Feb 2024 10:30:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUu65Z+5XQkzHwQaHRk7jjMmF5EOpuiHIXFqDV16S3Ue6OK4uN+Gn+r2wrOy2g60dRFidTFe+1NiGE6cTCJCT3HkHYmqg== X-Google-Smtp-Source: AGHT+IH6lOeftOt40VYDRbsD6jerylJXKVwOzUqtFkBkr2Wi7eo82aH7MQ5tzbvQ1ncpmZZUrTGR X-Received: by 2002:ac8:5746:0:b0:42c:5fce:e40d with SMTP id 6-20020ac85746000000b0042c5fcee40dmr2739081qtx.49.1708021830347; Thu, 15 Feb 2024 10:30:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021830; cv=pass; d=google.com; s=arc-20160816; b=BVehrJkU52SOob3KwtVlPNIxV4tzL52yPKNLuQlP2o/5l1agRi0Gca7YZRRuZcZBPS QJiGTvtcQLt2GPDo+OPwU5EtFEkHbgOW4tnMzCazImEe267qHriI3be+10wyMXP3JYaU LsroHA54u98uijpv3jDRjoHBETJAilOEU/1yhapQfv25BlZQRU1jCQZjOGcG5LdVznQL tpKrE+WUrjV7xoPbzZdLeuJ6gpH83HBaXRJqQd2eYpvtYRGrTKJVjkclcUT3N0Rxk/ff Sj1uhnz78M6XU2sM/e2lj+PrEpS+VlMCY19V0DDoVDeXUiYrCwgylJANuuyevH9fn7UH P/Zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=56eL18FyihP75xp0vhb9GZKPxcXw1iEwftxrhSdj85I=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=irTuFv7QXmS7uqhBKwfKVSnNSogFjgBLZaSxdWUQb+0Zf4/9h1XRs9FVBtsFjTgyrw 8bf+86+nkOWNh2Abuo1tCvFRhYR6zkykEBapXvFc1J7KG4BOQ9tPKpM9Mnw1cXTVcOrp rBjA2Q7nisFXD6LV5VqCuJ/K9yViDy0IZ2gl6zP5XyCMoSRR1lEtf5Olk9JGFBiDj7fe RYaPHb8+rN3WjLqD2xXkTjB/KoP3G3gNCgl3QxYV+mjOLfV/qH5C52xSe4DfroyWVwPa 3wpo4mHzkKNzBpyzCgjYd/DxhtbQ81mAZUQcIBEYnsEOryiyfPR6CLgS2FdcHxIGHJY5 LisA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ORXCFC7o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g7-20020ac84807000000b0042c67f0653dsi1831261qtq.221.2024.02.15.10.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ORXCFC7o; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67503-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67503-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2612B1C20DC4 for ; Thu, 15 Feb 2024 18:30:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AA7B14601E; Thu, 15 Feb 2024 18:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ORXCFC7o" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 18C2D145FF3; Thu, 15 Feb 2024 18:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021574; cv=none; b=csWKgK+fLuDhv01obknyVBDsF2u7DDFJO2Jnp5xKsOPrpDBx9u1VVvpOSlrS4y3VWXGQ+3+XM3EKOi9csy2Z5Penf4kuVhGYsGHrdSR9R8twX8Os/Wnx6byO6PmoKmL6i+6s+zxHdj+AKWQTJejMEIEsHb35d3r2tcwevmkFN8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021574; c=relaxed/simple; bh=Y9v/Te9flpYVSoeQkyHDc5ogS5iYhmlGbBJS7seYJwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IDGbP7ogDc+E9VWpQiisusQ0TDsnvj12fhn+YaSJ8Lspyk92Mx17lmBRBB6VWItZ+qDtbR3lLHF32Fjn7+QTilhhc7DqMASiq9310xKpZCQb/pjxUwU99UnirSU/TbcQF5bdEnRnxQ/2NEAQu0uuRpJ7OA9LvX2BEQdPNhVmxP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ORXCFC7o; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CACC1C433F1; Thu, 15 Feb 2024 18:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021573; bh=Y9v/Te9flpYVSoeQkyHDc5ogS5iYhmlGbBJS7seYJwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ORXCFC7ohEI5eCA1JzxPRwBYjnbYEDRJ+Y5ChzfkgmwbN3t9vCVgh3ZSxFa5K08sk BKQ9Tj6PoUMnQS7lLhr7vxg543UA0ymLhYFgN4k8Zh6fZQSrN3/IH2Zbys48wRoI1t nHQhF1jkO/UDEyDemFxMTidXqJd/tvbINtErAFtWRaV6Nz4RBOuyhDq8y9TaNSlreH ciZh+RH+2dJrPhC8/1sbrAyNii82JWgMxoxlvtDsmf1Stv1ZzQrn3+C74uPm5NXN04 sSMw/vfcX7tI9e36RifTg+AJMCMN/tIhJGj7MsIMLc9s1wH259hbkZGntPpDicmHrH 0nLh7rkN+eB3g== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:38 +0100 Subject: [PATCH net 11/13] selftests: mptcp: userspace_pm: unique subtest names Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-11-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1632; i=matttbe@kernel.org; h=from:subject:message-id; bh=Y9v/Te9flpYVSoeQkyHDc5ogS5iYhmlGbBJS7seYJwg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdIjRZNJi41Pm9lXfI+qJul5HTX37GAbzab GkymdB1gMOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c2ILEAClrQTO0idvhNjmAnNJuDSfLUGPiZ9bE+tPNbX8wvRaDiEZ+Cv25xma9y/Pnwa0G5Bi2dG /J+xD/2Ct/cgJV48breEPLjgUhboAhx1rkKTnuNf2p2BYy5683Rn86vQWWO3jIAylkaGwL6hjV4 O9VWK7To6C9viLDtLXdITAKIbnKMuKMT1JmGgiaHIIxBDGpl8lMYotnhmIwhWYDAqozMZ30wElK prS9aEEAmAQeL0IsIkHXAP6jg6N/ezbDdjl23v3tCNQ5OM7Mao2gGwpOuxPRl+3UfwMO6+ywDtP Fkj9FEdPHXHbU5Msnr3odbCjKQQIELNpmJ9Gb8cuo5oPPOPCuKt/Ua04hReBOiogmdj/kkF3z6i HulTZkpLdXGi8WK+cWdCT7nDKKtVH9mvMChwr3hu7/wVWlh1K/dMqspix4CCzpYHbTgggZCS2Gy fpCxgvIr+awTbVwgtCebzPpeHurr9q88Dh/RUfKbadoaKFzQ9PeF2F6A4CAqhnsS+IPUZfEZ/Wc C6aDLVSeMqXujgMzJ/XAYNtsYOxDwfNGx4EAe9lBXDs6n7JtV3IPGLrGF9BCA4yuaoIV3rFHPpP 9OGXiF4EDwMP3edj4A/5twCqHPtMs/XnuLF2ZMw6LkMfUwdxBwPAtie4Mmy2JvQWSK+cclzauAe ukefiA5FWfOhrEA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990698887405410 X-GMAIL-MSGID: 1790990698887405410 It is important to have a unique (sub)test name in TAP, because some CI environments drop tests with duplicated names. Some subtests from the userspace_pm selftest had the same names. That's because different subflows are created (and deleted) between the same pair of IP addresses. Simply adding the destination port in the name is then enough to have different names, because the destination port is always different. Note that adding such info takes a bit more space, so we need to increase a bit the width to print the name, simply to keep all the '[ OK ]' aligned as before. Fixes: f589234e1af0 ("selftests: mptcp: userspace_pm: format subtests results in TAP") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 6167837f48e1..1b94a75604fe 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -75,7 +75,7 @@ print_test() { test_name="${1}" - _printf "%-63s" "${test_name}" + _printf "%-68s" "${test_name}" } print_results() @@ -542,7 +542,7 @@ verify_subflow_events() local remid local info - info="${e_saddr} (${e_from}) => ${e_daddr} (${e_to})" + info="${e_saddr} (${e_from}) => ${e_daddr}:${e_dport} (${e_to})" if [ "$e_type" = "$SUB_ESTABLISHED" ] then From patchwork Thu Feb 15 18:25:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201711 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp55517dyb; Thu, 15 Feb 2024 11:02:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW1sFcWonJJqYDdd1s0c9C5Nu3bvwpfRPh8FvGh0IpzO2xum/zD3FyyunKHI+nvmNPBDXViJq/IhbEVKN8JdXKKxVLTWg== X-Google-Smtp-Source: AGHT+IFIdIzp4ivDo1NrqQcKiKfV6Tf9T+TZC3o3I0rD49ZLCNtJBs+e9Ailai2UOa3LRriJvZ16 X-Received: by 2002:a05:6a21:8ccc:b0:1a0:6f51:edee with SMTP id ta12-20020a056a218ccc00b001a06f51edeemr3497462pzb.56.1708023725589; Thu, 15 Feb 2024 11:02:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708023725; cv=pass; d=google.com; s=arc-20160816; b=VzpJwzk21WGkDfoDAQy0v57A7Yutrg5LXZHuTGD85cYIasFel9SdY+QM1x8XFPg45U w9LWS5cTPMK75RQnHNElS78NDX5Pjua6q6GUospgzFYTNOWTSMTRER4ikdfBj5ourX/P fa4x8NPqQrAJIQwlCDKTm0eSsUjaOSRcnfVE95awg5d0L4X8b07Sr0ZIlu6Xn1K5ggwy HSjZpQD4S0UQKwIcQoSxJvadKm6SjKG9ksTIP4ZZljHUcyS+oHmZ+RcEsGeA/DxKUZ0n 7XrHJwwlImCoTvGKYqhX4n5A26MFO78rl8J2az6nC+2FhzHP8NgwNc9HLRQQmbpi+zpp fBAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=EHtjgeL40D4Az+hMtFBLzcXzW1TyXRNg3eT0z+AcvGA=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=Sicp7EpCbbnrJOQIogHkzUzEne9jq8Zti7p2hNl0mUPsVjPkgWIxb3cD/GZQtXBn0Y X2Ma+NoF5Cp0fyb1LHY/k8iaac0DkiPirL7t7gIaaXpkTPcG8ep4WpNejLKiMVOL7WMA oTewxRObR+VtTtETPyO/eGY0wA7teHUaI1EDJ0GTK1/9wgPSgQxC39HtX4Y5tlSsTbHu +zA1kMQoe+Q7MOM0+rUhVDEihVoGDmd1hfU8tazklB6KOmiL6CEe7rxyysMm+bIpJ5ha 7/u5aWWd96iGsry1Njj1+vZEDW0MYQg5vEoqcwKyzUXRtPBFgkLvrW/BpQ5iLGDr2Jpa tuAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BnuMB//x"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67504-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s189-20020a635ec6000000b005dc788f3750si1549801pgb.465.2024.02.15.11.02.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 11:02:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BnuMB//x"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67504-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0B64BB21C6D for ; Thu, 15 Feb 2024 18:30:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B87B146907; Thu, 15 Feb 2024 18:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BnuMB//x" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 03D4D14601F; Thu, 15 Feb 2024 18:26:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021577; cv=none; b=ghx30YcyF6QAxOAI2+bx0+xe0rnT2/86RfoXxr092odVL1ge78Tn0Cp6CnHfSFgCaa+Tezi5uVYSfN5D3vFfIoBWeLLoT9vK4jIGfo03f7nggbTvagjNvsFfoU5JeXjosrYo9t2REQe6aDiECJxx1fFualwCuq6sHujU/FuWnwE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021577; c=relaxed/simple; bh=YZAGyjoJufUlAX5E7tD1GHS0mVfFjCwLVwMbYPCraK8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k9+xuXeZkteNvC3DX/P8LIGgvYeHea7LYxbX4af9CJJLL/+r0ajkm2+PLMJrClrswtZeCc/yBKCs0y7yg7dhTJptnoWWa/viFQijGPVrtRCeJOjEfEP88PcpsNhJ0CMq0fHYW9B6BVYBQRw1yi2gxx3PXzMn9Gqv0ETYvpmtX3Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BnuMB//x; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FD30C43601; Thu, 15 Feb 2024 18:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021576; bh=YZAGyjoJufUlAX5E7tD1GHS0mVfFjCwLVwMbYPCraK8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BnuMB//xUiDUYNJ6txw8eoPXXlw+VX9fenuyiaWK93M/uNJ/v5whURi9Npvb/cnvG iQm7WiY4Zd4zKtZOtKIrej10VlZXl8LtllYbVRh+619WAf0TvZV7CnN40Ozqo7Yo1W uG9jztY37ehl0pqE3dBu7xykRGcWwZ1yzkbCbeP1UCtjy9eNIoK33PX6tT89guGmFf mXnwe+WkngEyUk793edAcUJzOUsJS7xhHO242PExkxDsUUYIUDY7Dd7PrWn9NiFZVA zI1kTRa2zU1SRZLBH1WW2xaMrppEd8wwy8AZqmAlBPEtE1HzuEkb72UXyCsc/NhtSo LBeO4zHyJSvCw== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:39 +0100 Subject: [PATCH net 12/13] selftests: mptcp: diag: unique 'in use' subtest names Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-12-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2677; i=matttbe@kernel.org; h=from:subject:message-id; bh=YZAGyjoJufUlAX5E7tD1GHS0mVfFjCwLVwMbYPCraK8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdrMQGAJCFZGj0ryoKgsMZV5OcxK3UZfTsB CFpYzwF+KuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c5a5EAC/h2na7rwOfRvKah5bpW5oWXK4sI/I3aJgrgC91O6IaiXs3B9YgeqHMDuAAEsnLkm7Ywu 44qkBueydUcCZiT4BRHviTjR9fpBmTbWQPnhwtkEpZyKabSMOzeeDRCNvm4HvkIplkWR4e0Akft H+twoJl6DII+2u2P/w0y4laSDBePCjc7ty+5YR9iYuhxFj9s/uCZ4GQFyKAS8Bicdx4F3Ota/ZV W+47rlDatQNDCyhUzndGydWLTsXnPWedEqgJuGo2Qmsh6+oo5KVX7n5LNVveVET+TH84S/VurXX OmlG54K5+rPzBO+4BbkJ32laSU+JH9XHMb3Y6/lNm7DcVX4y84hm7w5JSEF0GTsdlJe9asjmV4/ r1hKN62noNrQnIdDDoaoAzFmIKmIYzWqdHb+yr6jDJ4RxuqWJIGcOfliL/QZYHOKGR/0COjUyBL viOWdUuaWPUq1Q4Ogt9b5zce3s8FcZyVeNzAMgbQbtrzPELFQHyXkpHq4Onkx8Ig7SpkpHgMB5B nzuHK2rTNSoB01LfMU42Mum4wAGUp6QZbNkQEcC8xnt6y/MySypZRUgdEJ70hWzTT68MQeE1t9f OYPSHa/s6AfPnESvMBKtET+60WPQUiiTdvTq9w3ldx+2O8GG0CdrMMY1ke64dH0i6FOeCvTr8RO fua5GtI6eBIBQNA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790992686179883946 X-GMAIL-MSGID: 1790992686179883946 It is important to have a unique (sub)test name in TAP, because some CI environments drop tests with duplicated name. Some 'in use' subtests from the diag selftest had the same names, e.g.: chk 0 msk in use after flush Now the previous value is taken, to have different names, e.g.: chk 2->0 msk in use after flush While at it, avoid repeating the full message, declare it once in the helper. Fixes: ce9902573652 ("selftests: mptcp: diag: format subtests results in TAP") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/diag.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index e0615c6ffb8d..266656a16229 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -166,9 +166,13 @@ chk_msk_listen() chk_msk_inuse() { local expected=$1 - local msg="$2" + local msg="....chk ${2:-${expected}} msk in use" local listen_nr + if [ "${expected}" -eq 0 ]; then + msg+=" after flush" + fi + listen_nr=$(ss -N "${ns}" -Ml | grep -c LISTEN) expected=$((expected + listen_nr)) @@ -179,7 +183,7 @@ chk_msk_inuse() sleep 0.1 done - __chk_nr get_msk_inuse $expected "$msg" 0 + __chk_nr get_msk_inuse $expected "${msg}" 0 } # $1: cestab nr @@ -227,11 +231,11 @@ wait_connected $ns 10000 chk_msk_nr 2 "after MPC handshake " chk_msk_remote_key_nr 2 "....chk remote_key" chk_msk_fallback_nr 0 "....chk no fallback" -chk_msk_inuse 2 "....chk 2 msk in use" +chk_msk_inuse 2 chk_msk_cestab 2 flush_pids -chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_inuse 0 "2->0" chk_msk_cestab 0 echo "a" | \ @@ -247,11 +251,11 @@ echo "b" | \ 127.0.0.1 >/dev/null & wait_connected $ns 10001 chk_msk_fallback_nr 1 "check fallback" -chk_msk_inuse 1 "....chk 1 msk in use" +chk_msk_inuse 1 chk_msk_cestab 1 flush_pids -chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_inuse 0 "1->0" chk_msk_cestab 0 NR_CLIENTS=100 @@ -273,11 +277,11 @@ for I in `seq 1 $NR_CLIENTS`; do done wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present" -chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use" +chk_msk_inuse $((NR_CLIENTS*2)) "many" chk_msk_cestab $((NR_CLIENTS*2)) flush_pids -chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_inuse 0 "many->0" chk_msk_cestab 0 mptcp_lib_result_print_all_tap From patchwork Thu Feb 15 18:25:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts (NGI0)" X-Patchwork-Id: 201697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp40179dyb; Thu, 15 Feb 2024 10:31:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXufe4nQjXsFxjT7aQOwR/eQOB0mevKeQn2ro61wLyk42hdVrlKVa1M9FRuDXkLxVt9wc97MStHg7RILh9Am+wDW/YjsQ== X-Google-Smtp-Source: AGHT+IEWlV2LOyeWj+btdu/ZRf5TyVk9J09BOtB+WwgrvfTNkSQP7qkzlaUQ5BxWM/naPATJdM4X X-Received: by 2002:ac2:5dfa:0:b0:511:ac60:2b01 with SMTP id z26-20020ac25dfa000000b00511ac602b01mr1798209lfq.32.1708021903855; Thu, 15 Feb 2024 10:31:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708021903; cv=pass; d=google.com; s=arc-20160816; b=h7xCX2OA0pxUS2hpAnGXle/RLkIMVxo2qMHUmNjN9X98y109aAbaEtVzFsCRjZnKwW c+DBYn8IGXTeguo/PAjacUCCvRYnSjD7qP/A1pz84qpPLqz84+A1RSHj94K1M6gE1VFj 8eDrNrTnz2piHiEOgZmmfrpDaZmgWY7Z5E41BVAkd34yZv4cj6PDNQFumefdgAK+cDYl o5aG2VoyDJGeXdNnyZUg0osOjXF3I3FUcCrk0dLSCkxD1W3T7DehP3Qd/g+7ZPNhSO8W aAgI3SrkwmgSIy0xtCJN5VOdcsuZC2bkU8YQo17Vp0ZvfyP54YYF61CG+klamoE7MOQ2 t9pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=lQEjE0WwrM7wP6lvEj75IPos5uep50RblNstDOs4WPM=; fh=YLls1mWwoBtdGDVDLSS7Y7vfTx1qtyt00TdtmrttUI0=; b=hzp14UpcLTrcCnThINOU96FbXGXdhMbRonbe7RtEEa2vcxUoqa0Bi7yaBxmu8OP9xA PX0j1Eyq7Ne33s9einbjnEu2aGaRpT2OJgzOOswz3YLfpHLJBliq2tbBv2Pq8n+s4P8Y 22lEl5M3SzANT3/7H4SfiYVaQq2fzXeHUTQZOvZVo7k05cwusMA552tqy2ipWxHiQAPI WkDyZQKDqDUwj9UB2Ze0xiyMFqIs16RXj77bjNZnUHVqGES69a5Pn4mcgVKmNh/cF8qU hSNerxZemRO21//p1BlJGSV7xo5p+e895WgIY87aahKcA7BJhyu2dV+U+8zljVrfOiId GY9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eNJENkXJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67505-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67505-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d24-20020a170906041800b00a3d952064c1si744246eja.259.2024.02.15.10.31.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 10:31:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67505-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eNJENkXJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-67505-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67505-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 571861F22CC1 for ; Thu, 15 Feb 2024 18:31:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 203511474B1; Thu, 15 Feb 2024 18:26:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eNJENkXJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8053014601F; Thu, 15 Feb 2024 18:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021580; cv=none; b=iTpScc50w+O2rTssbKCiAOT0upZP1dzPbd+PLgVokQwGl8vjZD6GTWPY7SFCNxurjd3I5XVIRAgRgJ2C73zxyIB/PyS1e716KHvekEcXEdAnwmLsrfIHvpKBD5TyG4KaGXFGaD9p7QJfeizjFhsTm7vXmIBL0GkR1or9yzNkc8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708021580; c=relaxed/simple; bh=x222K/iVJq1Vit9kTzhOmvETqEf55fuMWAFaC+bQJPA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yfz1xghAVhZWzaJg6ncCzZtamNH/DrfzlLsNgsIhwMN3bL9lY6YwPdbyFtfYaysQ4kvOj62a1Z2khXctBSVAYYtLhk4FU2x5mexiAo6EesvQ4PtrQR2l4MdXpbiRGBOhdYHtYqOh82aCB2u0YQYxuJQerbiZW1zOwxRBaXxC9qI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eNJENkXJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A69FC43394; Thu, 15 Feb 2024 18:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708021580; bh=x222K/iVJq1Vit9kTzhOmvETqEf55fuMWAFaC+bQJPA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eNJENkXJQd3tdenz6UODUvk6smrVpiDRE9Dbhz0k/rHhyIDmwPRjV8AP20UFaiXr1 2gpsp/H/0S47m3/kCpgJMQ0bKv1RVSH730ydj6nhTCAcx2xLxADd+A+VMRaogFIr4K zpDwAxiXaw7uYrD/nG43dO1o6crao0msx0LGo+kUKZe3hcSLKMoikfHzqgdMsJco6i HbpA/DqNWZvDGVvbJ72mgsp3R/2EzMgXkZLDBGZ2jOtyFVMGLrWKseXxxPThwLA+Uu 6qtk4fRO4yYaNCqysM1waQN/CuwTERtmkLZEpO5E4cg4jDsZeh3hiURbE590WJ5D2O wOSGCOYpvt0LA== From: "Matthieu Baerts (NGI0)" Date: Thu, 15 Feb 2024 19:25:40 +0100 Subject: [PATCH net 13/13] selftests: mptcp: diag: unique 'cestab' subtest names Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-upstream-net-20240215-misc-fixes-v1-13-8c01a55d8f6a@kernel.org> References: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> In-Reply-To: <20240215-upstream-net-20240215-misc-fixes-v1-0-8c01a55d8f6a@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Davide Caratti , Shuah Khan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2535; i=matttbe@kernel.org; h=from:subject:message-id; bh=x222K/iVJq1Vit9kTzhOmvETqEf55fuMWAFaC+bQJPA=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBlzlcdkqqo1as8l+1WTgonChxLYAPdqGM3qqqWv xMvz1RVmtOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZc5XHQAKCRD2t4JPQmmg c7P5EADAORF4I6xRVCuIteRM18Viuxr5KG8CJBSnyQSeTV/vonia8wze3JPh9GE6VpUkY0bqPvJ Z6yMC991t6M5QFmkPW5hfBjuQQcqeeZ/40MuMkAM1ssJFVq67Dmw19grT1ZLjriD3qXaW+xn5rn h3nWRaxK0GZo1NE0tdkwTt0dsmJOfDSH0YSp8Gyxu4iBzbkXfcOV93FDcqdbJne+qTWVZxJKQ8H /UZQcRbbO0dWoRh42yISUgigPMQwQuFusT3h6xoIKLek5U97L0dyFquk/X57yRXuoiXu9kYiDI8 sCvaQL+I6UhulZWWdKVc7bCi6690tmsA9/LFqUNl2n6lFTxJiEg9A0bwTp4L1bowf8UuwNggn+B r66SCrglwMHiYXrSJhDxHs9mabj3gGlhqFUzr6qGv3EA189mweNnRmnO12HEOoOTdhVCSoc51W+ T7OWhhhs1BPgcfnGOjXuOe9tY90XJW6B6a5dZlKKIvXebdaxyVKBfQc//PwyMXFguUdNXd8cD2R Ur0C13HAFW7cHBV/cY63MJAzdf2lPQl+6ws8FX+erP5ES7dkboC9do2SeKQVQ4UkDiDYDTnokgF HfKz4bR1ASlAhkmE/IK2u0AR3FGAImFLy0kSqC/GUcg/AVyFytIlG4p2KAcCALzY3l3camMdeKA lr+DTNHNrTLEXgw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790990775606734054 X-GMAIL-MSGID: 1790990775606734054 It is important to have a unique (sub)test name in TAP, because some CI environments drop tests with duplicated name. Some 'cestab' subtests from the diag selftest had the same names, e.g.: ....chk 0 cestab Now the previous value is taken, to have different names, e.g.: ....chk 2->0 cestab after flush While at it, the 'after flush' info is added, similar to what is done with the 'in use' subtests. Also inspired by these 'in use' subtests, 'many' is displayed instead of a large number: many msk socket present [ ok ] ....chk many msk in use [ ok ] ....chk many cestab [ ok ] ....chk many->0 msk in use after flush [ ok ] ....chk many->0 cestab after flush [ ok ] Fixes: 81ab772819da ("selftests: mptcp: diag: check CURRESTAB counters") Cc: stable@vger.kernel.org Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/diag.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh index 266656a16229..0a58ebb8b04c 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -189,10 +189,15 @@ chk_msk_inuse() # $1: cestab nr chk_msk_cestab() { - local cestab=$1 + local expected=$1 + local msg="....chk ${2:-${expected}} cestab" + + if [ "${expected}" -eq 0 ]; then + msg+=" after flush" + fi __chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \ - "${cestab}" "....chk ${cestab} cestab" "" + "${expected}" "${msg}" "" } wait_connected() @@ -236,7 +241,7 @@ chk_msk_cestab 2 flush_pids chk_msk_inuse 0 "2->0" -chk_msk_cestab 0 +chk_msk_cestab 0 "2->0" echo "a" | \ timeout ${timeout_test} \ @@ -256,7 +261,7 @@ chk_msk_cestab 1 flush_pids chk_msk_inuse 0 "1->0" -chk_msk_cestab 0 +chk_msk_cestab 0 "1->0" NR_CLIENTS=100 for I in `seq 1 $NR_CLIENTS`; do @@ -278,11 +283,11 @@ done wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present" chk_msk_inuse $((NR_CLIENTS*2)) "many" -chk_msk_cestab $((NR_CLIENTS*2)) +chk_msk_cestab $((NR_CLIENTS*2)) "many" flush_pids chk_msk_inuse 0 "many->0" -chk_msk_cestab 0 +chk_msk_cestab 0 "many->0" mptcp_lib_result_print_all_tap exit $ret