Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13440870pxu; Sun, 3 Jan 2021 15:15:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvAOMKB+klpsw+bBPXT/nIwKhSmvslYL/ddHFpTB9CF2/DY9U3JYQ3aAJGVppXtWuk7qxc X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr64401634ejb.132.1609715756521; Sun, 03 Jan 2021 15:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609715756; cv=none; d=google.com; s=arc-20160816; b=b0QxINzsxuYfc2qVwZx8n5JQ5xwZfAtqKLtA6IEnzUpWIYLOQCui6DYOJDUIR5wQJ5 MK44Xz1SP0Bw9pDvaZLQmZfddsvVHWNO5zmON8n0/Qbxyfuhe9HpScGyRgXKQAYwmSbF fTzydCfIzPRk3n6gVPJ8VQLWTRVOLYDNtVQlhAP4UIlFXcXsOz1TT8RZVcpE5D14R9vU ifstvgnJFaT1d9E/9NT9C+sC4e9Zlek5FflAqSJ33RVyO0U5ZYLron3Lkv6S8WWfbhL1 Y6HzdCT6zMGjiQNhc1i/mkUjQXbYVpta97/txpVWiPoHxrlZLeXUFlOiGTv7eQA9ernz meow== 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=JpyCmtxEdI8Td/OU+MHa2hHDzXpkg7mVDuvl2393vs8=; b=xjR2DRih+pX6zcOtrYMEykFUZQYTGFMfnyzvQWZ/pDRCzJdli13sXV1UhCJzfwnkcV +g74NdK2P3Wc5DZSRwMNNxK/sY+x/GFuqKcYsuHpjUAYDgTBLes9Z7HJqFr1S7yu/IOt n5QP9vajVKsx/Vc+R7VOeBFraufQ/api3MjfZiHaGO5j5hIbe37/oZGOg13sd5pKycZD ompZTgWRMmlpKWwXl40a35AheOm4tx7PE7GjPzVOq2seDHyrfX1VxvEh6Vha548SLnyS AG9LteqinL0RXPwL4pW9RF/F4an0Ka+hizFLnnOeLqnBG73n6teRvMAE3Qe9cPccckRA wzGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=QUSdve57; 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=yandex.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si19001494edd.53.2021.01.03.15.15.33; Sun, 03 Jan 2021 15:15:56 -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=@yandex.ru header.s=mail header.b=QUSdve57; 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=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727658AbhACVYW (ORCPT + 99 others); Sun, 3 Jan 2021 16:24:22 -0500 Received: from forward106p.mail.yandex.net ([77.88.28.109]:52947 "EHLO forward106p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727520AbhACVYU (ORCPT ); Sun, 3 Jan 2021 16:24:20 -0500 X-Greylist: delayed 458 seconds by postgrey-1.27 at vger.kernel.org; Sun, 03 Jan 2021 16:24:18 EST Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 40CFF1C81615; Mon, 4 Jan 2021 00:15:56 +0300 (MSK) Received: from vla1-5c8ce23a551e.qloud-c.yandex.net (vla1-5c8ce23a551e.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:400d:0:640:5c8c:e23a]) by forward100q.mail.yandex.net (Yandex) with ESMTP id 3A7B47080002; Mon, 4 Jan 2021 00:15:56 +0300 (MSK) Received: from vla1-cde8305024b9.qloud-c.yandex.net (vla1-cde8305024b9.qloud-c.yandex.net [2a02:6b8:c0d:4201:0:640:cde8:3050]) by vla1-5c8ce23a551e.qloud-c.yandex.net (mxback/Yandex) with ESMTP id Zmbgus4Wxf-FtD043si; Mon, 04 Jan 2021 00:15:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1609708556; bh=JpyCmtxEdI8Td/OU+MHa2hHDzXpkg7mVDuvl2393vs8=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID:Cc; b=QUSdve57xiAIK6nfNnmsduZzIzJ5chendnc3wKtoa8eWhSY9O7orI/KCclFX6gEYV 0orSD1kyKUoAKBjnmQRZ8+hmtHz0ABM8xwjpEDDH4pTCF8z35Trdmu/LOkFjdDeIz7 9Dmr2WKXhf+yLbw+B79VsaWZBPL0kozBl2AYyiGM= Authentication-Results: vla1-5c8ce23a551e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by vla1-cde8305024b9.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 5b7UsktbHB-FsIS2kxr; Mon, 04 Jan 2021 00:15:55 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: [PATCH 4/5] af_vsock: add socket ops for SOCK_SEQPACKET. To: Arseny Krasnov , Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Andra Paraschiv , Jorgen Hansen , Arseniy Krasnov , Colin Ian King , Jeff Vander Stoep Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210103195454.1954169-1-arseny.krasnov@kaspersky.com> <20210103200421.1956545-1-arseny.krasnov@kaspersky.com> From: stsp Message-ID: Date: Mon, 4 Jan 2021 00:15:53 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210103200421.1956545-1-arseny.krasnov@kaspersky.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 03.01.2021 23:04, Arseny Krasnov пишет: > From: Arseniy Krasnov > > --- > net/vmw_vsock/af_vsock.c | 107 +++++++++++++++++++++++++++++++++------ > 1 file changed, 91 insertions(+), 16 deletions(-) > > diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c > index 7ff00449a9a2..30caad9815f7 100644 > --- a/net/vmw_vsock/af_vsock.c > +++ b/net/vmw_vsock/af_vsock.c > @@ -452,6 +452,7 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk) > new_transport = transport_dgram; > break; > case SOCK_STREAM: > + case SOCK_SEQPACKET: > if (vsock_use_local_transport(remote_cid)) > new_transport = transport_local; > else if (remote_cid <= VMADDR_CID_HOST || !transport_h2g || > @@ -459,6 +460,12 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk) > new_transport = transport_g2h; > else > new_transport = transport_h2g; > + > + if (sk->sk_type == SOCK_SEQPACKET) { > + if (!new_transport->seqpacket_seq_send_len || > + !new_transport->seqpacket_seq_get_len) > + return -ENODEV; Is ENODEV the right error here? Just a quick look at a man page, and I am under impression something like EPROTONOSUPPORT or ESOCKNOSUPPORT may suit?