From: "Varghese, Vipin" <vipin.varghese@intel.com>
To: Akhil Goyal <akhil.goyal@nxp.com>,
"Wiles, Keith" <keith.wiles@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
"Doherty, Declan" <declan.doherty@intel.com>
Cc: "Padubidri, Sanjay A" <sanjay.padubidri@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] lib/crypto: add callback handlers for crypto
Date: Thu, 4 Jul 2019 05:03:33 +0000 [thread overview]
Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D38BA22@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <VE1PR04MB6639E2A56F16BB1974BEC330E6FD0@VE1PR04MB6639.eurprd04.prod.outlook.com>
Thanks Akhil, I will work on the suggested inputs.
> -----Original Message-----
> From: Akhil Goyal <akhil.goyal@nxp.com>
> Sent: Thursday, June 27, 2019 7:55 PM
> To: Varghese, Vipin <vipin.varghese@intel.com>; Wiles, Keith
> <keith.wiles@intel.com>; dev@dpdk.org; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: Padubidri, Sanjay A <sanjay.padubidri@intel.com>
> Subject: RE: [PATCH v2 1/2] lib/crypto: add callback handlers for crypto
>
> Hi Vipin,
>
> >
> > Add callback handlers for enqueue-dequeue operation on crypto device.
> > The pre-enqueue and post-dequeue are selected on invoke user
> > registered callback functions.
> >
> > Use cases:
> > - allow user to investigate the contents pre-enqueue.
> > - allow user to investigate the contents post-dequeue.
> > - modify pre-enqueue and post-dequeue stage content.
> > - investigate PMD meta data.
> >
> > Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> > ---
>
> [..]
>
> > @@ -907,6 +926,19 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id,
> > uint16_t qp_id,
> > nb_ops = (*dev->dequeue_burst)
> > (dev->data->queue_pairs[qp_id], ops, nb_ops);
> >
> > +#ifdef RTE_CRYPTODEV_ENQDEQ_CALLBACKS
> > + struct rte_cryptodev_enqdeq_callback *cb = NULL;
> > +
> > + TAILQ_FOREACH(cb, &(dev->deq_cbs), next) {
> > + if (cb->cb_fn == NULL)
> > + continue;
> > +
> > + cb->active = 1;
> > + nb_ops = cb->cb_fn(dev_id, qp_id, ops, nb_ops, cb->cb_arg);
> > + cb->active = 0;
> > + }
>
> Shouldn't this cb->active be set atomically.
>
> Will it be thread safe? There may be multiple threads enqueuing on the same
> device.
> One may be executing while the other finished and set the active to 0, and may
> unregister While the some other thread is still executing.
>
> One more thing, it would be better to have a debug prints about how many
> nb_ops have been Successfully passed through each of the callback.
> And in the callback, it should be assumed that it will return back just after the first
> failed ops, so that The application can free the remaining one. This should be
> documented in the callback API.
>
> > +#endif
> > +
> > return nb_ops;
> > }
> >
prev parent reply other threads:[~2019-07-04 5:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 5:03 [dpdk-dev] [PATCH v1 " Vipin Varghese
2019-06-10 5:03 ` [dpdk-dev] [PATCH v1 2/2] examples/l2fwd-crypto: add callback handlers Vipin Varghese
2019-06-10 6:30 ` [dpdk-dev] [PATCH v2 1/2] lib/crypto: add callback handlers for crypto Vipin Varghese
2019-06-10 6:30 ` [dpdk-dev] [PATCH v2 2/2] examples/l2fwd-crypto: add callback handlers Vipin Varghese
2019-06-21 7:06 ` Ruifeng Wang (Arm Technology China)
2019-07-04 5:03 ` Varghese, Vipin
2019-06-27 14:25 ` [dpdk-dev] [PATCH v2 1/2] lib/crypto: add callback handlers for crypto Akhil Goyal
2019-07-04 5:03 ` Varghese, Vipin [this message]
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=4C9E0AB70F954A408CC4ADDBF0F8FA7D4D38BA22@BGSMSX101.gar.corp.intel.com \
--to=vipin.varghese@intel.com \
--cc=akhil.goyal@nxp.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.com \
--cc=pablo.de.lara.guarch@intel.com \
--cc=sanjay.padubidri@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).