From patchwork Fri Aug 10 13:00:06 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: 143919 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3327262ljj; Fri, 10 Aug 2018 06:00:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzpqSN7ZV6KHy0aKNFEBhbf3lZqu2S0FjykdUc3kQk4a3DIMkfGsBcy6lzPHb+7sr4UYnUe X-Received: by 2002:a37:4fcd:: with SMTP id d196-v6mr5708942qkb.323.1533906054867; Fri, 10 Aug 2018 06:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533906054; cv=none; d=google.com; s=arc-20160816; b=juHmB1H85mcgjNkFiD10ePzlRkLvoyqsXwPHVX/3jnXsfqJ7kp8a+IgOe5NlSwKWeo hEdXRg2IRbq2bPVFY1AdICtq9CYtd0knPIeaT+OwoJ9I29iBV+y9q6wCnsqLWbZi4uts 6sUczwzj83+VkorOpvq1sL0SoM4CmwAHF9Y/R8TEd8r0O1JqLmodT1AxydmDuNfdoAO0 GMUDN6PLfytJg8S/W3BXGktC3sSRQyTxLrFPwaOnEQrkJeC4WiQZbxzvYzXcoi99XQ/E qs+/1ucpD8ylNaI8u7Jag3VguFXyL3/cizenqqFu4M6mRKWV04Ulw/79J7GCmlokKMQk ZP6g== 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=V4iDrSyoNn9AIMQirw8E+StVk7EAvg5Fevy36ycAQ8s=; b=yYMwmzB/3pp5A4EJmH8J4cyTEK4QMNn8K7/x8z/uFRI4O+ueKyeZven9XeFY6KtOa/ 5l48CCY0btLhfTY0fK3gFxo7FT6pIlLXqeqSGIpqZQ0ImjUmdiifddnG3aPRPI0j7AEX mOccY82tHUv5kJMxtuio1Pipw7fX0qNF365+C0I7QAx56zcp+1UK2JjvBgREgKcXW9um v/OeEUvqwCXP4GPhP6V5nqCz+eYabyi5puiXi7/YfsRY607yZECdtzYWqrJJDthdt2V3 RvjZTkQk5yvdQKdhHr1zKDBWU4fMX3UovtzsRrKYzrtUOfeGWIyR+/0ASYD6vScpso2u +Duw== 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 g5-v6si7990316qvb.255.2018.08.10.06.00.54; Fri, 10 Aug 2018 06:00:54 -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 7702E60840; Fri, 10 Aug 2018 13:00:54 +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 C24A5606A6; Fri, 10 Aug 2018 13:00:47 +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 90A9C60828; Fri, 10 Aug 2018 13:00:42 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 8220A607C8 for ; Fri, 10 Aug 2018 13:00:19 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106j.mail.yandex.net (Yandex) with ESMTP id ED2E8180840B for ; Fri, 10 Aug 2018 16:00:17 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ld7eTa4qxq-0HvmoZwm; Fri, 10 Aug 2018 16:00:17 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Vb4aj3S9kE-0HiCLBXH; Fri, 10 Aug 2018 16: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: Fri, 10 Aug 2018 13:00:06 +0000 Message-Id: <1533906007-732-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533906007-732-1-git-send-email-odpbot@yandex.ru> References: <1533906007-732-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 672 Subject: [lng-odp] [PATCH API-NEXT v1 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: 9b2b5a9695ad66977c964c83691cd2fef4c45b85 ** Merge commit sha: 2f50c6c282fb183ddbc4628815da441de53deea0 **/ 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 a564c0028..4594260cf 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2558,10 +2558,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); @@ -2582,7 +2581,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]); @@ -2626,7 +2625,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; @@ -2662,7 +2661,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; @@ -2698,7 +2697,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; @@ -2728,7 +2727,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; @@ -2758,7 +2757,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; @@ -2789,7 +2788,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; @@ -2826,7 +2825,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; @@ -2858,7 +2857,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; @@ -2890,7 +2889,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; @@ -2921,7 +2920,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; @@ -2952,7 +2951,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; @@ -2983,7 +2982,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; @@ -3014,7 +3013,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; @@ -3045,7 +3044,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; @@ -3082,7 +3081,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; @@ -3113,7 +3112,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; @@ -3147,7 +3146,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; @@ -3182,7 +3181,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; @@ -3216,7 +3215,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; @@ -3248,7 +3247,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; @@ -3280,7 +3279,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;