Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4595477rwb; Mon, 8 Aug 2022 04:03:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZLoIg3WWLDeBjhU5q7F9vqvLgAnOubTdKiz6qB/brxe3OznhEjeYiLHmY68SIN/BQC3wf X-Received: by 2002:a50:fb10:0:b0:43d:561a:c990 with SMTP id d16-20020a50fb10000000b0043d561ac990mr17040310edq.115.1659956624484; Mon, 08 Aug 2022 04:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659956624; cv=none; d=google.com; s=arc-20160816; b=IWbFWaBY+vAYZsPtgM58f+uoP4MCiAOix1dzzeHdqFTErNjE12kg2rIWLnzDBO79WU p4tEBLlXBNvyvTl+Scga0+DXsVksFg3Guvmheum/NWHaUtrLLw++eMzQ57OEvIIexFoD xW7upH43JRaL8/xUnfIKQn7Hi9yAZONY3u4DEfmSdKfR5sXWj0HWu0CXmoNg4O1EFzJm HNsXR4clRy0CVyn2roFMM+3oIv5Hn7rZhy3BWXYxrxg4Di9BF+YwxYZBDi8sgRddLIlu d2vUMq7X9iQw382JKbIagryNGYKoe5Sh9pKs/CBbw+6odjZCd/vCphOr5r/iPp08KJaB jPnw== 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=cqTZfTOpSZv/oxvZyQIT3dmO6v6DeAZnUAfnA5NVFOM=; b=wWNUqrM7jz/FIZtfDXFFa6ZR37OP1jUU1Gy3X0aDrGCKQsgrlPm7gLcJfMGDPJwf8o WYj30mkfBNeuHu4I0iBXcITusGcNsHMc9ifrPgInthsp5t0xfnFjIHTSx9wij8QxP/58 jTc3VH4SNyb/i70x3K/wRNNnenizrR7HFFJ2GTA648J1ZvkOqxycqFqkf9X8r+HAUaMX B6gQof2fRc3pkdJ0IoM5buE5C8p8y17r50o+qKKbZ05x+0iQ3MDL5iQVRu90IeEFTdyq 3Cy9X0mqrIT2y80HW9wgStOvAQICxL1qpO+eYCtHn9905/Hrg3iBqiOafoh3/lovhJwK vaTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hgAr4wdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne4-20020a1709077b8400b0073160e4227csi2583226ejc.489.2022.08.08.04.03.17; Mon, 08 Aug 2022 04:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hgAr4wdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236047AbiHHKyC (ORCPT + 99 others); Mon, 8 Aug 2022 06:54:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234608AbiHHKyA (ORCPT ); Mon, 8 Aug 2022 06:54:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 03867189 for ; Mon, 8 Aug 2022 03:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659956038; 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=cqTZfTOpSZv/oxvZyQIT3dmO6v6DeAZnUAfnA5NVFOM=; b=hgAr4wdAB7n99/kjR2gXD1uCd/g3qvycybsjMOwW6aQokcGIIMuvMepWI3tLEupgorQSX0 zNako5IxOKOJSucEq3e3MFRlZ53ho25bdempIFgbGJnCcCkPb11BpG24oHBO2pCtNad4PF fqo3kuv/HuNlvEqpdnmlQq9nbFVo654= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-rDxJh4YCNpCaihN57TBSEw-1; Mon, 08 Aug 2022 06:53:57 -0400 X-MC-Unique: rDxJh4YCNpCaihN57TBSEw-1 Received: by mail-qk1-f199.google.com with SMTP id bp14-20020a05620a458e00b006b959ef9d51so1306185qkb.12 for ; Mon, 08 Aug 2022 03:53:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=cqTZfTOpSZv/oxvZyQIT3dmO6v6DeAZnUAfnA5NVFOM=; b=viEVTSd624UrNKxxdKLHLZ8ID+oblfmXnPvnJ4y2r/VuetTYGBGJT7+smxZYbY0xWY pVx8aSTna/jGEmWBwhRQfqhXiaoQmWNAGmz2Nu8aj0ovNbRi120o2oxrKvhx8UPg2PNF mSXszU/wMRQJ/0Bi5LBQ5sIW0LYF6GLX7ZvyMSTUI6ilK33nAl39TqhgqVRqciiGMgHH XyMe+U5VkUFuvlotUmtCv/3ExoTRGKN6AoVX315hrweuLchzJb34l7PaVvpM8+Jx6Ewz LJV4WUrxYj374FnagUGySUP56VyBJJXEjZYaCgiZfu99MIvsxkEWYn6hrkYOSYsOZWwV RFhA== X-Gm-Message-State: ACgBeo3+if4w0CfMD8ihgSTuJ0AUkwH4K/Y5MreN+J6ohccfAYLyLUJu ckNpliGGcQKnG9/x02h6blJGDYl4jpVS06/jrXLjOBQULZ4fm/TLf5alIfwj5OCN6iBIVUSfYiN mMwxvJNpYPpCKQcSaN0wFLg5b X-Received: by 2002:a05:620a:f8f:b0:6b5:be6c:255e with SMTP id b15-20020a05620a0f8f00b006b5be6c255emr13571452qkn.638.1659956036589; Mon, 08 Aug 2022 03:53:56 -0700 (PDT) X-Received: by 2002:a05:620a:f8f:b0:6b5:be6c:255e with SMTP id b15-20020a05620a0f8f00b006b5be6c255emr13571431qkn.638.1659956036378; Mon, 08 Aug 2022 03:53:56 -0700 (PDT) Received: from sgarzare-redhat (host-79-46-200-178.retail.telecomitalia.it. [79.46.200.178]) by smtp.gmail.com with ESMTPSA id az38-20020a05620a172600b006b8619a67f4sm8787400qkb.34.2022.08.08.03.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 03:53:55 -0700 (PDT) Date: Mon, 8 Aug 2022 12:53:45 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: "David S. Miller" , "edumazet@google.com" , Jakub Kicinski , Paolo Abeni , "kys@microsoft.com" , "haiyangz@microsoft.com" , "sthemmin@microsoft.com" , "wei.liu@kernel.org" , Dexuan Cui , Stefan Hajnoczi , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers , Krasnov Arseniy , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , kernel Subject: Re: [RFC PATCH v3 6/9] vsock: add API call for data ready Message-ID: <20220808105345.vm7x6nzbi4ss7v6j@sgarzare-redhat> References: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 03, 2022 at 02:01:57PM +0000, Arseniy Krasnov wrote: >This adds 'vsock_data_ready()' which must be called by transport to kick >sleeping data readers. It checks for SO_RCVLOWAT value before waking >user,thus preventing spurious wake ups.Based on 'tcp_data_ready()' logic. > Since it's an RFC, I suggest you add a space after the punctuation. :-) The patch LGTM: Reviewed-by: Stefano Garzarella >Signed-off-by: Arseniy Krasnov >--- > include/net/af_vsock.h | 1 + > net/vmw_vsock/af_vsock.c | 10 ++++++++++ > 2 files changed, 11 insertions(+) > >diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h >index eae5874bae35..7b79fc5164cc 100644 >--- a/include/net/af_vsock.h >+++ b/include/net/af_vsock.h >@@ -77,6 +77,7 @@ struct vsock_sock { > s64 vsock_stream_has_data(struct vsock_sock *vsk); > s64 vsock_stream_has_space(struct vsock_sock *vsk); > struct sock *vsock_create_connected(struct sock *parent); >+void vsock_data_ready(struct sock *sk); > > /**** TRANSPORT ****/ > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index 3a1426eb8baa..47e80a7cbbdf 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -882,6 +882,16 @@ s64 vsock_stream_has_space(struct vsock_sock *vsk) > } > EXPORT_SYMBOL_GPL(vsock_stream_has_space); > >+void vsock_data_ready(struct sock *sk) >+{ >+ struct vsock_sock *vsk = vsock_sk(sk); >+ >+ if (vsock_stream_has_data(vsk) >= sk->sk_rcvlowat || >+ sock_flag(sk, SOCK_DONE)) >+ sk->sk_data_ready(sk); >+} >+EXPORT_SYMBOL_GPL(vsock_data_ready); >+ > static int vsock_release(struct socket *sock) > { > __vsock_release(sock->sk, 0); >-- >2.25.1