From patchwork Wed Feb 3 00:10:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 61051 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1052640lbb; Tue, 2 Feb 2016 16:10:44 -0800 (PST) X-Received: by 10.140.242.16 with SMTP id n16mr28615171qhc.2.1454458244526; Tue, 02 Feb 2016 16:10:44 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e11si3365000qhe.88.2016.02.02.16.10.44; Tue, 02 Feb 2016 16:10:44 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D024861783; Wed, 3 Feb 2016 00:10:43 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=SKz+wy3n; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 E464661772; Wed, 3 Feb 2016 00:10:39 +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 5F25D61777; Wed, 3 Feb 2016 00:10:38 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by lists.linaro.org (Postfix) with ESMTPS id 51F57616DD for ; Wed, 3 Feb 2016 00:10:37 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id is5so7413940obc.0 for ; Tue, 02 Feb 2016 16:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=UzTC6UVIVEJ5Su3qMQIXa07W7LeHAykBArwIaejzaEI=; b=SKz+wy3nP2a466erO/RhGDstn2lbn5caSOcZbBpRigYZcwCi4kZ8tbrrBdkz0HqfBF IRBSiaVF2jBWbrpwc123D/kauRI7R4pCTaPqVsx0fxjM2AEaFsO7FE2TRwJtCgdBz3E4 +8KoHy78qfmhqrx0pv9OHEm28quesvJMU0qOQ= 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; bh=UzTC6UVIVEJ5Su3qMQIXa07W7LeHAykBArwIaejzaEI=; b=WogLNgi8/E7iNi1jlZ17v7s/00h5DCcURa3yHp6ASszSoJBA7xHQPyl2iBANeEJ+Oi 5D3A4dd1vaVmvbzEDlwS40GYnLhatqQAFh/Ao5qRx1fq/5u5DfSpZmAoGfkWab6HmI3G rWGrMmmM0rv0YhqVoTkJ7uDkLUuhmj8aHCyk0mvFf8WUJFMWyPMqhP+dDjM+cmGczSUL gqdJm5DYHLhHyznOzTDhtCcLMrUY+4OF30711/z6ABa9kkh9GWyXrR2odtHk7ODN+h4U bvEBd5Db8RP5FEYmZbb0gOIdNaFCMhXLp+JmP7l8bQhx1syivn1rD8w+6LZwXWAaLO75 JjPw== X-Gm-Message-State: AG10YOQ7SQ+WgD1ZXn1oxeMXG4Du8pbqL05fAUDLSGNYK9nXe3EcUkPU4snnl00aJcifqMkyGUo= X-Received: by 10.60.117.65 with SMTP id kc1mr27362623oeb.32.1454458236813; Tue, 02 Feb 2016 16:10:36 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id gp6sm2085567obb.19.2016.02.02.16.10.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 16:10:36 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 2 Feb 2016 18:10:31 -0600 Message-Id: <1454458231-15843-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] validation: pktio: add coverage for multi-queue pktio routines 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" Add coverage for the following new multi-queue pktio APIs: - odp_pktio_input_queue_param_init() - odp_pktio_output_queue_param_init() - odp_pktio_input_queues_config() - odp_pktio_output_queues_config() - odp_pktio_pktin_queues() - odp_pktio_pktout_queues() Signed-off-by: Bill Fischofer --- test/validation/pktio/pktio.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index e412910..21d58b2 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -294,6 +294,12 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode, { odp_pktio_t pktio; odp_pktio_param_t pktio_param; + odp_pktio_capability_t capa; + odp_pktio_input_queue_param_t in_queue_param; + odp_pktio_output_queue_param_t out_queue_param; + odp_bool_t single_rx = 1; + odp_bool_t single_tx = 1; + int rc; const char *iface = iface_name[iface_idx]; odp_pktio_param_init(&pktio_param); @@ -308,6 +314,30 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode, CU_ASSERT(odp_pktio_to_u64(pktio) != odp_pktio_to_u64(ODP_PKTIO_INVALID)); + rc = odp_pktio_capability(pktio, &capa); + CU_ASSERT(rc == 0); + CU_ASSERT(single_rx <= (int)capa.max_input_queues); + CU_ASSERT(single_tx <= (int)capa.max_output_queues); + + odp_pktio_input_queue_param_init(&in_queue_param); + odp_pktio_output_queue_param_init(&out_queue_param); + + if (imode == ODP_PKTIN_MODE_RECV || imode == ODP_PKTIN_MODE_POLL) { + in_queue_param.single_user = single_rx; + in_queue_param.num_queues = single_rx; + rc = odp_pktio_input_queues_config(pktio, &in_queue_param); + CU_ASSERT(rc == 0); + CU_ASSERT(odp_pktio_pktin_queues(pktio, NULL, single_rx + 1) + == single_rx); + + out_queue_param.single_user = single_tx; + out_queue_param.num_queues = single_tx; + rc = odp_pktio_output_queues_config(pktio, &out_queue_param); + CU_ASSERT(rc == 0); + CU_ASSERT(odp_pktio_pktout_queues(pktio, NULL, single_tx + 1) + == single_tx); + } + if (wait_for_network) odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);