Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp262158pxv; Wed, 30 Jun 2021 05:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeRUicbt0OFKCwO6mtDfEDthVMmb0vQGH3j/Cksrcvw/B3d7rGHK0b1AmI2Yw1Fpm8MQSR X-Received: by 2002:a5d:9f4b:: with SMTP id u11mr7376827iot.144.1625055145276; Wed, 30 Jun 2021 05:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625055145; cv=none; d=google.com; s=arc-20160816; b=BJqnP2Pn9E46w4m8hlphfX1oSJLyEBhl0/PJ/6ELyO/YZ2/vKx2XgjlkgzCDiaf/mQ ACT3tZs0uXARgayd9i/hxhFgmZQKwsW+OXlwysQlVY4B1ABX7fBcPeO6MrA1amN69XQA pZaaYhlVYh1iXeRJnvsL2g1hGv2HN3DFVYaFwcAhVTDjds0rpDg65X9AP4SGeP5KVQVM r5vkiUYHApJRqLm+xNQreaaxCidBK0y7WuyhFcZHCNAMPzcHWyvzbml+cGQvQZMTkS8h 4HjfQUapiG8iL7+nmvMrVgsfZ8wNN/Fas2y/JUKzWdNTKj45/M9kmSgHc4E/WeJp6gZc o8Dg== 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=fPmSNjorX8tf2eCOIhHKnRjZ2avWw2QnQ177mXZw2z8=; b=ZjC7OTBW+t/LpQEU7U/frja7c+jRuwPhaP82+1bDipx2hkKKIXRF7yTqEeNEK3qrkp 3nlUcjt6YXyciAFYl0fb9H0L2hUlUOWBIVgIUPCPpHXFWV53rvrElvDhr1iVA507x+XE do6BE1SFD7kLW41w7p2UWx0BTQ/1FCaPTflz26+ecpX+v65v73RsljSkdYvBuqOEXCa4 2OB+W66cdNMcALNnFGhFyJ/Fjp54hq3AudoeVklLQVRVrAKeNu+PeZff9L9nXrSjJdfZ MmAE6JlpLF35XOuHcViZXl7iXRmqybSueWPLGwBfziryg/2sEr+AZ+CXm9gThc1rZ5vw siIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZWQj9HdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si27139162jan.49.2021.06.30.05.12.11; Wed, 30 Jun 2021 05:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZWQj9HdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234515AbhF3MNU (ORCPT + 99 others); Wed, 30 Jun 2021 08:13:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50086 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234486AbhF3MNS (ORCPT ); Wed, 30 Jun 2021 08:13:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625055049; 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=fPmSNjorX8tf2eCOIhHKnRjZ2avWw2QnQ177mXZw2z8=; b=ZWQj9HdVwRxuMcsvSRGyagOfx8ZXGzu6icJrFSpfXGVZ9Fkfb5/ohHRo6Fk6ODv2QspnaB H8gvhMcTgrp8b/OK/WUvf03U0H4dbeNxKDG9d1Y//qKr5MFEx3W74+mVUjH8hkMT7TTclV nFFXg+VeCjiSt5+54RqTmPcgZr639vw= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-298-o4Sn_YQjOkiS634bROQfUA-1; Wed, 30 Jun 2021 08:10:48 -0400 X-MC-Unique: o4Sn_YQjOkiS634bROQfUA-1 Received: by mail-ed1-f72.google.com with SMTP id o8-20020aa7dd480000b02903954c05c938so1050533edw.3 for ; Wed, 30 Jun 2021 05:10:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fPmSNjorX8tf2eCOIhHKnRjZ2avWw2QnQ177mXZw2z8=; b=Z0H2SMj0BYo7UIjKGj4zojhcg1aao2xK8TdHPFuMnf9X1htpMMLN2Fm/r5cIpeNBXK KS1edA0R/bJke6SLmQcfFqKOhYTHG+95TBiLWdySuVInI4sQwYVnj64T6IzYo0y5/bem ov0EMEObi0ImoRUEw/2gcuLPYtWwpzyQMPyeWk7sOjnbm6ATPoPwFA33rP3IwH/xXC4h 74g8uP//LC4ePlEblTIih8ivN4F3cFnBl4M2QgqIWAZpSRoKLdu68rpddGC+4GqGjBuB zRKoj/l+sSAc4XKjx7esuLUUWJtEK1MoW2//GFgTX+TIzrPSBPY7CgdQHQinyx2naoWN UVtw== X-Gm-Message-State: AOAM5328W8MsW2wpdCirixBeNwikEHcDmrYmZ7It0uDSSbxG1h121u6S RadUtKIFo2ARmSm5sM00OUWopWkIaC4Wo704ZjCulrLRh5QM/ysINmoD0LZW+VNNuO+pshlEyus QBxgRjGKm71SOyDWzl8wKF8fw X-Received: by 2002:a17:906:3a53:: with SMTP id a19mr20641904ejf.88.1625055046853; Wed, 30 Jun 2021 05:10:46 -0700 (PDT) X-Received: by 2002:a17:906:3a53:: with SMTP id a19mr20641875ejf.88.1625055046551; Wed, 30 Jun 2021 05:10:46 -0700 (PDT) Received: from steredhat (host-79-18-148-79.retail.telecomitalia.it. [79.18.148.79]) by smtp.gmail.com with ESMTPSA id v5sm947889edy.50.2021.06.30.05.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 05:10:46 -0700 (PDT) Date: Wed, 30 Jun 2021 14:10:44 +0200 From: Stefano Garzarella To: Arseny Krasnov Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Norbert Slusarek , Colin Ian King , Andra Paraschiv , kvm , Linux Virtualization , netdev , kernel list , Krasnov Arseniy Subject: Re: [RFC PATCH v1 05/16] af_vsock: use SOCK_STREAM function to check data Message-ID: References: <20210628095959.569772-1-arseny.krasnov@kaspersky.com> <20210628100250.570726-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210628100250.570726-1-arseny.krasnov@kaspersky.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >--- > 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 > >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 >