From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id C087A5A0275 for ; Mon, 12 Feb 2024 11:02:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707732141; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9lOrmOMT84/ccmqLw7HKqf6btW8xFcTq7Ri0UxO4C2E=; b=G9W1vWfY/w1l/7GEcMwKwCnEPTWDun7mTKrK8Ca0i6Xg7Wo6tJvhv6ZgyHcVlqx6wmKju5 zThjkIXPy5XgQSTT148M1alGEIa4UF0sBitPFjmgKEGFUAGQVdSR5mLelsfimWu9EMJJAV boM7lQxTMSDCLPNjWxMB0Uw1SU6bh5o= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-608-5rLQLNjqMxW-rF0mRKf58g-1; Mon, 12 Feb 2024 05:02:20 -0500 X-MC-Unique: 5rLQLNjqMxW-rF0mRKf58g-1 Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-4c03c961e66so957656e0c.2 for ; Mon, 12 Feb 2024 02:02:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707732140; x=1708336940; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9lOrmOMT84/ccmqLw7HKqf6btW8xFcTq7Ri0UxO4C2E=; b=gw+B12AOVdC3Ykdk/I6bWSmqZ6H9crYO0Qx4doYi1n4enrUFPtluiHMV8zUaufd3X/ 0zOmOBrZQQ8VSUmILCXeaga/OIWIDfTvND/A+qUacAp+y7SSftnk+xU4jkWxdG2wIV6M MaUPAV9OYRD3SZmNblgs1UZWjwLtuSZSOTVf2WYP0iDzqV9wUfOR2wXdKllN6Ybam1Zo GWvkAOyQAokeDpyolybBuVhC9bIXdJboM81TUfnGxGz9KvqmtZPyeBWrxiRwG5B+5V1/ h9b9/5+M67i5W3aBoSuHQKiGjGwaNEGu15f0ocEBriRR789fiKV/uqMhEXyRFv2E7ye6 cMQw== X-Gm-Message-State: AOJu0YyM/f5uioQxwlHUKuG3drwMgjZ1wXePLtQ5C4jH7hlno+TU5LtC MoptmmjsyMUHJ43x8zigtjdS1KF3i9hf1GVqH5aO8mIsIyEtXvk2K4C/gq+hQE1eoLR0qUluRsN J+gjouSefFWx6KFXTPVMiE3L23kPGzOVBjQ8s6waYGDdg0yzqrA== X-Received: by 2002:a05:6122:16aa:b0:4c0:849e:4ed with SMTP id 42-20020a05612216aa00b004c0849e04edmr1290032vkl.4.1707732138477; Mon, 12 Feb 2024 02:02:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2Dll4yaDdUwd9jtvKvd7/DyASh7iAM2LL1rHW2tbc2bq8gIRbvLJHuZm+x31Xr6wur338Ow== X-Received: by 2002:a05:6122:16aa:b0:4c0:849e:4ed with SMTP id 42-20020a05612216aa00b004c0849e04edmr1289957vkl.4.1707732137108; Mon, 12 Feb 2024 02:02:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXzLTyIO+6s3zKbCNYdiM5Bda0gQ7ptGY/F5a1Ap2+3Ir+SW6JdrQyDb0S5CJbQt4R+e0CzCuLkrlzcnpE8Kf54qyk= Received: from [192.168.100.30] ([82.142.8.70]) by smtp.gmail.com with ESMTPSA id ef11-20020a0562140a6b00b0068c9c9321a2sm10951qvb.35.2024.02.12.02.02.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 02:02:16 -0800 (PST) Message-ID: Date: Mon, 12 Feb 2024 11:02:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 20/24] vhost-user: add vhost-user To: David Gibson , Stefano Brivio References: <20240202141151.3762941-1-lvivier@redhat.com> <20240202141151.3762941-21-lvivier@redhat.com> <20240212001901.66ada100@elisabeth> From: Laurent Vivier In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: YSDQ6WQ3GTSXPXYM3BP4H6BGIBAFGPOM X-Message-ID-Hash: YSDQ6WQ3GTSXPXYM3BP4H6BGIBAFGPOM X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2/12/24 03:49, David Gibson wrote: > On Mon, Feb 12, 2024 at 12:19:01AM +0100, Stefano Brivio wrote: >> On Fri, 2 Feb 2024 15:11:47 +0100 >> Laurent Vivier wrote: >> >>> add virtio and vhost-user functions to connect with QEMU. >>> >>> $ ./passt --vhost-user >>> >>> and >>> >>> # qemu-system-x86_64 ... -m 4G \ >>> -object memory-backend-memfd,id=memfd0,share=on,size=4G \ >>> -numa node,memdev=memfd0 \ >>> -chardev socket,id=chr0,path=/tmp/passt_1.socket \ >>> -netdev vhost-user,id=netdev0,chardev=chr0 \ >>> -device virtio-net,mac=9a:2b:2c:2d:2e:2f,netdev=netdev0 \ >>> ... >>> >>> Signed-off-by: Laurent Vivier >>> --- >>> conf.c | 20 ++++++++++++++-- >>> passt.c | 7 ++++++ >>> passt.h | 1 + >>> tap.c | 73 ++++++++++++++++++++++++++++++++++++++++++--------------- >>> tcp.c | 8 +++++-- >>> udp.c | 6 +++-- >>> 6 files changed, 90 insertions(+), 25 deletions(-) >> This would need a matching change in the man page, passt.1, at least >> documenting the --vhost-user option and adjusting descriptions about >> the guest communication interface (look for "UNIX domain" there). >> >>> diff --git a/conf.c b/conf.c >>> index b6a2a1f0fdc3..40aa9519f8a6 100644 >>> --- a/conf.c >>> +++ b/conf.c >>> @@ -44,6 +44,7 @@ >>> #include "lineread.h" >>> #include "isolation.h" >>> #include "log.h" >>> +#include "vhost_user.h" >>> >>> /** >>> * next_chunk - Return the next piece of a string delimited by a character >>> @@ -735,9 +736,12 @@ static void print_usage(const char *name, int status) >>> info( " -I, --ns-ifname NAME namespace interface name"); >>> info( " default: same interface name as external one"); >>> } else { >>> - info( " -s, --socket PATH UNIX domain socket path"); >>> + info( " -s, --socket, --socket-path PATH UNIX domain socket path"); >> I don't get the point of --socket-path. It's handled just like -s >> anyway, right? Why can't it just be -s / --socket? > I believe the issue is that there's an expected command line interface > for the vhost server, which uses --socket-path for, well, the socket > path. Hence adding an alias to the existing passt option. > >>> info( " default: probe free path starting from " >>> UNIX_SOCK_PATH, 1); >>> + info( " --vhost-user Enable vhost-user mode"); >>> + info( " UNIX domain socket is provided by -s option"); >>> + info( " --print-capabilities print back-end capabilities in JSON format"); >> Instead of introducing a new option, couldn't we have these printed >> unconditionally with debug()? I guess it's debug-level stuff anyway. > Likewise, I think this option is expected by the thing which starts > the vhost server. > Yes, these parameters are defined in the vhost-user protocol specification: https://qemu-project.gitlab.io/qemu/interop/vhost-user.html#backend-program-conventions Thanks, Laurent