Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp550086pxf; Thu, 25 Mar 2021 09:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl+s8VXJl5YXsxueqe7Tgd7f3bgD58/Oy0imvQSEVo34y/x4bTUaEdyw7AKhedAOZicGLQ X-Received: by 2002:a17:906:c099:: with SMTP id f25mr10481678ejz.141.1616688401282; Thu, 25 Mar 2021 09:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616688401; cv=none; d=google.com; s=arc-20160816; b=IzbiSVx5mW9GBPZ3Xkh986BKeNJQA5L/dF1jMWE+ttNYklaHWSEXXUUIaiWkRXJ2H1 FMrEyqMGX42CJZBOJQ/hgRfDuOlbZyfW8bPmfcCm9B6vrECukksUDdOdvwWZZGD0DUll w4f0KLg2PO3eENeVIMpN5Tn1TbrHpYOgmWErUb68G7MexqMt3/o+E1ryy2lapntUE9Ma ivFZTWfWJ+hLs6kbUBx+vbp4Dmjt9/BEYcPBf1ZO2dSLLcIF8GPss6I5vjFmCipf3DUU ztW8GpQV/kMb1/uMXDc7i/8wA59jI+pU23av7AwLPGi7aQlIOb2XbXh+AY0Nww7vuryi fDLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=DJ7GiyTew++J90qV1Gfa/LTSfJ0LcIYCC/eHcrRH4ig=; b=scoJGDW0lCsbz8GO4ftsHGt4cl5LHw/BIdk+TgRnSKWfhdq3y++k34W1eU5gWXfJi8 TZ60LtiQk4Lpf6F2ceaIG61Mh/4hBP4aIt522mzvSNH5AG+qOXsNzgafDml6JhtNc9Ob DZ0D0uYWC9otMWc/GBdy46VbzG4JEQOLGCIPmpx1NwxSAxXfyFn40dk833Au2QCqyBve u0fXLDgH1WM4xXQVAuMhWsDHDCA5y5LtvEbmJmNW2lTllO3mMaOx3K/jeNgLY+nwDUtu aQXuVQ/C02Dplc9JmWDmQHAAzwgLpqueCXdGbVn8OlodwFSMFhNaQOgmS4Pp9kApQdDk 6A1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b=eWMqYEil; 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=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si4463695edh.186.2021.03.25.09.06.17; Thu, 25 Mar 2021 09:06:41 -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=@kaspersky.com header.s=mail202102 header.b=eWMqYEil; 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=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbhCYQFS (ORCPT + 99 others); Thu, 25 Mar 2021 12:05:18 -0400 Received: from mx12.kaspersky-labs.com ([91.103.66.155]:37244 "EHLO mx12.kaspersky-labs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhCYQE5 (ORCPT ); Thu, 25 Mar 2021 12:04:57 -0400 Received: from relay12.kaspersky-labs.com (unknown [127.0.0.10]) by relay12.kaspersky-labs.com (Postfix) with ESMTP id 0288877588; Thu, 25 Mar 2021 19:04:55 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202102; t=1616688295; bh=DJ7GiyTew++J90qV1Gfa/LTSfJ0LcIYCC/eHcrRH4ig=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type; b=eWMqYEilOnMEkmu5owDDSz1QrSJ1S6Jef1+Twiz/DJ5mONaqcJDmwCRITlVDicg79 yPlESp/mBXalWygX7kh3oBoqEX86x479hES9unR39IAfYgXFxo4lYXVbR203IzseoZ 3dRHN490yF2MYMBiL9YUCn8LR9GphPehrAYqFR4abSIn0CUnMly2YY6M6i+IquQxnQ R54aQ8iU+iOluuQdvtKTCWtre9LiS/Hggjr820bxCLWOiAzQ3WwikSXTphj0j4yJpU 9GCM5vihrzfcxT4QHcoDqnQxBF3k3Ys/JGnpdsPdYfDLVJBxtPAsNCrt/E0D8CKPqE m6TFvlKPE+vog== Received: from mail-hq2.kaspersky.com (unknown [91.103.66.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client CN "mail-hq2.kaspersky.com", Issuer "Kaspersky MailRelays CA G3" (verified OK)) by mailhub12.kaspersky-labs.com (Postfix) with ESMTPS id B6EE27758B; Thu, 25 Mar 2021 19:04:54 +0300 (MSK) Received: from [10.16.171.77] (10.64.68.128) by hqmailmbx3.avp.ru (10.64.67.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 25 Mar 2021 19:04:53 +0300 Subject: Re: [RFC PATCH v7 17/22] vhost/vsock: setup SEQPACKET ops for transport To: Stefano Garzarella 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" References: <20210323130716.2459195-1-arseny.krasnov@kaspersky.com> <20210323131421.2461760-1-arseny.krasnov@kaspersky.com> <20210325104205.y5z6qjv5g2kzvj3m@steredhat> From: Arseny Krasnov Message-ID: Date: Thu, 25 Mar 2021 19:04:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210325104205.y5z6qjv5g2kzvj3m@steredhat> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.64.68.128] X-ClientProxiedBy: hqmailmbx2.avp.ru (10.64.67.242) To hqmailmbx3.avp.ru (10.64.67.243) X-KSE-ServerInfo: hqmailmbx3.avp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 03/25/2021 15:37:01 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 162675 [Mar 25 2021] X-KSE-AntiSpam-Info: LuaCore: 438 438 e169a60cee0e977a975a890ed8ef829a2851344a X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: arseny.krasnov@kaspersky.com X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;kaspersky.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 03/25/2021 15:40:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 25.03.2021 15:18:00 X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KLMS-Rule-ID: 52 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, bases: 2021/03/25 14:47:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2021/03/25 13:43:00 #16496755 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.03.2021 13:42, Stefano Garzarella wrote: > 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". Ok, no problem > > 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 >> >