From patchwork Wed Jan 31 15:00:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126360 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp811465ljc; Wed, 31 Jan 2018 07:03:54 -0800 (PST) X-Google-Smtp-Source: AH8x2249SWUpzGknvPwxnb+W4uYjg430KzaZnHTWDWQWXi+j7IhoWveK9AEJV7ikJ+eL8w5DpdAK X-Received: by 10.129.109.143 with SMTP id i137mr22604498ywc.462.1517411034451; Wed, 31 Jan 2018 07:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411034; cv=none; d=google.com; s=arc-20160816; b=YxIelLES/JJN0u1lj+gdzhZY4HHmatEHmJnBRl6DM/XRaolrVLUXBFMjvEioVMZ89O c1wqIb9tg+HNGul7F7atrkjs7eGcv0+Co+VJnv9DpH14Odx1IOiDk99FOaOQm3b2JPmq BHF64C6i6kiYdGqMAHaJatimFIuKRLtEykMT9IviC2+jzpUIfxt31XioCH4Bo8BjCyh9 Rvv74shIGgy4/1Tc+bgpaljP/JQLNrVe48R8ZLfq7bKjEJ1kLJAlGA8QSZrRqRMRUfo1 c8FngY4iJihI9KKB6t06cQmRu3lEiiUdre/G3lL2LHWqfCidadBVqJKcvw+BAVAav7I8 OcsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=J4CkQ2TuxbAbGaA0LXr10T2bvWdI7wkTfO6YXFExURo=; b=J6pYB5rS6lBzmpWZpgNF1UgFkM+nv4mPW7uNnGwhtCUnB/wjy5wm4iMtT/EIc6KZS6 u9B+hgNOL+uOjcdFl2C7jdTMqjQnDl+Yo1Qi/NJtO4nC3W/BCBtEpZYxTLAj95XJgM+V 7/z9yRVszW/zQL0iRSKb8rHL8BP7FabdceuIt+UOqgC+Pwd1eQF5HzV/8l5EP4TBjass bs81VSYDu47zw/WAS1L12bnl0WE5j8LdyOLG1ta7rDuRbbU80oOwfBAV/yOigdZRUYT6 msdL/2oyAaHYe6KmNtqdl2sAjWkFtSmX9r7UnINm4mQQm0k5Fd6Bpkv3XlmQF306v/p7 SJTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p31si2603893qtf.369.2018.01.31.07.03.54; Wed, 31 Jan 2018 07:03:54 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 27F3C6175B; Wed, 31 Jan 2018 15:03:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 752B160C4C; Wed, 31 Jan 2018 15:00:54 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4A46B60974; Wed, 31 Jan 2018 15:00:33 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id D35796063C for ; Wed, 31 Jan 2018 15:00:22 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward102j.mail.yandex.net (Yandex) with ESMTP id C717A5601902 for ; Wed, 31 Jan 2018 18:00:20 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id N7L2pTrIXz-0KZeFfTi; Wed, 31 Jan 2018 18:00:20 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0KhCJeAR; Wed, 31 Jan 2018 18:00:20 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:13 +0300 Message-Id: <1517410819-24732-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 1/7] api: packet: add protocol type enumeration X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Add enumerations for L3 and L4 protocol types, and functions to request those. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/abi-default/packet.h | 28 +++++++ include/odp/api/spec/packet.h | 95 ++++++++++++++++++++++ .../linux-generic/include-abi/odp/api/abi/packet.h | 28 +++++++ 3 files changed, 151 insertions(+) diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h index 3d6876731..b83288d4c 100644 --- a/include/odp/api/abi-default/packet.h +++ b/include/odp/api/abi-default/packet.h @@ -30,6 +30,34 @@ typedef _odp_abi_packet_seg_t *odp_packet_seg_t; #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)0xffffffff) #define ODP_PACKET_OFFSET_INVALID 0xffff +typedef uint8_t odp_proto_l3_type_t; + +#define ODP_PROTO_L3_TYPE_NONE 0 +#define ODP_PROTO_L3_TYPE_ARP 1 +#define ODP_PROTO_L3_TYPE_RARP 2 +#define ODP_PROTO_L3_TYPE_MPLS 3 +#define ODP_PROTO_L3_TYPE_IPV4 4 +#define ODP_PROTO_L3_TYPE_IPV6 6 + +typedef uint8_t odp_proto_l4_type_t; + +/* Numbers from IANA Assigned Internet Protocol Numbers list */ +#define ODP_PROTO_L4_TYPE_NONE 0 +#define ODP_PROTO_L4_TYPE_ICMPV4 1 +#define ODP_PROTO_L4_TYPE_IGMP 2 +#define ODP_PROTO_L4_TYPE_IPV4 4 +#define ODP_PROTO_L4_TYPE_TCP 6 +#define ODP_PROTO_L4_TYPE_UDP 17 +#define ODP_PROTO_L4_TYPE_IPV6 41 +#define ODP_PROTO_L4_TYPE_GRE 47 +#define ODP_PROTO_L4_TYPE_ESP 50 +#define ODP_PROTO_L4_TYPE_AH 51 +#define ODP_PROTO_L4_TYPE_ICMPV6 58 +#define ODP_PROTO_L4_TYPE_NO_NEXT 59 +#define ODP_PROTO_L4_TYPE_IPCOMP 108 +#define ODP_PROTO_L4_TYPE_SCTP 132 +#define ODP_PROTO_L4_TYPE_ROHC 142 + typedef enum { ODP_PACKET_GREEN = 0, ODP_PACKET_YELLOW = 1, diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 3222ff5c2..4be515c7b 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -71,6 +71,79 @@ extern "C" { * Packet is red */ +/** + * @typedef odp_proto_l3_type_t + * Layer 3 protocol type + */ + +/** + * @def ODP_PROTO_L3_TYPE_NONE + * Layer 3 protocol type not defined + * + * @def ODP_PROTO_L3_TYPE_ARP + * Layer 3 protocol is ARP + * + * @def ODP_PROTO_L3_TYPE_RARP + * Layer 3 protocol is RARP + * + * @def ODP_PROTO_L3_TYPE_MPLS + * Layer 3 protocol is MPLS + * + * @def ODP_PROTO_L3_TYPE_IPV4 + * Layer 3 protocol type is IPv4 + * + * @def ODP_PROTO_L3_TYPE_IPV6 + * Layer 3 protocol type is IPv6 + */ + +/** + * @def ODP_PROTO_L4_TYPE_NONE + * Layer 4 protocol type not defined + * + * @def ODP_PROTO_L4_TYPE_ICMPV4 + * Layer 4 protocol type is ICMPv4 + * + * @def ODP_PROTO_L4_TYPE_IGMP + * Layer 4 protocol type is IGMP + * + * @def ODP_PROTO_L4_TYPE_IPV4 + * Layer 4 protocol type is IPv4 + * + * @def ODP_PROTO_L4_TYPE_TCP + * Layer 4 protocol type is TCP + * + * @def ODP_PROTO_L4_TYPE_UDP + * Layer 4 protocol type is UDP + * + * @def ODP_PROTO_L4_TYPE_IPV6 + * Layer 4 protocol type is IPv6 + * + * @def ODP_PROTO_L4_TYPE_GRE + * Layer 4 protocol type is GRE + * + * @def ODP_PROTO_L4_TYPE_ESP + * Layer 4 protocol type is IPSEC ESP + * + * @def ODP_PROTO_L4_TYPE_AH + * Layer 4 protocol type is IPSEC AH + * + * @def ODP_PROTO_L4_TYPE_ICMPV6 + * Layer 4 protocol type is ICMPv6 + * + * @def ODP_PROTO_L4_TYPE_NO_NEXT + * Layer 4 protocol type is "No Next Header". + * Protocol / next header number is 59. + * + * @def ODP_PROTO_L4_TYPE_IPCOMP + * Layer 4 protocol type is IP Payload Compression Protocol + * + * @def ODP_PROTO_L4_TYPE_SCTP + * Layer 4 protocol type is SCTP + * + * @def ODP_PROTO_L4_TYPE_ROHC + * Layer 4 protocol type is ROHC + */ + /** * Protocol */ @@ -1542,6 +1615,28 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt); */ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); +/** + * Layer 3 protocol type + * + * Returns layer 3 protocol type. Initial type value is ODP_PROTO_L3_TYPE_NONE. + * + * @param pkt Packet handle + * + * @return Layer 3 protocol type + */ +odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt); + +/** + * Layer 4 protocol type + * + * Returns layer 4 protocol type. Initial type value is ODP_PROTO_L4_TYPE_NONE. + * + * @param pkt Packet handle + * + * @return Layer 4 protocol type + */ +odp_proto_l4_type_t odp_packet_l4_type(odp_packet_t pkt); + /** * Layer 3 checksum check status * diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet.h b/platform/linux-generic/include-abi/odp/api/abi/packet.h index 1aa7cbd58..137cd3ec4 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet.h @@ -47,6 +47,34 @@ static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint8_t ndx) #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1) +typedef uint8_t odp_proto_l3_type_t; + +#define ODP_PROTO_L3_TYPE_NONE 0 +#define ODP_PROTO_L3_TYPE_ARP 1 +#define ODP_PROTO_L3_TYPE_RARP 2 +#define ODP_PROTO_L3_TYPE_MPLS 3 +#define ODP_PROTO_L3_TYPE_IPV4 4 +#define ODP_PROTO_L3_TYPE_IPV6 6 + +typedef uint8_t odp_proto_l4_type_t; + +/* Numbers from IANA Assigned Internet Protocol Numbers list */ +#define ODP_PROTO_L4_TYPE_NONE 0 +#define ODP_PROTO_L4_TYPE_ICMPV4 1 +#define ODP_PROTO_L4_TYPE_IGMP 2 +#define ODP_PROTO_L4_TYPE_IPV4 4 +#define ODP_PROTO_L4_TYPE_TCP 6 +#define ODP_PROTO_L4_TYPE_UDP 17 +#define ODP_PROTO_L4_TYPE_IPV6 41 +#define ODP_PROTO_L4_TYPE_GRE 47 +#define ODP_PROTO_L4_TYPE_ESP 50 +#define ODP_PROTO_L4_TYPE_AH 51 +#define ODP_PROTO_L4_TYPE_ICMPV6 58 +#define ODP_PROTO_L4_TYPE_NO_NEXT 59 +#define ODP_PROTO_L4_TYPE_IPCOMP 108 +#define ODP_PROTO_L4_TYPE_SCTP 132 +#define ODP_PROTO_L4_TYPE_ROHC 142 + typedef enum { ODP_PACKET_GREEN = 0, ODP_PACKET_YELLOW = 1, From patchwork Wed Jan 31 15:00:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126358 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp809179ljc; Wed, 31 Jan 2018 07:01:45 -0800 (PST) X-Google-Smtp-Source: AH8x226L8EQr9Vd3r1638IHS1othPb5N28gMCoLIjTD+F4hPCKdJz+0SNgaetkC/Qs3CRbjt1ULh X-Received: by 10.200.43.193 with SMTP id n1mr51273004qtn.20.1517410905617; Wed, 31 Jan 2018 07:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517410905; cv=none; d=google.com; s=arc-20160816; b=R7mg7OHgXP3918ExqNggyUnTiIJM2qFeTHUo/t5KJ5LUtBbv8eDxXcniNTyxNDykGa m/XhWtxlTHl4eSDt6W+c5wjd9GzoblrLpKLHCPCooYYtkk6EVwBXSlI6JYnGAMqGA9m2 zVoICouIFP7CEIBdOQA4YdGbQgbLWV61jEodWfVuponndemwkn1Kq6Tnfx2arFZrduCZ fbrvWFD5c53jimXUQtLuur+gxqoIwMHeMqkQ/X9GKv81ci4YK43YP1Eyju8lJGGxdTU6 SS2mzJomItUwZQWreYN7Tj9EFwaq7Iyk/N3I1LUgZePc7Zok6ICnOha37EqCTYObIZiy pH+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=cvcN6cXipgj+4wGXXMaxdUQpxzHo6nMVXwsf38JqxYg=; b=atc7b60NLW7Oah3nqb7ysonFhEOAEwjN1p5eioHPmyvzE5IUJVsZFodVNr5JdX/WkO Q3DodkKXpU8c8ASCQ3Y4v+zDpyGemP4Hi0+eaMAVbTb/nXqqtQmgJKB8/rG9KN3bbws5 N/aoF4EZ/FvnLPTSBTGRvaA+GWuuVI7ArNWQ+hZqNiyR83qUJ3uCVzjIft0bUuss0CGm /sN6nrZvdAMnq4k4tcPqMST9ZsBQ7W2I4aDj6JAXvF9Bw3iHAiMcItcSsP328e5pqbTK oyDN/ZCnjf9KHL2frGv56dpRneH7krkZXDVyHLhTqM/rSMwW5D86l34ZKKoQsw2+X8uq 8RIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id o56si4892289qto.84.2018.01.31.07.01.45; Wed, 31 Jan 2018 07:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 4908B6172A; Wed, 31 Jan 2018 15:01:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E3CC36081B; Wed, 31 Jan 2018 15:00:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 57D21608E6; Wed, 31 Jan 2018 15:00:29 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id D5A67607C9 for ; Wed, 31 Jan 2018 15:00:22 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 460375A03CDF for ; Wed, 31 Jan 2018 18:00:21 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dSsaWCvAzU-0LjK60Mj; Wed, 31 Jan 2018 18:00:21 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0Kh0rlrl; Wed, 31 Jan 2018 18:00:20 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:14 +0300 Message-Id: <1517410819-24732-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 2/7] api: ipsec: IP header parameter types X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Create IP header parameter types, so that those can be used also outside of SA parameter struct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 47e3045f3..c78afbe3f 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -382,6 +382,44 @@ typedef struct odp_ipsec_crypto_param_t { } odp_ipsec_crypto_param_t; +/** IPv4 header parameters */ +typedef struct odp_ipsec_ipv4_param_t { + /** IPv4 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv4 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv4 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv4 Don't Fragment bit */ + uint8_t df; + + /** IPv4 Time To Live */ + uint8_t ttl; + +} odp_ipsec_ipv4_param_t; + +/** IPv6 header parameters */ +typedef struct odp_ipsec_ipv6_param_t { + /** IPv6 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv6 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv6 flow label */ + uint32_t flabel; + + /** IPv6 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv6 hop limit */ + uint8_t hlimit; + +} odp_ipsec_ipv6_param_t; + /** * IPSEC tunnel parameters * @@ -397,40 +435,10 @@ typedef struct odp_ipsec_tunnel_param_t { /** Variant mappings for tunnel parameters */ union { /** IPv4 header parameters */ - struct { - /** IPv4 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv4 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv4 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv4 Don't Fragment bit */ - uint8_t df; - - /** IPv4 Time To Live */ - uint8_t ttl; - } ipv4; + odp_ipsec_ipv4_param_t ipv4; /** IPv6 header parameters */ - struct { - /** IPv6 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv6 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv6 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv6 flow label */ - uint32_t flabel; - - /** IPv6 hop limit */ - uint8_t hlimit; - } ipv6; + odp_ipsec_ipv6_param_t ipv6; }; } odp_ipsec_tunnel_param_t; From patchwork Wed Jan 31 15:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126359 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp810395ljc; Wed, 31 Jan 2018 07:02:47 -0800 (PST) X-Google-Smtp-Source: AH8x2255SebWhmt0GIoH5RrbJinhejjknLabC1LszNsgmhLYFFzcUUvtJCgXOlSqzK0GLusacehC X-Received: by 10.55.21.168 with SMTP id 40mr5074439qkv.171.1517410967499; Wed, 31 Jan 2018 07:02:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517410967; cv=none; d=google.com; s=arc-20160816; b=siDFMgIlAVxTyNTDdIEtAaXGVw4np6tcuklAfkeidst6BoDmwodw4tQ+8VkNAUHOuU qMeuuW972rHXJFea+P9zDhW1D3x6WVBfgPTb0SJ8G63s2o6TbfPlqf/jlm0eBcXlwPkX dbmVcZXAuMILljS8hNGpebsNNL5RnYv20RUSvnOuHuOemrH4Ck3nLjCg9tRQXewqbxKE sicFit4H9biJF7x5nwcEolKwxSt6u/kuFwWgpRaQbNV7I8S5Rcb1ItVerYOa5cMWtKJY Kb7IblimBnxl4yf3SMzueXpX9zHeTegIzFX7MlJe1QlR/UtxquIG1bGlv231kdBj2XkK G7CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=Plv7JkMW67OWy0BWIv0NEl8tCUHBOEWYcum/0FVQw9A=; b=BzvPzlJRAbK2XdY9atgHNjP6P7aSEX24kOwE9r28kAideUDbltv/96HMXU7ooRVREM UAWpSh19bM7tIXAJyQOVaMsIqf1OLxvKeqOyTT69/hNeBhQUnDQxZZHMtFg1Ox7uMLqb vfIgVtCXJTta/KL81DJ0+de4pLLl9px4apMF7TevErnr8B90NKfcsSIX4ySl7mJbzpd0 9+Oxe5Q5DzaDs0OH22Szm9y1MFoVNGVa0UMFDmm8dgXVw0UBZ6zbakNaItUmWGdN3dLZ L1kqRFTkzAKJL0OnRk/UTacQzM4J31338+HM4Z8y5CF4wKGV1nIPrC9OOqePhau6xVlP KulA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t1si1532162qkh.262.2018.01.31.07.02.47; Wed, 31 Jan 2018 07:02:47 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 065FE61756; Wed, 31 Jan 2018 15:02:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2A12660919; Wed, 31 Jan 2018 15:00:46 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id ACBFC608E6; Wed, 31 Jan 2018 15:00:31 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id A0EEE600CD for ; Wed, 31 Jan 2018 15:00:23 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward105p.mail.yandex.net (Yandex) with ESMTP id E2B4440831CA for ; Wed, 31 Jan 2018 18:00:21 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SVsw6cEVfT-0Ljir2Cx; Wed, 31 Jan 2018 18:00:21 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0LhK9pnC; Wed, 31 Jan 2018 18:00:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:15 +0300 Message-Id: <1517410819-24732-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 3/7] api: ipsec: rename fragmentation mode option X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Rename outbound operation fragmentation options to frag_mode. Frag_mode is used elsewhere in the API and "mode" is too generic term for it (not future proof). Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 2 +- platform/linux-generic/odp_ipsec.c | 2 +- test/validation/api/ipsec/ipsec_test_out.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index c78afbe3f..1060a3ee2 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -984,7 +984,7 @@ typedef struct odp_ipsec_op_flag_t { */ typedef struct odp_ipsec_out_opt_t { /** Fragmentation mode */ - odp_ipsec_frag_mode_t mode; + odp_ipsec_frag_mode_t frag_mode; } odp_ipsec_out_opt_t; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index b6192377e..9f08b228c 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1306,7 +1306,7 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, ipsec_sa = _odp_ipsec_sa_use(sa); ODP_ASSERT(NULL != ipsec_sa); - if ((opt && opt->mode == ODP_IPSEC_FRAG_CHECK) || + if ((opt && opt->frag_mode == ODP_IPSEC_FRAG_CHECK) || (!opt && ipsec_sa->out.frag_mode == ODP_IPSEC_FRAG_CHECK)) mtu = ipsec_sa->out.mtu; else diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c index 971fbbf8d..4940efa5a 100644 --- a/test/validation/api/ipsec/ipsec_test_out.c +++ b/test/validation/api/ipsec/ipsec_test_out.c @@ -530,7 +530,7 @@ static void test_out_ipv4_ah_sha256_frag_check(void) ipsec_test_part test2 = { .pkt_in = &pkt_ipv4_icmp_0, .num_opt = 1, - .opt = { .mode = ODP_IPSEC_FRAG_DISABLED, }, + .opt = { .frag_mode = ODP_IPSEC_FRAG_DISABLED, }, .out_pkt = 1, .out = { { .status.warn.all = 0, @@ -623,7 +623,7 @@ static void test_out_ipv4_esp_null_sha256_frag_check(void) ipsec_test_part test2 = { .pkt_in = &pkt_ipv4_icmp_0, .num_opt = 1, - .opt = { .mode = ODP_IPSEC_FRAG_DISABLED, }, + .opt = { .frag_mode = ODP_IPSEC_FRAG_DISABLED, }, .out_pkt = 1, .out = { { .status.warn.all = 0, From patchwork Wed Jan 31 15:00:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126362 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp813490ljc; Wed, 31 Jan 2018 07:05:59 -0800 (PST) X-Google-Smtp-Source: AH8x2249n3vWdQe3yFT+H8g2umyRioJogTlNnYHcI7z7u8sYC0M5nKR+e374xWxm3sjSZmp5iKVB X-Received: by 10.37.134.209 with SMTP id y17mr568266ybm.47.1517411159614; Wed, 31 Jan 2018 07:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411159; cv=none; d=google.com; s=arc-20160816; b=qDMqcLzP78eqT3/Fr2go3gOPQRtKJHvb3mepPlB7sPPHAdKtY9hY9hFtAI0u/tSj7Q bN/4JbFQAtwlP7nMU79ye7k0H2tomw4ZXjo1CqT1lV7AXJ/sb9a4TI/n1EgOx+cm61Po FfvR5YInkMGOF/8qkU8U3AiQZzabIek+F6uCDSRPmAWy9wsoUNefiuIWdGfNnK8xb6AC qH44P1cGuqc0MtwH5A6kQaeppq4AnoTb8kRc8UbgTk4L1Mtfvy6TXE1Tamxqe3Z8y51/ lDD84817lFb2ahbm103QASdgtDpP3X6EVtKo3pIogCPEJOLSLXWVMxA0XVODcyEyWJ3S y8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5XY2EvCru9q70SaqoF0wPl8lV5eDCAJDs3YFrp3Fo4M=; b=1G0smIoUJK8xnFDpHgFhZ35akoXNrmtNquHLJXhtNqkfbFoTc04MXBgtGHd3a54DZC ZDqvYAxBkGUWqSXbpLdJ8CTCUED+CXkSXWASlSXBQmm4poNGXHTtpCAW2ulZKaf6atuX F1GvzHOBBPoaF/rYHRZKkW5FOo1SdK5rgAMnljJg51J99VogsUgqmG7B9kLAptBB923O wW6mp5hMvzrvs8l7BKECF+HJuDiLhdvi0+37uh/u8S0VB4MTyswVRgXrJlMek4vsNrgS ejeTrVyTWbT2co1hFnFtWmWzue9lIQeV45omELKz111rzfxqtMewOOyTRZVmBONohqHl mj6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id g65si2307754qkb.52.2018.01.31.07.05.59; Wed, 31 Jan 2018 07:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2D76261735; Wed, 31 Jan 2018 15:05:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E23A76151C; Wed, 31 Jan 2018 15:01:01 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 969BB6083D; Wed, 31 Jan 2018 15:00:36 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id D9F736081B for ; Wed, 31 Jan 2018 15:00:23 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 7A96118475A for ; Wed, 31 Jan 2018 18:00:22 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n64U4POxXe-0MEGMJEk; Wed, 31 Jan 2018 18:00:22 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0LhikCxo; Wed, 31 Jan 2018 18:00:21 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:16 +0300 Message-Id: <1517410819-24732-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 4/7] api: ipsec: outbound operation option flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Add flags to select which options application uses. Currently, there's no ambiguity, but as soon as there are multiple options implementation needs to know which options are used and which are ignored. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 1060a3ee2..08533d80d 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -983,6 +983,20 @@ typedef struct odp_ipsec_op_flag_t { * These may be used to override some SA level options */ typedef struct odp_ipsec_out_opt_t { + /** Union of all flag bits */ + union { + /** Option flags. Set flag for those options that are + * used, all other options are ignored. */ + struct { + /** Use fragmentation mode option */ + uint32_t frag_mode: 1; + + } flag; + + /** All flag bits */ + uint32_t all_flags; + }; + /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; From patchwork Wed Jan 31 15:00:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126361 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp812493ljc; Wed, 31 Jan 2018 07:04:56 -0800 (PST) X-Google-Smtp-Source: AH8x225lrJgMD+yGpUrtZMdRz+kmr0NjI/E/nYavX4bOrU0pD2ZQd+sGkqiuixnZFFm+zCQIms+B X-Received: by 10.200.41.220 with SMTP id 28mr28033885qtt.159.1517411096221; Wed, 31 Jan 2018 07:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411096; cv=none; d=google.com; s=arc-20160816; b=Ls9gOx7TdasW+hTLO7VSdxjJm8gvz/g0a3omrlLVheq0TW8aD+0Znv1j65btvZnlhr A+vYqb9LHOLFuutRRFXPOBC2BQTevB036Uf9f8e0Rhz8VjU7+Gun89iSZ314px3zQn+I tj69akMWz7/ZM6pDMwnIS/iNyQratuXTdNA1HkDtH3I11O6PxDRrNhzJM2KhsGHzADOO iqLy7yPXI+ed/bP5/4ovWYe3XSkOsGHij7n3HQrjMRBGozEq65p0VrPMSJ5VtmtAlxOK 27L4mnzX4vqpldSzuKnaiMVSE6PeY9P0ucvD6/aRP0HGh6A3Fs9JYHonA5/WXZDU99Ti tY1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=fu+p7gS7cX5CVAS4l0KNcyjf8FwL6GeYQWX2niuWvr8=; b=wG9j+uk2BNtR4tSds6oej6gipaMsLAXAQilPgXNee29zFbSb7mI1RegUvvjFP72pbA /o6fTcMGuQEmiHlJGytrLYTqM7kH6Yyl2ZB0X4Ni14f+vW5vgQT05UPwKATDv4hu7sV0 AS95blSgvSjC2XS8oNlxBB2l29Og6HFLjfsB4vAcipVIyKUnfsa0+6pbkfzZzy3Xw3rX Bem4vmHVm0bhW6LnIEfWupSUl9Do2zTlZIqzTFho0oJYEKK8qOnkF+jw3phEvfs7tnf7 n3q+nvc+RQBH+yIYC0ZMyd/7cOuIRNtPaDFXCUSte6pR229zSYDLg/xX1TOYbj6zkGnB VsCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id j128si2434066qkf.377.2018.01.31.07.04.55; Wed, 31 Jan 2018 07:04:56 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id D05256174D; Wed, 31 Jan 2018 15:04:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A14776150B; Wed, 31 Jan 2018 15:01:00 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6055960956; Wed, 31 Jan 2018 15:00:36 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 3D00D6083D for ; Wed, 31 Jan 2018 15:00:24 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 19DF14083290 for ; Wed, 31 Jan 2018 18:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id wGBloTGP1O-0M9iuI6c; Wed, 31 Jan 2018 18:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0Mhm6hFW; Wed, 31 Jan 2018 18:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:17 +0300 Message-Id: <1517410819-24732-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 5/7] api: ipsec: inbound TFC padding and dummy packets X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Specify how application can recognize TFC padding and dummy packets at input. Packet metadata for L3/L4 protocol type indicate if the original packet was an IP or a TFC dummy packet. When packet length is larger than protocol fields indicate, some TFC padding remain in the packet. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 08533d80d..721f96856 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1226,12 +1226,23 @@ typedef struct odp_ipsec_status_t { * e.g. RFC 4302 and 4303). Resulting packets are well formed, reconstructed * original IP packets, with IPSEC headers removed and valid header field values * restored. The amount and content of packet data before the IP header is - * undefined. + * undefined. Some amount of TFC padding may follow the IP packet payload, + * in which case packet length is larger than protocol headers indicate. + * TFC dummy packets have l3_type set to ODP_PROTO_L3_TYPE_NONE in tunnel mode + * or l4_type set to ODP_PROTO_L4_TYPE_NO_NEXT in transport mode. Dummy + * packets contain implementation specific amount of (dummy) data. Furthermore, + * inline IPSEC processing may drop dummy packets. * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): - * - L3 offset: Offset to the first byte of the (outmost) IP header + * - l3_offset: Offset to the first byte of the original IP packet. The value + * is implementation specific for tunnel mode TFC dummy packets. + * - l3_type: Specifies if the original packet is IPv4 or IPv6. For tunnel + * mode TFC dummy packets set to ODP_PROTO_L3_TYPE_NONE. + * - l4_type: Always set to ODP_PROTO_L4_TYPE_NO_NEXT for transport mode dummy + * packets. Otherwise, depends on parse configuration. Default + * value is ODP_PROTO_L4_TYPE_NONE. * - pktio: For inline IPSEC processed packets, original packet input * interface * From patchwork Wed Jan 31 15:00:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126365 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp815427ljc; Wed, 31 Jan 2018 07:07:48 -0800 (PST) X-Google-Smtp-Source: AH8x227rWStTQgxyahmwPaijOs7f329SmF1jfPzhcXsq4PVOUGJ4S4jeyLsfTDG2/WgXw0YCZbz5 X-Received: by 10.55.144.198 with SMTP id s189mr48547147qkd.168.1517411268056; Wed, 31 Jan 2018 07:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411268; cv=none; d=google.com; s=arc-20160816; b=eVGvHuaGNxg2nPe71iKq7Ye6e7izthz/pfpbChXzd0B8McxSxgRhu+MUl9zDHvBp/s cw0xNMDUqFudkSmQJyW9YA90mozJmmtHjf7gK/V/BoeZYXnUj8UTUyOKToc6rT5LaI2M vCbh4tQkShhbq08m10lAvKYDJMXSZdpRFmATWARfFS8rRIllJIN1v943BFn7m9cl1Y2/ j8Y4Ece6gWbbIoiNqROSzwvdx/KXxZRU8QUqlkHi4Wx+zHOE36PO2vQ5IhygNWfD9uU6 O5Zikvs44LU5YKcWstbz7Mo7I9iN9ws/wZ59+EBcUg+OK587iubFFNqJwoQiBX51iRqn YK/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=rFeGFQVYBLnyaIiurFm/mutsz5PqnGEoIUaaIIT7z6M=; b=hguHbnNSAzly1OV8tPZzzJQPF+QNfsqWlLdAc8o4asiqVxZOlcLpyqIyLznCUB/eNy Wszb+0YvJSLOWvRTlduFrPsaHTV729Nj9m+ojYdO2nvPlKqPGKML8b1iyInl5Ltq04Bl GQ84q1cBBNEOH4TMdJ2tG+OmaYOoKK3glJ4Gh51fSZKONMnU70bDO4EHv6tUTBCQw2q7 2fh9omfyE+HgDkZ7rkibRxfq7VmhCQSz0zkVoq5ExDtinsevM5WSy7UPGOW4vuFNawFk H7uy3CktKvg1RPxGI+jGEdGJ2MS1Dz4BuECS0HSyoKN5fEWmo/vz81erO4SvlSMe4mRn OXqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id f67si1443019qkj.94.2018.01.31.07.07.47; Wed, 31 Jan 2018 07:07:48 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B860B616D9; Wed, 31 Jan 2018 15:07:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8A6DE61731; Wed, 31 Jan 2018 15:01:08 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 611366083D; Wed, 31 Jan 2018 15:00:38 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 2F11B60855 for ; Wed, 31 Jan 2018 15:00:25 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward100j.mail.yandex.net (Yandex) with ESMTP id BE80D5D846EE for ; Wed, 31 Jan 2018 18:00:23 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dxAzAhERqp-0NeuvRFi; Wed, 31 Jan 2018 18:00:23 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0Nhm5nTQ; Wed, 31 Jan 2018 18:00:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:18 +0300 Message-Id: <1517410819-24732-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 6/7] api: ipsec: outbound TFC padding and dummy packets X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Specify how application can request TFC padding and dummy packet creation at output. Application can use odp_ipsec_out_opt_t options to reguest addition of TFC padding, or creation of a TFC dummy packet (next header = 59). IP parameter override options are needed for tunnel mode dummy packet creation as there's no IP header to copy e.g. DSCP or flow label values to tunnel IP header. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 721f96856..665dc07bc 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -991,6 +991,22 @@ typedef struct odp_ipsec_out_opt_t { /** Use fragmentation mode option */ uint32_t frag_mode: 1; + /** Use TFC padding length option */ + uint32_t tfc_pad: 1; + + /** Tunnel mode TFC dummy packet. This can be used only + * in tunnel mode. When the flag is set, packet length + * and content is ignored and instead a TFC dummy + * packet is created during IPSEC operation. The dummy + * packet length is defined by 'tfc_pad_len' option. + * If the SA is configured to copy IP header fields + * from inner IP packet, those fields must be passed + * with IP parameters option. */ + uint32_t tfc_dummy: 1; + + /** Use IP parameters option */ + uint32_t ip_param: 1; + } flag; /** All flag bits */ @@ -1000,6 +1016,26 @@ typedef struct odp_ipsec_out_opt_t { /** Fragmentation mode */ odp_ipsec_frag_mode_t frag_mode; + /** TFC padding length + * + * Number of TFC padding bytes added to the packet during IPSEC + * processing. Resulting packet should not exceed the maximum packet + * length of the pool, otherwise IPSEC operation may fail. + * Implementation guarantees that the padding does not contain any + * confidential information. */ + uint32_t tfc_pad_len; + + /** Union of IP parameters */ + union { + /** Override IPv4 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv4_param_t ipv4; + + /** Override IPv6 parameters in outer header creation. + * IP addresses are ignored. */ + odp_ipsec_ipv6_param_t ipv6; + }; + } odp_ipsec_out_opt_t; /** @@ -1302,7 +1338,13 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, * The operation does packet transformation according to IPSEC standards (see * e.g. RFC 4302 and 4303). Resulting packets are well formed IP packets * with IPSEC, etc headers constructed according to the standards. The amount - * and content of packet data before the IP header is undefined. + * and content of packet data before the IP header is undefined. Use outbound + * operation parameters to specify the amount of TFC padding appended to + * the packet during IPSEC transformation. Options can be used also to create + * TFC dummy packets. Packet data content is ignored in tunnel mode TFC dummy + * packet creation as tfc_pad_len option defines solely the packet length. + * In all other cases, payload length for the IPSEC transformation is specified + * by odp_packet_len() minus odp_packet_l3_offset() plus tfc_pad_len option. * * Each successfully transformed packet has a valid value for these metadata: * - L3 offset: Offset to the first byte of the (outmost) IP header From patchwork Wed Jan 31 15:00:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126363 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp814392ljc; Wed, 31 Jan 2018 07:06:50 -0800 (PST) X-Google-Smtp-Source: AH8x226hJr4vB25ohzLvQ/JkB1fJN0tw8FJ23E4kbTVf1yvejIJIQCKVUID108vjOnwoegfsv/MP X-Received: by 10.55.76.133 with SMTP id z127mr4196000qka.318.1517411209872; Wed, 31 Jan 2018 07:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517411209; cv=none; d=google.com; s=arc-20160816; b=x91RNRxUMEFx7YYtL0RhDrCdbBn4lMRLvkYGPH5BpdQYxuWG+uO+KhStdBRreXRWV/ R2BXFCjKULH8EGA0ZM5z6horfF3TNWKCeoqES+356eQKt4OIE/VMq9Fxk/bUAGjBJMQY iQSQgk2ZuDnQf/H/g0hJJjPqivlYHghEM5W6JreNHHdGaLZ9D74Ps1qEy/fr1mYHVMfH xo1uhwD3ttmY29cKHxmSM+kYkLJ8UpnJ6VUxh5jht39rBw3cHHW/Okl5u5nF4kSk+rRE 2RFYg+dpS55IgdINxob9V6Jd9x77Wz4Vc78CNnLYVY6PDz8QuVCXTed3nBP0FO3X28Li 3fRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=2w0CzDkSpGQ0KSCFoXZJLSoefbsgajyk9KdRI1XX2c8=; b=i+AgsrA7M0ehl2v6BkmKRWAo/qC5okCMohwSYSvlwr+4f00kMubZVQkj36/PE9SeS2 hWJIVoAYN/qFO3d6rB5hfgPS29lc+kdP1cSTTyokzPPrgDQM2qQlz1ttoacIwq4S1DDX Ebrqa9z5WqkWsBNL1KZDVzfiTiZywXiGALi+ccjKt4EU7UKvdw01qJoE4wPqfBgQyIgO 4RolwnFJbpFLSLtT87lW+UT+qNAlzhdSamStSM1nYkUcSpmvWlknzKmHq/6Ts43PgOdT TLZG+wb9FGdDyAC67z0KQmGcHIY6IkzWonUinKBU9AAkHMvQ3zY7/05V82YyCczuVjKv zRiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id j32si3352542qtb.277.2018.01.31.07.06.49; Wed, 31 Jan 2018 07:06:49 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 7523160946; Wed, 31 Jan 2018 15:06:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 612B061705; Wed, 31 Jan 2018 15:01:04 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2AAD66081B; Wed, 31 Jan 2018 15:00:37 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 6049960872 for ; Wed, 31 Jan 2018 15:00:26 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 68AB651056E2 for ; Wed, 31 Jan 2018 18:00:24 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GhNMlZAyV6-0OwWT6FH; Wed, 31 Jan 2018 18:00:24 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p8qYWNiSK1-0NhKekSJ; Wed, 31 Jan 2018 18:00:23 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 18:00:19 +0300 Message-Id: <1517410819-24732-8-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> References: <1517410819-24732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v5 7/7] api: ipsec: inbound inner packet checksum capability X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Add inbound inner packet checksum check capability. When e.g. L4 checksum checking is not implemented in HW, it may be better to leave checking for application, as it would check only those packets that need the check. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: a8d85f63d9e1de7ba709e84b37a06e3482bdea1d **/ include/odp/api/spec/ipsec.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 665dc07bc..2d1c4d9ba 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -238,6 +238,11 @@ typedef struct odp_ipsec_capability_t { */ odp_support_t retain_header; + /** + * Inner packet checksum check offload support in inbound direction. + */ + odp_proto_chksums_t chksums_in; + /** Maximum number of different destination CoSes in classification * pipelining. The same CoS may be used for many SAs. This is equal or * less than 'max_cos' capability in classifier API.