From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0043.outbound.protection.outlook.com [104.47.32.43]) by dpdk.org (Postfix) with ESMTP id 8D8D11B286 for ; Fri, 6 Oct 2017 20:15:09 +0200 (CEST) Received: from MWHPR03CA0019.namprd03.prod.outlook.com (2603:10b6:300:117::29) 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.77.7; Fri, 6 Oct 2017 18:15:08 +0000 Received: from BN1BFFO11FD024.protection.gbl (2a01:111:f400:7c10::1:109) by MWHPR03CA0019.outlook.office365.com (2603:10b6:300:117::29) 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; Fri, 6 Oct 2017 18:15:08 +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 BN1BFFO11FD024.mail.protection.outlook.com (10.58.144.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Fri, 6 Oct 2017 18:15:07 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v96IERoe027297; Fri, 6 Oct 2017 11:15:01 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Fri, 6 Oct 2017 23:41:45 +0530 Message-ID: <20171006181151.4758-7-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171006181151.4758-1-akhil.goyal@nxp.com> References: <20171003131413.23846-1-akhil.goyal@nxp.com> <20171006181151.4758-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131517873080285380; (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)(7966004)(336005)(39380400002)(346002)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(85426001)(2950100002)(6916009)(189998001)(104016004)(68736007)(6666003)(8656003)(77096006)(316002)(69596002)(5660300001)(48376002)(50466002)(54906003)(7416002)(356003)(305945005)(81156014)(498600001)(4326008)(2906002)(1076002)(47776003)(50986999)(8676002)(15650500001)(81166006)(97736004)(86362001)(5003940100001)(50226002)(76176999)(575784001)(36756003)(106466001)(8936002)(16586007)(53936002)(33646002)(2351001)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD024; 1:gES9hyOF0qwCcqrty4Muqm6ZsUgHfnTpDsTXShTV2jm81YjIqpSEqt6XJyesMMDjZGTZ0i3ws09OSm7xKLXRYH4AiI7MryWmo7qHgZhJNUTB6uaGsEUM5npgh0SrVbpJ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2867ced8-8d53-40c2-5763-08d50ce62d05 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:K+/20MmDnr9HBpBtyyf5ANnliTQlvBk+pkEeO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GaleIoTk5aM9goQA2pMgrhR7nTSXe4Vw/loG6ysBvmd9BAphc5/eZjm+xBpz3DEpeYwo1fUIY6+2sIsr7nWm1Xs2mbK4sgYx46wmySmsg9sywYVa26b5iFKPUZikbJ32xaBOUsAfABgBvLG8nP9+RDKry9xw0a1b+gZ5Hy0yhMFhDiX4rkPb8iVtFb7uxEHAjbRBDF7lkP4Sqk9zgP28iRLkxRMaTxSSKsnzmTju3lAfhDOsSOvsbTb4yOQA== 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(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: 0452022BE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:l6tOE3n+N/ihD/ofA1MZg0QjofbxI7nh/tyJTtBnW?= =?us-ascii?Q?15nvmMAAvQ/Ita+TM+AvmvHcjPhLgqd2wCm1wnK+gHJhwiUsmg4HoLDhu1eV?= =?us-ascii?Q?VfgTvDPtfG/YdOP7JElBfQxKYWKVc1saio2xWDBFaJOdjA+PYKgAFua6Y5uq?= =?us-ascii?Q?nK3R32AQgZm4gkeHJs1KyZBHA8rXXMU5b9PHyApNewFg+oCuS8ld81rKcXCj?= =?us-ascii?Q?kqF/RxyaikyiQpqZzq4+tY0LWXOo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dQzztySb9WE26QdHZeNljBtkcourtY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 18:15:07.6541 (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: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH v3 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: Fri, 06 Oct 2017 18:15:11 -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 | 19 +++++++++++++++++-- lib/librte_ether/rte_ethdev_version.map | 7 +++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0597641..860eafa 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 INVALID_SEC_ID; +} + 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..cd0bb0c 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. @@ -929,6 +935,7 @@ struct rte_eth_conf { /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same * tx queue without SW lock. */ +#define DEV_TX_OFFLOAD_SECURITY 0x00008000 struct rte_pci_device; @@ -1651,6 +1658,10 @@ struct rte_eth_dev { enum rte_eth_dev_state state; /**< Flag indicating the port state */ } __rte_cache_aligned; +#define INVALID_SEC_ID 0xFFFF +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 +1722,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 +1734,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