From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0082.outbound.protection.outlook.com [104.47.36.82]) by dpdk.org (Postfix) with ESMTP id 58D3F1B341 for ; Sun, 15 Oct 2017 00:20:47 +0200 (CEST) Received: from BN6PR03CA0075.namprd03.prod.outlook.com (10.164.122.141) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) 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:46 +0000 Received: from BN1AFFO11FD017.protection.gbl (2a01:111:f400:7c10::189) by BN6PR03CA0075.outlook.office365.com (2603:10b6:405:6f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Sat, 14 Oct 2017 22:20:46 +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 BN1AFFO11FD017.mail.protection.outlook.com (10.58.52.77) 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:45 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v9EMKCMN018714; Sat, 14 Oct 2017 15:20:40 -0700 From: Akhil Goyal To: CC: , , , , , , , , , , , , Date: Sun, 15 Oct 2017 03:47:26 +0530 Message-ID: <20171014221734.15511-5-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: 131524932460002001; (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)(39380400002)(346002)(376002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(189998001)(53936002)(69596002)(105606002)(104016004)(68736007)(50226002)(81156014)(54906003)(106466001)(85426001)(97736004)(5660300001)(498600001)(7416002)(50466002)(16586007)(4326008)(48376002)(1076002)(2950100002)(5003940100001)(36756003)(8656003)(316002)(575784001)(81166006)(77096006)(86362001)(8936002)(6916009)(50986999)(76176999)(33646002)(305945005)(2351001)(8676002)(356003)(47776003)(6666003)(2906002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD017; 1:t2e+vBPuLXLwEIHPb76YMTdX4FH58Vw1ZT8EAluRpK23lvGSjzZE2mZwvdpNeLBtpQaFQDss/XYdBpAMO0BhyrHGmL+S5QfbJaT2JZUZnfecyKLGxYsGtv1kD2qAI8pD MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58559406-93ac-42ad-5970-08d51351d0d7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:sZvcE2KhCnOzPiW4q2PnOxUqZEcuDN0DaJuSFzJMm7gnZlq+iDEKneJ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2L/8LswbeYDnwBZoRrlBzvVOidM8tjqkus/CHXWsfqZkAqXpXBft1f0MFPZcZEXzO0zJJ5hQXpsle/tC+9X/yaeRie9/vQyO3k3gSId3B0HCp7sxyJNVrYPfXkn1Q8KvOZdGeF4ds5KDnrvMs+9JMfiIb+0evqpVx5Homnhs97lmN+enqnbKe2kEtHpq7Dqm9Bilg1htximaEXvY= 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)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 046060344D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2692; 23:cqVUKiTHCLj4rBqZIIfo+BuqtVuTXYKdTWTrH4QIR?= =?us-ascii?Q?inlTXuDoY8pHFkLpSEYoDCv/9OTSpzGWL2/od53xihSuRtpexBrHP/b73BPe?= =?us-ascii?Q?3CYOYn9Tzx41RSaR0vvsK8LdXUsT+N+oRxkqODRCf8dodiEK5atK9JaxPAmU?= =?us-ascii?Q?yB0/J4F44DC2tv49VmhBPrL5GSANEpVU+wBl/xEzCCxVdZNHxdh3jPEgJAaj?= =?us-ascii?Q?nKqqt3HsxA0iAacsrBLaoZW04GM48xf3v4FCU4QwQQQxP8MRkAWLGLMn/6G8?= =?us-ascii?Q?VjHJixqSQqCDuUG3Qf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ascii?Q?FoXbrBJogS1zob0/5uWdIBJnE/Eczo3/Bge+49ijw0k6N0wDMQX7Ni/KpQ2E?= =?us-ascii?Q?6AiLdwGGKRxBBOvFdLWAa7OLaQN5Hs6xSz8PHk0?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 6:8xjPhPH6bK/LIMIdgApMbMqGez7VqvFz5waInHISgGB09RanHn+1eqVDcfrJ1OSpEBJkvwIKROX5gcHeMrGAjpu1E65K8nXVKsLnyftATVUoCttWxfMIe7UoP0/Oa9lpnr43ugCxfzGDnNAj1KM35gx1DNeZbglsI7W/EpG8amFEonplV2FWK4kfv/NIxToobI4GyJZ7BDw64d4qZlrEhfIbDrslnf6p11jjQK0HMX/IdxFjql3+8bcOSNkgO82ByBhMSUCRunaDZ5E+A7BiGwgRTI+o7XD7UW71i15Huzbu7EJfzwEF2aQS/D+xandHhKjSQ1CHnAXDtxzt6bIqkQ==; 5:GtnarqcAukSDa17zSqawbckoO9CPL/qm2ut+/89lSEgPqXq7afgeMJHDssKIaleD0tczcgMfZn+HHVx96Zbfbqq5HQCndL8proPqvosY3oA+kL7QM4w/ZVTMmHZnRCa7yGaAErgwh24+6RXWaHWLAg==; 24:f/1oAw3BCDNh4B+yeYhT7BM46GgQ5hH1NZ+YKGh69382sm33+F6bN9tCQh6peXgKKjMyvri+er9kwu2Dixc20L9hmwFFbzOlqiyZIKmO2Wg=; 7:k+cPLIhZYZuqciC2Euo62mtcv3sxAwLU6JLXfN9Np7McjgdFcbIqK6XdjzFG1lCuHEEDgsE855lIf25hs3B86xTWsNfW8/SayxUV5bbktpaHhUe0TOayXQ1py4u9c53sWyWeKBqvc+xC5AZ2sHm4GvQOinF8X/l3CGdOyRdO2f7c29SlQ6vYtRfc47UGPtJlTc+iDJYAeVzXertJ6pUmauKWSuuy8SOCUG2GFRB5700= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2017 22:20:45.7505 (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: BN6PR03MB2692 Subject: [dpdk-dev] [PATCH v4 04/12] 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: Sat, 14 Oct 2017 22:20:47 -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 | 3 ++- lib/librte_ether/rte_flow.h | 26 ++++++++++++++++++++ lib/librte_net/Makefile | 2 +- lib/librte_net/rte_esp.h | 60 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 2 deletions(-) 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 7c680dc..d59893b 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -111,7 +111,8 @@ The public API headers are grouped by topics: [LPM IPv6 route] (@ref rte_lpm6.h), [ACL] (@ref rte_acl.h), [EFD] (@ref rte_efd.h), - [member] (@ref rte_member.h) + [member] (@ref rte_member.h), + [ESP] (@ref rte_esp.h) - **QoS**: [metering] (@ref rte_meter.h), diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index a0ffb71..7c89089 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 56727c4..0f87b23 100644 --- a/lib/librte_net/Makefile +++ b/lib/librte_net/Makefile @@ -42,7 +42,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