Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41395/?format=api
http://patchwork.dpdk.org/api/patches/41395/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180622120847.72376-3-roy.fan.zhang@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20180622120847.72376-3-roy.fan.zhang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180622120847.72376-3-roy.fan.zhang@intel.com", "date": "2018-06-22T12:08:47", "name": "[2/2] crypto/scheduler: add packet-size-distr mode param parse", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "23cd9b29d9d16039bd427a3c962803f3e2154a07", "submitter": { "id": 304, "url": "http://patchwork.dpdk.org/api/people/304/?format=api", "name": "Fan Zhang", "email": "roy.fan.zhang@intel.com" }, "delegate": { "id": 22, "url": "http://patchwork.dpdk.org/api/users/22/?format=api", "username": "pdelarag", "first_name": "Pablo", "last_name": "de Lara Guarch", "email": "pablo.de.lara.guarch@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180622120847.72376-3-roy.fan.zhang@intel.com/mbox/", "series": [ { "id": 206, "url": "http://patchwork.dpdk.org/api/series/206/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=206", "date": "2018-06-22T12:08:45", "name": "crypto/scheduler: add mode specific parameter support", "version": 1, "mbox": "http://patchwork.dpdk.org/series/206/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41395/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41395/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C92C21BB4B;\n\tFri, 22 Jun 2018 14:18:07 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 193E11BA92\n\tfor <dev@dpdk.org>; Fri, 22 Jun 2018 14:18:01 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Jun 2018 05:18:01 -0700", "from silpixa00398673.ir.intel.com (HELO\n\tsilpixa00398673.ger.corp.intel.com) ([10.237.223.54])\n\tby orsmga008.jf.intel.com with ESMTP; 22 Jun 2018 05:18:00 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,256,1526367600\"; d=\"scan'208\";a=\"51396420\"", "From": "Fan Zhang <roy.fan.zhang@intel.com>", "To": "dev@dpdk.org", "Cc": "pablo.de.lara.guarch@intel.com,\n\troy.fan.zhang@intel.com", "Date": "Fri, 22 Jun 2018 13:08:47 +0100", "Message-Id": "<20180622120847.72376-3-roy.fan.zhang@intel.com>", "X-Mailer": "git-send-email 2.13.6", "In-Reply-To": "<20180622120847.72376-1-roy.fan.zhang@intel.com>", "References": "<20180622120847.72376-1-roy.fan.zhang@intel.com>", "Subject": "[dpdk-dev] [PATCH 2/2] crypto/scheduler: add packet-size-distr mode\n\tparam parse", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch adds packet-size-distr mode specific parameter parse to\nsupport different threshold packet size value other than default\n128 bytes.\n\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\n---\n doc/guides/cryptodevs/scheduler.rst | 7 ++-\n drivers/crypto/scheduler/rte_cryptodev_scheduler.h | 1 +\n drivers/crypto/scheduler/scheduler_pmd.c | 53 ++++++++++++++++++++++\n 3 files changed, 60 insertions(+), 1 deletion(-)", "diff": "diff --git a/doc/guides/cryptodevs/scheduler.rst b/doc/guides/cryptodevs/scheduler.rst\nindex 4d7f5b152..d4e695760 100644\n--- a/doc/guides/cryptodevs/scheduler.rst\n+++ b/doc/guides/cryptodevs/scheduler.rst\n@@ -137,7 +137,12 @@ operation:\n **option_type** must be **CDEV_SCHED_OPTION_THRESHOLD** and **option** should\n point to a rte_cryptodev_scheduler_threshold_option structure filled with\n appropriate threshold value. Please NOTE this threshold has be a power-of-2\n- unsigned integer.\n+ unsigned integer. It is possible to use **mode_param** initialization\n+ parameter to achieve the same purpose. For example:\n+\n+ ... --vdev \"crypto_scheduler,mode=packet-size-distr,threshold:512\" ...\n+\n+ The above parameter will overwrite the threshold value to 512.\n \n * **CDEV_SCHED_MODE_FAILOVER:**\n \ndiff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h\nindex 1c164da7c..3faea4099 100644\n--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.h\n+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.h\n@@ -76,6 +76,7 @@ enum rte_cryptodev_schedule_option_type {\n /**\n * Threshold option structure\n */\n+#define RTE_CRYPTODEV_SCHEDULER_PARAM_THRES\t\"threshold\"\n struct rte_cryptodev_scheduler_threshold_option {\n \tuint32_t threshold;\t/**< Threshold for packet-size mode */\n };\ndiff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c\nindex 04eac114e..41a13ee90 100644\n--- a/drivers/crypto/scheduler/scheduler_pmd.c\n+++ b/drivers/crypto/scheduler/scheduler_pmd.c\n@@ -73,6 +73,8 @@ const struct scheduler_parse_map scheduler_ordering_map[] = {\n \t\t{\"disable\", 0}\n };\n \n+#define CDEV_SCHED_MODE_PARAM_SEP_CHAR\t\t':'\n+\n static int\n cryptodev_scheduler_create(const char *name,\n \t\tstruct rte_vdev_device *vdev,\n@@ -112,6 +114,15 @@ cryptodev_scheduler_create(const char *name,\n \n \tif (init_params->mode > CDEV_SCHED_MODE_USERDEFINED &&\n \t\t\tinit_params->mode < CDEV_SCHED_MODE_COUNT) {\n+\t\tunion {\n+\t\t\tstruct rte_cryptodev_scheduler_threshold_option\n+\t\t\t\t\tthreshold_option;\n+\t\t} option;\n+\t\tenum rte_cryptodev_schedule_option_type option_type;\n+\t\tchar param_name[RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN] = {0};\n+\t\tchar param_val[RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN] = {0};\n+\t\tchar *s, *end;\n+\n \t\tret = rte_cryptodev_scheduler_mode_set(dev->data->dev_id,\n \t\t\tinit_params->mode);\n \t\tif (ret < 0) {\n@@ -127,6 +138,48 @@ cryptodev_scheduler_create(const char *name,\n \t\t\t\t\tscheduler_mode_map[i].name);\n \t\t\tbreak;\n \t\t}\n+\n+\t\tif (strlen(init_params->mode_param_str) > 0) {\n+\t\t\ts = strchr(init_params->mode_param_str,\n+\t\t\t\t\tCDEV_SCHED_MODE_PARAM_SEP_CHAR);\n+\t\t\tif (s == NULL) {\n+\t\t\t\tCS_LOG_ERR(\"Invalid mode param\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\n+\t\t\tstrlcpy(param_name, init_params->mode_param_str,\n+\t\t\t\t\ts - init_params->mode_param_str + 1);\n+\t\t\ts++;\n+\t\t\tstrlcpy(param_val, s,\n+\t\t\t\t\tRTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN);\n+\n+\t\t\tswitch (init_params->mode) {\n+\t\t\tcase CDEV_SCHED_MODE_PKT_SIZE_DISTR:\n+\t\t\t\tif (strcmp(param_name,\n+\t\t\t\t\tRTE_CRYPTODEV_SCHEDULER_PARAM_THRES)\n+\t\t\t\t\t\t!= 0) {\n+\t\t\t\t\tCS_LOG_ERR(\"Invalid mode param\");\n+\t\t\t\t\treturn -EINVAL;\n+\t\t\t\t}\n+\t\t\t\toption_type = CDEV_SCHED_OPTION_THRESHOLD;\n+\n+\t\t\t\toption.threshold_option.threshold =\n+\t\t\t\t\t\tstrtoul(param_val, &end, 0);\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tCS_LOG_ERR(\"Invalid mode param\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\n+\t\t\tif (sched_ctx->ops.option_set(dev, option_type,\n+\t\t\t\t\t(void *)&option) < 0) {\n+\t\t\t\tCS_LOG_ERR(\"Invalid mode param\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\n+\t\t\tRTE_LOG(INFO, PMD, \" Sched mode param (%s = %s)\\n\",\n+\t\t\t\t\tparam_name, param_val);\n+\t\t}\n \t}\n \n \tsched_ctx->reordering_enabled = init_params->enable_ordering;\n", "prefixes": [ "2/2" ] }{ "id": 41395, "url": "