Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4613729rwb; Mon, 8 Aug 2022 04:22:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5eZ6touOwuo1NWlC8TCd6iYgSYq8SDS1BvXE95gXz1V3GhQmL5jF0Bl71V9U2xWWSMpXCC X-Received: by 2002:aa7:dbca:0:b0:43e:6707:d298 with SMTP id v10-20020aa7dbca000000b0043e6707d298mr17445671edt.133.1659957768738; Mon, 08 Aug 2022 04:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659957768; cv=none; d=google.com; s=arc-20160816; b=xflGTfpsTKZwKsjfhA+MKUn27Gc+B2sZzoRKzyOjPSh5bqRLQomV3i1afk8DrfxqdA e8T/Tl+2LXqanGo3c6JrHRCJEP7tF9JX0f4zxQbUUY1RquQRKUy0gJEfZNYCVaX9+ZzS 9GSadLWSM1Wz35ExlHqid9DeuDv1IHwoRBL5DtPoxtdLe8B+JCdwVP3V65ecfdcczVmg aQmjJa2mnET6d9bCPjYee7N0qgTqS4GPAs4XnqI5XqpUA8s77+wLTuSZuT6FGQUwoEc0 vUiGQJ3NdvmeRhdRoLnleUM4h7CYs9+Y0BoELSSA/G66V8wk7SM0cAIoK+YRjN0kA56x rg6Q== 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=8aV2W61ptlHUyh4odksNrh50/vrECqQvfXa6ytqlWXY=; b=HCrdfDn6pkrgS51Ky/A9XQ5e8RFzlx/4LTOdfniD1v/rPnfmPITnUeE5oyV4Ebvdtg TlgJArqyYJCyfIsjnNI85dNPY7m+MhJYEgmPZrNyxuO6/eHKfhAe3eaV3c08/0eI5JtI ycO/pvkd/Qmg4hSh0YwQKYmcGkHTLdxTGXKG1ZwOZ3SXVYRBTZQlE/zInr9HzgYEq+sR 3heWrMiviOAdMT9APPvtOCTzBtxMPkbPsEApzTxYN3JsXIkojXmGIic7HH5XVlAWiwks eKUhUrb/B6bb4by+GgtArslbHdxOrtGHl8nb6UOxPd6jSHPYMrN3OW8/YZC8KfOnON8o FC4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="hcPvLI/B"; 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 cs18-20020a170906dc9200b007305fc656b1si2842986ejc.648.2022.08.08.04.22.18; Mon, 08 Aug 2022 04:22:48 -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="hcPvLI/B"; 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 S237695AbiHHKqr (ORCPT + 99 others); Mon, 8 Aug 2022 06:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242198AbiHHKqo (ORCPT ); Mon, 8 Aug 2022 06:46:44 -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 733262BC6 for ; Mon, 8 Aug 2022 03:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659955602; 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=8aV2W61ptlHUyh4odksNrh50/vrECqQvfXa6ytqlWXY=; b=hcPvLI/Bcsc+ttb82IqvoYubBf17rKZ+eXB9Pq4gxXR8wj58MKeJdau+njW4Vc6/Vjf1IB Nuhi7MRn3rwpWR8zrXylR/0m8/TSwPsr5X+Sf9niqdbIMWaVAlL9IaZMEBnD/gWDvTNIiC ZGILldIA5F1fjBvuaHn4W5MKy7jgX1s= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-76-NlHvhnSpPmyd2TvWJi_-1w-1; Mon, 08 Aug 2022 06:46:41 -0400 X-MC-Unique: NlHvhnSpPmyd2TvWJi_-1w-1 Received: by mail-qv1-f69.google.com with SMTP id e12-20020ad4442c000000b004796bf5f82cso3269288qvt.20 for ; Mon, 08 Aug 2022 03:46:41 -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=8aV2W61ptlHUyh4odksNrh50/vrECqQvfXa6ytqlWXY=; b=YWf/lgMzsgNfIOA/oxj8P3iaEPvQBvQV/kAXvIgSAXkf8m6dWmsq78cp/IO/DVwu5g F18oQosKwa+BKa6w4BXg34CCNPafjUw4Ox9SF5fIIcbhsCa2ul6JsMZnAmUq4zdrQWmh FTJW4fU0EzwE2n+U2PLNZkbuvsl3q0/hkgae7hbyW+RNgxB1/U1B6RQrjPsYjYptrA7+ TVN6mWweKwcvEnQvCjLODvp80QRzWJyqfa8eK3u6Gyp0C4Gn8kf9Hcnwvv5Dqt691jDW VJOg01MqT9MBJFrMWVTgTEAGyjgeZvokLViflajWPem9J8064byJrKVnWly37bdcz1No BmCA== X-Gm-Message-State: ACgBeo05CcD30RyDuQL5zw04OOuxb2MUdn9mYm88e3+onStmgRfOgPXa 2z1WbFZtI9K56vdwX35mpgOnoY/jYcud+smY/kdnezHioM3whVQPLpKi0u6rGJG5+FPQruiFGKN SN/fI8/F7SVydZCLzXcwst/06 X-Received: by 2002:ac8:4e91:0:b0:31f:cfa:7669 with SMTP id 17-20020ac84e91000000b0031f0cfa7669mr15805108qtp.264.1659955600803; Mon, 08 Aug 2022 03:46:40 -0700 (PDT) X-Received: by 2002:ac8:4e91:0:b0:31f:cfa:7669 with SMTP id 17-20020ac84e91000000b0031f0cfa7669mr15805084qtp.264.1659955600582; Mon, 08 Aug 2022 03:46:40 -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 h126-20020a375384000000b006b5cb0c512asm8719392qkb.101.2022.08.08.03.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 03:46:39 -0700 (PDT) Date: Mon, 8 Aug 2022 12:46:30 +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 5/9] vsock: pass sock_rcvlowat to notify_poll_in as target Message-ID: <20220808104630.dvprekauh5pi7zx3@sgarzare-redhat> References: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> <5e343101-8172-d0fa-286f-5de422c6db0b@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <5e343101-8172-d0fa-286f-5de422c6db0b@sberdevices.ru> 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=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:59:49PM +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. I suggest you refrase the description a bit, which should describe what was the problem and what the patch does, so I was thinking something like this: Passing 1 as the target to notify_poll_in(), we don't honor what the user has set via SO_RCVLOWAT, going to set POLLIN and POLLRDNORM, even if we don't have the amount of bytes expected by the user. Let's use sock_rcvlowat() to get the right target to pass to notify_poll_in(). Anyway, the patch LGTM: Reviewed-by: Stefano Garzarella > >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/af_vsock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index 016ad5ff78b7..3a1426eb8baa 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -1066,8 +1066,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, > if (transport && transport->stream_is_active(vsk) && > !(sk->sk_shutdown & RCV_SHUTDOWN)) { > bool data_ready_now = false; >+ int target = sock_rcvlowat(sk, 0, INT_MAX); > int ret = transport->notify_poll_in( >- vsk, 1, &data_ready_now); >+ vsk, target, &data_ready_now); > if (ret < 0) { > mask |= EPOLLERR; > } else { >-- >2.25.1