DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>
To: Akhil Goyal <akhil.goyal@nxp.com>, "dev@dpdk.org" <dev@dpdk.org>,
	"Doherty, Declan" <declan.doherty@intel.com>,
	"Honnappa.Nagarahalli@arm.com" <Honnappa.Nagarahalli@arm.com>,
	"Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: "Vangati, Narender" <narender.vangati@intel.com>,
	"jerinj@marvell.com" <jerinj@marvell.com>
Subject: Re: [dpdk-dev] [v4 1/3] cryptodev: support enqueue callback functions
Date: Tue, 27 Oct 2020 19:41:59 +0000	[thread overview]
Message-ID: <MWHPR11MB1838BCF15C64000FE0AED559E8160@MWHPR11MB1838.namprd11.prod.outlook.com> (raw)
In-Reply-To: <VI1PR04MB3168EE80E3351AE4EAD3CF5EE6160@VI1PR04MB3168.eurprd04.prod.outlook.com>

Hi Akhil,

> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Wednesday, October 28, 2020 12:56 AM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org;
> Doherty, Declan <declan.doherty@intel.com>;
> Honnappa.Nagarahalli@arm.com; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Cc: Vangati, Narender <narender.vangati@intel.com>; jerinj@marvell.com
> Subject: RE: [v4 1/3] cryptodev: support enqueue callback functions
> 
> Hi Abhinandan,
> 
> > > > +static int
> > > > +cryptodev_cb_init(struct rte_cryptodev *dev) {
> > > > +	struct rte_cryptodev_enq_cb_rcu *list;
> > > > +	struct rte_rcu_qsbr *qsbr;
> > > > +	uint16_t qp_id;
> > > > +	size_t size;
> > > > +
> > > > +	/* Max thread set to 1, as one DP thread accessing a queue-pair */
> > > > +	const uint32_t max_threads = 1;
> > > > +
> > > > +	dev->enq_cbs = rte_zmalloc(NULL,
> > > > +				   sizeof(struct rte_cryptodev_enq_cb_rcu) *
> > > > +				   dev->data->nb_queue_pairs, 0);
> > > > +	if (dev->enq_cbs == NULL) {
> > > > +		CDEV_LOG_ERR("Failed to allocate memory for callbacks");
> > > > +		rte_errno = ENOMEM;
> > > > +		return -1;
> > > > +	}
> > >
> > > Why not return ENOMEM here? You are not using rte_errno while
> > > returning from this function, so setting it does not have any meaning.
> > This is a internal function. The caller is returning ENOMEM.
> 
> The caller can return the returned value from cryptodev_cb_init, instead of
> explicitly Returning ENOMEM.
> There is no point of setting rte_errno here.
Ok. I will update the patch.
> 
> 
> > > >  /** The data structure associated with each crypto device. */
> > > > struct rte_cryptodev {
> > > >  	dequeue_pkt_burst_t dequeue_burst; @@ -867,6 +922,10 @@ struct
> > > > rte_cryptodev {
> > > >  	__extension__
> > > >  	uint8_t attached : 1;
> > > >  	/**< Flag indicating the device is attached */
> > > > +
> > > > +	struct rte_cryptodev_enq_cb_rcu *enq_cbs;
> > > > +	/**< User application callback for pre enqueue processing */
> > > > +
> > > Extra line
> > ok
> > >
> > > We should add support for post dequeue callbacks also. Since this is
> > > an LTS release And we wont be very flexible in future quarterly
> > > release, we should do all the changes In one go.
> > This patch set is driven by requirement. Recently, we have a
> > requirement to have callback for dequeue as well. Looking at code
> > freeze date, I am not sure we can target that as well. Let this patch
> > go in and I will send a separate patch for dequeue callback.
> >
> 
> We may not be able to change the rte_cryptodev structure so frequently.
> It may be allowed to change it 21.11 release. Which is too far.
> I think atleast the cryptodev changes can go in RC2 and test app for deq cbs
> Can go in RC3 if not RC2.
" cryptodev changes " -> Is it rte_cryptodev structure changes alone or supporting
dequeue callback as well in RC2? And then have test app changes in RC3?
If it is about adding dequeue callback support in RC2, I will try.
If it does not work, hope we can still the get the enqueue callback + rte_cryptodev structure
changes to support dequeue callbacks in the next patch set.
> 
> > > I believe we should also double check with techboard if this is an ABI
> breakage.
> > > IMO, it is ABI breakage, rte_cryprodevs is part of stable APIs, but not sure.
> > >
> > > >  } __rte_cache_aligned;
> > > >
> 
> 
> 
> > > >
> > > > +#ifdef RTE_CRYPTO_CALLBACKS
> > > > +/**
> > > > + * @warning
> > > > + * @b EXPERIMENTAL: this API may change without prior notice
> > > > + *
> > > > + * Add a user callback for a given crypto device and queue pair
> > > > +which will be
> > > > + * called on crypto ops enqueue.
> > > > + *
> > > > + * This API configures a function to be called for each burst of
> > > > +crypto ops
> > > > + * received on a given crypto device queue pair. The return value
> > > > +is a pointer
> > > > + * that can be used later to remove the callback using
> > > > + * rte_cryptodev_remove_enq_callback().
> > > > + *
> > > > + * Multiple functions are called in the order that they are added.
> > >
> > > Is there a limit for the number of cbs that can be added? Better to
> > > add a Comment here.
> 
> I think you missed this comment.
There is not limitation as of now. I will add a comment on the same.
> 


  reply	other threads:[~2020-10-27 19:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25  9:44 [dpdk-dev] [v4 0/3] support enqueue callbacks on cryptodev Abhinandan Gujjar
2020-10-25  9:44 ` [dpdk-dev] [v4 1/3] cryptodev: support enqueue callback functions Abhinandan Gujjar
2020-10-27 12:47   ` Ananyev, Konstantin
2020-10-27 17:16     ` Gujjar, Abhinandan S
2020-10-27 17:20       ` Ananyev, Konstantin
2020-10-27 17:22         ` Gujjar, Abhinandan S
2020-10-27 18:19   ` Akhil Goyal
2020-10-27 19:16     ` Gujjar, Abhinandan S
2020-10-27 19:26       ` Akhil Goyal
2020-10-27 19:41         ` Gujjar, Abhinandan S [this message]
2020-10-27 18:28   ` Akhil Goyal
2020-10-28  8:20     ` Gujjar, Abhinandan S
2020-10-28 12:55       ` Ananyev, Konstantin
2020-10-28 14:28         ` Akhil Goyal
2020-10-28 14:52           ` Ananyev, Konstantin
2020-10-28 15:11           ` [dpdk-dev] [dpdk-techboard] " Bruce Richardson
2020-10-28 15:22             ` Honnappa Nagarahalli
2020-10-29 13:52               ` Gujjar, Abhinandan S
2020-10-29 14:00                 ` Akhil Goyal
2020-10-30  4:24                   ` Gujjar, Abhinandan S
2020-10-30 17:18                     ` Gujjar, Abhinandan S
2020-10-29 14:26               ` Kinsella, Ray
2020-10-25  9:44 ` [dpdk-dev] [v4 2/3] test: add testcase for crypto enqueue callback Abhinandan Gujjar
2020-10-25  9:44 ` [dpdk-dev] [v4 3/3] doc: add enqueue callback APIs Abhinandan Gujjar
2020-10-26 19:08   ` Akhil Goyal
2020-10-27  3:52     ` Gujjar, Abhinandan S
2020-10-27 12:51   ` Ananyev, Konstantin
2020-10-27 17:17     ` 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=MWHPR11MB1838BCF15C64000FE0AED559E8160@MWHPR11MB1838.namprd11.prod.outlook.com \
    --to=abhinandan.gujjar@intel.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=narender.vangati@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).