All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Cc: hemant.agrawal@nxp.com, akhil.goyal@nxp.com, dev@dpdk.org,
	pablo.de.lara.guarch@intel.com, declan.doherty@intel.com,
	narender.vangati@intel.com, nikhil.rao@intel.com,
	Nidadavolu.Murthy@cavium.com, NarayanaPrasad.Athreya@cavium.com
Subject: Re: [dpdk-dev, v1, 1/5] eventdev: add caps API and PMD callbacks for crypto adapter
Date: Tue, 10 Apr 2018 11:37:58 +0530	[thread overview]
Message-ID: <20180410060756.GA23776@jerin> (raw)
In-Reply-To: <1522824978-61568-1-git-send-email-abhinandan.gujjar@intel.com>

-----Original Message-----
> Date: Wed, 4 Apr 2018 12:26:18 +0530
> From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> To: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com,
>  akhil.goyal@nxp.com, dev@dpdk.org
> CC: pablo.de.lara.guarch@intel.com, declan.doherty@intel.com,
>  narender.vangati@intel.com, abhinandan.gujjar@intel.com,
>  nikhil.rao@intel.com
> Subject: [dpdk-dev,v1,1/5] eventdev: add caps API and PMD callbacks for
>  crypto adapter
> X-Mailer: git-send-email 1.9.1
> 
> Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
> ---
>  lib/librte_eventdev/rte_eventdev.c     |  25 +++++
>  lib/librte_eventdev/rte_eventdev.h     |  35 +++++++
>  lib/librte_eventdev/rte_eventdev_pmd.h | 176 +++++++++++++++++++++++++++++++++
>  3 files changed, 236 insertions(+)
> 
> diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
> index 2de8d9a..3d24e8f 100644
> --- a/lib/librte_eventdev/rte_eventdev.c
> +++ b/lib/librte_eventdev/rte_eventdev.c
> @@ -29,6 +29,8 @@
>  #include <rte_malloc.h>
>  #include <rte_errno.h>
>  #include <rte_ethdev.h>
> +#include <rte_cryptodev.h>
> +#include <rte_cryptodev_pmd.h>
>  
>  #include "rte_eventdev.h"
>  #include "rte_eventdev_pmd.h"
> @@ -123,6 +125,29 @@
>  				: 0;
>  }
>  
> +int __rte_experimental
> +rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
> +				  uint32_t *caps)
> +{
> +	struct rte_eventdev *dev;
> +	struct rte_cryptodev *cdev;
> +
> +	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> +	if (!rte_cryptodev_pmd_is_valid_dev(cdev_id))
> +		return -EINVAL;
> +
> +	dev = &rte_eventdevs[dev_id];
> +	cdev = rte_cryptodev_pmd_get_dev(cdev_id);
> +
> +	if (caps == NULL)
> +		return -EINVAL;
> +	*caps = 0;
> +
> +	return dev->dev_ops->crypto_adapter_caps_get ?
> +		(*dev->dev_ops->crypto_adapter_caps_get)
> +		(dev, cdev, caps) : 0;
> +}
> +
>  static inline int
>  rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues)
>  {
> diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
> index a20077c..49a71d1 100644
> --- a/lib/librte_eventdev/rte_eventdev.h
> +++ b/lib/librte_eventdev/rte_eventdev.h
> @@ -35,6 +35,8 @@
>  #ifndef _RTE_EVENTDEV_H_
>  #define _RTE_EVENTDEV_H_
>  
> +#include <rte_compat.h>
> +
>  /**
>   * @file
>   *
> @@ -1142,6 +1144,39 @@ struct rte_event {
>  rte_event_eth_rx_adapter_caps_get(uint8_t dev_id, uint8_t eth_port_id,
>  				uint32_t *caps);
>  
> +
> +/* Crypto adapter capability bitmap flag */
> +#define RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT	0x1
> +/**< Flag indicates HW is capable of generating events.
> + * Cryptodev can send packets to the event device using an internal event port.
> + */

Some top level comments,

1) Since we are not planning to abstract RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ
mode inside the adapter, I think, it make sense to introduce new
capability. ie. In some of the HW implementation, We could maintain the
packet order even if source queue/scheded_type is ORDERED. ie. if the capability
is set then application can use RTE_EVENT_CRYPTO_ADAPTER_DEQ_ONLY to maintain
the ingress order even if it is been called from multiple CPU in
ORDERED/ATOMIC context instead of using RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ
mode.

2) Please split the 2/5 to patch specification and implementation

3) I think, we need to give a example code snippet in the programmer
guide on how to use RTE_EVENT_CRYPTO_ADAPTER_ENQ_DEQ mode in conjunction
with rte_event_crypto_adapter_event_port_get().

Let me know your views?

  reply	other threads:[~2018-04-10  6:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  6:56 [dpdk-dev, v1, 1/5] eventdev: add caps API and PMD callbacks for crypto adapter Abhinandan Gujjar
2018-04-10  6:07 ` Jerin Jacob [this message]
2018-04-12  6:28   ` Gujjar, Abhinandan S
2018-04-10 10:37 ` Akhil Goyal
2018-04-12  6:47   ` Gujjar, Abhinandan S

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=20180410060756.GA23776@jerin \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=NarayanaPrasad.Athreya@cavium.com \
    --cc=Nidadavolu.Murthy@cavium.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=narender.vangati@intel.com \
    --cc=nikhil.rao@intel.com \
    --cc=pablo.de.lara.guarch@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.