Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp861013lqs; Fri, 14 Jun 2024 07:45:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbg2s7cj0fo8VlW0rBNCF872bQoahm8uWmYIAE2aeea1/Qt1VMROkqvwTG7ptX/cL0LfYZxO2l6cWLMkPGxasCv7tftt1tl0z/Vfj96A== X-Google-Smtp-Source: AGHT+IEjwpBGB8D99Ie9iTewGeg2HboHSDiKzwuRsi+TLXdynXgMkW/I5TAVyZXNFNUXtD2jGvXM X-Received: by 2002:a05:6358:60ca:b0:199:29f4:c57b with SMTP id e5c5f4694b2df-19fb4e64a00mr363679055d.11.1718376352252; Fri, 14 Jun 2024 07:45:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718376352; cv=pass; d=google.com; s=arc-20160816; b=ViiWBDBQ8aAdH41qSJRg/E9wRhS8HKgcA+kF+SdKuNLTj9tiNj8xxfiTwxZkB6NVaa cASTgfKGNqJGu7w1EFAel8aOPOuzVHarKBk7kebRYE3Cw63oVrQrMrPvGdGCBlkoKWXJ 59EjCNaX9+cmkMnCUYiK2+sNBfBqjiNEQ4DyDBWoJX3liSt2lp0pAcq7qmbbl8M/XRAL mhXaHUGOgLMF+7ujGyBybCCF6D/V0p7m6wWDIuUCB0NkFSh2ozZWbvfLAXt3sS3nXliC wFxdIkMGaURTpByMrn1ZoT24na+OUa27I5n+wrYb5Vt+vz9Oul9r4CA0L4GiE1DZLQ2w YQAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=93UmCDisZ5TIss0npLytW3RDBX8PdJ63A16h1i040Dw=; fh=I6YiJNi9wN3oC6it9Awnj56OKgjPMpD90NV0Hy/Ccmo=; b=gavzwoaBd9gR+7QUK5MIgndzEIqMREAmouZBlYxPgd6dvtU8dmHxBJGqNN6XGuIBbd XjHvHI51os8UVbuOIF6j5uPwtcGo0tcXb6tfxuk9UXPjbkllPAn3Cttf04iiy2IkbsaA ywL7Gvf5VElk+ifXGCqd2ZSEvXwTHHTC1rHuDm+wxHWIUiuRmbULUhHIRq/bkal+Ge3j MDNcSPCaqSbwFtqSbVmWKTr1MuIg302ByjhO4QO3jbXw2muh00YExghPAxc3sMK4w4RF pnUIOhqwFJRWulyLcUq5JHvshn9NZ5AILboj5jT1mf2olVZ133FHrxVLvsxGtvCHwh/b kBmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SLcVV5Op; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee310cd79si3738320a12.279.2024.06.14.07.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 07:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215044-linux.lists.archive=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=SLcVV5Op; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215044-linux.lists.archive=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 3E70E284572 for ; Fri, 14 Jun 2024 14:42:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 058F515AE0; Fri, 14 Jun 2024 14:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SLcVV5Op" 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 145C410979; Fri, 14 Jun 2024 14:42:43 +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=1718376164; cv=none; b=c2TDKAzAdt28vULlh8Ajxa446pBAlp3lkNmOvBlMenuL0oe17wFN0z5594kQqDGCSb2+tNnByN7gBPAFyoqKffKlK5CnyQqlHocQbalVWEVMPoi+tf+goB2kV/JPRiABJA5hoIl5OJGEvASFNhW0/XQlXXwN/V72snYIxJsvL9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718376164; c=relaxed/simple; bh=ik6eDWIdgCDqW3F4a+Pfi6+wrVRqwMCzQ5VGXi2oxi0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dJlq/SawedwCD+U/LpoUyTtJVakoOu1Ax+LiKhi35kdXC7Kz2ElU8dqFhIpCAcs/paT1fB42Vy33QO7FqUz/Qva7bAbapSSaTe3FI7Ejc2OPrzOiFoluy+H75rwhj4cqEdPpKkgEwFdOIHDb0GI3nECJ+g8QvohVajXx8a8anO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SLcVV5Op; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23E3AC2BD10; Fri, 14 Jun 2024 14:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718376163; bh=ik6eDWIdgCDqW3F4a+Pfi6+wrVRqwMCzQ5VGXi2oxi0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SLcVV5OpkHueAsHO2Ad89RqJHZ2FixV5j8RR9/p/yJ0dqGTXajrjucrv9x1ghOF4P ir4RVlTKyF0ye2ciO5/REyILPxF0uWRqs0S3/1cEc4a0Af4UIJjTIK0+gXt76Ipxl2 x8T5f7KYo1kPfMXdrgrxtMw5aKEGmuHChvsjXSIbI0M2TWIWVwl9wDtmJ5h/0bjsz4 5cGhrs+p4NMuNSCjsCGuFH+WsziNUOTdvDJvU5cv85pLLzq7CmSogcAwSyp8N1BJ7p ALsaTEeAEI5YqcJElCwQuhcStfF5Q3y3wqOYgMwAjWk4lzBKgrT5nVqA8lxw4e1X5O FZNeEZPiRBclA== Message-ID: <54e9c949-da29-4a19-af29-55aac52afbf9@kernel.org> Date: Fri, 14 Jun 2024 16:42:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH net-next 2/6] selftests: net: lib: remove ns from list after clean-up To: Simon Horman Cc: mptcp@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Mat Martineau , Geliang Tang , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240607-upstream-net-next-20240607-selftests-mptcp-net-lib-v1-0-e36986faac94@kernel.org> <20240607-upstream-net-next-20240607-selftests-mptcp-net-lib-v1-2-e36986faac94@kernel.org> <20240614104006.GC8447@kernel.org> Content-Language: en-GB From: Matthieu Baerts Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf YBNdx5Xl74NLSgx6y/1NiMQGuKeu+2BmtnkiGxBNanfXcnl4L4Lzz+iXBvvbtCbynnnqDDqU c7SPFMpMesgpcu1xFt0F6bcxE+0ojRtSCZ5HDElKlHJNYtD1uwY4UYVGWUGCF/+cY1YLmtfb WdNb/SFo+Mp0HItfBC12qtDIXYvbfNUGVnA5jXeWMEyYhSNktLnpDL2gBUCsdbkov5VjiOX7 CRTkX0UgNWRjyFZwThaZADEvAOo12M5uSBk7h07yJ97gqvBtcx45IsJwfUJE4hy8qZqsA62A nTRflBvp647IXAiCcwWsEgE5AXKwA3aL6dcpVR17JXJ6nwHHnslVi8WesiqzUI9sbO/hXeXw TDSB+YhErbNOxvHqCzZEnGAAFf6ges26fRVyuU119AzO40sjdLV0l6LE7GshddyazWZf0iac nEhX9NKxGnuhMu5SXmo2poIQttJuYAvTVUNwQVEx/0yY5xmiuyqvXa+XT7NKJkOZSiAPlNt6 VffjgOP62S7M9wDShUghN3F7CPOrrRsOHWO/l6I/qJdUMW+MHSFYPfYiFXoLUZyPvNVCYSgs 3oQaFhHapq1f345XBtfG3fOYp1K2wTXd4ThFraTLl8PHxCn4ywARAQABzSRNYXR0aGlldSBC YWVydHMgPG1hdHR0YmVAa2VybmVsLm9yZz7CwZEEEwEIADsCGwMFCwkIBwIGFQoJCAsCBBYC AwECHgECF4AWIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZUDpDAIZAQAKCRD2t4JPQmmgcz33 E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WHdngGEY2v2IP Qox7mAPznyKyXEfG+0rrVseZSEssKmY01IsgwwbmN9ZcqUKYNhjv67WMX7tNwiVbSrGLZoqf Xlgw4aAdnIMQyTW8nE6hH/Iwqay4S2str4HZtWwyWLitk7N+e+vxuK5qto4AxtB7VdimvKUs x6kQO5F3YWcC3vCXCgPwyV8133+fIR2L81R1L1q3swaEuh95vWj6iskxeNWSTyFAVKYYVskG V+OTtB71P1XCnb6AJCW9cKpC25+zxQqD2Zy0dK3u2RuKErajKBa/YWzuSaKAOkneFxG3LJIv Hl7iqPF+JDCjB5sAEQEAAcLBXwQYAQIACQUCVeP56QIbDAAKCRD2t4JPQmmgc5VnD/9YgbCr HR1FbMbm7td54UrYvZV/i7m3dIQNXK2e+Cbv5PXf19ce3XluaE+wA8D+vnIW5mbAAiojt3Mb 6p0WJS3QzbObzHNgAp3zy/L4lXwc6WW5vnpWAzqXFHP8D9PTpqvBALbXqL06smP47JqbyQxj Xf7D2rrPeIqbYmVY9da1KzMOVf3gReazYa89zZSdVkMojfWsbq05zwYU+SCWS3NiyF6QghbW voxbFwX1i/0xRwJiX9NNbRj1huVKQuS4W7rbWA87TrVQPXUAdkyd7FRYICNW+0gddysIwPoa KrLfx3Ba6Rpx0JznbrVOtXlihjl4KV8mtOPjYDY9u+8x412xXnlGl6AC4HLu2F3ECkamY4G6 UxejX+E6vW6Xe4n7H+rEX5UFgPRdYkS1TA/X3nMen9bouxNsvIJv7C6adZmMHqu/2azX7S7I vrxxySzOw9GxjoVTuzWMKWpDGP8n71IFeOot8JuPZtJ8omz+DZel+WCNZMVdVNLPOd5frqOv mpz0VhFAlNTjU1Vy0CnuxX3AM51J8dpdNyG0S8rADh6C8AKCDOfUstpq28/6oTaQv7QZdge0 JY6dglzGKnCi/zsmp2+1w559frz4+IC7j/igvJGX4KDDKUs0mlld8J2u2sBXv7CGxdzQoHaz lzVbFe7fduHbABmYz9cefQpO7wDE/Q== Organization: NGI0 Core In-Reply-To: <20240614104006.GC8447@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Simon, Thank you for your reply! On 14/06/2024 12:40, Simon Horman wrote: > On Fri, Jun 07, 2024 at 06:31:03PM +0200, Matthieu Baerts (NGI0) wrote: >> Instead of only appending items to the list, removing them when the >> netns has been deleted. >> >> By doing that, we can make sure 'cleanup_all_ns()' is not trying to >> remove already deleted netns. > > I do wonder if we can go a step further and use an associative array for > ns_list (maybe renamed). I think this would reduce remove_ns_list to > something like: > > unset ns_list["$item"] I agree that it would ease the removal of one item -- which is not complex to deal with the new helper :) -- but do you see any other benefits? For the moment, there is no other value to associate with, so we would do something like NS_MAP["$ns"]=1. We could link the name of the global variable, but that's not needed for the tests for the moment. Also, I don't know if it is important, but when we will iterate over the list of netns, it will not be done following the same order items have been added into the hashmap. So we will change the order in which items are deleted. > OTOH, perhaps this breaks with older versions of bash that we still > care about. Good point. I don't have the answer, but associative arrays are starting to be quite old now :) Cheers, Matt -- Sponsored by the NGI0 Core fund.