From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0052.outbound.protection.outlook.com [104.47.40.52]) by dpdk.org (Postfix) with ESMTP id 6C8491B389 for ; Sun, 15 Oct 2017 00:20:59 +0200 (CEST) Received: from CY4PR03CA0017.namprd03.prod.outlook.com (2603:10b6:903:33::27) by SN2PR03MB2367.namprd03.prod.outlook.com (2603:10b6:804:e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 14 Oct 2017 22:20:57 +0000 Received: from BL2FFO11FD005.protection.gbl (2a01:111:f400:7c09::103) by CY4PR03CA0017.outlook.office365.com (2603:10b6:903:33::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Sat, 14 Oct 2017 22:20:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD005.mail.protection.outlook.com (10.173.161.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Sat, 14 Oct 2017 22:20:57 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v9EMKCMP018714; Sat, 14 Oct 2017 15:20:51 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Sun, 15 Oct 2017 03:47:28 +0530 Message-ID: <20171014221734.15511-7-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171014221734.15511-1-akhil.goyal@nxp.com> References: <20171006181151.4758-1-akhil.goyal@nxp.com> <20171014221734.15511-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131524932574500545; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(346002)(39380400002)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(77096006)(5660300001)(1076002)(5003940100001)(8656003)(2906002)(7416002)(85426001)(15650500001)(356003)(305945005)(97736004)(16586007)(6666003)(8936002)(8676002)(81156014)(81166006)(316002)(104016004)(2950100002)(54906003)(6916009)(53936002)(4326008)(47776003)(498600001)(76176999)(50986999)(50466002)(50226002)(69596002)(48376002)(105606002)(189998001)(86362001)(68736007)(33646002)(106466001)(2351001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2367; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD005; 1:ueu8VUehTpujk8AIdPeE1qmdOBahR50TYne71vAo0qwdk9qAMPgvH8OYBDRrktvV9sA2YEgmhuSurgFRSLo6fCjkzmpaFVysM4USqTEmbbzlHvHgwnQJpa5xWtp10I7u MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0749bfda-4c2a-434b-7560-08d51351d7aa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:SN2PR03MB2367; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2367; 3:IXU4+X9iK9rjJ/kWchT5wOxKgaMsMJCv9yBQIrW0b1gjYDlLWVl6eG8bK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thh1bGSThYFoxZClknPi/5icXCr2eHLwiPMfxB+d7ubC4sXnomtKdxDGJN/PbyTz7XX4g2uDnNvrEgfi4hPzbK2R72ZX3I+zUr7AJHOP2oEwsup5KmUVt27e7r69Zb7NlhO98YAFu+XVggZXqb2dXYT4ZCVVswEA+nO3aosMFV7FIGEEnQNhCCY5ErjdeL+qEypN//q1E2/TehuzljwCdbqrXn18B2wR2wy+npSw== 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2367; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2367; X-Forefront-PRVS: 046060344D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2367; 23:NvZstgat8B85Z0ZVy+9xWVn2O0awchM8fsj5cJCok?= =?us-ascii?Q?uUeB8MlDK1xqmRnoib+Zj9Vjm9zubvMeCaZfkTVnHA1MtCDF/9a8DSJtdVqQ?= =?us-ascii?Q?XwQFFOy0xj5KBGOpAfK4XIdhpcV9Ao3a6OKQnuMYGtlImWjCV5PToAANKdt5?= =?us-ascii?Q?Ngy3MWRPtNnp+pZeSA3cOL0J4ydyT1KtxVYoQrtGsOnH3qugdSxW1cz5VEs+?= =?us-ascii?Q?yoIZY0WAMJaGp6Kp+k+35uNR+n4kKmDa9cJAdSNinDCu5mhvSWKrXcf+2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ticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2017 22:20:57.2004 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2367 Subject: [dpdk-dev] [PATCH v4 06/12] ethdev: 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: Sat, 14 Oct 2017 22:21:00 -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 | 18 ++++++++++++++++-- lib/librte_ether/rte_ethdev_version.map | 1 + 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0b1e928..9520f1e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -301,6 +301,17 @@ rte_eth_dev_socket_id(uint16_t port_id) return rte_eth_devices[port_id].data->numa_node; } +void * +rte_eth_dev_get_sec_ctx(uint8_t port_id) +{ + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL); + + if (rte_eth_devices[port_id].data->dev_flags & RTE_ETH_DEV_SECURITY) + return rte_eth_devices[port_id].data->security_ctx; + + return NULL; +} + uint16_t rte_eth_dev_count(void) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index aaf02b3..159bb73 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" @@ -379,7 +381,8 @@ struct rte_eth_rxmode { * This bit is temporary till rxmode bitfield offloads API will * be deprecated. */ - ignore_offload_bitfield : 1; + ignore_offload_bitfield : 1, + enable_sec : 1; /**< Enable security offload */ }; /** @@ -707,8 +710,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 */ }; /** @@ -969,6 +974,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ DEV_RX_OFFLOAD_VLAN_EXTEND) +#define DEV_RX_OFFLOAD_SECURITY 0x00000100 /** * TX offload capabilities of a device. @@ -998,6 +1004,7 @@ struct rte_eth_conf { * When set application must guarantee that per-queue all mbufs comes from * the same mempool and has refcnt = 1. */ +#define DEV_TX_OFFLOAD_SECURITY 0x00008000 struct rte_pci_device; @@ -1736,6 +1743,9 @@ struct rte_eth_dev { enum rte_eth_dev_state state; /**< Flag indicating the port state */ } __rte_cache_aligned; +void * +rte_eth_dev_get_sec_ctx(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 */ @@ -1796,6 +1806,8 @@ struct rte_eth_dev_data { int numa_node; /**< NUMA node connection */ struct rte_vlan_filter_conf vlan_filter_conf; /**< VLAN filter configuration. */ + void *security_ctx; + /**< Context for security ops */ }; /** Device supports hotplug detach */ @@ -1806,6 +1818,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 e27f596..3cc6a64 100644 --- a/lib/librte_ether/rte_ethdev_version.map +++ b/lib/librte_ether/rte_ethdev_version.map @@ -194,5 +194,6 @@ DPDK_17.11 { rte_eth_dev_pool_ops_supported; rte_eth_dev_reset; rte_flow_error_set; + rte_eth_dev_get_sec_ctx; } DPDK_17.08; -- 2.9.3