Message ID | 20230512094618.433707-1-pizhenwei@bytedance.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4982205vqo; Fri, 12 May 2023 03:09:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4JJt0jt8SigLp0d4TeXgKUpcxb+c7SV2566G/jYpK206B3tMmycfP4xTjW8Ad341MWzWWK X-Received: by 2002:a05:6a00:16cd:b0:63b:87fd:a705 with SMTP id l13-20020a056a0016cd00b0063b87fda705mr31397472pfc.10.1683886145374; Fri, 12 May 2023 03:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683886145; cv=none; d=google.com; s=arc-20160816; b=1G52qZ9Yo3xbeB/OfwvrLl7q8Pfpmw2EbzUndVk0KnS8vRzxYeW4hu9JpLmqgHwCVr wqXjNnM5nuXrBi9aXzYIdxgbnCtBu+x7FpqeHgmEZfoiy1cH2DwUScwNorApJtSQ1cS1 KEzh8VJRpBcNMHPeFeyNLOLIdqgOUbCblUXIOxB78FOHDo19sTljFQwUGfCrQzxFVehr uf+kv7M1B++WXsDw7NZvaNz4K9tgAnghYsutk/rK4EIm8/16vKqml/14UMhgtMBRX2NO a7I+PDM9pi0WeQNOCnju3vkxMxGAltcvP89IRskRc2FdMl2yjlATGkwRVrx+5x61KUHq 4BhQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=xQT0FmogO5TGY0rbQj7fXytMe4BFJtheTdNHt0t5iWE=; b=Ujg69CfgdLzCr4VXUA1DIGzkQFNDb9ieu1DMWGmH2yABT7Cvyh9B8ch3S+6Gwjxh/A HVnNleX6FtcbEqPm5Diwb8l8rDFtmWl3ghWgQBEfSAqwlmLZgLU+vr+rRB1Cmm6mhup5 W6ETPxZ0RLXyGGDktxqxYiyBZysxGe2f/VkehATEOSPshKPPf27PvK4UX7pmv5EBwvyk q1i+9EBgLE2GwMW5zfuiXaZ7fZSbCydpPrZwmtrNfuk2kkWUBSr6rARA02DhKlCuWtjX A0cVGwKRApuR3YSgCAGm3knCCVKhma8JYVR4XUkyorW1w4V3bjZ4M0iIgWdyDwzDVKli JoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=crfSML1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d206-20020a621dd7000000b0063b7c4435c0si10020927pfd.54.2023.05.12.03.08.50; Fri, 12 May 2023 03:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=crfSML1D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240272AbjELJsZ (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Fri, 12 May 2023 05:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240120AbjELJsY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 12 May 2023 05:48:24 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291E930E7 for <linux-kernel@vger.kernel.org>; Fri, 12 May 2023 02:48:23 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-64a9335a8e7so4364826b3a.0 for <linux-kernel@vger.kernel.org>; Fri, 12 May 2023 02:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1683884902; x=1686476902; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xQT0FmogO5TGY0rbQj7fXytMe4BFJtheTdNHt0t5iWE=; b=crfSML1D5wH7IO5vc+OyCVHZrQULvGv9CCRF1/naJtHJtQvEtBJue48p2BLCutjHdx k/3GgoGdwnBmEGE4B+5SMLpmay4Pgjpccn5NWT+WKQ/2h5wTCoZhc3EfGRYnW+LETqJl 8gHlKIAXXbrGB87dkSZQ2y0/MNMJLzUeWKb8R9fcOHObPNix/I9+CCqa+PRuRYxqwgDa 99pqlMt+lI9RgDqZro8ewFxfZrOMi9/TEUpXSignIUAHjfzaT6BV7uP4aWmikLvGUkik O+NjI7Tt2wIrBWDIdy4QHQbNoaHkb5ihUXuuap2onVXBURooML4V/B2gLlW9SwjCJIic Wmhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683884902; x=1686476902; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xQT0FmogO5TGY0rbQj7fXytMe4BFJtheTdNHt0t5iWE=; b=QDzYOOwvspmLbqJ/IidDXWBep8By5g8lIzX0ENPLSlu/C1dVdEC48+yNBbmD2dKwhn 5NrCrV1O73Z5TsBkBLVKIkvqdoCWJ6Ke8gq1ZzyaBtFdHd+1bh1dU3+ZyOJOWsFQfCeo X9DsdlHr867qAgPRUu2fGt9GI0rgj45bCeCyzZ56ebNtyrSjf+wCZtUX5o1pPBc2Emms xJO6i0TVaPmbatYlFv61HfNsZtDlDoYpmCAjkyngQQ0Irp93AaJZe1idyL5yM9w028oU CHwKVxGTa1Nm7nWs91TFrNbLqbR7MXrrR67DdjyUpQ+a98OB0uEQvlV+Oc6BF01yQcgr LhlQ== X-Gm-Message-State: AC+VfDxaG60UuZI1L55eM3iX/c6GGrJdLB6WgaomoNpdFHTcc5xvB4BT u9OaHmmsMdEqU9mMmraIi8i93ih31/bZb0d3tuo= X-Received: by 2002:a17:902:e547:b0:1ac:b03c:a58e with SMTP id n7-20020a170902e54700b001acb03ca58emr11886825plf.25.1683884902614; Fri, 12 May 2023 02:48:22 -0700 (PDT) Received: from always-x1.bytedance.net ([61.213.176.13]) by smtp.gmail.com with ESMTPSA id x17-20020a170902821100b001a6d4ffc760sm7452956pln.244.2023.05.12.02.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 02:48:22 -0700 (PDT) From: zhenwei pi <pizhenwei@bytedance.com> To: stefanha@redhat.com, mst@redhat.com, jasowang@redhat.com Cc: xuanzhuo@linux.alibaba.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, zhenwei pi <pizhenwei@bytedance.com> Subject: [PATCH 0/2] virtio: abstract virtqueue related methods Date: Fri, 12 May 2023 17:46:16 +0800 Message-Id: <20230512094618.433707-1-pizhenwei@bytedance.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765682010990995529?= X-GMAIL-MSGID: =?utf-8?q?1765682598739241478?= |
Series |
virtio: abstract virtqueue related methods
|
|
Message
zhenwei pi
May 12, 2023, 9:46 a.m. UTC
Hi, 3 weeks ago, I posted a proposal 'Virtio Over Fabrics': https://lists.oasis-open.org/archives/virtio-comment/202304/msg00442.html Jason and Stefan pointed out that a non-vring based virtqueue has a chance to overwrite virtqueue instead of using vring virtqueue. Then I try to abstract virtqueue related methods in this series, the details changes see the comment of patch 'virtio: abstract virtqueue related methods'. Something is still remained: - __virtqueue_break/__virtqueue_unbreak is supposed to use by internal virtio core, I'd like to rename them to vring_virtqueue_break /vring_virtqueue_unbreak. Is this reasonable? - virtqueue_get_desc_addr/virtqueue_get_avail_addr/virtqueue_get_used_addr /virtqueue_get_vring is vring specific, I'd like to rename them like vring_virtqueue_get_desc_addr. Is this reasonable? - there are still some functions in virtio_ring.c with prefix *virtqueue*, for example 'virtqueue_add_split', just keep it or rename it to 'vring_virtqueue_add_split'? zhenwei pi (2): virtio: abstract virtqueue related methods tools/virtio: implement virtqueue in test drivers/virtio/virtio.c | 362 ++++++++++++++++++++++++++++++++++ drivers/virtio/virtio_ring.c | 282 +++++---------------------- include/linux/virtio.h | 29 +++ tools/virtio/Makefile | 4 +- tools/virtio/linux/virtio.h | 30 +++ tools/virtio/virtqueue.c | 367 +++++++++++++++++++++++++++++++++++ 6 files changed, 842 insertions(+), 232 deletions(-) create mode 100644 tools/virtio/virtqueue.c