From patchwork Wed Aug 3 13:55:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 12935529 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 66317C19F29 for ; Wed, 3 Aug 2022 13:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233310AbiHCN4k (ORCPT ); Wed, 3 Aug 2022 09:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238798AbiHCNz4 (ORCPT ); Wed, 3 Aug 2022 09:55:56 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4B30D6B; Wed, 3 Aug 2022 06:55:51 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 46B5A5FD2E; Wed, 3 Aug 2022 16:55:50 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1659534950; bh=Ktbbd9hXNDd86/yoPDR8TGlX/txvLJI7Vez6o0MPzn4=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=gptFyj2SysmD7IKDZmNL6DDgi4KG/CWC6l7FxpDsQWCEcX83qtv/3lIDZEb/JkZko EToijo1GA/oeNFlLCKsR3ayuXn44nSi+qJ3slzeP5G5X6BupEMZpRW2Cz3nlf+AL/m 67OKltGJv1OcRe3GBYDZWskQbQMtoz9WGb0Xh9weqOQNJ5FIgZ99+MIRxcFDlsfOq8 1kwTb0uhkxdkUKADWIRim8ISpCXgeqHbpJ0HWhyaGE9wcxOWkKiL1DBhVaBulOIh2e L62Vf/9zDJqkVMQtoiq8n6n49PhwlASbDOef5neJEJpefLt2ZQ/38PxvWNz5OKrMjb gXnCkiTxOCQoQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Wed, 3 Aug 2022 16:55:49 +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 3/9] virtio/vsock: use 'target' in notify_poll_in callback Thread-Topic: [RFC PATCH v3 3/9] virtio/vsock: use 'target' in notify_poll_in callback Thread-Index: AQHYp0C1oRdUPWQ9EEOsL2TJh6981g== Date: Wed, 3 Aug 2022 13:55:36 +0000 Message-ID: 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. Use 'target' which is already exists and equal to sk_rcvlowat in this case. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index ec2c2afbf0d0..8f6356ebcdd1 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -634,10 +634,7 @@ virtio_transport_notify_poll_in(struct vsock_sock *vsk, size_t target, bool *data_ready_now) { - if (vsock_stream_has_data(vsk)) - *data_ready_now = true; - else - *data_ready_now = false; + *data_ready_now = vsock_stream_has_data(vsk) >= target; return 0; }