🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11418

Re: [PATCH net 6/6] selftests: seg6: add test for skb checksum with CHECKSUM_COMPLETE

#11418
From: Andrea Mayer
Date: Wed, 04 Nov 2026 20:48
54 lines
11756 bytes
On Tue, 3 Nov 2026 11:26:35 +0800
Hangbin Liu <hangbin.liu@linux.dev> wrote:

> [snip]
> > +
> > +log_test()
> > +{
> > +	log_test_expected "$1" "$2" "$3"
> > +}
> 
> We'd better use log_test_expected directly, otherwise the log_test in
> lib.sh will be overwrite.

Hi Hangbin,

Right, I will call log_test_expected() directly in v2.

> > +
> > +test_command_or_ksft_skip()
> > +{
> > +	local cmd="$1"
> > +
> > +	if [ ! -x "$(command -v "${cmd}")" ]; then
> > +		echo "SKIP: Could not run test without \"${cmd}\" tool"
> > +		exit "${ksft_skip}"
> > +	fi
> > +}
> 
> Then we can use require_command() in lib.sh here, which will call
> log_test() in lib.sh.

Yes, I will use require_command() too.

> [snip]
> > +
> > +if [ "$(id -u)" -ne 0 ]; then
> > +	echo "SKIP: Need root privileges"
> > +	exit "${ksft_skip}"
> > +fi
> 
> I wonder if there is any one run the selftest with none root privileges.
> Cause almost all the selftests need ip configurations.
> [snip]

The test needs root privileges to create the namespaces, write the
sysctls, add the tc filters and load the BPF programs. Without the
check, a non-root user without these privileges gets a SKIP from a later
check, for example "SKIP: dummy dev not supported", which does not say
that the privileges are missing. With the check, that user gets "SKIP:
Need root privileges". I would prefer to keep it.

Thanks for the review,
Andrea
Technical Details
Message-ID: <20261104214852.853a936a50a49e2cf2acbbd4@uniroma2.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356927-linux-kernel-netdev=dewy.ru
References: <20261031225033.64-1-andrea.mayer@uniroma2.it> <20261031225033.64-7-andrea.mayer@uniroma2.it> <aulUayPCDOYwAm1e@fedora>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356927-linux-kernel-netdev=dewy.ru
From: andrea.mayer@uniroma2.it (Andrea Mayer)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 6/6] selftests: seg6: add test for skb checksum with
 CHECKSUM_COMPLETE
