All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
To: Stefano Garzarella <sgarzare@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"kys@microsoft.com" <kys@microsoft.com>,
	"haiyangz@microsoft.com" <haiyangz@microsoft.com>,
	"sthemmin@microsoft.com" <sthemmin@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Bryan Tan <bryantan@vmware.com>, Vishnu Dasa <vdasa@vmware.com>,
	Krasnov Arseniy <oxffffaa@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: "virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	kernel <kernel@sberdevices.ru>,
	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
Subject: [PATCH net-next v4 3/9] virtio/vsock: use 'target' in notify_poll_in callback
Date: Fri, 19 Aug 2022 05:29:34 +0000	[thread overview]
Message-ID: <61ef8a18-24fe-d16c-b093-764d3b66804a@sberdevices.ru> (raw)
In-Reply-To: <de41de4c-0345-34d7-7c36-4345258b7ba8@sberdevices.ru>

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.

Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
---
 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;
 }
-- 
2.25.1

  parent reply	other threads:[~2022-08-19  5:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  5:21 [PATCH net-next v4 0/9] vsock: updates for SO_RCVLOWAT handling Arseniy Krasnov
2022-08-19  5:25 ` [PATCH net-next v4 1/9] vsock: SO_RCVLOWAT transport set callback Arseniy Krasnov
2022-08-19  5:27 ` [PATCH net-next v4 2/9] hv_sock: disable SO_RCVLOWAT support Arseniy Krasnov
2022-08-19  5:29 ` Arseniy Krasnov [this message]
2022-08-19  5:31 ` [PATCH net-next v4 4/9] vmci/vsock: use 'target' in notify_poll_in callback Arseniy Krasnov
2022-08-19  5:33 ` [PATCH net-next v4 5/9] vsock: pass sock_rcvlowat to notify_poll_in as target Arseniy Krasnov
2022-08-19  5:36 ` [PATCH net-next v4 6/9] vsock: add API call for data ready Arseniy Krasnov
2022-08-19  5:39 ` [PATCH net-next v4 7/9] virtio/vsock: check SO_RCVLOWAT before wake up reader Arseniy Krasnov
2022-08-19  5:41 ` [PATCH net-next v4 8/9] vmci/vsock: " Arseniy Krasnov
2022-08-19  5:43 ` [PATCH net-next v4 9/9] vsock_test: POLLIN + SO_RCVLOWAT test Arseniy Krasnov
2022-08-23  9:20 ` [PATCH net-next v4 0/9] vsock: updates for SO_RCVLOWAT handling patchwork-bot+netdevbpf
2022-08-23 19:14 ` Stefan Hajnoczi
2022-08-23 19:14   ` Stefan Hajnoczi
2022-08-23 19:18   ` Jakub Kicinski
2022-08-23 20:30     ` Stefan Hajnoczi
2022-08-23 20:30       ` Stefan Hajnoczi
2022-08-23 20:57       ` Paolo Abeni
2022-08-23 20:57         ` Paolo Abeni
2022-08-24  3:48         ` Arseniy Krasnov
2022-08-29 13:52         ` Stefano Garzarella
2022-08-29 13:52           ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61ef8a18-24fe-d16c-b093-764d3b66804a@sberdevices.ru \
    --to=avkrasnov@sberdevices.ru \
    --cc=bryantan@vmware.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=kernel@sberdevices.ru \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oxffffaa@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=pv-drivers@vmware.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=sthemmin@microsoft.com \
    --cc=vdasa@vmware.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.