From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm2-f11.google.com (mail-wm2-f11.google.com [74.125.225.139]) (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 0FF9B3C1966 for ; Tue, 14 Jul 2026 12:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031438; cv=none; b=Fd1Y8AxAi3pPy2O6Uxh+/PjCkyKIj6LJ9qD2LsFlDMlDhdUlG7t7rVuzBR1ttIcL3yZfMkTILqNIbIAFw0YaEGooJ/VjDLEMvhKCp5EUMVnLVoTUwIl5WaSNRVZe9G/dUtxjkUvQ2ONd8dg+P3E9G5XiotFpD8NP/672cKnvuyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784031438; c=relaxed/simple; bh=YEpNs6pmYVxz4PQh8SzmAkXFrjWAYq6cWXXi9C3jIkw=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Z0OlzAvXm6jrqOxvJqHN73hS67TttPkmLtqoIrAl4WdckU8ACQbIOeyptvzIpV/cdVXVYLiRm8J6FCraXVXEKiNxXGZcJk9SbeIBW/675ssM7dZFvyH7YJvEmStdAm2kaHdX31U1DV1Sxs/naEXhHhxV95kXK9Wd01Rr9RqmMs8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=74.125.225.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm2-f11.google.com with SMTP id 5b1f17b1804b1-493d43b6c28so3783195e9.1 for ; Tue, 14 Jul 2026 05:17:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784031433; x=1784636233; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=egZiSxqHD1w/P79BBVFkvOie28f1koI4NWZWuHndLxE=; b=WfWjP3fzUERWaaofdp0Mxq//Co1L/WuWKoz8PO8Yx4ehFaWu9EcJdpq9oqRppwKR3y Cc5em8d5WgzZfuEQWhDXm5JvIJDmkZSh46xskrdq2wT61eNtRNcqxy27vOvSgRLNOWti 8Z0PO5f4tOZX7/TDY14ZhVmN68yEi2SqwyK1a2CXh1BIhkmU9oY7vXO1svhyyYSDArEx YTtdMAb8bCFXFutMgItWaeW9DZd11rgVPlEjpiLukEP1Iog15YwRKmvFMgNxLGdjJdn9 tv6QVQ+Vq92JVi5NGELmkAZeBxaD63I12AQFXz0wQoP4agYPxyERKJBTNY5wDsIyrG9Q pfbw== X-Forwarded-Encrypted: i=1; AHgh+Rq/ORs7bS7kSPzkyVLbhh1ARvzpZRUpbtIheJ98p2sXQTUowYTJju+PDwg3FIjvw/jDuG0P0vw=@vger.kernel.org X-Gm-Message-State: AOJu0YxsRV9FDN8/2Ev/1yNSuuqauf8VxhauHiWEfHx9zhD/0RsmGkpS LFkZSj3QAl7kcBFPcJut6XjymfhVW6BNXoLnSw9IPV0Qt+Dq1hMqyojK X-Gm-Gg: AfdE7cnbl5QTmDDeh2ufxv0Yy89hTMDflSaNA3JUSSz7ArALhjKLE8yasXOzpVjgIuR XmnAJvfp17mYln1eLku4Ilg21MOM1WY+UML85g3mkqjOFGCrKYSEUrpv6SOjSSmPhtShvCtFY9l Ddc/EK+QPSxqcK1ryqZNhFTyuN1dTYz08JYJQFHhOoeaUbTBOmVC0PwJADBJH+MJArxITBPnoVL VEdh2HTyI9NXitGchOOxtWVGpDxk/dLtoxh6FaClHJTftcLVih53qQrhfESOOKDWGhJin0rtwE5 BYrnAPsH+YKV+7CBBo7wQLmrxbA9mJYxsLSd8pckFWsfyA87I+0s9VOxmpr7oXJTUvkvZFrJNim ho2srQ19AOvSNeZqrevFefvVwBowOjaBgmv6ORVddc3jzU4HlzvE2nDu0asTuz5JDzKLl94W4+h qGozZwCxOXvWOn4CrSerYvrGnc0rNy3arJpolmWrfTF1kdY5eUvQ== X-Received: by 2002:a05:600c:1f87:b0:493:f870:fbf0 with SMTP id 5b1f17b1804b1-493f88b3693mr166046515e9.34.1784031432765; Tue, 14 Jul 2026 05:17:12 -0700 (PDT) Received: from [192.168.88.241] (78-80-108-129.customers.tmcz.cz. [78.80.108.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950871cbd6sm84393335e9.3.2026.07.14.05.17.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jul 2026 05:17:12 -0700 (PDT) Message-ID: <87f03ccc-5f60-4e8e-a6ef-8f5f8dcb4e12@ovn.org> Date: Tue, 14 Jul 2026 14:17:09 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: i.maximets@ovn.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com, horms@kernel.org, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, davem@davemloft.net Subject: Re: [ovs-dev] [PATCH net-next v2] selftests/net/openvswitch: add SCTP flow key test To: =?UTF-8?B?5L6v5pWP54aZ?= References: <20260707034718.2717982-1-houminxi@gmail.com> Content-Language: en-US From: Ilya Maximets Autocrypt: addr=i.maximets@ovn.org; keydata= xsFNBF77bOMBEADVZQ4iajIECGfH3hpQMQjhIQlyKX4hIB3OccKl5XvB/JqVPJWuZQRuqNQG /B70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33s/bai34aaxkGXqpKv+CInARg3 fCikcHzYYWKaXS6HABEBAAHCwXwEGAEIACYCGwwWIQSH6ZrVEpascJjzbVq59+x3yCm/lgUC Z8H0qQUJDIjuxgAKCRC59+x3yCm/loAdD/wJCOhPp9711J18B9c4f+eNAk5vrC9Cj3RyOusH Hebb9HtSFm155Zz3xiizw70MSyOVikjbTocFAJo5VhkyuN0QJIP678SWzriwym+EG0B5P97h FSLBlRsTi4KD8f1Ll3OT03lD3o/5Qt37zFgD4mCD6OxAShPxhI3gkVHBuA0GxF01MadJEjMu jWgZoj75rCLG9sC6L4r28GEGqUFlTKjseYehLw0s3iR53LxS7HfJVHcFBX3rUcKFJBhuO6Ha /GggRvTbn3PXxR5UIgiBMjUlqxzYH4fe7pYR7z1m4nQcaFWW+JhY/BYHJyMGLfnqTn1FsIwP dbhEjYbFnJE9Vzvf+RJcRQVyLDn/TfWbETf0bLGHeF2GUPvNXYEu7oKddvnUvJK5U/BuwQXy TRFbae4Ie96QMcPBL9ZLX8M2K4XUydZBeHw+9lP1J6NJrQiX7MzexpkKNy4ukDzPrRE/ruui yWOKeCw9bCZX4a/uFw77TZMEq3upjeq21oi6NMTwvvWWMYuEKNi0340yZRrBdcDhbXkl9x/o skB2IbnvSB8iikbPng1ihCTXpA2yxioUQ96Akb+WEGopPWzlxTTK+T03G2ljOtspjZXKuywV Wu/eHyqHMyTu8UVcMRR44ki8wam0LMs+fH4dRxw5ck69AkV+JsYQVfI7tdOu7+r465LUfg== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 7/14/26 2:01 PM, 侯敏熙 wrote: > Hi Ilya, > > Thanks for pointing this out. I looked into this and found that > nc (netcat-openbsd) on Debian/Ubuntu does not have SCTP support at > all. The upstream OpenBSD nc only handles TCP, UDP, and > Unix-domain sockets, and the Debian patches don't add SCTP either. AFAICT, 'nc' in netdev CI is the nmap version of netcat, it's not the openbsd one. Does nmap version support sctp? Google seems to think so at least. The test should be skipped though if sctp is not supported. Note: sashiko had some comments on the daemon pid handling in v2. Best regards, Ilya Maximets. > > I see two cleaner alternatives that already have precedent in the > kernel selftests: > > 1. socat: net/netfilter/nft_queue.sh already uses > "socat -u SCTP-LISTEN:PORT STDOUT" for SCTP data-plane testing. > Many drivers/net/ selftests already gate on require_cmd("socat"). > > 2. A small C helper: similar to sctp_hello.c used by sctp_vrf.sh > and conntrack_sctp_collision.sh. The shell test would call > "./sctp_test server/client IP PORT" instead of ncat. > > Which approach would you prefer for v3? > > Best regards, > Minxi > > 侯敏熙 于2026年7月13日周一 11:02写道: > >> Ah so many thanks for your suggestions, Please forgive me, >> I've always used ncat to write test cases. >> >> I will re-spin this patch. >> >> Ilya Maximets 于2026年7月13日周一 10:39写道: >> >>> On 7/7/26 5:47 AM, Minxi Hou wrote: >>>> Register OVS_KEY_ATTR_SCTP in the flow key parser so that sctp() >>>> can be used in flow specifications. The ovs_key_sctp class already >>>> exists (with src/dst fields matching the TCP/UDP siblings) but was >>>> not wired into the parser, so the token was silently dropped and the >>>> kernel rejected the flow. >>>> >>>> Add test_sctp_connect_v4 exercising the SCTP flow key with >>>> port-specific matching: sctp(dst=4443) for client-to-server and >>>> sctp(src=4443) for server-to-client. >>>> >>>> Wait for ncat readiness with ovs_wait instead of a fixed sleep so >>>> the test does not race against ncat startup. Use grep -c on the >>>> listening message to distinguish between successive ncat instances >>>> that share the same stderr log. Kill the previous server before >>>> respawning to avoid EADDRINUSE on the SCTP port. >>>> >>>> Signed-off-by: Minxi Hou >>>> --- >>>> v1 -> v2: replace sleep with ovs_wait on ncat listening output, >>>> kill previous ncat server before respawning to avoid >>>> port conflict (Aaron review feedback) >>>> >>>> .../selftests/net/openvswitch/openvswitch.sh | 102 ++++++++++++++++++ >>>> .../selftests/net/openvswitch/ovs-dpctl.py | 5 + >>>> 2 files changed, 107 insertions(+) >>>> >>>> diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh >>> b/tools/testing/selftests/net/openvswitch/openvswitch.sh >>>> index 2954245129a2..9c364eeb2ec2 100755 >>>> --- a/tools/testing/selftests/net/openvswitch/openvswitch.sh >>>> +++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh >>>> @@ -32,6 +32,7 @@ tests=" >>>> dec_ttl ttl: dec_ttl decrements >>> IP TTL >>>> flow_set flow-set: Flow modify >>>> action_set set: SET action rewrites >>> fields >>>> + sctp_connect_v4 sctp: SCTP flow key >>> matching >>>> psample psample: Sampling packets >>> with psample" >>>> >>>> info() { >>>> @@ -443,6 +444,107 @@ test_action_set() { >>>> return 0 >>>> } >>>> >>>> +# sctp_connect_v4 test >>>> +# - sctp(dst=4443) matches client-to-server INIT >>>> +# - sctp(src=4443) matches server-to-client INIT-ACK >>>> +# - remove flows and verify connection fails, reinstall and recover >>>> +test_sctp_connect_v4() { >>>> + local t="test_sctp_connect_v4" >>>> + >>>> + which ncat >/dev/null 2>&1 || return $ksft_skip >>> >>> Not a full review, but can we avoid ncat? We already use nc in other >>> tests, using different implementations of the same thing in different >>> tests doesn't sound like a good idea. On mnay systems nc and ncat >>> will be different implementations with different options and behavior. >>> >>> Best regards, Ilya Maximets. >>> >> > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >