Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10831461pxu; Wed, 30 Dec 2020 12:58:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzunt18PvSA87ozJEsciDJguFPnMV8A2gEiMFielAn535E9vt4r+lEkXHsX5TBECz3sOxFy X-Received: by 2002:a17:906:13da:: with SMTP id g26mr49826404ejc.285.1609361934240; Wed, 30 Dec 2020 12:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609361934; cv=none; d=google.com; s=arc-20160816; b=bzP6oAudk0ge3dSs3oWge0pA51GFgmd8sexw2YOJXcFqfBqst0AEvQ7l00PQfzub16 Ig4gsqHlZcwKN/uHTuYdVhBbcIhNPc9OAyFp066KLWK1mjaIRcihAzvykcGLBoT8Lhy3 6xY1pNJxZXBwbgbXOO49LjeEEBF4g9uexzarXj9HMsCI4KERbr8AmMBOv3qrZTW74rnR NT04J+4S+JDX1lRq0kESbdsBWvOp65FL6UIA6eZb99bDMu7+va6GiJCNe3LjCnqJe04M eEtY3ixjxQRIzcXmUJRTDAQnWIJeZGwO2lDskxIKGndvIqQR+K+o916i0WUPyxv9jCuj sgNg== 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=iFlZtz74xmTz/ktSlcFt8gctOusgNHUwrHkjcpUKl9Y=; b=c2UoMrHANKCQVs/cQfR8FlTbk+DQuwrY3cjgNuHzQTRlEdpATLBUolLdA7lUi1ZlJL R3WekKq9xs261V9gDxZw8bvNHODUUpcLuyQK+rTygHe08zA/RWRyKOzgVOSE6lm22SL6 uj4wINHnwq79LcuLPYIz80AwTDWEMiSgVJy9U8rX4Xexq2JbqN7nJS3Pedhfaa5xsxlb UX0p2qcT6ZcNYLyXnFmuy2+Y8AlFDkF4ow1j77GrYTkj/Go08a7/9nBkO3ZlD3j9L9k9 yEFwBiu0n8eLnyySbED4CV9Pyg4M2r6Bk2iemtt+eooPjdJj029U+ghsnGejteXcbY/4 sCzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IAFjOFKT; 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 u9si23526182edd.26.2020.12.30.12.58.32; Wed, 30 Dec 2020 12:58:54 -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=IAFjOFKT; 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 S1726567AbgL3U5e (ORCPT + 99 others); Wed, 30 Dec 2020 15:57:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:27765 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbgL3U5d (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-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-ZIU9BJcdMDm9wtkBGgZnqw-1; Wed, 30 Dec 2020 15:56:04 -0500 X-MC-Unique: ZIU9BJcdMDm9wtkBGgZnqw-1 Received: by mail-wr1-f70.google.com with SMTP id r8so9265490wro.22 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=HnFE/texySY358X+5GvUZWBVeFCmN7agbYC8R609cMPFDNOWz39lX+HP1M0qa16I4Q r815LEA7y1AJFfXSkiYdBOEnJR61mWzW1rZg544rNOYNt7fpwC2sCGHtpoSIYbToHMHQ yZR4Skmd5svlLG8k83EzYjLxD2Q2aBl9cLclPhSctAqPnDoGAC8uI+HzZbgps0ZPXR7l aNf9W7iDVwBnGH0jm+8AmMuHAqkOo4DBdfByFAU57d2AVDBpj7yIfh4X8fxqRTpfcmkn 4YkcgFlnvYn2+4FyrXISlEI2X1nb/4Lw530eyQgPzCS26o+4Z+12S1MSM6GuRlsRQw0+ TSMw== X-Gm-Message-State: AOAM53370RoQdmQ6IDKZ4hxXr+7sbJmVktJpFUOpKv7/ZIetibI41239 HFYAPZnA8UfglCiop9sgz83G02lT+MDBj85u7Ly9a6oeJI+N/0UX+No9GokMw/u4X7xBuJojzS+ zvV0oI0uO1WKjpFkhTKz2b9lr X-Received: by 2002:a7b:c319:: with SMTP id k25mr9111292wmj.142.1609361763379; Wed, 30 Dec 2020 12:56:03 -0800 (PST) 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: linux-kernel@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