From patchwork Wed Feb 7 13:00:00 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: 127182 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp460656ljc; Wed, 7 Feb 2018 05:15:10 -0800 (PST) X-Google-Smtp-Source: AH8x226ONct5c3SrpfT5j4SITany9t09o9mzYVrgb/MJyjzWJhkC6MzQ2nGcZpTp+30rdbgYbHXI X-Received: by 10.55.203.157 with SMTP id u29mr8776537qkl.198.1518009310610; Wed, 07 Feb 2018 05:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518009310; cv=none; d=google.com; s=arc-20160816; b=Lmmjb3XPkPZLDXaq8Z5QAbnxwvKVPw6TGXLQbe941BOFsDD6vOyKZ7whw/t4XjDxzR 0qrCRheHEE4h2WO33RtTocX2kaNfq8w38YrLFG7ZPL0qzXw0NJLDYGpO96Ta3wVZ509A KCPTznZsmthP/pBg9s9w7U4zXCw8JCF9yvz41i74rS6lrWD8FG8V8pIbt5fEDsso9wPD p2N1w9BkTkLKuJBpX2cyS6ek7ihbwqJAX3VtU2/w5FKw/nhE3mffMrL8m3OpsoQbIJ6k jd+GRtLk782mFnUEpWVFHJCFppggBJW0zaFDa/SKZ/4/5bSLIBGRp48tdE/FuFCt36JF Zj8A== 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=WxYORQLppgP8kHVqsOXnxK6OndNz7YBKlVrSXTkK3v4=; b=0vonguMp5LtBmRab3TPwUQ04d8p36NME60IlNQujl9WuFNR5L/q4zdcZ+jVBpwGIPA iSmAsn2t5+h4JOFPik2mJfniBBuN3OCmpr30EXRR3hbru4JMq2FYmHGOmuqrbmcCSzii DCqTFQGCoD9yp1d+/r9O2grzIgC+9bpWxjF26g6ncbg0kqsDeVxyEZlREnbLgJLNnqYJ G+Gvdg8T6W1DeoKhVKkCIvT2K6EFjnw2+dF5Hdc9LjsJnS9IjkyR4FV/d4RSlqc9080r +BAHngKIhlG4s52P207rZGaMaLFGnolBBiEMHogrFTjvBVEzAz5c0l361d6FQehWnnbF AdNA== 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 o188si1429163qkc.54.2018.02.07.05.15.10; Wed, 07 Feb 2018 05:15:10 -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 37CA862801; Wed, 7 Feb 2018 13:15:10 +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 C7E87627A2; Wed, 7 Feb 2018 13:02:06 +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 07CB660B0E; Wed, 7 Feb 2018 13:00:44 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 72F09608A9 for ; Wed, 7 Feb 2018 13:00:19 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id E8F9143036D0 for ; Wed, 7 Feb 2018 16:00:12 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MUtQvVOoai-0CDSM8jP; Wed, 07 Feb 2018 16:00:12 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XfrietnG0-0CZCqmj0; Wed, 07 Feb 2018 16:00:12 +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 16:00:00 +0300 Message-Id: <1518008409-31750-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> References: <1518008409-31750-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v3 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: 86fcf3650d33f5dd82712dda131fb8ca66a3bdf8 **/ 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);