πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #3927

Re: [PATCH net-next v2 2/7] um: vector: honor virtio net hdr conversion failures

#3927
From: Johannes Berg
Date: Fri, 16 Oct 2026 09:44
72 lines
9478 bytes
On Fri, 2026-10-16 at 05:43 -0400, Michael S. Tsirkin wrote:
> 
> > > > > -	virtio_net_hdr_to_skb(skb, vheader, virtio_legacy_is_little_endian());
> > > > > +	if (virtio_net_hdr_to_skb(skb, vheader,
> > > > > +			virtio_legacy_is_little_endian()) < 0)
> > > > > +		return -1;
> > > > >  	return 0;
> > > > > 
> > > > 
> > > > Seems it'd be simpler to just
> > > > 
> > > > 	return virtio_net_hdr_to_skb(...);
> > > > 
> > > > As far as I can tell, the function only returns -EINVAL or 0 (never a
> > > > positive value), and the caller only cares about negative (error) or
> > > > positive (no checksum needed), so that'd be equivalent?
> > > > 
> > > > johannes
> > > 
> > > if raw_verify_header can safely return any errno - i did not want to
> > > audit it.
> > 
> > You already used an LLM and still didn't want to? ;-)
> > 
> > I checked briefly (by hand) and it seems fine, it's assigned to the
> > function pointer, which only has two callers on the _kern.c side.
> > 
> > johannes
> 
> 
>                                header_check = vp->verify_header(
>                                         mmsg_vector->msg_hdr.msg_iov->iov_base,
>                                         skb,
>                                         vp
>                                 );
>                                 if (header_check < 0) {
>                                 /* Overlay header failed to verify - discard.
>                                  * We can actually keep this skb and reuse it,
>                                  * but that will make the prep logic too
>                                  * complex.
>                                  */
>                                         dev_kfree_skb_irq(skb);
>                                         vp->estats.rx_encaps_errors++;
>                                         (*skbuff_vector) = NULL;
>                                         mmsg_vector++;
>                                         skbuff_vector++;
>                                         continue;
>                                 }
>                                 if (header_check > 0) {
>                                         vp->estats.rx_csum_offload_good++;
>                                         skb->ip_summed = CHECKSUM_UNNECESSARY;
>                                 }
> 
> 
> 
> so any negative is fine, but if we return 1 then it will force to CHECKSUM_UNNECESSARY
> which I am not sure is what was intended?
> 
Right, but virtio_net_hdr_to_skb() cannot return 1, only 0 on success
and -ERROR on failure?

johannes
Technical Details
Message-ID: <18ba10ec7aa6659ee4711f8dd3f3138e314e4af6.camel@sipsolutions.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347243-linux-kernel-netdev=dewy.ru
References: <cover.1792067836.git.mst@redhat.com> <6716834884238de0ab1ab313004044122aa2adbf.1792067836.git.mst@redhat.com> <8420ba1fe84fc7d105825026802d4ad10d44af71.camel@sipsolutions.net> <20261015085119-mutt-send-email-mst@kernel.org> <64ee40b97fc447bbf3abb80250ad0d9f3cf3c6fa.camel@sipsolutions.net> <20261016054142-mutt-send-email-mst@kernel.org>

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-347243-linux-kernel-netdev=dewy.ru
From: johannes@sipsolutions.net (Johannes Berg)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 2/7] um: vector: honor virtio net hdr
 conversion failures
Date: Fri, 16 Oct 2026 11:44:16 +0200
Organization: Usenet Network
Message-ID: <18ba10ec7aa6659ee4711f8dd3f3138e314e4af6.camel@sipsolutions.net>
References: <cover.1792067836.git.mst@redhat.com>
	 <6716834884238de0ab1ab313004044122aa2adbf.1792067836.git.mst@redhat.com>
	 <8420ba1fe84fc7d105825026802d4ad10d44af71.camel@sipsolutions.net>
	 <20261015085119-mutt-send-email-mst@kernel.org>
	 <64ee40b97fc447bbf3abb80250ad0d9f3cf3c6fa.camel@sipsolutions.net>
	 <20261016054142-mutt-send-email-mst@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2732823"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7fjyYV83yOWIS9kHnGisFFqTv8A= sha256:2Sykv7WBN4z9xFj74+OzMvenWdADN/BPFq0Cx7e24FY=
	sha1:7FvEnI7rg1r2cjhz7K9swFPdPOg= sha256:HxwWHzj6hatlVsS/+91e6+x7Fhwaivv//9pz03hkHuk=
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 B64FB1104D8; Fri, 16 Oct 2026 12:50:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 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.25,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=sipsolutions.net
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 yXP6C-cgcfCA;
	Fri, 16 Oct 2026 12:50:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-347243-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=permerror header.from=sipsolutions.net
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 826491104D4; Fri, 16 Oct 2026 12:50:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 2CA1B25FDE; Fri, 16 Oct 2026 09:44:42 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id EFF5345A29F;
	Fri, 16 Oct 2026 09:44:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="YiMl1guw"
