linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arseny Krasnov <arseny.krasnov@kaspersky.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Norbert Slusarek <nslusarek@gmx.net>,
	Colin Ian King <colin.king@canonical.com>,
	Andra Paraschiv <andraprs@amazon.com>, kvm <kvm@vger.kernel.org>,
	Linux Virtualization <virtualization@lists.linux-foundation.org>,
	netdev <netdev@vger.kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	Krasnov Arseniy <oxffffaa@gmail.com>
Subject: Re: [MASSMAIL KLMS] Re: [RFC PATCH v1 05/16] af_vsock: use SOCK_STREAM function to check data
Date: Wed, 30 Jun 2021 20:47:25 +0300	[thread overview]
Message-ID: <ed0a3ac9-41eb-8826-9758-b1e7f1831e0e@kaspersky.com> (raw)
In-Reply-To: <CAGxU2F6owSKJWEkYSTBGy+yrVhp1tcjDmC+gwj9NAJzddMrFkQ@mail.gmail.com>


On 30.06.2021 15:10, Stefano Garzarella wrote:
> On Mon, Jun 28, 2021 at 01:02:47PM +0300, Arseny Krasnov wrote:
>> Also remove 'seqpacket_has_data' callback from transport.
>>
>> Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
>> ---
>> include/net/af_vsock.h   |  1 -
>> net/vmw_vsock/af_vsock.c | 12 +-----------
>> 2 files changed, 1 insertion(+), 12 deletions(-)
> In order to avoid issues while bisecting the kernel, we should have
> commit that doesn't break the build or the runtime, so please take this
> in mind also for other commits.
>
> For example here we removed the seqpacket_has_data callbacks assignment
> before to remove where we use the callback, with a potential fault at
> runtime.
>
> I think you can simply put patches from 1 to 5 together in a single
> patch.
>
> In addition, we should move these changes after we don't need
> vsock_connectible_has_data() anymore, for example, where we replace the
> receive loop logic.
>
> Thanks,
> Stefano
Ack
>
>> diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
>> index ab207677e0a8..bf5ea1873e6f 100644
>> --- a/include/net/af_vsock.h
>> +++ b/include/net/af_vsock.h
>> @@ -141,7 +141,6 @@ struct vsock_transport {
>>       int (*seqpacket_enqueue)(struct vsock_sock *vsk, struct msghdr *msg,
>>                                size_t len);
>>       bool (*seqpacket_allow)(u32 remote_cid);
>> -      u32 (*seqpacket_has_data)(struct vsock_sock *vsk);
>>
>>       /* Notification. */
>>       int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
>> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
>> index 21ccf450e249..59ce35da2e5b 100644
>> --- a/net/vmw_vsock/af_vsock.c
>> +++ b/net/vmw_vsock/af_vsock.c
>> @@ -860,16 +860,6 @@ s64 vsock_stream_has_data(struct vsock_sock *vsk)
>> }
>> EXPORT_SYMBOL_GPL(vsock_stream_has_data);
>>
>> -static s64 vsock_connectible_has_data(struct vsock_sock *vsk)
>> -{
>> -      struct sock *sk = sk_vsock(vsk);
>> -
>> -      if (sk->sk_type == SOCK_SEQPACKET)
>> -              return vsk->transport->seqpacket_has_data(vsk);
>> -      else
>> -              return vsock_stream_has_data(vsk);
>> -}
>> -
>> s64 vsock_stream_has_space(struct vsock_sock *vsk)
>> {
>>       return vsk->transport->stream_has_space(vsk);
>> @@ -1881,7 +1871,7 @@ static int vsock_connectible_wait_data(struct
>> sock *sk,
>>       err = 0;
>>       transport = vsk->transport;
>>
>> -      while ((data = vsock_connectible_has_data(vsk)) == 0) {
>> +      while ((data = vsock_stream_has_data(vsk)) == 0) {
>>               prepare_to_wait(sk_sleep(sk), wait, TASK_INTERRUPTIBLE);
>>
>>               if (sk->sk_err != 0 ||
>> -- 2.25.1
>>
>

  reply	other threads:[~2021-06-30 17:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  9:59 [RFC PATCH v1 00/16] Improve SOCK_SEQPACKET receive logic Arseny Krasnov
2021-06-28 10:01 ` [RFC PATCH v1 01/16] vhost/vsock: don't set 'seqpacket_has_data()' callback Arseny Krasnov
2021-06-28 10:01 ` [RFC PATCH v1 02/16] vsock/loopback: " Arseny Krasnov
2021-06-28 10:02 ` [RFC PATCH v1 03/16] virtio/vsock: " Arseny Krasnov
2021-06-28 10:02 ` [RFC PATCH v1 04/16] virtio/vsock: remove 'virtio_transport_seqpacket_has_data' Arseny Krasnov
2021-06-28 10:02 ` [RFC PATCH v1 05/16] af_vsock: use SOCK_STREAM function to check data Arseny Krasnov
2021-06-30 12:10   ` Stefano Garzarella
2021-06-30 17:47     ` Arseny Krasnov [this message]
2021-06-28 10:03 ` [RFC PATCH v1 06/16] vsock/virtio: remove record size limit for SEQPACKET Arseny Krasnov
2021-06-28 10:03 ` [RFC PATCH v1 07/16] virtio/vsock: don't count EORs on receive Arseny Krasnov
2021-06-30 12:11   ` Stefano Garzarella
2021-06-30 17:47     ` Arseny Krasnov
2021-06-28 10:03 ` [RFC PATCH v1 08/16] af_vsock: change SEQPACKET receive loop Arseny Krasnov
2021-06-30 12:12   ` Stefano Garzarella
2021-06-30 17:47     ` Arseny Krasnov
2021-06-28 10:03 ` [RFC PATCH v1 09/16] af_vsock/virtio: update dequeue callback interface Arseny Krasnov
2021-06-28 10:03 ` [RFC PATCH v1 10/16] virtio/vsock: update SEQPACKET dequeue logic Arseny Krasnov
2021-06-28 10:04 ` [RFC PATCH v1 11/16] afvsock: add 'seqpacket_drop()' Arseny Krasnov
2021-06-30 12:12   ` Stefano Garzarella
2021-06-30 17:48     ` Arseny Krasnov
2021-06-28 10:04 ` [RFC PATCH v1 12/16] virtio/vsock: add 'drop until EOR' logic Arseny Krasnov
2021-06-28 10:04 ` [RFC PATCH v1 13/16] vhost/vsock: enable 'seqpacket_drop' callback in transport Arseny Krasnov
2021-06-28 10:05 ` [RFC PATCH v1 14/16] virtio/vsock: " Arseny Krasnov
2021-06-28 10:05 ` [RFC PATCH v1 15/16] vsock/loopback: " Arseny Krasnov
2021-06-28 10:05 ` [RFC PATCH v1 16/16] vsock_test: SEQPACKET read to broken buffer Arseny Krasnov
2021-06-30 12:17   ` 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=ed0a3ac9-41eb-8826-9758-b1e7f1831e0e@kaspersky.com \
    --to=arseny.krasnov@kaspersky.com \
    --cc=andraprs@amazon.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nslusarek@gmx.net \
    --cc=oxffffaa@gmail.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).