Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1512275rdb; Thu, 7 Dec 2023 00:47:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCpppC+bM05wnDuHW+rvVMDeuMxs9qdU0T7N0Dm+a0UcMmgrNHafYgmst6enUbw7vVhGpY X-Received: by 2002:a17:902:d48b:b0:1cf:7c3d:df68 with SMTP id c11-20020a170902d48b00b001cf7c3ddf68mr2418326plg.39.1701938837718; Thu, 07 Dec 2023 00:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701938837; cv=none; d=google.com; s=arc-20160816; b=gKwCq0l1wamVie9vs0IKFH4Kk2LHoBTTstvZkB8xj0PadbyxQqWECUWA0yJ3zFlYD5 Qgz0LQMcdJwtdgiEK9W6ZX5QKbftTj//PTmmK811mTSGr1fZEe1OO/mFOtHbUYiXZ4tc 0ictE2J22dsW5aEwl8OEPaXbkBalWIAsrQ4pGjwKH6835Ujmwn33kAwKqegXGC/5uGaw rsTbnMsoskOW8XzrWny/ZjSwq36BuHJ0BK4a1//zXQWMSKYT6y/ZBklM2w8aDoR95os7 eVLDtT97smKZuhUVfi0ddcNXqwccWLYam1BOXHH1FXvsZurZ+R1PNiBOkad6Bh9zfDJe ttPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Wa+ZVqhAONpvfJ8gOpR3U5TlBPgIPDBI52ExBUdPgdo=; fh=ir7cOO3TfsXjq7Y5DnAiuq3+k2gzyaCCb4HcXAX8/h4=; b=aNSmjJwJgJ8JFUl1IpOqEpovQba9p++/17kwvuRY1VCAeNT9IQahsA/UyZd3Yf8XBG q4Uwl+HukCs/Z/OR5I/Ya9bssuJVfP76DsEd+wCzCDJNWAIfpS5K3PSvEFPTWK4Kpylv ZXi/3SGGRf4cuUt4EWgg4P+81lFW+Y3ccr543Hl//Lygedt7XwmO8Er+wzcMEZFAa7cW mRyc6AWDLRv7Bs8Aclor3cMChI4R3t8Rr/79/M02wTwGQ7JGZaKvoWQ5fX9l90NpQxRA usETn5kKPL7MCGDYmDOav7+41nkyPpsZf0eEDoCPEjanfAGB5pVp0NeP3nTkZxkMv5rG BCpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V760QoZB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b3-20020a170902d30300b001d0c41b1d34si749564plc.69.2023.12.07.00.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:47:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V760QoZB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3E5C181F3589; Thu, 7 Dec 2023 00:47:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378394AbjLGIqk (ORCPT + 99 others); Thu, 7 Dec 2023 03:46:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378414AbjLGIqa (ORCPT ); Thu, 7 Dec 2023 03:46:30 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D3F5D57 for ; Thu, 7 Dec 2023 00:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701938794; 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=Wa+ZVqhAONpvfJ8gOpR3U5TlBPgIPDBI52ExBUdPgdo=; b=V760QoZBMhqvxb/44iHspCUkfFLoM1mTvOyalwrLbWwtDy8hDZRqbVjkbHcoM8XpMFuKN1 KBuOVpMKdaPw3PqiqIAJnKZMvAKJmmWJ5bH5fxCZioWfXj747oNF4YIQJTge3R+Mx5hD0/ SMkopyuWAF87IQlnJe5ca/JvfhQYJSQ= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-4CM8DLDEOa65RPIpIk2nxg-1; Thu, 07 Dec 2023 03:46:33 -0500 X-MC-Unique: 4CM8DLDEOa65RPIpIk2nxg-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2888414ac91so596520a91.2 for ; Thu, 07 Dec 2023 00:46:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701938792; x=1702543592; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wa+ZVqhAONpvfJ8gOpR3U5TlBPgIPDBI52ExBUdPgdo=; b=cY3oHXyVQuWA4p127mbslLem7K3RuDgLaUUJk8f3+KulIhO/I10DbtqHaawtDLrNVF I/gaz7LlYfMS+JqGscffEw1tzPaA7Gzcf8T0qj+XgVHr5jeO4kCwBCzeQwPcUOdh9i2X qkFqMMlt89C7gDZBRQrwGwpt1MRVNV5Ka12QZK3LHT/oY+fjrwTzjjTUPW7MnWixKbc/ ILcZNdlJDTAWGBr5kivfykJR7/L0I2TtgK3YbD1V48Rvj76rT8ScrdB8erj+JMYaf1Ge 0LUuiH9EIyiXmh86+zeP9r4MmOLIyG7TNLDDB8AKdHRc3K9hwbuDAirsNkhMrkhsh6kG X7Ew== X-Gm-Message-State: AOJu0YxcZu3HNLmSYJMKLhy9rbSjQPuvBlbX4jAM+8o0RX+bg+uM/ZXw 1/WGP5Z2TCLdLjwk+Aa/0AAycIyTtm7ZdZ3zZ+HXfZfcPsKZ2/9a37a0bzIBQW6DF9wjq3xn04y GOwO+OJehLMDq6rdgw4Rzhkxq4cIEdVYs/Nia44Tz X-Received: by 2002:a17:90a:d50b:b0:286:6cc1:5fd7 with SMTP id t11-20020a17090ad50b00b002866cc15fd7mr1867296pju.90.1701938792344; Thu, 07 Dec 2023 00:46:32 -0800 (PST) X-Received: by 2002:a17:90a:d50b:b0:286:6cc1:5fd7 with SMTP id t11-20020a17090ad50b00b002866cc15fd7mr1867294pju.90.1701938792090; Thu, 07 Dec 2023 00:46:32 -0800 (PST) MIME-Version: 1.0 References: <20231205083444.3029239-1-lulu@redhat.com> <20231205083444.3029239-8-lulu@redhat.com> In-Reply-To: <20231205083444.3029239-8-lulu@redhat.com> From: Jason Wang Date: Thu, 7 Dec 2023 16:46:20 +0800 Message-ID: Subject: Re: [PATCH v3 7/7] Documentation: Add reconnect process for VDUSE To: Cindy Lu Cc: mst@redhat.com, xieyongji@bytedance.com, linux-kernel@vger.kernel.org, maxime.coquelin@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 00:47:15 -0800 (PST) On Tue, Dec 5, 2023 at 4:35=E2=80=AFPM Cindy Lu wrote: > > Add a document explaining the reconnect process, including what the > Userspace App needs to do and how it works with the kernel. > > Signed-off-by: Cindy Lu > --- > Documentation/userspace-api/vduse.rst | 30 +++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/Documentation/userspace-api/vduse.rst b/Documentation/usersp= ace-api/vduse.rst > index bdb880e01132..ec66e573f6da 100644 > --- a/Documentation/userspace-api/vduse.rst > +++ b/Documentation/userspace-api/vduse.rst > @@ -231,3 +231,33 @@ able to start the dataplane processing as follows: > after the used ring is filled. > > For more details on the uAPI, please see include/uapi/linux/vduse.h. > + > +HOW VDUSE devices reconnectoin works > +---------------- > +0. Userspace APP checks if the device /dev/vduse/vduse_name exists. > + If it does not exist, need to create the instance. > + If it does exist, it means this is a reconnect and the program procee= ds to step 3. > + > +1. Create a new VDUSE instance with ioctl(VDUSE_CREATE_DEV) on > + /dev/vduse/control. > + > +2. When the ioctl(VDUSE_CREATE_DEV) function is called, the kernel alloc= ates memory > + to synchronize the reconnect information. This is the implementation details and I guess this doc only focuses on the uAPI. So there's no need to describe it here. > + > +3. Userspace App need to mmap the pages to userspace > + > + When connecting for the first time, the userspace app must save the r= econnect > + information (struct vhost_reconnect_data) in mapped pages This looks vague. We need to describe what kind of information that needs to be saved and when to save. Thanks > + > + If this is reconnect,If the purpose is to reconnect, the userspace ap= plication > + must verify if the saved information is suitable for reconnection. Ad= ditionally, > + the userspace application is required to set the "reconnected" bit in= the > + "struct vhost_reconnect_data" to "VDUSE_RECONNECT". The kernel will u= se this bit > + to identify if the userspace application is reconnect. > + > +4. Start the userspace App. > + userspace APP will call ioctl VDUSE_VQ_GET_INFO to sync the vq inform= ation. > + Additionally, the APP must save the vq reconnect information (struct = vdpa_vq_state) > + in mapped pages while running. > + > +5. When the Userspace App exits, it is necessary to unmap all the reconn= ect pages. > -- > 2.34.3 >