From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 376B72BD1 for ; Tue, 24 Jan 2017 17:06:07 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 24 Jan 2017 08:06:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,278,1477983600"; d="scan'208";a="217055905" Received: from silpixa00381633.ir.intel.com (HELO silpixa00381633.ger.corp.intel.com) ([10.237.222.114]) by fmsmga004.fm.intel.com with ESMTP; 24 Jan 2017 08:06:05 -0800 From: Fan Zhang To: dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com Date: Tue, 24 Jan 2017 16:06:12 +0000 Message-Id: <1485273983-172764-1-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484659145-107332-1-git-send-email-roy.fan.zhang@intel.com> References: <1484659145-107332-1-git-send-email-roy.fan.zhang@intel.com> Subject: [dpdk-dev] [PATCH v6 00/11] crypto/scheduler: add driver for scheduler crypto pmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2017 16:06:08 -0000 This patch provides the initial implementation of the scheduler poll mode driver using DPDK cryptodev framework. Scheduler PMD is used to schedule and enqueue the crypto ops to the hardware and/or software crypto devices attached to it (slaves). The dequeue operation from the slave(s), and the possible dequeued crypto op reordering, are then carried out by the scheduler. As the initial version, the scheduler PMD currently supports only the Round-robin mode, which distributes the enqueued burst of crypto ops among its slaves in a round-robin manner. This mode may help to fill the throughput gap between the physical core and the existing cryptodevs to increase the overall performance. Moreover, the scheduler PMD is provided the APIs for user to create his/her own scheduler. Build instructions: To build DPDK with CRYTPO_SCHEDULER_PMD the user is required to set CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER=y in config/common_base Notice: - Scheduler PMD shares same EAL commandline options as other cryptodevs. However, apart from socket_id, the rest of cryptodev options are ignored. The scheduler PMD's max_nb_queue_pairs and max_nb_sessions options are set as the minimum values of the attached slaves'. For example, a scheduler cryptodev is attached 2 cryptodevs with max_nb_queue_pairs of 2 and 8, respectively. The scheduler cryptodev's max_nb_queue_pairs will be automatically updated as 2. - In addition, an extra option "slave" is added. The user can attach one or more slave cryptodevs initially by passing their names with this option. Here is an example: ... --vdev "crypto_aesni_mb_pmd,name=aesni_mb_1" --vdev "crypto_aesni_ mb_pmd,name=aesni_mb_2" --vdev "crypto_scheduler_pmd,slave=aesni_mb_1, slave=aesni_mb_2" ... Remember the software cryptodevs to be attached shall be declared before the scheduler PMD, otherwise the scheduler will fail to locate the slave(s) and report error. - The scheduler cryptodev cannot be started unless the scheduling mode is set and at least one slave is attached. Also, to configure the scheduler in the run-time, like attach/detach slave(s), change scheduling mode, or enable/disable crypto op ordering, one should stop the scheduler first, otherwise an error will be returned. - Enabling crypto ops reordering will cause overwriting the userdata field of each mbuf. Fan Zhang (11): Changes in v6: Split into multiple patches. Added documentation. Added unit test. Changes in v5: Fixed EOF whitespace warning. Updated Copyright. Changes in v4: Fixed a few bugs. Added slave EAL commandline option support. Changes in v3: Fixed config/common_base. Changes in v2: New approaches in API to suit future scheduling modes. cryptodev: add scheduler PMD name and type crypto/scheduler: add APIs for scheduler crypto/scheduler: add internal structure declarations crypto/scheduler: add scheduler API implementations crypto/scheduler: add round-robin scheduling mode crypto/scheduler: register scheduler vdev driver crypto/scheduler: register operation function pointer table crypto/scheduler: add scheduler PMD to DPDK compile system crypto/scheduler: add scheduler PMD config options app/test: add unit test for cryptodev scheduler PMD crypto/scheduler: add documentation app/test/test_cryptodev.c | 241 +++++++++- app/test/test_cryptodev_aes_test_vectors.h | 101 +++-- app/test/test_cryptodev_blockcipher.c | 6 +- app/test/test_cryptodev_blockcipher.h | 3 +- app/test/test_cryptodev_hash_test_vectors.h | 38 +- config/common_base | 8 +- doc/guides/cryptodevs/img/scheduler-overview.svg | 277 ++++++++++++ doc/guides/cryptodevs/index.rst | 3 +- doc/guides/cryptodevs/scheduler.rst | 128 ++++++ drivers/crypto/Makefile | 3 +- drivers/crypto/scheduler/Makefile | 66 +++ drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 471 ++++++++++++++++++++ drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 165 +++++++ .../scheduler/rte_cryptodev_scheduler_operations.h | 71 +++ .../scheduler/rte_pmd_crypto_scheduler_version.map | 12 + drivers/crypto/scheduler/scheduler_pmd.c | 361 +++++++++++++++ drivers/crypto/scheduler/scheduler_pmd_ops.c | 490 +++++++++++++++++++++ drivers/crypto/scheduler/scheduler_pmd_private.h | 115 +++++ drivers/crypto/scheduler/scheduler_roundrobin.c | 435 ++++++++++++++++++ lib/librte_cryptodev/rte_cryptodev.h | 3 + mk/rte.app.mk | 6 +- 21 files changed, 2948 insertions(+), 55 deletions(-) create mode 100644 doc/guides/cryptodevs/img/scheduler-overview.svg create mode 100644 doc/guides/cryptodevs/scheduler.rst create mode 100644 drivers/crypto/scheduler/Makefile create mode 100644 drivers/crypto/scheduler/rte_cryptodev_scheduler.c create mode 100644 drivers/crypto/scheduler/rte_cryptodev_scheduler.h create mode 100644 drivers/crypto/scheduler/rte_cryptodev_scheduler_operations.h create mode 100644 drivers/crypto/scheduler/rte_pmd_crypto_scheduler_version.map create mode 100644 drivers/crypto/scheduler/scheduler_pmd.c create mode 100644 drivers/crypto/scheduler/scheduler_pmd_ops.c create mode 100644 drivers/crypto/scheduler/scheduler_pmd_private.h create mode 100644 drivers/crypto/scheduler/scheduler_roundrobin.c -- 2.7.4