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 DE6EA3E4C68 for ; Mon, 18 May 2026 09:07:02 +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=1779095224; cv=none; b=T9YF5Y9FmYrxNccQlZESScsjW/43/yT7vfw5BXdlA5vOu9HMp4M9iTQNQvOwm+z/SfZcr8s4w7gNqOQ0kX3Cn20+Gl5XjrEAXc8L/CKVtbix67JpeTm9HXQLKvRmJTNn8c7zRro6qAZbQOB7/F0hjeIBRw9SjCtKDLBHD5oEY8M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779095224; c=relaxed/simple; bh=4Jgas6XMDUNHabFy3gLOXXGPd/CXV5aZuFt6IpzE+ME=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=j1vyEVdyycOoa1K+kX/ozrbuIzXdOq1IBdaFkvpCrVug7lLPvXoxGvutJRn6WpFC4psOdDE2tLR4xjWnU+hqDxIn7zJjN+Z6ahYb0hcHIn+LpK4zBLmEj491c4UfagFKdB9HT8/AgbuK0poLkw4nbMFkPMSbbzRFtHwSgLKZY0Q= 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=BjHLjqPN; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=NW93tZzJ; 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="BjHLjqPN"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="NW93tZzJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779095221; 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: content-transfer-encoding:content-transfer-encoding; bh=WVr+ozlWbMHYAfpi/swl/ldM7Por8GhrxE5XtzjKwI0=; b=BjHLjqPNpQZS4G5WHrcvgUe7Rxy+bb+oty0LzSPbjRPp+i/uOr/+tQugfZw8J+LXzU8E+m TmCBcsHsu22ci1lPwvAbqIKH+hZ4KUUJxkjVlx7Ida1RkGWxKJi2DCLJdAJBWEsHJNWi9v 3dAJt1m+uIi48ZQ386ZzLKU53sXsPdY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-358-n5_sh3RGMdeOG_QvTPSr2Q-1; Mon, 18 May 2026 05:07:00 -0400 X-MC-Unique: n5_sh3RGMdeOG_QvTPSr2Q-1 X-Mimecast-MFC-AGG-ID: n5_sh3RGMdeOG_QvTPSr2Q_1779095219 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-48ff0eb77b5so18536965e9.0 for ; Mon, 18 May 2026 02:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779095219; x=1779700019; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WVr+ozlWbMHYAfpi/swl/ldM7Por8GhrxE5XtzjKwI0=; b=NW93tZzJ0TMy1f/345XjJDPEgfL1iOqk8JawoVks3FSzoQoW19IN+gmDRowBVBM1Mg OC9l9TilTHki3qhS40JGpYugXmvcYMWd0Jf8yvm2Sob4x4xYHTAKuUCiC6zb8uw9DXHp gwvMoZDB1Y/2Nq+QQuKdkLW3qTfSV6gIAy2UTB+EGtsCUvAMTLIF+RdaoJ3fw56mnaLq 7ctK6HFNwqNr7f9wLnqUbKWCZbrDFlvY66bTSoWshOt7HtTQJcPUa9gEy11C8dKY0dBO Fyf7A7BUQiSidt/Fy9/mV/NH94LJ2trrcWGH9Lhx4USWR03W845OziA28erEUmm+pnEA FfdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779095219; x=1779700019; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WVr+ozlWbMHYAfpi/swl/ldM7Por8GhrxE5XtzjKwI0=; b=oALmwzU2cvovklYF081oGEtSX1D7eOfADSS+3No6/N0ATEr4gJQsgoxjVYwQs0G3wn cD3hioGlsLWXnNxxf/DtJUK862JJ8M3Bumr1o03vdZB6sYp/K4e5tXyWrolxVMwpUsbm z1a8EbD3hnb/SL5DQIFcetwBppX2qpksh9msEID3M+JKB0LJ1XsP3n69HDOseH8b0ttX cCQd9ESV28VuI2ykHy6CoN13Jh2ljbM+Zo0gZXH9eOfjHeEuQfGNYNBgZ7pZdQEco+wv Lru3J7IFXtkwQQqCvVfL0e6bjuJUJ+2uSrE+lvBMBieP8/+f0VBTu5hmiP7j0lElBxyR fspQ== X-Forwarded-Encrypted: i=1; AFNElJ+HiLtrhux5AY+eafosJPqX4aP/6b+k0E58rsztXaZ3OmArBzStBv9OnFnDmqSmseWGr8oYkFWppIZ+tdI=@vger.kernel.org X-Gm-Message-State: AOJu0YwB7l/WOT62EYOKqNHXV4UAYEKvb3Mzt46taG6kT0lF2HJpkVXw Dl7QEzwmrkSCv2OXM9DIzXZeNTrLMVStmBg2P8mMLFQMe8lnED0S5WVUzlEaMGFsmg4bHVUeh/t LVESDvMVyl/HuqWHxsG2CcIIkniFXd6QOt6j+ukjppUx4rcQC81q5+YGpjNDAVaql/Q== X-Gm-Gg: Acq92OGkslFL4PQ5Hisebuniv6zmjPchCh+qoq7D/2DpCpRquiRBlgN6EJWBoTO2cNq VPmDpmfg/f58NChfUrvXx9QGROTDgLB+bKoJjHehVfdqlbOcatTzCKqFUNfF4YV/K+lcVcUU/FU WoVkHfk/Cfxg1erje9MpxsjgZ4hMYsdymXsnCA865FdqgQhK2rEk8s02JM60XEk7BN3ohBsB6aV S9JgHD7bKofmVzSC0To4dwMrC37h8rNBGHOD3Z6ND4C93tzlQ9BOWwlUnIhghFLQCoIMuRI5/V8 aYdETTQaA6gvjTZi80+D6BU8JQbLV4fcmX+d0RCrQ9ZQ1KchetQ5vkIg7Dev5wsMR0wwDRvmiUd ocxFCoAtjJu4MabhFla2SlsXPRxJTw7nYpNGcJOG7x29E4vNlJBVm1B6lCQ+V X-Received: by 2002:a05:600c:8184:b0:489:1c1f:35f1 with SMTP id 5b1f17b1804b1-48fe60e1451mr214884055e9.4.1779095219294; Mon, 18 May 2026 02:06:59 -0700 (PDT) X-Received: by 2002:a05:600c:8184:b0:489:1c1f:35f1 with SMTP id 5b1f17b1804b1-48fe60e1451mr214883165e9.4.1779095218657; Mon, 18 May 2026 02:06:58 -0700 (PDT) Received: from stex1 (host-87-16-204-231.retail.telecomitalia.it. [87.16.204.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe5e9d5d9sm279478545e9.15.2026.05.18.02.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 02:06:58 -0700 (PDT) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: Simon Horman , Jakub Kicinski , "Michael S. Tsirkin" , Paolo Abeni , Jason Wang , Stefano Garzarella , "David S. Miller" , kvm@vger.kernel.org, Stefan Hajnoczi , linux-kernel@vger.kernel.org, Eric Dumazet , Xuan Zhuo , virtualization@lists.linux.dev, =?UTF-8?q?Eugenio=20P=C3=A9rez?= Subject: [PATCH net v4 0/2] vsock/virtio: fix skb overhead accounting to preserve full buf_alloc Date: Mon, 18 May 2026 11:06:54 +0200 Message-ID: <20260518090656.134588-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.54.0 Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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] 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