Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/11847/?format=api
http://patches.dpdk.org/api/patches/11847/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1459416734-54479-9-git-send-email-pablo.de.lara.guarch@intel.com/", "project": { "id": 1, "url": "http://patches.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": "<1459416734-54479-9-git-send-email-pablo.de.lara.guarch@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1459416734-54479-9-git-send-email-pablo.de.lara.guarch@intel.com", "date": "2016-03-31T09:32:14", "name": "[dpdk-dev,v3,8/8] l2fwd-crypto: extend crypto information", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "8aeb88d3b8ec2d73cf369390380317572177744c", "submitter": { "id": 9, "url": "http://patches.dpdk.org/api/people/9/?format=api", "name": "De Lara Guarch, Pablo", "email": "pablo.de.lara.guarch@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1459416734-54479-9-git-send-email-pablo.de.lara.guarch@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/11847/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/11847/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 809D96A1C;\n\tThu, 31 Mar 2016 11:32:27 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id CB82C691A\n\tfor <dev@dpdk.org>; Thu, 31 Mar 2016 11:32:16 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP; 31 Mar 2016 02:32:16 -0700", "from sie-lab-214-036.ir.intel.com (HELO\n\tsie-lab-214-36.ir.intel.com) ([10.237.214.36])\n\tby orsmga001.jf.intel.com with ESMTP; 31 Mar 2016 02:32:15 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,421,1455004800\"; d=\"scan'208\";a=\"922460836\"", "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>", "To": "dev@dpdk.org", "Cc": "declan.doherty@intel.com, Pablo de Lara <pablo.de.lara.guarch@intel.com>", "Date": "Thu, 31 Mar 2016 10:32:14 +0100", "Message-Id": "<1459416734-54479-9-git-send-email-pablo.de.lara.guarch@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1459416734-54479-1-git-send-email-pablo.de.lara.guarch@intel.com>", "References": "<1459414919-44829-1-git-send-email-pablo.de.lara.guarch@intel.com>\n\t<1459416734-54479-1-git-send-email-pablo.de.lara.guarch@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 8/8] l2fwd-crypto: extend crypto information", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Display extra crypto information (algorithms, keys/IV/AAD used, chain...),\nso user can know exactly what operations are being carried out.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n examples/l2fwd-crypto/main.c | 84 ++++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 82 insertions(+), 2 deletions(-)", "diff": "diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c\nindex 5fb33df..09a07d3 100644\n--- a/examples/l2fwd-crypto/main.c\n+++ b/examples/l2fwd-crypto/main.c\n@@ -71,6 +71,7 @@\n #include <rte_prefetch.h>\n #include <rte_random.h>\n #include <rte_ring.h>\n+#include <rte_hexdump.h>\n \n enum cdev_type {\n \tCDEV_TYPE_ANY,\n@@ -634,8 +635,6 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)\n \n \tRTE_LOG(INFO, L2FWD, \"entering main loop on lcore %u\\n\", lcore_id);\n \n-\tl2fwd_crypto_options_print(options);\n-\n \tfor (i = 0; i < qconf->nb_rx_ports; i++) {\n \n \t\tportid = qconf->rx_port_list[i];\n@@ -708,6 +707,14 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)\n \t\t\t\tport_cparams[i].dev_id);\n \t}\n \n+\tl2fwd_crypto_options_print(options);\n+\n+\t/*\n+\t * Initialize previous tsc timestamp before the loop,\n+\t * to avoid showing the port statistics immediately,\n+\t * so user can see the crypto information.\n+\t */\n+\tprev_tsc = rte_rdtsc();\n \twhile (1) {\n \n \t\tcur_tsc = rte_rdtsc();\n@@ -1213,8 +1220,45 @@ l2fwd_crypto_default_options(struct l2fwd_crypto_options *options)\n }\n \n static void\n+display_cipher_info(struct l2fwd_crypto_options *options)\n+{\n+\tprintf(\"\\n---- Cipher information ---\\n\");\n+\tprintf(\"Algorithm: %s\\n\",\n+\t\tsupported_cipher_algo[options->cipher_xform.cipher.algo]);\n+\trte_hexdump(stdout, \"Cipher key:\",\n+\t\t\toptions->cipher_xform.cipher.key.data,\n+\t\t\toptions->cipher_xform.cipher.key.length);\n+\trte_hexdump(stdout, \"IV:\", options->iv.data, options->iv.length);\n+}\n+\n+static void\n+display_auth_info(struct l2fwd_crypto_options *options)\n+{\n+\tprintf(\"\\n---- Authentication information ---\\n\");\n+\tprintf(\"Algorithm: %s\\n\",\n+\t\tsupported_auth_algo[options->auth_xform.auth.algo]);\n+\trte_hexdump(stdout, \"Auth key:\",\n+\t\t\toptions->auth_xform.auth.key.data,\n+\t\t\toptions->auth_xform.auth.key.length);\n+\trte_hexdump(stdout, \"AAD:\", options->aad.data, options->aad.length);\n+}\n+\n+static void\n l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)\n {\n+\tchar string_cipher_op[MAX_STR_LEN];\n+\tchar string_auth_op[MAX_STR_LEN];\n+\n+\tif (options->cipher_xform.cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)\n+\t\tstrcpy(string_cipher_op, \"Encrypt\");\n+\telse\n+\t\tstrcpy(string_cipher_op, \"Decrypt\");\n+\n+\tif (options->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_GENERATE)\n+\t\tstrcpy(string_auth_op, \"Auth generate\");\n+\telse\n+\t\tstrcpy(string_auth_op, \"Auth verify\");\n+\n \tprintf(\"Options:-\\nn\");\n \tprintf(\"portmask: %x\\n\", options->portmask);\n \tprintf(\"ports per lcore: %u\\n\", options->nb_ports_per_lcore);\n@@ -1226,6 +1270,42 @@ l2fwd_crypto_options_print(struct l2fwd_crypto_options *options)\n \n \tprintf(\"sessionless crypto: %s\\n\",\n \t\t\toptions->sessionless ? \"enabled\" : \"disabled\");\n+\n+\tif (options->ckey_param && (options->ckey_random_size != -1))\n+\t\tprintf(\"Cipher key already parsed, ignoring size of random key\\n\");\n+\n+\tif (options->akey_param && (options->akey_random_size != -1))\n+\t\tprintf(\"Auth key already parsed, ignoring size of random key\\n\");\n+\n+\tif (options->iv_param && (options->iv_random_size != -1))\n+\t\tprintf(\"IV already parsed, ignoring size of random IV\\n\");\n+\n+\tif (options->aad_param && (options->aad_random_size != -1))\n+\t\tprintf(\"AAD already parsed, ignoring size of random AAD\\n\");\n+\n+\tprintf(\"\\nCrypto chain: \");\n+\tswitch (options->xform_chain) {\n+\tcase L2FWD_CRYPTO_CIPHER_HASH:\n+\t\tprintf(\"Input --> %s --> %s --> Output\\n\",\n+\t\t\tstring_cipher_op, string_auth_op);\n+\t\tdisplay_cipher_info(options);\n+\t\tdisplay_auth_info(options);\n+\t\tbreak;\n+\tcase L2FWD_CRYPTO_HASH_CIPHER:\n+\t\tprintf(\"Input --> %s --> %s --> Output\\n\",\n+\t\t\tstring_auth_op, string_cipher_op);\n+\t\tdisplay_cipher_info(options);\n+\t\tdisplay_auth_info(options);\n+\t\tbreak;\n+\tcase L2FWD_CRYPTO_HASH_ONLY:\n+\t\tprintf(\"Input --> %s --> Output\\n\", string_auth_op);\n+\t\tdisplay_auth_info(options);\n+\t\tbreak;\n+\tcase L2FWD_CRYPTO_CIPHER_ONLY:\n+\t\tprintf(\"Input --> %s --> Output\\n\", string_cipher_op);\n+\t\tdisplay_cipher_info(options);\n+\t\tbreak;\n+\t}\n }\n \n /* Parse the argument given in the command line of the application */\n", "prefixes": [ "dpdk-dev", "v3", "8/8" ] }{ "id": 11847, "url": "