From patchwork Tue Mar 14 13:55:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 95298 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1546756obz; Tue, 14 Mar 2017 06:55:27 -0700 (PDT) X-Received: by 10.36.28.134 with SMTP id c128mr15470222itc.49.1489499727752; Tue, 14 Mar 2017 06:55:27 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 99si14207229iok.16.2017.03.14.06.55.26; Tue, 14 Mar 2017 06:55:27 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C5E29609BA; Tue, 14 Mar 2017 13:55:26 +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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED 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 1C16B60665; Tue, 14 Mar 2017 13:55:22 +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 BF8FE60668; Tue, 14 Mar 2017 13:55:19 +0000 (UTC) Received: from mail-ot0-f181.google.com (mail-ot0-f181.google.com [74.125.82.181]) by lists.linaro.org (Postfix) with ESMTPS id A2B9160654 for ; Tue, 14 Mar 2017 13:55:17 +0000 (UTC) Received: by mail-ot0-f181.google.com with SMTP id o24so135979745otb.1 for ; Tue, 14 Mar 2017 06:55:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4RN1rFO9s9iBmbabcOlwCDUIEAc2dxqlUSYO7YuBOKY=; b=W7Twx4VgrtFN7HzmnDI3Fz0ueU+ALNhfkJepwFQODVBNdPauxaxQ05U796MC4juYZf St4o8lvb7Vr0qcTryUteLDLJlXRKH1yVG8c3o06JKQawd8eptiGyKyXYq3XiFoSh1GCN UixViA/gHpd6BdBZB+9zfmh6fIs1nkGlB6K1kEDNRs+UzyyyS9kgzcvoUk1+Z3RT4D6u NK6okDZgQ9i6s+sv8KBq9jyiZkr/3rAKkytr7WFGSyLLC+TLle/0EBzCkFULUasiC0kZ jFKiabj3nOweqQXfp5SDRR6IXWdpz1K4VjDdXlybVzvYJCsOdxdXqA85zBY9Rb+Tao9q E2qg== X-Gm-Message-State: AMke39kFKEo8Rj44orm0C81p4iRbVRU9flfi34f3Idg0hefxTOvSfG+0jc+qAJeO28rAguypCxg= X-Received: by 10.157.7.225 with SMTP id 88mr19135152oto.122.1489499717085; Tue, 14 Mar 2017 06:55:17 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id q81sm9272490oia.14.2017.03.14.06.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 06:55:16 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 14 Mar 2017 08:55:12 -0500 Message-Id: <20170314135512.6485-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.12.0.rc1 Subject: [lng-odp] [PATCHv2] validation: packet: do not require a max packet length 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" Address bug https://bugs.linaro.org/show_bug.cgi?id=2908 by adding appropriate pool capability checks to the packet and crypto tests to account for pkt.max_len, pkt.max_seg_len, or pkt.max_segs_per_pkt being zero, indicating these limits are bound only by available memory. Signed-off-by: Bill Fischofer --- test/common_plat/validation/api/crypto/crypto.c | 6 ++++-- test/common_plat/validation/api/packet/packet.c | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) -- 2.12.0.rc1 Reviewed-by: Balakrishna Garapati diff --git a/test/common_plat/validation/api/crypto/crypto.c b/test/common_plat/validation/api/crypto/crypto.c index e7c2bf32..94beb2f1 100644 --- a/test/common_plat/validation/api/crypto/crypto.c +++ b/test/common_plat/validation/api/crypto/crypto.c @@ -48,12 +48,14 @@ int crypto_init(odp_instance_t *inst) params.pkt.num = PKT_POOL_NUM; params.type = ODP_POOL_PACKET; - if (PKT_POOL_LEN > pool_capa.pkt.max_seg_len) { + if (pool_capa.pkt.max_seg_len && + PKT_POOL_LEN > pool_capa.pkt.max_seg_len) { fprintf(stderr, "Warning: small packet segment length\n"); params.pkt.seg_len = pool_capa.pkt.max_seg_len; } - if (PKT_POOL_LEN > pool_capa.pkt.max_len) { + if (pool_capa.pkt.max_len && + PKT_POOL_LEN > pool_capa.pkt.max_len) { fprintf(stderr, "Pool max packet length too small\n"); return -1; } diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c index 900c4263..669122a7 100644 --- a/test/common_plat/validation/api/packet/packet.c +++ b/test/common_plat/validation/api/packet/packet.c @@ -114,6 +114,8 @@ int packet_suite_init(void) printf("pool_capability failed\n"); return -1; } + if (capa.pkt.max_segs_per_pkt == 0) + capa.pkt.max_segs_per_pkt = 10; /* Pick a typical packet size and decrement it to the single segment * limit if needed (min_seg_len maybe equal to max_len @@ -366,6 +368,8 @@ void packet_test_alloc_segmented(void) int ret, i, num_alloc; CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); + if (capa.pkt.max_segs_per_pkt == 0) + capa.pkt.max_segs_per_pkt = 10; if (capa.pkt.max_len) max_len = capa.pkt.max_len; @@ -1847,6 +1851,9 @@ void packet_test_extend_ref(void) { odp_packet_t max_pkt, ref; uint32_t hr, tr, max_len; + odp_pool_capability_t capa; + + CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); max_pkt = odp_packet_copy(segmented_test_packet, odp_packet_pool(segmented_test_packet)); @@ -1860,8 +1867,10 @@ void packet_test_extend_ref(void) odp_packet_push_tail(max_pkt, tr); /* Max packet should not be extendable at either end */ - CU_ASSERT(odp_packet_extend_tail(&max_pkt, 1, NULL, NULL) < 0); - CU_ASSERT(odp_packet_extend_head(&max_pkt, 1, NULL, NULL) < 0); + if (max_len == capa.pkt.max_len) { + CU_ASSERT(odp_packet_extend_tail(&max_pkt, 1, NULL, NULL) < 0); + CU_ASSERT(odp_packet_extend_head(&max_pkt, 1, NULL, NULL) < 0); + } /* See if we can trunc and extend anyway */ CU_ASSERT(odp_packet_trunc_tail(&max_pkt, hr + tr + 1,