From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50056.outbound.protection.outlook.com [40.107.5.56]) by dpdk.org (Postfix) with ESMTP id 01B5A1B486 for ; Wed, 26 Sep 2018 20:05:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=316KvjUERMkv7/22coIQQA/y8A9LhyjhT9PVMtW16/Y=; b=WszHHCLM1RqMbOLrf5G2P4viHuwPDdFv09C4OXBY8H75RPJXopxaPssTpeCGKogITJJW1NMbu8KLmXaHHyyDO8GIUMq4cFNhtWoN4/0srNFBdAxNS7ed9BW/H3EuUKD6U4gkFN1JN5q+zZSLh+W1UIsSNkZxYYoXw46b+ssirq0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.22; Wed, 26 Sep 2018 18:05:56 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: thomas@monjalon.net, Hemant Agrawal Date: Wed, 26 Sep 2018 23:34:30 +0530 Message-Id: <20180926180440.31726-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926180440.31726-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> <20180926180440.31726-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::24) To AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a06cf08-619e-4341-7440-08d623dab5d6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4679; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 3:AQLpsFonCoFymzF8DDOJGhLedLLnrT4MaDtYHZBW0Lw/fmgWej/TPvVZrqS4U7JfINY867MWNUkTj10TPhHRRTiTPh2efl/Ytd/pNf175hl9FnaG/J99lsJW2nEd4E1TQgx7bYu8bWEhLZsv4qyz9XZC+lU7GVK4qsBVxXRmJeHK9cDJ4XQyIAuehzWkRyBEK51h6n94hfHXQzFu4sCYeF0kg5AFyfuDDYQfuQ6aO9Ryzz3pJ4KZpVfkFGLNDowx; 25:Z8enmc/r4HRMw4FKIfmg7GEpzjKYFeyxJgs+zFJPSX5xAquoOucup1pe5fpsZhmpr7UX01DNg/NWEG+igE2Mop/BfF/30/uEM4Pcj22b6xnZhSLReEfT4sivVUANmeTH/lFMMr1OvAkF44sW7sSU7xUMPjrSsH51Nr0PvZhhOcHYaxp4nOz88mNEE7pgXyVbi28EN0tbX+KgMiwTh3vjjE6L7yp//Y/mwcVI59HbXMQj8+6xSHlkBs8ey7KgR+cw/gu73jRnvltcOfL8/EZUIRhrt+Z8UQ/rdqYThq0C4t/o/q6BK3ja+vNww/n2XlUKIYdrHMlkC2lfcrxx99fRiA==; 31:UcZ5TjrlR3qtWvwTJX1vPsCFSxMewbXnB54bmidb/XiKBQ5cZynLd0s7COs8Sxzuv3p9lf4NpL1wZb5CSbLcb5tNL3tIVnjmtmooEpf7LloVOTBH/1drRsqab+5X9ZD06W145iQg5h7vyuNrCep+PWwCt29gEOTFp4uRQ7p2HCvRucu/Yqvo6NFfVYVqXpMDPoY8WjiWiJuT4c+qveuz+5rsw2VTpJOwb2FumKKUiSg= X-MS-TrafficTypeDiagnostic: AM6PR04MB4679: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 20:0Cv/TVD7NUKdMNZO6XXhBc4fXLiwrgXf/YPIFye+Nja/9Lu+7UfA5beWNpXLhOGNXlzluWmI63Y1DOdKBtHhmPZ+2QVYCXuhTFnSGEwq7hSvxUmtvt2B1eCgMjWx4XYgGp9gZzHJtR4rU2/yqRbL/s2hW4IF3vaterqIuJ1lAa7+Pmc1wCrT7QZyuJtwctQNw/2Uq63dsqPf7HpzfWeM/ABoLvxM6Fsot0+kfyDo/PMKraDpelBo5GSBOATF8jXUx7YwdVBiO5wyBjtwWsxJbJsk3vC62X1rm/vGpQj2I3oWE85ugUZ2MxKI88nXNq11lbT9INVYT2iRdfxWC98yKjyfjgI79UJeOupmVeJWWYZ9Q0h4ZRM5wKs6nRhDvB/il67Smv/LnqdwK7oN0PAoUiU0MQ9vagjdbhEWaGAz6F8CFfQrsrjc6DBv/JnpncSunQU6I3IOplaChRbxmN2c9vKkxXrAqzUvU5MIQc9vbrh/JFw+4CLhuMyuiUtCOsiT; 4:QLr2TL4BTInqFkGpyUv0+2wNoCOSEpaQIwMViwtsixmsUEib/fvOSAmOlmsk7hh86MZ+EmQdbt4OsOGiIxNKymgdBmFaoLZFDCDPalpskv8WIniwsE2TpwVp+VfPo/tiLYPzY9SYiwm6QvuK4ExjT9GDfWZxzU9DFLVdk+Z2BfPAHPKuKSvjgrqrUmnrYU1WenudXsu5dO1CnPTKj9yGtKkDG78it8/Vxh5F/eyt7EviiYnGlprIe3EsR83tPrDY3hyoFzvqUCAOEAEbyi/1COMTUZe8uTw3FNr8Qw/OKoRSifyYOz6moIJR8Xi/RYSm/DJe5FuZ0TQcnJbJxeyT70MZ+sruv98nmOsw+UBAyOA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:AM6PR04MB4679; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4679; X-Forefront-PRVS: 08076ABC99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(136003)(396003)(346002)(366004)(39860400002)(189003)(199004)(11346002)(50226002)(446003)(47776003)(44832011)(956004)(476003)(106356001)(486006)(2616005)(6512007)(66066001)(305945005)(7736002)(6486002)(105586002)(36756003)(575784001)(86362001)(478600001)(8936002)(16526019)(81166006)(50466002)(186003)(26005)(25786009)(8676002)(55236004)(48376002)(81156014)(4326008)(3846002)(6116002)(1076002)(6666003)(52116002)(34290500001)(5009440100003)(2906002)(16586007)(51416003)(316002)(97736004)(6506007)(76176011)(5660300001)(386003)(68736007)(14444005)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4679; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR04MB4679; 23:TJHMkWnAKRlUEVkZ8e2Sb7O5gNLZpPh7JmKlVl7y1?= =?us-ascii?Q?Alx2XTvKVETU3hY2Gkq24UHvC68jm9aHIjB6E4VfCWIIVEDsJEyMPf13zLE0?= =?us-ascii?Q?4yVvGmBYjDT0LdhyOYyUA+woDScASTi3PkuAbplerZOT4vyrZIMa1NnqPWCH?= =?us-ascii?Q?2NNwD8r7PM9uarJ6MVcAz7fSMcTfBRNxdruvM8LVV+HkgMKO/mKJGzWbmNeR?= =?us-ascii?Q?C/+SOq7azBJQJ2PxwVKFpPw4saFc2tE/9vxsQZQ3MQyFarkka4Yfh0ZMseCM?= =?us-ascii?Q?2CdspjwRiYW3FN7DGgNKrn+xJaV2rj4giOYaYLd5kwaU38e8C4k2rfLj8DNX?= =?us-ascii?Q?B8NaXs3RyRzxsgmWKweCn43BTgq8g22a2xACAPQPlJgcNJ0efdOLDK+Lu6bz?= =?us-ascii?Q?gvZ6JUehSAuzTw7cp4TrVKnFQjDykuDj4/eipeNth6RU3Uod+rj7WuX1yEKJ?= =?us-ascii?Q?ManixWTrKQS9TNxpOfyAfFywgMF2YuqsmsdX4eKS+BF6Irt13lEVdu3BHxm/?= =?us-ascii?Q?veI4NeaMyrgsO7hBtKZXc50NIRZ677B2V6dh7oclbPH7IrDkToKuDlG2bz+7?= =?us-ascii?Q?jFBE2BNaGeCBJIdU0/K0y2F6tNGZmox6WPIE1Yykk/ggINy091iDGUQwrddG?= =?us-ascii?Q?QdDttS2XS5bL/VTi6u86t7zXRdAI0B7xqIjDcLdkgtb2gdoP9pmhjKJl088z?= =?us-ascii?Q?Zwk/sF1h/85+aGA2dQKhmeWaSgo0rA8BDdcSo6DpvZSFeHFiF9anKZ7RCJiX?= =?us-ascii?Q?cHV2iK5w+GsChykzjQBU0aguKybHeyDEiwY79/jjYTj5o+jzHr6k0NAKosuF?= =?us-ascii?Q?dvHagL2e4FR1eT4YNYOwShsqI7CZyZyGV9WGujZ9RQbPYVOK46DL6+70k4QQ?= =?us-ascii?Q?+/T+Sv7XPBlcfmo1EujqPo/59gSQv9bNomYcBAl/YCkTDaFB36CUWwlW5/jX?= =?us-ascii?Q?/CRxnTG7MF2+5K5ASPfthC0Ms42yYzIVQst+3k39EottPZI2gwMza5Z1X311?= =?us-ascii?Q?cnp6dcQG1a6JZhW+DpXG92xcx7qIwm/FSqemUXZgsOJ9ukzM6XMa2VllwwJh?= =?us-ascii?Q?nbBzfc5V3U8hWGTmzAYmcrRjTnWVHXIr5ebZ2iZ4CDMRo14MDgCLPfAXbn//?= =?us-ascii?Q?6j9/u2dpfeAS5PB/qs5rmaq6qvEi8k34JSOvdHHDF9F0xL8BFR9zdPqtSEpj?= =?us-ascii?Q?dlzbm08RJhlFZIhJL52KiAsoOCthUlagQhRQht5hxwaRQAWAgiQEjOFd8vyY?= =?us-ascii?Q?Xd7j+YVzwkw+pvNQkUSPRquAlnb3WPEAy/qctscsbUN/g7MPkYaBoNsUPnUB?= =?us-ascii?Q?fIVWx2yDExVOF1QWmkiUuzEzFb+GGs6ClQDRV/V5kep?= X-Microsoft-Antispam-Message-Info: RawYUAoDwofO2oy2e0qIvJEUGaGsy9+sJlmAX3Cpv27TyP6T67mmfLu7FXDg11PVhBehq+SW+4fxQyiHoATTB4E7TEXqB1Vwj3ipX6ntbRQ/y9L1wr/Anq2oduoh4a6jc0K31fnPywqGa1561Qp7cyhkRRLevReMuyitmvhB2c3wf2b1Jjlk2MMwv1QRbqKHnw/i5S90fgGYSymXAcEgeS4qSiYzWbabkhZHio+wALaBkaP95yTHdgJel7zVdUAdSj3J1jSFMo8W4/+Nk1odSPDLcX/O6InBOKYPS+zP0jQbHpX+GLoAs8uJeLRAd/VNbf9QPXmP9AovW8nECXeNeawxWjxq9utrec2CuJk6sf0= X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 6:1vh3BZf45V6iI4h7IKYc4Yop1TBIgM7vWdDXm4/zskQZoBFPbMgA2l5fM9Q7buXJQMHl5iiQeX7Rw3/liiGMnvbTIV6hGNe4q4buxGscmnfXcFjkPKLckWOriVvovQpBPY2WKJqka3qWH5ATrzyLAYnH2127V2K1NxWFU7i97SViXaxeMwygHXKvkidlOzJhPnO2V9zhHeFaU44cHNNt+NvVgrRX8VMhB6UiD2JBHb8yi+00nqjMPJDN5XGx0K6qDOCydNR5MriKB6gplukfUweHMrptM/6azedIuvFJtdZREXQveuLuxZwg6j4spC6yiBJC+nc8LDHktGkdK/s+15akUTcPipAeTUKRg27Ds9+T2FMThtX8AOOfkxMoxy68ScgaOg5zza8pQx4j3/VpIfJzamlSWYq3Z7SPnjvHCjAyYnSbPDdBEh0u/XOZu1UGQrML85IQ/GpV9EJa+WhzHw==; 5:/OWG/0c/OjXmlUY+UDTz0EO2n36AkK+rrOk6a+UL1Jbv5mFb0bn9G3Lh2MFmal6PM/g+elFWc/rHhQdMzz1InFR+b93fZDKWZKGyMU1Xq0H7NNuoYYfbklHsNr+DedpooX5TGHZKRuXdI/ttioXpbXOhhQwDuFAFdQKt7Tz772o=; 7:6dM6ptjUnN/pCjEd3MLLmbnykbSHHlsVWdhvEjmfAaiXBh39/xx8blt+FZyBs8dAaTSQfjm2ydOvnnOuFzkBYHLpQWRd1ZIB+gLyBT6d4b/ZY5/XTu7p+LbMOLoAkYSvVAzMayQbt2BnNqA0FXMwCQVYNeWL4Qj43S66aRFXckDctINHKBpF7Dk3JuA1GJR2+17DIFqNkGD9QhDEbE8dL/srTJo3Z1U+pEaH+Q53ThcNDfqmGSZ9IUXcKb/scKO+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2018 18:05:56.3670 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a06cf08-619e-4341-7440-08d623dab5d6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4679 Subject: [dpdk-dev] [PATCH v2 05/15] crypto/dpaa2_sec: upgarde mc FW APIs to 10.10.0 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: Wed, 26 Sep 2018 18:05:59 -0000 From: Hemant Agrawal This also brings in support to configure the queues for order restoration. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 1 + drivers/crypto/dpaa2_sec/mc/dpseci.c | 128 ++++++++++++++++++- drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h | 25 +++- drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h | 73 ++++++++++- 4 files changed, 218 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 2a3c61c66..e77039870 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/drivers/crypto/dpaa2_sec/mc/dpseci.c b/drivers/crypto/dpaa2_sec/mc/dpseci.c index de8ca970c..87e0defdc 100644 --- a/drivers/crypto/dpaa2_sec/mc/dpseci.c +++ b/drivers/crypto/dpaa2_sec/mc/dpseci.c @@ -6,6 +6,7 @@ */ #include #include +#include #include #include @@ -116,11 +117,13 @@ int dpseci_create(struct fsl_mc_io *mc_io, cmd_flags, dprc_token); cmd_params = (struct dpseci_cmd_create *)cmd.params; - for (i = 0; i < DPSECI_PRIO_NUM; i++) + for (i = 0; i < 8; i++) cmd_params->priorities[i] = cfg->priorities[i]; + for (i = 0; i < 8; i++) + cmd_params->priorities2[i] = cfg->priorities[8 + i]; cmd_params->num_tx_queues = cfg->num_tx_queues; cmd_params->num_rx_queues = cfg->num_rx_queues; - cmd_params->options = cfg->options; + cmd_params->options = cpu_to_le32(cfg->options); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -302,7 +305,7 @@ int dpseci_get_attributes(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpseci_rsp_get_attr *)cmd.params; attr->id = le32_to_cpu(rsp_params->id); - attr->options = rsp_params->options; + attr->options = le32_to_cpu(rsp_params->options); attr->num_tx_queues = rsp_params->num_tx_queues; attr->num_rx_queues = rsp_params->num_rx_queues; @@ -490,6 +493,8 @@ int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, attr->arc4_acc_num = rsp_params->arc4_acc_num; attr->des_acc_num = rsp_params->des_acc_num; attr->aes_acc_num = rsp_params->aes_acc_num; + attr->ccha_acc_num = rsp_params->ccha_acc_num; + attr->ptha_acc_num = rsp_params->ptha_acc_num; return 0; } @@ -569,6 +574,113 @@ int dpseci_get_api_version(struct fsl_mc_io *mc_io, return 0; } +/** + * dpseci_set_opr() - Set Order Restoration configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @index: The queue index + * @options: Configuration mode options + * can be OPR_OPT_CREATE or OPR_OPT_RETIRE + * @cfg: Configuration options for the OPR + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg) +{ + struct dpseci_cmd_set_opr *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_SET_OPR, + cmd_flags, + token); + cmd_params = (struct dpseci_cmd_set_opr *)cmd.params; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->oloe = cfg->oloe; + cmd_params->oeane = cfg->oeane; + cmd_params->olws = cfg->olws; + cmd_params->oa = cfg->oa; + cmd_params->oprrws = cfg->oprrws; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpseci_get_opr() - Retrieve Order Restoration config and query. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @index: The queue index + * @cfg: Returned OPR configuration + * @qry: Returned OPR query + * + * Return: '0' on Success; Error code otherwise. + */ +int dpseci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry) +{ + struct dpseci_rsp_get_opr *rsp_params; + struct dpseci_cmd_get_opr *cmd_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPSECI_CMDID_GET_OPR, + cmd_flags, + token); + cmd_params = (struct dpseci_cmd_get_opr *)cmd.params; + cmd_params->index = index; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpseci_rsp_get_opr *)cmd.params; + cfg->oloe = rsp_params->oloe; + cfg->oeane = rsp_params->oeane; + cfg->olws = rsp_params->olws; + cfg->oa = rsp_params->oa; + cfg->oprrws = rsp_params->oprrws; + qry->rip = dpseci_get_field(rsp_params->flags, RIP); + qry->enable = dpseci_get_field(rsp_params->flags, OPR_ENABLE); + qry->nesn = le16_to_cpu(rsp_params->nesn); + qry->ndsn = le16_to_cpu(rsp_params->ndsn); + qry->ea_tseq = le16_to_cpu(rsp_params->ea_tseq); + qry->tseq_nlis = dpseci_get_field(rsp_params->tseq_nlis, TSEQ_NLIS); + qry->ea_hseq = le16_to_cpu(rsp_params->ea_hseq); + qry->hseq_nlis = dpseci_get_field(rsp_params->hseq_nlis, HSEQ_NLIS); + qry->ea_hptr = le16_to_cpu(rsp_params->ea_hptr); + qry->ea_tptr = le16_to_cpu(rsp_params->ea_tptr); + qry->opr_vid = le16_to_cpu(rsp_params->opr_vid); + qry->opr_id = le16_to_cpu(rsp_params->opr_id); + + return 0; +} + +/** + * dpseci_set_congestion_notification() - Set congestion group + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @cfg: congestion notification configuration + * + * Return: '0' on success, error code otherwise + */ int dpseci_set_congestion_notification( struct fsl_mc_io *mc_io, uint32_t cmd_flags, @@ -604,6 +716,16 @@ int dpseci_set_congestion_notification( return mc_send_command(mc_io, &cmd); } +/** + * dpseci_get_congestion_notification() - Get congestion group + * notification configuration + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPSECI object + * @cfg: congestion notification configuration + * + * Return: '0' on success, error code otherwise + */ int dpseci_get_congestion_notification( struct fsl_mc_io *mc_io, uint32_t cmd_flags, diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h index 12ac005ad..279e8f4d4 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci.h @@ -20,7 +20,7 @@ struct fsl_mc_io; /** * Maximum number of Tx/Rx priorities per DPSECI object */ -#define DPSECI_PRIO_NUM 8 +#define DPSECI_MAX_QUEUE_NUM 16 /** * All queues considered; see dpseci_set_rx_queue() @@ -58,7 +58,7 @@ struct dpseci_cfg { uint32_t options; uint8_t num_tx_queues; uint8_t num_rx_queues; - uint8_t priorities[DPSECI_PRIO_NUM]; + uint8_t priorities[DPSECI_MAX_QUEUE_NUM]; }; int dpseci_create(struct fsl_mc_io *mc_io, @@ -259,6 +259,10 @@ int dpseci_get_tx_queue(struct fsl_mc_io *mc_io, * implemented in this version of SEC. * @aes_acc_num: The number of copies of the AES module that are * implemented in this version of SEC. + * @ccha_acc_num: The number of copies of the ChaCha20 module that are + * implemented in this version of SEC. + * @ptha_acc_num: The number of copies of the Poly1305 module that are + * implemented in this version of SEC. **/ struct dpseci_sec_attr { @@ -279,6 +283,8 @@ struct dpseci_sec_attr { uint8_t arc4_acc_num; uint8_t des_acc_num; uint8_t aes_acc_num; + uint8_t ccha_acc_num; + uint8_t ptha_acc_num; }; int dpseci_get_sec_attr(struct fsl_mc_io *mc_io, @@ -316,6 +322,21 @@ int dpseci_get_api_version(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t *major_ver, uint16_t *minor_ver); + +int dpseci_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg); + +int dpseci_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry); + /** * enum dpseci_congestion_unit - DPSECI congestion units * @DPSECI_CONGESTION_UNIT_BYTES: bytes units diff --git a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h index 26cef0f73..af3518a0f 100644 --- a/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h +++ b/drivers/crypto/dpaa2_sec/mc/fsl_dpseci_cmd.h @@ -9,22 +9,25 @@ /* DPSECI Version */ #define DPSECI_VER_MAJOR 5 -#define DPSECI_VER_MINOR 1 +#define DPSECI_VER_MINOR 3 /* Command versioning */ #define DPSECI_CMD_BASE_VERSION 1 #define DPSECI_CMD_BASE_VERSION_V2 2 +#define DPSECI_CMD_BASE_VERSION_V3 3 #define DPSECI_CMD_ID_OFFSET 4 #define DPSECI_CMD_V1(id) \ ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION) #define DPSECI_CMD_V2(id) \ ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION_V2) +#define DPSECI_CMD_V3(id) \ + ((id << DPSECI_CMD_ID_OFFSET) | DPSECI_CMD_BASE_VERSION_V3) /* Command IDs */ #define DPSECI_CMDID_CLOSE DPSECI_CMD_V1(0x800) #define DPSECI_CMDID_OPEN DPSECI_CMD_V1(0x809) -#define DPSECI_CMDID_CREATE DPSECI_CMD_V2(0x909) +#define DPSECI_CMDID_CREATE DPSECI_CMD_V3(0x909) #define DPSECI_CMDID_DESTROY DPSECI_CMD_V1(0x989) #define DPSECI_CMDID_GET_API_VERSION DPSECI_CMD_V1(0xa09) @@ -37,9 +40,10 @@ #define DPSECI_CMDID_SET_RX_QUEUE DPSECI_CMD_V1(0x194) #define DPSECI_CMDID_GET_RX_QUEUE DPSECI_CMD_V1(0x196) #define DPSECI_CMDID_GET_TX_QUEUE DPSECI_CMD_V1(0x197) -#define DPSECI_CMDID_GET_SEC_ATTR DPSECI_CMD_V1(0x198) +#define DPSECI_CMDID_GET_SEC_ATTR DPSECI_CMD_V2(0x198) #define DPSECI_CMDID_GET_SEC_COUNTERS DPSECI_CMD_V1(0x199) - +#define DPSECI_CMDID_SET_OPR DPSECI_CMD_V1(0x19A) +#define DPSECI_CMDID_GET_OPR DPSECI_CMD_V1(0x19B) #define DPSECI_CMDID_SET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x170) #define DPSECI_CMDID_GET_CONGESTION_NOTIFICATION DPSECI_CMD_V1(0x171) @@ -63,6 +67,8 @@ struct dpseci_cmd_create { uint8_t num_rx_queues; uint8_t pad[6]; uint32_t options; + uint32_t pad2; + uint8_t priorities2[8]; }; struct dpseci_cmd_destroy { @@ -152,6 +158,8 @@ struct dpseci_rsp_get_sec_attr { uint8_t arc4_acc_num; uint8_t des_acc_num; uint8_t aes_acc_num; + uint8_t ccha_acc_num; + uint8_t ptha_acc_num; }; struct dpseci_rsp_get_sec_counters { @@ -169,6 +177,63 @@ struct dpseci_rsp_get_api_version { uint16_t minor; }; +struct dpseci_cmd_set_opr { + uint16_t pad0; + uint8_t index; + uint8_t options; + uint8_t pad1[7]; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; +}; + +struct dpseci_cmd_get_opr { + uint16_t pad; + uint8_t index; +}; + +#define DPSECI_RIP_SHIFT 0 +#define DPSECI_RIP_SIZE 1 +#define DPSECI_OPR_ENABLE_SHIFT 1 +#define DPSECI_OPR_ENABLE_SIZE 1 +#define DPSECI_TSEQ_NLIS_SHIFT 0 +#define DPSECI_TSEQ_NLIS_SIZE 1 +#define DPSECI_HSEQ_NLIS_SHIFT 0 +#define DPSECI_HSEQ_NLIS_SIZE 1 + +struct dpseci_rsp_get_opr { + uint64_t pad0; + /* from LSB: rip:1 enable:1 */ + uint8_t flags; + uint16_t pad1; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; + uint16_t nesn; + uint16_t pad8; + uint16_t ndsn; + uint16_t pad2; + uint16_t ea_tseq; + /* only the LSB */ + uint8_t tseq_nlis; + uint8_t pad3; + uint16_t ea_hseq; + /* only the LSB */ + uint8_t hseq_nlis; + uint8_t pad4; + uint16_t ea_hptr; + uint16_t pad5; + uint16_t ea_tptr; + uint16_t pad6; + uint16_t opr_vid; + uint16_t pad7; + uint16_t opr_id; +}; + #define DPSECI_DEST_TYPE_SHIFT 0 #define DPSECI_DEST_TYPE_SIZE 4 #define DPSECI_CG_UNITS_SHIFT 4 -- 2.17.1