From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10068.outbound.protection.outlook.com [40.107.1.68]) by dpdk.org (Postfix) with ESMTP id 5F12B1B1F7 for ; Fri, 5 Oct 2018 15:58:46 +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=9L3jL1kPOe9t1DFpccbEgmqkCYvRrmVsrYhB3yxvAoU=; b=LIu22MymiK+CTzF7VH/gt1zbiAJ9ISsPmjjSLrVcKsyv+F33SuxQNBSPvhzj/6RsYDf1YvWIIf3FG3uUsxUYCu3hupEE946/ol4dNn2HxXhAOs+8NDWS/KkVBqK+4AsR9H45ECwnks9p4ZQAJV1hfE8GMicRprABLJGmbZIuDbU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; Received: from GDB1.ap.freescale.net (14.143.30.134) by DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Fri, 5 Oct 2018 13:58:40 +0000 From: akhil.goyal@nxp.com To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, radu.nicolau@intel.com, jerin.jacob@caviumnetworks.com, narayanaprasad.athreya@caviumnetworks.com, Shally.Verma@caviumnetworks.com, Anoob.Joseph@caviumnetworks.com, Vidya.Velumuri@caviumnetworks.com, hemant.agrawal@nxp.com, Akhil Goyal Date: Fri, 5 Oct 2018 19:23:16 +0530 Message-Id: <20181005135318.6350-2-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005135318.6350-1-akhil.goyal@nxp.com> References: <20181005133344.6115-1-akhil.goyal@nxp.com> <20181005135318.6350-1-akhil.goyal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: TYAPR01CA0109.jpnprd01.prod.outlook.com (2603:1096:404:2a::25) To DB7PR04MB4889.eurprd04.prod.outlook.com (2603:10a6:10:18::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9adb9509-b533-411d-0cb5-08d62acaaa60 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:DB7PR04MB4889; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 3:52nxotV2suDVvdm7z9u3o9zKYi32fbGI1FDG6RhGjS/IlBe2FewzG1LSqaFT1R3/bnbLMiRUI+LlWoCLVXcI/9b97x+2yqJQ98yZFRqvNsSBeJnJsfyR9SGhh3p+g1klYjhn94/G5f7BMnV10lXf3dWdFFc2VXh4Cchk1Q8ggzG8oJhkokpyVOQ6L6A+vZy2Kx38A3zxb8U5/l6z9EriEnggh78GlQar/nvixjA9E1iwrbLEEx72N1gmuCvxeDq7; 25:pnZVGERxvo4wkr6jkWWEFNO6GZ+pTqyzP67etJLzvYFyt8fdes14qS6kj1w/MuwPr4IcJZilF07mmlaD63ASrKZZZEOI6bc1ez6RH81Tpkp/V3XHspdAP6tAU5RxuIwJ61g3jzrUcOC/h3XX1pVYomED/ZgJG9y4aCWgFTp8dD9cnlXipfXgZ6FrdS7S3K/Mt35WNcoyyUfBiibwZaH6DtJe4ud4SNM0cWKeeIOY1Ixa0EDLHdR4411oIZsjg/LiXRRYZOY/A7gxRcoYdAZga3iL52smVqjAVTyBDsgzTVWpbOqACh/CIstRWZhUCXSAbj0H3nT3HrCPtg78CWx06Q==; 31:HzdF4N6qp83+bUchg1Zr1iOufhR4hqlm6nXjyBBdQ7JL5AEC5J+ui92P+udFkAkZ/L0X+e2iNbi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TR6Un3aIA80x1xLSdq+4A/Qwm64LQoXTxZegNeerv/nh3kzRNKMIz8qk6ze X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(185117386973197)(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:DB7PR04MB4889; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4889; X-Forefront-PRVS: 0816F1D86E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(376002)(366004)(346002)(189003)(199004)(316002)(1076002)(16586007)(50226002)(53936002)(2351001)(6116002)(86362001)(478600001)(25786009)(3846002)(14444005)(575784001)(5009440100003)(8936002)(26005)(2906002)(16526019)(6666003)(6916009)(33896004)(186003)(6512007)(85782001)(9686003)(6486002)(97736004)(68736007)(11346002)(15650500001)(81156014)(956004)(81166006)(66066001)(446003)(8676002)(6506007)(36756003)(386003)(47776003)(48376002)(2361001)(50466002)(7736002)(486006)(76176011)(2616005)(106356001)(51416003)(5660300001)(52116002)(105586002)(305945005)(55236004)(4326008)(476003)(110426005)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4889; H:GDB1.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; DB7PR04MB4889; 23:vhiRYbwIRoWgKJ9Co43e1eIGJhQfd31MTV5R5w3j2?= =?us-ascii?Q?MPr1IfvT7TYKlqKZ7hSl1NAYHEumr8DPz+iW0mi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Q?Po9P/petVThQKuoYwwQ64jFTbzhkG34Nan6pHUeIcXWnZzuBO8cvBMJv2v+1?= =?us-ascii?Q?60g0ajeU0ZlZzHWPqlcyQYd87HJvnNVhwECadCw03wYS8ZaDEPHOaPuE/J5i?= =?us-ascii?Q?9Mlpr06KwCnYPjmwriRZIKfIpMDkW9hs718bACA1WxWp/nkla/Dkd4XZKxBI?= =?us-ascii?Q?ued387vXXfNi0lr3F150dVTZpVZBKcfbQT5JvqoEafKREusTxFXYFLluaFL+?= =?us-ascii?Q?zD2gFNQYkcd1C5ZNOVoLilefJ7WEOuoQwLTBx1BW6gmFLMU2CCTRhzXOscrn?= =?us-ascii?Q?JrIrXrPd478N7yvsyQPLGydGjCBUnNOaizdqPxMxF9K5Y4jvNC+IMEvza7jD?= =?us-ascii?Q?FXK8pQ+5t2VXGGy7Uea1r3BOupjONvNwMzZD4TT1sMFrNeTDnY/zZem+UfFy?= =?us-ascii?Q?2n42nMm8RKYjQ1+90a0JN8AOLezU62sZa26RvD9KUxNbQ67inpMsmTe4Tn/h?= =?us-ascii?Q?qqbN2c+hfVe0i15eZw8eE0W7YuJqTbskqfYmLSUJzbuVZN2njfs?= X-Microsoft-Antispam-Message-Info: 1PbL2OHmNoW8xeiNUW/MYxZg2MPBP2WLD8YBFOxcFDyjEpoFZQO89FCMWTRMAeVE00QiTlWGbs123s6uNskTBdnoiLiux2sGKI4nVUGPXJFrRBWtfSHREX9zA1fOfpULXHodKK0aYQwKPs0/oCp8hXzqrwxAwLRSP6cSJ1vgXbhagf8ZmFIalxOWARY/LIVUZtGWQfEQtnup1lAPmd0ufT0tgr7QjqEjdWotXppquX6hzIN+3RG2EW9TrV2jYC6xUfQl8MzicOKNbLMPXLFvgOEMGpj9Xte5veENty6yRtiKvMnADThenlFlDeX7LM5ljJnYDVxMGLANsepHNcwk597zNS1G5dEHYyJNGmYRTUk= X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4889; 6:3YZoy9vvys/CQkTiFvCAu9ZPv1kNSTeyLcPHfvF/+77yiFWBo3O900c5La6Uc6/E/7Dj29TfPZjTTHnfLNTzgUaaVcGzgs7WONj5gxQKy+YWrPaSTe6yQg+JtcPjc+4WgAny+tly8OFmxu2W7PVWT+q40lRyoUHPqHN9IeWnNtCaAZjmzK21mvCQDuDBoxfRC0953/TjfK3S6VY9/oSJyC4UVRlbOkKT7Lt65YUZDqcI9zoMAORlKsYV3/xEOU4HYGch5rUI19PNRiOomR1Hgyx94tBYYJpCcui66croDqNnWa6Z+3dgetcCrqBL+QmxW3xvoNkSSQBU8NFatoNTKOsT8ZBN/JglqDnYjEbXYkTXFZ+hc6t9Qi/LiD+hS6zawL4OlT48nNi56DzsHp9cgVh+f4VH2VGpLpxwFaFFvb9cdN3dGlOkijesbSNVOp5RxOgVDuJjTz+kZ0qWSfDYpw==; 5:EA9RZ4N2pdnwWfHXw1mztYRVWdo8gGtkG64j7zrpXUMn7Uszt0JNPit5MSLJEl9uljks7s1oyU4kkZ2Ow1HEBXsgXjNv1dQ98OU84lpBkmU7geiXFYK6qQvFzM2q++JwC4MBj6nDhoY+cE+HNilaRieHekSYjoogNKvVdnePSOc=; 7:PhyO5BVNbNqf7nA8fs/325I8KyuuEmrK+D9xY73QAmTjax8fFxcYRsUHTbk8XKJCEHWD4uxIEZhfNX7kX2SpM+vTrExwzlPgHYW9rNv12GxDGj3dgUT1vtMDC9j/5EgrgSDhs7FUwb5atNufM1swlEHzR3lU6qROtPQkf6IzEEflMUFr+xT62vQaYrVW/6E3DOHE4hTaMzWc8eWjhMRSQKXe+Be0ir/hmqkLpiAwcUJpu+c1LqroHwAqWTlzrI5x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 13:58:40.4503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9adb9509-b533-411d-0cb5-08d62acaaa60 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4889 Subject: [dpdk-dev] [PATCH v3 1/3] security: support pdcp protocol 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, 05 Oct 2018 13:58:46 -0000 From: Akhil Goyal Packet Data Convergence Protocol (PDCP) is added in rte_security for 3GPP TS 36.323 for LTE. The patchset provide the structure definitions for configuring the PDCP sessions and relevant documentation is added. Signed-off-by: Hemant Agrawal Signed-off-by: Akhil Goyal --- doc/guides/prog_guide/rte_security.rst | 96 ++++++++++++++++++++++++-- lib/librte_security/rte_security.c | 4 ++ lib/librte_security/rte_security.h | 67 ++++++++++++++++++ 3 files changed, 160 insertions(+), 7 deletions(-) diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst index 0812abe77..83d9d99e0 100644 --- a/doc/guides/prog_guide/rte_security.rst +++ b/doc/guides/prog_guide/rte_security.rst @@ -10,8 +10,8 @@ The security library provides a framework for management and provisioning of security protocol operations offloaded to hardware based devices. The library defines generic APIs to create and free security sessions which can support full protocol offload as well as inline crypto operation with -NIC or crypto devices. The framework currently only supports the IPSec protocol -and associated operations, other protocols will be added in future. +NIC or crypto devices. The framework currently only supports the IPSec and PDCP +protocol and associated operations, other protocols will be added in future. Design Principles ----------------- @@ -253,6 +253,49 @@ for any protocol header addition. +--------|--------+ V +PDCP Flow Diagram +~~~~~~~~~~~~~~~~~ + +Based on 3GPP TS 36.323 Evolved Universal Terrestrial Radio Access (E-UTRA); +Packet Data Convergence Protocol (PDCP) specification + +.. code-block:: c + + Transmitting PDCP Entity Receiving PDCP Entity + | ^ + | +-----------|-----------+ + V | In order delivery and | + +---------|----------+ | Duplicate detection | + | Sequence Numbering | | (Data Plane only) | + +---------|----------+ +-----------|-----------+ + | | + +---------|----------+ +-----------|----------+ + | Header Compression*| | Header Decompression*| + | (Data-Plane only) | | (Data Plane only) | + +---------|----------+ +-----------|----------+ + | | + +---------|-----------+ +-----------|----------+ + | Integrity Protection| |Integrity Verification| + | (Control Plane only)| | (Control Plane only) | + +---------|-----------+ +-----------|----------+ + +---------|-----------+ +----------|----------+ + | Ciphering | | Deciphering | + +---------|-----------+ +----------|----------+ + +---------|-----------+ +----------|----------+ + | Add PDCP header | | Remove PDCP Header | + +---------|-----------+ +----------|----------+ + | | + +----------------->>----------------+ + + +.. note:: + + * Header Compression and decompression are not supported currently. + +Just like IPSec, in case of PDCP also header addition/deletion, cipher/ +de-cipher, integrity protection/verification is done based on the action +type chosen. + Device Features and Capabilities --------------------------------- @@ -271,7 +314,7 @@ structure in the *DPDK API Reference*. Each driver (crypto or ethernet) defines its own private array of capabilities for the operations it supports. Below is an example of the capabilities for a -PMD which supports the IPSec protocol. +PMD which supports the IPSec and PDCP protocol. .. code-block:: c @@ -298,6 +341,22 @@ PMD which supports the IPSec protocol. }, .crypto_capabilities = pmd_capabilities }, + { /* PDCP Lookaside Protocol offload Data Plane */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_PDCP, + .pdcp = { + .domain = RTE_SECURITY_PDCP_MODE_DATA, + }, + .crypto_capabilities = pmd_capabilities + }, + { /* PDCP Lookaside Protocol offload Control */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_PDCP, + .pdcp = { + .domain = RTE_SECURITY_PDCP_MODE_CONTROL, + }, + .crypto_capabilities = pmd_capabilities + }, { .action = RTE_SECURITY_ACTION_TYPE_NONE } @@ -429,6 +488,7 @@ Security Session configuration structure is defined as ``rte_security_session_co union { struct rte_security_ipsec_xform ipsec; struct rte_security_macsec_xform macsec; + struct rte_security_pdcp_xform pdcp; }; /**< Configuration parameters for security session */ struct rte_crypto_sym_xform *crypto_xform; @@ -463,15 +523,17 @@ The ``rte_security_session_protocol`` is defined as .. code-block:: c enum rte_security_session_protocol { - RTE_SECURITY_PROTOCOL_IPSEC, + RTE_SECURITY_PROTOCOL_IPSEC = 1, /**< IPsec Protocol */ RTE_SECURITY_PROTOCOL_MACSEC, /**< MACSec Protocol */ + RTE_SECURITY_PROTOCOL_PDCP, + /**< PDCP Protocol */ }; -Currently the library defines configuration parameters for IPSec only. For other -protocols like MACSec, structures and enums are defined as place holders which -will be updated in the future. +Currently the library defines configuration parameters for IPSec and PDCP only. +For other protocols like MACSec, structures and enums are defined as place holders +which will be updated in the future. IPsec related configuration parameters are defined in ``rte_security_ipsec_xform`` @@ -494,6 +556,26 @@ IPsec related configuration parameters are defined in ``rte_security_ipsec_xform /**< Tunnel parameters, NULL for transport mode */ }; +PDCP related configuration parameters are defined in ``rte_security_pdcp_xform`` + +.. code-block:: c + + struct rte_security_pdcp_xform { + int8_t bearer; /**< PDCP bearer ID */ + /** < PDCP mode of operation: Control or data */ + enum rte_security_pdcp_domain domain; + /**< PDCP Frame Direction 0:UL 1:DL */ + enum rte_security_pdcp_direction pkt_dir; + /**< Sequence number size, 5/7/12/15/18 */ + enum rte_security_pdcp_sn_size sn_size; + /**< Starting Hyper Frame Number to be used together with the SN + * from the PDCP frames + */ + uint32_t hfn; + /**< HFN Threashold for key renegotiation */ + uint32_t hfn_threshold; + }; + Security API ~~~~~~~~~~~~ diff --git a/lib/librte_security/rte_security.c b/lib/librte_security/rte_security.c index 1954960a5..c6355de95 100644 --- a/lib/librte_security/rte_security.c +++ b/lib/librte_security/rte_security.c @@ -131,6 +131,10 @@ rte_security_capability_get(struct rte_security_ctx *instance, capability->ipsec.direction == idx->ipsec.direction) return capability; + } else if (idx->protocol == RTE_SECURITY_PROTOCOL_PDCP) { + if (capability->pdcp.domain == + idx->pdcp.domain) + return capability; } } } diff --git a/lib/librte_security/rte_security.h b/lib/librte_security/rte_security.h index b0d1b97ee..b3565c612 100644 --- a/lib/librte_security/rte_security.h +++ b/lib/librte_security/rte_security.h @@ -206,6 +206,57 @@ struct rte_security_macsec_xform { int dummy; }; +/** + * PDCP Mode of session + */ +enum rte_security_pdcp_domain { + RTE_SECURITY_PDCP_MODE_CONTROL, /**< PDCP control plane */ + RTE_SECURITY_PDCP_MODE_DATA, /**< PDCP data plane */ +}; + +/** PDCP Frame direction */ +enum rte_security_pdcp_direction { + RTE_SECURITY_PDCP_UPLINK, /**< Uplink */ + RTE_SECURITY_PDCP_DOWNLINK, /**< Downlink */ +}; + +/** + * PDCP Sequence Number Size selectors + * @PDCP_SN_SIZE_5: 5bit sequence number + * @PDCP_SN_SIZE_7: 7bit sequence number + * @PDCP_SN_SIZE_12: 12bit sequence number + * @PDCP_SN_SIZE_15: 15bit sequence number + * @PDCP_SN_SIZE_18: 18bit sequence number + */ +enum rte_security_pdcp_sn_size { + RTE_SECURITY_PDCP_SN_SIZE_5 = 5, + RTE_SECURITY_PDCP_SN_SIZE_7 = 7, + RTE_SECURITY_PDCP_SN_SIZE_12 = 12, + RTE_SECURITY_PDCP_SN_SIZE_15 = 15, + RTE_SECURITY_PDCP_SN_SIZE_18 = 18 +}; + +/** + * PDCP security association configuration data. + * + * This structure contains data required to create a PDCP security session. + */ +struct rte_security_pdcp_xform { + int8_t bearer; /**< PDCP bearer ID */ + /** < PDCP mode of operation: Control or data */ + enum rte_security_pdcp_domain domain; + /**< PDCP Frame Direction 0:UL 1:DL */ + enum rte_security_pdcp_direction pkt_dir; + /**< Sequence number size, 5/7/12/15/18 */ + enum rte_security_pdcp_sn_size sn_size; + /**< Starting Hyper Frame Number to be used together with the SN + * from the PDCP frames + */ + uint32_t hfn; + /**< HFN Threshold for key renegotiation */ + uint32_t hfn_threshold; +}; + /** * Security session action type. */ @@ -232,6 +283,8 @@ enum rte_security_session_protocol { /**< IPsec Protocol */ RTE_SECURITY_PROTOCOL_MACSEC, /**< MACSec Protocol */ + RTE_SECURITY_PROTOCOL_PDCP, + /**< PDCP Protocol */ }; /** @@ -246,6 +299,7 @@ struct rte_security_session_conf { union { struct rte_security_ipsec_xform ipsec; struct rte_security_macsec_xform macsec; + struct rte_security_pdcp_xform pdcp; }; /**< Configuration parameters for security session */ struct rte_crypto_sym_xform *crypto_xform; @@ -413,6 +467,10 @@ struct rte_security_ipsec_stats { }; +struct rte_security_pdcp_stats { + uint64_t reserved; +}; + struct rte_security_stats { enum rte_security_session_protocol protocol; /**< Security protocol to be configured */ @@ -421,6 +479,7 @@ struct rte_security_stats { union { struct rte_security_macsec_stats macsec; struct rte_security_ipsec_stats ipsec; + struct rte_security_pdcp_stats pdcp; }; }; @@ -465,6 +524,11 @@ struct rte_security_capability { int dummy; } macsec; /**< MACsec capability */ + struct { + enum rte_security_pdcp_domain domain; + /** < PDCP mode of operation: Control or data */ + } pdcp; + /**< PDCP capability */ }; const struct rte_cryptodev_capabilities *crypto_capabilities; @@ -506,6 +570,9 @@ struct rte_security_capability_idx { enum rte_security_ipsec_sa_mode mode; enum rte_security_ipsec_sa_direction direction; } ipsec; + struct { + enum rte_security_pdcp_domain domain; + } pdcp; }; }; -- 2.17.1