From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00044.outbound.protection.outlook.com [40.107.0.44]) by dpdk.org (Postfix) with ESMTP id C3E861B48B for ; Fri, 12 Oct 2018 12:05:48 +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=oikYUy7yV/D/FyN65Hze+pfr/k7EdWSiO8VvQ63u1LE=; b=pj3LUA25MHPO6ty/6SUZR8aOqylsoqSWEEdqRfIkrNb2KPApVT4RCr8iAgrBp0gVbjvGklnbsxVLn2rGS4l5nvqKoewVPIykQ5ECYH26M2vgJ6BzvhHMMtz2QHUuLM/v2bmLODsZwEQP1dK2Yrpa/VTPWRPPaLcvGGMtHvdLMaY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:46 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:16 +0530 Message-Id: <20181012100426.29349-6-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e155389-e3c5-415f-06e0-08d6302a484a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 3:atEtjT29m1UoFgTcewJWbHvVKH2hzMItT7nEosM9UnOAUe0qD9W0xjMjXPt8ZbU4gzjC/K5Jhp0anoi++jQBkps1BFe6Rkrykg5rmqPuHA+A7VbV3imDHXqkuk/OX6SIq4j5SHNvxFGSpvUHfxGLO8eJ2oyiG7CXSSuopSsLH4LXznEWfSbhYiNOjNDYQDAbAyxhx2Eds5J65DecoXlzMZgyU9cLdnhiCf3X9BVdIdm1nNLD3GuhxqB7SK6Guhsy; 25:4RPAz1tCLy0nvDE190bxVlehA4pfqnQztFyL+V+/pyyQDNby6o0HVdhmSI+QRvCGaZc91UdSMNaAJe1bD1v3I/6H5ZJhuwL+as6tpd6JC3VrdfIgS3ejbPVIdSpYdYrgKNVO8iBbTJ7UaFEqQM6vtjHeIw7BiihmWyfS8jvPdFNA51OLhQIHIGkxQsehM6aoBgqRpR/OIbKuz35U3sJe834f38V2MDwuikTNyK8uV2M2BfdgwnX6qoDt1NJ0eLm+bhEO77J7aqQ2u98eHgvdJZbj9sIO4QockOzFMmFVhAqOfMCTZCcUJYwdFse26PEO/Pl2nmxDqm3hX0QG6Fcx1A==; 31:jt76sFBhqL/gtFYiW/YwbYyy5LlaQkclbiMilivH7YcmP7MsjMVQZ7R+RZ66tmhdRZyAmotkeVC0L6va8bs+UNdDnL/O+Uj7sMozfgJdR8l1pJ8CpwZhpXVKj43lt5M3L/hjYIGZqFU9ARl2DQjwvVZGzh5FPF3BVCldqG/u1dcVpcJtZZde8x+8Q1ULva3x7PGOwkntbrFFwzinS3yhgGXCR6M4oznpk3qiSzeeDc8= X-MS-TrafficTypeDiagnostic: AM0PR04MB4676: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676; 20:mdTwbwE7HMMtsTJJdfGKyh7CFXYQ6yIkj6l1xrf/c6fX/7WvwftIoyndUE+kqBnaajpGbzD485M5hQ8ff4eF7PG/LcEgE521cAPqvee52xEi3s2NnC8Ugk9LiZtyiNJQQAFEhIFPIJOXnMXfPyXvQsy+ADSVcXJUpsju30053hQYmF8roc+dvewu44Fpk7tp7eSzp2kWTF9Qk/bgl7WhfyEvws3zEYdadXVqqQWCSBf6IAazRt0KXRM6DFRl/sGqi9+aKA1MOxCs/6YrHC8DIDTTzkED9CPDjOzSk51DYkDWUGuDE8UZRE8/jEIw+oe2R22rCi/mTdzWz8Uz7Humn3VmxjSDmIin7Hy9B0pSRTwXb7vTDfm4xsR8Q+UYQpyVmItp52hsBSyvEfeQkhtSravBaAWVu96IQyTuojvWJAWpkHIGJFrATrAqk5VhGRTUl2ttGSDyzKi+e5NAeGOVeKV94EbX8DtfnBjAD83qc/6Xhd8rpV4v9ENeA9ojAHaK; 4:AUfGsKfKn6ANCBV/M68Zr6bk/R31VQBBAW5zUh3JVYwEUbwhfT2zbNpBh8oKLB0B2UFXxjxAGNiYQzsVL1xINdGZvjGu4xtg/cbT5KdZudjNUl6F6d1FqfOaOy5BXAEWGMRLxfTQDAmHHqik4S7lfzA5oG50aaXtoobZINHcoOTlUNLnCSKR7p5e0FiuwekQYA0nbCsyDiOWHbBWKrJ0Eq03UK8iBYdBQN7TfmRYJMt1+dvGQlF3HdNVKLiMkE9mJXd5wRxnp104A7vsx2RZYw+6akb8HbpI9c6gDix69aohftAuEMZcTH6oNJaN2BsLl+qmZyT9EW7kuMvLGOnRbOEPE1JJTjlgFirMBtK0VzY= 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)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:KKQpMV9RG0SG9MXrmaw48Ht/h09PFi/ZcwNiITcSj?= =?us-ascii?Q?SE2gTSJBB3GQjxT0ys9WJhMfT1SvzR1p3sUgOaz5T66I5omaCdX8Q5wmIper?= =?us-ascii?Q?fBaV9whMva35PT5pm5CUTbIz2tIvhtHMCn4nrRn0iZpwxAMmU71LwNhcftbK?= =?us-ascii?Q?VyRCT+6bg9XTGwqC8dgcM/EAw0GpjCwOJ1TE3a3dfpDdN3ncb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43DGZd27NHZ7KovysirEuJN3sQ2UPmavZ/3O7ZN6kYEpy+rMncljQK8omvh+GbYFQ7FMtk/Ciu/VKTToaOtgyohEczq6uuv6Zhb8/DMD3pi6FptGQo2szHh4wfz840gMedH5iKsnJTfe5llX68uYo3g9ooDptunY+iOhsgoTl0FiAtF0R+gftE/1XG2DG3UEon3VMPmIAwkqwLDKu1wa2be76zwiicoGINw==; 5:uZRN6ajtvdocCXQKer0CWwHX0VxX007+sG+IMB8jGcOKY5gmRkETd5xBei6Bo4z0KHNe+i3KBQAVdZ9kiIK0SsCurjKbJMuwsRea8KdhchO9EnuamR3oaDiZ9yvtP6PB2JfAsCAqciPotVF1rWkI0W4XVKqlEW6IXAXaQBzhnAA=; 7:JYctAZBVRUbz87c86cPfwFENyPVtu02I3UjS88+2psEa1YkHBdB2WmoPyHTn2qmx4oARbb+mMI4UtvPUO4K+KBTD2le8Jv0InQy5CciQiTEdNiLlzWzyv6sPd311GjOxsXZzEPUuhK5LnHCNKvm3Joml+FeBVaXxuRC+Q4I7oTlkMboveiKY90kmdcDm3fxOGOwwrDHj5E3N80UiPFgpXo1Fdtg19egVBI2QultPimvaVs9mGy6zY/Wcb5Jtb5Ha SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:46.9247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e155389-e3c5-415f-06e0-08d6302a484a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 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: Fri, 12 Oct 2018 10:05:49 -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 265a8e41a..ee95c2b7c 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