From patchwork Mon Jun 27 02:09:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 70887 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp849117qgy; Sun, 26 Jun 2016 19:09:36 -0700 (PDT) X-Received: by 10.55.4.23 with SMTP id 23mr19276258qke.179.1466993376851; Sun, 26 Jun 2016 19:09:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o5si15019020qkd.128.2016.06.26.19.09.36; Sun, 26 Jun 2016 19:09:36 -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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 87FEC68744; Mon, 27 Jun 2016 02:09:36 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 201126873F; Mon, 27 Jun 2016 02:09:11 +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 0BEDA6873B; Mon, 27 Jun 2016 02:09:09 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by lists.linaro.org (Postfix) with ESMTPS id 54A0B68739 for ; Mon, 27 Jun 2016 02:09:08 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id r2so182904825oih.2 for ; Sun, 26 Jun 2016 19:09:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HdLr4IVcjBucp3flw6mo2RovYSN+qNLUP8esgCLN+5M=; b=be+IA2gRWea6QgFkU8qFsDt+HMLv1alVJWapnZeWlWgQ4z8NmKutG+zcsX/9CrauOn MyV7SSgjM95uw9wXsbe2fdgZ+gvFbfpIzNwTGEpRalnCp0pYs9iCO0BAL/nRVYyHZaId fzAUHwmfXpjgk8RJjkyrcDOHYWZFYueG+sZKv51EA0X8bMouurdu7CEoBm6whRXgSiS7 cYPQjqy0wnRoVOCFEbsoxEmAtuBQHPBPq9VvaUDer4hMJjVAb/MgXsZc2uUILB3/9btF qhSUcW4sdHVPy84c9eYE8Z8ZuBnoP7XFIuVZvUmcN9EUATsqkIsGK9Dyedh27nxNBuv1 sHQQ== X-Gm-Message-State: ALyK8tIYqWX0JBqs5KScKF9xCImjuRUCFxu/VKEA5zg0fyJbaac6gAPi7s/uS3ZAIjDdruoXc/k= X-Received: by 10.157.40.57 with SMTP id m54mr10094602otb.152.1466993347794; Sun, 26 Jun 2016 19:09:07 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id o126sm8241595oia.15.2016.06.26.19.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Jun 2016 19:09:07 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 26 Jun 2016 21:09:03 -0500 Message-Id: <1466993343-28996-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466993343-28996-1-git-send-email-bill.fischofer@linaro.org> References: <1466993343-28996-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] validation: queue: use malloc to avoid artificial limits on max_queues 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" odp_queue_capability() returns max_queues which may be more than 64K. Use malloc to allocate an array of queue handles to test the ability to create max_queues to avoid limiting the test to 64K queues. Signed-off-by: Bill Fischofer --- test/validation/queue/queue.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index c21897b..9af8c9c 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -11,7 +11,6 @@ #define MAX_BUFFER_QUEUE (8) #define MSG_POOL_SIZE (4 * 1024 * 1024) #define CONFIG_MAX_ITERATION (100) -#define MAX_QUEUES (64 * 1024) static int queue_context = 0xff; static odp_pool_t pool; @@ -55,7 +54,7 @@ void queue_test_capa(void) odp_queue_capability_t capa; odp_queue_param_t qparams; char name[ODP_QUEUE_NAME_LEN]; - odp_queue_t queue[MAX_QUEUES]; + odp_queue_t *queue; int num_queues, i; memset(&capa, 0, sizeof(odp_queue_capability_t)); @@ -71,10 +70,9 @@ void queue_test_capa(void) name[ODP_QUEUE_NAME_LEN - 1] = 0; - if (capa.max_queues > MAX_QUEUES) - num_queues = MAX_QUEUES; - else - num_queues = capa.max_queues; + num_queues = capa.max_queues; + queue = malloc(num_queues * sizeof(odp_queue_t)); + CU_ASSERT_FATAL(queue != NULL); odp_queue_param_init(&qparams); @@ -93,6 +91,8 @@ void queue_test_capa(void) for (i = 0; i < num_queues; i++) CU_ASSERT(odp_queue_destroy(queue[i]) == 0); + + free(queue); } void queue_test_mode(void)