From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 DD7942D12EB for ; Thu, 30 Oct 2025 16:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761841308; cv=none; b=YMnM2CTi3lZtQUDa7jlM9x0ONpzLEQOEWIfYMyYWNLJ96sHPk5tQIQIK9jzDOE4tnGBHM3xxYvMoxccuRUKjQrg22MLccpbXYXTc/sMK9MkDTxwt2L04Zyi+CbI++fLenD8B4muFc7aYrsraJg4EyfPKzcgDf+wf2A8+StE8Q/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761841308; c=relaxed/simple; bh=kX0cm2UnEiNJ+qzpBPfgy3+r4pATEZSTxmE6WFa7VM4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KsB/VoRp5Jn9H2fXA9cRRQlepgfgPqPSObTiwHgYeB6OpnxL4Ke3rUBTWMBI3MPhdgWLpW8K64xsmToFs8ubwyEbFScVvXrkrNiUfRL+8xKS/YoHLFLacSNz+TJ15UrwiSJHNuG3HcZZ3UOHpVTC2xfVcbBBadvOCMHFer3vQ4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=D+quNg75; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="D+quNg75" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1761841294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zMFZXp3tx2YPKZtWsOkoNrm9qO50YlAqRAEraxEEN8U=; b=D+quNg75KVoxfK+nHvJSuj2ygg7TDLVMhoUvNdsp2A4jI2e8UFgRH8PNkDziKckOgJWo6m XCjmHu5mbjBRYXqAEWVnZUdaXYPvszj58fBy+J+k8NbwQ19z9vnwjD4s2+UYBPL6BWxKY5 O9a8dqI3BXq/QQIFqi9CKuODhqbUuFk= Date: Thu, 30 Oct 2025 09:21:28 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v3 3/4] selftests/bpf: integrate test_tc_tunnel.sh tests into test_progs To: =?UTF-8?Q?Alexis_Lothor=C3=A9?= Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , ebpf@linuxfoundation.org, Thomas Petazzoni , Bastien Curutchet , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251027-tc_tunnel-v3-0-505c12019f9d@bootlin.com> <20251027-tc_tunnel-v3-3-505c12019f9d@bootlin.com> <1ac9d14e-4250-480c-b863-410be78ac6c6@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 10/30/25 7:04 AM, Alexis Lothoré wrote: >>> + int family = cfg->ipproto == 6 ? AF_INET6 : AF_INET; >>> + >>> + cfg->server_fd = start_reuseport_server(family, SOCK_STREAM, >>> + cfg->server_addr, TEST_PORT, >>> + TIMEOUT_MS, 1); >> >> Why reuseport is needed? Does it have issue in bind() to the same >> ip/port in the later sub-test? > > Yes, I observed that is I use the bare start_server, I systematically have > the first test passing, an all the others failing on the server startup > with errno 98 (Address already in use). I have been assuming that it is due > to some TIME_WAIT state on the freshly closed socket, but I may be missing > something ? Thanks for confirming. You are right. It should be the TIME_WAIT. Using SO_REUSEPORT works but become confusing on what the test is trying to do by starting only 1 reuseport server. reuseport is usually used with >1 server listening on the same address. A better thing to do is to always setsockopt(SO_REUSEADDR) in start_server_addr for TCP.