Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp266761pxf; Thu, 25 Mar 2021 03:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3D2rbCQp9grCmhYk2jZaf8Xyu/sLbUfnRHDRS7L1kTnjEdSfJ12BkjrCIjh2PE9U9Etg X-Received: by 2002:a05:6402:510f:: with SMTP id m15mr8439759edd.328.1616669050204; Thu, 25 Mar 2021 03:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616669050; cv=none; d=google.com; s=arc-20160816; b=quypYtUJwY49AD9RJCtkuU7hJpAD67uan08aguFQFTUhWJOFesFY8mpiQmAp2hNRoD iJ6MPJ4i7b97J0gt2K0Nge6daCGRsJk/oJJQ8qv071NaBOqM/I5rByiP0pyI8MnygOJc E7at5C5Kss9+ueIUfCD71zNEsWM+obwO3yUdhqFHc7RIjrfQYVsqAVMd+G4f3ze9xIi3 C+JGMDPTqp9OTGvRaoqJRW8f2djnVwThzmLeirDHzez7wbCPwBOFiH4PxuJVZdeWrHRh XI2YfZB1tyXN1L2DGusjiE3XXhglL1lhJAbAy5CJChMbQwIwzVPKme8tXHjJUBT+jUe1 3EGQ== 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=aQDI6ul2y7LDTOrys0NWj2wyx1hXa7tSyglML0bhC18=; b=ZZx29Cq6Wmi+ohX5uz0yaIIcN7jmcKK6upv7lDX6oNKUz7h3YbYwUc6i69IFARkaZM N+/MbHcIb+5WKKubnjnStS/xfBytWlioCdAz6oTvpL5kcRBUf4IC4uoQbRov+WP7Ak8Q wAmmwa9x7tpQpH2OWRHt18zjH16/n50q6xLe/QVGw9VrE94ZpynW4e2DcRF/Vt6YIK6U dGT5wcZapAQbsqopVFaGeDfOoOzvBZVnFNPQ/V9qI807i5AMoJc5Z09G3B/031guf566 FJCz/YbdvZE3PK3VhqMaex3vhBd3ppAuUAvj+61ym+3R9KTw5rQLcfFT9dOMLMTyfWNQ ZMAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KchhdeGf; 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 y5si3584422edw.446.2021.03.25.03.43.42; Thu, 25 Mar 2021 03:44:10 -0700 (PDT) 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=KchhdeGf; 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 S230156AbhCYKmh (ORCPT + 99 others); Thu, 25 Mar 2021 06:42:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53310 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbhCYKmL (ORCPT ); Thu, 25 Mar 2021 06:42:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616668931; 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=aQDI6ul2y7LDTOrys0NWj2wyx1hXa7tSyglML0bhC18=; b=KchhdeGfkta7UjzBaNgoi/j/pZtgG3NjgR/rt4JDX9XQs3yTi5JPYx9IM09ZgE6hAVSQtg KgxiMfUZcsPp5Af0VB0rF/git+pGcnFQFcGXJSuKkcBA8CVMXYbAz4yTelCXDq90YbK1Yx DtZbxLoa/WeTwt0nEJknzAbmRZiWBj0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-ukc6U82mOO2oA8iYpCn8Qg-1; Thu, 25 Mar 2021 06:42:09 -0400 X-MC-Unique: ukc6U82mOO2oA8iYpCn8Qg-1 Received: by mail-wr1-f72.google.com with SMTP id f3so2448839wrt.14 for ; Thu, 25 Mar 2021 03:42:09 -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; bh=aQDI6ul2y7LDTOrys0NWj2wyx1hXa7tSyglML0bhC18=; b=q9S67l1AyLBpTYm1uDL5NN4sSCTTpOdI6bRLhvScE+qCQtMYCuYED7JD75RdvQqvam +6esFOA+5ChFSmEiv/i6NpvNdRaF0yVg8eiGpv4kVwnaH7yOJwj1V0M/wxidRqTzjG7a v0Xgn3g5z5TtpCZfyRys2uPZXBiA/xHeDIodmQmrcBH0XQd4xmUAuolh+4bA3Y+ijzUk zBGQpzjgaLT/Wdrq33r5gTeEQkHUZllVr9yvPnerYnpBz8XvSBpqmgE8sY/TwwOXZd+m eHbIpY+e2v7bhVhWRdV0475O3+6EWvBDDwU+SfbQDb7+FARUu0lMArLD5KXYHjYEIpm+ 6ZDQ== X-Gm-Message-State: AOAM531sBrdT1jCeD+X8/SYG0jXjoCh7XvehS5LRu1FzpUb8nGtvo2xT 11Ru5L2S7uhqCs00Rb6eplJcgCKgLuZfBIwEG/cGL7birpICKtx4S6u0tkug/hX7noiEZEZoQKV HuUTj9V8wIAjiTFhmtDFNdKsV X-Received: by 2002:a05:600c:3506:: with SMTP id h6mr7332005wmq.168.1616668928292; Thu, 25 Mar 2021 03:42:08 -0700 (PDT) X-Received: by 2002:a05:600c:3506:: with SMTP id h6mr7331961wmq.168.1616668927966; Thu, 25 Mar 2021 03:42:07 -0700 (PDT) Received: from steredhat (host-79-34-249-199.business.telecomitalia.it. [79.34.249.199]) by smtp.gmail.com with ESMTPSA id p18sm6580970wrs.68.2021.03.25.03.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 03:42:07 -0700 (PDT) Date: Thu, 25 Mar 2021 11:42:05 +0100 From: Stefano Garzarella To: Arseny Krasnov Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Jorgen Hansen , Andra Paraschiv , Norbert Slusarek , Colin Ian King , Jeff Vander Stoep , Alexander Popov , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stsp2@yandex.ru, oxffffaa@gmail.com Subject: Re: [RFC PATCH v7 17/22] vhost/vsock: setup SEQPACKET ops for transport Message-ID: <20210325104205.y5z6qjv5g2kzvj3m@steredhat> References: <20210323130716.2459195-1-arseny.krasnov@kaspersky.com> <20210323131421.2461760-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210323131421.2461760-1-arseny.krasnov@kaspersky.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 04:14:18PM +0300, Arseny Krasnov wrote: >This also removes ignore of non-stream type of packets and adds >'seqpacket_allow()' callback. > >Signed-off-by: Arseny Krasnov >--- > drivers/vhost/vsock.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) Same thing for this transporter too, maybe we can merge with the patch "vhost/vsock: SEQPACKET feature bit support". Stefano > >diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c >index 5e78fb719602..5af141772068 100644 >--- a/drivers/vhost/vsock.c >+++ b/drivers/vhost/vsock.c >@@ -354,8 +354,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) >@@ -398,6 +397,8 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock) > return val < vq->num; > } > >+static bool vhost_transport_seqpacket_allow(void); >+ > static struct virtio_transport vhost_transport = { > .transport = { > .module = THIS_MODULE, >@@ -424,6 +425,10 @@ static struct virtio_transport vhost_transport = { > .stream_is_active = virtio_transport_stream_is_active, > .stream_allow = virtio_transport_stream_allow, > >+ .seqpacket_dequeue = virtio_transport_seqpacket_dequeue, >+ .seqpacket_enqueue = virtio_transport_seqpacket_enqueue, >+ .seqpacket_allow = vhost_transport_seqpacket_allow, >+ > .notify_poll_in = virtio_transport_notify_poll_in, > .notify_poll_out = virtio_transport_notify_poll_out, > .notify_recv_init = virtio_transport_notify_recv_init, >@@ -439,8 +444,14 @@ static struct virtio_transport vhost_transport = { > }, > > .send_pkt = vhost_transport_send_pkt, >+ .seqpacket_allow = false > }; > >+static bool vhost_transport_seqpacket_allow(void) >+{ >+ return vhost_transport.seqpacket_allow; >+} >+ > static void vhost_vsock_handle_tx_kick(struct vhost_work *work) > { > struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, >-- >2.25.1 >