DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Cc: dev@dpdk.org, Zhihong Wang <zhihong.wang@intel.com>,
	Cunming Liang <cunming.liang@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	James R Harris <james.r.harris@intel.com>,
	Changpeng Liu <changpeng.liu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] vhost: add external message handling callbacks to the public API
Date: Tue, 15 Jan 2019 19:22:13 +0800	[thread overview]
Message-ID: <20190115112213.GA15290@dpdk-tbie.sh.intel.com> (raw)
In-Reply-To: <20190114042829.24499-1-dariusz.stojaczyk@intel.com>

On Mon, Jan 14, 2019 at 05:28:29AM +0100, Darek Stojaczyk wrote:
> External message callbacks are used e.g. by vhost crypto
> to parse crypto-specific vhost-user messages.
> 
> We are now publishing the API to register those callbacks,
> so that other backends outside of DPDK can use them as well.
> 
> Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
> ---
>  lib/librte_vhost/rte_vhost.h | 66 ++++++++++++++++++++++++++++++++++++
>  lib/librte_vhost/vhost.c     | 13 +++++++
>  lib/librte_vhost/vhost.h     | 54 ++---------------------------
>  3 files changed, 81 insertions(+), 52 deletions(-)
> 
> diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
> index d280ac420..a11f9ca04 100644
> --- a/lib/librte_vhost/rte_vhost.h
> +++ b/lib/librte_vhost/rte_vhost.h
> @@ -111,6 +111,56 @@ struct rte_vhost_vring {
>  	uint16_t		size;
>  };
>  
> +/* The possible results of a message handling function */

Better to change /* to /**, so doxygen can generate doc for it.

> +enum vh_result {
> +	/* Message handling failed */
> +	VH_RESULT_ERR   = -1,
> +	/* Message handling successful */
> +	VH_RESULT_OK    =  0,
> +	/* Message handling successful and reply prepared */
> +	VH_RESULT_REPLY =  1,
> +};

Maybe better to prefix with rte_ and RTE_?
How about rte_vhost_result and RTE_VHOST_RESULT_*?

> +
[...]
>  
> +/**
> + * Register external message handling callbacks
> + *
> + * @param vid
> + *  vhost device ID
> + * @param ops
> + *  virtio external callbacks to register
> + * @param ctx
> + *  additional context passed to the callbacks
> + * @return
> + *  0 on success, -1 on failure
> + */
> +int __rte_experimental
> +rte_vhost_extern_callback_register(int vid,
> +		struct rte_vhost_user_extern_ops const * const ops, void *ctx);

This symbol also needs to be added to the .map file
for shared library.

For the rest,
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

  reply	other threads:[~2019-01-15 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14  4:28 Darek Stojaczyk
2019-01-15 11:22 ` Tiwei Bie [this message]
2019-01-16 12:22   ` Stojaczyk, Dariusz
2019-01-17 15:32 ` [dpdk-dev] [PATCH v3] " Darek Stojaczyk
2019-01-21  8:25   ` Maxime Coquelin
2019-02-08 18:04   ` 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=20190115112213.GA15290@dpdk-tbie.sh.intel.com \
    --to=tiwei.bie@intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=cunming.liang@intel.com \
    --cc=dariusz.stojaczyk@intel.com \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=zhihong.wang@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).