Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp64100ybi; Thu, 1 Aug 2019 14:42:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8qP4byAM+rIIYV+5EbF1FJqzNVgqM1dzB1dXsWoWGlIWIDzamx7zCTaLURsPiExqHz6mI X-Received: by 2002:a17:90a:9bca:: with SMTP id b10mr887689pjw.90.1564695759904; Thu, 01 Aug 2019 14:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564695759; cv=none; d=google.com; s=arc-20160816; b=dliry45rmz8YLwD4qGxfKdsJNH7I75rqX2ioru05GCqcfuAsi3ox6q7fen9Lqw47qM FX/aW8rO/xw4wGcOKRJgjiizlOol623KXOUiAqw6IfPB0gflzV7HmJ7U4tlaWJyI8sdX fAjBdn24Ojb+d3u7LTSkrCnTDaHRz0TNRECLpemMQASOuaorWlrmh2/VEbUOmnOlXegx KhtI9FpZrd1ODvKjQd4vYnPUxD43cTAiVgLIeeyW3GdF7r4Cyajbl1OobRg1FdgG+Pw+ OfIj7gSh71JOcenAT4B6FEI/jK3EumC0RPJyy+uZwhgR7IA4wY3RiBogW7KJNBlnThKM wVpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=a0EUgeGqQ7K8JBk8474/F7Qfdf6czPogTZsCAuEQGPE=; b=g4PoknuY3frGXJHzzzkTP1Y/ZtwLuREzWBR6HYyLahdnwJPCWY9FEqyU5esmhgaJ2S hSSMgZiZJyee3nat1xdA99PEjvhArBkiqir0WWyPDMY7pDnAU/L6C0BifMpr9YzDhw+B vMX/qsCM9hVcDO272vT50MMEGwWOvt9Qiiz4HQbLvLGlK1tb7PTkudXFqdLkFuHBqThx 5eDl9dVZ4xkiBU/31lgIv5ZOEE2/iKqP4gV/SHglLIEu50rv4UhkFMvvtguQKjrGsAYn Yq5q2V4LwMcqqU+7QfMCWCakmpB9W+StjTfFrt/OYIcCFwPIeo7QJiPFsxprPNwRtFGi uaEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si24938237pgr.196.2019.08.01.14.42.20; Thu, 01 Aug 2019 14:42:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732401AbfHAP6m (ORCPT + 99 others); Thu, 1 Aug 2019 11:58:42 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40673 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732315AbfHAP6l (ORCPT ); Thu, 1 Aug 2019 11:58:41 -0400 Received: by mail-wm1-f68.google.com with SMTP id v19so63707068wmj.5 for ; Thu, 01 Aug 2019 08:58:40 -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=a0EUgeGqQ7K8JBk8474/F7Qfdf6czPogTZsCAuEQGPE=; b=cVmJk6D1wod+tuZTBfVHAlrliIJ3ms6lCGgvUyU2UPvU4KppdfpeKk1EeHhDDdIaRv 6cLFdnXSoEe/iQx9doMuGV820dOKv2h9VYObUlrvhWDGNvusaRdfsm68JBONq31gA0Os mAEMqycclXCYvZjdXhQFhhB0iyn+qHkP/pTar46PzlM7S/Sz5YWXleV6yFzdBZGYdWu1 jAsvS9+eRIDosEXb1HzcPXIqigGGncyO8lr23y6MNZKFvXYED6cuTFYJzcmHn29YBorU LVNfbea3l9h/SKT7h2jt3On6YVVnBhBQENj85ICYodQ7Vl4xoN+JPRkKgR1Zx7g5WOik f7zw== X-Gm-Message-State: APjAAAXGVDN3scq7mVkG+oQ7ez/juKdJQH0tkFfNO15GETo168v4ybhC 6ZfdQgqkEzWBIAwCj0yCWEjQww== X-Received: by 2002:a05:600c:2388:: with SMTP id m8mr15142423wma.23.1564675119726; Thu, 01 Aug 2019 08:58:39 -0700 (PDT) Received: from steredhat (host122-201-dynamic.13-79-r.retail.telecomitalia.it. [79.13.201.122]) by smtp.gmail.com with ESMTPSA id r4sm44542036wrq.82.2019.08.01.08.58.38 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 01 Aug 2019 08:58:39 -0700 (PDT) Date: Thu, 1 Aug 2019 17:58:36 +0200 From: Stefano Garzarella To: Sergei Shtylyov Cc: netdev@vger.kernel.org, kvm@vger.kernel.org, Stefan Hajnoczi , Dexuan Cui , virtualization@lists.linux-foundation.org, "David S. Miller" , Jorgen Hansen , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 10/11] vsock_test: skip read() in test_stream*close tests on a VMCI host Message-ID: <20190801155836.ssounrtdtm5m6q6u@steredhat> References: <20190801152541.245833-1-sgarzare@redhat.com> <20190801152541.245833-11-sgarzare@redhat.com> <79ffb2a6-8ed2-cce2-7704-ed872446c0fe@cogentembedded.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79ffb2a6-8ed2-cce2-7704-ed872446c0fe@cogentembedded.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 01, 2019 at 06:53:32PM +0300, Sergei Shtylyov wrote: > Hello! > Hi :) > On 08/01/2019 06:25 PM, Stefano Garzarella wrote: > > > When VMCI transport is used, if the guest closes a connection, > > all data is gone and EOF is returned, so we should skip the read > > of data written by the peer before closing the connection. > > > > Reported-by: Jorgen Hansen > > Signed-off-by: Stefano Garzarella > > --- > > tools/testing/vsock/vsock_test.c | 26 ++++++++++++++++++++++++-- > > 1 file changed, 24 insertions(+), 2 deletions(-) > > > > diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c > > index cb606091489f..64adf45501ca 100644 > > --- a/tools/testing/vsock/vsock_test.c > > +++ b/tools/testing/vsock/vsock_test.c > [...] > > @@ -79,16 +80,27 @@ static void test_stream_client_close_server(const struct test_opts *opts) > > exit(EXIT_FAILURE); > > } > > > > + local_cid = vsock_get_local_cid(fd); > > + > > control_expectln("CLOSED"); > > > > send_byte(fd, -EPIPE); > > - recv_byte(fd, 1); > > + > > + /* Skip the read of data wrote by the peer if we are on VMCI and > > s/wrote/written/? > Thanks, I'll fix it! Stefano > > + * we are on the host side, because when the guest closes a > > + * connection, all data is gone and EOF is returned. > > + */ > > + if (!(opts->transport == TEST_TRANSPORT_VMCI && > > + local_cid == VMADDR_CID_HOST)) > > + recv_byte(fd, 1); > > + > > recv_byte(fd, 0); > > close(fd); > > } > [...] > > MBR, Sergei --