Date: Wed, 4 Nov 2026 21:48:52 +0100
Organization: Usenet Network
Message-ID: <20261104214852.853a936a50a49e2cf2acbbd4@uniroma2.it>
References: <20261031225033.64-1-andrea.mayer@uniroma2.it>
 <20261031225033.64-7-andrea.mayer@uniroma2.it>
 <aulUayPCDOYwAm1e@fedora>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3529909"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:n36+RELvtN70FDLzSOb4awqtzio= sha256:d1hNjfCfFvIGT88okc05bWBxaQaqwPysEn+mNYv41vM=
	sha1:3VbbPKX14vh+EgUcq+sBkv0/f7o= sha256:pOrZFjOrgsvWMNL4JbscZmilxisHKhDP1dSaKZAwLws=
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 94266112E33; Thu,  5 Nov 2026 03:57:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -4.775
X-Spam-Status: No, score=-4.775 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, NICE_REPLY_A=-1.724, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=uniroma2.it header.b=3lud85Yp; dkim=pass (2048-bit key)
	header.d=uniroma2.it header.b=gIjKeGI7
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 4P5yoV0YkXiX;
	Thu,  5 Nov 2026 03:57:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-356927-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=uniroma2.it
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 2B13D112E19; Thu,  5 Nov 2026 03:56:48 +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 E6A8C3F56A; Wed,  4 Nov 2026 21:26:29 +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=1793825381;
	b=YilUbEWUGBM97Z0v23PGiC8Z03bNkNKANVOGxl0MfaPL65vqA8xs+NNQ8mIx4ysUIvpD
	 DFsZN8snF8XdtZG5mWzYRWelTP9GgIoDWvFwF3q+pYnxhzsSUTU3OU4nbZKjcmS/lqar/
	 wMdHYyDl6l7q9RV5tklHNFTTV6En5S1IwKZ9dIX4O+JcNGQGkdr0W5WDLuHz+kUhO1922
	 wRp6NJ5sAG1qQ9JBlZljQ0pc8YPGyc4jMM4GeI8Gr9O0EL65RcvXOuyvjOjqayY4ooZvk
	 wM05tCH3fWdhic+wMBbTbVjksyuIFXkQOKv9NmDMzBGEEcnCs1fKgqlY+LJln8tjO9Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793825381;
	h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
	 DKIM-Signature:Date:From:To:Cc:Subject:Message-Id:In-Reply-To:
	 References:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:Mime-Version:
	 Content-Type:Content-Transfer-Encoding:X-Virus-Scanned:
	 X-Virus-Status;
	bh=KWiRV1sGkuoDXhM09Z+91Z+gqhSc78puMi7yQgR1TGE=;
	b=wmEUfwsb3zo6SXbd/mtu0MddpWapZ5z4FD6kniK22zYiC+/sYyo8/ZcaU3rgtE54BA8I
	 v0X99JWMJmQiPGK6byvnB9hTKSrSt1IqnBuxYhVd78+IlZfdGNO0FoRV+18aoFEV4tPeS
	 oJ2iVQ92kHJzNybKQnZpYJNuPP2P847/K0QTvHG3nBSC0iRxzEqHDjgsJEIdPutofPARJ
	 7wdxb3gVaUBT3Lge5QS59xWarisHJjHYZZygid1QCf00ludbn7IKICf6EHBLvx5va3qrM
	 hcLTPZEm96OzQ7rlyW9yhIexNCVxabicRhpD9jtqrFkBedwB0OmDjbya8Y3pnND3HXQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=3lud85Yp;
	dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=gIjKeGI7;
	dmarc=pass header.from=uniroma2.it;
	spf=pass smtp.mailfrom=uniroma2.it;
	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 021F1606CA02;
	Wed,  4 Nov 2026 20:49:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=3lud85Yp;
	dkim=pass (2048-bit key, unprotected) header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=gIjKeGI7
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=160.80.4.35
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793825380;
	b=dqxwQxC3t72vT5Ogi7Nk3Q7C1/U+450b1Hc7JzkOQlxnk+Au8OY4onncbgpghZC0Kbby
	 V7VnSch46ycTfhZwx8v+7CG21DwOu9CJXOyo8bUWWBG5anun0ItcnYCMwHZi58q3CprDG
	 yLTbhiNcKtqw7JgNiAusLzuDlwJyvEisxoX1ETF3h4VD5XegOv8ayGlyBc3Xect7T4FYA
	 0qaj1GU6xtVZsImuPKU1iUNWUMuRMPL78ESvxvB7XN2eY4aAxUYi3FPKF6dyRce03MBcE
	 YMQ3V8UjbRD0VaSeD37mYPqRKLbjBkhRaAZYJKN6ZYfiAO8otWlPKuozQdHEm72esuQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793825380;
	h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:Date:
	 From:To:Cc:Subject:Message-Id:In-Reply-To:References:X-Mailer:
	 Mime-Version:Content-Type:Content-Transfer-Encoding:X-Virus-Scanned:
	 X-Virus-Status;
	bh=KWiRV1sGkuoDXhM09Z+91Z+gqhSc78puMi7yQgR1TGE=;
	b=NcTrOW18xxL9EM/jO8YiG5torkkB99TioKFeEIM204Okv63E1FfMC3wT2Q9Q66TGISKn
	 UWQY/BYHBcQNXo1DENVWhL21r3Z2aj6W+7Abm39z8x3bjaEZfElTrY/kJLDZPDgjGKhsE
	 wT5Xz62sxqOFAsv3bFQdm27nkT19pZu+2iEAi4xqmwyHiSsnnPBJVQ2+RPU4/Seo8A5pT
	 yHiF1C2rSuIiD9VvL9WMgo2Gwg8gD9uwpj7W1zBOAoGhVvF6nw+EELAKXE3Zp4UTWWYif
	 XGne76xiHQI9EPjZSxON+tKjSml/lhDpDywts2baAkZlq2qYpx2Rf52EWEhw5uym+9A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=uniroma2.it;
	spf=pass smtp.mailfrom=uniroma2.it;
	dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=ed25519-sha256 header.s=ed201904 header.b=3lud85Yp;
	dkim=pass header.d=uniroma2.it header.i=@uniroma2.it header.a=rsa-sha256 header.s=rsa201904 header.b=gIjKeGI7;
	arc=none smtp.remote-ip=160.80.4.35