X-Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16])
	(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 808CE44CAC6;
	Fri, 16 Oct 2026 09:44:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792143877; cv=none; b=IPXxOn9F3uT56bg+GZAGYnqyzelfNJITJXmh/OUCRcOGELci5Hz3OtIXbEXB84TZMjpAzbxxc6kJ9a3ErOZF72Q47lHfSoGyzzoHtN50qlaJh8VceMm6zAkoxWQZIGFTKPBWJ7F500BDpE9mCk7kubmrXrDqhY6zrM8PDXuXH9A=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792143877; c=relaxed/simple;
	bh=zDWNr4AnOOv1lhYK2bkBkb9CY9qN2RBP5lbHwr3KTJk=;
	h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
	 Content-Type:MIME-Version; b=ph1CyXBbTQMeMg0tf/hlW53ZJuCzYhowoje7QdQBfju36osZ2onFHxstP3PVloy5oN6FzR8xDfDbqErlcuzcHsCNe29RZZE6g5ZNDUVWCKc4+xvgJAJXWq6+A0FHsu9175Nz1rMyRZDuV3iwrJjJTOsDlGvPnM45w4a4KudFNE0=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=YiMl1guw; arc=none smtp.client-ip=168.119.38.16
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding:
	Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender
	:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To:
	Resent-Cc:Resent-Message-ID; bh=f/uMLjCIp2jROhfmRYKxJtNgmOf39cw4XgLVOb0p/jw=;
	t=1792143875; x=1793353475; b=YiMl1guw4CORM986w1ZLKmMOJJy8BezznRuXpSX0cME+760
	OtoMXfkdFcztNjIjoLkCTi6iOT2JZZGS0Pqb6q7+Qne5y+tqLjCRcwcjwwTb2PhzCwUBiV3zG7Lrl
	2FRHVPkDY4PI3d/XNi0seHrtqNsYdzQBqvVaa2+I7eEc1EnbEkSU0tsBmYW7ciBoq0pXs6sLPX0d8
	ByBnBH1UgyhpDCHgzgspBXDfx0dGBlY88Lt6kUrEHAAbyZHY+WEpTmkYR+xrSlu1FoFWrVSyR6h+h
	BrKzNZj7Nphp++c9gayFiak6+Rp+/8oXbk85cfHcGScD+K+NdnRgtHchf+cSAaVw==;
X-Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256)
	(Exim 4.98.2)
	(envelope-from <johannes@sipsolutions.net>)
	id 1xHeU5-00000005eqa-3gLI;
	Fri, 16 Oct 2026 11:44:18 +0200
X-Cc: linux-kernel@vger.kernel.org, Willem de Bruijn	
 <willemdebruijn.kernel@gmail.com>, Jason Wang <jasowangio@gmail.com>, 
 Eugenio PΓ©rez	 <eperezma@redhat.com>, Xuan Zhuo
 <xuanzhuo@linux.alibaba.com>, Andrew Lunn	 <andrew+netdev@lunn.ch>, "David
 S. Miller" <davem@davemloft.net>, Eric Dumazet	 <edumazet@kernel.org>,
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni	 <pabeni@redhat.com>,
 netdev@vger.kernel.org, virtualization@lists.linux.dev,  Rusty Russell
 <rusty@rustcorp.com.au>, Max Krasnyansky <maxk@qualcomm.com>, Richard
 Weinberger <richard@nod.at>,  Anton Ivanov
 <anton.ivanov@cambridgegreys.com>, linux-um@lists.infradead.org
X-In-Reply-To: <20261016054142-mutt-send-email-mst@kernel.org>
X-User-Agent: Evolution 3.60.2 (3.60.2-2.fc44) 
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-malware-bazaar: not-scanned