From patchwork Thu Mar 23 21:56:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 95922 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp958304qgd; Thu, 23 Mar 2017 14:57:06 -0700 (PDT) X-Received: by 10.200.38.218 with SMTP id 26mr5080857qtp.53.1490306226442; Thu, 23 Mar 2017 14:57:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id n89si146229qte.325.2017.03.23.14.57.05; Thu, 23 Mar 2017 14:57:06 -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 A003762FA9; Thu, 23 Mar 2017 21:57:05 +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 8235962D8B; Thu, 23 Mar 2017 21:57:00 +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 6AD9E62DAA; Thu, 23 Mar 2017 21:56:57 +0000 (UTC) Received: from mail-ot0-f182.google.com (mail-ot0-f182.google.com [74.125.82.182]) by lists.linaro.org (Postfix) with ESMTPS id 3799C62D50 for ; Thu, 23 Mar 2017 21:56:55 +0000 (UTC) Received: by mail-ot0-f182.google.com with SMTP id y88so41345991ota.2 for ; Thu, 23 Mar 2017 14:56:55 -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=DIqga/cIggjdQKNLFn1SywHeigu1OemVvntQkzT77bg=; b=dPRElPuXcJhEbhWBP6X5SGwrgvgrLMlB3jtWDbNQSL2ZMgYeaE2Hah+epjTK+RD/4a 5uKmOQmkNRS3OPOpiHgw0tKDohiqO8G3LWG1SJ1KISvY2MJEeP9/q+3hox9UfNUA70gT gIrDoOw3uQPLNQoYUHGyEVgBi9qNvR5kkOAf2co+ZU7Lznwox/dR0/cJBWlozNnddhe2 nkt8e8u/bNQHGlOuYFm1jCyg3MMMDMyvJCpfF++M0Se7Mead9NDU2ifTVp+HrsQOjoUY XwmSHbVVmv0t9Un9j8gJi0Wv56IsFpE+qzm1wM7xXsKXsDRt11IbkAiBm8AJRUJpMs1N rkMQ== X-Gm-Message-State: AFeK/H1q9F2PivknwuLvU6Ivdr250q13QasTYv5REy2D1v18lM7LsjvotEV18bYdDZX0I/rKicc= X-Received: by 10.157.9.197 with SMTP id 5mr2899955otz.178.1490306214636; Thu, 23 Mar 2017 14:56:54 -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 k205sm178758oih.0.2017.03.23.14.56.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Mar 2017 14:56:53 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 23 Mar 2017 16:56:50 -0500 Message-Id: <20170323215650.616-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [lng-odp] [PATCHv3] 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, pktio, 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 +++++++++++-- test/common_plat/validation/api/pktio/pktio.c | 11 +++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) -- 2.9.3 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 e7c2bf3..94beb2f 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 900c426..669122a 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, diff --git a/test/common_plat/validation/api/pktio/pktio.c b/test/common_plat/validation/api/pktio/pktio.c index 4f3c0c0..54f206e 100644 --- a/test/common_plat/validation/api/pktio/pktio.c +++ b/test/common_plat/validation/api/pktio/pktio.c @@ -124,7 +124,7 @@ static void set_pool_len(odp_pool_param_t *params, odp_pool_capability_t *capa) { uint32_t seg_len; - seg_len = capa->pkt.max_seg_len; + seg_len = capa->pkt.max_seg_len ? capa->pkt.max_seg_len : PKT_BUF_SIZE; switch (pool_segmentation) { case PKT_POOL_SEGMENTED: @@ -620,7 +620,8 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b, CU_ASSERT_FATAL(odp_pool_capability(&pool_capa) == 0); - if (packet_len > pool_capa.pkt.max_len) + if (pool_capa.pkt.max_len && + packet_len > pool_capa.pkt.max_len) packet_len = pool_capa.pkt.max_len; } @@ -1689,7 +1690,8 @@ int pktio_check_send_failure(void) odp_pktio_close(pktio_tx); /* Failure test supports only single segment */ - if (pool_capa.pkt.max_seg_len < mtu + 32) + if (pool_capa.pkt.max_seg_len && + pool_capa.pkt.max_seg_len < mtu + 32) return ODP_TEST_INACTIVE; return ODP_TEST_ACTIVE; @@ -1728,7 +1730,8 @@ void pktio_test_send_failure(void) CU_ASSERT_FATAL(odp_pool_capability(&pool_capa) == 0); - if (pool_capa.pkt.max_seg_len < mtu + 32) { + if (pool_capa.pkt.max_seg_len && + pool_capa.pkt.max_seg_len < mtu + 32) { CU_FAIL("Max packet seg length is too small."); return; }