From patchwork Fri Aug 19 05:39:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 12948348 X-Patchwork-Delegate: kuba@kernel.org 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 5DD3CC32771 for ; Fri, 19 Aug 2022 05:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346508AbiHSFjz (ORCPT ); Fri, 19 Aug 2022 01:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241985AbiHSFjy (ORCPT ); Fri, 19 Aug 2022 01:39:54 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BA19BFABC; Thu, 18 Aug 2022 22:39:53 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 4E9FF5FD07; Fri, 19 Aug 2022 08:39:51 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1660887591; bh=R79+XidUY9g0x8il8JzWOIn3o41h8mogyFPGT9KZ2dk=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=DYgOFWe4A013wRMQmmiUgKTPVk1OGKBNjIEvLrykzGdIb5nAP3Z8VqRWZnOoiVIgB 9INu0/yWirCu8ghVn/IgO5zit4HCIxgYVYLJ4k6RQR6I9boWLMzMusSnlYMIoJ2Ahs AUZDAUS62kCSCE5Orz6hNeabMd64uJQYSwdfEIGD44SAzRFDZcyhi5pnv1l5rg2av1 hoNoGoRwh/EjL167FkvpnQYruswjjy/Z6U8mxsKJJDuEqXr9gOKdrLH5ewf3fbtK0c Ilk0SxYTNvoy+HS0bQmJp5DKp8KNO6Ju+MZ+C72kZDDnQdpGTJdJbNnGYUr5HHQ6i6 PwPAkOOj40zbg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Fri, 19 Aug 2022 08:39:50 +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 , Krasnov Arseniy , "Michael S. Tsirkin" 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 , VMware PV-Drivers Reviewers Subject: [PATCH net-next v4 7/9] virtio/vsock: check SO_RCVLOWAT before wake up reader Thread-Topic: [PATCH net-next v4 7/9] virtio/vsock: check SO_RCVLOWAT before wake up reader Thread-Index: AQHYs44KDFwnsmWHL0COnLpDuJnm+Q== Date: Fri, 19 Aug 2022 05:39:24 +0000 Message-ID: <696d5dfb-92a6-cd06-60d0-d9c953774226@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/08/19 00:26:00 #20118704 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This adds extra condition to wake up data reader: do it only when number of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick user,because it will wait until SO_RCVLOWAT bytes will be dequeued. This check is performed in vsock_data_ready(). Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 8f6356ebcdd1..35863132f4f1 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -1081,7 +1081,7 @@ virtio_transport_recv_connected(struct sock *sk, switch (le16_to_cpu(pkt->hdr.op)) { case VIRTIO_VSOCK_OP_RW: virtio_transport_recv_enqueue(vsk, pkt); - sk->sk_data_ready(sk); + vsock_data_ready(sk); return err; case VIRTIO_VSOCK_OP_CREDIT_REQUEST: virtio_transport_send_credit_update(vsk);