Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp207523rdf; Mon, 20 Nov 2023 23:32:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGq8G+ZgLlL77OOLe5ewoCniTR92axdqSVGWwhk1Fh1HYD2i27IWC4LtnUVViO4WTFXFJFE X-Received: by 2002:a17:902:9309:b0:1cc:7077:c87c with SMTP id bc9-20020a170902930900b001cc7077c87cmr10006504plb.14.1700551927234; Mon, 20 Nov 2023 23:32:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700551927; cv=none; d=google.com; s=arc-20160816; b=cHhbtvAOxwxsAMgUAHTCDrU+A4IN4h8ydVf6TyubfqFliWkXuXSwRNenUdxMZRK3L5 VNR7J6ksWIfDlxNi1aG512KNbcePB0B+VRoqFkqIrWEaHr8UC63O9IHXPTDGLqnfjOin +RaSuc9KjZ3GqF1bs2mI2AzCkpYlj69UfyuHexPBnQL9Xyt0TTDUbakDT0ful3ny8Z6e UXSWUM+Sj5TCjSVbTJ5S8vWMwnn6+TZ276M1oAfTOZCRYQ+a+lzhlpFQAQNaLQXs13Ps B0BpSOgA5ZFM3r/DlhYwr64VjKGpQUd1dfxEGX0QGWImFBJnq7MTp+J0CJn23mXQTOmv TYgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=77Bzl/+Kq0+MzNg2uBfJvKrlDQ1jm6M8H9m1x9Ji14Q=; fh=ARFoO5Pk7SniYIzyAg9Z8eUcw3AUCiaEHOgWusT66QQ=; b=LUHlpwBTToXWsBsm5FPqi0wUIT1U5+jlaOFqYHbCUGNO6hfH6xW9KmXX3BOHjiiuPj 46vWgbzeClIsw6ZJCnWr2tSaUML2iZOUcnk7nQuTRg9mIwYItKkXJOfK/my+u+8EH8G/ L98gsSb8Az2QQVtq22mzmm8zttgk7XGXsHoOx6Hcgb+6Bv9SDN57fF/h4xfTS9+7aOL1 G/TRaf1QvU/3A7xdvgwHoOc0u609d4EAeDNfxfWrgVtDC8JrqdDuqwxKQ3cooSq61vC1 Khx4svSn4JHRvkow2ufDtKU8YR4AuxfkLvQOTcm1r19XvTdTXWDcgDW15gei2pY38OVT w5sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G9bNE1EP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id p10-20020a1709026b8a00b001bde9e8a29fsi9330854plk.183.2023.11.20.23.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 23:32:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G9bNE1EP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 745A4807C741; Mon, 20 Nov 2023 23:32:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjKUHbt (ORCPT + 99 others); Tue, 21 Nov 2023 02:31:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjKUHbn (ORCPT ); Tue, 21 Nov 2023 02:31:43 -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 8FDBF10E for ; Mon, 20 Nov 2023 23:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700551899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=77Bzl/+Kq0+MzNg2uBfJvKrlDQ1jm6M8H9m1x9Ji14Q=; b=G9bNE1EPKLxDZi+B3kkNegL2Jeft7dD1SS7TQiSudQ9jlOXgv29gDnJg2zAb/WFJk4xrhI gSuoq5Uv6Bi4GdiByrtPeHSaPoxwVbN05nFrCSQm7zaXXmhVBrzYCzsLYtAb2iKVnCJi2R egN9LBEvpVy/tfYMNsBUyEY0GfVaYLA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-ETEATdwXPl-IT_04BPdwNQ-1; Tue, 21 Nov 2023 02:31:35 -0500 X-MC-Unique: ETEATdwXPl-IT_04BPdwNQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F6543804A4D; Tue, 21 Nov 2023 07:31:35 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60E281C060B0; Tue, 21 Nov 2023 07:31:32 +0000 (UTC) From: Cindy Lu To: lulu@redhat.com, jasowang@redhat.com, mst@redhat.com, xieyongji@bytedance.com, linux-kernel@vger.kernel.org, maxime.coquelin@redhat.com Subject: [PATCH v2 5/5] Documentation: Add reconnect process for VDUSE Date: Tue, 21 Nov 2023 15:30:50 +0800 Message-Id: <20231121073050.287080-6-lulu@redhat.com> In-Reply-To: <20231121073050.287080-1-lulu@redhat.com> References: <20231121073050.287080-1-lulu@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 23:32:04 -0800 (PST) Add the document to explained how the reconnect process include how the Userspace App need to do and how it works with kernel Signed-off-by: Cindy Lu --- Documentation/userspace-api/vduse.rst | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/userspace-api/vduse.rst b/Documentation/userspace-api/vduse.rst index bdb880e01132..6e01c21d94df 100644 --- a/Documentation/userspace-api/vduse.rst +++ b/Documentation/userspace-api/vduse.rst @@ -231,3 +231,32 @@ 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 not create + the device. If yes means this is reconnect, goto 3 + +1. Create a new VDUSE instance with ioctl(VDUSE_CREATE_DEV) on + /dev/vduse/control. + +2. In ioctl(VDUSE_CREATE_DEV), the kernel alloc the memory to sync the reconnect + information. + +3. Userspace App will mmap the pages to userspace + + If this first time to connect, userspace App need save the reconnect + information (struct vhost_reconnect_data) in mapped pages + + If this is reconnect, userspace App need to check if the saved information + OK to reconnect, Also userspace App MUST set the bit reconnected in + struct vhost_reconnect_data to 1. (kernel will use this bit to identify if the + userAPP is reconnected ) + +4. Successfully start the userspace App. + userspace APP need to call ioctl VDUSE_VQ_GET_INFO to sync the vq information. also + APP need to save the reconnect information (struct vhost_reconnect_vring) + while running + +5. When the Userspace App exit, Userspace App need to unmap all the reconnect + pages -- 2.34.3