From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42058C433E0 for ; Wed, 30 Dec 2020 20:57:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B634206F6 for ; Wed, 30 Dec 2020 20:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726545AbgL3U5e (ORCPT ); Wed, 30 Dec 2020 15:57:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53467 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgL3U5d (ORCPT ); Wed, 30 Dec 2020 15:57:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609361766; 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=iFlZtz74xmTz/ktSlcFt8gctOusgNHUwrHkjcpUKl9Y=; b=IAFjOFKTzYuL0nPHFkOlMlBDN55g2RIpd3qxmTvzWZZXtDB1s4KAdcJ1pP69CE1fY1ctNx q6q+rFDLhV0D0P+D0cdK7aAfS6ZDGTfEx5myFI3Rvwv3taNkdSf0mY6qYAfczEItszerjN rJGJ2HmdOUvyJh0roeq78fGXVvdk1hA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-8m_-j8TwOpqYl-5h_izSCA-1; Wed, 30 Dec 2020 15:56:04 -0500 X-MC-Unique: 8m_-j8TwOpqYl-5h_izSCA-1 Received: by mail-wm1-f70.google.com with SMTP id z12so2908786wmf.9 for ; Wed, 30 Dec 2020 12:56:04 -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=iFlZtz74xmTz/ktSlcFt8gctOusgNHUwrHkjcpUKl9Y=; b=I0ud6tspwtBxJK3ip5EQ7pvrDpz+gGJ552fY32BH1v+Q+aPQc26YFkV5qolbRszAkK H0JlSYR3clURifZ2V9uqG6r0d1sjrO/ioCUU0THJsS923syABDWJNEds9FPgHFGDSe0I P+JZmCK5246tV6x3h/x+42yWYsMxPYTOVYv2yAhy58zroTmtY50Ru2fq4M0f9CuhJkZk 7kvrZueVvKvj3nGYlQI96+DD71z4FhRt/TA9f5L+STF6Jo++4ORbAJk/eMoqV9WhSgns kgnBqAurakJQyOtCS/DDXTDDrq6IHvhmLxv7+/xGFohMw07sA0VpJjN9xbJUNQcOmo2N hRWA== X-Gm-Message-State: AOAM530u/UCb1qGtguEPsmIG8PVgokaOGFHmkdbGM1+Fe7tiS5R7meFX AuQNU3v0anp7x5HZVuf2xA2zZAxU+VO6Ep+7BK38OT+1Flbj4ZO5+1JDKXeggVodIsx3ZmDm9EV PktUXqirYtZEC X-Received: by 2002:a7b:c319:: with SMTP id k25mr9111288wmj.142.1609361763378; Wed, 30 Dec 2020 12:56:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyB48GLoSLLN8yYRD+dbDksR16DwdSfBGhZ/WcRSvjWjsNVj0mfX0SAKJH/DWv1GhEP0T8aRA== X-Received: by 2002:a7b:c319:: with SMTP id k25mr9111280wmj.142.1609361763191; Wed, 30 Dec 2020 12:56:03 -0800 (PST) Received: from redhat.com (bzq-79-178-32-166.red.bezeqint.net. [79.178.32.166]) by smtp.gmail.com with ESMTPSA id i9sm64608892wrs.70.2020.12.30.12.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 12:56:02 -0800 (PST) Date: Wed, 30 Dec 2020 15:55:58 -0500 From: "Michael S. Tsirkin" To: Arseny Krasnov Cc: Stefan Hajnoczi , Stefano Garzarella , Jason Wang , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] vhost/vsock: support for SOCK_SEQPACKET socket. Message-ID: <20201230155410-mutt-send-email-mst@kernel.org> References: <20201229110634.275024-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201229110634.275024-1-arseny.krasnov@kaspersky.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Dec 29, 2020 at 02:06:33PM +0300, Arseny Krasnov wrote: > This patch simply adds transport ops and removes > ignore of non-stream type of packets. > > Signed-off-by: Arseny Krasnov How is this supposed to work? virtio vsock at the moment has byte level end to end credit accounting at the protocol level. I suspect some protocol changes involving more than this tweak would be needed to properly support anything that isn't a stream. > --- > drivers/vhost/vsock.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c > index a483cec31d5c..4a36ef1c52d0 100644 > --- a/drivers/vhost/vsock.c > +++ b/drivers/vhost/vsock.c > @@ -346,8 +346,7 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, > return NULL; > } > > - if (le16_to_cpu(pkt->hdr.type) == VIRTIO_VSOCK_TYPE_STREAM) > - pkt->len = le32_to_cpu(pkt->hdr.len); > + pkt->len = le32_to_cpu(pkt->hdr.len); > > /* No payload */ > if (!pkt->len) > @@ -416,6 +415,9 @@ static struct virtio_transport vhost_transport = { > .stream_is_active = virtio_transport_stream_is_active, > .stream_allow = virtio_transport_stream_allow, > > + .seqpacket_seq_send_len = virtio_transport_seqpacket_seq_send_len, > + .seqpacket_seq_get_len = virtio_transport_seqpacket_seq_get_len, > + > .notify_poll_in = virtio_transport_notify_poll_in, > .notify_poll_out = virtio_transport_notify_poll_out, > .notify_recv_init = virtio_transport_notify_recv_init, > -- > 2.25.1