From patchwork Mon Jul 18 08:15:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 12920979 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 1338CC43334 for ; Mon, 18 Jul 2022 08:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231937AbiGRIQh (ORCPT ); Mon, 18 Jul 2022 04:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbiGRIQg (ORCPT ); Mon, 18 Jul 2022 04:16:36 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBFA18B34; Mon, 18 Jul 2022 01:16:34 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 379A85FD02; Mon, 18 Jul 2022 11:16:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1658132193; bh=P1nJrkr4Sn5U/iYTmAgG12ArGGHsfWi2OJp13EVm0cA=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=JatiyhM0hARi6p2do309wBi/iTOndctex3kl1O5m7NBQyoRn+R0yaoRyBjEQL+Uo9 zA5k+SGXqldQLx6CZMhyGZdcgFB0YFUiokKzC7cfu/8n/udA1saE3fa1FX5fQeH6Ux tTbU8vT4pX0rQQaJU1HOLyGXDD++5/qbxQmir1l2BitHYtJ4vAG6yD94GV9AVQiDBh MMKpjjV3k6BxIXQ+NzqNonD3sTOquqxNtxNkuaGJ89jI7Jm4QZJVBJUcJt4Re9RqNo qsWWWFLlGYmJwtOXe0Vw3NPeMI7FbDJ6tZHrGI7Wz9IW6EESVXMlcNVcmlIS6/IlKM lmm2eNSqOZNmg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Mon, 18 Jul 2022 11:16:32 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Stefan Hajnoczi , "Michael S. Tsirkin" , Arseniy Krasnov , Krasnov Arseniy , "edumazet@google.com" CC: "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "kvm@vger.kernel.org" , kernel Subject: [RFC PATCH v1 1/3] vsock: use sk_skrcvlowat to set POLLIN,POLLRDNORM, bits. Thread-Topic: [RFC PATCH v1 1/3] vsock: use sk_skrcvlowat to set POLLIN,POLLRDNORM, bits. Thread-Index: AQHYmn6SAU6pAMObZUmsS+bpsPqTqA== Date: Mon, 18 Jul 2022 08:15:42 +0000 Message-ID: <637e945f-f28a-86d9-a242-1f4be85d9840@sberdevices.ru> In-Reply-To: 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/07/18 02:31:00 #19923013 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC Both bits indicate, that next data read call won't be blocked, but when sk_rcvlowat is not 1,these bits will be set by poll anyway,thus when user tries to dequeue data, it will wait until sk_rcvlowat bytes of data will be available. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index f04abf662ec6..0225f3558e30 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1067,7 +1067,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, !(sk->sk_shutdown & RCV_SHUTDOWN)) { bool data_ready_now = false; int ret = transport->notify_poll_in( - vsk, 1, &data_ready_now); + vsk, sk->sk_rcvlowat, &data_ready_now); if (ret < 0) { mask |= EPOLLERR; } else {