From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16781C433F5 for ; Wed, 30 Mar 2022 10:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245583AbiC3KxH (ORCPT ); Wed, 30 Mar 2022 06:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244428AbiC3KxG (ORCPT ); Wed, 30 Mar 2022 06:53:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F006F3B579 for ; Wed, 30 Mar 2022 03:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648637480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wnMSItC8n0CDYr8QTJ4aTsqJAmXh/a7xPpLx6HfylVg=; b=AIONujci/vuPWIQ+vsR6ZkCBrZPZmQpkiVl+ERXyrwmns0vX1JQwZL6yZh2uhW8+Sk4Ln1 +E3YOFXxYj/lkEC1hhziYa3OryW4mJf/JJnLx/iu68bM/HLWflFP8pmQVXQNwUHy2En+Kv Y06uLhFqSfn9HhPRujjb7SVfZFC8Kf8= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-gI58E74HM5O2Jq8RZog95Q-1; Wed, 30 Mar 2022 06:51:09 -0400 X-MC-Unique: gI58E74HM5O2Jq8RZog95Q-1 Received: by mail-wr1-f70.google.com with SMTP id a17-20020a5d6cb1000000b00203f85a2ed9so5792949wra.7 for ; Wed, 30 Mar 2022 03:51:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wnMSItC8n0CDYr8QTJ4aTsqJAmXh/a7xPpLx6HfylVg=; b=yYcC6Um9z1lMKRJ+unQAmUGcvsOhTYAWSBDUu3CNzgjy3cCGsxLlw9MjIy4meGShTe ziMLvIFZanPS2joN+IKNAWTypQPTFEsqa4cx6AVXFDj+bxmC4TiPuRwmk3KMO0uqxsqv YHu8OU6D6K5JXxYn53UoTETEZZKBsf2TC8FKapcPu+AW9whH7DMPTfobJuwDkRCGU03P 3c1ArrnaUWUXdAfiYdaK7QUvQUYMB9rL0J6KlEAlcQ08eBk6JDicQenVe3LDJiVwm8pm Fo3qPQncFggLn/4msM7s1mRBnl01VFE6pvTXWdQBXwEqlXLAQrKzYeGZajcLn0s8qGZp ashg== X-Gm-Message-State: AOAM532ArOwjJd/BL7+xqDumTQMjF8XOGzuX0lZkAm4eEW3hkybdlEsS VS5I45+gWVeKyC1n3VT89znv9tgQ09yAJI8Lse0GSvUnx4XMLLKsVLF0Ra3f4gE//ijNrLhNF4r vUN/2flIOseffnkzw X-Received: by 2002:a5d:66ca:0:b0:203:f9b1:dfc0 with SMTP id k10-20020a5d66ca000000b00203f9b1dfc0mr36046493wrw.146.1648637468405; Wed, 30 Mar 2022 03:51:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBZEJlZUuM9T8weSZ6dyHvg5KLz9n08nG046N4t/DHrijmrL4VGxtkumOjoOLwAE/zUA3xxQ== X-Received: by 2002:a5d:66ca:0:b0:203:f9b1:dfc0 with SMTP id k10-20020a5d66ca000000b00203f9b1dfc0mr36046468wrw.146.1648637468157; Wed, 30 Mar 2022 03:51:08 -0700 (PDT) Received: from redhat.com ([2.52.9.207]) by smtp.gmail.com with ESMTPSA id d20-20020a05600c34d400b0038caf684679sm6436194wmq.0.2022.03.30.03.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 03:51:07 -0700 (PDT) Date: Wed, 30 Mar 2022 06:51:03 -0400 From: "Michael S. Tsirkin" To: Xuan Zhuo Cc: Jason Wang , virtualization , netdev , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , "open list:XDP (eXpress Data Path)" Subject: Re: [PATCH v2 0/9] virtio: support advance DMA Message-ID: <20220330065039-mutt-send-email-mst@kernel.org> References: <20220224110402.108161-1-xuanzhuo@linux.alibaba.com> <20220330023258-mutt-send-email-mst@kernel.org> <1648623508.9711535-4-xuanzhuo@linux.alibaba.com> <1648631012.1186295-1-xuanzhuo@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1648631012.1186295-1-xuanzhuo@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 30, 2022 at 05:03:32PM +0800, Xuan Zhuo wrote: > On Wed, 30 Mar 2022 16:38:18 +0800, Jason Wang wrote: > > On Wed, Mar 30, 2022 at 2:59 PM Xuan Zhuo wrote: > > > > > > On Wed, 30 Mar 2022 14:56:17 +0800, Jason Wang wrote: > > > > On Wed, Mar 30, 2022 at 2:34 PM Michael S. Tsirkin wrote: > > > > > > > > > > On Thu, Feb 24, 2022 at 07:03:53PM +0800, Xuan Zhuo wrote: > > > > > > virtqueue_add() only supports virtual addresses, dma is completed in > > > > > > virtqueue_add(). > > > > > > > > > > > > In some scenarios (such as the AF_XDP scenario), DMA is completed in advance, so > > > > > > it is necessary for us to support passing the DMA address to virtqueue_add(). > > > > > > > > > > I picked up a couple of patches. Others are waiting for some acks > > > > > (Jason?) and improved commit logs for documentation. > > > > > > > > I will review them. > > > > > > hi, the core code of premapped, I will merge it into 'virtio pci support > > > VIRTIO_F_RING_RESET' because this function will be used when reusing the buffer > > > after resize. > > > > I still prefer not to do that. > > > > We can make rest work for resize first and add pre mapping on top. It > > will simplify the review. > > Yes, I am also worried about the review problem, the number of my local resize > patch has reached 44 (including reuse bufs). > > hi, Michael, can we implement resize on top of v8 first? (drop unused bufs directly) > > Then we implement premmapd and reuse the bufs after resize. > > We need to get the address (DMA address) and len from the reset ring and submit > it to the new vq through virtqueue_add(). So let virtqueue_add() support > premapped first. > > Thanks. Not sure I understand. So the plan is - remap - resize on top ? > > > > > Thanks > > > > > > > > Thanks. > > > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > Thanks! > > > > > > > > > > > v2: > > > > > > 1. rename predma -> premapped > > > > > > 2. virtio net xdp tx use virtio dma api > > > > > > > > > > > > v1: > > > > > > 1. All sgs requested at one time are required to be unified PREDMA, and several > > > > > > of them are not supported to be PREDMA > > > > > > 2. virtio_dma_map() is removed from this patch set and will be submitted > > > > > > together with the next time AF_XDP supports virtio dma > > > > > > 3. Added patch #2 #3 to remove the check for flags when performing unmap > > > > > > indirect desc > > > > > > > > > > > > Xuan Zhuo (9): > > > > > > virtio_ring: rename vring_unmap_state_packed() to > > > > > > vring_unmap_extra_packed() > > > > > > virtio_ring: remove flags check for unmap split indirect desc > > > > > > virtio_ring: remove flags check for unmap packed indirect desc > > > > > > virtio_ring: virtqueue_add() support premapped > > > > > > virtio_ring: split: virtqueue_add_split() support premapped > > > > > > virtio_ring: packed: virtqueue_add_packed() support premapped > > > > > > virtio_ring: add api virtio_dma_map() for advance dma > > > > > > virtio_ring: introduce virtqueue_add_outbuf_premapped() > > > > > > virtio_net: xdp xmit use virtio dma api > > > > > > > > > > > > drivers/net/virtio_net.c | 42 +++++- > > > > > > drivers/virtio/virtio_ring.c | 280 ++++++++++++++++++++++++++--------- > > > > > > include/linux/virtio.h | 12 ++ > > > > > > 3 files changed, 254 insertions(+), 80 deletions(-) > > > > > > > > > > > > -- > > > > > > 2.31.0 > > > > > > > > > > > > > >