Article View: linux.kernel.netdev
Article #12001Re: [PATCH net 3/3] vsock/virtio: queue at most one credit update per socket
From: Oleg Drokin
Date: Fri, 06 Nov 2026 05:02
Date: Fri, 06 Nov 2026 05:02
29 lines
9766 bytes
9766 bytes
On Thu, 2026-11-05 at 19:19 -0500, Michael S. Tsirkin wrote:
> On Wed, Nov 04, 2026 at 07:01:41PM -0500, Oleg Drokin wrote:
> >
> >
> > #define VIRTIO_VSOCK_SKB_CB(skb) ((struct virtio_vsock_skb_cb
> > *)((skb)->cb))
> > @@ -167,6 +168,9 @@ struct virtio_vsock_sock {
> > u32 buf_used;
> > struct sk_buff_head rx_queue;
> > u32 msg_count;
> > + struct sk_buff *credit_update;
> > +
> > + refcount_t refcnt;
>
> why all this complexity? can you not just peek at the queue tail
> instead?
Thanks for the suggestion. The send queues are per device, not per
socket: vhost has one per guest, and the guest driver and loopback
have one each. A peer with two connections can alternate its credit
requests between them, so the tail is always the other connection's
update and nothing would ever be merged.
v2 reworks this third patch:
vsock_sock remembers its newest queued packet while that packet is a
credit update, together with the queue it is in.
The refcount, the skb destructor and the transmit hooks
are gone, and vhost and the guest driver are not touched.
Technical Details
Message-ID:
<9615375a368c5d6c31cae9dbbfd51db037784193.camel@linuxhacker.ru>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357749-linux-kernel-netdev=dewy.ruReferences:
<20261105000141.3617241-1-green@linuxhacker.ru> <20261105000141.3617241-4-green@linuxhacker.ru> <20261105191917-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-357749-linux-kernel-netdev=dewy.ru From: green@linuxhacker.ru (Oleg Drokin) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 3/3] vsock/virtio: queue at most one credit update per socket Date: Fri, 06 Nov 2026 00:02:23 -0500 Organization: Usenet Network Message-ID: <9615375a368c5d6c31cae9dbbfd51db037784193.camel@linuxhacker.ru> References: <20261105000141.3617241-1-green@linuxhacker.ru> <20261105000141.3617241-4-green@linuxhacker.ru> <20261105191917-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="3797595"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:RgWqRcwnXfdXsp06aR6uPd9nMxk= sha256:bB60c3uakCusMRlBb8WOsto440pzXnQZUTnPi0c8KbY= sha1:GzCBWADgajFUPaYbi80zRHGhwVg= sha256:VDU4d0x5hxXsWA09S2oA4qKNJlRLDE3S/pCBbwvaOCo= 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 C99CB113161; Fri, 6 Nov 2026 08:03:15 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 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] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=linuxhacker.ru 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 DYoD8tNHIT95; Fri, 6 Nov 2026 08:03:11 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-357749-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linuxhacker.ru X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 3C1B1112E19; Fri, 6 Nov 2026 08:03:02 +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 2F9DA25EBF; Fri, 6 Nov 2026 05:02:59 +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=1793941377; b=qm9ueja84WO0VtGzek/vgZ336lvyiYXWSbOoF3xmCFn4ncAND6OOk0h9Sbwy28vQ1MhO OOuO/oFSwcaeN9gPcFG8FMon0Rr/4YK/aJrJOBmcHdjcQeRkb7auCKjkMs9WN3CLmP8G6 wmCfYiJ8Ciyq4pUMEqRqcIokzlQ4S+M8LeaS1IBsJ2aKM5QHLhR8mAaQofx9BPkycv80O mvIO9ZM+z4b2mEkYVN6Vsh0XbBRh1BQrd9wvikpn+KakThECC7c+dzgxHbhoSZxfkwwvD /vbErU2jsDglZQDtqEtdDTfOVwQpH+/o3OrRNpnhuwhzdB+MBuB5Gaz/oPl5/kp9TeQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793941377; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Filter: DKIM-Signature:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:User-Agent: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version; bh=/E4P3dYGG3OLLZ/+JjGK4939CGV5ZJ679kg1UXIY3WI=; b=hWUUXNTmJKILaCmWR4etZ/OwYiTIwq3rF93QJCE/dpIXkEg2IsPGYiUb7SBvdXjPT5Et AzruwkeesNs76jEYFskiJwlYSHVElaVeJ4YAglfC9NWVVpkXUYpWVQvA28/43aRXVG/tX I38TI2oEQJAZzN+WYkWeNS5zwovEnbB/42wW0CvkTJxHfOImTXm8zQwRqLUNwifEBc1Q9 VWn79heYatzhq+3opGt1pSR0DNmmINlbpKmC3aR+h104wf7eXBJjv8O+xYXnWUidC/nZY dxR0v5BwMoju1UmJ3auM1kHYySOY47OoRYEHeFGJQVl3/gTo8p4k9PI+2jf19u/u9qA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linuxhacker.ru header.i=@linuxhacker.ru header.a=rsa-sha256 header.s=mail header.b=snlGUrD0; dmarc=pass header.from=linuxhacker.ru; spf=pass smtp.mailfrom=linuxhacker.ru; 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 1F5A3606A328; Fri, 6 Nov 2026 05:02:57 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linuxhacker.ru header.i=@linuxhacker.ru header.a=rsa-sha256 header.s=mail header.b=snlGUrD0 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=159.69.87.85 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793941356; b=RI3JABH/eswoWyDEtKR13w1tFFQx/zSOyWZScj+C0eU7rsoRF4Xn2ipFGfaWqzT39CID MrOltnLJUtp5Fkd5YQCta/5W+vyA8Yk/7ty0D4MV3EXqApDLSLWakl/IVHdpNI1vQkA/h 2PAafAJ5XfevB5132JkPuhSSzJ3CnX1FNhoo0NIfx7LzQHbSuC/aMF+EvkZxOafmCtLfp OnI9Fa3uGZ/j1xuVIhS04nWUHRHVS9ft3rjtP0HGD6UyzfCXXj7jg/uZ+Ru6RDQPWx9Ht VuWxaKGI06pT6IaJzFEF1W5oVVIPAEMcoAOgdRDwOL9tzvhoM6es8IyRNJomk1k75dw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793941356; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Message-ID:Subject: From:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:MIME-Version; bh=/E4P3dYGG3OLLZ/+JjGK4939CGV5ZJ679kg1UXIY3WI=; b=U4zZS3Y898Z5y+yrKZO1iXu9+oPrZEnC2DDUF7R7dL2KfqYJwT7uPvC9xIvSwkNLsAo7 qfUdXUHGhwkYDrVghQUpuxtWit8BVy5bCRvZ9bVylYtR1yncIFBZfqvoLE0wXgB9jc7wD Dpo3aBHwQVjS02TzFOP+YAZqADe9Vq0EDLkEqu6ONUr+hjVBRoubrU7LFYaYnSecBbIlK 228VLcOWJusf6kabC8TfdgsGWz1zRU/v9Glv1BiNkTXTVDBW7VLKj6YKnugCyI9Nwb7Vf RLWGtxC6x6SeoujgngG6YbCaqBzZTE/ndvaY9Uem7x0ICgR8KVCos3Svo5GiWeblHxg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linuxhacker.ru; spf=pass smtp.mailfrom=linuxhacker.ru; dkim=pass header.d=linuxhacker.ru header.i=@linuxhacker.ru header.a=rsa-sha256 header.s=mail header.b=snlGUrD0; arc=none smtp.remote-ip=159.69.87.85 X-Received: from eagle.linuxhacker.ru (linuxhacker.ru [159.69.87.85]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5A1E606A326; Fri, 6 Nov 2026 05:02:34 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E5A1E606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxhacker.ru X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxhacker.ru X-Received: from [10.137.0.31] (unknown [162.81.204.199]) by eagle.linuxhacker.ru (Postfix) with ESMTPSA id 7A2C7BEE42; Fri, 6 Nov 2026 05:02:25 +0000 (UTC) X-DKIM-Filter: OpenDKIM Filter v2.11.0 eagle.linuxhacker.ru 7A2C7BEE42 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxhacker.ru; s=mail; t=1793941347; bh=aqDdN5EbIY6jIgTAilZgeXe6s88P6n4MhtpN1ffc92k=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=snlGUrD0Q3Yg+a0E085tRFo10AhVaxfpNBITl2MVPIqcC0Q1d8eMgKRWJd4V00lte UluotoNGtZJONdFBGprmosOJH9ALqG55htsIedDzkSpSnJaXQP/BhfVmxzqN3O69RA fje+5IDucsxsZ99Svs8v2+msNGlP2nEl8P+F36DmnOdi/y/spIcV4TlfHMDXiDd0CL FGm+Pzli4O+YOLo2kg/teEqPm53N6V8clkHQ7EhXWp0F1P3KBARWDjY3iz02S3C8jM RhYulnXClDSxvYLdXmnxKG0EbXa3Aah0pAAKksGbFOsmjZ2JreNzV5qG+9RbMxA5M3 pAlCMzizTYwzg== X-Cc: sgarzare@redhat.com, stefanha@redhat.com, jasowangio@gmail.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com, bobbyeshleman@meta.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261105191917-mutt-send-email-mst@kernel.org> X-User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) 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