From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0061.outbound.protection.outlook.com [104.47.34.61]) by dpdk.org (Postfix) with ESMTP id 916201B829 for ; Tue, 24 Oct 2017 16:18:59 +0200 (CEST) Received: from BN6PR03CA0001.namprd03.prod.outlook.com (10.168.230.139) by CO2PR03MB2357.namprd03.prod.outlook.com (10.166.93.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Tue, 24 Oct 2017 14:18:58 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:122) by BN6PR03CA0001.outlook.office365.com (2603:10b6:404:23::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Tue, 24 Oct 2017 14:18:57 +0000 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 BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.156.4 via Frontend Transport; Tue, 24 Oct 2017 14:18:57 +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 v9OEIVHW029613; Tue, 24 Oct 2017 07:18:52 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Tue, 24 Oct 2017 19:45:38 +0530 Message-ID: <20171024141545.30837-5-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171024141545.30837-1-akhil.goyal@nxp.com> References: <20171014221734.15511-1-akhil.goyal@nxp.com> <20171024141545.30837-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131533283377090141; (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)(376002)(346002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(316002)(54906003)(305945005)(189998001)(8656005)(8656005)(4326008)(77096006)(8676002)(47776003)(104016004)(97736004)(81166006)(8936002)(356003)(50466002)(48376002)(498600001)(81156014)(50986999)(76176999)(5660300001)(36756003)(53936002)(105606002)(5003940100001)(575784001)(68736007)(50226002)(16586007)(33646002)(106466001)(7416002)(6916009)(2351001)(2950100002)(1076002)(2906002)(6666003)(86362001)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2357; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD034; 1:IfPnIKmXeWhL8dtLz2YF4uNJcix+sKEsjq8tnZ79CgcwcjjlF3LRUNbF/ZIv3TTvIjRKLocbkeieVaCMZcvEpd4P9cl/4jGv+X1iQtku+o0+6/jZAJCUsrsSB1hrbaRL MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 90f5f4f4-e708-4ad7-0e5d-08d51aea2a4c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4628075)(201703131517081)(2017052603229); SRVR:CO2PR03MB2357; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2357; 3:fRZkxXUMg28rajnMgO1rosWoj38im6E/J6Rl36EYjSRaO5lWq2nPuzqzcy8ChpIWcRj9Z2sKe+dqkHmbJSfHDN04ib7bH/84thQwvrecIteDJzYxLWyMC4ZYcu6ro0oX9NcntBC9z0+yKicLVqnCtoG/34DaVzA3mA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3afIpwfN341NzGbW9h7iGXPTH62iH5QZuI/kBXIa+dFyXIgYiwiphRpOTZ00oNBSzcQeI65VBOs= X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); 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)(3002001)(100000703101)(100105400095)(3231020)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2357; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2357; X-Forefront-PRVS: 047001DADA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2357; 23:5wwp8+zEBKEwppHf4JseoM1YwHOn/A4GDI94FVfup?= =?us-ascii?Q?TD4yVqEuXOfk7lbFyaeqM4OBIsn4hk/l6sIjlIXHppMWlDrk+uWtnKeq7noO?= =?us-ascii?Q?gC0AW3w8F0cSEZWY1Iwc0BnSXDqdce0c5fkmAj67WiFmQ42GF9sRduy2cDps?= =?us-ascii?Q?6q+mZJ4T33/TXM6HSyfA/9/2LnyTTUKnmeGO/TTrXYQQYcCYiA714CIwiLFt?= =?us-ascii?Q?p02AQtrXqx/aod2NPg63rsl+IECpM3HRUtJxPTPXPtcNQhO3H8kaHZsEgld4?= =?us-ascii?Q?tGF5k3MAmm94qzOmeSc7dqDqCsSQbCLNJkKfXhjq1GyjJHHFcf1qgU+KVWvZ?= =?us-ascii?Q?n1vL/cS37TOG+goWEH4jDgxN2nAoW9VFSCss7w8jccQBO4vLRqH45LCrZ11s?= =?us-ascii?Q?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1; CO2PR03MB2357; 6:dER/uwESGMOTa8nhgeo5yQ6k5UAL9/LflfeeRgjDSJv2P+1PjhLP28G4vb8D7xIyLSqGo1E7kTxGTNk5NekmdvnXgmPlgmcLsKcrC2uLC1RScy5iHkkA7YsLiSgxajJrnpGQmcLxvYP1aVjOIhJ5j6/atZ5/TGVeUxuhC31BNDT3VV18VQUvrGvyP7AJhiOIjHfHkMqzpajhNFWK09rx5lCIG53Ej5eVPqca/iwN/OWKwnJvWwfLjaVC9OBObAX87HACzjD/MPrRKEqM2m5Az7BJBaWmF0yOQXsZNsDVvG91FXbM94suxisGleNj74j+Vy6n5aOaoth7Ad4uKbxKbg==; 5:vn/A2jdsTzQLZ6NjfId0h+CmkWXhgSbWfxHXEeP5o2GGbEga/zcTP7kGnQYZPFJy4JsNsELzTZx7ZFBNaT+oL+ftZ4xq0oC3LKz0xNXmg1/hgN0EY1br1e7KFxpBQheRm1jQFCF7aRc5eSlpw0Ctbg==; 24:TFyKE/W1haMBsO/z0S7MFTFCrQERXbHndVeaVWR1xzRSYqFrdvFVdLqKHB2No5GKvLKT0nXnZfgjh5ydGQ3Ynwlqj3czT7ZVunYFspP1I/U=; 7:aB46C+xIQVR49pmaUnSuIsI7Y5kZn3403Chf5JtqPBTsV94aaxl2hSz3mDSj6Xf/LFjEEdgqwlKY7PC0tjVqsrQfziWas35KdmFYrXIOLx/IJlDifKmBqw39XgN4ALkGxRLkL401pkzOFMS6Gr5RUGpYMk2E2n+pRTu/2OY/eDMphUfuvWooa/vnshs/FIOJCsZgIfh0fpO4aRqIFDLQxbnVkyCD8N9mcVYLQizKYm8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2017 14:18:57.4594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90f5f4f4-e708-4ad7-0e5d-08d51aea2a4c 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: CO2PR03MB2357 Subject: [dpdk-dev] [PATCH v5 04/11] net: add ESP header to generic flow steering 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, 24 Oct 2017 14:19:00 -0000 From: Boris Pismenny The ESP header is required for IPsec crypto actions. Signed-off-by: Boris Pismenny Signed-off-by: Aviad Yehezkel --- doc/api/doxy-api-index.md | 1 + lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_esp.h | 60 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 lib/librte_net/rte_esp.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index 0f8d6d9..ac994ed 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -101,6 +101,7 @@ The public API headers are grouped by topics: [ethernet] (@ref rte_ether.h), [ARP] (@ref rte_arp.h), [ICMP] (@ref rte_icmp.h), + [ESP] (@ref rte_esp.h), [IP] (@ref rte_ip.h), [SCTP] (@ref rte_sctp.h), [TCP] (@ref rte_tcp.h), diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index 062e3ac..bd8274d 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -50,6 +50,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -336,6 +337,13 @@ enum rte_flow_item_type { * See struct rte_flow_item_gtp. */ RTE_FLOW_ITEM_TYPE_GTPU, + + /** + * Matches a ESP header. + * + * See struct rte_flow_item_esp. + */ + RTE_FLOW_ITEM_TYPE_ESP, }; /** @@ -787,6 +795,24 @@ static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = { #endif /** + * RTE_FLOW_ITEM_TYPE_ESP + * + * Matches an ESP header. + */ +struct rte_flow_item_esp { + struct esp_hdr hdr; /**< ESP header definition. */ +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_ESP. */ +#ifndef __cplusplus +static const struct rte_flow_item_esp rte_flow_item_esp_mask = { + .hdr = { + .spi = 0xffffffff, + }, +}; +#endif + +/** * Matching pattern item definition. * * A pattern is formed by stacking items starting from the lowest protocol diff --git a/lib/librte_net/Makefile b/lib/librte_net/Makefile index cdaf0c7..50c358e 100644 --- a/lib/librte_net/Makefile +++ b/lib/librte_net/Makefile @@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_NET) := rte_net.c SRCS-$(CONFIG_RTE_LIBRTE_NET) += rte_net_crc.c # install includes -SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h +SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include := rte_ip.h rte_tcp.h rte_udp.h rte_esp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_sctp.h rte_icmp.h rte_arp.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_ether.h rte_gre.h rte_net.h SYMLINK-$(CONFIG_RTE_LIBRTE_NET)-include += rte_net_crc.h diff --git a/lib/librte_net/rte_esp.h b/lib/librte_net/rte_esp.h new file mode 100644 index 0000000..e228af0 --- /dev/null +++ b/lib/librte_net/rte_esp.h @@ -0,0 +1,60 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RTE_ESP_H_ +#define _RTE_ESP_H_ + +/** + * @file + * + * ESP-related defines + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * ESP Header + */ +struct esp_hdr { + uint32_t spi; /**< Security Parameters Index */ + uint32_t seq; /**< packet sequence number */ +} __attribute__((__packed__)); + +#ifdef __cplusplus +} +#endif + +#endif /* RTE_ESP_H_ */ -- 2.9.3