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 3C8DBA0A0E; Wed, 3 Feb 2021 17:43:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2F9A240530; Wed, 3 Feb 2021 17:43:32 +0100 (CET) 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 216B9240506 for ; Wed, 3 Feb 2021 17:43:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612370611; 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=yv2P23t32GkofyT8+vJMxDIOgSCtorD2V4FqvuPZjUE=; b=IQIWgx6kdCLUlD7leeU2qS/Xja3Psn/sUMeAXZXUUQmwYEo/567Ebl6iJLMKfqb/9l4eBZ LmmdEooc2jrc1tzNUgQhjp4NAm5L9tVwUup8ipSZ4+nSqs483aSXntPgjzvvZWhNBlwNyQ V/SEjw2AnczxBKJ7Zazfz5gqmfRpaLg= 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-151-lef-NkVnOtWK9ZiEKYC_wg-1; Wed, 03 Feb 2021 11:43:27 -0500 X-MC-Unique: lef-NkVnOtWK9ZiEKYC_wg-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 5A4D985EE66; Wed, 3 Feb 2021 16:43:26 +0000 (UTC) Received: from [10.36.110.4] (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33FB55FC3A; Wed, 3 Feb 2021 16:43:25 +0000 (UTC) To: Cheng Jiang , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com References: <20210131123628.47883-1-Cheng1.jiang@intel.com> <20210203142904.37625-1-Cheng1.jiang@intel.com> From: Maxime Coquelin Message-ID: <85c51712-57ba-f70c-95e4-2d8ff6ed683b@redhat.com> Date: Wed, 3 Feb 2021 17:43:23 +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: <20210203142904.37625-1-Cheng1.jiang@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 v2] 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 3:29 PM, Cheng Jiang wrote: > It makes more sense to add error propagation for rte_ioat_completed_ops. > And change the type of dev_id from int to uint16_t. I would reword it to: " This patch adds add error propagation for rte_ioat_completed_ops call, and also changes dev_id type from int to uint16_t. " Reviewed-by: Maxime Coquelin > > Signed-off-by: Cheng Jiang > --- > v2: mentioned dev_id type changes in git log > > 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; > 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; > -- > 2.29.2 >