Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp641242ybp; Fri, 11 Oct 2019 01:52:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmrVimmWKpFzPdIfP72AgS+wSpwz1ueeVCgsC5WyyY/f6v0oMlkU2z4mrLmUGsmv3Hby8x X-Received: by 2002:a50:b966:: with SMTP id m93mr12317272ede.228.1570783963826; Fri, 11 Oct 2019 01:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570783963; cv=none; d=google.com; s=arc-20160816; b=BJ4Y39b/OFCQn+3nK9B/y7cSv9X1yC+05H2I5OUv0siI6LvQj/lpMD0965xlb+eLN8 ABD1dzWDou8NqJBidal9aS2ilhMuZ5sFq6d4LRsh4MtxLtrs1zQtt/N6etslVk2lUFdh pNTvk7BeJP47LRiu7F48b2riYtxhjZLImO9BGHtTSPS2cDsARvr+8yift9Uqc/cNIvgY TlG7a4wrMILKHUGs/hwNTwvt29WjhqWIo/FaC534f5VSTy2OW7PsYCEKs6P8inULwp2n sjj6Yj+RQUitmcc36Y2TkwGuXHD3fKKxvnJDuBKmdbp1laOhlpdnqs/O+JczpLHVCnV3 tpaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bm3aGONhK4qHoU5UjTbFZHuFrC1vqMKeEY0f1MpcuKs=; b=hPhhKJph+XdyDh+HmxnVTW35qV+KgiLDGv35a/2LVkeXjLBM5+IffoxqH9TWWROcOI IDFdVQltEA1D3Fb2xvageZIcCpoHARt4pkkEWSJYbGNQDs4KuwklgHoX20mE9DPddNjZ BaC1US4gyOkVWsFVy1bUvHfgCWQJAE5rWFnE2t1W86imlEMukivcDZgFAfLg0mjhaoBQ TGUG5OA9fgHwkeD+7EF05jtX33Voa+c6NTNs1wmV45ZzX4SpwvzVb8ek6uaqhCA3CRe8 MH9S/861PEn9JPIUNn1k/LC4jjTZrThRfRTKOk1oC6iauQ1saIZmfKWwUnhj5JtE1U00 fBpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si4415343ejp.435.2019.10.11.01.52.20; Fri, 11 Oct 2019 01:52:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727554AbfJKIwF (ORCPT + 99 others); Fri, 11 Oct 2019 04:52:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbfJKIwD (ORCPT ); Fri, 11 Oct 2019 04:52:03 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38420C049D59 for ; Fri, 11 Oct 2019 08:52:03 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id m16so2499842wmg.8 for ; Fri, 11 Oct 2019 01:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bm3aGONhK4qHoU5UjTbFZHuFrC1vqMKeEY0f1MpcuKs=; b=YLV3jsE+cey4K5N6zd1XULbOvmsCRx5YtwzTw7dX+FdH9dkrSnNwK/4a3Na8m1g8VN YA2AB2SG8CbRavcn2shnTRwhR4GvU/IRXKWIYssX/QfBXcjR8bz4OY8jJSjVN9U2tx5/ clGVBiDvINWs7OAPlQxZjHPmHvvwjLnkB8rg1eqpX1LFd1Pdw22dyxDN97eqmkiKHg0+ PHPko3XOxBnd85PPY3e+il8GYI7ej8N1d5nm2OKSJxturgvJkV+4rABaTQtWuKq+OJC7 qZl7kOGcPrON1NZFk6xsxEAkP3lPy32qan+JXM3tcu63FMagyB/bG2+zblp7sJ/KBwhq HjRA== X-Gm-Message-State: APjAAAWw1dkJQGZmIKreFg/+tX6BatMxuxbXXGSTEC+GJpSYdlk3ylra jKPxQE/0wVGFzXPc2PPuszkY+R5oSGbrSuTUvfCNlazPK0Bn0Nj+zFjgFhKLTYVVCSkVrYKl3Da rDTCIAtoX3nlbumupOK0Zlw/N X-Received: by 2002:adf:f50b:: with SMTP id q11mr8542921wro.310.1570783921677; Fri, 11 Oct 2019 01:52:01 -0700 (PDT) X-Received: by 2002:adf:f50b:: with SMTP id q11mr8542895wro.310.1570783921424; Fri, 11 Oct 2019 01:52:01 -0700 (PDT) Received: from steredhat (host174-200-dynamic.52-79-r.retail.telecomitalia.it. [79.52.200.174]) by smtp.gmail.com with ESMTPSA id z189sm13295813wmc.25.2019.10.11.01.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 01:52:00 -0700 (PDT) Date: Fri, 11 Oct 2019 10:51:58 +0200 From: Stefano Garzarella To: Stefan Hajnoczi Cc: Stefan Hajnoczi , netdev@vger.kernel.org, Sasha Levin , linux-hyperv@vger.kernel.org, Stephen Hemminger , kvm@vger.kernel.org, "Michael S. Tsirkin" , Dexuan Cui , Haiyang Zhang , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, "David S. Miller" , Jorgen Hansen Subject: Re: [RFC PATCH 07/13] vsock: handle buffer_size sockopts in the core Message-ID: <20191011085158.wiiv4av5fgipm4k7@steredhat> References: <20190927112703.17745-1-sgarzare@redhat.com> <20190927112703.17745-8-sgarzare@redhat.com> <20191009123026.GH5747@stefanha-x1.localdomain> <20191010093254.aluys4hpsfcepb42@steredhat> <20191011082714.GF12360@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011082714.GF12360@stefanha-x1.localdomain> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 11, 2019 at 09:27:14AM +0100, Stefan Hajnoczi wrote: > On Thu, Oct 10, 2019 at 11:32:54AM +0200, Stefano Garzarella wrote: > > On Wed, Oct 09, 2019 at 01:30:26PM +0100, Stefan Hajnoczi wrote: > > > On Fri, Sep 27, 2019 at 01:26:57PM +0200, Stefano Garzarella wrote: > > > Another issue is that this patch drops the VIRTIO_VSOCK_MAX_BUF_SIZE > > > limit that used to be enforced by virtio_transport_set_buffer_size(). > > > Now the limit is only applied at socket init time. If the buffer size > > > is changed later then VIRTIO_VSOCK_MAX_BUF_SIZE can be exceeded. If > > > that doesn't matter, why even bother with VIRTIO_VSOCK_MAX_BUF_SIZE > > > here? > > > > > > > The .notify_buffer_size() should avoid this issue, since it allows the > > transport to limit the buffer size requested after the initialization. > > > > But again the min set by the user can not be respected and in the > > previous implementation we forced it to VIRTIO_VSOCK_MAX_BUF_SIZE. > > > > Now we don't limit the min, but we guarantee only that vsk->buffer_size > > is lower than VIRTIO_VSOCK_MAX_BUF_SIZE. > > > > Can that be an acceptable compromise? > > I think so. > > Setting buffer sizes was never tested or used much by userspace > applications that I'm aware of. We should probably include tests for > changing buffer sizes in the test suite. Good idea! We should add a test to check if min/max are respected, playing a bit with these sockopt. I'll do it in the test series! Thanks, Stefano