Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/65582/?format=api
http://patches.dpdk.org/api/patches/65582/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1580908578-3384-2-git-send-email-anoobj@marvell.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": "<1580908578-3384-2-git-send-email-anoobj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1580908578-3384-2-git-send-email-anoobj@marvell.com", "date": "2020-02-05T13:16:13", "name": "[1/6] common/cpt: remove redundant bitswaps", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0f424a338f11841a34ab7309508f46c19e3d55e2", "submitter": { "id": 1205, "url": "http://patches.dpdk.org/api/people/1205/?format=api", "name": "Anoob Joseph", "email": "anoobj@marvell.com" }, "delegate": { "id": 6690, "url": "http://patches.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1580908578-3384-2-git-send-email-anoobj@marvell.com/mbox/", "series": [ { "id": 8429, "url": "http://patches.dpdk.org/api/series/8429/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8429", "date": "2020-02-05T13:16:12", "name": "code improvements for OCTEON TX crypto PMDs", "version": 1, "mbox": "http://patches.dpdk.org/series/8429/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/65582/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/65582/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 77EECA04FA;\n\tWed, 5 Feb 2020 14:16:48 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BE6191C199;\n\tWed, 5 Feb 2020 14:16:44 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id D07BD1C195\n for <dev@dpdk.org>; Wed, 5 Feb 2020 14:16:42 +0100 (CET)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 015DEvKB027130; Wed, 5 Feb 2020 05:16:42 -0800", "from sc-exch01.marvell.com ([199.233.58.181])\n by mx0b-0016f401.pphosted.com with ESMTP id 2xyhn12wvp-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 05 Feb 2020 05:16:42 -0800", "from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 5 Feb\n 2020 05:16:40 -0800", "from maili.marvell.com (10.93.176.43) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Wed, 5 Feb 2020 05:16:40 -0800", "from ajoseph83.caveonetworks.com (unknown [10.29.45.60])\n by maili.marvell.com (Postfix) with ESMTP id E49FA3F72F1;\n Wed, 5 Feb 2020 05:16:38 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=o29GQS2l32NEWU3rOA9oDVUfbRzeB+k+id+IyZa1RL0=;\n b=k0a3RIQYcUQGHh4D77jL27FYfARXny4+CSmPwBbAsGZf8gpVoUSkIx0faMnxfrHFVKLj\n 7kJ0gaObSrbGjz2iUJv6q2gfRHg3x0T3OH84RvoI6Wr4ab7XM5DLQYLBLXj9RJLxjnYj\n fc4+vaRgVYSoJnNqt9iwdvU439Ruy1eLPM7iIZ6OyoSWYtVo2wXpDdruHwUFGlVNfCl1\n MXhDlhLNwKayOb3qXED3glOVktdw+0sJywVj7+nPIqg4zTxLjK9pWwbeOuAsG0VCnBqh\n Cxq/TuA47A2KFcfCUIVdiOwcPy5+fmCJbAMhPKGtcM8WgacUUnR/aHs2X2Ixgvi2uDOx 6w==", "From": "Anoob Joseph <anoobj@marvell.com>", "To": "Akhil Goyal <akhil.goyal@nxp.com>", "CC": "Anoob Joseph <anoobj@marvell.com>, <dev@dpdk.org>", "Date": "Wed, 5 Feb 2020 18:46:13 +0530", "Message-ID": "<1580908578-3384-2-git-send-email-anoobj@marvell.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1580908578-3384-1-git-send-email-anoobj@marvell.com>", "References": "<1580908578-3384-1-git-send-email-anoobj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572\n definitions=2020-02-05_03:2020-02-04,\n 2020-02-05 signatures=0", "Subject": "[dpdk-dev] [PATCH 1/6] common/cpt: remove redundant bitswaps", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The structures can be written for direct h/w usage to avoid multiple\nbitswaps.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\n---\n drivers/common/cpt/cpt_mcode_defines.h | 45 +++++++---------------------------\n drivers/common/cpt/cpt_ucode.h | 34 +++++++++----------------\n 2 files changed, 20 insertions(+), 59 deletions(-)", "diff": "diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h\nindex d830bef..8bb09e6 100644\n--- a/drivers/common/cpt/cpt_mcode_defines.h\n+++ b/drivers/common/cpt/cpt_mcode_defines.h\n@@ -267,41 +267,16 @@ struct cpt_sess_misc {\n \tphys_addr_t ctx_dma_addr;\n };\n \n-typedef union {\n-\tuint64_t flags;\n-\tstruct {\n-#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN\n-\t\tuint64_t enc_cipher : 4;\n-\t\tuint64_t reserved1 : 1;\n-\t\tuint64_t aes_key : 2;\n-\t\tuint64_t iv_source : 1;\n-\t\tuint64_t hash_type : 4;\n-\t\tuint64_t reserved2 : 3;\n-\t\tuint64_t auth_input_type : 1;\n-\t\tuint64_t mac_len : 8;\n-\t\tuint64_t reserved3 : 8;\n-\t\tuint64_t encr_offset : 16;\n-\t\tuint64_t iv_offset : 8;\n-\t\tuint64_t auth_offset : 8;\n-#else\n-\t\tuint64_t auth_offset : 8;\n-\t\tuint64_t iv_offset : 8;\n-\t\tuint64_t encr_offset : 16;\n-\t\tuint64_t reserved3 : 8;\n-\t\tuint64_t mac_len : 8;\n-\t\tuint64_t auth_input_type : 1;\n-\t\tuint64_t reserved2 : 3;\n-\t\tuint64_t hash_type : 4;\n-\t\tuint64_t iv_source : 1;\n-\t\tuint64_t aes_key : 2;\n-\t\tuint64_t reserved1 : 1;\n-\t\tuint64_t enc_cipher : 4;\n-#endif\n-\t} e;\n-} encr_ctrl_t;\n-\n typedef struct {\n-\tencr_ctrl_t enc_ctrl;\n+\tuint64_t iv_source : 1;\n+\tuint64_t aes_key : 2;\n+\tuint64_t rsvd_60 : 1;\n+\tuint64_t enc_cipher : 4;\n+\tuint64_t auth_input_type : 1;\n+\tuint64_t rsvd_52_54 : 3;\n+\tuint64_t hash_type : 4;\n+\tuint64_t mac_len : 8;\n+\tuint64_t rsvd_39_0 : 40;\n \tuint8_t encr_key[32];\n \tuint8_t encr_iv[16];\n } mc_enc_context_t;\n@@ -444,8 +419,6 @@ typedef mc_hash_type_t auth_type_t;\n \n /* Helper macros */\n \n-#define CPT_P_ENC_CTRL(fctx) fctx->enc.enc_ctrl.e\n-\n #define SRC_IOV_SIZE \\\n \t(sizeof(iov_ptr_t) + (sizeof(buf_ptr_t) * CPT_MAX_SG_CNT))\n #define DST_IOV_SIZE \\\ndiff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h\nindex d5a0135..24b53a1 100644\n--- a/drivers/common/cpt/cpt_ucode.h\n+++ b/drivers/common/cpt/cpt_ucode.h\n@@ -149,7 +149,7 @@ static __rte_always_inline void\n cpt_fc_ciph_set_key_passthrough(struct cpt_ctx *cpt_ctx, mc_fc_context_t *fctx)\n {\n \tcpt_ctx->enc_cipher = 0;\n-\tCPT_P_ENC_CTRL(fctx).enc_cipher = 0;\n+\tfctx->enc.enc_cipher = 0;\n }\n \n static __rte_always_inline void\n@@ -171,7 +171,7 @@ cpt_fc_ciph_set_key_set_aes_key_type(mc_fc_context_t *fctx, uint16_t key_len)\n \t\tCPT_LOG_DP_ERR(\"Invalid AES key len\");\n \t\treturn;\n \t}\n-\tCPT_P_ENC_CTRL(fctx).aes_key = aes_key_type;\n+\tfctx->enc.aes_key = aes_key_type;\n }\n \n static __rte_always_inline void\n@@ -218,7 +218,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n {\n \tstruct cpt_ctx *cpt_ctx = ctx;\n \tmc_fc_context_t *fctx = &cpt_ctx->fctx;\n-\tuint64_t *ctrl_flags = NULL;\n \tint ret;\n \n \tret = cpt_fc_ciph_set_type(type, cpt_ctx, key_len);\n@@ -226,19 +225,17 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n \t\treturn -1;\n \n \tif (cpt_ctx->fc_type == FC_GEN) {\n-\t\tctrl_flags = (uint64_t *)&(fctx->enc.enc_ctrl.flags);\n-\t\t*ctrl_flags = rte_be_to_cpu_64(*ctrl_flags);\n \t\t/*\n \t\t * We need to always say IV is from DPTR as user can\n \t\t * sometimes iverride IV per operation.\n \t\t */\n-\t\tCPT_P_ENC_CTRL(fctx).iv_source = CPT_FROM_DPTR;\n+\t\tfctx->enc.iv_source = CPT_FROM_DPTR;\n \t}\n \n \tswitch (type) {\n \tcase PASSTHROUGH:\n \t\tcpt_fc_ciph_set_key_passthrough(cpt_ctx, fctx);\n-\t\tgoto fc_success;\n+\t\tgoto success;\n \tcase DES3_CBC:\n \t\t/* CPT performs DES using 3DES with the 8B DES-key\n \t\t * replicated 2 more times to match the 24B 3DES-key.\n@@ -255,7 +252,7 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n \t\tbreak;\n \tcase DES3_ECB:\n \t\t/* For DES3_ECB IV need to be from CTX. */\n-\t\tCPT_P_ENC_CTRL(fctx).iv_source = CPT_FROM_CTX;\n+\t\tfctx->enc.iv_source = CPT_FROM_CTX;\n \t\tbreak;\n \tcase AES_CBC:\n \tcase AES_ECB:\n@@ -273,7 +270,7 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n \t\t\t * and nothing else\n \t\t\t */\n \t\t\tif (!key)\n-\t\t\t\tgoto fc_success;\n+\t\t\t\tgoto success;\n \t\t}\n \t\tcpt_fc_ciph_set_key_set_aes_key_type(fctx, key_len);\n \t\tbreak;\n@@ -305,14 +302,10 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,\n \n \t/* For GMAC auth, cipher must be NULL */\n \tif (cpt_ctx->hash_type != GMAC_TYPE)\n-\t\tCPT_P_ENC_CTRL(fctx).enc_cipher = type;\n+\t\tfctx->enc.enc_cipher = type;\n \n \tmemcpy(fctx->enc.encr_key, key, key_len);\n \n-fc_success:\n-\tif (ctrl_flags != NULL)\n-\t\t*ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);\n-\n success:\n \tcpt_ctx->enc_cipher = type;\n \n@@ -2494,7 +2487,6 @@ cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,\n {\n \tstruct cpt_ctx *cpt_ctx = ctx;\n \tmc_fc_context_t *fctx = &cpt_ctx->fctx;\n-\tuint64_t *ctrl_flags = NULL;\n \n \tif ((type >= ZUC_EIA3) && (type <= KASUMI_F9_ECB)) {\n \t\tuint32_t keyx[4];\n@@ -2545,15 +2537,12 @@ cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,\n \t\t\tcpt_ctx->fc_type = HASH_HMAC;\n \t}\n \n-\tctrl_flags = (uint64_t *)&fctx->enc.enc_ctrl.flags;\n-\t*ctrl_flags = rte_be_to_cpu_64(*ctrl_flags);\n-\n \t/* For GMAC auth, cipher must be NULL */\n \tif (type == GMAC_TYPE)\n-\t\tCPT_P_ENC_CTRL(fctx).enc_cipher = 0;\n+\t\tfctx->enc.enc_cipher = 0;\n \n-\tCPT_P_ENC_CTRL(fctx).hash_type = cpt_ctx->hash_type = type;\n-\tCPT_P_ENC_CTRL(fctx).mac_len = cpt_ctx->mac_len = mac_len;\n+\tfctx->enc.hash_type = cpt_ctx->hash_type = type;\n+\tfctx->enc.mac_len = cpt_ctx->mac_len = mac_len;\n \n \tif (key_len) {\n \t\tcpt_ctx->hmac = 1;\n@@ -2563,9 +2552,8 @@ cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,\n \t\tmemset(fctx->hmac.ipad, 0, sizeof(fctx->hmac.ipad));\n \t\tmemset(fctx->hmac.opad, 0, sizeof(fctx->hmac.opad));\n \t\tmemcpy(fctx->hmac.opad, key, key_len);\n-\t\tCPT_P_ENC_CTRL(fctx).auth_input_type = 1;\n+\t\tfctx->enc.auth_input_type = 1;\n \t}\n-\t*ctrl_flags = rte_cpu_to_be_64(*ctrl_flags);\n \treturn 0;\n }\n \n", "prefixes": [ "1/6" ] }{ "id": 65582, "url": "