Article View: linux.kernel.netdev
Article #20730Re: [PATCH net-next v5 3/3] selftests: net: veth: propagate bad-settings check failures to exit status
From: Hangbin Liu
Date: Mon, 23 Nov 2026 05:22
Date: Mon, 23 Nov 2026 05:22
76 lines
11484 bytes
11484 bytes
Hi Omokefe,
On Sat, Nov 21, 2026 at 07:22:17PM +0100, Omokefe Emmanuel Onanaroghene wrote:
> Three more checks in veth.sh print "fail - set operation successful
> ?!?" without setting ret: "bad setting: XDP with RX nr less than TX",
> "bad setting: reducing RX nr below peer TX with XDP set", and "bad
> setting: increasing peer TX nr above RX with XDP set". A kernel that
> wrongly accepts any of these invalid operations would be reported yet
> the script would still exit 0. Wrap each fail branch so it sets ret=1.
>
> Reported-by: Tianyi Gao <tianyi@cloudflare.com>
> Link: https://lore.kernel.org/all/CAG4wq-cd01i7YrcFPmma=BXUcwn_PK=wneKW=vyEBYzQ3Bn7QA@mail.gmail.com/
> Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
> ---
> tools/testing/selftests/net/veth.sh | 26 +++++++++++++++++++-------
> 1 file changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
> index 7a2bbed0263e7..6eeb123aaf885 100755
> --- a/tools/testing/selftests/net/veth.sh
> +++ b/tools/testing/selftests/net/veth.sh
> @@ -474,9 +474,13 @@ if [ $CPUS -gt 1 ]; then
> ip netns exec $NS_DST ethtool -L veth$DST rx 1 tx 2 2>/dev/null
> ip netns exec $NS_SRC ethtool -L veth$SRC rx 1 tx 2 2>/dev/null
> printf "%-60s" "bad setting: XDP with RX nr less than TX"
> - ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} \
> - section xdp 2>/dev/null &&\
> - echo "fail - set operation successful ?!?" || echo " ok "
> + if ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} \
> + section xdp 2>/dev/null; then
> + echo "fail - set operation successful ?!?"
> + ret=1
> + else
> + echo " ok "
> + fi
>
> # the following tests will run with multiple channels active
> ip netns exec $NS_SRC ethtool -L veth$SRC rx 2
> @@ -484,16 +488,24 @@ if [ $CPUS -gt 1 ]; then
> ip -n $NS_DST link set dev veth$DST xdp object ${BPF_FILE} \
> section xdp 2>/dev/null
> printf "%-60s" "bad setting: reducing RX nr below peer TX with XDP set"
> - ip netns exec $NS_DST ethtool -L veth$DST rx 1 2>/dev/null &&\
> - echo "fail - set operation successful ?!?" || echo " ok "
> + if ip netns exec $NS_DST ethtool -L veth$DST rx 1 2>/dev/null; then
> + echo "fail - set operation successful ?!?"
> + ret=1
> + else
> + echo " ok "
> + fi
> CUR_RX=2
> CUR_TX=2
> fi
>
> if [ $CPUS -gt 2 ]; then
> printf "%-60s" "bad setting: increasing peer TX nr above RX with XDP set"
> - ip netns exec $NS_SRC ethtool -L veth$SRC tx 3 2>/dev/null &&\
> - echo "fail - set operation successful ?!?" || echo " ok "
> + if ip netns exec $NS_SRC ethtool -L veth$SRC tx 3 2>/dev/null; then
> + echo "fail - set operation successful ?!?"
> + ret=1
> + else
> + echo " ok "
> + fi
> chk_channels "setting invalid channels nr" $DST 2 2
> fi
>
> --
> 2.43.0
>
This one and patch 2 are fixing the same issue in the same test. Why bother
with two patches?
Thanks
Hangbin
Technical Details
Message-ID:
<20261123052207.GG10218@Liu-laptop>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369048-linux-kernel-netdev=dewy.ruReferences:
<20261121182217.4609-1-emmaonana18@gmail.com> <20261121182217.4609-4-emmaonana18@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369048-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 3/3] selftests: net: veth: propagate bad-settings check failures to exit status Date: Mon, 23 Nov 2026 13:22:07 +0800 Organization: Usenet Network Message-ID: <20261123052207.GG10218@Liu-laptop> References: <20261121182217.4609-1-emmaonana18@gmail.com> <20261121182217.4609-4-emmaonana18@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3798908"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:p9gxf8ALwpqUIw7Vb1p9c5fjfnM= sha256:M33M72F1ZOb0r1ovInEnNNpa2ZEjc600/Nus04cD0P8= sha1:LXC6IJPJTlzO8aISsTVXfKmkd6A= sha256:S+ykobX07PK4tZ1vEt8t4XReDtRodxGAclbRu51UEoo= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 07D7A125D8E; Mon, 23 Nov 2026 08:22:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5iTPbYrs0td0; Mon, 23 Nov 2026 08:22:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369048-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 8B3F9125D8D; Mon, 23 Nov 2026 08:22:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 559F7279E9; Mon, 23 Nov 2026 05:22:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795411342; b=opYIornbqJcLW56JyMIR7SaiksXEIVD+MxTTtgaIgUr4wiOQT9rUvnnUrtfHa4V9p9pw knJ7RCdnJPGHAc/OU7GLWt1awMqL1ifq+bjcYrjJDiX8djs8lpLqt2/Pz+2Y0e6bN0/Q9 etzc9t/hhJcpHAZFmGX4EaMQEQXcS9UFozxeCJwkzzpkv38dMKfArtrJ7hURlWOdRLYya 55rdceVDk1q3z5q3QnReu7u9J8hyRbsmCT24IFDF1B4sZVVwclN/0BHRSUu0AkfNBX52G eYLjm8JDk/HNh1tMYpKZPnTpBEHDvca1dwgwBBABbMA31nH78vnUL9J9CE7FgKGXeJA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795411342; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=iy36ClD91OuaesY/Ay9KrdFH02xOa7KlfGzGZS847ZU=; b=sNhsZTAL6QcBCNEJNTYnCsX0JsLcgUwycOLoIjIsGAryy61LiKMzpbYojv2dKPJ4e8+3 MM9Sc40q5Ipd4jOhaz8wonMaiiM9ziWCzoc0CxuBz9YczH0NW8B4xOTWn0TfP3al/sK2y Qv3WwoVwAeQcb1K2+fCBc4c/l9OgRmzuklnIeDm6AQCeSSJHDE48VoEC0P+g2J8CBl+Xe 6zglH5EJQdq4RX5EACNEHhQ0/zGRsx7+d+Z4QfmnNon2mluTV8cVkP1GysRp1XcyQaYBD 7bEp3jMyKlJwHG4EqsnjDVGAoYHXu1yqBQdhyj9jbra5mT+8r89K7Bor9N1k/Af3Yyg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b="rorQCa/B"; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBE0A606A334; Mon, 23 Nov 2026 05:22:22 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=rorQCa/B X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.43 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795411341; b=gQO5RNIMuN8JVmOK7ZYNHiUTOxEtupC8SuFPm9uLYCYrUuW7q8zTAnyiNZM1iD87yTuW E7g/ntYYanyTA9EpiGFKus9nQX7375O23dEr5FJYLxxRQOx2qNZMchj2nOnsBH30Hcie3 P9CieFLra13KLjc3PUey+RShiSSCVp/1wbBGw2esZEcGB9ajqBcPGl1aIxQg8uJuU4wDY rPzlc2epOCh85PEvAtt7U1do/2R3tG+K4gCqFU60S+1voL8+zGJtlDOGL3DwCDxbkiGEC wI0BUBR8WZmq3Uj2ucWrkHwLIZHgfsuhLqSXaXe0UAwa2TtUPimCVNPCmxzqon4S9SQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795411341; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=iy36ClD91OuaesY/Ay9KrdFH02xOa7KlfGzGZS847ZU=; b=aJbSqqd8Oc9vlqSLpPxLoh4c0qJQb/CxGBVbdl3s5hKwjcrXbRkWsEpaIeOJn5uNQjsY MgUZ79RibCKcpHy+jpUPSKazeMoDTY9KK5VcONRieixu3dKSN/Mx5nYjwrNfPogFMhwg8 tw2Z1Ihvs0BhvuUIhjeZm1nRUV0xsd0qllxIMisndxGJlzuggTG1HEvBUQwHLjoFbUKKG 9Dc4mG/i7J4oiGl3W59vIFEZoviuGscaHltx6kl2asxlThr2h/+qUKxpOEYswW7KhUcsl btnMcZPAYaAo2gPNfLNOZg7Z2NE4am3m0Xje+nZ0w+3ebkfZeSwmVuhXdvc0b/S2imQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b="rorQCa/B"; arc=none smtp.remote-ip=95.215.58.43 X-Received: from mta1.migadu.com (out-43.mta1.migadu.com [95.215.58.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26DAE606A31E for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 05:22:20 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 26DAE606A31E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=D82Nd0c2N+O4K4PuYhgfhJVwNjk6bdjRGsOrqQiK2r4=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795411339; v=1; x=1796016139; b=rorQCa/BO2A211dkndlN3Z5a+4JYq5futjumyEheZuePk96gq4WCr5xxiiNzN0OOhnmMz6xT ZYy/qBo+xlUR66fL2yeW3qkEcIsDDLIhN3QNJbE0KaQZEtKr3kVQkRYp3Ks+Ws7sc8Yb57Wk7p6 1lORLH0C+OVV/3QD07YeWkuk= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id d4f9441bda4b8cfe; Mon, 23 Nov 2026 05:22:19 +0000 X-Mizu-Trace-ID: d4f9441bda4b8cfe X-Migadu-Flow: FLOW_OUT X-Cc: tianyi@cloudflare.com, kuba@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, skhan@linuxfoundation.org, kernel-team@cloudflare.com, tianyi.gao@linux.dev X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261121182217.4609-4-emmaonana18@gmail.com>