From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id D9E6B1B2F7 for ; Sun, 15 Oct 2017 14:48:36 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id 196so1237802wma.1 for ; Sun, 15 Oct 2017 05:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=48Hedow0BXpSNrsaNUzhMGQIqlyB74bm8VJ6k5TzL84=; b=UYKCS+7BI4O2qBwhpWtU9k2FhOgFKQ87YPMsdco7J8HLRZc0s7hHc+Gip3lZVCpa4p xLgfx5f61HAYrEPfDYrvWY01yPkdoexp21sAwX19xVb+5gX4nPiDTkTp1I907nK80CKb L5JXBape28dJ+beKlyPk+J1EU8X9qcIXd7wWRs5Cs1EiqRdprWH7ORWfdDrniA6R5jA+ gswfYQyWipwxAvoUhD4XoP+VkPgTUangdjWk7yR3+NfTrmVqYco7aFX4nMSsznYYk/CZ QUR+FtdCuRimTo30+eTa/pXZj6YNoWQCc4XYLhEPOsUXEScHPhCHjIklI1qYCSuIpo5f K+xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=48Hedow0BXpSNrsaNUzhMGQIqlyB74bm8VJ6k5TzL84=; b=jHHK5VcH56rWj9afrjoY0l4I84oKnSBctbDkDWBPzDnFYQ3+u+o7H2rr8zrhLw1pFg oiQfeJrQJoLI793DbiRl/62CxSqfkzm3gD/RRUSMnOGo00F9a7wbajMdMO3C1wkELGpF zm93GDp9WPueUXY7byQFGpdx7kj55nnSEhOZJNYPZl5/MEuDYFsVIGpP6tzqWbXfpyXT Hdx0Ki85XqMYbpK0Big/DPOFJSZT9F4s2ilOLCjmZLC4KoBleGf/eRJjIW/Ls1ANiwSG UUan8qtN5ftVTlSmc6bukTkHc2pu6DlBnVnkuZ3oFW+62Qxr9w2H14Keh4xtT9auMitM QvZA== X-Gm-Message-State: AMCzsaUSgACxl5kaD7AkPjEaHfYmgBZXUwo8FB8nirP0kG457qOkFTlc 9RDdpoufsngaSAxEoHe5ZNzMOQ== X-Google-Smtp-Source: AOwi7QA0OxyRh/DCi7I2hVvl6OQcKALHiR33R5m+STgv1ozEimYydC3xSPqp5ueWQDxan6eMrzsTlw== X-Received: by 10.80.143.98 with SMTP id 89mr9242783edy.273.1508071716402; Sun, 15 Oct 2017 05:48:36 -0700 (PDT) Received: from [10.0.38.219] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id m8sm3749671edl.74.2017.10.15.05.48.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Oct 2017 05:48:35 -0700 (PDT) To: Akhil Goyal , dev@dpdk.org Cc: declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, hemant.agrawal@nxp.com, radu.nicolau@intel.com, borisp@mellanox.com, aviadye@mellanox.com, thomas@monjalon.net, sandeep.malik@nxp.com, jerin.jacob@caviumnetworks.com, john.mcnamara@intel.com, konstantin.ananyev@intel.com, shahafs@mellanox.com, olivier.matz@6wind.com References: <20171006181151.4758-1-akhil.goyal@nxp.com> <20171014221734.15511-1-akhil.goyal@nxp.com> <20171014221734.15511-5-akhil.goyal@nxp.com> From: Aviad Yehezkel Message-ID: <4cccbfa2-1170-6d02-c2d1-c442cb6a9170@dev.mellanox.co.il> Date: Sun, 15 Oct 2017 15:48:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171014221734.15511-5-akhil.goyal@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [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: Sun, 15 Oct 2017 12:48:37 -0000 On 10/15/2017 1:17 AM, Akhil Goyal wrote: > 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_ */ Tested-by: Aviad Yehezkel