Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4591845rwb; Mon, 8 Aug 2022 04:00:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6+9eZswsl4zlqAeqo5RxCoAs+KnvwJW72TXojUr2tm3YVSEC4eBXCCvGS47w36RqtB4/I+ X-Received: by 2002:a05:6402:e08:b0:43a:f435:ff1a with SMTP id h8-20020a0564020e0800b0043af435ff1amr17657210edh.123.1659956447618; Mon, 08 Aug 2022 04:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659956447; cv=none; d=google.com; s=arc-20160816; b=Ixs+g7vVT378R0VeMyQRHPnuYXLHevG+bV2E44c6ZDrW504IYAc9+VomXVAEaHbsFs +VfROxrgVLJ5Xb312isFFX1xvVi7LNDIYZCYVzXVEcenvT7Dwb1EZtqMusHMpjSPnj50 mGC1q80I2DbhP7Y6mWPZ9KbCjEHPv61qUy6VRrOuP1+LSRbiufALUfn+/LTqGMfrwx7+ bDLyx1ISCbrww8dOSmefo9wFrY2n6O01NfOpE6WgD6KBTSmKe6jxBbO9+H5UPpeCUldX 2awMyclz1phC+4ixbdYR4Czzu0K+WcZ65bFUQ0LAwkk7HCgDfK7kMmN+tKGbgWsqsfGO nzrw== 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=zJ1tVOq7gmtva8bvG4/tC19zWSGUYjLfZNUM1FdlBcA=; b=qDG85izAbT7lXqmHMmhwO0nQB4rO6VoEn+ZnDgnyMyAvnfqhaNoXTmdk7IZusex4Zt t0GX66jvDrZfkCcxEujRVLLybUTAXo3O2j3z07JWL67Tue14c+gd8O1u7bH5YN44vZtg q4ior+tOsIVccSUNDbn3+w4TZVsylvunALNgAMWvLEAqp13jIy+wyXyWoC6siO1Y64nj ga9Kvk6Jy8YXbEso6Y00DaQqAs7T7UdgKPOmVEsluG+SFejsfsPWRD8Ut1cP7XUs4wR8 WjaaRc3aYtu17BcYjOPeapWj6cMjGy8PQ5gb52wsw1nRqmkfrKdYHGyNoDtKDWwE6wxE NDjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aq79ZUAN; 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 o3-20020a170906974300b007308f78bb11si10925577ejy.414.2022.08.08.04.00.21; Mon, 08 Aug 2022 04:00:47 -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=aq79ZUAN; 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 S242586AbiHHKge (ORCPT + 99 others); Mon, 8 Aug 2022 06:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242576AbiHHKga (ORCPT ); Mon, 8 Aug 2022 06:36:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1581113F6E for ; Mon, 8 Aug 2022 03:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659954983; 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=zJ1tVOq7gmtva8bvG4/tC19zWSGUYjLfZNUM1FdlBcA=; b=aq79ZUAN4Q/3jZSK73nD1tswjVjkp1gOUzTNxXoDmq1GDy6TNWv1Dj0XZocq3ZnovLw9Ai Pdk/2DFZd8i1IC7zeq4ylI7E/nqFBIaSvhEFZqRd7KvQviwAHwb9JcDaKq0hY8tuqULzHf bldLYrs1B8qK7Yba+GK7q1XqoxQll50= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-389-xRuWAwepOKSAgI1gmJZiYQ-1; Mon, 08 Aug 2022 06:36:22 -0400 X-MC-Unique: xRuWAwepOKSAgI1gmJZiYQ-1 Received: by mail-qv1-f72.google.com with SMTP id np4-20020a056214370400b00476809b9caeso4238370qvb.0 for ; Mon, 08 Aug 2022 03:36:22 -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=zJ1tVOq7gmtva8bvG4/tC19zWSGUYjLfZNUM1FdlBcA=; b=ZUwnMlqI+DXTKoiltCxxPZGkElVCEkhVRgmy5G3LKIjaQGd/vxfd7M+3mjfWNupURP c6dRjHM8XHwhNjdWFKQxNjf8sAR2aCS6yUtjokSKcWHBSi8fbZ1VqBr4mIbhM2qlCV6E IQ2NYTh2oQ30jQdkVN24spQb956yatV70OayLQ1gkMw2vB+g7TSLJnV3L1CdMfm43xJX IQJyZGU86P9f8UnvH6lt3W2QlFKmO7kTnUd6S4PnVPoCpiItfDupNeIS4OlEwsMkmXYz gOOt5AbsAgT6zBk1Ux0SI8afVz9p8bm+ND9qv0M7hjfDAztwp1VNdH4H3uxutezk6LEh uwXw== X-Gm-Message-State: ACgBeo3FOlOmO047nJL9+dtP16xhCc0BnY/lZoLqp2vBxNSwTG5HPUiQ 9YJ7+atKo/Fz90a/gIVPT63s3x7gI/dFCojcwr5m8mb0mKA9hgkHEWjlx++TaW71iGhvVD+bKSU d5+RyGZtqrSq8dhrzjC1FKcdy X-Received: by 2002:a05:622a:180e:b0:31f:d9b:5d08 with SMTP id t14-20020a05622a180e00b0031f0d9b5d08mr14833995qtc.361.1659954982344; Mon, 08 Aug 2022 03:36:22 -0700 (PDT) X-Received: by 2002:a05:622a:180e:b0:31f:d9b:5d08 with SMTP id t14-20020a05622a180e00b0031f0d9b5d08mr14833976qtc.361.1659954982116; Mon, 08 Aug 2022 03:36:22 -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 m22-20020ac866d6000000b0031f229d4427sm7582235qtp.96.2022.08.08.03.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 03:36:21 -0700 (PDT) Date: Mon, 8 Aug 2022 12:36:11 +0200 From: Stefano Garzarella To: Arseniy Krasnov , Bryan Tan , Vishnu Dasa , VMware PV-Drivers Reviewers 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 4/9] vmci/vsock: use 'target' in notify_poll_in callback Message-ID: <20220808103611.4ma4c5fpszrmstvx@sgarzare-redhat> References: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> <2e420c8e-9550-c8c5-588f-e13b79a057ff@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <2e420c8e-9550-c8c5-588f-e13b79a057ff@sberdevices.ru> X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 01:57:54PM +0000, Arseniy Krasnov wrote: >This callback controls setting of POLLIN,POLLRDNORM output bits of poll() >syscall,but in some cases,it is incorrectly to set it, when socket has >at least 1 bytes of available data. Use 'target' which is already exists >and equal to sk_rcvlowat in this case. Ditto as the previous patch. With that fixed: Reviewed-by: Stefano Garzarella @Bryan, @Vishnu, if you're happy with this change, can you ack/review? Thanks, Stefano > >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/vmci_transport_notify.c | 8 ++++---- > net/vmw_vsock/vmci_transport_notify_qstate.c | 8 ++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c >index d69fc4b595ad..852097e2b9e6 100644 >--- a/net/vmw_vsock/vmci_transport_notify.c >+++ b/net/vmw_vsock/vmci_transport_notify.c >@@ -340,12 +340,12 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, > { > struct vsock_sock *vsk = vsock_sk(sk); > >- if (vsock_stream_has_data(vsk)) { >+ if (vsock_stream_has_data(vsk) >= target) { > *data_ready_now = true; > } else { >- /* We can't read right now because there is nothing in the >- * queue. Ask for notifications when there is something to >- * read. >+ /* We can't read right now because there is not enough data >+ * in the queue. Ask for notifications when there is something >+ * to read. > */ > if (sk->sk_state == TCP_ESTABLISHED) { > if (!send_waiting_read(sk, 1)) >diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c >index 0f36d7c45db3..12f0cb8fe998 100644 >--- a/net/vmw_vsock/vmci_transport_notify_qstate.c >+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c >@@ -161,12 +161,12 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, > { > struct vsock_sock *vsk = vsock_sk(sk); > >- if (vsock_stream_has_data(vsk)) { >+ if (vsock_stream_has_data(vsk) >= target) { > *data_ready_now = true; > } else { >- /* We can't read right now because there is nothing in the >- * queue. Ask for notifications when there is something to >- * read. >+ /* We can't read right now because there is not enough data >+ * in the queue. Ask for notifications when there is something >+ * to read. > */ > if (sk->sk_state == TCP_ESTABLISHED) > vsock_block_update_write_window(sk); >-- >2.25.1