From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 D3B983F86F3 for ; Tue, 19 May 2026 09:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779182884; cv=none; b=Ids0hkV0S8SmBlfNwpgEnzKAssuQpIlJdAlBEXTHFU4BE7rkRHuDjKDRyR3uRMHTcKQ0d9QdDTTLGY17W/yqv/TFPo/xM5OSGLCOlwxhJR04xGECf9xKYnsXe3brhJMsvCizeibDwCVnMAmYeF3lws8J27TFhArNjIgx/cblLK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779182884; c=relaxed/simple; bh=uDEw9No4oP0gv6j/Ado3aaG16haNPWRnDa/SWjuSB2c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u71nI3KNC6HSEIMKhoXVHIDXynqEjezsNOhzCHaryJMIGtN3l7QUsXTcBMtXkjNnWXmzbi3RBwKRd9HSRP03gjzZ7UmwOlOBP2xQyob6cxvvIW//RiWm6jYbmnF3oy5giEO8ECDZCwGRLmYQUBojRT7kK1EAuPnLiMIz2xMjjcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Rtn3n3hH; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Qp5g2XXc; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Rtn3n3hH"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qp5g2XXc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779182879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3kq5cy4odtanFj4ZmmMjmdUGGp4uB2ZhMg4n7iuzQNs=; b=Rtn3n3hHjeG06wrmahBmrpvnEhYR+jEb0NsM4qrjeozaOK42WG43ypBvnE4KiJJJ+LeWtB jhV/N1K3EfwrVY6foEddYR3kH+jT9yvLKxcyWqtRASXBSsavLA11kIzGxgjX9iL5F/04VC /GZHN1APwLtybUvFv44BJbWblwjL9QY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-116-FWiPZkFPPaCtQeXeTp6CLA-1; Tue, 19 May 2026 05:27:57 -0400 X-MC-Unique: FWiPZkFPPaCtQeXeTp6CLA-1 X-Mimecast-MFC-AGG-ID: FWiPZkFPPaCtQeXeTp6CLA_1779182876 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-449dcfe8005so2666063f8f.3 for ; Tue, 19 May 2026 02:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779182876; x=1779787676; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3kq5cy4odtanFj4ZmmMjmdUGGp4uB2ZhMg4n7iuzQNs=; b=Qp5g2XXcUW5pzt09Ok1DfcXRCqJOSLPS5Ths9SasBz3va0oZXd96CZJiWEnmmTg5ju ulT2vzEKejVy2Ybn3f0FTNm33XADihQGTYChOCTEjAIbH8+J8EQJgQ9h8lco/13ofs+h neQVPFURGpFYz/Ggzut/7i0wVxgWOGbt0VW8ZsdO0Ya5BTr5cRQJt+BiEqPJMzOsSJKz 0qOUv6tejOWJfPmqENslLKQMINFZ6YdKWrtdVhIq4Rl8bQTNN97dymbC6xFrTRoZcpEX FLlqILASe6JlPlEQ8ORNJ6KyMtqvF9P8mYdDO2MHjfqYUfU+OHhjLNpXAsfBCjuV18Rz xHGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779182876; x=1779787676; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3kq5cy4odtanFj4ZmmMjmdUGGp4uB2ZhMg4n7iuzQNs=; b=UBoAuk4GOXqHH6lM9KAyYBoE/U0iEpEQJ4Isq2m4QzRJ1PLRkoKWE31G4I1VkBNShe 3YJFr46BPOpelsRKW/TLlZyn7bF2Gu7E8GAHOe+t8lOvbjTZNfiSytbQtuiOOv0poOek WqFfMQEUPj0hjttXvGBvxtUrMm0I5kqLoyLI99ikhwtE74C9rtavYsEBMc4gURL/Ey7m gWaW0h4Gn4Qf7SFRl7rqVs1/cwtbgG1I37D7f8KY+ubhSqaqND0tp/z/dXWhJgCb83jB jzJMdqEuculUf6ppyqgLGSfFrmXXZpKZ+o98BTLOW1E6vcfT6e+F+85/PE3b1WpHekGu ROkg== X-Forwarded-Encrypted: i=1; AFNElJ/K//MFaS6zoUPN8k++85gfsCyP/MfKwqCSUNrhElFfiW/DnCRDIljglbKavPvx77ay5INIU1ZtlPoWqfo=@vger.kernel.org X-Gm-Message-State: AOJu0YwcORb9+DfcQPzZYXqf33UvUFOFl5znW9yOW2Yw1IixT5gmpT4F +0XB8szJZ7JHTRNH4t06leQdukMckWd9l9U1EhMXQd+unnsVoRqh9R/ZiGy0qTArYGv9B2gpUMA gYh9i0rKV3clQPBD3fL5XlOkVpZeKmCyrnONdLSIWT2PPnKuDWjREDXZHPaK0z3THqg== X-Gm-Gg: Acq92OF0Gz62groWhzGQbsveck64tONNvDaoB8wQVKTcM3zAlLrAVA/ZvBsMOPP8CTX YartUAQswDPaToyREcPdEyHy4ezej1DMvIbuoS0kCZf3u4WkWz9Q7DCmB+3rVGAQZy8gqX7tOZq Z54xdTIjDIoJlRDGh2pSWuBk8sKl3yEotgWXtf8d731TgILFkRk6Y8tTpJgEwV0yUElPRRDiqJ0 iAA/j/nG2gbQL022EhbQDH+ZM5/PCOnzMed0UX18at+zf13qHgU0+uq5LYH0Bp5zXUbJ7LqGkEC 0u9Mgs1v8Dimwqe5mdD56s0T6fVDd+48I8mMefYbycih8ddt9aq6zB2izg5fzr6gXsbax5xa54V J2a0L6/hTbrInoEVvZ52Itlk2EGyy17dniSuZjl9Qm2Jc3US5g6Vq+Wk0i7AhTqvRHK+Mf1n70Q == X-Received: by 2002:a05:6000:40db:b0:43d:7a97:78af with SMTP id ffacd0b85a97d-45e5c6137f0mr31869423f8f.42.1779182876050; Tue, 19 May 2026 02:27:56 -0700 (PDT) X-Received: by 2002:a05:6000:40db:b0:43d:7a97:78af with SMTP id ffacd0b85a97d-45e5c6137f0mr31869195f8f.42.1779182874171; Tue, 19 May 2026 02:27:54 -0700 (PDT) Received: from sgarzare-redhat (host-87-16-204-231.retail.telecomitalia.it. [87.16.204.231]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45d9ed2f738sm43178925f8f.16.2026.05.19.02.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 02:27:53 -0700 (PDT) Date: Tue, 19 May 2026 11:27:46 +0200 From: Stefano Garzarella To: netdev@vger.kernel.org Cc: Simon Horman , Jakub Kicinski , "Michael S. Tsirkin" , Paolo Abeni , Jason Wang , "David S. Miller" , kvm@vger.kernel.org, Stefan Hajnoczi , linux-kernel@vger.kernel.org, Eric Dumazet , Xuan Zhuo , virtualization@lists.linux.dev, Eugenio =?utf-8?B?UMOpcmV6?= Subject: Re: [PATCH net v4 0/2] vsock/virtio: fix skb overhead accounting to preserve full buf_alloc Message-ID: References: <20260518090656.134588-1-sgarzare@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20260518090656.134588-1-sgarzare@redhat.com> On Mon, May 18, 2026 at 11:06:54AM +0200, Stefano Garzarella wrote: >Patch 1 resets the connection when we can no longer queue packets, >this prevents silent data loss, and both peers are notified. > >Patch 2 increases the total budget to `buf_alloc * 2` for payload >plus skb overhead similar to how SO_RCVBUF is doubled to reserve >space for sk_buff metadata. This preserves the full buf_alloc for >payload under normal operation, while still bounding the skb queue >growth. > >In the future, we plan to improve how we handle the merging of packets >to minimize overhead and avoid closing connections. > >v4: >- Split the buf_alloc check to be sure the credit is still respected and > to avoid overflow of buf_used [sashiko] >- call virtio_transport_do_close() and vsock_remove_sock() to properly > close the connection and remove the socket from the connect table > [sashiko] sashiko reports 2 issues on the second patch but both IMO are pre-existing: https://sashiko.dev/#/patchset/20260518090656.134588-1-sgarzare%40redhat.com The first one related 32-bit architectures should be fixed, but can be a follow up since not introduced by this series. The secong one related to a low value set by the user as buffer size, it's also pre-existing and I don't think we can do much. Please let me know if you prefer to add another patch to this series to fix the first issue, or just send another patch. Thanks, Stefano > >v3: https://lore.kernel.org/netdev/20260513105417.56761-1-sgarzare@redhat.com/ >- Split in 2 patches [MST] > >v2: https://lore.kernel.org/netdev/20260512080737.36787-1-sgarzare@redhat.com/ >- Close the connection when we can no longer queue new packets instead > of losing data. >- No longer announce the reduced buf_alloc to avoid violating the > spec. [MST] > >v1: https://lore.kernel.org/netdev/20260508092330.69690-1-sgarzare@redhat.com/ > >Stefano Garzarella (2): > vsock/virtio: reset connection on receiving queue overflow > vsock/virtio: fix skb overhead accounting to preserve full buf_alloc > > net/vmw_vsock/virtio_transport_common.c | 29 ++++++++++++++++++++----- > 1 file changed, 23 insertions(+), 6 deletions(-) > >-- >2.54.0 >