From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06D60A0350; Mon, 3 Jan 2022 11:26:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79CF940688; Mon, 3 Jan 2022 11:26:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BC2724003C for ; Mon, 3 Jan 2022 11:26:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641205591; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+etb/o0A7Cikfj8b7JC/piDdB+byJ1/EvQt+iPudy1I=; b=aY4MTxGS04ooyjeKRoQgLK8WVIWgEL131ueC1XwWaDUiejGzb+zLav4jk8V7XPwRtlaROm Cp0G2RQSkl27D/bM7KsJbEMAJsa5ZD0EMZEfIWkL9BO9adabMlJAKN33C4/l6n2sOuMJvY jTTuFCWvw8EX7FT1jbMfTF5qCh8nR84= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-8r8jl_bYPrOf6ZiXFkteVg-1; Mon, 03 Jan 2022 05:26:26 -0500 X-MC-Unique: 8r8jl_bYPrOf6ZiXFkteVg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFBF7102CB77; Mon, 3 Jan 2022 10:26:24 +0000 (UTC) Received: from [10.39.208.13] (unknown [10.39.208.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F06837A243; Mon, 3 Jan 2022 10:26:22 +0000 (UTC) Message-ID: <70570834-7e02-5472-ab67-644a3688b0db@redhat.com> Date: Mon, 3 Jan 2022 11:26:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [RFC 1/1] vhost: integrate dmadev in asynchronous datapath To: "Hu, Jiayu" , "dev@dpdk.org" Cc: "i.maximets@ovn.org" , "Xia, Chenbo" , "Richardson, Bruce" , "Van Haaren, Harry" , "Mcnamara, John" , "Pai G, Sunil" References: <20211122105437.3534231-1-jiayu.hu@intel.com> <20211122105437.3534231-2-jiayu.hu@intel.com> <61b6c53f-753b-7bc7-9aef-58e706e647aa@redhat.com> From: Maxime Coquelin In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Jiayu, On 12/28/21 02:15, Hu, Jiayu wrote: > Hi Maxime, > > Thanks for your comments, and some replies are inline. > > Thanks, > Jiayu > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Friday, December 24, 2021 6:40 PM >> To: Hu, Jiayu ; dev@dpdk.org >> Cc: i.maximets@ovn.org; Xia, Chenbo ; Richardson, >> Bruce ; Van Haaren, Harry >> ; Mcnamara, John >> ; Pai G, Sunil >> Subject: Re: [RFC 1/1] vhost: integrate dmadev in asynchronous datapath >> >> Hi Jiayu, >> >> This is a first review, I need to spend more time on the series to understand >> it well. Do you have a prototype of the OVS part, so that it helps us to grasp >> how the full integration would look like? > > I think OVS patch will be sent soon. And we will send the deq side implementation too. > >> >> On 11/22/21 11:54, Jiayu Hu wrote: >>> Since dmadev is introduced in 21.11, to avoid the overhead of vhost >>> DMA abstraction layer and simplify application logics, this patch >>> integrates dmadev in asynchronous data path. >>> >>> Signed-off-by: Jiayu Hu >>> Signed-off-by: Sunil Pai G >>> --- >>> doc/guides/prog_guide/vhost_lib.rst | 63 ++++---- >>> examples/vhost/ioat.c | 218 ---------------------------- >>> examples/vhost/ioat.h | 63 -------- >>> examples/vhost/main.c | 144 +++++++++++++++--- >>> examples/vhost/main.h | 12 ++ >>> examples/vhost/meson.build | 6 +- >>> lib/vhost/meson.build | 3 +- >>> lib/vhost/rte_vhost_async.h | 73 +++------- >>> lib/vhost/vhost.c | 37 ++--- >>> lib/vhost/vhost.h | 45 +++++- >>> lib/vhost/virtio_net.c | 198 ++++++++++++++++++++----- >>> 11 files changed, 410 insertions(+), 452 deletions(-) >>> delete mode 100644 examples/vhost/ioat.c >>> delete mode 100644 examples/vhost/ioat.h >>> ... >>> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c >>> index 13a9bb9dd1..595cf63b8d 100644 >>> --- a/lib/vhost/vhost.c >>> +++ b/lib/vhost/vhost.c >>> @@ -344,6 +344,7 @@ vhost_free_async_mem(struct vhost_virtqueue *vq) >>> return; >>> >>> rte_free(vq->async->pkts_info); >>> + rte_free(vq->async->pkts_cmpl_flag); >>> >>> rte_free(vq->async->buffers_packed); >>> vq->async->buffers_packed = NULL; >>> @@ -1626,8 +1627,7 @@ rte_vhost_extern_callback_register(int vid, >>> } >>> >>> diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h >>> index 7085e0885c..974e495b56 100644 >>> --- a/lib/vhost/vhost.h >>> +++ b/lib/vhost/vhost.h >>> @@ -51,6 +51,11 @@ >>> #define VHOST_MAX_ASYNC_IT (MAX_PKT_BURST) >>> #define VHOST_MAX_ASYNC_VEC 2048 >>> >>> +/* DMA device copy operation tracking ring size. */ >>> +#define VHOST_ASYNC_DMA_TRACK_RING_SIZE (uint32_t)4096 >> >> How is this value chosen? Is that specific to your hardware? > > Yes. But in fact, this value should be equal to or greater than vchan > desc number, and it should be dynamic. In addition, the context tracking > array " dma_copy_track" should be per-vchan basis, rather than per-device, > although existed DMA devices only supports 1 vchan at most. > > I have reworked this part which can be configured by users dynamically. Wouldn't it be better to use the max_desc value from from struct rte_dma_info?