Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1209591rwb; Thu, 18 Aug 2022 22:22:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4cMAJD6eKt3SXXSF5KhOwKBb5lyKL67J9Xxw76k5PevkGEDiXrbeLkunwUtBiJanF2yOg1 X-Received: by 2002:a17:902:9b85:b0:16e:cc02:b9b2 with SMTP id y5-20020a1709029b8500b0016ecc02b9b2mr5775913plp.74.1660886535620; Thu, 18 Aug 2022 22:22:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1660886535; cv=pass; d=google.com; s=arc-20160816; b=bRXLyE8GufQCsAEWSHk4a7cbSu8oKSupGjAYv1Jbqtmb6+xkVNvMni/4fS1ELVtV6W FjkceZ0Wl0uZRKzX9duRxFpgiDidaeLQ893MVuOI81Ba6XqwuvzOfiRD/RLv9eiNsBAq Xt/7/uraMt+i5VIJLKIzT69P+X4xbxc46BBLq1yNXIZ4E37q+O5BK5Q8xrqLJ0XBgnhm jzC+o8inooMmsQiqYDo7SWWt6y0ZeDg83m8SJcmFKplUcVITteFpwYhrfWMLGK8LKng1 n+IEkznnLTV+8GcrLYlHhhf8d/xzJ1+hmqfaH8WdsCwnnCBPa4l66M1kvsP5LmusDpM+ 2z2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=3fC9A7DvpvQ65F2izoyBZRpDt0eKvbE/2tIvL/M5ipw=; b=CQqtrmfNcpQ+v4SUchBK5OH7n5nNFq53cFROD73g7s7vsc04Q7NKy/pG11GeldRK7Z lw6U4Je2hGdJlPpyQmvE+QJrezlUIHBULuWBSLtrvcArzxfvpILOWB5sc41RHWrs/dPm GtcQp/Cezra8VOtr6gRJynzDd/ZRADA3M0P+lVh/ZCZ/E4WLfoVjJ1Y4pzGgZadPkLAq HCUzPLDccFUgY78bMHBElileLJ7WojNe9JljBFF1tT0riCk96ewNCnotT80R5gmxdM0F KQpSYRlmUyCUeg8VOHDoQb0Q3jxhYxMw5gldQBlEpptSJYhUFMhy2eKyk8OAFpvBxkDd 7xSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=r9aoe1zF; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); 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=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a634952000000b0041b72fda9b5si3144970pgk.311.2022.08.18.22.22.04; Thu, 18 Aug 2022 22:22:15 -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=@vmware.com header.s=selector2 header.b=r9aoe1zF; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); 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=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346227AbiHSEvH (ORCPT + 99 others); Fri, 19 Aug 2022 00:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiHSEvE (ORCPT ); Fri, 19 Aug 2022 00:51:04 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EF8C6EA9; Thu, 18 Aug 2022 21:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hk/qoYYg6m363OkRWljAFTW1EFFRDQ44sBCaXKLxGWRUz0qHvpYeygc49OfBXuCj4T/ktKNaAl6jjBY2n7tua7gIUZYe7hv/peVOlVkn2RJZ4fcPOIClnF+ZPtkLunEiEO4oV8XVhuRpyYdO7zenmQbw8ErpuelqcofPZRxX9kMTaCVENh57CFAKvqs9si4LoaBmQGZtrMa/7Aka+mIY5mittshV+DFlXCJ3qkeMzxC0YEtUBWLBCICxjqzzrTeaVAE8rt5/Cq4S2NR6ews57giMSSXEYFr0YPWJeRLhbC0UqkRWwYFd3e9qPNuFxLMi6e9sHWEsI7CFwr3IY1LnrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3fC9A7DvpvQ65F2izoyBZRpDt0eKvbE/2tIvL/M5ipw=; b=CnXepyMdatYiz7YbQFPRVuVQIb2H47YGu4qqHqL4abJfZVIYjbK6dao16FL99xAkpVDllDXf10oF6Gv5ADh8k5RwmZRNw6Q5emCt3gsVs6jcrMSYUuCkdADew6S+wHl5XRbnVZsm8ODWhGjjswzxSWbYz5WdDCjq7x2S3KKcMQaxOOpSMcb1RvQWE1com4V5SsNOQJBNjybD+XH2O9kHFSuFyInkoq3AldqP5hgp4sala1l7eRkUrZW85ptyNAV1NCW02Gvbfz8r+VCmXZJqqYa4I1pEBdqnD7AC4y8WYaQZOBumsn0HCKJw+4bpGH9Iuw1pzSzAcBy1A3bFTO16KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3fC9A7DvpvQ65F2izoyBZRpDt0eKvbE/2tIvL/M5ipw=; b=r9aoe1zFdsI1w/0PdQxfjWfLHwcIMg/1ILODXoG0Qmmdd6/efDLf10cF6kYsGUdazTAY8bmty+HTLyviZ9E1Is5lZwMcUDksurvBCUKWxkb+qbAZkqAG3YAS0PBDgxfFldY7VSm3uUlpqG7dkQnHkY1yNFGuUfL00Urcssi+000= Received: from BYAPR05MB3960.namprd05.prod.outlook.com (2603:10b6:a02:88::12) by SN6PR05MB4848.namprd05.prod.outlook.com (2603:10b6:805:9a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.4; Fri, 19 Aug 2022 04:49:57 +0000 Received: from BYAPR05MB3960.namprd05.prod.outlook.com ([fe80::30dd:741a:330:383c]) by BYAPR05MB3960.namprd05.prod.outlook.com ([fe80::30dd:741a:330:383c%3]) with mapi id 15.20.5566.004; Fri, 19 Aug 2022 04:49:57 +0000 From: Vishnu Dasa To: Stefano Garzarella CC: Arseniy Krasnov , Bryan Tan , Pv-drivers , "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 , 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 4/9] vmci/vsock: use 'target' in notify_poll_in callback Thread-Topic: [RFC PATCH v3 4/9] vmci/vsock: use 'target' in notify_poll_in callback Thread-Index: AQHYp0EUp9rRqTq8tUaEqfUfKAix8K2k1tiAgBDo5wA= Date: Fri, 19 Aug 2022 04:49:56 +0000 Message-ID: <0783F6F8-901A-4186-B4E7-01FE099F1939@vmware.com> References: <2ac35e2c-26a8-6f6d-2236-c4692600db9e@sberdevices.ru> <2e420c8e-9550-c8c5-588f-e13b79a057ff@sberdevices.ru> <20220808103611.4ma4c5fpszrmstvx@sgarzare-redhat> In-Reply-To: <20220808103611.4ma4c5fpszrmstvx@sgarzare-redhat> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ceacb500-2bce-42c4-f0a8-08da819e43d5 x-ms-traffictypediagnostic: SN6PR05MB4848:EE_ x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3gT6Tqi+iiMJ4M4oxXa0ELbq2tv+R+HqmrCDt4JUZvBZp5n1Xcn6kPFRCxrHSQlybyChzDacCBfOQzGmnCV6iInlaJCERIvNDtCl5dKQk7rDVOOeJI+3XrZ3J5e7upXnUMXi0qDYyqEsQE3cZjmF2awsBWGRU1iReb6LaPTmDW4bUqlorl1bX793ZzqyfyV2cG/S9wfZ4tV3sZNqMX06bpG2q/PF3OQVmhc7KalWHtB9TmoFlT0PfO5kGlIf4L3s1uOOSUL+dOtAka1GL4YK8KBPVLlPUpaTjRIyIm5S/HyY5vFBqd/f62xF+bXQ5GjE0uOjYF0TrVCmEX2qDaYY6aeiuXcrkfcFFqYowUYrkCzMkfJNWrCgGXdGW5Its3SNmtutk++tzwdLIZEVjUcTwWaH1HXAUuQg/mzmHTRk+dspJJHyB38xgeumlxQRATsO0GkBQtrQKX7sd/YACm0A+5fUhxRA4HTCUfNkPmzBOF8WsBW4k4X7er9HsTSbeQxfJD9PAZB0DzXjJkffgyAaeiEN8VZp9NLk/weZ1UmDR1aj1vQchT6nbdteQOEGeXcILQ8VtseUMuUbzLdZyb9o2prNCeKQF23ex8IXpcGp1NmV66nURhxRHFCu1TXXVIY0dRJU9eRKn395BcFJsNzePk+BZBDWsRuF3DDmkXpSCoIDK/vKoBob09fRwUOuFqKqLeQhYzSoojH/kprsmcRT+lfjBU18UYjpNXDgkmWz/cgISmLpcgcnCENCMZPYeVuqIQPeIsdsz+3JuxaB/+wFJ1JwUU4KZGban2hdk0KLre9SrUFrA4XfeG7EHkitu8rFikxFs5l+IzZiosdjGxlHnLZSyf5H6qlg132D4SLogRA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB3960.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(396003)(366004)(39860400002)(346002)(376002)(2906002)(41300700001)(66476007)(66556008)(66946007)(6486002)(33656002)(64756008)(66446008)(8676002)(76116006)(8936002)(7416002)(5660300002)(86362001)(71200400001)(478600001)(186003)(4326008)(83380400001)(2616005)(6512007)(6506007)(53546011)(38070700005)(38100700002)(122000001)(316002)(54906003)(36756003)(6916009)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9quURMd+oPAdxJ61gpQX1CEtRLOd0J6ZRXl9rKmud9ohC9aWdWgSW0/cwEKS?= =?us-ascii?Q?/53F+2BQwzFqA89oVM1ClhS6aJM26PReebaXHY/Rt3fsJQc6XwvjzfRIv5Dw?= =?us-ascii?Q?lqEifvpJia0RvK6Tfr+nLnJEi8H8MsUpizD5VdbarE86BDPrMnqkBjwamAAm?= =?us-ascii?Q?/a5p7J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jpvSvDiK?= =?us-ascii?Q?DeiDOwfdNWVu7Q5q/o5MJb3sjH3Gcd4K56MUzqPj3a/2uCFZ+lu1pP7WPaDQ?= =?us-ascii?Q?znWnJGWjaNKk66vi+jHDkSo3V3lfu0ZrDCOU3FgvW9A9I4pTLkLU3CFxjr+C?= =?us-ascii?Q?zBnG4CufPsEx0FvKY89++YFdCu0ipYihLbJbjLynUrvG7u7Boh3i4gBurrPu?= =?us-ascii?Q?ucjQMFSTiSrBo6NFo1h9bVMn0Ex0pL8kUxpVj/yyMN1vRB74gIxKQBP74TIB?= =?us-ascii?Q?KdBBN4K5YHqFRriVVwsl52m4kMN5RvXA5xd48AnqDR5FP+EnmjzeAQ/9Wrsh?= =?us-ascii?Q?5MF4HkHuQxu2mKoA3842hPj6pmERe3Bcg5GsosEmCvFbrdsHBGi26LfGbW7U?= =?us-ascii?Q?Qj27IKbLYgECpDVtGGAqWqyUNIhozs6gGic7ip6uL6BNGu8G9CRuBwL0zfAC?= =?us-ascii?Q?TSfzTZJtZmWbgofEYAcq1oam6H3bBBMnH4ZqcMq+jw/rcqlXX/h7ix7H9pJx?= =?us-ascii?Q?KBtS8LS4sVkpon/dCJ6y/TfJu4FjQIN7Jn7VaDZzWAuGHE5ygQYd2PnpMdDh?= =?us-ascii?Q?8wGlu4lwXC3B+akXfh/sZCVDjCtQKzLnH/h6NGpZ0kPB?= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB3960.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ceacb500-2bce-42c4-f0a8-08da819e43d5 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2022 04:49:56.9100 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: o0B1VkB7nwXgBBoDVhcXfcWQcHjfrag3OFjQD6xb67peA2dNEHy/1gZxbScwbmQpJ/OAFYxYljdk1EgSaE1qYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4848 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Aug 8, 2022, at 3:36 AM, Stefano Garzarella wrot= e: >=20 > On Wed, Aug 03, 2022 at 01:57:54PM +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. Use 'target' which is already exists >> and equal to sk_rcvlowat in this case. >=20 > Ditto as the previous patch. > With that fixed: >=20 > Reviewed-by: Stefano Garzarella >=20 > @Bryan, @Vishnu, if you're happy with this change, can you ack/review? This patch looks good to me. Thank you, Arseniy for running the test with VMCI. I also ran some of our internal tests successfully with this patch series. > Thanks, > Stefano >=20 >>=20 >> Signed-off-by: Arseniy Krasnov Reviewed-by: Vishnu Dasa >> --- >> net/vmw_vsock/vmci_transport_notify.c | 8 ++++---- >> net/vmw_vsock/vmci_transport_notify_qstate.c | 8 ++++---- >> 2 files changed, 8 insertions(+), 8 deletions(-) >>=20 >> diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_= transport_notify.c >> index d69fc4b595ad..852097e2b9e6 100644 >> --- a/net/vmw_vsock/vmci_transport_notify.c >> +++ b/net/vmw_vsock/vmci_transport_notify.c >> @@ -340,12 +340,12 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, >> { >> struct vsock_sock *vsk =3D vsock_sk(sk); >>=20 >> - if (vsock_stream_has_data(vsk)) { >> + if (vsock_stream_has_data(vsk) >=3D target) { >> *data_ready_now =3D true; >> } else { >> - /* We can't read right now because there is nothing in th= e >> - * queue. Ask for notifications when there is something t= o >> - * read. >> + /* We can't read right now because there is not enough da= ta >> + * in the queue. Ask for notifications when there is some= thing >> + * to read. >> */ >> if (sk->sk_state =3D=3D TCP_ESTABLISHED) { >> if (!send_waiting_read(sk, 1)) >> diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsoc= k/vmci_transport_notify_qstate.c >> index 0f36d7c45db3..12f0cb8fe998 100644 >> --- a/net/vmw_vsock/vmci_transport_notify_qstate.c >> +++ b/net/vmw_vsock/vmci_transport_notify_qstate.c >> @@ -161,12 +161,12 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, >> { >> struct vsock_sock *vsk =3D vsock_sk(sk); >>=20 >> - if (vsock_stream_has_data(vsk)) { >> + if (vsock_stream_has_data(vsk) >=3D target) { >> *data_ready_now =3D true; >> } else { >> - /* We can't read right now because there is nothing in th= e >> - * queue. Ask for notifications when there is something t= o >> - * read. >> + /* We can't read right now because there is not enough da= ta >> + * in the queue. Ask for notifications when there is some= thing >> + * to read. >> */ >> if (sk->sk_state =3D=3D TCP_ESTABLISHED) >> vsock_block_update_write_window(sk); >> -- >> 2.25.1