From patchwork Thu Jul 23 05:39:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Fu X-Patchwork-Id: 74631 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CF88A0526; Thu, 23 Jul 2020 07:41:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B7881BF94; Thu, 23 Jul 2020 07:41:22 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0772E1BE90 for ; Thu, 23 Jul 2020 07:41:20 +0200 (CEST) IronPort-SDR: sb2tAeFSQiJRl/AANnlwYsDDobqescft3TRSciEL/i/DxWhGv+is6Xse/mz5R/bRvafdtNFGw2 iR+Umjs3qaWg== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="149644260" X-IronPort-AV: E=Sophos;i="5.75,385,1589266800"; d="scan'208";a="149644260" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2020 22:41:19 -0700 IronPort-SDR: fsGinBJ4pwdJNpbtO7XkqqfxO9jEy9I8uhSzYFgQCmpckL1FT7HXE/uequSXCneUOQ5XJzY0p4 sRLlgE6LZWog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,385,1589266800"; d="scan'208";a="488711477" Received: from npg-dpdk-patrickfu-casc2.sh.intel.com ([10.67.119.92]) by fmsmga005.fm.intel.com with ESMTP; 22 Jul 2020 22:41:17 -0700 From: patrick.fu@intel.com To: dev@dpdk.org, maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: Patrick Fu Date: Thu, 23 Jul 2020 13:39:06 +0800 Message-Id: <20200723053906.3616989-1-patrick.fu@intel.com> X-Mailer: git-send-email 2.18.4 Subject: [dpdk-dev] [PATCH v1] vhost: fix async callback return type define X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Patrick Fu The async copy device callbacks are used by async APIs to transfer data and check completion status. Async APIs return the number of packets successfully processed to the caller applications and no error (negative) value is allowed for API return value. Thus, negative return values from async device callbacks don't have meaningful usage, while adding overhead in checking the return value validity. This patch change the callback return values from "int" to "uint32_t" to get aligned with async API definition. Fixes: 78639d54563a ("vhost: introduce async enqueue registration API") Signed-off-by: Patrick Fu Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- lib/librte_vhost/rte_vhost_async.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/rte_vhost_async.h b/lib/librte_vhost/rte_vhost_async.h index c8ad8dbc7..66d258abe 100644 --- a/lib/librte_vhost/rte_vhost_async.h +++ b/lib/librte_vhost/rte_vhost_async.h @@ -59,9 +59,9 @@ struct rte_vhost_async_channel_ops { * @param count * number of elements in the "descs" array * @return - * -1 on failure, number of descs processed on success + * number of descs processed on success */ - int (*transfer_data)(int vid, uint16_t queue_id, + uint32_t (*transfer_data)(int vid, uint16_t queue_id, struct rte_vhost_async_desc *descs, struct rte_vhost_async_status *opaque_data, uint16_t count); @@ -70,15 +70,15 @@ struct rte_vhost_async_channel_ops { * @param vid * id of vhost device to check copy completion * @param queue_id - * queue id to check copyp completion + * queue id to check copy completion * @param opaque_data * buffer to receive the opaque data pair from DMA engine * @param max_packets * max number of packets could be completed * @return - * -1 on failure, number of iov segments completed on success + * number of iov segments completed on success */ - int (*check_completed_copies)(int vid, uint16_t queue_id, + uint32_t (*check_completed_copies)(int vid, uint16_t queue_id, struct rte_vhost_async_status *opaque_data, uint16_t max_packets); };