Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp569978lqh; Tue, 7 May 2024 07:44:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2cnzCdUgV1njxtxPKs/nzmGljTaQdjUI42uO2CivRlYLnR1mFhPpQEcxQukUchtYdCIsAG7MHKV6eyHZ/ppZfieBRDhBlV2d+X0xtvA== X-Google-Smtp-Source: AGHT+IFhxhWPJR6T5LSVy1leqQe7mhNrwvj3yGn3sV+BCSNSfOQtiWW7nUtr3FC3vb++BGQwt2RL X-Received: by 2002:a17:906:5006:b0:a55:9195:362c with SMTP id s6-20020a170906500600b00a559195362cmr7112512ejj.49.1715093045637; Tue, 07 May 2024 07:44:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715093045; cv=pass; d=google.com; s=arc-20160816; b=bDyjaBfWidlc/dSB1T/wmpbo9W10ix2FOA7ISt0aFclyewTOWI/ZVVZF09jt8GI5Zk khFn/V9x5sB7AFLJJj1xeZ2iwrYzjfPdoJ4MVQJN4Xp/HY3o2hGRck/0RJj/2Dq9nNYp wONtN3i/vXxgdFiG+xnWeNEvy0SRo3mOjki6E1jyvz8MvfIml8o0dRV5dQD9HoP2iv6z ziPiL3Nkk8hfM2kqDxq2qflXgfK56HonsPr9WGgPC3wIInIhy+EB3i1L8QM0kuMR5015 slNcLqX/8M1Kvk4yzWi0zW+D36XmbWCax0KxsArMTp46Bb+/iSfNbkqlM1wTatjUj2QL +97Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8bM5RjluxHipg60pIjQCs1Kdq4Li1XFga7CcO2QMKNA=; fh=ku7SZ/+GXdENO5cyv+8rHyh/mXAPf/Dych/n9a5Z3ks=; b=ZX9TZmxCwsPUJbpjXOOGtuQ7JXU6uf0L7ajdNn/3yphjsJQOQzDgbUml/ZJettwE6O GapPr6LWhZSvVlrqfGalMn7wFeSld1WTSb/qgCv1lP2xrShtHPsvC7EOjizh3i4P3IWs YnM+qAmeXjCQ4BfZVZSH5TXX5xPMqZ0FRsCI6C95TQdVmnhdKgfKI/5L4d5CCxLdD2kw /1kHBwD5VdkS9hX4wXtAO2LPgGMpufTAThZMSlsC2V7TAJAoOZnX49iYWHFKVOJZmRh1 659T6vRKr41+3GpWQz4X9ygoIcICpa2iXNCxrrx9M5M1hB8rPaU/h2EMrPwi7PdWtvef lDhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IRT5LAzr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-171602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e2-20020a170906314200b00a59c84626cdsi2977727eje.513.2024.05.07.07.44.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IRT5LAzr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-171602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 375C21F23872 for ; Tue, 7 May 2024 14:44:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1208A15FD1D; Tue, 7 May 2024 14:43:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IRT5LAzr" Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC75A156F39; Tue, 7 May 2024 14:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715093033; cv=none; b=HSxohsMz1TIkWULJA1zw1rJ6dcdX8z55+eb638/JXIyILsPw9QK+BQkC53cEDK/TJyfjdZbPqHy4t/FlMfa5MnBKyXJM3B2GCwRWf3AycbniGnnPav4ZxXoaAk136z8oJS2kGaAlPCsZ2td46nMXl3lB4WK8Be2+FrmL4aMBC38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715093033; c=relaxed/simple; bh=cVK00FVDWLzEDng1ImuaW8RdJLe7pFz6qhNng9TB52w=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hsmL83J9qgyQqpqU51kIwEACkBRThBQbwZCtjrzmv1tlnEIxoenJgQMZ8KWdOiEPQuxS5frcK23Wn/VRHJy0v2dneYWTv9wrvlQvKydrk/k0VKL0HyNIAnP9/F5FmMpAY3K30PqlUY+1XZYbAVokhfDIKPpteFYjYNa3HARI6jY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IRT5LAzr; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-34e7a35d5d4so2413424f8f.2; Tue, 07 May 2024 07:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715093030; x=1715697830; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8bM5RjluxHipg60pIjQCs1Kdq4Li1XFga7CcO2QMKNA=; b=IRT5LAzrgTDwtonDzUoI5cmF6WkEZrb4Kdff8G5dzDYdL0UOehPFnnn4jQyucGMVNh xjbSPUV7o7ne4svcyMAJGhk9lSiHY09I9bUIP2DlPoFA3KfsFHUViFDG9cZXyuz6kIfP YknA2lt75aMkeZEA2BziEuYQ0S49lpj43co9I3/+zDFRId+vFT01WLsBTzhEH5JrN0ul ofm2BbO2vBbZRnw8cnB9ZiGsrGVUhnwi64hyrj/mFZwyIjrCa9f6QNasdZGQe8dr/aW0 zWt02ej9L+AooRBsKvnmQdq56q2Oj7S4O2uWowGZLZVXaYalCmpjVlD4RMoHUgCVrH5B 9fKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715093030; x=1715697830; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8bM5RjluxHipg60pIjQCs1Kdq4Li1XFga7CcO2QMKNA=; b=amBwxvfaJ1QAH9jfyKcxOSfj98uiHDu+FJM6t3jmSVPcxkUAmakDAnhy+e9anr37mW Xxy+6xKFuleFVK9zLvUmf9H2lct8LJXJBrcxoCCXwfcQcTGZA5q2tzosCWhXZkuvOjEr RJXGPSH8EK+X+DHLDr2L9kt9VzlvczRLhvxvqBzaIIRKBf0Cjx06N5TDcEqtZt4GvF+j 5ao/7arABXL/gKZSqmXBv7YTsAPJGVjFuwdsUaWWzhbTL6cl+2PPJK+2235QHjsRT7Sc VEvUANivpexQawZv0qSMBSRrLew6hAiqeW1xdIRbLVoW9P4fkzKT+TQZ+pbF7PCwv6je 4dYA== X-Forwarded-Encrypted: i=1; AJvYcCVNISGbTtAKlGaw7ymPqRozg9kzFPuqOXiNQNbzLf/5pBoCzGOlrWVREZlElrqqdUVJZzrfi63iha4KiAkzB7SoiZZcbzXUmn/IqwlQfVt3sFGC4PdFH5kws7Pf/ySZ9xnvxu1ugmSg2DXqUGKpf9C7Go1IpCTG6FSBWNRWKLsji5TP+zYHeTESFJIzA/TfiEdqcIvXVp/kmHO6 X-Gm-Message-State: AOJu0YxuQ9U35RNO6qG4cWz5omXDSTca5zRURn75+a9ztSSUG/x9uqJ/ GzonDJ2Uf/qtfiki70aTgZzbYBO7TdmTS6ofN6cagS3PCMSXIYf7rgdS0NSJy0JLVxEtoRUaznA jc6/XQ/htKsa+6RLFDToKXRiIk98= X-Received: by 2002:a5d:42d2:0:b0:34a:56e7:5cc4 with SMTP id ffacd0b85a97d-34fca14b3bamr36578f8f.2.1715093030024; Tue, 07 May 2024 07:43:50 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507-upstream-bpf-next-20240506-mptcp-subflow-test-v1-0-e2bcbdf49857@kernel.org> <20240507-upstream-bpf-next-20240506-mptcp-subflow-test-v1-1-e2bcbdf49857@kernel.org> In-Reply-To: <20240507-upstream-bpf-next-20240506-mptcp-subflow-test-v1-1-e2bcbdf49857@kernel.org> From: Alexei Starovoitov Date: Tue, 7 May 2024 07:43:39 -0700 Message-ID: Subject: Re: [PATCH bpf-next 1/4] selftests/bpf: Handle SIGINT when creating netns To: "Matthieu Baerts (NGI0)" Cc: MPTCP Upstream , Mat Martineau , Geliang Tang , Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , LKML , Network Development , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , Geliang Tang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 7, 2024 at 3:53=E2=80=AFAM Matthieu Baerts (NGI0) wrote: > > From: Geliang Tang > > It's necessary to delete netns during the MPTCP bpf tests interrupt, > otherwise the next tests run will fail due to unable to create netns. > > This patch adds a new SIGINT handle sig_int, and deletes NS_TEST in it. > > Signed-off-by: Geliang Tang > Reviewed-by: Mat Martineau > Signed-off-by: Matthieu Baerts (NGI0) > --- > tools/testing/selftests/bpf/prog_tests/mptcp.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testi= ng/selftests/bpf/prog_tests/mptcp.c > index 274d2e033e39..baf976a7a1dd 100644 > --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c > +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c > @@ -64,11 +64,18 @@ struct mptcp_storage { > char ca_name[TCP_CA_NAME_MAX]; > }; > > +static void sig_int(int sig) > +{ > + signal(sig, SIG_IGN); > + SYS_NOFAIL("ip netns del %s", NS_TEST); > +} > + > static struct nstoken *create_netns(void) > { > SYS(fail, "ip netns add %s", NS_TEST); > SYS(fail, "ip -net %s link set dev lo up", NS_TEST); > > + signal(SIGINT, sig_int); > return open_netns(NS_TEST); That's a drop in the bucket. ctrl-c of test_progs doesn't really work. Such clean up needs to be generic as part of network_helpers.c