From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0062.outbound.protection.outlook.com [104.47.42.62]) by dpdk.org (Postfix) with ESMTP id 4997F1B3AD for ; Tue, 3 Oct 2017 15:17:21 +0200 (CEST) Received: from MWHPR03CA0060.namprd03.prod.outlook.com (10.174.173.177) by CO2PR03MB2360.namprd03.prod.outlook.com (10.166.93.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 13:17:19 +0000 Received: from BN1AFFO11FD046.protection.gbl (2a01:111:f400:7c10::118) by MWHPR03CA0060.outlook.office365.com (2603:10b6:301:3b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Tue, 3 Oct 2017 13:17:19 +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 BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Tue, 3 Oct 2017 13:17:18 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v93DGfTH030592; Tue, 3 Oct 2017 06:17:13 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , Date: Tue, 3 Oct 2017 18:44:07 +0530 Message-ID: <20171003131413.23846-7-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171003131413.23846-1-akhil.goyal@nxp.com> References: <20170914082651.26232-1-akhil.goyal@nxp.com> <20171003131413.23846-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131515102389224932; (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)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(7416002)(68736007)(104016004)(50986999)(76176999)(356003)(189998001)(6666003)(4326008)(48376002)(54906003)(8656003)(85426001)(33646002)(305945005)(50466002)(36756003)(50226002)(498600001)(86362001)(2906002)(2351001)(16586007)(105606002)(81156014)(316002)(5003940100001)(81166006)(5660300001)(8936002)(77096006)(1076002)(8676002)(97736004)(2950100002)(53936002)(6916009)(15650500001)(69596002)(47776003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2360; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:iJTp2JeKkcJhWYy3YjN+C0Nn9Ocbe7eC2Y/KRYno40H0ovGjPgtdJxdWCM1zZFNTh3bLlvEyD2WHg23WiBXdewhq3wskr06xMGhTSRtqRXKgm2Yqo6w+SKPbd2YyB9o0 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57dadab3-eaad-4d04-e485-08d50a6112f6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CO2PR03MB2360; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 3:6YsKntJ7bBv5JaPXNrNHJjKAlKP/Ya+a0Jo1jsE0I91DNVHmb7SOmxdhNG/UrvGZE6hHf3egYPRSGKPxjhRquNXBoQM6l6kPI3KmP7RhsvrvZdGQH34BTiZMIxFi0zDUTVER/YUEh6IzsUc1oNi7W650IiM5iH3jPx75DMy0OFi4YU0I8/i+dkk5CSEfzo11i33iU+SR5y6E7ZgO4CBgR0nt42v/BE4LnwQkK/E+5gRuEbi7+B9hrvpnseGgYii9M4soTlTguPSAncwRJ0aPvCMIYsTrAnjdpcplqC4M7jL2YrqqwHDyNv8ACDlAD79b+IqCNV9CtRDDfdhO0fgJEg==; 25:3xjr7RYFXvn1kWlpdupiRSBbTCwixbHC4U4GHYE1VqZCuuaEV+wXTq9RzFPaosiOR4P+oOs7VkJsVP3VwidrGu8u+LfSQzsgFOm0jdaC/5DxiIjW9R1xhMa+Q5+gt0uFATFfnp/XGxWDs1hnz+8bRZmXjuwIwUNyxypeLv69kSGgZ5jFpwanyFAA6nPXScsSWlAVgtPXmefyNXZe8pRV4B164KicJfI/MIklTaWwHZTAU8GxqaWNMWXHs5syQztopt7VIiPbe3Nefs9+h/79b1eYugGciNMxXLbJSowOpDaG9gEc9+mcACRck/1Zlq6IUzmq6s2qix4Ypu7A7RiECA==; 31:I+nHvbhaqd49ZPMHmzN00x1VNWFx3xcI1HPFfVXZEDgno+xL4rvsaovSCnucKCAk9rKZo7KSoNwOI8WmahH2+Yr0ZYfCtD2ib7xtPuNJqsnS5mOeg90ZVsjz3PU+OhnWqDGk8rwpVaVePa65lahRSvRbdyhNmK0vUbKDQDXnY/Q5AAXLLdIrwr4zAHhcyjzQoTiPk/8BkgkJ3BQO26vHpJz4PKbIzHToI+nRlBYgfdI= X-MS-TrafficTypeDiagnostic: CO2PR03MB2360: 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)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123559100)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2360; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2360; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2360; 4:GEoq67/M/eQK8CqgU/6kb9No32PGNTNt0LXqStTdMUp/+8zAx7vlp6NdRH5dHG5HUaNWH86uYAW3DgYVTekBMFs3Vix0Y94w387IgiZsqDZ5e5fymMLW4Mmmm/W6wOAdW0q4KdX2PKlq2WDbxYjJD6rxtxHgT+2V/2m0J3HailUdhJJGir+H0jiug0szr6G0Re0NgMCUsS2bJz1sWD0aYTItBeNF+9rJFRHQ0p+gMP93GxT2qIUn2SsXBpx2fP3aUvQ4DgeSEkNHfu0abV9haJ+6HCJn9jJjSMFGkSLEFwz36Vja++1lWO0JZkjhyaBgP3RfnHSZBBEZx7Syp0Y8Ig== X-Forefront-PRVS: 044968D9E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2360; 23:Tki/6818KjPsKdJ+0ev1EXWrGESlQL+2GhxdWmTEu?= =?us-ascii?Q?S/iKlaFeCkJVf3L6uh/7N5F/5Fr6TH7XI4pgkn9NYdXjDipmUXCvH4bEP6fp?= =?us-ascii?Q?gqSeVTKMhF8AZCSwIonUrQ9jLQ2d2zfIYiBZmNljIzjRauCxHw9ReuYHObEZ?= =?us-ascii?Q?crWiI4TARk6zIQm44maNmGKM0dZS4mlHfLa429o63SerXZZb1NQ7YrrvoLoM?= =?us-ascii?Q?anGcqa77dlQmf3jYOLrDpvdYn1NTExfewLc9S5/xdITYt5MKr0MNGTB4KKh0?= =?us-ascii?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ant-OriginalArrivalTime: 03 Oct 2017 13:17:18.6572 (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: CO2PR03MB2360 Subject: [dpdk-dev] [PATCH v2 06/12] 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: Tue, 03 Oct 2017 13:17:21 -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..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..193ad62 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,8 @@ 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 /**< Multiple threads can invoke rte_eth_tx_burst() concurrently on the same * tx queue without SW lock. */ @@ -1651,6 +1659,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 +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