Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2146337pxb; Thu, 11 Feb 2021 05:42:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0aLwPniF3xSkL9RaB1/emDXCD547zOR3S3CLzTbiaqD/gePXn7mD5Qwt8UFc9QvAkPJcV X-Received: by 2002:a17:906:33c5:: with SMTP id w5mr8663538eja.319.1613050927680; Thu, 11 Feb 2021 05:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613050927; cv=none; d=google.com; s=arc-20160816; b=EmckdQnevkz+gSsahot/N1QwE5noKJKlbo2m800uqAbH8MdgCIuBq4uqJhmNCBaSyQ tcoCOZpSiR30Y5sw1+q8chGrG5faMgvLGCxWGsIak/0JMmtF1gUjjHJNlxhhB3h3oDYb zl7hDltczfcr/JpdKRNZ9CkZL9AtvdtrdHhZuMoXDKnuKWISc02EPLJY3r1fjUw9djnt baj6DBXqS2KAgVB7hT+1Wu3d6vkFAXz5kXJ6TFWl4sOC86vKJEOQxni6p2nt5zT+Lxmr 8VJs/hi4C/xBlx+7pzftEvP1sxhGXeyeirqEklFNq5+NrIvyeBYp8zmymlGKEflLTQdA C0ag== 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=Hmk14exEuAu1KNsA1eN9M3YU73ik9B3Wqe10eKOKhmo=; b=L+/mIN4F8zSwdRjV3mEHkRMJDEq7fkPcfYfE4P9sODLVEdxRbJLacnkD+dftsJnDml avWejtWH+2P7LVCLtmaEKPRMHhyuLkf071RcjGPLWmNMcArE8rzvceyMNlZDLBxpMgES SvOpH6IFY2YVY4keEYdwd9pu9GMgJsUhdlI6umcLZY8fAi381ewupLrl/xTTHDuxDYCD S6rCptkT1rRDW2pQm09ruU59yCT8PIRW66zIZaPN/cvWY8p2118s7Jf0jM18thcqiFuE IAhZql1jGE8Pvm6Xfg+T5KW3qC5morrYuZSizSGPK7vndI7jL3VZliMEBQmProd0Zi5x AHQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eH7uNJNT; 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 jx6si3730234ejc.37.2021.02.11.05.41.42; Thu, 11 Feb 2021 05:42:07 -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=eH7uNJNT; 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 S231802AbhBKNkK (ORCPT + 99 others); Thu, 11 Feb 2021 08:40:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55842 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231289AbhBKNUj (ORCPT ); Thu, 11 Feb 2021 08:20:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613049550; 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=Hmk14exEuAu1KNsA1eN9M3YU73ik9B3Wqe10eKOKhmo=; b=eH7uNJNTrHC/2bUAM5UTu2sM0WL4Zb9uF6dBNwE/fKDKXspPXbZJ1s3HVPybNgRfGzcdP4 F9lzOhUTcrFUY81g9gfOyeW4U9JzfMKVm91Mm/tRTI66Z/FzyHStow1pZhUbv6fK+5W9za yH0Yk53JhDLB43xLDH24Bo3zKy66KW0= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-602--G6hEfRqNDySzDgq1jgaCA-1; Thu, 11 Feb 2021 08:19:08 -0500 X-MC-Unique: -G6hEfRqNDySzDgq1jgaCA-1 Received: by mail-ej1-f71.google.com with SMTP id yc4so4770781ejb.2 for ; Thu, 11 Feb 2021 05:19:08 -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=Hmk14exEuAu1KNsA1eN9M3YU73ik9B3Wqe10eKOKhmo=; b=BFyktH4VYYfkX5O2zhGbw5VDPAKtShLtZGryFCPGP0klmaxue9oBmiJF0xXTCjEJm4 L5csJnvi2ryJiVucLtr0MB3cRF2jO+iGn4DvU4plPMLDq4BS+ojffhlH860V6Jkd+Psm 6/f3CcZ1imRuI4IVCR2uK5jbu52vbMNpxHj0v2VZ2OhNxltHdjTjWlwYn02wCphwzHtp zSVSfwiGDoNdtJ3QvxHCXXeK2CmC3CG7R2TTfnTyZXnHEYmPfubf+HWMVpi2rFkeQY9c 9ulAUKLE4IOP8uWyA08jDfnhxECZ5ZpDqsCCXEHKnXLW2rKo/hzUi0jP7brCWF88vbgl tf7w== X-Gm-Message-State: AOAM530+HMupjBt965RMO+0QROEaxrSkbp5hJFqTQCAG9qS2NUG/y8fj fZ3NLoXewp0cFTpPln/AJs58hxmuKU37FXboigeMFujwdY2WW4E3f88AypqVcKa5Oaf1is3yK1S B6unuKHhyste+02jWtmaKc5Iw X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr8293106ejb.377.1613049547482; Thu, 11 Feb 2021 05:19:07 -0800 (PST) X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr8293081ejb.377.1613049547302; Thu, 11 Feb 2021 05:19:07 -0800 (PST) Received: from steredhat (host-79-34-249-199.business.telecomitalia.it. [79.34.249.199]) by smtp.gmail.com with ESMTPSA id g22sm4356281ejw.31.2021.02.11.05.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 05:19:06 -0800 (PST) Date: Thu, 11 Feb 2021 14:19:04 +0100 From: Stefano Garzarella To: Arseny Krasnov Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Jorgen Hansen , Colin Ian King , Andra Paraschiv , Jeff Vander Stoep , 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 v4 08/17] af_vsock: update comments for stream sockets Message-ID: <20210211131904.ejkq3gltlqcffduq@steredhat> References: <20210207151259.803917-1-arseny.krasnov@kaspersky.com> <20210207151632.805240-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210207151632.805240-1-arseny.krasnov@kaspersky.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 07, 2021 at 06:16:29PM +0300, Arseny Krasnov wrote: >This replaces 'stream' to 'connect oriented' in comments as SEQPACKET is >also connect oriented. I'm not a native speaker but maybe is better 'connection oriented' or looking at socket(2) man page 'connection-based' is also fine. Thanks, Stefano > >Signed-off-by: Arseny Krasnov >--- > net/vmw_vsock/af_vsock.c | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index c77998a14018..6e5e192cb703 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -415,8 +415,8 @@ static void vsock_deassign_transport(struct vsock_sock *vsk) > > /* Assign a transport to a socket and call the .init transport callback. > * >- * Note: for stream socket this must be called when vsk->remote_addr is set >- * (e.g. during the connect() or when a connection request on a listener >+ * Note: for connect oriented socket this must be called when vsk->remote_addr >+ * is set (e.g. during the connect() or when a connection request on a listener > * socket is received). > * The vsk->remote_addr is used to decide which transport to use: > * - remote CID == VMADDR_CID_LOCAL or g2h->local_cid or VMADDR_CID_HOST if >@@ -479,10 +479,10 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk) > return 0; > > /* transport->release() must be called with sock lock acquired. >- * This path can only be taken during vsock_stream_connect(), >- * where we have already held the sock lock. >- * In the other cases, this function is called on a new socket >- * which is not assigned to any transport. >+ * This path can only be taken during vsock_connect(), where we >+ * have already held the sock lock. In the other cases, this >+ * function is called on a new socket which is not assigned to >+ * any transport. > */ > vsk->transport->release(vsk); > vsock_deassign_transport(vsk); >@@ -659,9 +659,10 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk, > > vsock_addr_init(&vsk->local_addr, new_addr.svm_cid, new_addr.svm_port); > >- /* Remove stream sockets from the unbound list and add them to the hash >- * table for easy lookup by its address. The unbound list is simply an >- * extra entry at the end of the hash table, a trick used by AF_UNIX. >+ /* Remove connect oriented sockets from the unbound list and add them >+ * to the hash table for easy lookup by its address. The unbound list >+ * is simply an extra entry at the end of the hash table, a trick used >+ * by AF_UNIX. > */ > __vsock_remove_bound(vsk); > __vsock_insert_bound(vsock_bound_sockets(&vsk->local_addr), vsk); >@@ -952,10 +953,10 @@ static int vsock_shutdown(struct socket *sock, int mode) > if ((mode & ~SHUTDOWN_MASK) || !mode) > return -EINVAL; > >- /* If this is a STREAM socket and it is not connected then bail out >- * immediately. If it is a DGRAM socket then we must first kick the >- * socket so that it wakes up from any sleeping calls, for example >- * recv(), and then afterwards return the error. >+ /* If this is a connect oriented socket and it is not connected then >+ * bail out immediately. If it is a DGRAM socket then we must first >+ * kick the socket so that it wakes up from any sleeping calls, for >+ * example recv(), and then afterwards return the error. > */ > > sk = sock->sk; >@@ -1786,7 +1787,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg, > > transport = vsk->transport; > >- /* Callers should not provide a destination with stream sockets. */ >+ /* Callers should not provide a destination with connect oriented >+ * sockets. >+ */ > if (msg->msg_namelen) { > err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP; > goto out; >-- >2.25.1 >