From patchwork Mon Aug 20 10: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: 144557 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3766605ljj; Mon, 20 Aug 2018 03:01:28 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz3kZkMzGYkPaZwTR4JBeq4mnU4Jy6/3s1avdhY2SXDqK0KBgGf2aa/nhhUapGa6GrzT4zu X-Received: by 2002:a0c:f7d2:: with SMTP id f18-v6mr40180221qvo.175.1534759288650; Mon, 20 Aug 2018 03:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534759288; cv=none; d=google.com; s=arc-20160816; b=bBPWz8fcP0fnjbl9N5pSMHCNBgvRC21kAExY6Z9gSZe/V7Nvs/aqQix0My0s8WqMx3 Yup4EdNCtEiEozAG8UQnxqSIaLTWiFEVA2rOoAFISLhFyKe0JEEGtzE8UHWJHz0fsOjP 6KT5X1Dx/wJ31aHbel5nbNSvTFh88kYc9zKV5tYg2To7KoclXthKZN7dt2Cmma/c5atE sNaC3y2rjMrfL9T+onioU7tgKlAubQIoCJ4/OJnk746Qk9apvGK0iCJTeCSSZ+eocMfk 9KvRys5i1AETJlpyimQCGfuoOfLMDam+4b3cOvbtGLFFErlez03QUqhdC8cvtjOfMYxR Nvgg== 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=bopDw/y524t9mb4/oyY3kKP4hdQ1Vx0f9960mKnUbrU=; b=fUd+S8FgyQj1/sav6UD3o5znkuRU11vNWGyhS/IhPb6kOZHztYWAdAVDPuoM+WKOSs U4qlnVMih3jKR6OxZEZpQY/x7NZTRnA2UCZwXbW8UdITxaokPjEalR2STut3CXEkCqD7 MEy8wcNjtaiy1V1so8ZTX1FX0iAH2DEE6cECxIGZOI4/ebRzjnXDRa2wBdnSc7Wk1GSC Exh/RHyCAquD/jnCrrueE9VqJ31DUrTg1W6YkuSomlDmrmJio9LtB78q7Xp5wlQJE4eN F3z5Wat3o3kXlmldY5+OcGZ6I5NzX578FVzBeDlKv8Eo2q6OgDGeaUSa4hQsWTyVmDdv IIDw== 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 h6-v6si697015qke.235.2018.08.20.03.01.28; Mon, 20 Aug 2018 03:01:28 -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 4DB5A685F8; Mon, 20 Aug 2018 10:01:28 +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 48FDF685FE; Mon, 20 Aug 2018 10:00: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 69A54685E0; Mon, 20 Aug 2018 10:00:27 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id CC8D16095C for ; Mon, 20 Aug 2018 10:00:20 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward103p.mail.yandex.net (Yandex) with ESMTP id A53002183B02 for ; Mon, 20 Aug 2018 13:00:18 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id wtwBp2cqXN-0IjicQkr; Mon, 20 Aug 2018 13:00:18 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mI7U2yzlYn-0HPGS4xZ; Mon, 20 Aug 2018 13:00:17 +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: Mon, 20 Aug 2018 10:00:07 +0000 Message-Id: <1534759208-15203-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534759208-15203-1-git-send-email-odpbot@yandex.ru> References: <1534759208-15203-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 672 Subject: [lng-odp] [PATCH API-NEXT v3 3/4] validation: packet: add num_pkt parameter to parse_test_alloc 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 It's more robust to use a parameter instead of assuming that a fixed number of packets are allocated. Signed-off-by: Petri Savolainen --- /** Email created from pull request 672 (psavol:next-packet-metadata) ** https://github.com/Linaro/odp/pull/672 ** Patch: https://github.com/Linaro/odp/pull/672.patch ** Base sha: 2722279b31b075586551801eb2860687ff966ea8 ** Merge commit sha: e76448d8a8f2575ab3a4c445be84d19f055cbf2d **/ test/validation/api/packet/packet.c | 47 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index fa7ce8b82..280e5c829 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2561,10 +2561,9 @@ static int packet_parse_suite_term(void) } static void parse_test_alloc(odp_packet_t pkt[], const uint8_t test_packet[], - uint32_t len) + uint32_t len, int num_pkt) { int ret, i; - int num_pkt = PARSE_TEST_NUM_PKT; ret = odp_packet_alloc_multi(parse_test.pool, len, pkt, num_pkt); CU_ASSERT_FATAL(ret == num_pkt); @@ -2585,7 +2584,7 @@ static void parse_eth_ipv4_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_udp, - sizeof(test_packet_ipv4_udp)); + sizeof(test_packet_ipv4_udp), num_pkt); for (i = 0; i < num_pkt; i++) { chksum_status = odp_packet_l3_chksum_status(pkt[i]); @@ -2629,7 +2628,7 @@ static void parse_ipv4_udp(void) uint32_t offset[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_udp, - sizeof(test_packet_ipv4_udp)); + sizeof(test_packet_ipv4_udp), num_pkt); for (i = 0; i < num_pkt; i++) offset[i] = 14; @@ -2665,7 +2664,7 @@ static void parse_eth_ipv4_tcp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_tcp, - sizeof(test_packet_ipv4_tcp)); + sizeof(test_packet_ipv4_tcp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2701,7 +2700,7 @@ static void parse_eth_ipv6_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv6_udp, - sizeof(test_packet_ipv6_udp)); + sizeof(test_packet_ipv6_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2731,7 +2730,7 @@ static void parse_eth_ipv6_tcp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv6_tcp, - sizeof(test_packet_ipv6_tcp)); + sizeof(test_packet_ipv6_tcp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_ALL; @@ -2761,7 +2760,7 @@ static void parse_eth_vlan_ipv4_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_vlan_ipv4_udp, - sizeof(test_packet_vlan_ipv4_udp)); + sizeof(test_packet_vlan_ipv4_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2792,7 +2791,7 @@ static void parse_eth_vlan_ipv6_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_vlan_ipv6_udp, - sizeof(test_packet_vlan_ipv6_udp)); + sizeof(test_packet_vlan_ipv6_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2829,7 +2828,7 @@ static void parse_eth_vlan_qinq_ipv4_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_vlan_qinq_ipv4_udp, - sizeof(test_packet_vlan_qinq_ipv4_udp)); + sizeof(test_packet_vlan_qinq_ipv4_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2861,7 +2860,7 @@ static void parse_eth_arp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_arp, - sizeof(test_packet_arp)); + sizeof(test_packet_arp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2893,7 +2892,7 @@ static void parse_eth_ipv4_icmp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_icmp, - sizeof(test_packet_ipv4_icmp)); + sizeof(test_packet_ipv4_icmp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2924,7 +2923,7 @@ static void parse_eth_ipv6_icmp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv6_icmp, - sizeof(test_packet_ipv6_icmp)); + sizeof(test_packet_ipv6_icmp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2955,7 +2954,7 @@ static void parse_eth_ipv4_sctp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_sctp, - sizeof(test_packet_ipv4_sctp)); + sizeof(test_packet_ipv4_sctp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -2986,7 +2985,7 @@ static void parse_eth_ipv4_ipsec_ah(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_ipsec_ah, - sizeof(test_packet_ipv4_ipsec_ah)); + sizeof(test_packet_ipv4_ipsec_ah), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3017,7 +3016,7 @@ static void parse_eth_ipv4_ipsec_esp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_ipsec_esp, - sizeof(test_packet_ipv4_ipsec_esp)); + sizeof(test_packet_ipv4_ipsec_esp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3048,7 +3047,7 @@ static void parse_eth_ipv6_ipsec_ah(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv6_ipsec_ah, - sizeof(test_packet_ipv6_ipsec_ah)); + sizeof(test_packet_ipv6_ipsec_ah), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3085,7 +3084,7 @@ static void parse_eth_ipv6_ipsec_esp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv6_ipsec_esp, - sizeof(test_packet_ipv6_ipsec_esp)); + sizeof(test_packet_ipv6_ipsec_esp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3116,7 +3115,7 @@ static void parse_mcast_eth_ipv4_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_mcast_eth_ipv4_udp, - sizeof(test_packet_mcast_eth_ipv4_udp)); + sizeof(test_packet_mcast_eth_ipv4_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3150,7 +3149,7 @@ static void parse_bcast_eth_ipv4_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_bcast_eth_ipv4_udp, - sizeof(test_packet_bcast_eth_ipv4_udp)); + sizeof(test_packet_bcast_eth_ipv4_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3185,7 +3184,7 @@ static void parse_mcast_eth_ipv6_udp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_mcast_eth_ipv6_udp, - sizeof(test_packet_mcast_eth_ipv6_udp)); + sizeof(test_packet_mcast_eth_ipv6_udp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3219,7 +3218,7 @@ static void parse_eth_ipv4_udp_first_frag(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_udp_first_frag, - sizeof(test_packet_ipv4_udp_first_frag)); + sizeof(test_packet_ipv4_udp_first_frag), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3251,7 +3250,7 @@ static void parse_eth_ipv4_udp_last_frag(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_udp_last_frag, - sizeof(test_packet_ipv4_udp_last_frag)); + sizeof(test_packet_ipv4_udp_last_frag), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4; @@ -3283,7 +3282,7 @@ static void parse_eth_ipv4_rr_nop_icmp(void) odp_packet_t pkt[num_pkt]; parse_test_alloc(pkt, test_packet_ipv4_rr_nop_icmp, - sizeof(test_packet_ipv4_rr_nop_icmp)); + sizeof(test_packet_ipv4_rr_nop_icmp), num_pkt); parse.proto = ODP_PROTO_ETH; parse.last_layer = ODP_PROTO_LAYER_L4;