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 E033CA0524; Tue, 13 Apr 2021 10:51:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE81E160CB7; Tue, 13 Apr 2021 10:51:06 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 3C443160C9F for ; Tue, 13 Apr 2021 10:51:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618303864; 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=nT0kGG9AktFgDndqQNGrV0fPeCO9HoUH60AeCVrW3yI=; b=G0oz+8dKgSYLfg2dnHSfsv6Ryf6tbxJgTyih4TeVbDyMkXWSQqpLsnd1ee8fw+0SqIyNZ2 /pXPH6YJLvkfij+OVmhaRj3r0SpS2BtcwE19j/bAxXVh+7CkYVDzhABz5w/zGdFMQ35prb mjjLWlJ3K9QEFE1YbkLiw49ToqkH5gs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-PWtGqAu6N8mu9Y3c5zjMoQ-1; Tue, 13 Apr 2021 04:51:00 -0400 X-MC-Unique: PWtGqAu6N8mu9Y3c5zjMoQ-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 0EC899F92A; Tue, 13 Apr 2021 08:50:59 +0000 (UTC) Received: from [10.36.110.28] (unknown [10.36.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21C9E5C5FC; Tue, 13 Apr 2021 08:50:56 +0000 (UTC) To: "Hu, Jiayu" , "Jiang, Cheng1" , "Xia, Chenbo" , Thomas Monjalon Cc: "dev@dpdk.org" , "Yang, YvonneX" , "Wang, Yinan" , "stable@dpdk.org" References: <20210317054054.34616-1-Cheng1.jiang@intel.com> <23c4f6e7-4895-44b7-4ff0-3a02f9f3f86a@redhat.com> <13e28ecd418142fda75873f7a0bc2b4d@intel.com> From: Maxime Coquelin Message-ID: <4f2e0296-4c68-197b-ad07-6b43e5e2da38@redhat.com> Date: Tue, 13 Apr 2021 10:50:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <13e28ecd418142fda75873f7a0bc2b4d@intel.com> 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks 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 Sender: "dev" On 4/7/21 9:54 AM, Hu, Jiayu wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, April 7, 2021 3:48 PM >> To: Jiang, Cheng1 ; Xia, Chenbo >> ; Thomas Monjalon >> Cc: dev@dpdk.org; Hu, Jiayu ; Yang, YvonneX >> ; Wang, Yinan ; >> stable@dpdk.org >> Subject: Re: [PATCH] examples/vhost: fix ioat ring space in callbacks >> >> >> >> On 3/17/21 6:40 AM, Cheng Jiang wrote: >>> We use ioat ring space for determining if ioat callbacks can enqueue a >>> packet to ioat device. But there is one slot can't be used in ioat >>> ring due to the ioat driver design, so we need to reduce one slot in >>> ioat ring to prevent ring size mismatch in ioat callbacks. >>> >>> Fixes: 2aa47e94bfb2 ("examples/vhost: add ioat ring space count and >> check") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Cheng Jiang >>> --- >>> examples/vhost/ioat.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c >>> index 60b73be93..9cb5e0d50 100644 >>> --- a/examples/vhost/ioat.c >>> +++ b/examples/vhost/ioat.c >>> @@ -113,7 +113,7 @@ open_ioat(const char *value) >>> goto out; >>> } >>> rte_rawdev_start(dev_id); >>> - cb_tracker[dev_id].ioat_space = IOAT_RING_SIZE; >>> + cb_tracker[dev_id].ioat_space = IOAT_RING_SIZE - 1; >> >> That really comforts me in thinking we need a generic abstraction for >> DMA devices. How is the application developer supposed to know that >> the DMA driver has such weird limitations? >> >> Can the driver be fixed to have a proper behavior? > > Here is the patch of providing capacity check API for DMA: > http://patches.dpdk.org/project/dpdk/patch/20210318182042.43658-6-bruce.richardson@intel.com/ OK, thanks for the pointer. While this new API is being reviewed, and for LTS, let's pick your patch. As soon as Bruce patch is merged, please send a new patch on top to make use of this API. Reviewed-by: Maxime Coquelin Thanks, Maxime > Thanks, > Jiayu >> >>> dma_info->nr++; >>> i++; >>> } >>> >