Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2244421ybi; Thu, 18 Jul 2019 05:34:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOWN9IlI4200cQB+z+w8TtlDL4ShvKZPpiVKhHStl6CvtaOSuocm5VsQ6MeWgt5X/FdC2V X-Received: by 2002:a17:90a:e38f:: with SMTP id b15mr51829071pjz.85.1563453279681; Thu, 18 Jul 2019 05:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563453279; cv=none; d=google.com; s=arc-20160816; b=kRkFtrUHKU7CAiH99mI3wKwe4ZBADOBk98q/qP4Oaw/Tf1LST0A5QfmiG7EkxDrwBf YYtwUHA7WitYn19SWCFljPgcJ6mqMYVZCcuk/hLZNT6x/voV42Qladzj0iL+UmnuTwNy tPjHBxKc5aaLfDR8n+OhjLSrzr+G9ByqnaCxF+cakUjfAqtOt4Tl5q3N0P9aUdQ/iAbn Wty1arlB99aFbdk0wXqVfSivAQ8l8wNM6Bika8jrsIp8GGw39Y4vB+O2L+P/VW7WtkG2 L6yLD9vxYJmKMkAXQEfKIPnkgzEhdzcFeDTohnxNmPIuNdVZ5dQThIfH4k7TLjORle5x FxMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vDq3OMyw2fF2ZHXHolAWti6Jt9ecOHRwkzJkU1zrtik=; b=SiLk+Ccvv6izEbnT0kJwOOsa6tl9pNJQS9ltzEbjQVG6/MX99P7ackEKFnwAYEFdPk GkTYSh0soKzn00dMcoxckM332VE4wau4PR0kdOnINaJnmt3/KegwBEUK/QFnWcf5q5iT RxKiVuVw6990XtU1pBr+hUvW18HShDoe2M3MpSCn7udZ1uI8L16djfkrPQFwr8kjOXTG ZrIYaLfIKHVUMnhV87US8CYvbWEK9NqQ3vhApoC/X0tFQ0MkFgKc3I+JHOJIns74yv81 w4oPQ1eaj5O+yoBASdJeM/aUaApC4noudGgUkJTzoe9Of//6LVMN9EO23YrM0lUOi5uH ZpTA== 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 k13si737608pgj.525.2019.07.18.05.34.23; Thu, 18 Jul 2019 05:34:39 -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 S2390304AbfGRMdx (ORCPT + 99 others); Thu, 18 Jul 2019 08:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51384 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727692AbfGRMdx (ORCPT ); Thu, 18 Jul 2019 08:33:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43D52307D941; Thu, 18 Jul 2019 12:33:53 +0000 (UTC) Received: from redhat.com (ovpn-120-147.rdu2.redhat.com [10.10.120.147]) by smtp.corp.redhat.com (Postfix) with SMTP id AD1EA5D720; Thu, 18 Jul 2019 12:33:47 +0000 (UTC) Date: Thu, 18 Jul 2019 08:33:40 -0400 From: "Michael S. Tsirkin" To: Stefano Garzarella Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Hajnoczi , "David S. Miller" , virtualization@lists.linux-foundation.org, Jason Wang , kvm@vger.kernel.org Subject: Re: [PATCH v4 5/5] vsock/virtio: change the maximum packet size allowed Message-ID: <20190718083105-mutt-send-email-mst@kernel.org> References: <20190717113030.163499-1-sgarzare@redhat.com> <20190717113030.163499-6-sgarzare@redhat.com> <20190717105703-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 18 Jul 2019 12:33:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 18, 2019 at 09:52:41AM +0200, Stefano Garzarella wrote: > On Wed, Jul 17, 2019 at 5:00 PM Michael S. Tsirkin wrote: > > > > On Wed, Jul 17, 2019 at 01:30:30PM +0200, Stefano Garzarella wrote: > > > Since now we are able to split packets, we can avoid limiting > > > their sizes to VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE. > > > Instead, we can use VIRTIO_VSOCK_MAX_PKT_BUF_SIZE as the max > > > packet size. > > > > > > Signed-off-by: Stefano Garzarella > > > > > > OK so this is kind of like GSO where we are passing > > 64K packets to the vsock and then split at the > > low level. > > Exactly, something like that in the Host->Guest path, instead in the > Guest->Host we use the entire 64K packet. > > Thanks, > Stefano btw two allocations for each packet isn't great. How about allocating the struct linearly with the data? And all buffers are same length for you - so you can actually do alloc_pages. Allocating/freeing pages in a batch should also be considered. -- MST