From patchwork Wed Aug 3 13:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 12935531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DC73C19F2C for ; Wed, 3 Aug 2022 14:00:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238450AbiHCOAI (ORCPT ); Wed, 3 Aug 2022 10:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236478AbiHCOAH (ORCPT ); Wed, 3 Aug 2022 10:00:07 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A6AB8A; Wed, 3 Aug 2022 07:00:05 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id DDC235FD2F; Wed, 3 Aug 2022 17:00:03 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1659535203; bh=ZKMXpCA9Ey3wdzBNP+gXLnhyO45OV7iXKTbsieEn9NI=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=nBsWoYp0gXHeJkZUq0y+1zuiM+x8y2iDCV5d//JxA36M1kJMBu3y/1J3F0zxmuI+N BqtPoHFKqABGbBsU+ajMZIH0kNWWfDi298My4nETIadzE6Wz/dTbWbWDEG+ajR8Km6 MF5u7zryJXGaKpzLlTfFvVQAI033RJwzcL42uIYBeMcoNR72HlucfW1NwSg4oqwWIV wWsyjxYlVJ4EezJsadCMSMmO6eXTDvabu0A+GcgyzaQRjV4E0tsmF0FU6JeSvF/rxS aiop8S64qAhW1FAr9rUKc2FUpkKcnliGuHYzQmhOPaKIlCrTD8E0worXqN1JAglCMf 9cA7PAy7Nrh3g== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mail.sberdevices.ru (Postfix) with ESMTP; Wed, 3 Aug 2022 17:00:02 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "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 , "Arseniy Krasnov" CC: "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: [RFC PATCH v3 5/9] vsock: pass sock_rcvlowat to notify_poll_in as target Thread-Topic: [RFC PATCH v3 5/9] vsock: pass sock_rcvlowat to notify_poll_in as target Thread-Index: AQHYp0FLSVsieEsYCEKStjqm/Ox4tQ== Date: Wed, 3 Aug 2022 13:59:49 +0000 Message-ID: <5e343101-8172-d0fa-286f-5de422c6db0b@sberdevices.ru> In-Reply-To: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-ID: MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/03 07:41:00 #20041172 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC 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. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- 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 {