From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0055.outbound.protection.outlook.com [104.47.34.55]) by dpdk.org (Postfix) with ESMTP id AC28D1B25F for ; Wed, 25 Oct 2017 17:10:43 +0200 (CEST) Received: from CY1PR03CA0025.namprd03.prod.outlook.com (2603:10b6:600::35) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Wed, 25 Oct 2017 15:10:41 +0000 Received: from BN1AFFO11FD030.protection.gbl (2a01:111:f400:7c10::180) by CY1PR03CA0025.outlook.office365.com (2603:10b6:600::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.178.6 via Frontend Transport; Wed, 25 Oct 2017 15:10:41 +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 BN1AFFO11FD030.mail.protection.outlook.com (10.58.52.168) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.156.4 via Frontend Transport; Wed, 25 Oct 2017 15:10:41 +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 v9PFAECY009577; Wed, 25 Oct 2017 08:10:36 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Wed, 25 Oct 2017 20:37:21 +0530 Message-ID: <20171025150727.30364-5-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171025150727.30364-1-akhil.goyal@nxp.com> References: <20171024141545.30837-1-akhil.goyal@nxp.com> <20171025150727.30364-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131534178415947318; (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)(7966004)(376002)(346002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(77096006)(316002)(4326008)(104016004)(8676002)(5660300001)(53936002)(2950100002)(6916009)(6666003)(47776003)(15650500001)(85426001)(2906002)(189998001)(16586007)(5003940100001)(33646002)(54906003)(81156014)(8936002)(2351001)(1076002)(50986999)(106466001)(76176999)(498600001)(81166006)(105606002)(356003)(97736004)(50466002)(50226002)(68736007)(48376002)(36756003)(305945005)(86362001)(7416002)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD030; 1:7wM4+5KCCchXimmkJqCJ8aRiqeDTNldh7Kl0843s9RkNU8RoGQamFDU+lCGk34u+a7z1jY+8iNG3vxO57AZ6bsrR11GAnnMQnhjPR1rvmg3o7QOG8TUX3ghhnDr14LeT MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8410872a-47b1-4914-ccd6-08d51bba8ec2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603199); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:7VDz8tfzrB7fnbfOJvC61gPYXhfTdRtHbk9TOMk73Uo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47wZ9cEN4f75kulMlqW/lX7Vxoxj67wRl+GHwMFd4jcLNbmFjbU+/gCcb6LzKGVpXbIduBy01EVy9BPK280MgA+Yxg0b/uTzpC2Ew+xOMQJ5ZlWuCSuVq7XJPoXtWB3/B6wx1lHUU57x2IpSNVieIg8YQVQwufPGhFLDgo89/A8oYnplTZPvut5jj+4Nabn0Csltppv9D9lVGblkKuPUNctKH0PcnywKfoGZYrreC0U61DXBLvGXkZgra5sF0xqUlakYoUNtpo3C3YxIETd0b1ybk3G8TutqpSaVDvDovD X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(185117386973197)(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)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3231020)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123556025)(20161123565025)(20161123561025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 0471B73328 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:7bOz39uMPy3DbZAKDJFFbzDZoVkRoBNB0SaZzsBnJ?= =?us-ascii?Q?I1gHFay0+FOe+ixKzRwoC5savo1d+XAS0QQjYUk/sVIcxOrYs9hB9y0e/anI?= =?us-ascii?Q?ZLnNL961FtpLu9++Z0Bdksh3r4yYS5mhwJhQA0pKx6YpWHJ8vQDDhdp6pZYX?= =?us-ascii?Q?OYMWtZqoebx1QFl8N49q8T4V1VuLGXe7UoajuSwMhV+C+rczB1/Q2oc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7faIgzHhR+VoHPqUp7MyyDWuJacqnmvjZU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2017 15:10:41.4231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8410872a-47b1-4914-ccd6-08d51bba8ec2 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: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v6 04/10] 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: Wed, 25 Oct 2017 15:10:44 -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 Acked-by: Hemant Agrawal --- lib/librte_ether/rte_ethdev.c | 13 +++++++++++++ lib/librte_ether/rte_ethdev.h | 9 +++++++++ lib/librte_ether/rte_ethdev_version.map | 1 + 3 files changed, 23 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0b1e928..68b0318 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -301,6 +301,13 @@ 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); + return rte_eth_devices[port_id].security_ctx; +} + uint16_t rte_eth_dev_count(void) { @@ -712,6 +719,8 @@ rte_eth_convert_rx_offload_bitfield(const struct rte_eth_rxmode *rxmode, offloads |= DEV_RX_OFFLOAD_TCP_LRO; if (rxmode->hw_timestamp == 1) offloads |= DEV_RX_OFFLOAD_TIMESTAMP; + if (rxmode->security == 1) + offloads |= DEV_RX_OFFLOAD_SECURITY; *rx_offloads = offloads; } @@ -764,6 +773,10 @@ rte_eth_convert_rx_offloads(const uint64_t rx_offloads, rxmode->hw_timestamp = 1; else rxmode->hw_timestamp = 0; + if (rx_offloads & DEV_RX_OFFLOAD_SECURITY) + rxmode->security = 1; + else + rxmode->security = 0; } int diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index b773589..028bf11 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" @@ -370,6 +372,7 @@ struct rte_eth_rxmode { enable_scatter : 1, /**< Enable scatter packets rx handler */ enable_lro : 1, /**< Enable LRO */ hw_timestamp : 1, /**< Enable HW timestamp */ + security : 1, /**< Enable rte_security offloads */ /** * When set the offload bitfield should be ignored. * Instead per-port Rx offloads should be set on offloads @@ -963,6 +966,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000 #define DEV_RX_OFFLOAD_SCATTER 0x00002000 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000 +#define DEV_RX_OFFLOAD_SECURITY 0x00008000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM) @@ -998,6 +1002,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 0x00020000 struct rte_pci_device; @@ -1741,8 +1746,12 @@ struct rte_eth_dev { */ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT]; enum rte_eth_dev_state state; /**< Flag indicating the port state */ + void *security_ctx; /**< Context for security ops */ } __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 */ diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map index 57d9b54..e9681ac 100644 --- a/lib/librte_ether/rte_ethdev_version.map +++ b/lib/librte_ether/rte_ethdev_version.map @@ -191,6 +191,7 @@ DPDK_17.08 { DPDK_17.11 { global: + rte_eth_dev_get_sec_ctx; rte_eth_dev_pool_ops_supported; rte_eth_dev_reset; rte_flow_error_set; -- 2.9.3