Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41441/?format=api
http://patchwork.dpdk.org/api/patches/41441/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1529904090-8661-1-git-send-email-jananeex.m.parthasarathy@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": "<1529904090-8661-1-git-send-email-jananeex.m.parthasarathy@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1529904090-8661-1-git-send-email-jananeex.m.parthasarathy@intel.com", "date": "2018-06-25T05:21:30", "name": "crypto/zuc: add dynamic logging to zuc", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "9384520a1a2d2c1863132f9f7012092f3dc979e1", "submitter": { "id": 1024, "url": "http://patchwork.dpdk.org/api/people/1024/?format=api", "name": "Jananee Parthasarathy", "email": "jananeex.m.parthasarathy@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/1529904090-8661-1-git-send-email-jananeex.m.parthasarathy@intel.com/mbox/", "series": [ { "id": 218, "url": "http://patchwork.dpdk.org/api/series/218/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=218", "date": "2018-06-25T05:21:30", "name": "crypto/zuc: add dynamic logging to zuc", "version": 1, "mbox": "http://patchwork.dpdk.org/series/218/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41441/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41441/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 B3A9358C4;\n\tMon, 25 Jun 2018 07:21:49 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id EF5A62BEA\n\tfor <dev@dpdk.org>; Mon, 25 Jun 2018 07:21:47 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Jun 2018 22:21:47 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 24 Jun 2018 22:21:45 -0700", "from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com\n\t[10.102.246.100])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw5P5LiJP020634; Mon, 25 Jun 2018 06:21:44 +0100", "from wgcvswdev001.ir.intel.com (localhost [127.0.0.1])\n\tby wgcvswdev001.ir.intel.com with ESMTP id w5P5LiGq008746;\n\tMon, 25 Jun 2018 06:21:44 +0100", "(from jmparthx@localhost)\n\tby wgcvswdev001.ir.intel.com with ? id w5P5LiRw008742;\n\tMon, 25 Jun 2018 06:21:44 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,269,1526367600\"; d=\"scan'208\";a=\"210846273\"", "From": "Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>", "To": "dev@dpdk.org", "Cc": "pablo.de.lara.guarch@intel.com, reshma.pattan@intel.com,\n\tAgalya Babu Radha Krishnan <agalyax.babu.radhakrishnan@intel.com>", "Date": "Mon, 25 Jun 2018 06:21:30 +0100", "Message-Id": "<1529904090-8661-1-git-send-email-jananeex.m.parthasarathy@intel.com>", "X-Mailer": "git-send-email 1.7.12.2", "Subject": "[dpdk-dev] [PATCH] crypto/zuc: add dynamic logging to zuc", "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": "From: Agalya Babu Radha Krishnan <agalyax.babu.radhakrishnan@intel.com>\n\n 1.added new logtype for zuc driver.\n 2.registered new logtype.\n 3.ZUC_LOG_ERR and CDEV_LOG_ERR are\n replaced with new logtype name ZUC_PMD_LOG\n\nSigned-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>\nReviewed-by: Reshma Pattan <reshma.pattan@intel.com>\n---\n drivers/crypto/zuc/rte_zuc_pmd.c | 28 +++++++++++++++++-----------\n drivers/crypto/zuc/rte_zuc_pmd_ops.c | 13 +++++++------\n drivers/crypto/zuc/rte_zuc_pmd_private.h | 27 +++++++--------------------\n 3 files changed, 31 insertions(+), 37 deletions(-)", "diff": "diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c\nindex a805b2278..2a6c2caf7 100644\n--- a/drivers/crypto/zuc/rte_zuc_pmd.c\n+++ b/drivers/crypto/zuc/rte_zuc_pmd.c\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2016-2017 Intel Corporation\n+ * Copyright(c) 2016-2018 Intel Corporation\n */\n \n #include <rte_common.h>\n@@ -11,7 +11,6 @@\n #include <rte_cpuflags.h>\n \n #include \"rte_zuc_pmd_private.h\"\n-\n #define ZUC_MAX_BURST 4\n #define BYTE_LEN 8\n \n@@ -78,7 +77,7 @@ zuc_set_session_parameters(struct zuc_session *sess,\n \t\tbreak;\n \tcase ZUC_OP_NOT_SUPPORTED:\n \tdefault:\n-\t\tZUC_LOG_ERR(\"Unsupported operation chain order parameter\");\n+\t\tZUC_PMD_LOG(ERR, \"Unsupported operation chain order parameter\");\n \t\treturn -ENOTSUP;\n \t}\n \n@@ -88,7 +87,7 @@ zuc_set_session_parameters(struct zuc_session *sess,\n \t\t\treturn -ENOTSUP;\n \n \t\tif (cipher_xform->cipher.iv.length != ZUC_IV_KEY_LENGTH) {\n-\t\t\tZUC_LOG_ERR(\"Wrong IV length\");\n+\t\t\tZUC_PMD_LOG(ERR, \"Wrong IV length\");\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tsess->cipher_iv_offset = cipher_xform->cipher.iv.offset;\n@@ -104,14 +103,14 @@ zuc_set_session_parameters(struct zuc_session *sess,\n \t\t\treturn -ENOTSUP;\n \n \t\tif (auth_xform->auth.digest_length != ZUC_DIGEST_LENGTH) {\n-\t\t\tZUC_LOG_ERR(\"Wrong digest length\");\n+\t\t\tZUC_PMD_LOG(ERR, \"Wrong digest length\");\n \t\t\treturn -EINVAL;\n \t\t}\n \n \t\tsess->auth_op = auth_xform->auth.op;\n \n \t\tif (auth_xform->auth.iv.length != ZUC_IV_KEY_LENGTH) {\n-\t\t\tZUC_LOG_ERR(\"Wrong IV length\");\n+\t\t\tZUC_PMD_LOG(ERR, \"Wrong IV length\");\n \t\t\treturn -EINVAL;\n \t\t}\n \t\tsess->auth_iv_offset = auth_xform->auth.iv.offset;\n@@ -187,7 +186,7 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,\n \t\t\t\t|| ((ops[i]->sym->cipher.data.offset\n \t\t\t\t\t% BYTE_LEN) != 0)) {\n \t\t\tops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;\n-\t\t\tZUC_LOG_ERR(\"Data Length or offset\");\n+\t\t\tZUC_PMD_LOG(ERR, \"Data Length or offset\");\n \t\t\tbreak;\n \t\t}\n \n@@ -198,7 +197,7 @@ process_zuc_cipher_op(struct rte_crypto_op **ops,\n \t\t\t\t(ops[i]->sym->m_dst != NULL &&\n \t\t\t\t!rte_pktmbuf_is_contiguous(\n \t\t\t\t\t\tops[i]->sym->m_dst))) {\n-\t\t\tZUC_LOG_ERR(\"PMD supports only contiguous mbufs, \"\n+\t\t\tZUC_PMD_LOG(ERR, \"PMD supports only contiguous mbufs, \"\n \t\t\t\t\"op (%p) provides noncontiguous mbuf as \"\n \t\t\t\t\"source/destination buffer.\\n\", ops[i]);\n \t\t\tops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;\n@@ -246,7 +245,7 @@ process_zuc_hash_op(struct zuc_qp *qp, struct rte_crypto_op **ops,\n \t\t/* Data must be byte aligned */\n \t\tif ((ops[i]->sym->auth.data.offset % BYTE_LEN) != 0) {\n \t\t\tops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;\n-\t\t\tZUC_LOG_ERR(\"Offset\");\n+\t\t\tZUC_PMD_LOG(ERR, \"Offset\");\n \t\t\tbreak;\n \t\t}\n \n@@ -461,7 +460,7 @@ cryptodev_zuc_create(const char *name,\n \n \tdev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);\n \tif (dev == NULL) {\n-\t\tZUC_LOG_ERR(\"failed to create cryptodev vdev\");\n+\t\tZUC_PMD_LOG(ERR, \"failed to create cryptodev vdev\");\n \t\tgoto init_error;\n \t}\n \n@@ -483,7 +482,7 @@ cryptodev_zuc_create(const char *name,\n \n \treturn 0;\n init_error:\n-\tZUC_LOG_ERR(\"driver %s: cryptodev_zuc_create failed\",\n+\tZUC_PMD_LOG(ERR, \"driver %s: failed\",\n \t\t\tinit_params->name);\n \n \tcryptodev_zuc_remove(vdev);\n@@ -545,3 +544,10 @@ RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ZUC_PMD,\n \t\"socket_id=<int>\");\n RTE_PMD_REGISTER_CRYPTO_DRIVER(zuc_crypto_drv, cryptodev_zuc_pmd_drv.driver,\n \t\tcryptodev_driver_id);\n+\n+RTE_INIT(zuc_init_log);\n+static void\n+zuc_init_log(void)\n+{\n+\tzuc_logtype_driver = rte_log_register(\"pmd.crypto.zuc\");\n+}\ndiff --git a/drivers/crypto/zuc/rte_zuc_pmd_ops.c b/drivers/crypto/zuc/rte_zuc_pmd_ops.c\nindex 8abac8989..6f3345421 100644\n--- a/drivers/crypto/zuc/rte_zuc_pmd_ops.c\n+++ b/drivers/crypto/zuc/rte_zuc_pmd_ops.c\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2016-2017 Intel Corporation\n+ * Copyright(c) 2016-2018 Intel Corporation\n */\n \n #include <string.h>\n@@ -172,13 +172,13 @@ zuc_pmd_qp_create_processed_ops_ring(struct zuc_qp *qp,\n \tr = rte_ring_lookup(qp->name);\n \tif (r) {\n \t\tif (rte_ring_get_size(r) >= ring_size) {\n-\t\t\tZUC_LOG_INFO(\"Reusing existing ring %s\"\n+\t\t\tZUC_PMD_LOG(INFO, \"Reusing existing ring %s\"\n \t\t\t\t\t\" for processed packets\",\n \t\t\t\t\t qp->name);\n \t\t\treturn r;\n \t\t}\n \n-\t\tZUC_LOG_ERR(\"Unable to reuse existing ring %s\"\n+\t\tZUC_PMD_LOG(ERR, \"Unable to reuse existing ring %s\"\n \t\t\t\t\" for processed packets\",\n \t\t\t\t qp->name);\n \t\treturn NULL;\n@@ -271,19 +271,20 @@ zuc_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,\n \tint ret;\n \n \tif (unlikely(sess == NULL)) {\n-\t\tZUC_LOG_ERR(\"invalid session struct\");\n+\t\tZUC_PMD_LOG(ERR, \"invalid session struct\");\n \t\treturn -EINVAL;\n \t}\n \n \tif (rte_mempool_get(mempool, &sess_private_data)) {\n-\t\tCDEV_LOG_ERR(\n+\t\tZUC_PMD_LOG(ERR,\n \t\t\t\"Couldn't get object from session mempool\");\n+\n \t\treturn -ENOMEM;\n \t}\n \n \tret = zuc_set_session_parameters(sess_private_data, xform);\n \tif (ret != 0) {\n-\t\tZUC_LOG_ERR(\"failed configure session parameters\");\n+\t\tZUC_PMD_LOG(ERR, \"failed configure session parameters\");\n \n \t\t/* Return session to mempool */\n \t\trte_mempool_put(mempool, sess_private_data);\ndiff --git a/drivers/crypto/zuc/rte_zuc_pmd_private.h b/drivers/crypto/zuc/rte_zuc_pmd_private.h\nindex b83c4a047..36923b5de 100644\n--- a/drivers/crypto/zuc/rte_zuc_pmd_private.h\n+++ b/drivers/crypto/zuc/rte_zuc_pmd_private.h\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2016-2017 Intel Corporation\n+ * Copyright(c) 2016-2018 Intel Corporation\n */\n \n #ifndef _RTE_ZUC_PMD_PRIVATE_H_\n@@ -10,25 +10,12 @@\n #define CRYPTODEV_NAME_ZUC_PMD\t\tcrypto_zuc\n /**< KASUMI PMD device name */\n \n-#define ZUC_LOG_ERR(fmt, args...) \\\n-\tRTE_LOG(ERR, CRYPTODEV, \"[%s] %s() line %u: \" fmt \"\\n\", \\\n-\t\t\tRTE_STR(CRYPTODEV_NAME_ZUC_PMD), \\\n-\t\t\t__func__, __LINE__, ## args)\n-\n-#ifdef RTE_LIBRTE_ZUC_DEBUG\n-#define ZUC_LOG_INFO(fmt, args...) \\\n-\tRTE_LOG(INFO, CRYPTODEV, \"[%s] %s() line %u: \" fmt \"\\n\", \\\n-\t\t\tRTE_STR(CRYPTODEV_NAME_ZUC_PMD), \\\n-\t\t\t__func__, __LINE__, ## args)\n-\n-#define ZUC_LOG_DBG(fmt, args...) \\\n-\tRTE_LOG(DEBUG, CRYPTODEV, \"[%s] %s() line %u: \" fmt \"\\n\", \\\n-\t\t\tRTE_STR(CRYPTODEV_NAME_ZUC_PMD), \\\n-\t\t\t__func__, __LINE__, ## args)\n-#else\n-#define ZUC_LOG_INFO(fmt, args...)\n-#define ZUC_LOG_DBG(fmt, args...)\n-#endif\n+/** ZUC PMD LOGTYPE DRIVER */\n+int zuc_logtype_driver;\n+#define ZUC_PMD_LOG(level, fmt, ...) \\\n+\trte_log(RTE_LOG_ ## level, zuc_logtype_driver, \\\n+\t\t\t\"%s()... line %u: \" fmt \"\\n\", __func__, __LINE__, \\\n+\t\t\t\t## __VA_ARGS__)\n \n #define ZUC_IV_KEY_LENGTH 16\n #define ZUC_DIGEST_LENGTH 4\n", "prefixes": [] }{ "id": 41441, "url": "