Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp105388rdh; Tue, 6 Feb 2024 21:48:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsakCdOBKjpKQP5Q3flUreFPQHxSVfBA+OOwNi9gx9J//RrET+ABtw1SATvql7lly3bAV+ X-Received: by 2002:aa7:c0c3:0:b0:560:dc3b:4ee4 with SMTP id j3-20020aa7c0c3000000b00560dc3b4ee4mr439652edp.3.1707284910439; Tue, 06 Feb 2024 21:48:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707284910; cv=pass; d=google.com; s=arc-20160816; b=Kjd9nJoHif4uoYYhrD1Vm1iH7OF5ExWC4yEOWZxpu3jBZWJGR0dHJ6LXVZ65AnxR1y fBgsSzJNGOtUrn/cxim9WlT3eO0Yj+OlEjtK6kWUnHKy7BnN+Mdd0bSoALg/NiHz2CBI 0dMHqIXEviSS0CsdNyTlpjad/0A3bMj1t/ZJ4pRj60PyC8b/sEalABI9iPuRGfSi+RfQ +37Q5pUpuGLqlD2cfKVEY65VjOV1ODkRmgJe+xqHs0ZbBiOhjf1HgOFKMMqa4+wHyh1L 7nxa4TS4AflERWganPaQUPZ3y2Q99nz6qjYoMUI3HuQq1cDhfPMxaTNjsX4aOzL1mBGF MI4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=mxvyLlwFPrOAb4E1s475cmzm9HXLhSgjIXU0tbGtRvE=; fh=BFOogiG0BRTrFonwJpDfhF+e1V+rGQi/PaB9jsVSRpM=; b=0uRQJjj4t4IjAbUvm5DmuhEtjjJpHmmLKx2BlDcw63GJw/5SYla0nsM5LtmORVUpm2 Vj37J+G+ffSYND3JBQ3KixYPxFvYOTlFJVchpDyoJmQ3i+/T9MkFDN7LxLaPPssTE7dU +lL05jLyiMSo8mDgL8Ued69wUeVTyhdEgZ3rH58vzdAsxNTn1x91CgcvPTceZHvEpXdO dlf+NfrvJav2uOGAXoSUYUrSqm2aJZgT4hpsACqLtwpIIfkyBGseXYB5lo4z5I9ZhD// uVtAi4twWZw3SyYClymrrBkUZUalr5ph+VDUCthLAJcunBUcMFKXaUZZ6UWJpiAz/LgI dJqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=flQ3DrS5; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCWs/RnvOf2t9W19sN+731sCXNR5gSO9D115YCMzIEPP6nTTvn2oMTnqlc3GfyU6VKvqfJ1fzWCOC2a/Y63HkeKK3iVoCZSivOHUgx9s4Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e25-20020a50ec99000000b00560852e9e18si429087edr.534.2024.02.06.21.48.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 21:48:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=flQ3DrS5; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-55985-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F16601F23594 for ; Wed, 7 Feb 2024 05:48:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06BCD200D1; Wed, 7 Feb 2024 05:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="flQ3DrS5" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DF96200A8 for ; Wed, 7 Feb 2024 05:47:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284872; cv=none; b=ohQPa59raDocByFa2rZTX2m/VEeqD7ArJvfhBbumoUCf2Hx3GKEp5tP/B2DwYfj/MKuoCdwXRQY0nHbHhAfu8iTwdCVwj4NW2/+Hia9ouwENe8a0PY9wHw6uzQmr7X5P9eCxYoEvD/UTJD4VvTEpsCQqxHEVx0s6SI+sov8BkXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284872; c=relaxed/simple; bh=6uX9zfQ8cQJ8WnngTxHu/ne5naJ+QAafInm6eyaxJy0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cs2sFLY1F5GkGSBNB32ScPaSvYjbQbPbO8oQz12+4vcN1A1LWlSCUziI+xXqBe71MNkrLNrbWMEJa27OOippbBIFNSAgT698BVir7cLz1kPjz8mUhexEfxMGbrAZ7lyRN9eb4LdPWiWtATryFlUJO2HMj4i9OOjVcoGYwop5e5E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=flQ3DrS5; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707284869; 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=mxvyLlwFPrOAb4E1s475cmzm9HXLhSgjIXU0tbGtRvE=; b=flQ3DrS54ZCp8VW/C5iohqfH+ufwKd3U+3uuU+lpCH3CxRRSrcDQQC/qjhwbXI5bj/GdIr d9uhc7xY2vHc5IcpdKdvdv4wzOI3qVG9hEO5VnJXHMDW/vxuW/+kCSicf6Bokrj1fyC4d4 Nl85h+naRLbd26T5kXR8AuGK4YXKO6g= 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-6-f3trEO6NNI-I9I6uYGLkcQ-1; Wed, 07 Feb 2024 00:47:45 -0500 X-MC-Unique: f3trEO6NNI-I9I6uYGLkcQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 76D903811F41; Wed, 7 Feb 2024 05:47:45 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECCD7492BC6; Wed, 7 Feb 2024 05:47:42 +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 v4 5/5] Documentation: Add reconnect process for VDUSE Date: Wed, 7 Feb 2024 13:43:32 +0800 Message-ID: <20240207054701.616094-6-lulu@redhat.com> In-Reply-To: <20240207054701.616094-1-lulu@redhat.com> References: <20240207054701.616094-1-lulu@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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 | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/userspace-api/vduse.rst b/Documentation/userspace-api/vduse.rst index bdb880e01132..a2be85e0e516 100644 --- a/Documentation/userspace-api/vduse.rst +++ b/Documentation/userspace-api/vduse.rst @@ -231,3 +231,35 @@ 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.goto step 1 + If it does exist, it means this is a reconnect and goto 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 allocates memory + to save the reconnect information. + +3. Userspace App need to mmap the pages to userspace + Userspace App need to map Pages 0 to vq_number for vq status, + Users can define the structure for saving the reconnect information themselves + in the userspace. + +4. Check if the infomatin sutiable for reconnect + If this is reconnect: + Before attempting to reconnect, The userspace application need to the + ioctl VDUSE_DEV_GET_CONFIG,VDUSE_DEV_GET_STATUS,VDUSE_DEV_GET_FEATURES... + to get the and confirm if these information are suitable for reconnecting. + +5. Start the userspace App. + While running, the application should store the relevant information about + reconnections in mapped pages. + When calling ioctl VDUSE_VQ_GET_INFO from the userspace APP to get vq information, it is necessary + to check if this is a reconnection. If a reconnection has occurred, the vq-related information + must be get from the mapped pages. + +6. When the Userspace App exits, it is necessary to unmap all the reconnect pages. -- 2.43.0