Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10037792rwr; Fri, 12 May 2023 02:58:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72ZDayc8eapYEtRQnDCP/VD7QiiAHw/4dN0fGuhZy/fOJNEquvaeDqMPDteuN0BqO8sMbE X-Received: by 2002:a17:902:f54c:b0:1ac:3b69:bb9c with SMTP id h12-20020a170902f54c00b001ac3b69bb9cmr31067502plf.28.1683885493460; Fri, 12 May 2023 02:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683885493; cv=none; d=google.com; s=arc-20160816; b=KrsBKYeuqZQ38JrDzp61y3RO0w2gG95QmB/mmXLyxRs0LZzhOy9NzZ7+lWr199mSpN 2MlWBpLg8zcMP+le9oDvxMCwR1AfIFFidWMT800Ugkf3myvaL9HifSnqXKSQlghu8i8t E9Isyu6bDq0VTx2+ArejHu4qV68zrzxTSDdfgYL16ZmIA8SpaLYa5QmnqKdeB/c9Rg3A p2OAiTNR/jmMXxNYSfDOYNshYzpOIG7zFvq2O7rh9osE59fNufw1kq/UUXVuU3repY2x NECA6okwJGlt96eO0huecqL2hHwy04yz0iQQEb3SZXMhXIkoSO0ZeWggP/QYcLkxTrDT cvFA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a170902b19700b001ab23d42f37si2822854plr.258.2023.05.12.02.57.59; Fri, 12 May 2023 02:58:13 -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 S240244AbjELJsZ (ORCPT + 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 ); 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 ; Fri, 12 May 2023 02:48:23 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-64a9335a8e7so4364826b3a.0 for ; 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 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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.20.1