Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp200822pxb; Fri, 8 Jan 2021 02:37:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmHldnQ7ZXKUArCyfNPPHY8EAVKHHBsgA5zFJyW8ujGiMaIxOBxjLOuL9rW958pVh85bvw X-Received: by 2002:a17:907:1010:: with SMTP id ox16mr2244075ejb.439.1610102249376; Fri, 08 Jan 2021 02:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610102249; cv=none; d=google.com; s=arc-20160816; b=MyvtuPc8nn5HxzGFJ69INtAyHbOeqaGtCznMdYs3EoMOhmZDiDoQxuwZp895Ki1iPr 9KOfL3YitH7wHpqmz+r/IM60KU1LWEgiTlXLwJmVCzJwqbs2KqtqkEecMdC4xYy0/CfO Orgu0J4+i1ehQA5Kjo9EXc55qwfQc38BV0rGeXOSuGzvBd4wcGbMnNsjDLDnpJf1B6vH MVKIKwhVxjH6xeDaP+3sx1yYgdxRRFXh5b1dnA0w5fz41SFPQYZbiQ6/iT1LlmMTlW8o mz24LBnJobNSaL6kNWM3xweq87ZEkBhEOkoaQajn0xz1G6IAmLKGX/n4ggtjpB3TKCbg 0lHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9jaCobpp/gjZ1BrAW63KVqKbg+WZam2J/wlrqVXlE/U=; b=nGtx2G+B+N8ayxSTUVOkCJ0qg2v7qzcA6Yz++37j9bj260LRE1Eq9He9oKhXOfhQlu oPE6UTlGfWNde1YRhrfbWe1U9+jKYWhOlAnfD1kzZvIS3gMViEmpt/ZmiSmzRqqfaK/6 UOq0wV5Phd4raYgllBZU1iDDVNH87eMFNetvNX+/Xyoa/zftXFq6GWjy/o0/BOI3lE3E tlla3XrmQZ+/aKw8zAn5FbUTeXNYuoWmScJO1xhB2dTDQtjf7W7dkdzrdDlNo5nnlYCB bieCaou20YTcsGG/J5itumXeKp/GIYly2p3R9qHWOwOB5IO8PydBJTcOL4vQ6R0d1fyE 8Zaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="GjZRGu/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r16si3244290ejz.602.2021.01.08.02.37.05; Fri, 08 Jan 2021 02:37:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="GjZRGu/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbhAHKf3 (ORCPT + 99 others); Fri, 8 Jan 2021 05:35:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50574 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbhAHKf3 (ORCPT ); Fri, 8 Jan 2021 05:35:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610102042; 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=9jaCobpp/gjZ1BrAW63KVqKbg+WZam2J/wlrqVXlE/U=; b=GjZRGu/5tFOLIAoaDM2OL0XDemAkaNO9u+E19hViCIt2GCEh0rp7rH98IZ8QGhM057bjC6 KxdNtWFuyOLd4BwqbhP0i9BLFU5JMTpqtuZK0py/d3C6YXNfxe1vr/hsQFGMR5l3MD0/JJ bJmFOCT5ZdQBFE3/VUr0tf3zA8P39J0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-gd3cqmoFNherrAVisJepDg-1; Fri, 08 Jan 2021 05:34:00 -0500 X-MC-Unique: gd3cqmoFNherrAVisJepDg-1 Received: by mail-wr1-f69.google.com with SMTP id g17so3943251wrr.11 for ; Fri, 08 Jan 2021 02:34:00 -0800 (PST) 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; bh=9jaCobpp/gjZ1BrAW63KVqKbg+WZam2J/wlrqVXlE/U=; b=mnq3UT7pxGwSu7JZr4JHcNM2OpVbKW2CcTa5RixIG6WhBe66rmLY/AosjkpiW+ynnJ qBjOmRrFE33fTbk470SzldvIv8sman+EJwm1TxijuGW46lVVZF63Ny1QAl2kP8ZI8VUQ 5yAbGXRSVvWdkcsRGIpdo0ObFuDK4IQ8EOj8MlStLeUr7dkBKjxqXDfkOYvRG41JA0kH 1YgvxmSt1VnVWKOh9Km8QCEVBNJcdaXXhkZOIL7t0jMo9/tMR6AjJfxC4EgcDHV+OkDv 3pIbHlIKDzNCHmgEFHjajNil7Sq2M1xwe5pbI3s2s3OZHx5QYIGEkzo68EUzyGL2Fe/a 33rA== X-Gm-Message-State: AOAM531z2B37XAIkucApGFyqQlMRutayaovVsw8dPD7djGSJz2FOMTCk 9wkOb9phKm/Hek0F9uZSNIgqTe5lbDMZ5DNgtGzvsfPVeJvWvXJAlaMaHZPPBFmqy4z/icRk4du cwJbHS8FH23ruY3xjS2Dy6f5E X-Received: by 2002:a5d:4f8a:: with SMTP id d10mr2905566wru.219.1610102039579; Fri, 08 Jan 2021 02:33:59 -0800 (PST) X-Received: by 2002:a5d:4f8a:: with SMTP id d10mr2905551wru.219.1610102039359; Fri, 08 Jan 2021 02:33:59 -0800 (PST) Received: from steredhat (host-79-34-249-199.business.telecomitalia.it. [79.34.249.199]) by smtp.gmail.com with ESMTPSA id s25sm13327280wrs.49.2021.01.08.02.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 02:33:58 -0800 (PST) Date: Fri, 8 Jan 2021 11:33:35 +0100 From: Stefano Garzarella To: Arseny Krasnov Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Colin Ian King , Jorgen Hansen , Arseniy Krasnov , Andra Paraschiv , Jeff Vander Stoep , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stsp2@yandex.ru Subject: Re: [PATCH 0/5] virtio/vsock: introduce SOCK_SEQPACKET support. Message-ID: <20210108103335.iabhzk4r6fpsiopt@steredhat> References: <20210103195454.1954169-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210103195454.1954169-1-arseny.krasnov@kaspersky.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arseny, On Sun, Jan 03, 2021 at 10:54:52PM +0300, Arseny Krasnov wrote: > As SOCK_SEQPACKET guarantees to save record boundaries, so to >do it, new packet operation was added: it marks start of record (with >record length in header). To send record, packet with start marker is >sent first, then all data is transmitted as 'RW' packets. On receiver's >side, length of record is known from packet with start record marker. >Now as packets of one socket are not reordered neither on vsock nor on >vhost transport layers, these marker allows to restore original record >on receiver's side. When each 'RW' packet is inserted to rx queue of >receiver, user is woken up, data is copied to user's buffer and credit >update message is sent. If there is no user waiting for data, credit >won't be updated and sender will wait. Also, if user's buffer is full, >and record is bigger, all unneeded data will be dropped (with sending of >credit update message). > 'MSG_EOR' flag is implemented with special value of 'flags' field >in packet header. When record is received with such flags, 'MSG_EOR' is >set in 'recvmsg()' flags. 'MSG_TRUNC' flag is also supported. > In this implementation maximum length of datagram is not limited >as in stream socket. I did a a quick review. I like the idea of adding SOCK_SEQPACKET, but the series needs more work. Some patches miss the SoB, the commit messages are very minimal. Anyway I like that you shared your patches, but please use RFC tag if they are not ready to be merged. Another suggestion is to move the patches that modify the core (af_vsock.c) before the transport modifications to make the review easier. I'd also like to see new tests in tools/testing/vsock/vsock_test.c Thanks, Stefano