From patchwork Wed Feb 7 10:59:59 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: 127148 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp357482ljc; Wed, 7 Feb 2018 03:05:01 -0800 (PST) X-Google-Smtp-Source: AH8x224Izov2peouo417YNCjhpSXRpeCk5WIQsJsYA15kDj6Jc+02Ye6gUB/vQTwG0AXyPbGLwv/ X-Received: by 10.200.16.11 with SMTP id z11mr8299725qti.292.1518001501634; Wed, 07 Feb 2018 03:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001501; cv=none; d=google.com; s=arc-20160816; b=tlWPs2+Bfa0V86CfIZGE4jtj7aOq2jCkE2IxA5uy895ofX08dCHBMxm6rvaTtBAxup x2toBL6SGdjTI8VXyQN13fVnuJw9pij3CCW6BVw4fsOXA4NkI2CStLZJu6iyk2j/Pmae u3WNbEuLJ1iKlbv4xiYiWgsqs8+67MsuuO20jG3jj4cdrzl54OOvD/Jh63SY+/BqiKC4 x87VhntWKDslvSVo4rf2NN+u5snNBhPp9WcjBlYRznw2R7i6WJibFF3VArrJQ7ZXzGuW gELe+LzW0LHkcK5sUUKBJuSo5wezrHPuZ3e7Dr49mBPnd4R8xJ+bWGUX18J5/pv/+xfc 0kFA== 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=tbqK+6yfuwDZzsH8x5Dh57/539tZntNjSRDSHbmKn+k=; b=bqQ3Jux+vibcy+wcuxnkjJqkoCmqMS7jfspyWAs1plTK7+e9kH0SOdWxjr+aHQxqdh UJEhr9G4OqDcAMSgRXmGSqQ+tnoNuU71fTu2YXA8AI2JEjtwe1uCQdowJG/g5RAYo8Pj 0SjroOH7oniCa9YHqmGw2IbmqNHwE12RsuiKHS8v1r+iSrq3m7ajeVVhDsYyntPHpwv+ RUxvxcx/YRn5yjvyzjiQcwOG6uPVqbdzDKa9hWSgo9NPB2k+c9E/7pcFG2SU1xtZ4mhf jqekgchTwznmVeBw3EyUGC2yzq//4j4eCBa5r34eG8q/X21QYMykmp4xynE6Bo7aqMNu V95w== 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 r7si1203993qtd.178.2018.02.07.03.05.01; Wed, 07 Feb 2018 03:05:01 -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 0339D62778; Wed, 7 Feb 2018 11:05:01 +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 9B2B6619BF; Wed, 7 Feb 2018 11:02:36 +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 84191616D9; Wed, 7 Feb 2018 11:02:25 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 122F6616D9 for ; Wed, 7 Feb 2018 11:01:09 +0000 (UTC) Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 7B13C18254B for ; Wed, 7 Feb 2018 14:01:07 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SpkDeqlYKY-17gCUmDH; Wed, 07 Feb 2018 14:01:07 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-10Vqw8VE; Wed, 07 Feb 2018 14:01:00 +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, 7 Feb 2018 13:59:59 +0300 Message-Id: <1518001208-29529-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 5/14] example: switch to using odp_packet_l3_type_set() 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: Dmitry Eremin-Solenikov Use odp_packet_l3_type_set() instead of calling odp_packet_has_ipv4_set() or odp_packet_has_ipv6_set(). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ example/generator/odp_generator.c | 2 +- example/ipfragreass/odp_ipfragreass_helpers.c | 2 +- example/ipsec/odp_ipsec_stream.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 8ac4dade3..c34457643 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -324,7 +324,7 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool, /* ip */ odp_packet_l3_offset_set(pkt, ODPH_ETHHDR_LEN); - odp_packet_has_ipv4_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN); ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip); ip->src_addr = odp_cpu_to_be_32(args->appl.srcip); diff --git a/example/ipfragreass/odp_ipfragreass_helpers.c b/example/ipfragreass/odp_ipfragreass_helpers.c index e7755f242..7a7960cde 100644 --- a/example/ipfragreass/odp_ipfragreass_helpers.c +++ b/example/ipfragreass/odp_ipfragreass_helpers.c @@ -58,7 +58,7 @@ odp_packet_t pack_udp_ipv4_packet(odp_pool_t pool, odp_u16be_t ip_id, header_len = WORDS_TO_BYTES(header_len_words); assert(header_len >= IP_HDR_LEN_MIN && header_len <= IP_HDR_LEN_MAX); odp_packet_l3_offset_set(result, 0); - odp_packet_has_ipv4_set(result, 1); + odp_packet_l3_type_set(result, ODP_PROTO_L3_TYPE_IPV4); buffer = odp_packet_data(result); header = (odph_ipv4hdr_t *)buffer; ipv4hdr_init(header); diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 7487dddf6..45038211a 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -202,7 +202,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4); /* IPv4 */ - odp_packet_has_ipv4_set(pkt, 1); + odp_packet_l3_type_set(pkt, ODP_PROTO_L3_TYPE_IPV4); ip = (odph_ipv4hdr_t *)data; data += sizeof(*ip);