From patchwork Wed Feb 7 05:43:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cindy Lu X-Patchwork-Id: 20037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2022967dyb; Tue, 6 Feb 2024 21:47:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIarJr2N1qYaLs/OxIgWfeAuI5FIl4jv9ZPbxnHQAOEgGSiLaL9cL0lLSuyJudgrmp1MxkqilB1EZbTPAWX97vLLYocQ== X-Google-Smtp-Source: AGHT+IHquSzzuu1RBh4hItfXASBtpj5POXVO84BiPbxyBZ6uykIwIUV9W8GuPhVZjI2J6S3C2Kuc X-Received: by 2002:a50:9f0f:0:b0:560:ae15:5df8 with SMTP id b15-20020a509f0f000000b00560ae155df8mr2190687edf.40.1707284849314; Tue, 06 Feb 2024 21:47:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707284849; cv=pass; d=google.com; s=arc-20160816; b=GwlHF4WXnDGwlVibO2BesKq3Z/DtO6Yj7ZVlKlw3fTte4soblFvUd5V2zyLz7gsFfE VxpbNfPd0eqP4Qoeu4ShxhOPVLqLPfQednygHlYm4En+Hxth03OY46r96kY0aQYbjkG1 iZwJSCC3pLxcg5Q5R9PtjZiE0uV9lxCxynmofEM7ZqhdC/zoXViFzn6vPyRvh9M21fAj 8scE1LaTA/b+lntZGrA6x+TgO3KCuinfyQrNGLgob62gGwZJblvfjTdsx1jP9o42bzli unD/TwWlmEWW7TmT9YquFz03lLXNdLwUJpnlPCLAzue65tfNMs3Q/u21sMEgyPbQzZ4I lIzg== 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:message-id:date:subject:to:from :dkim-signature; bh=OxN1jaJo+G98/fFpgDdkFoeRweqHUWYF3iMfC1LGZRw=; fh=WUz/m2B07E72+OyR6wIog0RNzZMI0iBonMxIpYqcD6s=; b=A7MK+jpLJO0R55oC4VzrdmbB9i38LMGDJ5Ps1rJXLywHwhU7hb3sQOJcINGfmI1/WG 9DrzQJFdzkrpzp6itMO5HOB0V8YFeH7DHwH5ImAS1oqhLTVnJTKqlQ6UNpm8GNo//Fz+ yCmhojIrzTLr7ImL/urhMQZrdyizq1Zij0s/WaYV29Vr6ik3ySQMRwhzq7TMuqt+DQBn GnJyKpOmUH/Aajcu35wTO65dTuL6Qz+bROUYCRWE9Js++nAB6FkYDON2f+dZ/hK9yJ8H gg6dZCu2AQb8Qr88+wz0KFXo5cIYtf1KX1YP4XqB7QhyFDfM2R1WuW9+Z/ZiBFNaEtmL V7dw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gm0zgVW9; 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-55980-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55980-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCXWmZsf8FEnjx4dMhSo0zKjx+bL/ZdEymF/3SD3CqVrE/ZrvoA9gYnTV/N6XTscE+fyPQPXu82XCLRVszJsrW64tZyuPg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b28-20020a50ccdc000000b00560410689d1si430140edj.31.2024.02.06.21.47.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 21:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55980-ouuuleilei=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=gm0zgVW9; 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-55980-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55980-ouuuleilei=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 E89D81F2338B for ; Wed, 7 Feb 2024 05:47:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F2001CD3A; Wed, 7 Feb 2024 05:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gm0zgVW9" 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 A803C1CD1E for ; Wed, 7 Feb 2024 05:47:11 +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=1707284833; cv=none; b=DmMuy1k3axayM0Bu7WNEpGoD6oGVr4LW49DIm1y2PCaDDixh+r8a6HtpoVInuB1ytDzSV6rFEl2NGlsCqKBfMBlDH5+sv0DUfW9itHZfV1fPDQ2LuNfOqJvgVPR2EJLyf/mFCIpUR8yJIKl9H7Ot0skMibAzCil1fBTTjiWT7zQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707284833; c=relaxed/simple; bh=mpSx7v17lWYWp3+GRrVAszqBH9MUhZzyCqu7z5sqqdQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Bu6PefJl5JyJDhXtQUZLjLBFm74ragAxeePrAbWm8sul94aDfe01DEFnT3sfeXnPhZY1cblyGetJnbnv1eAs2o9+CAipH9mXZVVPiFq8sGBzU+IbXLnNBTQohqrCtMOVwpgWL2n2Bv0/wg7G/QUoF+aecLfFY/e38vsOO27dxxA= 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=gm0zgVW9; 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=1707284830; 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; bh=OxN1jaJo+G98/fFpgDdkFoeRweqHUWYF3iMfC1LGZRw=; b=gm0zgVW9Q6vBq9+cd9V19VQOAmJdvY9bObTg4pMYD2/2rxeV3YGF+Q4ZjMuWjCMcXPFltW 4z9T4mCuNvyuI+XU5Pev7jJx84SSvjACyEjHVCAt408LWfby/UY0YN9fSGtyhGnAsESPJd EiO8Qz5SAqFfLiPUUsGjcUiOO3elybI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-134-rTp5DMKoMEetzY_46rPvCA-1; Wed, 07 Feb 2024 00:47:08 -0500 X-MC-Unique: rTp5DMKoMEetzY_46rPvCA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 4431683B8EA; Wed, 7 Feb 2024 05:47:08 +0000 (UTC) Received: from server.redhat.com (unknown [10.72.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73BFFC1596E; Wed, 7 Feb 2024 05:47:05 +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 0/5] vduse: Add support for reconnection Date: Wed, 7 Feb 2024 13:43:27 +0800 Message-ID: <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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790217918469612911 X-GMAIL-MSGID: 1790217918469612911 Here is the reconnect support in vduse, Kernel will allocate pages for reconnection. Userspace needs to use mmap to map the memory to userspace and use these pages to save the reconnect information. test passd in vduse+dpdk-testpmd change in V2 1. Address the comments from v1 2. Add the document for reconnect process change in V3 1. Move the vdpa_vq_state to the uAPI. vduse will use this to synchronize the vq info between the kernel and userspace app. 2. Add a new ioctl VDUSE_DEV_GET_CONFIG. userspace app use this to get config space 3. Rewrite the commit message. 4. Only save the address for the page address and remove the index. 5. remove the ioctl VDUSE_GET_RECONNECT_INFO, userspace app will use uAPI VDUSE_RECONNCT_MMAP_SIZE to mmap 6. Rewrite the document for the reconnect process to make it clearer. change in v4 1. Change the number of map pages to VQ numbers. UserSpace APP can define and maintain the structure for saving reconnection information in userspace. The kernel will not maintain this information. 2. Rewrite the document for the reconnect process to make it clearer. 3. add the new ioctl for VDUSE_DEV_GET_CONFIG/VDUSE_DEV_GET_STATUS Cindy Lu (5): vduse: Add new ioctl VDUSE_DEV_GET_CONFIG vduse: Add new ioctl VDUSE_DEV_GET_STATUS vduse: Add function to get/free the pages for reconnection vduse: Add file operation for mmap Documentation: Add reconnect process for VDUSE Documentation/userspace-api/vduse.rst | 32 +++++++ drivers/vdpa/vdpa_user/vduse_dev.c | 125 ++++++++++++++++++++++++++ include/uapi/linux/vduse.h | 5 ++ 3 files changed, 162 insertions(+)