From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0058.outbound.protection.outlook.com [104.47.34.58]) by dpdk.org (Postfix) with ESMTP id C80561B1A3 for ; Thu, 14 Sep 2017 10:29:34 +0200 (CEST) Received: from BN6PR03CA0009.namprd03.prod.outlook.com (10.168.230.147) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Thu, 14 Sep 2017 08:29:33 +0000 Received: from BL2FFO11OLC002.protection.gbl (2a01:111:f400:7c09::118) by BN6PR03CA0009.outlook.office365.com (2603:10b6:404:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Thu, 14 Sep 2017 08:29:33 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC002.mail.protection.outlook.com (10.173.161.186) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Thu, 14 Sep 2017 08:29:33 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8E8T36K025953; Thu, 14 Sep 2017 01:29:28 -0700 From: Akhil Goyal To: CC: , , , , , , , , Date: Thu, 14 Sep 2017 13:56:46 +0530 Message-ID: <20170914082651.26232-7-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170914082651.26232-1-akhil.goyal@nxp.com> References: <20170914082651.26232-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131498513732165138; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(346002)(376002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5660300001)(106466001)(7416002)(305945005)(15650500001)(105606002)(104016004)(2906002)(6666003)(2950100002)(6916009)(1076002)(77096006)(81156014)(81166006)(8936002)(47776003)(50986999)(50226002)(76176999)(36756003)(48376002)(2351001)(356003)(33646002)(8676002)(110136004)(50466002)(97736004)(8656003)(4326008)(498600001)(85426001)(86362001)(68736007)(5003940100001)(54906002)(16586007)(53936002)(189998001)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC002; 1:GcIB0Ry7LEZuYm4CCIYTsEyACpvcV2jGFkHptoE9lmQk4nmtUOJUeuVW3q5o5qGrA3f35VVbvww6jUvBitgtc6lS9wIBYd6Q1dkWlrxNHzPlnfjLy73zbIlCYYwdLd03 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e102969-d6f1-4f6b-9b54-08d4fb4ab9f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1;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HAjS5OQ8c1bVQEqhurGWLmlUsPJHoapXdwZTvqHpyvsBEPt1O1C2m3O8+XNGNi8TAdnMmEscueAKGuy/qv+qaHD7uB2fzDq8chnWiycMyZS9KzW+d2jHec6PUNtpsWBTsP5e05nkTvQYzpoEQiOgTF+ZQBMROmYNTFgG0Bw7f4HzdedzpOBMWF8U7XRarDX8QbE8GNyYygZSR9cnHRLuek5AKz98b1hQyCW0DQ4CIojBatNDc9LcXmk0TZyse1Ix2fCvPwOOQOXlHtkbo1R1uvM77cMQhZzgsY44MwynxwEBXD3pYDl49nlAx3rdw== X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123565025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 0430FA5CB7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:d7UmYos1OHlOZ/GxRpPjvT62ckyj8pIKoMnnTXJUi?= =?us-ascii?Q?xHwyYyw0O537KMSKjKFXTVSFUi0nFqLEHXhhXbcaMZZu4XdT2CGjB+stog1K?= =?us-ascii?Q?veSZeIDtzABnskfCcmVST1qycdMW+WQ+OzFxsyKoiKb4jRkvI2ctLxiRczgS?= =?us-ascii?Q?92++1/gQQR8VyGtcSkKU7Oww5YTKQPWbriNwJjvWAMMLnG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bnXSdjDqowb8AFe2//NCTdglIjBqdwA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 08:29:33.0293 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 06/11] ethdev: extend ethdev to support security APIs 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: Thu, 14 Sep 2017 08:29:35 -0000 From: Declan Doherty rte_flow_action type and ethdev updated to support rte_security sessions for crypto offload to ethernet device. Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel Signed-off-by: Radu Nicolau Signed-off-by: Declan Doherty --- lib/librte_ether/rte_ethdev.c | 11 +++++++++++ lib/librte_ether/rte_ethdev.h | 22 ++++++++++++++++++++-- lib/librte_ether/rte_ethdev_version.map | 7 +++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0597641..f51c5a5 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -302,6 +302,17 @@ rte_eth_dev_socket_id(uint8_t port_id) return rte_eth_devices[port_id].data->numa_node; } +uint16_t +rte_eth_dev_get_sec_id(uint8_t port_id) +{ + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); + + if (rte_eth_devices[port_id].data->dev_flags & RTE_ETH_DEV_SECURITY) + return rte_eth_devices[port_id].data->sec_id; + + return -1; +} + uint8_t rte_eth_dev_count(void) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 0adf327..262ba47 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -180,6 +180,8 @@ extern "C" { #include #include #include +#include + #include "rte_ether.h" #include "rte_eth_ctrl.h" #include "rte_dev_info.h" @@ -357,7 +359,8 @@ struct rte_eth_rxmode { jumbo_frame : 1, /**< Jumbo Frame Receipt enable. */ hw_strip_crc : 1, /**< Enable CRC stripping by hardware. */ enable_scatter : 1, /**< Enable scatter packets rx handler */ - enable_lro : 1; /**< Enable LRO */ + enable_lro : 1, /**< Enable LRO */ + enable_sec : 1; /**< Enable security offload */ }; /** @@ -679,8 +682,10 @@ struct rte_eth_txmode { /**< If set, reject sending out tagged pkts */ hw_vlan_reject_untagged : 1, /**< If set, reject sending out untagged pkts */ - hw_vlan_insert_pvid : 1; + hw_vlan_insert_pvid : 1, /**< If set, enable port based VLAN insertion */ + enable_sec : 1; + /**< Enable security offload */ }; /** @@ -907,6 +912,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080 +#define DEV_RX_OFFLOAD_SECURITY 0x00000100 /** * TX offload capabilities of a device. @@ -926,6 +932,11 @@ struct rte_eth_conf { #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000 /**< Used for tunneling packet. */ #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000 +#define DEV_TX_OFFLOAD_SECURITY 0x00008000 +#define DEV_TX_OFFLOAD_SEC_NEED_MDATA 0x00010000 +#define DEV_TX_OFFLOAD_IPSEC_CRYPTO_HW_TRAILER 0x00020000 +#define DEV_TX_OFFLOAD_IPSEC_CRYPTO_TSO 0x00040000 +#define DEV_TX_OFFLOAD_IPSEC_CRYPTO_CKSUM 0x00080000 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same * tx queue without SW lock. */ @@ -1651,6 +1662,9 @@ struct rte_eth_dev { enum rte_eth_dev_state state; /**< Flag indicating the port state */ } __rte_cache_aligned; +uint16_t +rte_eth_dev_get_sec_id(uint8_t port_id); + struct rte_eth_dev_sriov { uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */ uint8_t nb_q_per_pool; /**< rx queue number per pool */ @@ -1711,6 +1725,8 @@ struct rte_eth_dev_data { int numa_node; /**< NUMA node connection */ struct rte_vlan_filter_conf vlan_filter_conf; /**< VLAN filter configuration. */ + uint16_t sec_id; + /**< security instance identifier */ }; /** Device supports hotplug detach */ @@ -1721,6 +1737,8 @@ struct rte_eth_dev_data { #define RTE_ETH_DEV_BONDED_SLAVE 0x0004 /** Device supports device removal interrupt */ #define RTE_ETH_DEV_INTR_RMV 0x0008 +/** Device supports inline security processing */ +#define RTE_ETH_DEV_SECURITY 0x0010 /** * @internal diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map index 4283728..24cbd7d 100644 --- a/lib/librte_ether/rte_ethdev_version.map +++ b/lib/librte_ether/rte_ethdev_version.map @@ -187,3 +187,10 @@ DPDK_17.08 { rte_tm_wred_profile_delete; } DPDK_17.05; + +DPDK_17.11 { + global: + + rte_eth_dev_get_sec_id; + +} DPDK_17.08; -- 2.9.3