DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Fu, Patrick" <patrick.fu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v1] vhost: fix async callback return type define
Date: Mon, 27 Jul 2020 12:52:45 +0000	[thread overview]
Message-ID: <MN2PR11MB4063504834916505D09747929C720@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200723053906.3616989-1-patrick.fu@intel.com>


> -----Original Message-----
> From: Fu, Patrick <patrick.fu@intel.com>
> Sent: Thursday, July 23, 2020 1:39 PM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: Fu, Patrick <patrick.fu@intel.com>
> Subject: [PATCH v1] vhost: fix async callback return type define
> 
> From: Patrick Fu <patrick.fu@intel.com>
> 
> 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 <patrick.fu@intel.com>
> ---
>  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);
>  };
> --
> 2.18.4

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

  reply	other threads:[~2020-07-27 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  5:39 patrick.fu
2020-07-27 12:52 ` Xia, Chenbo [this message]
2020-07-28  9:10 ` Maxime Coquelin
2020-07-28 10:15   ` Fu, Patrick
2020-07-28 15:26 ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB4063504834916505D09747929C720@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=patrick.fu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).