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 D0CD8A0A0E; Wed, 3 Feb 2021 13:48:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCBAD240590; Wed, 3 Feb 2021 13:48:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id A2778240574 for ; Wed, 3 Feb 2021 13:48:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612356526; 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=WdIHbdQsFMA0QIiu70qE9uimmj1iSoJRH86dWxGqq4E=; b=YUDc6ewzAXn2SEUX1TdRiwbtm6Nz4DNYlGfAiFKpI1eLzIArvYIu8GP5WTfI1qD1WM2zUu 013A0SpLDp+rSHEHahpxD5Cnmk2+602QwmYNN+j7GqQqpcJe1njdRPve53xSLW77E1EB3i 0iAHHIUdISek47LSuozuILetz/Tp48s= 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-68-RGsuRNZRNaWcauruUaU1bQ-1; Wed, 03 Feb 2021 07:48:45 -0500 X-MC-Unique: RGsuRNZRNaWcauruUaU1bQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1C111015C80; Wed, 3 Feb 2021 12:48:43 +0000 (UTC) Received: from [10.36.110.4] (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A547F10016F5; Wed, 3 Feb 2021 12:48:42 +0000 (UTC) To: "Jiang, Cheng1" , "Xia, Chenbo" Cc: "dev@dpdk.org" , "Hu, Jiayu" , "Yang, YvonneX" , "Wang, Yinan" References: <20210131123628.47883-1-Cheng1.jiang@intel.com> <8701873a-02c8-ddc0-f02a-54956ecccff1@redhat.com> From: Maxime Coquelin Message-ID: <0ce95d26-384c-3a20-721f-a0910fd980fa@redhat.com> Date: Wed, 3 Feb 2021 13:48:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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: add error propagation in ioat ops 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 2/3/21 12:52 PM, Jiang, Cheng1 wrote: > Hi, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, February 3, 2021 5:49 PM >> To: Jiang, Cheng1 ; Xia, Chenbo >> >> Cc: dev@dpdk.org; Hu, Jiayu ; Yang, YvonneX >> ; Wang, Yinan >> Subject: Re: [PATCH] examples/vhost: add error propagation in ioat ops >> >> >> >> On 1/31/21 1:36 PM, Cheng Jiang wrote: >>> It makes more sense to add error propagation for rte_ioat_completed_ops. >>> >>> Signed-off-by: Cheng Jiang >>> --- >>> examples/vhost/ioat.c | 14 ++++++++++---- >>> 1 file changed, 10 insertions(+), 4 deletions(-) >>> >>> diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c index >>> dbad28d43..60b73be93 100644 >>> --- a/examples/vhost/ioat.c >>> +++ b/examples/vhost/ioat.c >>> @@ -22,7 +22,6 @@ struct packet_tracker { >>> >>> struct packet_tracker cb_tracker[MAX_VHOST_DEVICE]; >>> >>> - >>> int >>> open_ioat(const char *value) >>> { >>> @@ -129,7 +128,7 @@ ioat_transfer_data_cb(int vid, uint16_t queue_id, >>> struct rte_vhost_async_status *opaque_data, uint16_t count) >> { >>> uint32_t i_desc; >>> - int dev_id = dma_bind[vid].dmas[queue_id * 2 + >> VIRTIO_RXQ].dev_id; >>> + uint16_t dev_id = dma_bind[vid].dmas[queue_id * 2 + >>> +VIRTIO_RXQ].dev_id; >> >> This change from uint16_t to int does not seem related to the purpose of this >> patch. Is it? > > Yes, this change has nothing to do with adding the log, I just noticed uint16_t is more appropriate and changed here. > I can only add the log if you think change the type of dev_id here is not ok. Better to have two commits since these are two different changes. At least please mention it in the commit message. Thanks, Maxime > Thanks. > Cheng > >> >>> struct rte_vhost_iov_iter *src = NULL; >>> struct rte_vhost_iov_iter *dst = NULL; >>> unsigned long i_seg; >>> @@ -182,10 +181,17 @@ ioat_check_completed_copies_cb(int vid, >> uint16_t queue_id, >>> unsigned short mask = MAX_ENQUEUED_SIZE - 1; >>> unsigned short i; >>> >>> - int dev_id = dma_bind[vid].dmas[queue_id * 2 >>> + uint16_t dev_id = dma_bind[vid].dmas[queue_id * 2 >>> + VIRTIO_RXQ].dev_id; >>> n_seg = rte_ioat_completed_ops(dev_id, 255, dump, dump); >>> - if (n_seg <= 0) >>> + if (n_seg < 0) { >>> + RTE_LOG(ERR, >>> + VHOST_DATA, >>> + "fail to poll completed buf on IOAT >> device %u", >>> + dev_id); >>> + return 0; >>> + } >>> + if (n_seg == 0) >>> return 0; >>> >>> cb_tracker[dev_id].ioat_space += n_seg; >>> >