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 2E97AA0A0E; Wed, 3 Feb 2021 10:48:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 973A12404A7; Wed, 3 Feb 2021 10:48:44 +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 A15F52404A5 for ; Wed, 3 Feb 2021 10:48:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612345722; 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=r5K9G4x51y0UwDwbwHlcwsJjnyVfCBgq5lB30eAkyyQ=; b=R8R52lgjXhphnHinxF05ijAuXjFRn0xinsuNxuWB6dj5qtLnrzRWsg6EQ3XxFG+w+5AOQ6 eGAqVPHlhdMViRlEQ2g7Al7D/Alczz6zgCqSeOXpc/8gXHXOmjwySVgQzZClkLE020tDeQ anf1bhGquo7q61xLXSHQrwIA6AKnfu8= 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-560--_BdhR4POICRvPtA6he1jw-1; Wed, 03 Feb 2021 04:48:41 -0500 X-MC-Unique: -_BdhR4POICRvPtA6he1jw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 077F0107ACFE; Wed, 3 Feb 2021 09:48:40 +0000 (UTC) Received: from [10.36.110.4] (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7CC41971B; Wed, 3 Feb 2021 09:48:38 +0000 (UTC) To: Cheng Jiang , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com, yinan.wang@intel.com References: <20210131123628.47883-1-Cheng1.jiang@intel.com> From: Maxime Coquelin Message-ID: <8701873a-02c8-ddc0-f02a-54956ecccff1@redhat.com> Date: Wed, 3 Feb 2021 10:48:37 +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: <20210131123628.47883-1-Cheng1.jiang@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 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? > 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; >