From patchwork Thu Mar 1 16:59:58 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: 130341 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3043955edc; Thu, 1 Mar 2018 09:01:56 -0800 (PST) X-Google-Smtp-Source: AG47ELtgbxF6A7+fXCmR0BWc0Lbkkxc7H18cXj4hcpDTyOHlMeHFtk83fHUC6Iqtds8HAZrw6Jhx X-Received: by 10.55.36.132 with SMTP id k4mr3719483qkk.68.1519923716108; Thu, 01 Mar 2018 09:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519923716; cv=none; d=google.com; s=arc-20160816; b=XJJJVNHYdvn3HFxQ0CM9nZ+VHmdJWRUoZWV03Md9Vk6e4nzu6olTCysNru6Ytvelz2 yqzlr15HRgpX+L0an/Wy7/2G/Q2HAw/cqEQGwJMGL510JqwAaF9p5me6yE23oymGaNgR y6nPsao5gvrjiAStLNWu52u8S9RlB1zjqCx5zufZDVzcC/xVgIjD5gVp6GiPnM3+pqY5 3jZjIWNHaKGncT6NO4KZk5XtDw/4GjYnmKXs/clIuvA5jpoxIwLMlpH7GkRxeVtyymF2 15KAKBwevQluJ5DW7HfkUrYEIk2Ub3KPnAmA/tMuKja0EVDIIKmyia7K4VXjOjke8z7Y HJrQ== 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=4O9H17OnCH0wX+r5V4Qyw8mZdaepv+ja4t4Kr8GBb10=; b=VHMuU5tfx0/V64LKAnJz+q9vLFDijCyhEVIO4vrxpeqgna8r5opx7BhU/3GrXTtlw7 +czsoNj22tGYFvlqHcLYVJLNv1H4WSIATKhYGEH0JajHIennQthYjyF963QeNDmPvs4a u5HbVkfQYns5ZX9/5WrEqkDlfsrdEuWeKK9X9KfJ7RsaRMmgNbG3YjsfxMw7GzLm6mgs y370n5i5O5Sz7UeO+PfVJgPaScUCQ30dnYLOaNBjPhM+vUwuemsj2nvlhLcOUHfBt7E3 78yFi5UoDEpnfR++VtbVEBoBle/CEyg4i/vl1RXrsHy6XnHtgkeDH553EDIVTGQdLjhZ JnaA== 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 o39si4792106qtf.24.2018.03.01.09.01.55; Thu, 01 Mar 2018 09:01: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 B97E0617E0; Thu, 1 Mar 2018 17:01: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 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 3EFC560802; Thu, 1 Mar 2018 17:00:40 +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 32A5361777; Thu, 1 Mar 2018 17:00:21 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id BD02561777 for ; Thu, 1 Mar 2018 17:00:15 +0000 (UTC) Received: from mxback15g.mail.yandex.net (mxback15g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:94]) by forward103j.mail.yandex.net (Yandex) with ESMTP id C224E34C41A0 for ; Thu, 1 Mar 2018 20:00:13 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback15g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bh0xFJxQlk-0Dl8SdZn; Thu, 01 Mar 2018 20:00:13 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7MkXJ9JJAA-0CCCD5BZ; Thu, 01 Mar 2018 20: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: Thu, 1 Mar 2018 19:59:58 +0300 Message-Id: <1519923609-31634-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> References: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 505 Subject: [lng-odp] [PATCH v1 2/13] validation: api: check l3/l4 proto types after parsing 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 Signed-off-by: Dmitry Eremin-Solenikov Reviewed-by: Petri Savolainen Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 505 (muvarov:devel/master_merge_api-next) ** https://github.com/Linaro/odp/pull/505 ** Patch: https://github.com/Linaro/odp/pull/505.patch ** Base sha: 284f52d72ec19df3774c7409780f1f9eea33b8e6 ** Merge commit sha: e8f50fefcd57a92e0971dc1172c5402c56b8370a **/ test/validation/api/packet/packet.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 03449f26e..2ed801640 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2605,6 +2605,10 @@ static void parse_eth_ipv4_udp(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -2638,6 +2642,10 @@ static void parse_ipv4_udp(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -2668,6 +2676,10 @@ static void parse_eth_ipv4_tcp(void) CU_ASSERT(odp_packet_has_tcp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv6(pkt[i])); CU_ASSERT(!odp_packet_has_udp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV4); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_TCP); } odp_packet_free_multi(pkt, num_pkt); @@ -2790,6 +2802,10 @@ static void parse_eth_vlan_ipv6_udp(void) CU_ASSERT(odp_packet_has_udp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv4(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_UDP); } odp_packet_free_multi(pkt, num_pkt); @@ -3040,6 +3056,10 @@ static void parse_eth_ipv6_ipsec_ah(void) CU_ASSERT(!odp_packet_has_ipv4(pkt[i])); CU_ASSERT(!odp_packet_has_tcp(pkt[i])); CU_ASSERT(!odp_packet_has_udp(pkt[i])); + CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]), + ODP_PROTO_L3_TYPE_IPV6); + CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]), + ODP_PROTO_L4_TYPE_TCP); } odp_packet_free_multi(pkt, num_pkt);