DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>
Subject: Re: [dpdk-dev] [PATCH v5 1/3] crypto/scheduler: add packet size based mode code
Date: Wed, 29 Mar 2017 20:09:45 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8974770F2B9@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1490804784-64350-2-git-send-email-roy.fan.zhang@intel.com>

Hi Fan,

> -----Original Message-----
> From: Zhang, Roy Fan
> Sent: Wednesday, March 29, 2017 5:26 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo; Gonzalez Monroy, Sergio; Doherty, Declan
> Subject: [PATCH v5 1/3] crypto/scheduler: add packet size based mode
> code
> 
> This patch adds the packet size based distribution mode main source
> file.
> 
> Packet-size based distribution mode is a scheduling mode works with 2
> slaves, primary slave and secondary slave, and distribute the enqueued
> crypto ops to them based on their data lengths. A crypto op will be
> distributed to the primary slave if its data length equals or bigger
> than the designated threshold, otherwise it will be handled by the
> secondary slave.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> Series-acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

I haven't acked this patch yet :P. Actually, I have one comment below.

> ---
>  .../crypto/scheduler/scheduler_pkt_size_distr.c    | 410
> +++++++++++++++++++++
>  1 file changed, 410 insertions(+)
>  create mode 100644 drivers/crypto/scheduler/scheduler_pkt_size_distr.c
> 
> diff --git a/drivers/crypto/scheduler/scheduler_pkt_size_distr.c
> b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c
> new file mode 100644
> index 0000000..8da10c8
> --- /dev/null
> +++ b/drivers/crypto/scheduler/scheduler_pkt_size_distr.c

...

> +static uint16_t
> +schedule_enqueue(void *qp, struct rte_crypto_op **ops, uint16_t
> nb_ops)
> +{

...

> +		job_len = ops[i]->sym->cipher.data.length;
> +		job_len += (ops[i]->sym->cipher.data.length == 0) *
> +				ops[i]->sym->auth.data.length;
> +		/* decide the target op based on the job length */
> +		p_enq_op = &enq_ops[!(job_len & qp_ctx->threshold)];
> +		sched_ops[p_enq_op->slave_idx][p_enq_op->pos] = ops[i];
> +		ops[i]->sym->session = sess->sessions[p_enq_op-
> >slave_idx];
> +		p_enq_op->pos++;
> +
> +		/* stop schedule cops before the queue is full, this shall
> +		 * prevent the failed enqueue
> +		 */
> +		if (p_enq_op->pos + in_flight_ops[p_enq_op->slave_idx] >=
> +				qp_ctx->max_nb_objs) {
> +			i = nb_ops;
> +			break;
> +		}

If (in_flight_ops == qp_ctx->max_nb_objs), then you won't even be able to enqueue
a single crypto operation (as the device is completely full), but at this stage, 
you have already modified the session of the operation, so you need to avoid this situation.

Thanks,
Pablo

  reply	other threads:[~2017-03-29 20:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 14:09 [dpdk-dev] [PATCH v3 0/3] crypto/scheduler: add packet-base scheduling mode Fan Zhang
2017-03-28 14:09 ` [dpdk-dev] [PATCH v3 1/3] crypto/scheduler: add packet size based mode code Fan Zhang
2017-03-28 14:09 ` [dpdk-dev] [PATCH v3 2/3] crypto/scheduler: enable packet size based scheduling mode Fan Zhang
2017-03-28 14:09 ` [dpdk-dev] [PATCH v3 3/3] doc: update cryptodev scheduler PMD documentation Fan Zhang
2017-03-29  8:25 ` [dpdk-dev] [PATCH v4 0/3] crypto/scheduler: add packet-base scheduling mode Fan Zhang
2017-03-29  8:25   ` [dpdk-dev] [PATCH v4 1/3] crypto/scheduler: add packet size based mode code Fan Zhang
2017-03-30  7:38     ` Declan Doherty
2017-03-29  8:25   ` [dpdk-dev] [PATCH v4 2/3] crypto/scheduler: enable packet size based scheduling mode Fan Zhang
2017-03-29  8:25   ` [dpdk-dev] [PATCH v4 3/3] doc: update cryptodev scheduler PMD documentation Fan Zhang
2017-03-29  9:57     ` Mcnamara, John
2017-03-29 16:26   ` [dpdk-dev] [PATCH v5 0/3] crypto/scheduler: add packet-base scheduling mode Fan Zhang
2017-03-29 16:26     ` [dpdk-dev] [PATCH v5 1/3] crypto/scheduler: add packet size based mode code Fan Zhang
2017-03-29 20:09       ` De Lara Guarch, Pablo [this message]
2017-03-29 16:26     ` [dpdk-dev] [PATCH v5 2/3] crypto/scheduler: enable packet size based scheduling mode Fan Zhang
2017-03-29 16:26     ` [dpdk-dev] [PATCH v5 3/3] doc: update cryptodev scheduler PMD documentation Fan Zhang
2017-03-30 10:47     ` [dpdk-dev] [PATCH v6 0/3] crypto/scheduler: add packet-base scheduling mode Fan Zhang
2017-03-30 10:47       ` [dpdk-dev] [PATCH v6 1/3] crypto/scheduler: add packet size based mode code Fan Zhang
2017-03-30 11:16         ` Declan Doherty
2017-03-30 10:47       ` [dpdk-dev] [PATCH v6 2/3] crypto/scheduler: enable packet size based scheduling mode Fan Zhang
2017-03-30 11:17         ` Declan Doherty
2017-03-30 10:47       ` [dpdk-dev] [PATCH v6 3/3] doc: update cryptodev scheduler PMD documentation Fan Zhang
2017-03-30 11:17         ` Declan Doherty
2017-03-30 12:10       ` [dpdk-dev] [PATCH v6 0/3] crypto/scheduler: add packet-base scheduling mode De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D8974770F2B9@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=roy.fan.zhang@intel.com \
    --cc=sergio.gonzalez.monroy@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).