All of lore.kernel.org
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>,
	"Zhang, Roy Fan" <roy.fan.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>
Subject: Re: [PATCH] crypto/scheduler: add multicore scheduling mode
Date: Wed, 31 May 2017 07:48:52 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8976CBB956E@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1496002118-64735-1-git-send-email-pablo.de.lara.guarch@intel.com>

Hi Kirill,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Sunday, May 28, 2017 9:09 PM
> To: Doherty, Declan; Zhang, Roy Fan
> Cc: dev@dpdk.org; Rybalchenko, Kirill
> Subject: [dpdk-dev] [PATCH] crypto/scheduler: add multicore scheduling
> mode
> 
> From: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> 
> Multi-core scheduling mode is a mode where scheduler distributes
> crypto operations in a round-robin base, between several core
> assigned as workers.
> 
> Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> ---
>  app/test-crypto-perf/cperf_test_throughput.c       |   2 +
>  drivers/crypto/scheduler/Makefile                  |   1 +
>  drivers/crypto/scheduler/rte_cryptodev_scheduler.c |   7 +
>  drivers/crypto/scheduler/rte_cryptodev_scheduler.h |   6 +
>  drivers/crypto/scheduler/scheduler_multicore.c     | 405
> +++++++++++++++++++++
>  drivers/crypto/scheduler/scheduler_pmd.c           |  73 +++-
>  drivers/crypto/scheduler/scheduler_pmd_private.h   |   4 +
>  lib/librte_cryptodev/rte_cryptodev.c               |   2 +-
>  8 files changed, 497 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/crypto/scheduler/scheduler_multicore.c
> 
> diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-
> crypto-perf/cperf_test_throughput.c
> index 61b27ea..0504a37 100644
> --- a/app/test-crypto-perf/cperf_test_throughput.c
> +++ b/app/test-crypto-perf/cperf_test_throughput.c
> @@ -502,6 +502,8 @@ cperf_throughput_test_runner(void *test_ctx)
> 
>  	}
> 
> +	rte_cryptodev_stop(ctx->dev_id);

This should be in a separate patch, but this is probably in the wrong place,
as this runner is called several times when using multiple buffer sizes.

> +
>  	return 0;
>  }
> 

...

> diff --git a/drivers/crypto/scheduler/scheduler_multicore.c
> b/drivers/crypto/scheduler/scheduler_multicore.c
> new file mode 100644
> index 0000000..12e5734
> --- /dev/null
> +++ b/drivers/crypto/scheduler/scheduler_multicore.c


> +struct mc_scheduler_qp_ctx {
> +	struct scheduler_slave
> slaves[RTE_CRYPTODEV_SCHEDULER_MAX_NB_SLAVES];
> +	uint32_t nb_slaves;
> +
> +	uint32_t last_enq_worker_idx;
> +	uint32_t last_deq_worker_idx;

I would say these can be uint8_t.

...

> +static int
> +scheduler_stop(struct rte_cryptodev *dev)
> +{
> +	struct scheduler_ctx *sched_ctx = dev->data->dev_private;
> +	struct mc_scheduler_ctx *mc_ctx = sched_ctx->private_ctx;
> +
> +	mc_ctx->stop_signal = 1;
> +	for (uint16_t i = 0; i < sched_ctx->nb_wc; i++)

Declare the variable "i" outside the foor loop.

> +		rte_eal_wait_lcore(sched_ctx->wc_pool[i]);
> +
> +	return 0;
> +}

 
>  const struct scheduler_parse_map scheduler_ordering_map[] = {
> @@ -117,6 +124,17 @@ cryptodev_scheduler_create(const char *name,
>  	sched_ctx->max_nb_queue_pairs =
>  			init_params->def_p.max_nb_queue_pairs;
> 
> +	if (init_params->mode == CDEV_SCHED_MODE_MULTICORE) {
> +		sched_ctx->nb_wc = 0;
> +		for (uint16_t i = 0; i < MAX_NB_WORKER_CORES; i++) {

Declare variable "i" outside for loop.

> +			if (init_params->wcmask & (1ULL << i)) {
> +				sched_ctx->wc_pool[sched_ctx->nb_wc++] =
> i;
> +				RTE_LOG(INFO, PMD, "  Worker
> core[%u]=%u added\n",
> +						sched_ctx->nb_wc-1, i);
> +			}
> +		}
> +	}
> +
>  	if (init_params->mode > CDEV_SCHED_MODE_USERDEFINED &&
>  			init_params->mode < CDEV_SCHED_MODE_COUNT)
> {
>  		ret = rte_cryptodev_scheduler_mode_set(dev->data-
> >dev_id,
> @@ -251,6 +269,42 @@ parse_integer_arg(const char *key __rte_unused,
>  	return 0;
>  }
> 

...

> diff --git a/lib/librte_cryptodev/rte_cryptodev.c
> b/lib/librte_cryptodev/rte_cryptodev.c
> index b65cd9c..5aa2b8b 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.c
> +++ b/lib/librte_cryptodev/rte_cryptodev.c
> @@ -1032,8 +1032,8 @@ rte_cryptodev_stop(uint8_t dev_id)
>  		return;
>  	}
> 
> -	dev->data->dev_started = 0;
>  	(*dev->dev_ops->dev_stop)(dev);
> +	dev->data->dev_started = 0;

Separate patch for this.

>  }

Last thing, there are some compilation issues to fix, according to patchwork:
http://dpdk.org/ml/archives/test-report/2017-May/020993.html

Thanks,
Pablo

  reply	other threads:[~2017-05-31  7:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-28 20:08 [PATCH] crypto/scheduler: add multicore scheduling mode Pablo de Lara
2017-05-31  7:48 ` De Lara Guarch, Pablo [this message]
2017-06-05  6:19 ` Zhang, Roy Fan
2017-06-30  9:51 ` [PATCH v2] " Pablo de Lara
2017-07-05 16:14   ` [PATCH v3] " Kirill Rybalchenko
2017-07-06  1:42     ` Zhang, Roy Fan
2017-07-06  8:30       ` De Lara Guarch, Pablo
2017-07-06  8:32       ` 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=E115CCD9D858EF4F90C690B0DCB4D8976CBB956E@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=kirill.rybalchenko@intel.com \
    --cc=roy.fan.zhang@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.