From patchwork Thu Aug 9 12:00:07 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: 143827 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2006115ljj; Thu, 9 Aug 2018 05:03:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxhoJqhnCyC3UHhtWxUopNPwuP3XO2YIKpbyPV8wANjBsg72O1faqCgGSPV0uO1cCKG+xIr X-Received: by 2002:ac8:4402:: with SMTP id j2-v6mr1637582qtn.233.1533816188433; Thu, 09 Aug 2018 05:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533816188; cv=none; d=google.com; s=arc-20160816; b=lwKfXsxMe+fgAtGsSKK7CWjLCfnm8Zkkgo6W9pF6CSgEIlnujVGu2SHQB8cgDQFVUz tkTAuGQkswGC2eVACPzrGB//30q8/UziD09IcpXbeWcYqh9eMPyqVQ9AFFTIXS/OJddh NZPELmPJz8gYF3mNy47NQ3WW8T34OJWWyEUAyHaruXO+i36QSDBl4d+nnKudyU4G3Uwk UwOp70Rvc8458qYoGoW7zsDmUBg7PUx8rWt0Wg02/xzjvoKEH6bsj4r4oLbmP9rQanOU r29bKV4HNcNVfkEfQoDRkn+hSExc+uy/ByrB717nw4Uo83eeXYUjAirzvkaLqldkc1ga Vajw== 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=NibIqNsrCogjHAbvQFnBjXzrHLfNRFX/VatpIk9Zb5c=; b=ed8unIomPROgbC+eIr4bRTyp+NE0hmsxOyqPuxKIrVm61jSbFwUEzG4ZEjHrDl8hSB 7QmvkOQXzTkGG5C9uuKXRw4jaUaq8TKusfSlHM7FhWSo/dkgYSwVJRD5ERbqHxTvXRjk LGZTF7gfMdVdIs2gyD60aIr1OaB/FO5Y2wtc5XY4otLYSnCGUCk2tOJ926/vnJKBVJ+H i6328wCFY4K7BVguEhiR+BWEkJIJT48zuk6RTyJhK3QvenoON5D3kugdZdl/6zp/CjqX xGEcFVZFn8Yn2K9yqz/LtJCnWXXEmBSvX2K15ckixiyp8eBmh4lGjmD/uLCCQ6Qg9rDl qBvw== 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 p1-v6si1049353qvn.128.2018.08.09.05.03.08; Thu, 09 Aug 2018 05:03:08 -0700 (PDT) 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 1D9ED68617; Thu, 9 Aug 2018 12:03:08 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, 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 7043B6861A; Thu, 9 Aug 2018 12:01:34 +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 610B668605; Thu, 9 Aug 2018 12:01:19 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 055CB68626 for ; Thu, 9 Aug 2018 12:00:13 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 0523B1343F71 for ; Thu, 9 Aug 2018 15:00:11 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QvKQqlwP8k-0AtWVAPT; Thu, 09 Aug 2018 15:00:10 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id M6ygb3U54b-0Av8FHPH; Thu, 09 Aug 2018 15:00:10 +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, 9 Aug 2018 12:00:07 +0000 Message-Id: <1533816007-30726-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> References: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 669 Subject: [lng-odp] [PATCH API-NEXT v1 3/3] validation: packet: add packet subtype tests 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 Check that packet subtype is correct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 669 (psavol:next-packet-subtype) ** https://github.com/Linaro/odp/pull/669 ** Patch: https://github.com/Linaro/odp/pull/669.patch ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85 ** Merge commit sha: 3a6201b601ab55e07cbfd561fa9904ba48035478 **/ .../validation/api/crypto/odp_crypto_test_inp.c | 2 ++ test/validation/api/ipsec/ipsec.c | 17 +++++++++++++++-- test/validation/api/packet/packet.c | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 07f1d1fac..5b395c2a6 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -225,6 +225,7 @@ static int alg_packet_op(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO); rc = odp_crypto_result(&result, pkt); if (rc < 0) { @@ -298,6 +299,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO); rc = odp_crypto_result(&result, pkt); if (rc < 0) { diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 31a6f9b53..be47d109b 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -502,6 +502,7 @@ static int ipsec_send_in_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_in_enq(&pkt, 1, ¶m)); @@ -517,6 +518,8 @@ static int ipsec_send_in_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { odp_queue_t queue; @@ -555,7 +558,10 @@ static int ipsec_send_in_one(const ipsec_test_part *part, subtype); CU_ASSERT(!part->out[i].status.error.sa_lookup); - pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } @@ -586,6 +592,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == + ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_out_enq(&pkt, 1, ¶m)); @@ -601,6 +609,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { struct odp_ipsec_out_inline_param_t inline_param; @@ -657,7 +667,10 @@ static int ipsec_send_out_one(const ipsec_test_part *part, subtype); CU_ASSERT(part->out[i].status.error.all); - pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index a564c0028..fa7ce8b82 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -319,6 +319,7 @@ static void packet_test_alloc_free(void) CU_ASSERT(odp_event_types(odp_packet_to_event(packet), &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet) == ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet) != odp_packet_to_u64(ODP_PACKET_INVALID)); @@ -402,6 +403,8 @@ static void packet_test_alloc_free_multi(void) &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet[i]) == + ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet[i]) != odp_packet_to_u64(ODP_PACKET_INVALID));