Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1844066rwd; Wed, 17 May 2023 02:04:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wvYwPxgTrTRh4wAJ90iVa0r7QkPKK47AlgkLuY9IrZv/HA+AT0ELIhsJPc0wwGmq1rDiR X-Received: by 2002:a05:6a21:78a9:b0:102:a593:a158 with SMTP id bf41-20020a056a2178a900b00102a593a158mr32922391pzc.47.1684314279929; Wed, 17 May 2023 02:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684314279; cv=none; d=google.com; s=arc-20160816; b=EQuPHszVPXRCvDaavMvH8Ygh0sknDviCzS9/4A/EatQz3/+zmAp5KUjFDHhyzDfcxP LZAhfn8p+yPYpbAJNl9vzd8tKWBjJhVPh2UIqb7yn9vCspsTwmx9o3Tm2ozKu/1ccbG0 YW1sLMfoNWu476Aja3AnIi4xwBmY6gVjbgouVX+h6i1vEpYz2xTznIRx2pCg+aK1L9g/ tzKj6PmI1z2pDmYKntEI6LfpVTYkHJso6bvNjE/hvHv/UgZ0V5BFyG0ApTUA5xj81k29 /65nYZbPq9fs+iv6Szh0R/6emmy/a8X9C9RIaA55yI3J8GpPJi2N2oOifZSFuA2RPm1L 7AKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/lS0VerKT/K5L5+mTBdB0d9Ml3aR+Xdun4CK+Oz2SxI=; b=MlTZDxJP9nIWfXT3edH3xQpzp29YEYeFFYCxEV5lzrWzafmO+apHnMt0Pv7/erHxuv Nrs0ZhvcNpxRmMEEL595W/nXPUsUQWQ2k2mR87EvR82WSn2w8ivJ3+cx9wskdHqbonUm T8o+mrshpqJd251I8V4Vg1U2BNeNYY6Tn4i2IwTQYPPUCz7YqGxWbBjN7edhesgmyefo jktfCIYVz3VUX7AG6W67QhzFqEBlm/efb8umxjYxvh/pGK7pjUF83H6zZSxf9tLHqnGj EnVoBCs8/AViSC8vOcl0scZ57MCyh7gfXP3aVksH2L81rBQimms8SzNZvf7efwooy91N fMQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=TtyWNefn; 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 r28-20020aa79edc000000b00643ba887601si21966187pfq.307.2023.05.17.02.04.25; Wed, 17 May 2023 02:04:39 -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=TtyWNefn; 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 S230270AbjEQIjP (ORCPT + 99 others); Wed, 17 May 2023 04:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjEQIiu (ORCPT ); Wed, 17 May 2023 04:38:50 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F4D3C30 for ; Wed, 17 May 2023 01:38:00 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-24dec03ad8fso485281a91.1 for ; Wed, 17 May 2023 01:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1684312680; x=1686904680; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/lS0VerKT/K5L5+mTBdB0d9Ml3aR+Xdun4CK+Oz2SxI=; b=TtyWNefnV49cwEOlKU8y2jD+mhN5zLQYPxbCTrObAYp/C192RW6uoewbVjaYQfg9yo i/yxj0UcotS7dAZ0cUxJpju9r9PSoW8N9SK9Qs6tAdHjtgYdO4hOoYb8eXdLhgtB/TkG I3TCiKLegp9VJ/F/+oLMaD3/7k3UUIliS1Wqm4UXeMOrD0ZMhZDF3ADvAn03ktJ9BQ81 sbkq+yAqCmih3F0vxoOzpI4TYB3rtnCPrjAlbrhO7G8fxrmNRBDRB/1opljUYn6lCakP aVc8fi+PXGDb/FM9anQX24DlH/AO7MDJh20Pa4vKQHkP2EbLHAnB5RuC7EzAOMHLNSRy Sp9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684312680; x=1686904680; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/lS0VerKT/K5L5+mTBdB0d9Ml3aR+Xdun4CK+Oz2SxI=; b=NoXV+ibdZa5tVvfgIxoSplnaZZKmzKA/XKAigd+RMJiD10b/fMzVUbhNEATavwc4oU 0y/vsNp3insYUn7P54xuefg+Jnm8b1ajjFVyfT242nqRQA8qhvZVSN7MQxbmLBq+aJ1J 3XdMTU1sNzgvEuBaa2avoyYXOY7BODv6zIkEO97IAjF75RyRf/Wbx/ta8W79aXDVewvD HM/4rQfqS10cmqdYpJ9OyOha4PvS2peis2Ik9B3EFShBi0l1CmZT54rXGdcZ+HJ7cTfW fBgND95R/r6SrHweTXmUjNZUPM6zSPAmcWd9M1UxM0hMi1h5Bk7wjm2Zj1UrdD7m9RRe omGg== X-Gm-Message-State: AC+VfDxlrLCBQ6Fz9FHnFvTC4bbs5X+SW2TIBuOJO9u95+scyDZ777tL 2vPzqlRKDvJ2Aq0Khtp3EgNkEbWdrafgX0tI5Ak= X-Received: by 2002:a17:90a:dd88:b0:252:e7e2:fefe with SMTP id l8-20020a17090add8800b00252e7e2fefemr11945883pjv.2.1684312680236; Wed, 17 May 2023 01:38:00 -0700 (PDT) Received: from [10.3.43.196] ([61.213.176.7]) by smtp.gmail.com with ESMTPSA id f24-20020a17090ace1800b002405d3bbe42sm1030351pju.0.2023.05.17.01.37.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 May 2023 01:37:59 -0700 (PDT) Message-ID: Date: Wed, 17 May 2023 16:35:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Re: [PATCH v2 1/2] virtio: abstract virtqueue related methods Content-Language: en-US To: Christoph Hellwig Cc: stefanha@redhat.com, mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20230517025424.601141-1-pizhenwei@bytedance.com> <20230517025424.601141-2-pizhenwei@bytedance.com> <9e4702f2-5473-2139-3858-ae58817bc7b5@bytedance.com> From: zhenwei pi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 5/17/23 15:46, Christoph Hellwig wrote: > On Wed, May 17, 2023 at 03:43:03PM +0800, zhenwei pi wrote: >> I have a plan to introduce 'Virtio Over Fabrics'(TCP&RDMA) as Virtio >> transport, as mentioned in cover letter of this series: >> 3 weeks ago, I posted a proposal 'Virtio Over Fabrics': >> https://lists.oasis-open.org/archives/virtio-comment/202304/msg00442.html > > Just don't do it. Please define your own protocols over RDMA or TCP > for exactly the operations you need (for many they will already exist) > instead of piggyg backing on virtio and making everyone else pay the > price. > Hi 1, `virtqueue_add_inbuf` in current version: static inline int virtqueue_add_inbuf(struct virtqueue *vq, struct scatterlist *sg, unsigned int num, void *data, gfp_t gfp) { if (likely(!vq->abstract)) return vring_virtqueue_add_sgs(vq, &sg, num, 0, 1, data, NULL, gfp); return vq->add_sgs(vq, &sg, num, 0, 1, data, NULL, gfp); } And disassemble 'virtinput_queue_evtbuf': static void virtinput_queue_evtbuf(struct virtio_input *vi, struct virtio_input_event *evtbuf) { struct scatterlist sg[1]; sg_init_one(sg, evtbuf, sizeof(*evtbuf)); virtqueue_add_inbuf(vi->evt, sg, 1, evtbuf, GFP_ATOMIC); } I notice that two instructions are newly added for vring like: 24d: 80 78 35 00 cmpb $0x0,0x35(%rax) 251: 75 3f jne 292 Is it an expensive price... 2, Storage/FS specific remote protocol is quite popular, otherwise I'm not familiar with other device protocols. For example, I need a remote crypto device to accelerate HTTPS ... With Virtio Over Fabrics, I have a chance to attach a virtio-crypto device to do this work. -- zhenwei pi