X-Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.4.35])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 508AC606B2E4;
	Wed,  4 Nov 2026 20:49:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 508AC606B2E4
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniroma2.it
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniroma2.it
X-Received: from smtpauth-2019-1.uniroma2.it (smtpauth.uniroma2.it [160.80.5.46])
	by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 6A4Kmwv7026955;
	Wed, 4 Nov 2026 21:49:03 +0100
X-Received: from lubuntu-18.04 (unknown [160.80.103.126])
	by smtpauth-2019-1.uniroma2.it (Postfix) with ESMTPSA id 3A5D8121681;
	Wed,  4 Nov 2026 21:48:53 +0100 (CET)
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=uniroma2.it;
	s=ed201904; t=1793825333; h=from:from:sender: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=KWiRV1sGkuoDXhM09Z+91Z+gqhSc78puMi7yQgR1TGE=;
	b=3lud85Ypuk1tJ4tH2Yskpq8GzXEWvWfGmN9+7cebU6nDqyMHSirqd70IOiIm/74cz/PBeg
	jLQkFeBqdmDRtaDQ==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniroma2.it; s=rsa201904;
	t=1793825333; h=from:from:sender: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=KWiRV1sGkuoDXhM09Z+91Z+gqhSc78puMi7yQgR1TGE=;
	b=gIjKeGI7fmepMSDdBPAlik4cT5XZmFCK5v/N/c5pedyglD8RjJJr/NOmaJ01XH904Vu+xZ
	9sjCp9XD/QzLFvudkjfrFM7ku642bphdwieD9vqn0D2MkOjX4O8Gpv0K2N19MXGh0DamjS
	p5z1qyxWzfxl6H5o6jyO/gFN3kYtYoP+QZNICk/l/QypChvSHz6M2zbcKA7ACKvy61IikD
	FpL/nILSAQC12OE8NTobXZm/gTvou1yZMIjNHxUidllVDFySilBE09vEKxybns9UBLXKpe
	cEPbLllIc7QziULnLD6LibaeiCdAZxW6/AgU2huu7TFG3Me21r5jubtRz0qwUg==
X-Cc: "David S. Miller" <davem@davemloft.net>,
        Eric Dumazet
 <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
        Paolo Abeni
 <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
        David Ahern
 <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>,
        Shuah Khan
 <shuah@kernel.org>, linux-kernel@vger.kernel.org,
        netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
        bpf@vger.kernel.org, David Lebrun
 <david.lebrun@uclouvain.be>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Mathieu Xhonneux <m.xhonneux@gmail.com>,
        David Lebrun <dlebrun@google.com>,
        Stefano Salsano <stefano.salsano@uniroma2.it>,
        Andrea Mayer
 <andrea@common-net.org>,
        Andrea Mayer <andrea.mayer@uniroma2.it>
X-In-Reply-To: <aulUayPCDOYwAm1e@fedora>
X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu)
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-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015
X-Virus-Status: Clean