From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FABFECE58C for ; Fri, 11 Oct 2019 14:37:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84936222BE for ; Fri, 11 Oct 2019 14:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbfJKOhq (ORCPT ); Fri, 11 Oct 2019 10:37:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44558 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbfJKOhq (ORCPT ); Fri, 11 Oct 2019 10:37:46 -0400 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDADD85537 for ; Fri, 11 Oct 2019 14:37:45 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id n18so4444670wro.11 for ; Fri, 11 Oct 2019 07:37:45 -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:user-agent; bh=cJdL4DlBZ1DsoqoslBnw04GmuGAbbtWTmEe0mcYukas=; b=aSwDHgVvmUkOS1/1WvoFUDyYt7ipg0AklgE8SsZkXsO7wRLa/pKkhO+klP+UhVN+vX RA9io9tCRQI5QgNbUtoO201B4IIieHddXntjPEhag2Rq9Qqui0oSNKzOQKP5An2vCdX5 yz3T5sleVFjryC0ZqhbN3ibjj+TQ3Klhs3p3wUmxSXwh/LHDdBbKjPVLO/joYxehQwZa FnFq9c7ZwGcxhY7l1X1krP3IDiVFqVJteRado13Ff0/74C37uBHy/cCNGypjt7vrOgtF Z9ct8yacybZGFA9UByNxTEYD5/6yrcJfD+yM5qfa70jXEjVc38IqddtL1W5UeH9H81RB ZjVA== X-Gm-Message-State: APjAAAViT5DCDhHBlONU+3YsufvZEyMPdpokTaTe6N+HEfv3qvdCkVKh ndrp/5zJ+3mGoO/3m6acjLEPPxFwm2FHpRl8EBiNFp1y7zUGEQSj5eEyY7YZc5cQbNYWLP2qW4d aCl5z+t7m36gI X-Received: by 2002:adf:a516:: with SMTP id i22mr14579490wrb.273.1570804664502; Fri, 11 Oct 2019 07:37:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNdP5yvb8Rbsm9tLzeyjamBn7Ne70jEAdvVVgHzVT6Bjn+tQzwtYnB8hZDowTkrOmAzV3rXQ== X-Received: by 2002:adf:a516:: with SMTP id i22mr14579472wrb.273.1570804664273; Fri, 11 Oct 2019 07:37:44 -0700 (PDT) Received: from steredhat (host174-200-dynamic.52-79-r.retail.telecomitalia.it. [79.52.200.174]) by smtp.gmail.com with ESMTPSA id y14sm13296394wrd.84.2019.10.11.07.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 07:37:43 -0700 (PDT) Date: Fri, 11 Oct 2019 16:37:41 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Jorgen Hansen , "David S. Miller" , Stefan Hajnoczi , Adit Ranadive , Jason Wang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 1/2] vsock: add half-closed socket details in the implementation notes Message-ID: <20191011143741.frgdjcyee25wpcmf@steredhat> References: <20191011130758.22134-1-sgarzare@redhat.com> <20191011130758.22134-2-sgarzare@redhat.com> <20191011101936-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011101936-mutt-send-email-mst@kernel.org> User-Agent: NeoMutt/20180716 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Oct 11, 2019 at 10:22:30AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 11, 2019 at 03:07:57PM +0200, Stefano Garzarella wrote: > > vmci_transport never allowed half-closed socket on the host side. > > Since we want to have the same behaviour across all transports, we > > add a section in the "Implementation notes". > > > > Cc: Jorgen Hansen > > Cc: Adit Ranadive > > Signed-off-by: Stefano Garzarella > > --- > > net/vmw_vsock/af_vsock.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c > > index 2ab43b2bba31..27df57c2024b 100644 > > --- a/net/vmw_vsock/af_vsock.c > > +++ b/net/vmw_vsock/af_vsock.c > > @@ -83,6 +83,10 @@ > > * TCP_ESTABLISHED - connected > > * TCP_CLOSING - disconnecting > > * TCP_LISTEN - listening > > + * > > + * - Half-closed socket is supported only on the guest side. recv() on the host > > + * side should return EOF when the guest closes a connection, also if some > > + * data is still in the receive queue. > > */ > > > > #include > > That's a great way to lose data in a way that's hard to debug. > > VMCI sockets connect to a hypervisor so there's tight control > of what the hypervisor can do. > > But vhost vsocks connect to a fully fledged Linux, so > you can't assume this is safe. And application authors do not read > kernel source. Thanks for explaining. Discard this patch, I'll try to add a getsockopt() to allow the tests (and applications) to understand if half-closed socket is supported or not. Stefano