Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp255068imn; Wed, 27 Jul 2022 05:29:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vflnQVMtSISIJHv9N1my/dKrUFRlteI3gikxLBAgtHzygXP9ULP+KShR+RWA6m0DXrXk55 X-Received: by 2002:a05:6a00:27a1:b0:52b:a08:fe02 with SMTP id bd33-20020a056a0027a100b0052b0a08fe02mr21891478pfb.75.1658924979371; Wed, 27 Jul 2022 05:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658924979; cv=none; d=google.com; s=arc-20160816; b=ybSDH/D5g2lbwzyQvijiEWfQ3JfWBtMfnInpHWkT9Oo8LKy0xb/0l2dvtUN0T1ueOs jGRGtxDdaaBcas1U42K58xWHs1p+Co7d4X2tpZ0bs5ElZdG/NW7uUaOkNceQhylB3Mx3 xpFjofhXWQNaT3Or48V208PkoXuKUnZHRYMcs/EX0P174wwuNBRVlVywv7l7gnlK12zL HZ0mgnCHx+oMrCAYdlmDGWNWkWBgaCdMJFcUgmjeBK/+i9FnH4iP5q3Ja4q1BW0ExpF2 7/y/En+WVKR6MLfk4kMcf371YugzIJk4xH0qSwuvVIUFLMjrO3n48xqJ0xhDtIeeFXNQ Medg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k2Ka0CTSNUje69lzv8PJ/TPp2RlYweVKt52OqRvsIcU=; b=pjAyrQ+YFWAmMWwXhyE60o2HmkWBjXJK74dCkHWCB8wIcdGqfFSDMiVAhZGOGPxpMo irpllq81ScWkAhazY/m7lTCs6sjcPImXRP2fRLVrQ2jtLijHhLILxf8waesvsmEazKC3 YNDOFQ3BohN4q30eWI7tbwPFhCmuy2UJ7ivO4ck7W4wAcUiPJg1vIK6cvEy+BFmHXOUy cynmLFMnBSbfmTC/6UO2/bUYZroz4Ca8DYec+d5TLAA2SjOcg6q/0ss0vV1/Y2DMZx1a +Wg0NMQdTycP2zcGiTPfWh01M9UKnEknT1SF/DYN+tCGUTyWZ1z/pHeL24PcdaR7KyW/ f5Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hCNsxit3; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t24-20020a6564d8000000b00411994baf80si17589200pgv.281.2022.07.27.05.29.24; Wed, 27 Jul 2022 05:29:39 -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=@redhat.com header.s=mimecast20190719 header.b=hCNsxit3; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232885AbiG0MWx (ORCPT + 99 others); Wed, 27 Jul 2022 08:22:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbiG0MWw (ORCPT ); Wed, 27 Jul 2022 08:22:52 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4187D45F47 for ; Wed, 27 Jul 2022 05:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658924570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k2Ka0CTSNUje69lzv8PJ/TPp2RlYweVKt52OqRvsIcU=; b=hCNsxit3sOgekOMXCX8vEkyote23KAqAiukuUs+eZ4Uur2AsQhGq5uzID4UwjiR9q84m1K R3rP6m8isCm2miaFcS9tMxt0aJUKhr2GQyZwGAGD43IuI0+wa03hAtVAG5hdW3PiYxNomM MQX330eS8hk2g1PP9RAUpbJ2AM9sCgU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-n9iPIs7sMc2R9fpVEU8Wiw-1; Wed, 27 Jul 2022 08:22:49 -0400 X-MC-Unique: n9iPIs7sMc2R9fpVEU8Wiw-1 Received: by mail-wr1-f72.google.com with SMTP id k26-20020adfb35a000000b0021d6c3b9363so2770046wrd.1 for ; Wed, 27 Jul 2022 05:22:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=k2Ka0CTSNUje69lzv8PJ/TPp2RlYweVKt52OqRvsIcU=; b=K1jpmQKM/S0X1MQ6kF4i58/HVyB+4yYjQgnBsnXsmj9xQT6AxOEnJYCysytrcf8qe6 vLKcuxT6eObWRchxD5+xlZYh8og01ATLLQ66tiCtoSeYS/01X3+bQ9dBX0xt0z+ofbaK QCraOlb5oebdSz4Tvi7wQ7s7Ndmql3fkG0Z66eDXFvWKWY7rx521u4hGiU5K7+MMi3jj FIgECzSi+YKRMFjpj1hRXUU0ryz+ui4vjmrLevfirOpxe0MVuxFDT/1Gw9Bw7dLE4OIF semEUd36mECGSY73xjAa6MmxJ2lpSzbqU2Bq8Ls2g0RQrzCWA0/z+blPx9vMrJbJtGsf 1ztg== X-Gm-Message-State: AJIora8cWHv95a+t/osT/mcnApVuYeFJgXXMO2aOtkHN/I4wEtaSPyHh npCweiPlYkit3RZupmgooEOBZ7VV9WXvG4dPsKzJRLQxHobNFNsgX46lh2IRcutuepTn1/mbjB/ tRV2RuSWCNFMCZbAPpyJxFLrt X-Received: by 2002:a7b:ca57:0:b0:3a3:205d:2533 with SMTP id m23-20020a7bca57000000b003a3205d2533mr2850183wml.67.1658924567788; Wed, 27 Jul 2022 05:22:47 -0700 (PDT) X-Received: by 2002:a7b:ca57:0:b0:3a3:205d:2533 with SMTP id m23-20020a7bca57000000b003a3205d2533mr2850159wml.67.1658924567308; Wed, 27 Jul 2022 05:22:47 -0700 (PDT) Received: from sgarzare-redhat (host-79-46-200-178.retail.telecomitalia.it. [79.46.200.178]) by smtp.gmail.com with ESMTPSA id f5-20020adff445000000b0021e5f32ade7sm13639242wrp.68.2022.07.27.05.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 05:22:46 -0700 (PDT) Date: Wed, 27 Jul 2022 14:22:41 +0200 From: Stefano Garzarella To: Jorgen Hansen , Arseniy Krasnov Cc: "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" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "kvm@vger.kernel.org" , kernel Subject: Re: [RFC PATCH v2 3/9] vmci/vsock: use 'target' in notify_poll_in, callback Message-ID: <20220727122241.mrafnepbelcboo5i@sgarzare-redhat> References: <19e25833-5f5c-f9b9-ac0f-1945ea17638d@sberdevices.ru> <355f4bb6-82e7-2400-83e9-c704a7ef92f3@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <355f4bb6-82e7-2400-83e9-c704a7ef92f3@sberdevices.ru> X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 @Jorgen can you take a look at this series, especially this patch? Maybe we need to update the comments in the else branch, something like s/there is nothing/there is not enough data Thanks, Stefano On Mon, Jul 25, 2022 at 08:01:01AM +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. > >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/vmci_transport_notify.c | 2 +- > net/vmw_vsock/vmci_transport_notify_qstate.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c >index d69fc4b595ad..1684b85b0660 100644 >--- a/net/vmw_vsock/vmci_transport_notify.c >+++ b/net/vmw_vsock/vmci_transport_notify.c >@@ -340,7 +340,7 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, > { > struct vsock_sock *vsk = vsock_sk(sk); > >- if (vsock_stream_has_data(vsk)) { >+ if (vsock_stream_has_data(vsk) >= target) { > *data_ready_now = true; > } else { > /* We can't read right now because there is nothing in the >diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c >index 0f36d7c45db3..a40407872b53 100644 >--- a/net/vmw_vsock/vmci_transport_notify_qstate.c >+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c >@@ -161,7 +161,7 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk, > { > struct vsock_sock *vsk = vsock_sk(sk); > >- if (vsock_stream_has_data(vsk)) { >+ if (vsock_stream_has_data(vsk) >= target) { > *data_ready_now = true; > } else { > /* We can't read right now because there is nothing in the >-- >2.25.1